feat(core): add bounded system-record V1 contracts - #2103
Conversation
otReviewAgent
left a comment
There was a problem hiding this comment.
Operational Notice: Review Agent could not complete this review.
Business logic reviewer failed: WARNING: failed to clean up stale arg0 temp dirs: Permission denied (os error 13)
Merge-readiness review — 2026-08-06FindingsNo additional blocker or high-severity issue remains after review commit The four fresh findings were valid and are now addressed:
Architecture and riskThe PR still preserves its intended B1 boundary: the System Record V1 contract remains default-unused and subpath-only. No producer, protocol handler, materializer, scheduler, or node activation path is registered, so this round does not add runtime sync load. The changes tighten canonical state and verification boundaries without relaxing closure, cache, frame, inventory, or aggregate resource caps. Cold noninitial apply remains fail closed: summaries are factory-minted only after the complete digest-addressed authority chain passes real envelope verification. Tombstones now carry unambiguous empty projection/table identity, and quarantined state cannot absorb evidence from another stable record. Verification
AssessmentCode-review ready. I found no remaining production blocker in the current diff. Final merge readiness is pending the fresh GitHub CI run for |
Dedicated merge-readiness review — final local roundThis supersedes my earlier readiness note. A fresh independent audit found four HIGH issues in the prior remote head; all four are fixed in Findings addressed
The prior review fixes were rechecked as part of this pass: stable-key validation precedes quarantine short-circuits, tombstones use the canonical empty projection digest, cold rotated tombstone closure uses real signatures, and closed-record snapshot helpers are centralized. Residual risk / follow-up
Verification
Merge readinessCode-review ready. I found no remaining architectural, correctness, security, or resource-bound blocker in |
otReviewAgent
left a comment
There was a problem hiding this comment.
Operational Notice: Review Agent could not complete this review.
Business logic reviewer failed: WARNING: failed to clean up stale arg0 temp dirs: Permission denied (os error 13)
Final adversarial hardening roundCommit What changed
Independent verdicts
The only intentional integration obligation is that the later B2 loader honors and drains the supplied abort signal. Core cannot forcibly cancel arbitrary caller code, but late loader settlement cannot mutate traversal state. Verification
Merge readinessReady from local code review. The PR remains dormant/default-unused, so this round does not activate runtime sync or add node pressure. Final merge remains gated only on the fresh GitHub checks and any new remote review finding for |
otReviewAgent
left a comment
There was a problem hiding this comment.
Operational Notice: Review Agent could not complete this review.
Business logic reviewer failed: WARNING: failed to clean up stale arg0 temp dirs: Permission denied (os error 13)
Summary
agentsgraph replay with bounded, per-record synchronization in later stacks.@origintrail-official/dkg-core/system-record-v1; no producer, provider, requester, materializer, protocol handler, or activation path is registered in this PR.Related
testnet-canary.Diagrams
Dormant protocol verification flow
Before:
sequenceDiagram participant Caller as Future B2 caller participant Core as DKG core participant Resolver as Exact-object resolver participant Runtime as Default node runtime Caller->>Core: Request System Record V1 contract Core-->>Caller: Contract unavailable Note over Caller,Resolver: Canonical objects, closure limits, and authority proof are not implemented Note over Runtime: Existing agents graph behavior remains activeAfter:
sequenceDiagram participant Caller as Future B2 caller participant Core as DKG core participant Resolver as Exact-object resolver participant Runtime as Default node runtime Caller->>Core: Verify canonical signed head Core->>Resolver: Resolve digest-addressed bounded dependencies Resolver-->>Core: Exact canonical bytes Core-->>Caller: Bounded closure plus opaque authority summary Caller->>Core: Evaluate authority advance and applied-state limits Core-->>Caller: Typed accept, stale, quarantine, or reject Note over Runtime: No import, registration, storage mutation, or activation in B1Files changed
packages/core/src/system-record-limits-v1.tspackages/core/src/system-record-codec-primitives-v1.tspackages/core/src/system-record-objects-v1.tspackages/core/src/system-record-applied-state-v1.tspackages/core/src/system-record-inventory-v1.tspackages/core/src/system-record-wire-v1.tspackages/core/src/system-record-v1.tspackages/core/test/system-record-*.test.tspackages/core/test/fixtures/system-record-v1/docs/adr/0002-system-record-sync-v1.md.github/workflows/system-record-protocol.ymlpackages/core/test/system-record-package-export-v1.mjspackages/core/package.json,pnpm-lock.yamlTest plan
pnpm install --offline --frozen-lockfilepnpm --filter @origintrail-official/dkg-core buildpnpm --filter @origintrail-official/dkg-core test:system-record-exportpnpm --filter @origintrail-official/dkg-core test(1,655 core tests passed; dedicated protocol suite: 77 passed, 2 exhaustive tests intentionally skipped)pnpm --filter @origintrail-official/dkg-core test:system-record-exhaustive(2 maximum-boundary proofs passed)pnpm --filter @origintrail-official/dkg-core test:coverage(existing V8-instrumented 5-second timeout remains red; the samesync-control-objecttimeout reproduces on untouched base26c27a99…; this PR does not change that test or weaken its timeout)node packages/core/test/fixtures/system-record-v1/generate.mjs --checkpnpm test:issue-2052:system-records(25 passed)pnpm characterize:issue-2052:system-recordsgit diff --check