Repository navigation
feat(import): ningen-shikkaku.lifecycle@v2 — import the structured --korg-sink - #27
Merged
Merged
Conversation
…korg-sink ningen-shikkaku's `dazai daemon` and `motokano` now write `ningen-korg-lifecycle@1` records (`--korg-sink`), built from closed enums and counters only. Import them directly instead of scraping `[dazai]` log lines: - profile `ningen-shikkaku.lifecycle@v2`: session_start / arm / read / wipe / kill / session_end, keyed by component + the producer's random per-run session id; covers motokano reads; no PIDs, tool names, lengths or digests (named as forbidden alongside v1's list). v1 stays for older daemons and the Python reference. - `ningen_sink_to_envelope`: fixed field-map projection (never copies an unlisted field), drops and counts torn/foreign lines, no value coercion (out-of-vocabulary values reject the whole envelope), source version from the records' producer stamp. - CLI `python -m korg_ledger envelope ningen-sink FILE`. - Spec: IMPORT.md §6, SPEC §11, examples incl. real 0.1.0 sink output that projects byte-for-byte onto the v2 example envelope; tests for projection, leak resistance, atomic rejection, versioning and the CLI round trip. Amp-Thread-ID: https://ampcode.com/threads/T-01a135b8-8f38-7394-9d5c-8ac8282f6295 Co-authored-by: aisle9angel@gmail.com <aisle9angel@gmail.com>
🛡️ ✅ Certificate verifiedIndependently verified — zero trust in the tool that produced it. ✅
|
| claim | CI demo: agent added a /healthz endpoint with a passing test |
| who (issuer) | c294765adf91ce96… |
| what | 5 events · Bash×1 Edit×1 Read×1 Write×1 user_prompt×1 |
| files | src/app.py, tests/test_health.py |
| integrity | chain ✓ · summary re-derived ✓ · seal ✓ |
Verified by the independent korg verifier. Re-check in a browser: seal.html.
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.
Why
ningen-shikkaku.lifecycle@v1(#25) imports dazai lifecycle events by regex-scraping[dazai]stderr lines. That silently loses events whenever log wording changes, it can't seemotokanoreads, and it carries PIDs.ningen-shikkaku now writes a structured lifecycle sink:
dazai daemon/motokano --korg-sink PATH, contractningen-korg-lifecycle@1. It emits one JSON line per session/arm/read/wipe/kill step, built only from closed enums and counters. This PR imports that sink through the existingkorg-import@v1door.What
ningen-shikkaku.lifecycle@v2. Kinds aresession_start,arm,read,wipe,killandsession_end, keyed bycomponentplus the producer's random per-runsessionid. It also allowlists anat_msfield.pid,name,tool_name,path,socket,length,len,size,hash,sha256anddigest.ningen_sink_to_envelope(lines, version=None).dropped.source.versioncomes from the records'args.producer, or must be passed explicitly if the records name more than one version.python -m korg_ledger envelope ningen-sink FILE.--source-versionis now optional for this source only.imports/ningen-shikkaku-sink.example.jsonlis real output from both binaries: an armed dazai hard panic, then a motokano run with a refused re-read.ningen-shikkaku-lifecycle-v2.example.json. There is also a.rejected.jsonexample.No hash rule, vector or other profile changes.
Verification
value,name,pid,cmd,stdout,len) are never copied;generate_vectors.pyshows no drift;conformance.pyandjs/conformance.mjsPASS.envelope ningen-sink→import→lintgives 12 events, chain intact, DAG well-formed, redaction-clean. The secret, tool names and command never appear in the envelope or the ledger.https://ampcode.com/threads/T-01a135b8-8f38-7394-9d5c-8ac8282f6295