Skip to content

CORE (signing sitting): verifyChain checks seq continuity (queued patch + rehearsal test) - #74

Merged
githubscum merged 1 commit into
mainfrom
lotor-lane/verifychain-seq-continuity
Oct 26, 2026
Merged

githubscum merged 1 commit into
mainfrom
lotor-lane/verifychain-seq-continuity

Conversation

@githubscum

Copy link
Copy Markdown
Owner

WO: WO-SEQ-CONTINUITY (lane run 54). First core item carried from the 2026-10-22 sitting (Isaac's ruling, POST-MERGE-EVAL-PLAN section 0): sequence continuity in verifyChain. Write-up: proposals/store-tail-append/PROPOSAL.md, section "Separate core item ... seq continuity" (Finding 2 of the second-family review of #72).

The hole. verifyChain checks hash, signature, genesis prevHash and prevHash linkage, never seq. An entry signed with a skipped, duplicated or non-integer seq verifies { ok: true }, and every reader that reports entry.seq as a receipt's position (receiptSeq, which the gate returns on every decision) is then off by an unknown amount. The hash covers seq, so the hole is write-time only.

What is here. No core file is edited. Core change is queued as a patch for the signing sitting:

  • proposals/verifychain-seq-continuity.patch: 11 added lines inside the verifyChain loop, after the signature check and before the prevHash check: Number.isSafeInteger(entry.seq) && entry.seq === i, else { ok: false, brokenAt: i, reason: 'seq discontinuity at entry i: expected i, got <seq>' }.
  • test/chain-seq-continuity.test.js: six cases (normal chain, skip, duplicate, string seq, genesis offset, precedence of the hash-mismatch check). Block 1 runs them against the live module, with the four seq cases todo until a landing tripwire (the reason string in the live source) flips them. Block 2 rehearses the landing: copies today's source into a temp dir (LF-normalized), git applys the patch there, asserts it is pure addition (original + 11 lines, every original line in order), imports the patched copy and runs all six cases, not todo.

Tested. npm test in a fresh clone of c69f552 with this branch: 1305 tests, 1301 pass, 0 fail, 4 todo (main alone: 1292/1292). The 4 todo are cases (b)-(e) on the live module: they fail there, which is the hole shown, and pass in block 2 against the patched copy. Orchestrator re-read both files after each executor pass.

Eval served. None of E1-E6 directly; this is R0/R1 integrity (the chain's numbering is part of the trace a witness holds).

Executor. glm-5.3-flash:cloud via dispatch-to-ollama, sessions 4, all glm-5.3-flash on the chain, receipt seqs 37791, 37812, 37837, 37854; FIX1-3 were line-ending, trailing-newline and enclosing-repo issues in the WO environment, plus one orchestrator touch: appended the patch's missing final newline by hand. Orchestrator verified by running the tests, re-reading both files, and probing the patched copy.

What a reviewer should doubt.

  1. Live chain scan not done. Before landing, scan the live chain for seq !== index. Any hit means this check turns a currently-verifying chain red; that is a finding to resolve first. The lane did not read the live log.
  2. verifyChain on a slice. The check assumes a full chain from genesis (as the genesis prevHash check already does). Any caller that verifies a window starting past 0 would now fail on seq as well as genesis; none found by grep (bin/export-chain.js, bin/hook-session-start.js, src/views, src/store).
  3. Block 2 shells out to git apply on a temp copy of a core file. It writes nothing under the repo, but it is the test suite applying a core patch, and a reviewer should decide whether that rehearsal belongs in npm test.
  4. Line endings. The patch is LF; an autocrlf checkout's source is CRLF. Block 2 normalizes. At the sitting, git show HEAD:<patch> | git apply in the live install meets the same question limit 77 named.

CORE: title marked for the signing sitting. Do not merge outside one.

🤖 Generated with Claude Code

…a patch

verifyChain checked hash, signature, genesis prevHash and prevHash linkage,
never seq, so an entry signed with a skipped, duplicated or non-integer seq
verified ok. The fix is core, so it is queued as
proposals/verifychain-seq-continuity.patch (11 added lines) with
test/chain-seq-continuity.test.js: the seq cases are todo on the live module
until the patch lands, and a rehearsal block applies the patch to a temp copy
and runs every case against it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@githubscum
githubscum merged commit 853111f into main Oct 26, 2026
githubscum added a commit that referenced this pull request Oct 26, 2026
…e under signature

Applied in the live install, each step signed by the owner:
- precondition: live chain 42,567 entries, seq continuous (scan signed, 13668b04).
- chain: verifyChain checks seq continuity (proposals/verifychain-seq-continuity,
  #74), signed 008521ce.
- gate and hooks: subagent tool calls carry agentId/agentType on gate receipts
  (proposals/agent-id-attribution, #73), signed 74885c4c.
- policy: matcher/3 folds CRLF so one commit has one stamp
  (proposals/l77-matcherhash-eol, #82, KNOWN-LIMITS 77), signed 7f124e65.
- tests: agent-id describe todo marker removed; seq and l77 tests detect the
  landing on their own.

Found during the sitting: KNOWN-LIMITS 82. The first apply, `git apply <patch>`,
rewrote src/chain/index.js with no gate stop and no receipt, because the
matcher reads paths from argv and the patch carries them in its bytes. It was
reverted under signature (34b2dca0) and every patch was re-applied with its
targets named via --include, which the matcher sees.

Pin re-stamp follows in its own commit; mechanical, not a re-verification of
every limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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