Repository navigation
feat: Phase 1 — zero-config verifiable Claude Code capture (korg-ledger@v1) - #8
Merged
Merged
Conversation
…Claude Code capture
…n hook registration
…reservation (TDD)
…hon, and JS (lockstep)
…ant, and anchor path
…th (flat file is legacy)
Owner
Author
|
Update: Plan 6 landed on this branch — Phase 1 is now complete in this PR. The "Plan 6" item listed under Out of scope / follow-ups has been implemented and pushed:
Still genuinely out of scope (follow-up PRs): Plan 2b (JSONL-on-disk for the server-side |
3 tasks done
New1Direction
added a commit
that referenced
this pull request
Jun 22, 2026
Lands the stacked branch 'feat/phase1-unified-verifiable-capture' (PR #8) onto main.
New1Direction
added a commit
that referenced
this pull request
Oct 5, 2026
Bump the korg runtime crates from 0.1.0 to 0.2.0 (korg-bridge keeps its own bridge-v* line) and cut the [0.2.0] changelog section from Unreleased, filling in the merged work it was missing (#8-#22). Claude-Session: https://claude.ai/code/session_01QsuMoxNk88vZYnxPepuUKV Co-authored-by: Claude <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.
Summary
Makes Korg's core promise real for the data users actually generate: every Claude Code session is captured passively, cross-platform, into a tamper-evident
korg-ledger@v1chain that any third party can independently verify — turning the project from "a thing you set up" into "a thing that's just on."This implements Phase 1 of the "verifiable flight-recorder for AI agents" direction (design + plans under
docs/superpowers/). It unifies on the one verifiable ledger format, ships a zero-config capture hook, backfills history, and reserves the Phase-2 trust slots — all without breaking the frozen cross-language conformance vectors.What's included
adapters/korg-ledger-py/(new) — a stdlib-only, third independent conformant producer ofkorg-ledger@v1(alongside the Rust crate and JS verifier).LedgerWriterhash-chainsJournalEventJSONL with HLC ordering, a strictly-earlier causality gate, HMAC mode, resume-from-tip, and a concurrency-safe append (re-reads the chain tip under an exclusive lock so overlapping writers can't fork the chain).adapters/claude-code/) —make_canonical_emit+ akorg-hookdriver registered onPostToolUse/Stop/SubagentStop. It reuses the existing session parser, captures full richness (llm_inference, tokens, cache, tool results, the §2a causal spine) into a per-session verifiable ledger~/.korg/sessions/<id>.jsonl, and never raises / always exits 0.adapters/korg-setup/) —claude_settings.pyidempotently registers the hook in~/.claude/settings.json; the macOS-only launchd daemon is demoted to opt-in (--daemon).korg-backfillre-derives canonical per-session ledgers from every historical transcript (idempotent), plus a guarded migrator for the legacy flat~/.korg/claude-events.jsonl.event_sigis excluded from the hash preimage across all four implementations (Rust, two Python, JS); the RustJournalEventgains a wire-compatibleevent_sigfield; an additiveLedgerRewindvariant and the external-anchor path are reserved for Phase 2.Key design decisions
emitted_countcapture:PostToolUsefires after a tool's result lands, so re-parsing the transcript each firing captures results the buffered parser fills in by mutation (which incremental tail mode drops).Test plan
All verified locally before this PR:
cargo test -p korg-ledger -p korg-registrygreen, incl.conformance_vectors_reproduce_the_frozen_oracle(frozen vectors byte-identical with the new field) and theLedgerRewindserialization test.node spec/korg-ledger-v1/js/conformance.mjsPASS (incl. the newevent_sig excludedassertion).python3 spec/korg-ledger-v1/conformance.pyPASS.korg-hookstdin entry point and thekorg-backfillCLI both produce per-session ledgers verified clean by the independent spec oracle.Out of scope / follow-ups
CapabilityJournal(internal; off the user path; capture ledgers are already JSONL).recall-mcpat the per-session ledgers, add a cross-producer conformance CI gate, and the honest-docs pass.event_sig(per-event signing), external time-anchoring / transparency-log notarization, wirerewind()to appendLedgerRewind.🤖 Generated with Claude Code