Skip to content

quilt_emit: vessel lifecycle events β†’ quilt 5-opcode WAL (first quilt-native fleet agent) - #1

Merged
SuperInstance merged 1 commit into
masterfrom
quilt-emitter
Sep 26, 2026
Merged

SuperInstance merged 1 commit into
masterfrom
quilt-emitter

Conversation

@SuperInstance

Copy link
Copy Markdown
Owner

Why

git-agent's vessel already produces structured lifecycle events (session start, worklog, task outcomes, career promotions, fences, skills, snapshots, heartbeats, session end) β€” but nothing turned them into durable, verifiable records. The fleet's quilt kernel (BIND/LINK/EFFECT/VIEW/TICK/FORGET) is the natural spine, and the org audit found the exact same gap shape everywhere: events exist, the WAL doesn't receive them, nothing checks them.

What

git_agent/quilt_emit.py β€” QuiltEmitter:

  • validate β†’ schema-checked at the boundary; invalid events raise QuiltValidationError with the precise field, never silently dropped, never crash the loop
  • map β†’ one vessel event β†’ one quilt opcode line (mapping table in the module docstring)
  • append β†’ fnv1a hash-chained JSONL WAL (default ~/.git-agent/quilt.jsonl)
  • replay/verify β†’ reducer state reconstructible from the WAL alone; verify() catches tampering (hash recompute), truncation (chain + seq), replay divergence
  • idempotent at-least-once ingest (same event_id twice β†’ one WAL entry)

git_agent/schemas/event.schema.json β€” canonical schema shipped with the producer (fleet doctrine: schemas belong with the producer, not the linter).

Fixtures are real captured payloads from a live VesselManager (tests/_capture_fixtures.py, kept for regeneration) β€” no invented shapes.

Verification

  • python3 -m pytest tests/test_quilt_emit.py -q β†’ 25 passed (FAIL-first: written against the absent module, watched them fail at import, built until green)
  • python3 -m pytest tests -q β†’ 259 passed (234 prior + 25 new), 4.14s β€” the existing suite untouched and green

Next (not in this PR)

Wiring the emitter into the agent runtime (one import + one ingest per lifecycle hook), then feeding tidepool/gauge real data instead of fixtures.

…t-native fleet agent)

git-agent's vessel already emits structured lifecycle events (session start,
worklog, task outcomes, career promotions, fences, skills, snapshots,
heartbeats, session end) but nothing turned them into durable, verifiable
records. This adds the missing translation + validation layer:

- git_agent/quilt_emit.py β€” QuiltEmitter: validate -> map -> append to an
  fnv1a hash-chained JSONL WAL (default ~/.git-agent/quilt.jsonl); replay()
  reconstructs reducer state from the WAL alone; verify() catches tampering
  (hash recompute), truncation (chain linkage + seq continuity), and
  replay divergence. Invalid events raise QuiltValidationError with the
  precise missing/invalid field β€” never silently dropped, never crash the
  ingest loop. Duplicate event_id delivery is idempotent (at-least-once
  ingest -> exactly-once WAL).
- git_agent/schemas/event.schema.json β€” canonical JSON Schema, shipped with
  the producer per fleet doctrine (schemas belong with the producer).
- tests/fixtures/*.json β€” REAL event payloads captured from a live
  VesselManager via tests/_capture_fixtures.py (kept for regeneration).
- tests/test_quilt_emit.py β€” 25 behavioral checks, FAIL-first.

Opcode mapping: session_start->BIND(identity), worklog->LINK, task_completion
/promotion/fence->EFFECT, skill->BIND(skills), snapshot->VIEW,
heartbeat->TICK, session_end->FORGET(archived).

Suite: 259 passed (234 prior + 25 new), 4.14s.
@SuperInstance
SuperInstance merged commit 6bc099a into master Sep 26, 2026
1 of 5 checks passed
@SuperInstance
SuperInstance deleted the quilt-emitter branch September 26, 2026 00:40
SuperInstance added a commit that referenced this pull request Sep 26, 2026
Grand Quilt P0.2+P0.3: Jev judgment gate + the captain's VIEW (stacked on #1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant