Conversation
…NG-608) Moves the producer onto the published typed contract: - internal/ledgeringest gains the typed v1 wire model and the mapper from exported store rows — the single legacy->v1 name authority on the CLI (renames, drops, closed-vocabulary guards, decided-row mirrors derived from the decision fact so they can never disagree). - Receipts are now created in the clean payload/proof shape: sections omit empty members, tool_call_id is the sole correlation field, the stored payload is the RFC 8785 (JCS) bytes the hash commits to, and unsigned receipts omit the signature on the wire. A payload_form column marks clean rows; local chain verification is unchanged. - Session lifecycle rows stay local: they no longer mint receipts and never reach the wire — session records carry open/close state. - Contract-form selection is deterministic per export page, never error-driven: any pre-cutover receipt or fact-less decided action pins its page to the legacy form, which is how pre-upgrade backlog (including rows written during a temporary downgrade) drains; pages of post-cutover rows ship v1, as do heartbeats. A 409 replay conflict on the v1 form is isolated like an oversized page instead of retrying the same bytes forever. - The transport test validates real flush bytes — decoded untyped, so a typed struct cannot hide a dropped field — against the pinned contract schema, proves session rows never leak, checks heartbeats, and covers the pre-cutover legacy drain. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Stacked on #447. Moves the daemon's producer onto the published ledger-ingest v1 contract — typed records, clean field names, JCS-hashed receipts — with a deterministic drain path for pre-upgrade backlog and no error-driven form fallback.
How
internal/ledgeringest): the single legacy→v1 name authority. Renames (canonical_event_type→event_type,decision_at→decided_at,*_jsonnames dropped,tool_use_id+tool_call_idcollapsed), removals (fields no producer populates), closed-vocabulary guards, and decided-row mirrors derived from the decision fact itself so the server's cross-checks can never disagree.payload_formcolumn (additive migration) marks clean rows. LocalVerifyReceiptschain verification is unchanged for old and new receipts alike.session.start/endrows no longer mint receipts and never reach the wire; session records carry open/close state, as the contract specifies.409replay conflict is isolated like an oversized page (shrink → skip) instead of retrying identical bytes forever.Tests
payload_form='legacy'ship on the legacy form with no hybrid markers.go test ./...green.Rollout
Ships only after the server accepts the v1 form in production (staging channel first). The legacy serializer stays for exactly one release to drain pre-upgrade rows; its removal is the follow-up PR.
🤖 Generated with Claude Code