Skip to content

feat(stores): run-scoped knowledge stores with lineage-chain reads, and the claim-evidence contract - #115

Merged
drewstone merged 1 commit into
mainfrom
feat/run-scoped-stores
Aug 6, 2026
Merged

feat(stores): run-scoped knowledge stores with lineage-chain reads, and the claim-evidence contract#115
drewstone merged 1 commit into
mainfrom
feat/run-scoped-stores

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

What

Two additive modules, no changes to existing surfaces:

  • run-scoped.ts — one knowledge store per run, isolated by construction, inheriting only through ancestry declared at init. Chain reads return every visible page labeled here / inherited:<runId> / shared, because "this run established it", "an earlier attempt believed it", and "the lab curates it" are three different provenance claims a reader must weigh differently. Lineage cycles fail loud; absent ancestry ends the chain quietly.
  • claim-evidence.ts — evidence rungs (1–5) as a first-class type; a record-time refusal of rung ≥4 claims that carry no re-executable check; and the calibrated verdict lattice verified / silent-check / contradicted / unrunnable / uncheckable as a pure function, so every grader shares one semantics while execution stays with the caller.

Why here

Grown in the discovery-lab campaign and recorded there (docs/15-adoption-decisions.md) as debt owed to this package — the lab's standing rule is that a capability its tools grow must migrate upstream rather than live as a local fork.

Each rule was paid for before it was written:

  • Two false "measured" claims crossed run boundaries through a shared store and became standing instructions in live agent profiles before anyone re-derived them. Isolation-with-labeled-inheritance is the countermeasure.
  • A run produced 28 true claims that scored zero because nothing carried a check a grader could re-execute; a sibling lab's cells once produced 6 false certifications in 17 deliveries with no agent lying. assertGradeableEvidence refuses the shape at record time.
  • The verdict lattice is calibrated, not designed: its naive predecessor graded three TRUE claims as refuted on first contact (silent asserts print nothing, so an expected-output match can never succeed), and could not tell a missing input file from a failed assertion. The tests encode exactly those cases.

Verification

  • pnpm lint clean, pnpm typecheck clean, pnpm build clean
  • 13 new tests: isolation, origin labeling, sibling non-inheritance, shared-store reads, absent-lineage termination, cycle refusal, and the four miscalibration cases

🤖 Generated with Claude Code

…nd the claim-evidence contract

Grown in a discovery campaign that learned each rule by paying for it, recorded
in that lab's docs/15-adoption-decisions.md as debt owed here.

run-scoped.ts: one store per run, isolated by construction, inheriting only by
ancestry declared at init. When every run writes one shared store, a false
'measured' claim from one arm becomes the next arm's settled provenance — the
motivating campaign shipped two such claims into live agent instructions before
anyone re-derived them. Chain reads label every page here / inherited:<runId> /
shared, because those are three different provenance claims a reader must weigh
differently. Lineage cycles fail loud; absent ancestry ends the chain.

claim-evidence.ts: evidence rungs as a first-class type, a record-time refusal
of rung>=4 claims that carry no re-executable check (a self-grade nobody can
dispute), and the calibrated verdict lattice — verified / silent-check /
contradicted / unrunnable / uncheckable. The lattice's distinctions each exist
because collapsing them blamed the wrong party on first contact with real
claims: a silent assert graded three TRUE results as refuted, and a missing
input file was indistinguishable from a failed assertion.

13 tests: isolation, origin labeling, sibling non-inheritance, shared-store
reads, absent-lineage termination, cycle refusal, and the four calibration
cases that were graded wrong before the lattice existed.

@tangletools tangletools left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved drewstone PR — 45669a41

This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.

tangletools · auto-approval · reason: drewstone_author · 2026-08-06T09:43:34Z

@drewstone
drewstone merged commit 4dbb1da into main Aug 6, 2026
2 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.

2 participants