test(runtime): pin the batch-row sink's disclose/withhold log coherence - #14684

Merged
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through
Sep 2, 2026
Merged

test(runtime): pin the batch-row sink's disclose/withhold log coherence#14684
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through

Conversation

@os-musk

Copy link
Copy Markdown
Collaborator

Part of #14403 — the residual half. Deliberately not a closing keyword: the triage seat asked for a measured verdict and reserved the grading, so the card stays open for it.

TL;DR — this is a measured zero-implementation result on the source, plus the pin the residual was waiting for

The card predicted a lost operator diagnostic in the batch-row sink. Measured on the real stack, there is none, for a reason that is itself worth pinning. So this PR changes no executable line: one comment block in protocol.ts recording the measurement, and one test file where a prose "KNOWN RESIDUAL" note becomes an assertion.

git diff is two files, and the protocol.ts half is comment-only — proven mechanically, every added line matches ^\+\s*\*:

$ git diff -U0 packages/metadata-protocol/src/protocol.ts | grep '^+' | grep -v '^+++' | grep -vE '^\+\s*\*'
(no output)

Step 1 — the hard gate, run before any edit

origin/main @ 2aa8456cf, worktree byte-pristine:

pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 \
src/batch-row-driver-text-real-driver.integration.test.ts \
src/seed-loader-driver-text-real-driver.integration.test.ts
Test Files 2 passed (2)
Tests 4 passed (4)
os-verify-lock: VERDICT command-exit 0

GREENmain is not broken today, priority:p2 stands, and card item 3 (retriage the sentence pins) is not triggered — both files already carry their RETRIAGED, not re-baselined blocks from PR #14405. Posted on the card as comment 5513980544 before the first edit.

Item 2 — both named sites already reach through, by two different mechanisms

sitereach-through?mechanism
seedFailureCause (seed-loader.ts:139-151)yeswalks the cause chain, prefers the deepest sentence ([#14095] docblock)
seedCauseLabel (seed-loader.ts)yesalready takes (err, printed) and compares the sentence about to be printed against the one the payload quoted
batch-row sink, withheld pathyespasses err whole to console.warn; util.inspect renders the [cause] chain (Node v22.22.2)
batch-row sink, disclosed pathn/areturns before the warn — and that is correct, see below

The triage read had seedCauseLabel as an open question; on this tree it is already the more advanced form, so nothing was owed there either.

⭐ The measured correction: the residual note in the pin file was half wrong

batch-row-driver-text-real-driver.integration.test.ts carried this on main:

with the row disclosed, the sink returns before its console.warn, so the warn fires ZERO times and the driver's own sentence — UNIQUE constraint failed: bd_note.email — reaches neither the response nor the console.

The zero-warn half is true. The "nor the console" half is false, and the counter-evidence comes out of that suite's own rig — captured during the step-1 run, with stack frames naming batch-row-driver-text-real-driver.integration.test.ts:136 and engine.ts:4572:

ERROR Insert operation failed {"object":"bd_note","error":{"message":
"UNIQUE constraint failed: bd_note.email [statement and bound values redacted]", ...}}

That is the engine's insert door taking the envelope's cause on purpose — e instanceof DuplicateRecordError ? e.cause : e (engine.ts:10198), the #14095 / #14390 remedy, already pinned in packages/objectql/src/driver-fault-redaction.test.ts where it asserts the failing column survives in the line. The diagnostic moved one hop; it was never deleted.

Why adding the log would have been the wrong fix, not merely a redundant one

Two independent reasons, either sufficient:

  1. It restates what the engine already logs, once per duplicate row — a 500-row batch with 100 duplicates would emit 100 extra warns for a condition already in the log.
  2. AGENTS.md's degradation rule refuses this site outright. A batch row is the third answer it names: "a failure handed to the CALLER is not a degradation at all … a batch whose contract IS a per-item outcome report … Do not bolt a logger.error onto such a site." The row reports success: false, code: DUPLICATE_RECORD, httpStatus: 409 and the producer's own sentence. The caller was told.

The sink's own log exists to record a withhold. Nothing was withheld here, so there is nothing for it to record.

What actually changed

packages/metadata-protocol/src/protocol.ts — comment only. A [#14403] section on clientFacingRowFailureText recording the measurement and marking the disclosed branch ⛔ do-not-log, so the next reader does not re-open this from the same inference the card made.

packages/runtime/src/batch-row-driver-text-real-driver.integration.test.ts — the residual note becomes a pin. A console.warn recorder is installed in rig() (⛔ recording, never muting — every call is forwarded to the real console.warn, so shard-log output is unchanged), and the sink's decision/log coherence is asserted in both directions on one rig:

  • deleteManyData (undeclared FK fault, withheld) → expect(sinkWarnings).toHaveLength(1) plus the driver's own FOREIGN KEY constraint failed inside it. This is the live control: without it a green zero in the sibling test could mean the recorder was never wired.
  • batchData create (declared 409, disclosed) → expect(sinkWarnings).toEqual([]).

Ablation — the new pin is proven to bite the exact change this PR argues against

Mutated clientFacingRowFailureText to log on the disclosed branch (the fix I am declining), rebuilt, ran, restored. Predicted direction: RED, and that is what happened.

== BEFORE: worktree=c7ce3813f… head=c7ce3813f… (worktree == HEAD before mutating)
== MUTATED: injected_hits=1 worktree=43f69cf48… (marker on disk, hash moved)
✓ dist/: marker present in 2 built files -- the ablation is live in the artifact the suite consumes
== ABLATED TEST RUN exit=1
× batchData create leaks neither the INSERT statement nor the values it carries
AssertionError: expected [ Array(1) ] to deeply equal []
== RESTORED: worktree=c7ce3813f… still_injected=0 (bytes back to the HEAD blob)
✓ tree: working tree clean against HEAD
✓ dist/: marker absent from all 24 built files

Both legs rebuilt @objectstack/metadata-protocol and both were proven through scripts/ablation-dist-preflight.mjs (present, then --absent) — the runtime suite resolves this package through exports to dist/, so an unrebuilt ablation would have stayed green and certified a vacuous assertion. Mutation was confirmed on disk by a hit count on the injected text plus a blob-hash move, never by the editor's exit code; the restore names HEAD explicitly rather than a bare git checkout --, which would have restored from the mutated index.

Verification

All on the final tree; the union below was run at HEAD = the commit this PR ships.

  • The two pinsTest Files 2 passed (2), Tests 4 passed (4), VERDICT command-exit 0.
  • @objectstack/metadata-protocol full suiteTest Files 156 passed | 2 skipped (158), Tests 2141 passed | 10 skipped (2151), VERDICT command-exit 0.
  • typecheck@objectstack/metadata-protocol and @objectstack/runtime, both clean.
  • ⚠️packages/runtime/tsconfig.json excludes its own test files, so that typecheck says nothing about the file I edited. Checked explicitly with a throwaway config (removed again; tree clean): tsc --noEmit exit 0, and --listFiles confirms the edited file was actually in the program (1 hit) rather than silently absent.
  • Gate family re-derived on the final tree with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands (change set taken by the script from the merge base, not from a hand-rolled diff): 29 commands, 26 measured green.
  • The other 3 exited 3, which each gate's own verdict text calls NOT MEASURED rather than a findingcheck-test-completeness.mjs ("there is no local log to hand it … ⛔ It is not a red"), check:dual-build-cjs-loads and check:type-check-debt (both "PREREQUISITE NOT MET", needing a full-repo build; their self-tests passed, and check:type-check-coverage printed OK). A full turbo run build was run to clear the prerequisite and both re-run; result recorded in the dispatch report.

Exit codes were captured before any pipe (cmd > log 2>&1; EXIT=$?), and every verdict above is quoted from the gate's own verdict line rather than read off a bare $?.

No contract moved

No accept set widens or narrows, no public entry gains or loses an export, no declared refusal changes shape, and no door's answer changes — only what one of them logs, and that not at all in this diff. Clause-② remains no. The four leak assertions this suite exists for (insert into, dup@example.com, UNIQUE constraint failed, SQLITE_CONSTRAINT) are untouched, byte for byte, and passing.

Changeset

Carrying skip-changeset instead of a changeset file, which is this workflow's own prescription for a PR that "declares no release of its own": the diff is one comment block and one test file, so nothing is published and a version bump would ship a release that changes nothing. The dispatch's default of patch was explicitly conditional on the measurement, and the measurement moved it.


🤖 Generated with Claude Code

https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68


Generated by Claude Code

WIP checkpoint before the verification round.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
@os-muskos-musk added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 2, 2026 — with Claude
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 9 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json bd4aa4e49c6ac11f1833576d8b98fc41584b6a5dpackageMentionDocs.

@os-muskClaude

Copy link
Copy Markdown
CollaboratorAuthor

Landing provenance (engine execution seat, session session_0112hMx9hjJ9BgB28X97DS68): flipped ready at 18:46Z and armed auto-merge (squash) at 18:46:43Z on head 99b509c80. The echo read method: MERGE; the queue build ref is the arming reading, not the echo.

  • Review: ACCEPT on the card, comment 5514600105. Clause-② no, self-read from the final diff and confirmed by this seat: no executable line changes anywhere in the PR, so no accept set, export or declared refusal can have moved. In-seat review is in order — the CONTRACT_REVIEW_TIER requirement binds Clause-② yes cards.
  • Governed-surface test re-run on the final two-path file list: 0 of 2 path(s) hit the register — ordinary queue landing. Re-derived rather than recalled.
  • Enqueue bar: all 37 check runs on 99b509c80 completed success or skipped, read with perPage: 50. Last standing was Test Core (1/6) (18:21:17Z → 18:39:44Z, 18 min) and Lint & Repo Gates (→ 18:38:33Z).
  • Verified by this seat against the tree rather than the report: the protocol.ts half is comment-only (every added line filtered against ^\+\s*\* leaves an empty set), and the four leak assertions the suite exists for survive — insert into 2, dup@example.com 4, UNIQUE constraint failed 2, SQLITE_CONSTRAINT 4.

Part of #14403, correctly — ⛔ not a closing keyword. The card stays open at MERGED: the dev shipped the measured half and reserved the grading for this seat, and Part-of PR must not also close its card is green on the head.

⚠️ Known exposure, stated in advance: the queue build runs the full suite, so this PR meets packages/cli/test/run-dev-unbuilt-workspace.e2e.test.ts — the flake tracked on #14648, which ejected #14629 at 17:45Z. If ejected, the disposition is fixed: ⛔ no re-queue while #14648 is open, ⛔ no weakening of that test, and the card goes to pm:blocked with an Unlock-action: line rather than being re-dispatched.

Owed by the seat at MERGED: verify by content on origin/main that protocol.ts carries the [#14403] do-not-log note and that the sink's coherence pin is present in both directions, then grade what remains on #14403 — the card is Part of, so pm:dispatched comes off only when the grading closes it.


Generated by Claude Code

@os-musk
os-musk added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 93d2d67Sep 2, 2026
39 checks passed
@os-musk
os-musk deleted the claude/issue-14403-seed-loader-cause-reach-through branch September 2, 2026 20:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gatetests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@os-musk@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

test(runtime): pin the batch-row sink's disclose/withhold log coherence - #14684

Merged
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through
Sep 2, 2026
Merged

test(runtime): pin the batch-row sink's disclose/withhold log coherence#14684
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through

Conversation

@os-musk

Copy link
Copy Markdown
Collaborator

Part of #14403 — the residual half. Deliberately not a closing keyword: the triage seat asked for a measured verdict and reserved the grading, so the card stays open for it.

TL;DR — this is a measured zero-implementation result on the source, plus the pin the residual was waiting for

The card predicted a lost operator diagnostic in the batch-row sink. Measured on the real stack, there is none, for a reason that is itself worth pinning. So this PR changes no executable line: one comment block in protocol.ts recording the measurement, and one test file where a prose "KNOWN RESIDUAL" note becomes an assertion.

git diff is two files, and the protocol.ts half is comment-only — proven mechanically, every added line matches ^\+\s*\*:

$ git diff -U0 packages/metadata-protocol/src/protocol.ts | grep '^+' | grep -v '^+++' | grep -vE '^\+\s*\*'
(no output)

Step 1 — the hard gate, run before any edit

origin/main @ 2aa8456cf, worktree byte-pristine:

pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 \
src/batch-row-driver-text-real-driver.integration.test.ts \
src/seed-loader-driver-text-real-driver.integration.test.ts
Test Files 2 passed (2)
Tests 4 passed (4)
os-verify-lock: VERDICT command-exit 0

GREENmain is not broken today, priority:p2 stands, and card item 3 (retriage the sentence pins) is not triggered — both files already carry their RETRIAGED, not re-baselined blocks from PR #14405. Posted on the card as comment 5513980544 before the first edit.

Item 2 — both named sites already reach through, by two different mechanisms

sitereach-through?mechanism
seedFailureCause (seed-loader.ts:139-151)yeswalks the cause chain, prefers the deepest sentence ([#14095] docblock)
seedCauseLabel (seed-loader.ts)yesalready takes (err, printed) and compares the sentence about to be printed against the one the payload quoted
batch-row sink, withheld pathyespasses err whole to console.warn; util.inspect renders the [cause] chain (Node v22.22.2)
batch-row sink, disclosed pathn/areturns before the warn — and that is correct, see below

The triage read had seedCauseLabel as an open question; on this tree it is already the more advanced form, so nothing was owed there either.

⭐ The measured correction: the residual note in the pin file was half wrong

batch-row-driver-text-real-driver.integration.test.ts carried this on main:

with the row disclosed, the sink returns before its console.warn, so the warn fires ZERO times and the driver's own sentence — UNIQUE constraint failed: bd_note.email — reaches neither the response nor the console.

The zero-warn half is true. The "nor the console" half is false, and the counter-evidence comes out of that suite's own rig — captured during the step-1 run, with stack frames naming batch-row-driver-text-real-driver.integration.test.ts:136 and engine.ts:4572:

ERROR Insert operation failed {"object":"bd_note","error":{"message":
"UNIQUE constraint failed: bd_note.email [statement and bound values redacted]", ...}}

That is the engine's insert door taking the envelope's cause on purpose — e instanceof DuplicateRecordError ? e.cause : e (engine.ts:10198), the #14095 / #14390 remedy, already pinned in packages/objectql/src/driver-fault-redaction.test.ts where it asserts the failing column survives in the line. The diagnostic moved one hop; it was never deleted.

Why adding the log would have been the wrong fix, not merely a redundant one

Two independent reasons, either sufficient:

  1. It restates what the engine already logs, once per duplicate row — a 500-row batch with 100 duplicates would emit 100 extra warns for a condition already in the log.
  2. AGENTS.md's degradation rule refuses this site outright. A batch row is the third answer it names: "a failure handed to the CALLER is not a degradation at all … a batch whose contract IS a per-item outcome report … Do not bolt a logger.error onto such a site." The row reports success: false, code: DUPLICATE_RECORD, httpStatus: 409 and the producer's own sentence. The caller was told.

The sink's own log exists to record a withhold. Nothing was withheld here, so there is nothing for it to record.

What actually changed

packages/metadata-protocol/src/protocol.ts — comment only. A [#14403] section on clientFacingRowFailureText recording the measurement and marking the disclosed branch ⛔ do-not-log, so the next reader does not re-open this from the same inference the card made.

packages/runtime/src/batch-row-driver-text-real-driver.integration.test.ts — the residual note becomes a pin. A console.warn recorder is installed in rig() (⛔ recording, never muting — every call is forwarded to the real console.warn, so shard-log output is unchanged), and the sink's decision/log coherence is asserted in both directions on one rig:

  • deleteManyData (undeclared FK fault, withheld) → expect(sinkWarnings).toHaveLength(1) plus the driver's own FOREIGN KEY constraint failed inside it. This is the live control: without it a green zero in the sibling test could mean the recorder was never wired.
  • batchData create (declared 409, disclosed) → expect(sinkWarnings).toEqual([]).

Ablation — the new pin is proven to bite the exact change this PR argues against

Mutated clientFacingRowFailureText to log on the disclosed branch (the fix I am declining), rebuilt, ran, restored. Predicted direction: RED, and that is what happened.

== BEFORE: worktree=c7ce3813f… head=c7ce3813f… (worktree == HEAD before mutating)
== MUTATED: injected_hits=1 worktree=43f69cf48… (marker on disk, hash moved)
✓ dist/: marker present in 2 built files -- the ablation is live in the artifact the suite consumes
== ABLATED TEST RUN exit=1
× batchData create leaks neither the INSERT statement nor the values it carries
AssertionError: expected [ Array(1) ] to deeply equal []
== RESTORED: worktree=c7ce3813f… still_injected=0 (bytes back to the HEAD blob)
✓ tree: working tree clean against HEAD
✓ dist/: marker absent from all 24 built files

Both legs rebuilt @objectstack/metadata-protocol and both were proven through scripts/ablation-dist-preflight.mjs (present, then --absent) — the runtime suite resolves this package through exports to dist/, so an unrebuilt ablation would have stayed green and certified a vacuous assertion. Mutation was confirmed on disk by a hit count on the injected text plus a blob-hash move, never by the editor's exit code; the restore names HEAD explicitly rather than a bare git checkout --, which would have restored from the mutated index.

Verification

All on the final tree; the union below was run at HEAD = the commit this PR ships.

  • The two pinsTest Files 2 passed (2), Tests 4 passed (4), VERDICT command-exit 0.
  • @objectstack/metadata-protocol full suiteTest Files 156 passed | 2 skipped (158), Tests 2141 passed | 10 skipped (2151), VERDICT command-exit 0.
  • typecheck@objectstack/metadata-protocol and @objectstack/runtime, both clean.
  • ⚠️packages/runtime/tsconfig.json excludes its own test files, so that typecheck says nothing about the file I edited. Checked explicitly with a throwaway config (removed again; tree clean): tsc --noEmit exit 0, and --listFiles confirms the edited file was actually in the program (1 hit) rather than silently absent.
  • Gate family re-derived on the final tree with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands (change set taken by the script from the merge base, not from a hand-rolled diff): 29 commands, 26 measured green.
  • The other 3 exited 3, which each gate's own verdict text calls NOT MEASURED rather than a findingcheck-test-completeness.mjs ("there is no local log to hand it … ⛔ It is not a red"), check:dual-build-cjs-loads and check:type-check-debt (both "PREREQUISITE NOT MET", needing a full-repo build; their self-tests passed, and check:type-check-coverage printed OK). A full turbo run build was run to clear the prerequisite and both re-run; result recorded in the dispatch report.

Exit codes were captured before any pipe (cmd > log 2>&1; EXIT=$?), and every verdict above is quoted from the gate's own verdict line rather than read off a bare $?.

No contract moved

No accept set widens or narrows, no public entry gains or loses an export, no declared refusal changes shape, and no door's answer changes — only what one of them logs, and that not at all in this diff. Clause-② remains no. The four leak assertions this suite exists for (insert into, dup@example.com, UNIQUE constraint failed, SQLITE_CONSTRAINT) are untouched, byte for byte, and passing.

Changeset

Carrying skip-changeset instead of a changeset file, which is this workflow's own prescription for a PR that "declares no release of its own": the diff is one comment block and one test file, so nothing is published and a version bump would ship a release that changes nothing. The dispatch's default of patch was explicitly conditional on the measurement, and the measurement moved it.


🤖 Generated with Claude Code

https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68


Generated by Claude Code

WIP checkpoint before the verification round.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
@os-muskos-musk added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 2, 2026 — with Claude
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 9 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json bd4aa4e49c6ac11f1833576d8b98fc41584b6a5dpackageMentionDocs.

@os-muskClaude

Copy link
Copy Markdown
CollaboratorAuthor

Landing provenance (engine execution seat, session session_0112hMx9hjJ9BgB28X97DS68): flipped ready at 18:46Z and armed auto-merge (squash) at 18:46:43Z on head 99b509c80. The echo read method: MERGE; the queue build ref is the arming reading, not the echo.

  • Review: ACCEPT on the card, comment 5514600105. Clause-② no, self-read from the final diff and confirmed by this seat: no executable line changes anywhere in the PR, so no accept set, export or declared refusal can have moved. In-seat review is in order — the CONTRACT_REVIEW_TIER requirement binds Clause-② yes cards.
  • Governed-surface test re-run on the final two-path file list: 0 of 2 path(s) hit the register — ordinary queue landing. Re-derived rather than recalled.
  • Enqueue bar: all 37 check runs on 99b509c80 completed success or skipped, read with perPage: 50. Last standing was Test Core (1/6) (18:21:17Z → 18:39:44Z, 18 min) and Lint & Repo Gates (→ 18:38:33Z).
  • Verified by this seat against the tree rather than the report: the protocol.ts half is comment-only (every added line filtered against ^\+\s*\* leaves an empty set), and the four leak assertions the suite exists for survive — insert into 2, dup@example.com 4, UNIQUE constraint failed 2, SQLITE_CONSTRAINT 4.

Part of #14403, correctly — ⛔ not a closing keyword. The card stays open at MERGED: the dev shipped the measured half and reserved the grading for this seat, and Part-of PR must not also close its card is green on the head.

⚠️ Known exposure, stated in advance: the queue build runs the full suite, so this PR meets packages/cli/test/run-dev-unbuilt-workspace.e2e.test.ts — the flake tracked on #14648, which ejected #14629 at 17:45Z. If ejected, the disposition is fixed: ⛔ no re-queue while #14648 is open, ⛔ no weakening of that test, and the card goes to pm:blocked with an Unlock-action: line rather than being re-dispatched.

Owed by the seat at MERGED: verify by content on origin/main that protocol.ts carries the [#14403] do-not-log note and that the sink's coherence pin is present in both directions, then grade what remains on #14403 — the card is Part of, so pm:dispatched comes off only when the grading closes it.


Generated by Claude Code

@os-musk
os-musk added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 93d2d67Sep 2, 2026
39 checks passed
@os-musk
os-musk deleted the claude/issue-14403-seed-loader-cause-reach-through branch September 2, 2026 20:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gatetests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@os-musk@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test(runtime): pin the batch-row sink's disclose/withhold log coherence - #14684

Merged
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through
Sep 2, 2026
Merged

test(runtime): pin the batch-row sink's disclose/withhold log coherence#14684
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through

Conversation

@os-musk

Copy link
Copy Markdown
Collaborator

Part of #14403 — the residual half. Deliberately not a closing keyword: the triage seat asked for a measured verdict and reserved the grading, so the card stays open for it.

TL;DR — this is a measured zero-implementation result on the source, plus the pin the residual was waiting for

The card predicted a lost operator diagnostic in the batch-row sink. Measured on the real stack, there is none, for a reason that is itself worth pinning. So this PR changes no executable line: one comment block in protocol.ts recording the measurement, and one test file where a prose "KNOWN RESIDUAL" note becomes an assertion.

git diff is two files, and the protocol.ts half is comment-only — proven mechanically, every added line matches ^\+\s*\*:

$ git diff -U0 packages/metadata-protocol/src/protocol.ts | grep '^+' | grep -v '^+++' | grep -vE '^\+\s*\*'
(no output)

Step 1 — the hard gate, run before any edit

origin/main @ 2aa8456cf, worktree byte-pristine:

pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 \
src/batch-row-driver-text-real-driver.integration.test.ts \
src/seed-loader-driver-text-real-driver.integration.test.ts
Test Files 2 passed (2)
Tests 4 passed (4)
os-verify-lock: VERDICT command-exit 0

GREENmain is not broken today, priority:p2 stands, and card item 3 (retriage the sentence pins) is not triggered — both files already carry their RETRIAGED, not re-baselined blocks from PR #14405. Posted on the card as comment 5513980544 before the first edit.

Item 2 — both named sites already reach through, by two different mechanisms

sitereach-through?mechanism
seedFailureCause (seed-loader.ts:139-151)yeswalks the cause chain, prefers the deepest sentence ([#14095] docblock)
seedCauseLabel (seed-loader.ts)yesalready takes (err, printed) and compares the sentence about to be printed against the one the payload quoted
batch-row sink, withheld pathyespasses err whole to console.warn; util.inspect renders the [cause] chain (Node v22.22.2)
batch-row sink, disclosed pathn/areturns before the warn — and that is correct, see below

The triage read had seedCauseLabel as an open question; on this tree it is already the more advanced form, so nothing was owed there either.

⭐ The measured correction: the residual note in the pin file was half wrong

batch-row-driver-text-real-driver.integration.test.ts carried this on main:

with the row disclosed, the sink returns before its console.warn, so the warn fires ZERO times and the driver's own sentence — UNIQUE constraint failed: bd_note.email — reaches neither the response nor the console.

The zero-warn half is true. The "nor the console" half is false, and the counter-evidence comes out of that suite's own rig — captured during the step-1 run, with stack frames naming batch-row-driver-text-real-driver.integration.test.ts:136 and engine.ts:4572:

ERROR Insert operation failed {"object":"bd_note","error":{"message":
"UNIQUE constraint failed: bd_note.email [statement and bound values redacted]", ...}}

That is the engine's insert door taking the envelope's cause on purpose — e instanceof DuplicateRecordError ? e.cause : e (engine.ts:10198), the #14095 / #14390 remedy, already pinned in packages/objectql/src/driver-fault-redaction.test.ts where it asserts the failing column survives in the line. The diagnostic moved one hop; it was never deleted.

Why adding the log would have been the wrong fix, not merely a redundant one

Two independent reasons, either sufficient:

  1. It restates what the engine already logs, once per duplicate row — a 500-row batch with 100 duplicates would emit 100 extra warns for a condition already in the log.
  2. AGENTS.md's degradation rule refuses this site outright. A batch row is the third answer it names: "a failure handed to the CALLER is not a degradation at all … a batch whose contract IS a per-item outcome report … Do not bolt a logger.error onto such a site." The row reports success: false, code: DUPLICATE_RECORD, httpStatus: 409 and the producer's own sentence. The caller was told.

The sink's own log exists to record a withhold. Nothing was withheld here, so there is nothing for it to record.

What actually changed

packages/metadata-protocol/src/protocol.ts — comment only. A [#14403] section on clientFacingRowFailureText recording the measurement and marking the disclosed branch ⛔ do-not-log, so the next reader does not re-open this from the same inference the card made.

packages/runtime/src/batch-row-driver-text-real-driver.integration.test.ts — the residual note becomes a pin. A console.warn recorder is installed in rig() (⛔ recording, never muting — every call is forwarded to the real console.warn, so shard-log output is unchanged), and the sink's decision/log coherence is asserted in both directions on one rig:

  • deleteManyData (undeclared FK fault, withheld) → expect(sinkWarnings).toHaveLength(1) plus the driver's own FOREIGN KEY constraint failed inside it. This is the live control: without it a green zero in the sibling test could mean the recorder was never wired.
  • batchData create (declared 409, disclosed) → expect(sinkWarnings).toEqual([]).

Ablation — the new pin is proven to bite the exact change this PR argues against

Mutated clientFacingRowFailureText to log on the disclosed branch (the fix I am declining), rebuilt, ran, restored. Predicted direction: RED, and that is what happened.

== BEFORE: worktree=c7ce3813f… head=c7ce3813f… (worktree == HEAD before mutating)
== MUTATED: injected_hits=1 worktree=43f69cf48… (marker on disk, hash moved)
✓ dist/: marker present in 2 built files -- the ablation is live in the artifact the suite consumes
== ABLATED TEST RUN exit=1
× batchData create leaks neither the INSERT statement nor the values it carries
AssertionError: expected [ Array(1) ] to deeply equal []
== RESTORED: worktree=c7ce3813f… still_injected=0 (bytes back to the HEAD blob)
✓ tree: working tree clean against HEAD
✓ dist/: marker absent from all 24 built files

Both legs rebuilt @objectstack/metadata-protocol and both were proven through scripts/ablation-dist-preflight.mjs (present, then --absent) — the runtime suite resolves this package through exports to dist/, so an unrebuilt ablation would have stayed green and certified a vacuous assertion. Mutation was confirmed on disk by a hit count on the injected text plus a blob-hash move, never by the editor's exit code; the restore names HEAD explicitly rather than a bare git checkout --, which would have restored from the mutated index.

Verification

All on the final tree; the union below was run at HEAD = the commit this PR ships.

  • The two pinsTest Files 2 passed (2), Tests 4 passed (4), VERDICT command-exit 0.
  • @objectstack/metadata-protocol full suiteTest Files 156 passed | 2 skipped (158), Tests 2141 passed | 10 skipped (2151), VERDICT command-exit 0.
  • typecheck@objectstack/metadata-protocol and @objectstack/runtime, both clean.
  • ⚠️packages/runtime/tsconfig.json excludes its own test files, so that typecheck says nothing about the file I edited. Checked explicitly with a throwaway config (removed again; tree clean): tsc --noEmit exit 0, and --listFiles confirms the edited file was actually in the program (1 hit) rather than silently absent.
  • Gate family re-derived on the final tree with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands (change set taken by the script from the merge base, not from a hand-rolled diff): 29 commands, 26 measured green.
  • The other 3 exited 3, which each gate's own verdict text calls NOT MEASURED rather than a findingcheck-test-completeness.mjs ("there is no local log to hand it … ⛔ It is not a red"), check:dual-build-cjs-loads and check:type-check-debt (both "PREREQUISITE NOT MET", needing a full-repo build; their self-tests passed, and check:type-check-coverage printed OK). A full turbo run build was run to clear the prerequisite and both re-run; result recorded in the dispatch report.

Exit codes were captured before any pipe (cmd > log 2>&1; EXIT=$?), and every verdict above is quoted from the gate's own verdict line rather than read off a bare $?.

No contract moved

No accept set widens or narrows, no public entry gains or loses an export, no declared refusal changes shape, and no door's answer changes — only what one of them logs, and that not at all in this diff. Clause-② remains no. The four leak assertions this suite exists for (insert into, dup@example.com, UNIQUE constraint failed, SQLITE_CONSTRAINT) are untouched, byte for byte, and passing.

Changeset

Carrying skip-changeset instead of a changeset file, which is this workflow's own prescription for a PR that "declares no release of its own": the diff is one comment block and one test file, so nothing is published and a version bump would ship a release that changes nothing. The dispatch's default of patch was explicitly conditional on the measurement, and the measurement moved it.


🤖 Generated with Claude Code

https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68


Generated by Claude Code

WIP checkpoint before the verification round.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
@os-muskos-musk added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 2, 2026 — with Claude
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 9 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json bd4aa4e49c6ac11f1833576d8b98fc41584b6a5dpackageMentionDocs.

@os-muskClaude

Copy link
Copy Markdown
CollaboratorAuthor

Landing provenance (engine execution seat, session session_0112hMx9hjJ9BgB28X97DS68): flipped ready at 18:46Z and armed auto-merge (squash) at 18:46:43Z on head 99b509c80. The echo read method: MERGE; the queue build ref is the arming reading, not the echo.

  • Review: ACCEPT on the card, comment 5514600105. Clause-② no, self-read from the final diff and confirmed by this seat: no executable line changes anywhere in the PR, so no accept set, export or declared refusal can have moved. In-seat review is in order — the CONTRACT_REVIEW_TIER requirement binds Clause-② yes cards.
  • Governed-surface test re-run on the final two-path file list: 0 of 2 path(s) hit the register — ordinary queue landing. Re-derived rather than recalled.
  • Enqueue bar: all 37 check runs on 99b509c80 completed success or skipped, read with perPage: 50. Last standing was Test Core (1/6) (18:21:17Z → 18:39:44Z, 18 min) and Lint & Repo Gates (→ 18:38:33Z).
  • Verified by this seat against the tree rather than the report: the protocol.ts half is comment-only (every added line filtered against ^\+\s*\* leaves an empty set), and the four leak assertions the suite exists for survive — insert into 2, dup@example.com 4, UNIQUE constraint failed 2, SQLITE_CONSTRAINT 4.

Part of #14403, correctly — ⛔ not a closing keyword. The card stays open at MERGED: the dev shipped the measured half and reserved the grading for this seat, and Part-of PR must not also close its card is green on the head.

⚠️ Known exposure, stated in advance: the queue build runs the full suite, so this PR meets packages/cli/test/run-dev-unbuilt-workspace.e2e.test.ts — the flake tracked on #14648, which ejected #14629 at 17:45Z. If ejected, the disposition is fixed: ⛔ no re-queue while #14648 is open, ⛔ no weakening of that test, and the card goes to pm:blocked with an Unlock-action: line rather than being re-dispatched.

Owed by the seat at MERGED: verify by content on origin/main that protocol.ts carries the [#14403] do-not-log note and that the sink's coherence pin is present in both directions, then grade what remains on #14403 — the card is Part of, so pm:dispatched comes off only when the grading closes it.


Generated by Claude Code

@os-musk
os-musk added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 93d2d67Sep 2, 2026
39 checks passed
@os-musk
os-musk deleted the claude/issue-14403-seed-loader-cause-reach-through branch September 2, 2026 20:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gatetests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@os-musk@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test(runtime): pin the batch-row sink's disclose/withhold log coherence - #14684

Merged
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through
Sep 2, 2026
Merged

test(runtime): pin the batch-row sink's disclose/withhold log coherence#14684
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through

Conversation

@os-musk

Copy link
Copy Markdown
Collaborator

Part of #14403 — the residual half. Deliberately not a closing keyword: the triage seat asked for a measured verdict and reserved the grading, so the card stays open for it.

TL;DR — this is a measured zero-implementation result on the source, plus the pin the residual was waiting for

The card predicted a lost operator diagnostic in the batch-row sink. Measured on the real stack, there is none, for a reason that is itself worth pinning. So this PR changes no executable line: one comment block in protocol.ts recording the measurement, and one test file where a prose "KNOWN RESIDUAL" note becomes an assertion.

git diff is two files, and the protocol.ts half is comment-only — proven mechanically, every added line matches ^\+\s*\*:

$ git diff -U0 packages/metadata-protocol/src/protocol.ts | grep '^+' | grep -v '^+++' | grep -vE '^\+\s*\*'
(no output)

Step 1 — the hard gate, run before any edit

origin/main @ 2aa8456cf, worktree byte-pristine:

pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 \
src/batch-row-driver-text-real-driver.integration.test.ts \
src/seed-loader-driver-text-real-driver.integration.test.ts
Test Files 2 passed (2)
Tests 4 passed (4)
os-verify-lock: VERDICT command-exit 0

GREENmain is not broken today, priority:p2 stands, and card item 3 (retriage the sentence pins) is not triggered — both files already carry their RETRIAGED, not re-baselined blocks from PR #14405. Posted on the card as comment 5513980544 before the first edit.

Item 2 — both named sites already reach through, by two different mechanisms

sitereach-through?mechanism
seedFailureCause (seed-loader.ts:139-151)yeswalks the cause chain, prefers the deepest sentence ([#14095] docblock)
seedCauseLabel (seed-loader.ts)yesalready takes (err, printed) and compares the sentence about to be printed against the one the payload quoted
batch-row sink, withheld pathyespasses err whole to console.warn; util.inspect renders the [cause] chain (Node v22.22.2)
batch-row sink, disclosed pathn/areturns before the warn — and that is correct, see below

The triage read had seedCauseLabel as an open question; on this tree it is already the more advanced form, so nothing was owed there either.

⭐ The measured correction: the residual note in the pin file was half wrong

batch-row-driver-text-real-driver.integration.test.ts carried this on main:

with the row disclosed, the sink returns before its console.warn, so the warn fires ZERO times and the driver's own sentence — UNIQUE constraint failed: bd_note.email — reaches neither the response nor the console.

The zero-warn half is true. The "nor the console" half is false, and the counter-evidence comes out of that suite's own rig — captured during the step-1 run, with stack frames naming batch-row-driver-text-real-driver.integration.test.ts:136 and engine.ts:4572:

ERROR Insert operation failed {"object":"bd_note","error":{"message":
"UNIQUE constraint failed: bd_note.email [statement and bound values redacted]", ...}}

That is the engine's insert door taking the envelope's cause on purpose — e instanceof DuplicateRecordError ? e.cause : e (engine.ts:10198), the #14095 / #14390 remedy, already pinned in packages/objectql/src/driver-fault-redaction.test.ts where it asserts the failing column survives in the line. The diagnostic moved one hop; it was never deleted.

Why adding the log would have been the wrong fix, not merely a redundant one

Two independent reasons, either sufficient:

  1. It restates what the engine already logs, once per duplicate row — a 500-row batch with 100 duplicates would emit 100 extra warns for a condition already in the log.
  2. AGENTS.md's degradation rule refuses this site outright. A batch row is the third answer it names: "a failure handed to the CALLER is not a degradation at all … a batch whose contract IS a per-item outcome report … Do not bolt a logger.error onto such a site." The row reports success: false, code: DUPLICATE_RECORD, httpStatus: 409 and the producer's own sentence. The caller was told.

The sink's own log exists to record a withhold. Nothing was withheld here, so there is nothing for it to record.

What actually changed

packages/metadata-protocol/src/protocol.ts — comment only. A [#14403] section on clientFacingRowFailureText recording the measurement and marking the disclosed branch ⛔ do-not-log, so the next reader does not re-open this from the same inference the card made.

packages/runtime/src/batch-row-driver-text-real-driver.integration.test.ts — the residual note becomes a pin. A console.warn recorder is installed in rig() (⛔ recording, never muting — every call is forwarded to the real console.warn, so shard-log output is unchanged), and the sink's decision/log coherence is asserted in both directions on one rig:

  • deleteManyData (undeclared FK fault, withheld) → expect(sinkWarnings).toHaveLength(1) plus the driver's own FOREIGN KEY constraint failed inside it. This is the live control: without it a green zero in the sibling test could mean the recorder was never wired.
  • batchData create (declared 409, disclosed) → expect(sinkWarnings).toEqual([]).

Ablation — the new pin is proven to bite the exact change this PR argues against

Mutated clientFacingRowFailureText to log on the disclosed branch (the fix I am declining), rebuilt, ran, restored. Predicted direction: RED, and that is what happened.

== BEFORE: worktree=c7ce3813f… head=c7ce3813f… (worktree == HEAD before mutating)
== MUTATED: injected_hits=1 worktree=43f69cf48… (marker on disk, hash moved)
✓ dist/: marker present in 2 built files -- the ablation is live in the artifact the suite consumes
== ABLATED TEST RUN exit=1
× batchData create leaks neither the INSERT statement nor the values it carries
AssertionError: expected [ Array(1) ] to deeply equal []
== RESTORED: worktree=c7ce3813f… still_injected=0 (bytes back to the HEAD blob)
✓ tree: working tree clean against HEAD
✓ dist/: marker absent from all 24 built files

Both legs rebuilt @objectstack/metadata-protocol and both were proven through scripts/ablation-dist-preflight.mjs (present, then --absent) — the runtime suite resolves this package through exports to dist/, so an unrebuilt ablation would have stayed green and certified a vacuous assertion. Mutation was confirmed on disk by a hit count on the injected text plus a blob-hash move, never by the editor's exit code; the restore names HEAD explicitly rather than a bare git checkout --, which would have restored from the mutated index.

Verification

All on the final tree; the union below was run at HEAD = the commit this PR ships.

  • The two pinsTest Files 2 passed (2), Tests 4 passed (4), VERDICT command-exit 0.
  • @objectstack/metadata-protocol full suiteTest Files 156 passed | 2 skipped (158), Tests 2141 passed | 10 skipped (2151), VERDICT command-exit 0.
  • typecheck@objectstack/metadata-protocol and @objectstack/runtime, both clean.
  • ⚠️packages/runtime/tsconfig.json excludes its own test files, so that typecheck says nothing about the file I edited. Checked explicitly with a throwaway config (removed again; tree clean): tsc --noEmit exit 0, and --listFiles confirms the edited file was actually in the program (1 hit) rather than silently absent.
  • Gate family re-derived on the final tree with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands (change set taken by the script from the merge base, not from a hand-rolled diff): 29 commands, 26 measured green.
  • The other 3 exited 3, which each gate's own verdict text calls NOT MEASURED rather than a findingcheck-test-completeness.mjs ("there is no local log to hand it … ⛔ It is not a red"), check:dual-build-cjs-loads and check:type-check-debt (both "PREREQUISITE NOT MET", needing a full-repo build; their self-tests passed, and check:type-check-coverage printed OK). A full turbo run build was run to clear the prerequisite and both re-run; result recorded in the dispatch report.

Exit codes were captured before any pipe (cmd > log 2>&1; EXIT=$?), and every verdict above is quoted from the gate's own verdict line rather than read off a bare $?.

No contract moved

No accept set widens or narrows, no public entry gains or loses an export, no declared refusal changes shape, and no door's answer changes — only what one of them logs, and that not at all in this diff. Clause-② remains no. The four leak assertions this suite exists for (insert into, dup@example.com, UNIQUE constraint failed, SQLITE_CONSTRAINT) are untouched, byte for byte, and passing.

Changeset

Carrying skip-changeset instead of a changeset file, which is this workflow's own prescription for a PR that "declares no release of its own": the diff is one comment block and one test file, so nothing is published and a version bump would ship a release that changes nothing. The dispatch's default of patch was explicitly conditional on the measurement, and the measurement moved it.


🤖 Generated with Claude Code

https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68


Generated by Claude Code

WIP checkpoint before the verification round.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
@os-muskos-musk added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 2, 2026 — with Claude
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 9 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json bd4aa4e49c6ac11f1833576d8b98fc41584b6a5dpackageMentionDocs.

@os-muskClaude

Copy link
Copy Markdown
CollaboratorAuthor

Landing provenance (engine execution seat, session session_0112hMx9hjJ9BgB28X97DS68): flipped ready at 18:46Z and armed auto-merge (squash) at 18:46:43Z on head 99b509c80. The echo read method: MERGE; the queue build ref is the arming reading, not the echo.

  • Review: ACCEPT on the card, comment 5514600105. Clause-② no, self-read from the final diff and confirmed by this seat: no executable line changes anywhere in the PR, so no accept set, export or declared refusal can have moved. In-seat review is in order — the CONTRACT_REVIEW_TIER requirement binds Clause-② yes cards.
  • Governed-surface test re-run on the final two-path file list: 0 of 2 path(s) hit the register — ordinary queue landing. Re-derived rather than recalled.
  • Enqueue bar: all 37 check runs on 99b509c80 completed success or skipped, read with perPage: 50. Last standing was Test Core (1/6) (18:21:17Z → 18:39:44Z, 18 min) and Lint & Repo Gates (→ 18:38:33Z).
  • Verified by this seat against the tree rather than the report: the protocol.ts half is comment-only (every added line filtered against ^\+\s*\* leaves an empty set), and the four leak assertions the suite exists for survive — insert into 2, dup@example.com 4, UNIQUE constraint failed 2, SQLITE_CONSTRAINT 4.

Part of #14403, correctly — ⛔ not a closing keyword. The card stays open at MERGED: the dev shipped the measured half and reserved the grading for this seat, and Part-of PR must not also close its card is green on the head.

⚠️ Known exposure, stated in advance: the queue build runs the full suite, so this PR meets packages/cli/test/run-dev-unbuilt-workspace.e2e.test.ts — the flake tracked on #14648, which ejected #14629 at 17:45Z. If ejected, the disposition is fixed: ⛔ no re-queue while #14648 is open, ⛔ no weakening of that test, and the card goes to pm:blocked with an Unlock-action: line rather than being re-dispatched.

Owed by the seat at MERGED: verify by content on origin/main that protocol.ts carries the [#14403] do-not-log note and that the sink's coherence pin is present in both directions, then grade what remains on #14403 — the card is Part of, so pm:dispatched comes off only when the grading closes it.


Generated by Claude Code

@os-musk
os-musk added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 93d2d67Sep 2, 2026
39 checks passed
@os-musk
os-musk deleted the claude/issue-14403-seed-loader-cause-reach-through branch September 2, 2026 20:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gatetests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@os-musk@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

test(runtime): pin the batch-row sink's disclose/withhold log coherence - #14684

Merged
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through
Sep 2, 2026
Merged

test(runtime): pin the batch-row sink's disclose/withhold log coherence#14684
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through

Conversation

@os-musk

Copy link
Copy Markdown
Collaborator

Part of #14403 — the residual half. Deliberately not a closing keyword: the triage seat asked for a measured verdict and reserved the grading, so the card stays open for it.

TL;DR — this is a measured zero-implementation result on the source, plus the pin the residual was waiting for

The card predicted a lost operator diagnostic in the batch-row sink. Measured on the real stack, there is none, for a reason that is itself worth pinning. So this PR changes no executable line: one comment block in protocol.ts recording the measurement, and one test file where a prose "KNOWN RESIDUAL" note becomes an assertion.

git diff is two files, and the protocol.ts half is comment-only — proven mechanically, every added line matches ^\+\s*\*:

$ git diff -U0 packages/metadata-protocol/src/protocol.ts | grep '^+' | grep -v '^+++' | grep -vE '^\+\s*\*'
(no output)

Step 1 — the hard gate, run before any edit

origin/main @ 2aa8456cf, worktree byte-pristine:

pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 \
src/batch-row-driver-text-real-driver.integration.test.ts \
src/seed-loader-driver-text-real-driver.integration.test.ts
Test Files 2 passed (2)
Tests 4 passed (4)
os-verify-lock: VERDICT command-exit 0

GREENmain is not broken today, priority:p2 stands, and card item 3 (retriage the sentence pins) is not triggered — both files already carry their RETRIAGED, not re-baselined blocks from PR #14405. Posted on the card as comment 5513980544 before the first edit.

Item 2 — both named sites already reach through, by two different mechanisms

sitereach-through?mechanism
seedFailureCause (seed-loader.ts:139-151)yeswalks the cause chain, prefers the deepest sentence ([#14095] docblock)
seedCauseLabel (seed-loader.ts)yesalready takes (err, printed) and compares the sentence about to be printed against the one the payload quoted
batch-row sink, withheld pathyespasses err whole to console.warn; util.inspect renders the [cause] chain (Node v22.22.2)
batch-row sink, disclosed pathn/areturns before the warn — and that is correct, see below

The triage read had seedCauseLabel as an open question; on this tree it is already the more advanced form, so nothing was owed there either.

⭐ The measured correction: the residual note in the pin file was half wrong

batch-row-driver-text-real-driver.integration.test.ts carried this on main:

with the row disclosed, the sink returns before its console.warn, so the warn fires ZERO times and the driver's own sentence — UNIQUE constraint failed: bd_note.email — reaches neither the response nor the console.

The zero-warn half is true. The "nor the console" half is false, and the counter-evidence comes out of that suite's own rig — captured during the step-1 run, with stack frames naming batch-row-driver-text-real-driver.integration.test.ts:136 and engine.ts:4572:

ERROR Insert operation failed {"object":"bd_note","error":{"message":
"UNIQUE constraint failed: bd_note.email [statement and bound values redacted]", ...}}

That is the engine's insert door taking the envelope's cause on purpose — e instanceof DuplicateRecordError ? e.cause : e (engine.ts:10198), the #14095 / #14390 remedy, already pinned in packages/objectql/src/driver-fault-redaction.test.ts where it asserts the failing column survives in the line. The diagnostic moved one hop; it was never deleted.

Why adding the log would have been the wrong fix, not merely a redundant one

Two independent reasons, either sufficient:

  1. It restates what the engine already logs, once per duplicate row — a 500-row batch with 100 duplicates would emit 100 extra warns for a condition already in the log.
  2. AGENTS.md's degradation rule refuses this site outright. A batch row is the third answer it names: "a failure handed to the CALLER is not a degradation at all … a batch whose contract IS a per-item outcome report … Do not bolt a logger.error onto such a site." The row reports success: false, code: DUPLICATE_RECORD, httpStatus: 409 and the producer's own sentence. The caller was told.

The sink's own log exists to record a withhold. Nothing was withheld here, so there is nothing for it to record.

What actually changed

packages/metadata-protocol/src/protocol.ts — comment only. A [#14403] section on clientFacingRowFailureText recording the measurement and marking the disclosed branch ⛔ do-not-log, so the next reader does not re-open this from the same inference the card made.

packages/runtime/src/batch-row-driver-text-real-driver.integration.test.ts — the residual note becomes a pin. A console.warn recorder is installed in rig() (⛔ recording, never muting — every call is forwarded to the real console.warn, so shard-log output is unchanged), and the sink's decision/log coherence is asserted in both directions on one rig:

  • deleteManyData (undeclared FK fault, withheld) → expect(sinkWarnings).toHaveLength(1) plus the driver's own FOREIGN KEY constraint failed inside it. This is the live control: without it a green zero in the sibling test could mean the recorder was never wired.
  • batchData create (declared 409, disclosed) → expect(sinkWarnings).toEqual([]).

Ablation — the new pin is proven to bite the exact change this PR argues against

Mutated clientFacingRowFailureText to log on the disclosed branch (the fix I am declining), rebuilt, ran, restored. Predicted direction: RED, and that is what happened.

== BEFORE: worktree=c7ce3813f… head=c7ce3813f… (worktree == HEAD before mutating)
== MUTATED: injected_hits=1 worktree=43f69cf48… (marker on disk, hash moved)
✓ dist/: marker present in 2 built files -- the ablation is live in the artifact the suite consumes
== ABLATED TEST RUN exit=1
× batchData create leaks neither the INSERT statement nor the values it carries
AssertionError: expected [ Array(1) ] to deeply equal []
== RESTORED: worktree=c7ce3813f… still_injected=0 (bytes back to the HEAD blob)
✓ tree: working tree clean against HEAD
✓ dist/: marker absent from all 24 built files

Both legs rebuilt @objectstack/metadata-protocol and both were proven through scripts/ablation-dist-preflight.mjs (present, then --absent) — the runtime suite resolves this package through exports to dist/, so an unrebuilt ablation would have stayed green and certified a vacuous assertion. Mutation was confirmed on disk by a hit count on the injected text plus a blob-hash move, never by the editor's exit code; the restore names HEAD explicitly rather than a bare git checkout --, which would have restored from the mutated index.

Verification

All on the final tree; the union below was run at HEAD = the commit this PR ships.

  • The two pinsTest Files 2 passed (2), Tests 4 passed (4), VERDICT command-exit 0.
  • @objectstack/metadata-protocol full suiteTest Files 156 passed | 2 skipped (158), Tests 2141 passed | 10 skipped (2151), VERDICT command-exit 0.
  • typecheck@objectstack/metadata-protocol and @objectstack/runtime, both clean.
  • ⚠️packages/runtime/tsconfig.json excludes its own test files, so that typecheck says nothing about the file I edited. Checked explicitly with a throwaway config (removed again; tree clean): tsc --noEmit exit 0, and --listFiles confirms the edited file was actually in the program (1 hit) rather than silently absent.
  • Gate family re-derived on the final tree with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands (change set taken by the script from the merge base, not from a hand-rolled diff): 29 commands, 26 measured green.
  • The other 3 exited 3, which each gate's own verdict text calls NOT MEASURED rather than a findingcheck-test-completeness.mjs ("there is no local log to hand it … ⛔ It is not a red"), check:dual-build-cjs-loads and check:type-check-debt (both "PREREQUISITE NOT MET", needing a full-repo build; their self-tests passed, and check:type-check-coverage printed OK). A full turbo run build was run to clear the prerequisite and both re-run; result recorded in the dispatch report.

Exit codes were captured before any pipe (cmd > log 2>&1; EXIT=$?), and every verdict above is quoted from the gate's own verdict line rather than read off a bare $?.

No contract moved

No accept set widens or narrows, no public entry gains or loses an export, no declared refusal changes shape, and no door's answer changes — only what one of them logs, and that not at all in this diff. Clause-② remains no. The four leak assertions this suite exists for (insert into, dup@example.com, UNIQUE constraint failed, SQLITE_CONSTRAINT) are untouched, byte for byte, and passing.

Changeset

Carrying skip-changeset instead of a changeset file, which is this workflow's own prescription for a PR that "declares no release of its own": the diff is one comment block and one test file, so nothing is published and a version bump would ship a release that changes nothing. The dispatch's default of patch was explicitly conditional on the measurement, and the measurement moved it.


🤖 Generated with Claude Code

https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68


Generated by Claude Code

WIP checkpoint before the verification round.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
@os-muskos-musk added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 2, 2026 — with Claude
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 9 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json bd4aa4e49c6ac11f1833576d8b98fc41584b6a5dpackageMentionDocs.

@os-muskClaude

Copy link
Copy Markdown
CollaboratorAuthor

Landing provenance (engine execution seat, session session_0112hMx9hjJ9BgB28X97DS68): flipped ready at 18:46Z and armed auto-merge (squash) at 18:46:43Z on head 99b509c80. The echo read method: MERGE; the queue build ref is the arming reading, not the echo.

  • Review: ACCEPT on the card, comment 5514600105. Clause-② no, self-read from the final diff and confirmed by this seat: no executable line changes anywhere in the PR, so no accept set, export or declared refusal can have moved. In-seat review is in order — the CONTRACT_REVIEW_TIER requirement binds Clause-② yes cards.
  • Governed-surface test re-run on the final two-path file list: 0 of 2 path(s) hit the register — ordinary queue landing. Re-derived rather than recalled.
  • Enqueue bar: all 37 check runs on 99b509c80 completed success or skipped, read with perPage: 50. Last standing was Test Core (1/6) (18:21:17Z → 18:39:44Z, 18 min) and Lint & Repo Gates (→ 18:38:33Z).
  • Verified by this seat against the tree rather than the report: the protocol.ts half is comment-only (every added line filtered against ^\+\s*\* leaves an empty set), and the four leak assertions the suite exists for survive — insert into 2, dup@example.com 4, UNIQUE constraint failed 2, SQLITE_CONSTRAINT 4.

Part of #14403, correctly — ⛔ not a closing keyword. The card stays open at MERGED: the dev shipped the measured half and reserved the grading for this seat, and Part-of PR must not also close its card is green on the head.

⚠️ Known exposure, stated in advance: the queue build runs the full suite, so this PR meets packages/cli/test/run-dev-unbuilt-workspace.e2e.test.ts — the flake tracked on #14648, which ejected #14629 at 17:45Z. If ejected, the disposition is fixed: ⛔ no re-queue while #14648 is open, ⛔ no weakening of that test, and the card goes to pm:blocked with an Unlock-action: line rather than being re-dispatched.

Owed by the seat at MERGED: verify by content on origin/main that protocol.ts carries the [#14403] do-not-log note and that the sink's coherence pin is present in both directions, then grade what remains on #14403 — the card is Part of, so pm:dispatched comes off only when the grading closes it.


Generated by Claude Code

@os-musk
os-musk added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 93d2d67Sep 2, 2026
39 checks passed
@os-musk
os-musk deleted the claude/issue-14403-seed-loader-cause-reach-through branch September 2, 2026 20:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gatetests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@os-musk@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test(runtime): pin the batch-row sink's disclose/withhold log coherence - #14684

Merged
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through
Sep 2, 2026
Merged

test(runtime): pin the batch-row sink's disclose/withhold log coherence#14684
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through

Conversation

@os-musk

Copy link
Copy Markdown
Collaborator

Part of #14403 — the residual half. Deliberately not a closing keyword: the triage seat asked for a measured verdict and reserved the grading, so the card stays open for it.

TL;DR — this is a measured zero-implementation result on the source, plus the pin the residual was waiting for

The card predicted a lost operator diagnostic in the batch-row sink. Measured on the real stack, there is none, for a reason that is itself worth pinning. So this PR changes no executable line: one comment block in protocol.ts recording the measurement, and one test file where a prose "KNOWN RESIDUAL" note becomes an assertion.

git diff is two files, and the protocol.ts half is comment-only — proven mechanically, every added line matches ^\+\s*\*:

$ git diff -U0 packages/metadata-protocol/src/protocol.ts | grep '^+' | grep -v '^+++' | grep -vE '^\+\s*\*'
(no output)

Step 1 — the hard gate, run before any edit

origin/main @ 2aa8456cf, worktree byte-pristine:

pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 \
src/batch-row-driver-text-real-driver.integration.test.ts \
src/seed-loader-driver-text-real-driver.integration.test.ts
Test Files 2 passed (2)
Tests 4 passed (4)
os-verify-lock: VERDICT command-exit 0

GREENmain is not broken today, priority:p2 stands, and card item 3 (retriage the sentence pins) is not triggered — both files already carry their RETRIAGED, not re-baselined blocks from PR #14405. Posted on the card as comment 5513980544 before the first edit.

Item 2 — both named sites already reach through, by two different mechanisms

sitereach-through?mechanism
seedFailureCause (seed-loader.ts:139-151)yeswalks the cause chain, prefers the deepest sentence ([#14095] docblock)
seedCauseLabel (seed-loader.ts)yesalready takes (err, printed) and compares the sentence about to be printed against the one the payload quoted
batch-row sink, withheld pathyespasses err whole to console.warn; util.inspect renders the [cause] chain (Node v22.22.2)
batch-row sink, disclosed pathn/areturns before the warn — and that is correct, see below

The triage read had seedCauseLabel as an open question; on this tree it is already the more advanced form, so nothing was owed there either.

⭐ The measured correction: the residual note in the pin file was half wrong

batch-row-driver-text-real-driver.integration.test.ts carried this on main:

with the row disclosed, the sink returns before its console.warn, so the warn fires ZERO times and the driver's own sentence — UNIQUE constraint failed: bd_note.email — reaches neither the response nor the console.

The zero-warn half is true. The "nor the console" half is false, and the counter-evidence comes out of that suite's own rig — captured during the step-1 run, with stack frames naming batch-row-driver-text-real-driver.integration.test.ts:136 and engine.ts:4572:

ERROR Insert operation failed {"object":"bd_note","error":{"message":
"UNIQUE constraint failed: bd_note.email [statement and bound values redacted]", ...}}

That is the engine's insert door taking the envelope's cause on purpose — e instanceof DuplicateRecordError ? e.cause : e (engine.ts:10198), the #14095 / #14390 remedy, already pinned in packages/objectql/src/driver-fault-redaction.test.ts where it asserts the failing column survives in the line. The diagnostic moved one hop; it was never deleted.

Why adding the log would have been the wrong fix, not merely a redundant one

Two independent reasons, either sufficient:

  1. It restates what the engine already logs, once per duplicate row — a 500-row batch with 100 duplicates would emit 100 extra warns for a condition already in the log.
  2. AGENTS.md's degradation rule refuses this site outright. A batch row is the third answer it names: "a failure handed to the CALLER is not a degradation at all … a batch whose contract IS a per-item outcome report … Do not bolt a logger.error onto such a site." The row reports success: false, code: DUPLICATE_RECORD, httpStatus: 409 and the producer's own sentence. The caller was told.

The sink's own log exists to record a withhold. Nothing was withheld here, so there is nothing for it to record.

What actually changed

packages/metadata-protocol/src/protocol.ts — comment only. A [#14403] section on clientFacingRowFailureText recording the measurement and marking the disclosed branch ⛔ do-not-log, so the next reader does not re-open this from the same inference the card made.

packages/runtime/src/batch-row-driver-text-real-driver.integration.test.ts — the residual note becomes a pin. A console.warn recorder is installed in rig() (⛔ recording, never muting — every call is forwarded to the real console.warn, so shard-log output is unchanged), and the sink's decision/log coherence is asserted in both directions on one rig:

  • deleteManyData (undeclared FK fault, withheld) → expect(sinkWarnings).toHaveLength(1) plus the driver's own FOREIGN KEY constraint failed inside it. This is the live control: without it a green zero in the sibling test could mean the recorder was never wired.
  • batchData create (declared 409, disclosed) → expect(sinkWarnings).toEqual([]).

Ablation — the new pin is proven to bite the exact change this PR argues against

Mutated clientFacingRowFailureText to log on the disclosed branch (the fix I am declining), rebuilt, ran, restored. Predicted direction: RED, and that is what happened.

== BEFORE: worktree=c7ce3813f… head=c7ce3813f… (worktree == HEAD before mutating)
== MUTATED: injected_hits=1 worktree=43f69cf48… (marker on disk, hash moved)
✓ dist/: marker present in 2 built files -- the ablation is live in the artifact the suite consumes
== ABLATED TEST RUN exit=1
× batchData create leaks neither the INSERT statement nor the values it carries
AssertionError: expected [ Array(1) ] to deeply equal []
== RESTORED: worktree=c7ce3813f… still_injected=0 (bytes back to the HEAD blob)
✓ tree: working tree clean against HEAD
✓ dist/: marker absent from all 24 built files

Both legs rebuilt @objectstack/metadata-protocol and both were proven through scripts/ablation-dist-preflight.mjs (present, then --absent) — the runtime suite resolves this package through exports to dist/, so an unrebuilt ablation would have stayed green and certified a vacuous assertion. Mutation was confirmed on disk by a hit count on the injected text plus a blob-hash move, never by the editor's exit code; the restore names HEAD explicitly rather than a bare git checkout --, which would have restored from the mutated index.

Verification

All on the final tree; the union below was run at HEAD = the commit this PR ships.

  • The two pinsTest Files 2 passed (2), Tests 4 passed (4), VERDICT command-exit 0.
  • @objectstack/metadata-protocol full suiteTest Files 156 passed | 2 skipped (158), Tests 2141 passed | 10 skipped (2151), VERDICT command-exit 0.
  • typecheck@objectstack/metadata-protocol and @objectstack/runtime, both clean.
  • ⚠️packages/runtime/tsconfig.json excludes its own test files, so that typecheck says nothing about the file I edited. Checked explicitly with a throwaway config (removed again; tree clean): tsc --noEmit exit 0, and --listFiles confirms the edited file was actually in the program (1 hit) rather than silently absent.
  • Gate family re-derived on the final tree with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands (change set taken by the script from the merge base, not from a hand-rolled diff): 29 commands, 26 measured green.
  • The other 3 exited 3, which each gate's own verdict text calls NOT MEASURED rather than a findingcheck-test-completeness.mjs ("there is no local log to hand it … ⛔ It is not a red"), check:dual-build-cjs-loads and check:type-check-debt (both "PREREQUISITE NOT MET", needing a full-repo build; their self-tests passed, and check:type-check-coverage printed OK). A full turbo run build was run to clear the prerequisite and both re-run; result recorded in the dispatch report.

Exit codes were captured before any pipe (cmd > log 2>&1; EXIT=$?), and every verdict above is quoted from the gate's own verdict line rather than read off a bare $?.

No contract moved

No accept set widens or narrows, no public entry gains or loses an export, no declared refusal changes shape, and no door's answer changes — only what one of them logs, and that not at all in this diff. Clause-② remains no. The four leak assertions this suite exists for (insert into, dup@example.com, UNIQUE constraint failed, SQLITE_CONSTRAINT) are untouched, byte for byte, and passing.

Changeset

Carrying skip-changeset instead of a changeset file, which is this workflow's own prescription for a PR that "declares no release of its own": the diff is one comment block and one test file, so nothing is published and a version bump would ship a release that changes nothing. The dispatch's default of patch was explicitly conditional on the measurement, and the measurement moved it.


🤖 Generated with Claude Code

https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68


Generated by Claude Code

WIP checkpoint before the verification round.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
@os-muskos-musk added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 2, 2026 — with Claude
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 9 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json bd4aa4e49c6ac11f1833576d8b98fc41584b6a5dpackageMentionDocs.

@os-muskClaude

Copy link
Copy Markdown
CollaboratorAuthor

Landing provenance (engine execution seat, session session_0112hMx9hjJ9BgB28X97DS68): flipped ready at 18:46Z and armed auto-merge (squash) at 18:46:43Z on head 99b509c80. The echo read method: MERGE; the queue build ref is the arming reading, not the echo.

  • Review: ACCEPT on the card, comment 5514600105. Clause-② no, self-read from the final diff and confirmed by this seat: no executable line changes anywhere in the PR, so no accept set, export or declared refusal can have moved. In-seat review is in order — the CONTRACT_REVIEW_TIER requirement binds Clause-② yes cards.
  • Governed-surface test re-run on the final two-path file list: 0 of 2 path(s) hit the register — ordinary queue landing. Re-derived rather than recalled.
  • Enqueue bar: all 37 check runs on 99b509c80 completed success or skipped, read with perPage: 50. Last standing was Test Core (1/6) (18:21:17Z → 18:39:44Z, 18 min) and Lint & Repo Gates (→ 18:38:33Z).
  • Verified by this seat against the tree rather than the report: the protocol.ts half is comment-only (every added line filtered against ^\+\s*\* leaves an empty set), and the four leak assertions the suite exists for survive — insert into 2, dup@example.com 4, UNIQUE constraint failed 2, SQLITE_CONSTRAINT 4.

Part of #14403, correctly — ⛔ not a closing keyword. The card stays open at MERGED: the dev shipped the measured half and reserved the grading for this seat, and Part-of PR must not also close its card is green on the head.

⚠️ Known exposure, stated in advance: the queue build runs the full suite, so this PR meets packages/cli/test/run-dev-unbuilt-workspace.e2e.test.ts — the flake tracked on #14648, which ejected #14629 at 17:45Z. If ejected, the disposition is fixed: ⛔ no re-queue while #14648 is open, ⛔ no weakening of that test, and the card goes to pm:blocked with an Unlock-action: line rather than being re-dispatched.

Owed by the seat at MERGED: verify by content on origin/main that protocol.ts carries the [#14403] do-not-log note and that the sink's coherence pin is present in both directions, then grade what remains on #14403 — the card is Part of, so pm:dispatched comes off only when the grading closes it.


Generated by Claude Code

@os-musk
os-musk added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 93d2d67Sep 2, 2026
39 checks passed
@os-musk
os-musk deleted the claude/issue-14403-seed-loader-cause-reach-through branch September 2, 2026 20:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gatetests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@os-musk@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test(runtime): pin the batch-row sink's disclose/withhold log coherence - #14684

Merged
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through
Sep 2, 2026
Merged

test(runtime): pin the batch-row sink's disclose/withhold log coherence#14684
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through

Conversation

@os-musk

Copy link
Copy Markdown
Collaborator

Part of #14403 — the residual half. Deliberately not a closing keyword: the triage seat asked for a measured verdict and reserved the grading, so the card stays open for it.

TL;DR — this is a measured zero-implementation result on the source, plus the pin the residual was waiting for

The card predicted a lost operator diagnostic in the batch-row sink. Measured on the real stack, there is none, for a reason that is itself worth pinning. So this PR changes no executable line: one comment block in protocol.ts recording the measurement, and one test file where a prose "KNOWN RESIDUAL" note becomes an assertion.

git diff is two files, and the protocol.ts half is comment-only — proven mechanically, every added line matches ^\+\s*\*:

$ git diff -U0 packages/metadata-protocol/src/protocol.ts | grep '^+' | grep -v '^+++' | grep -vE '^\+\s*\*'
(no output)

Step 1 — the hard gate, run before any edit

origin/main @ 2aa8456cf, worktree byte-pristine:

pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 \
src/batch-row-driver-text-real-driver.integration.test.ts \
src/seed-loader-driver-text-real-driver.integration.test.ts
Test Files 2 passed (2)
Tests 4 passed (4)
os-verify-lock: VERDICT command-exit 0

GREENmain is not broken today, priority:p2 stands, and card item 3 (retriage the sentence pins) is not triggered — both files already carry their RETRIAGED, not re-baselined blocks from PR #14405. Posted on the card as comment 5513980544 before the first edit.

Item 2 — both named sites already reach through, by two different mechanisms

sitereach-through?mechanism
seedFailureCause (seed-loader.ts:139-151)yeswalks the cause chain, prefers the deepest sentence ([#14095] docblock)
seedCauseLabel (seed-loader.ts)yesalready takes (err, printed) and compares the sentence about to be printed against the one the payload quoted
batch-row sink, withheld pathyespasses err whole to console.warn; util.inspect renders the [cause] chain (Node v22.22.2)
batch-row sink, disclosed pathn/areturns before the warn — and that is correct, see below

The triage read had seedCauseLabel as an open question; on this tree it is already the more advanced form, so nothing was owed there either.

⭐ The measured correction: the residual note in the pin file was half wrong

batch-row-driver-text-real-driver.integration.test.ts carried this on main:

with the row disclosed, the sink returns before its console.warn, so the warn fires ZERO times and the driver's own sentence — UNIQUE constraint failed: bd_note.email — reaches neither the response nor the console.

The zero-warn half is true. The "nor the console" half is false, and the counter-evidence comes out of that suite's own rig — captured during the step-1 run, with stack frames naming batch-row-driver-text-real-driver.integration.test.ts:136 and engine.ts:4572:

ERROR Insert operation failed {"object":"bd_note","error":{"message":
"UNIQUE constraint failed: bd_note.email [statement and bound values redacted]", ...}}

That is the engine's insert door taking the envelope's cause on purpose — e instanceof DuplicateRecordError ? e.cause : e (engine.ts:10198), the #14095 / #14390 remedy, already pinned in packages/objectql/src/driver-fault-redaction.test.ts where it asserts the failing column survives in the line. The diagnostic moved one hop; it was never deleted.

Why adding the log would have been the wrong fix, not merely a redundant one

Two independent reasons, either sufficient:

  1. It restates what the engine already logs, once per duplicate row — a 500-row batch with 100 duplicates would emit 100 extra warns for a condition already in the log.
  2. AGENTS.md's degradation rule refuses this site outright. A batch row is the third answer it names: "a failure handed to the CALLER is not a degradation at all … a batch whose contract IS a per-item outcome report … Do not bolt a logger.error onto such a site." The row reports success: false, code: DUPLICATE_RECORD, httpStatus: 409 and the producer's own sentence. The caller was told.

The sink's own log exists to record a withhold. Nothing was withheld here, so there is nothing for it to record.

What actually changed

packages/metadata-protocol/src/protocol.ts — comment only. A [#14403] section on clientFacingRowFailureText recording the measurement and marking the disclosed branch ⛔ do-not-log, so the next reader does not re-open this from the same inference the card made.

packages/runtime/src/batch-row-driver-text-real-driver.integration.test.ts — the residual note becomes a pin. A console.warn recorder is installed in rig() (⛔ recording, never muting — every call is forwarded to the real console.warn, so shard-log output is unchanged), and the sink's decision/log coherence is asserted in both directions on one rig:

  • deleteManyData (undeclared FK fault, withheld) → expect(sinkWarnings).toHaveLength(1) plus the driver's own FOREIGN KEY constraint failed inside it. This is the live control: without it a green zero in the sibling test could mean the recorder was never wired.
  • batchData create (declared 409, disclosed) → expect(sinkWarnings).toEqual([]).

Ablation — the new pin is proven to bite the exact change this PR argues against

Mutated clientFacingRowFailureText to log on the disclosed branch (the fix I am declining), rebuilt, ran, restored. Predicted direction: RED, and that is what happened.

== BEFORE: worktree=c7ce3813f… head=c7ce3813f… (worktree == HEAD before mutating)
== MUTATED: injected_hits=1 worktree=43f69cf48… (marker on disk, hash moved)
✓ dist/: marker present in 2 built files -- the ablation is live in the artifact the suite consumes
== ABLATED TEST RUN exit=1
× batchData create leaks neither the INSERT statement nor the values it carries
AssertionError: expected [ Array(1) ] to deeply equal []
== RESTORED: worktree=c7ce3813f… still_injected=0 (bytes back to the HEAD blob)
✓ tree: working tree clean against HEAD
✓ dist/: marker absent from all 24 built files

Both legs rebuilt @objectstack/metadata-protocol and both were proven through scripts/ablation-dist-preflight.mjs (present, then --absent) — the runtime suite resolves this package through exports to dist/, so an unrebuilt ablation would have stayed green and certified a vacuous assertion. Mutation was confirmed on disk by a hit count on the injected text plus a blob-hash move, never by the editor's exit code; the restore names HEAD explicitly rather than a bare git checkout --, which would have restored from the mutated index.

Verification

All on the final tree; the union below was run at HEAD = the commit this PR ships.

  • The two pinsTest Files 2 passed (2), Tests 4 passed (4), VERDICT command-exit 0.
  • @objectstack/metadata-protocol full suiteTest Files 156 passed | 2 skipped (158), Tests 2141 passed | 10 skipped (2151), VERDICT command-exit 0.
  • typecheck@objectstack/metadata-protocol and @objectstack/runtime, both clean.
  • ⚠️packages/runtime/tsconfig.json excludes its own test files, so that typecheck says nothing about the file I edited. Checked explicitly with a throwaway config (removed again; tree clean): tsc --noEmit exit 0, and --listFiles confirms the edited file was actually in the program (1 hit) rather than silently absent.
  • Gate family re-derived on the final tree with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands (change set taken by the script from the merge base, not from a hand-rolled diff): 29 commands, 26 measured green.
  • The other 3 exited 3, which each gate's own verdict text calls NOT MEASURED rather than a findingcheck-test-completeness.mjs ("there is no local log to hand it … ⛔ It is not a red"), check:dual-build-cjs-loads and check:type-check-debt (both "PREREQUISITE NOT MET", needing a full-repo build; their self-tests passed, and check:type-check-coverage printed OK). A full turbo run build was run to clear the prerequisite and both re-run; result recorded in the dispatch report.

Exit codes were captured before any pipe (cmd > log 2>&1; EXIT=$?), and every verdict above is quoted from the gate's own verdict line rather than read off a bare $?.

No contract moved

No accept set widens or narrows, no public entry gains or loses an export, no declared refusal changes shape, and no door's answer changes — only what one of them logs, and that not at all in this diff. Clause-② remains no. The four leak assertions this suite exists for (insert into, dup@example.com, UNIQUE constraint failed, SQLITE_CONSTRAINT) are untouched, byte for byte, and passing.

Changeset

Carrying skip-changeset instead of a changeset file, which is this workflow's own prescription for a PR that "declares no release of its own": the diff is one comment block and one test file, so nothing is published and a version bump would ship a release that changes nothing. The dispatch's default of patch was explicitly conditional on the measurement, and the measurement moved it.


🤖 Generated with Claude Code

https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68


Generated by Claude Code

WIP checkpoint before the verification round.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
@os-muskos-musk added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 2, 2026 — with Claude
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 9 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json bd4aa4e49c6ac11f1833576d8b98fc41584b6a5dpackageMentionDocs.

@os-muskClaude

Copy link
Copy Markdown
CollaboratorAuthor

Landing provenance (engine execution seat, session session_0112hMx9hjJ9BgB28X97DS68): flipped ready at 18:46Z and armed auto-merge (squash) at 18:46:43Z on head 99b509c80. The echo read method: MERGE; the queue build ref is the arming reading, not the echo.

  • Review: ACCEPT on the card, comment 5514600105. Clause-② no, self-read from the final diff and confirmed by this seat: no executable line changes anywhere in the PR, so no accept set, export or declared refusal can have moved. In-seat review is in order — the CONTRACT_REVIEW_TIER requirement binds Clause-② yes cards.
  • Governed-surface test re-run on the final two-path file list: 0 of 2 path(s) hit the register — ordinary queue landing. Re-derived rather than recalled.
  • Enqueue bar: all 37 check runs on 99b509c80 completed success or skipped, read with perPage: 50. Last standing was Test Core (1/6) (18:21:17Z → 18:39:44Z, 18 min) and Lint & Repo Gates (→ 18:38:33Z).
  • Verified by this seat against the tree rather than the report: the protocol.ts half is comment-only (every added line filtered against ^\+\s*\* leaves an empty set), and the four leak assertions the suite exists for survive — insert into 2, dup@example.com 4, UNIQUE constraint failed 2, SQLITE_CONSTRAINT 4.

Part of #14403, correctly — ⛔ not a closing keyword. The card stays open at MERGED: the dev shipped the measured half and reserved the grading for this seat, and Part-of PR must not also close its card is green on the head.

⚠️ Known exposure, stated in advance: the queue build runs the full suite, so this PR meets packages/cli/test/run-dev-unbuilt-workspace.e2e.test.ts — the flake tracked on #14648, which ejected #14629 at 17:45Z. If ejected, the disposition is fixed: ⛔ no re-queue while #14648 is open, ⛔ no weakening of that test, and the card goes to pm:blocked with an Unlock-action: line rather than being re-dispatched.

Owed by the seat at MERGED: verify by content on origin/main that protocol.ts carries the [#14403] do-not-log note and that the sink's coherence pin is present in both directions, then grade what remains on #14403 — the card is Part of, so pm:dispatched comes off only when the grading closes it.


Generated by Claude Code

@os-musk
os-musk added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 93d2d67Sep 2, 2026
39 checks passed
@os-musk
os-musk deleted the claude/issue-14403-seed-loader-cause-reach-through branch September 2, 2026 20:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gatetests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@os-musk@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

test(runtime): pin the batch-row sink's disclose/withhold log coherence - #14684

Merged
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through
Sep 2, 2026
Merged

test(runtime): pin the batch-row sink's disclose/withhold log coherence#14684
os-musk merged 1 commit into
mainfrom
claude/issue-14403-seed-loader-cause-reach-through

Conversation

@os-musk

Copy link
Copy Markdown
Collaborator

Part of #14403 — the residual half. Deliberately not a closing keyword: the triage seat asked for a measured verdict and reserved the grading, so the card stays open for it.

TL;DR — this is a measured zero-implementation result on the source, plus the pin the residual was waiting for

The card predicted a lost operator diagnostic in the batch-row sink. Measured on the real stack, there is none, for a reason that is itself worth pinning. So this PR changes no executable line: one comment block in protocol.ts recording the measurement, and one test file where a prose "KNOWN RESIDUAL" note becomes an assertion.

git diff is two files, and the protocol.ts half is comment-only — proven mechanically, every added line matches ^\+\s*\*:

$ git diff -U0 packages/metadata-protocol/src/protocol.ts | grep '^+' | grep -v '^+++' | grep -vE '^\+\s*\*'
(no output)

Step 1 — the hard gate, run before any edit

origin/main @ 2aa8456cf, worktree byte-pristine:

pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 \
src/batch-row-driver-text-real-driver.integration.test.ts \
src/seed-loader-driver-text-real-driver.integration.test.ts
Test Files 2 passed (2)
Tests 4 passed (4)
os-verify-lock: VERDICT command-exit 0

GREENmain is not broken today, priority:p2 stands, and card item 3 (retriage the sentence pins) is not triggered — both files already carry their RETRIAGED, not re-baselined blocks from PR #14405. Posted on the card as comment 5513980544 before the first edit.

Item 2 — both named sites already reach through, by two different mechanisms

sitereach-through?mechanism
seedFailureCause (seed-loader.ts:139-151)yeswalks the cause chain, prefers the deepest sentence ([#14095] docblock)
seedCauseLabel (seed-loader.ts)yesalready takes (err, printed) and compares the sentence about to be printed against the one the payload quoted
batch-row sink, withheld pathyespasses err whole to console.warn; util.inspect renders the [cause] chain (Node v22.22.2)
batch-row sink, disclosed pathn/areturns before the warn — and that is correct, see below

The triage read had seedCauseLabel as an open question; on this tree it is already the more advanced form, so nothing was owed there either.

⭐ The measured correction: the residual note in the pin file was half wrong

batch-row-driver-text-real-driver.integration.test.ts carried this on main:

with the row disclosed, the sink returns before its console.warn, so the warn fires ZERO times and the driver's own sentence — UNIQUE constraint failed: bd_note.email — reaches neither the response nor the console.

The zero-warn half is true. The "nor the console" half is false, and the counter-evidence comes out of that suite's own rig — captured during the step-1 run, with stack frames naming batch-row-driver-text-real-driver.integration.test.ts:136 and engine.ts:4572:

ERROR Insert operation failed {"object":"bd_note","error":{"message":
"UNIQUE constraint failed: bd_note.email [statement and bound values redacted]", ...}}

That is the engine's insert door taking the envelope's cause on purpose — e instanceof DuplicateRecordError ? e.cause : e (engine.ts:10198), the #14095 / #14390 remedy, already pinned in packages/objectql/src/driver-fault-redaction.test.ts where it asserts the failing column survives in the line. The diagnostic moved one hop; it was never deleted.

Why adding the log would have been the wrong fix, not merely a redundant one

Two independent reasons, either sufficient:

  1. It restates what the engine already logs, once per duplicate row — a 500-row batch with 100 duplicates would emit 100 extra warns for a condition already in the log.
  2. AGENTS.md's degradation rule refuses this site outright. A batch row is the third answer it names: "a failure handed to the CALLER is not a degradation at all … a batch whose contract IS a per-item outcome report … Do not bolt a logger.error onto such a site." The row reports success: false, code: DUPLICATE_RECORD, httpStatus: 409 and the producer's own sentence. The caller was told.

The sink's own log exists to record a withhold. Nothing was withheld here, so there is nothing for it to record.

What actually changed

packages/metadata-protocol/src/protocol.ts — comment only. A [#14403] section on clientFacingRowFailureText recording the measurement and marking the disclosed branch ⛔ do-not-log, so the next reader does not re-open this from the same inference the card made.

packages/runtime/src/batch-row-driver-text-real-driver.integration.test.ts — the residual note becomes a pin. A console.warn recorder is installed in rig() (⛔ recording, never muting — every call is forwarded to the real console.warn, so shard-log output is unchanged), and the sink's decision/log coherence is asserted in both directions on one rig:

  • deleteManyData (undeclared FK fault, withheld) → expect(sinkWarnings).toHaveLength(1) plus the driver's own FOREIGN KEY constraint failed inside it. This is the live control: without it a green zero in the sibling test could mean the recorder was never wired.
  • batchData create (declared 409, disclosed) → expect(sinkWarnings).toEqual([]).

Ablation — the new pin is proven to bite the exact change this PR argues against

Mutated clientFacingRowFailureText to log on the disclosed branch (the fix I am declining), rebuilt, ran, restored. Predicted direction: RED, and that is what happened.

== BEFORE: worktree=c7ce3813f… head=c7ce3813f… (worktree == HEAD before mutating)
== MUTATED: injected_hits=1 worktree=43f69cf48… (marker on disk, hash moved)
✓ dist/: marker present in 2 built files -- the ablation is live in the artifact the suite consumes
== ABLATED TEST RUN exit=1
× batchData create leaks neither the INSERT statement nor the values it carries
AssertionError: expected [ Array(1) ] to deeply equal []
== RESTORED: worktree=c7ce3813f… still_injected=0 (bytes back to the HEAD blob)
✓ tree: working tree clean against HEAD
✓ dist/: marker absent from all 24 built files

Both legs rebuilt @objectstack/metadata-protocol and both were proven through scripts/ablation-dist-preflight.mjs (present, then --absent) — the runtime suite resolves this package through exports to dist/, so an unrebuilt ablation would have stayed green and certified a vacuous assertion. Mutation was confirmed on disk by a hit count on the injected text plus a blob-hash move, never by the editor's exit code; the restore names HEAD explicitly rather than a bare git checkout --, which would have restored from the mutated index.

Verification

All on the final tree; the union below was run at HEAD = the commit this PR ships.

  • The two pinsTest Files 2 passed (2), Tests 4 passed (4), VERDICT command-exit 0.
  • @objectstack/metadata-protocol full suiteTest Files 156 passed | 2 skipped (158), Tests 2141 passed | 10 skipped (2151), VERDICT command-exit 0.
  • typecheck@objectstack/metadata-protocol and @objectstack/runtime, both clean.
  • ⚠️packages/runtime/tsconfig.json excludes its own test files, so that typecheck says nothing about the file I edited. Checked explicitly with a throwaway config (removed again; tree clean): tsc --noEmit exit 0, and --listFiles confirms the edited file was actually in the program (1 hit) rather than silently absent.
  • Gate family re-derived on the final tree with node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands (change set taken by the script from the merge base, not from a hand-rolled diff): 29 commands, 26 measured green.
  • The other 3 exited 3, which each gate's own verdict text calls NOT MEASURED rather than a findingcheck-test-completeness.mjs ("there is no local log to hand it … ⛔ It is not a red"), check:dual-build-cjs-loads and check:type-check-debt (both "PREREQUISITE NOT MET", needing a full-repo build; their self-tests passed, and check:type-check-coverage printed OK). A full turbo run build was run to clear the prerequisite and both re-run; result recorded in the dispatch report.

Exit codes were captured before any pipe (cmd > log 2>&1; EXIT=$?), and every verdict above is quoted from the gate's own verdict line rather than read off a bare $?.

No contract moved

No accept set widens or narrows, no public entry gains or loses an export, no declared refusal changes shape, and no door's answer changes — only what one of them logs, and that not at all in this diff. Clause-② remains no. The four leak assertions this suite exists for (insert into, dup@example.com, UNIQUE constraint failed, SQLITE_CONSTRAINT) are untouched, byte for byte, and passing.

Changeset

Carrying skip-changeset instead of a changeset file, which is this workflow's own prescription for a PR that "declares no release of its own": the diff is one comment block and one test file, so nothing is published and a version bump would ship a release that changes nothing. The dispatch's default of patch was explicitly conditional on the measurement, and the measurement moved it.


🤖 Generated with Claude Code

https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68


Generated by Claude Code

WIP checkpoint before the verification round.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
@os-muskos-musk added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 2, 2026 — with Claude
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol.ts) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 9 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json bd4aa4e49c6ac11f1833576d8b98fc41584b6a5dpackageMentionDocs.

@os-muskClaude

Copy link
Copy Markdown
CollaboratorAuthor

Landing provenance (engine execution seat, session session_0112hMx9hjJ9BgB28X97DS68): flipped ready at 18:46Z and armed auto-merge (squash) at 18:46:43Z on head 99b509c80. The echo read method: MERGE; the queue build ref is the arming reading, not the echo.

  • Review: ACCEPT on the card, comment 5514600105. Clause-② no, self-read from the final diff and confirmed by this seat: no executable line changes anywhere in the PR, so no accept set, export or declared refusal can have moved. In-seat review is in order — the CONTRACT_REVIEW_TIER requirement binds Clause-② yes cards.
  • Governed-surface test re-run on the final two-path file list: 0 of 2 path(s) hit the register — ordinary queue landing. Re-derived rather than recalled.
  • Enqueue bar: all 37 check runs on 99b509c80 completed success or skipped, read with perPage: 50. Last standing was Test Core (1/6) (18:21:17Z → 18:39:44Z, 18 min) and Lint & Repo Gates (→ 18:38:33Z).
  • Verified by this seat against the tree rather than the report: the protocol.ts half is comment-only (every added line filtered against ^\+\s*\* leaves an empty set), and the four leak assertions the suite exists for survive — insert into 2, dup@example.com 4, UNIQUE constraint failed 2, SQLITE_CONSTRAINT 4.

Part of #14403, correctly — ⛔ not a closing keyword. The card stays open at MERGED: the dev shipped the measured half and reserved the grading for this seat, and Part-of PR must not also close its card is green on the head.

⚠️ Known exposure, stated in advance: the queue build runs the full suite, so this PR meets packages/cli/test/run-dev-unbuilt-workspace.e2e.test.ts — the flake tracked on #14648, which ejected #14629 at 17:45Z. If ejected, the disposition is fixed: ⛔ no re-queue while #14648 is open, ⛔ no weakening of that test, and the card goes to pm:blocked with an Unlock-action: line rather than being re-dispatched.

Owed by the seat at MERGED: verify by content on origin/main that protocol.ts carries the [#14403] do-not-log note and that the sink's coherence pin is present in both directions, then grade what remains on #14403 — the card is Part of, so pm:dispatched comes off only when the grading closes it.


Generated by Claude Code

@os-musk
os-musk added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 93d2d67Sep 2, 2026
39 checks passed
@os-musk
os-musk deleted the claude/issue-14403-seed-loader-cause-reach-through branch September 2, 2026 20:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gatetests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@os-musk@claude