Skip to content

Add portable read-only ledger inspection - #5

Merged
Zacharon merged 2 commits into
mainfrom
work/skills-adapter-conformance-20261113
Nov 17, 2026
Merged

Zacharon merged 2 commits into
mainfrom
work/skills-adapter-conformance-20261113

Conversation

@Zacharon

Copy link
Copy Markdown
Owner

Saved ledger evidence can now be inspected through one read-only CLI/API, with whole-chain and artifact-byte validation before projection. Raw lifecycle aliases remain visible, while operational mission states never grant kernel approval.

Tests no longer depend on a private machine path: self-contained synthetic checks run everywhere, and real-contract integration requires explicit trusted external selection. Fixture attributes preserve the exact hashed bytes on checkout.

Validation: final full unittest suite ran 169 tests, OK with 25 skips (24 pre-existing optional/runtime skips plus the unselected external integration class). With a trusted external contract selected locally, all 32 adapter tests passed (16 synthetic and 16 real-contract integration). Committed artifact hashes, privacy scan, diff whitespace check and WHY links passed.

Review status: prior independent H3 recheck was reported VERIFIED for the bounded adapter. The portability and checkout fixes in this draft still require review; application identity/grants remain partial, and owner acceptance is pending. No production, live ingestion, hosted, browser or device acceptance is claimed. Shared kernel unchanged; historical private evidence excluded.

Review map: work/skills-adapter-conformance-20261113 → origin/main

Generated by pr_map.py for dbd46cd4..380938ce (merge base → head). Areas, dependencies and risk flags are guesses from paths, imports and keywords. Use them to decide where to look, not as proof that something is safe.

What this change is for

Inspect saved local ledger evidence without changing review decisions or starting ingestion. Validate the whole chain and artifact bytes, preserve raw states, and separate portable synthetic tests from explicitly selected real-contract integration.

Commits:

  • Add portable read-only ledger projection and conformance checks (380938c)

At a glance

Files Lines changed Lines to review Generated or lock-file lines Areas Risk-flagged files Parts
12 +389 / −0 389 0 4 1 1

Start here

Read these first. They carry risk or many other changed files depend on them.

  1. runner/shared_contract.py — auth, used by 1 changed file
  2. docs/SHARED_CONTRACT_ADAPTER.md — used by 1 changed file
  3. tests/test_shared_contract.py — 182 changed lines
  4. tests/fixtures/shared_contract/synthetic_contract.py — 14 changed lines
  5. CONTEXT.md — 11 changed lines
  6. tests/fixtures/shared_contract/artifact_ledger.jsonl — 6 changed lines
  7. tests/fixtures/shared_contract/.gitattributes — 5 changed lines

Dependency graph

A solid arrow points from a file to a changed file it imports or explains itself with (WHY:); a dotted arrow is a Markdown link. Red boxes carry a risk flag.

flowchart LR
  subgraph g0["(root)"]
    n0["CONTEXT.md<br/>+11/−0"]
    n1["README.md<br/>+3/−0"]
  end
  subgraph g1["docs"]
    n2["SHARED_CONTRACT_ADAPTER.md<br/>+74/−0"]
  end
  subgraph g2["runner"]
    n3["shared_contract.py<br/>+90/−0"]
    n11["test_shared_contract.py<br/>+182/−0"]
  end
  subgraph g3["tests"]
    n4[".gitattributes<br/>+5/−0"]
    n5["artifact_ledger.jsonl<br/>+6/−0"]
    n6["eval_result.json<br/>+1/−0"]
    n7["memory_checkpoint.json<br/>+1/−0"]
    n8["review_packet.md<br/>+1/−0"]
    n9["run_state.json<br/>+1/−0"]
    n10["synthetic_contract.py<br/>+14/−0"]
  end
  n1 -.-> n2
  n3 --> n2
  n11 --> n3
  classDef risk fill:#fde2e1,stroke:#c0392b,color:#111
  class n3 risk
Loading

Areas

(root)

2 files · +14/−0

File Change +/− Depends on Used by Notes
CONTEXT.md added +11/−0 — — —
README.md modified +3/−0 SHARED_CONTRACT_ADAPTER.md (link) — —

docs

1 files · +74/−0

File Change +/− Depends on Used by Notes
docs/SHARED_CONTRACT_ADAPTER.md added +74/−0 — shared_contract.py —

runner

2 files · +272/−0

File Change +/− Depends on Used by Notes
runner/shared_contract.py added +90/−0 SHARED_CONTRACT_ADAPTER.md test_shared_contract.py auth (content: authorizes); why (line 19): docs/SHARED_CONTRACT_ADAPTER.md#trusted-code-boundary; why (line 35): docs/SHARED_CONTRACT_ADAPTER.md#validation-order
tests/test_shared_contract.py added +182/−0 shared_contract.py — —

tests

7 files · +29/−0

File Change +/− Depends on Used by Notes
tests/fixtures/shared_contract/.gitattributes added +5/−0 — — —
tests/fixtures/shared_contract/artifact_ledger.jsonl added +6/−0 — — —
tests/fixtures/shared_contract/eval_result.json added +1/−0 — — —
tests/fixtures/shared_contract/memory_checkpoint.json added +1/−0 — — —
tests/fixtures/shared_contract/review_packet.md added +1/−0 — — —
tests/fixtures/shared_contract/run_state.json added +1/−0 — — —
tests/fixtures/shared_contract/synthetic_contract.py added +14/−0 — — —

Explanations linked from code

2 WHY: link(s) in changed code; 0 broken.

Reviewer checklist

  • The change does what the intent above says, and nothing it says it leaves alone was touched.
  • Every risk-flagged file was read line by line: runner/shared_contract.py
  • Each WHY: link opens and still matches the code beside it.
  • Generated and lock-file changes match their manifest changes.
  • Tests cover the behavior change, not just the lines.

Created with gpt-6.1-sol in T3 Code through the Codex harness.

Zacharon and others added 2 commits November 16, 2026 05:45
The doc started with a triple-encoded UTF-8 BOM, so GitHub rendered the
first heading as mojibake text instead of a heading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Zacharon

Copy link
Copy Markdown
Owner Author

Independent review (Claude Opus 5.5, Finish Line run 2026-11-17).

Read the whole diff (12 files, +389). No blocking defect found.

Checked:

  • runner/shared_contract.py: whole hash chain is read and validated before any projection; file-backed record types require path and SHA256; every referenced file is resolved inside the root and rehashed; missing/unsupported lifecycle states fail closed; output rows are fresh dicts with the source record kept as a JSON string. CLI catches the expected error types and prints nothing to stdout on failure.
  • Tests: python -m unittest tests.test_shared_contract locally on Python 3.14: 16 tests, OK, 1 skip (the external-contract class, as documented). CI was green on 3.11, 3.12 and postgres.
  • Fixtures are synthetic; no private paths in the committed diff.

Fixed in ee15932: docs/SHARED_CONTRACT_ADAPTER.md started with a triple-encoded BOM (ï...#), so the first heading rendered as mojibake.

Non-blocking:

  • synthetic_contract.py starts with a UTF-8 BOM. Python accepts it; drop it next time the file is touched.
  • The adapter calls the private ArtifactLedger._resolve_project_path. Fine for now; a public helper would be cleaner.

Not merged: the project state reserves integration/owner acceptance of this candidate for the owner.

@Zacharon
Zacharon marked this pull request as ready for review November 17, 2026 09:50
@Zacharon
Zacharon merged commit 8e9a09b into main Nov 17, 2026
3 checks passed
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