You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
check-engine-double-contract: a native Mongo Collection fake is counted as an ObjectQL engine double, because insertMany and find are read as engine evidence #29859
Filing gate: ① This is a class-a out-of-scope finding from the #29538 dev (os-dev-report 6598582500, out-of-scope item 1), accepted by the seat on PR #29858. Filed by domain:server seat 5. ⛔ Not a claim. Suggested grade: p3. It is an instrument false red: a correct test fake reads red, and the cost is a seat bending the fake to the gate.
What happens
scripts/check-engine-double-contract.mjs attributes an object literal to the ObjectQL engine contract by its member names. It has two inputs:
ENGINE_SIBLINGS (line ~441) includes find and insertMany.
ENGINE_ONLY_MEMBERS (line ~481) takes insertMany as positive engine-not-driver evidence.
The count at lines ~1235–1243 makes a literal a findOne engine double when it holds two siblings besides the verb.
A native MongoDB Collection fake that declares insertOne, insertMany, updateOne, findOne and find is therefore read as an engine double whose findOne must route through assertEngineFindOnePredicate. This is the shape driver-mongodb's tests wire as (driver as any).db = { collection: () => collection }. insertMany and find are native Collection methods, not engine members, and the fake's findOne(filter, options) takes no object name.
Reach (a real producer): on PR #29858's parent 94b0457, packages/drivers/driver-mongodb/src/mongodb-declared-column-null-on-write.test.ts read x PINNED [findOne]: … declares 1 engine double(s) whose findOne() does not route through assertEngineFindOnePredicate (line 57). The dev split the fake per arm to get green. That split was honest only because the arms happened to use disjoint members.
Business reason
The driver-mongodb conformance tests need recording fakes of the native driver API to pin what the driver sends. Today, a fake that needs insertMany and find beside findOne can't be written without a false red. The gate's own header warns that a gate which reddens correct code grows its ledger into noise.
Wanted
A veto arm for the native Mongo Collection shape, in the same way DRIVER_ONLY_MEMBERS and REPOSITORY_ONLY_MEMBERS put their shapes out of scan scope. Native-only names such as insertOne, updateOne, deleteOne, replaceOne, bulkWrite, countDocuments and findOneAndUpdate are positive Collection evidence. Alternatively, insertMany leaves ENGINE_ONLY_MEMBERS if the engine-side evidence does not need it. Decide which one by reading the engine's own members.
A self-test case that a five-member native Collection fake is out of scope, and that a real engine double with insertMany is still attributed.
⛔ No baseline row. The ledger is shrink-only.
Reader
A domain:server seat, or the devx lane if the coordinator routes instruments there. The surface is the checker and its --self-test.
Dedupe
Searched is:issue engine-double-contract insertMany (11 hits, none on this gate's attribution) and is:issue ENGINE_ONLY_MEMBERS (1 hit, #29538 itself). New.
Claim: PM loop round 1
Session: session_01Utp6CXCS98uhsFQYk64epE (seat) · dev = project card thread session_01Utp6CXoPqLaG33jM98mL1R
Account: os-bill
Branch: claude/project-thread-1o35e8 (harness-pinned thread branch; platform exception to claude/issue-<n>-<slug>)
Worktree: objectstack-issue-29859
Domain: domain:server
Seat: domain:server#6
File surface: scripts/check-engine-double-contract.mjs and its self-test/fixtures; a driver-mongodb test only to restore a fake bent to the gate. ⛔ other product code, packages/spec/**, ui/**, skills/**, docs/adr/**, .claude/**, AGENTS.md (stop on breach; explain in the report)
Container & model: S–M, mode:thread, model: default tier (opus; dispatch-gates --tier: no path-derived mandate), effort: high
Clause-②: no — a gate script's evidence narrows; no published accept set or public surface moves
Metadata-protocol: none
Responsibility: scripts/check-engine-double-contract.mjs reads find/insertMany as engine evidence, so a native Mongo Collection fake reads as an engine findOne double (PR #29858's parent) | none: no other gate judges this | every driver-mongodb test author, who bends the fake to the gate today
Thread-read: 6599355239
Premise: holds (seat read on c5800818: ENGINE_ONLY_MEMBERS at L481 still holds insertMany; the dev re-measures the false red first)
Serial constraints cleared: none (seat 4's #29860 edits a different gate script, scripts/check-where-matcher-conformance.mjs)
Order: project file server-seat6/dispatch-29859.md, delivered to the card thread.
{
"issue": 29859,
"status": "done",
"branch": "claude/project-thread-1o35e8",
"pr": "https://github.com/objectstack-ai/objectstack/pull/30499",
"session": "session_01Utp6CXoPqLaG33jM98mL1R",
"premise_still_valid": true,
"summary": "Measured the PM assumption and narrowed it: the false red is not only insertMany. A native Collection fake's findOne(filter, options) has a second parameter that is neither an id nor a string, so isEngineVerbShape admits it on the two-parameter path without reading ENGINE_ONLY_MEMBERS at all; a one-parameter findOne(filter) is admitted by insertMany on the short-arity path. insertMany is a real ObjectQL class member (engine.ts insertMany(object, rows, options)), so it stays engine evidence. Fix: a fourth evidence arm, NATIVE_COLLECTION_ONLY_MEMBERS (insertOne, updateOne, deleteOne, replaceOne, bulkWrite, countDocuments, estimatedDocumentCount, findOneAndUpdate, findOneAndDelete, findOneAndReplace; none declared in engine.ts, IDataEngine, IDataDriver or IScopedObjectRepository, grep control leg hits insertMany/findOne), consulted right after the scoped-repository veto under the same takesObjectNameFirst guard, so an engine double whose verb takes the object name first stays in scope. Signature evidence, no file exemption, no ledger row. --census ablates the new veto separately (moves 1 construct, 0 pinned). The driver-mongodb test split into singleRowDb/batchDb to satisfy the gate is one fakeDb() again.",
"tests": "Red first: main's gate (f273c9fe) over the restored test, check-engine-double-contract exit 1, 'x PINNED [findOne]: packages/drivers/driver-mongodb/src/mongodb-declared-column-null-on-write.test.ts declares 1 engine double(s) whose findOne() does not route through assertEngineFindOnePredicate (line 65)'. Green on f443d8b1: full run exit 0 'OK — 1230 pinned, 120 in the DEBT ledger, 3 exempt.', --self-test exit 0 (new battery 'The NATIVE COLLECTION, the fourth shape (#29859).' 7 cases, floor 7, roster floor 34 -> 35), --census exit 0 'NATIVE_COLLECTION_ONLY_MEMBERS veto moves 1 construct(s); 0 of them pinned'. Full-repo before/after (main + split test vs branch + restored test, 0e5fa59b): output byte-identical apart from the exit line; 1230/120/3, 1133 retained, provenance 7122/4386/1252/1133 both. Ablation once via scripts/ablation-replace.mjs (anchor 1 -> 0, blob 6bad367f -> de0d3adc, veto if prefixed 'false &&'): --self-test 3 failures (five-member native fake out of scope; one-parameter native findOne out of scope; mixed fixture exact set), full run exit 1 naming the Mongo test; restored blob == HEAD 6bad367f, git diff HEAD empty. Under os-verify-lock (VERDICT command-exit 0): driver-mongodb dependency closure build, driver-mongodb test (Test Files 35 passed | 6 skipped; Tests 728 passed | 194 skipped), driver-mongodb typecheck (tsc + check:test-typecheck OK, 0 debt). Restored file alone 3/3.",
"gates": "dispatch-gates --commands --repo objectstack-ai/objectstack on f443d8b1: 68 commands (list identical to the 0e5fa59b derivation), each run with its exit recorded before any pipe: 68 exit 0. --ran: '68 derived, 68 run, 0 NOT-MEASURED, 0 UNRUN.' (On 0e5fa59b the first sweep had check-plugin-teardown-shape --self-test exit 3, shallow, exit 0 after git fetch origin 621a4876, and check:dual-build-cjs-loads exit 3 PREREQUISITE NOT MET; both exit 0 on the f443d8b1 sweep.) pnpm lint exit 0 on f443d8b1; check-nul-bytes exit 0. No test file runs the gate script (git grep hits are comments in fakes); its --self-test is its suite. PR check-runs: in_progress at report time.",
"line_budget": "204 changed lines (+159 / -45) across 2 files vs merge base; under the 3000-line class",
"files_changed": "scripts/check-engine-double-contract.mjs; packages/drivers/driver-mongodb/src/mongodb-declared-column-null-on-write.test.ts",
"deviations": "Changeset: none, skip-changeset on pr_create (scripts/** is repo tooling; the driver-mongodb file is a test, files = dist/README/CHANGELOG, tsup entry src/index.ts). Merged origin/main once (f506b79d, 53 files, no overlap) before the PR and re-ran the whole derived sweep, lint and the gate's own three modes on the merge head. Session-context assign/review step skipped per the order (no MCP write). A stray /build.pid file was written at the container root by a background-job typo; a safety check refused its removal, left in place (container-local, not in the repo).",
"dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
"mcp_calls": "4 — issue_read x3 (#29859 get, get_comments x2), ToolSearch schema load not counted; no write tool",
"api_writes": "2 — relay pr_create (POST /repos/objectstack-ai/objectstack/dispatches, run 42037173551 success, read-back 8824/8824 bytes identical, PR #30499 draft, labels [skip-changeset], no assignees); this os-dev-report comment via post-stamped (POST /repos/objectstack-ai/objectstack/issues/29859/comments). Plus git push of the designated branch (not REST). Reads: 2 REST GETs (Claim comment 6657967578, PR #30499).",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": []
}
Activity
objectstack-fleet commentedon Nov 3, 2026
triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U
Path: none
Triage: first-touch audit · p3 ·
domain:serverkept ·pm:triage→pm:queue· 2026-11-03T08:52Z⛔ Not a claim.
check-engine-double-contract.mjsreadsfind/insertManyas engine evidence, so a correct native MongoCollectionfake is refused as an engine double. An instrument false red, with a real producer (PR fix(objectql): a write answers every stored declared column the driver did not echo as null, as the next read does (#29538) #29858's parent). p3, as suggested.domain:server: a gate script follows the anchoring rule (SKILL.md table) to the surface it guards, the ObjectQL engine doubles.Generated by Claude Code
objectstack-fleet commentedon Nov 5, 2026
domain:server#6 · os-bill · session_01Utp6CXCS98uhsFQYk64epE
Claim: PM loop round 1
Session:
session_01Utp6CXCS98uhsFQYk64epE(seat) · dev = project card threadsession_01Utp6CXoPqLaG33jM98mL1RAccount:
os-billBranch:
claude/project-thread-1o35e8(harness-pinned thread branch; platform exception toclaude/issue-<n>-<slug>)Worktree:
objectstack-issue-29859Domain:
domain:serverSeat:
domain:server#6File surface:
scripts/check-engine-double-contract.mjsand its self-test/fixtures; a driver-mongodb test only to restore a fake bent to the gate. ⛔ other product code,packages/spec/**,ui/**,skills/**,docs/adr/**,.claude/**,AGENTS.md(stop on breach; explain in the report)Container & model:
S–M,mode:thread,model: default tier (opus; dispatch-gates --tier: no path-derived mandate),effort: highClause-②: no — a gate script's evidence narrows; no published accept set or public surface moves
Metadata-protocol: none
Responsibility:
scripts/check-engine-double-contract.mjs reads find/insertMany as engine evidence, so a native Mongo Collection fake reads as an engine findOne double (PR #29858's parent) | none: no other gate judges this | every driver-mongodb test author, who bends the fake to the gate todayThread-read: 6599355239
Premise: holds (seat read on
c5800818:ENGINE_ONLY_MEMBERSat L481 still holdsinsertMany; the dev re-measures the false red first)Serial constraints cleared:
none (seat 4's #29860 edits a different gate script, scripts/check-where-matcher-conformance.mjs)Order: project file
server-seat6/dispatch-29859.md, delivered to the card thread.objectstack-fleet commentedon Nov 5, 2026
domain:server#6 · os-bill · session_01Utp6CXCS98uhsFQYk64epE
os-dev-report
Card thread
session_01Utp6CXoPqLaG33jM98mL1R· branchclaude/project-thread-1o35e8· draft PR #30499 · headf443d8b1{ "issue": 29859, "status": "done", "branch": "claude/project-thread-1o35e8", "pr": "https://github.com/objectstack-ai/objectstack/pull/30499", "session": "session_01Utp6CXoPqLaG33jM98mL1R", "premise_still_valid": true, "summary": "Measured the PM assumption and narrowed it: the false red is not only insertMany. A native Collection fake's findOne(filter, options) has a second parameter that is neither an id nor a string, so isEngineVerbShape admits it on the two-parameter path without reading ENGINE_ONLY_MEMBERS at all; a one-parameter findOne(filter) is admitted by insertMany on the short-arity path. insertMany is a real ObjectQL class member (engine.ts insertMany(object, rows, options)), so it stays engine evidence. Fix: a fourth evidence arm, NATIVE_COLLECTION_ONLY_MEMBERS (insertOne, updateOne, deleteOne, replaceOne, bulkWrite, countDocuments, estimatedDocumentCount, findOneAndUpdate, findOneAndDelete, findOneAndReplace; none declared in engine.ts, IDataEngine, IDataDriver or IScopedObjectRepository, grep control leg hits insertMany/findOne), consulted right after the scoped-repository veto under the same takesObjectNameFirst guard, so an engine double whose verb takes the object name first stays in scope. Signature evidence, no file exemption, no ledger row. --census ablates the new veto separately (moves 1 construct, 0 pinned). The driver-mongodb test split into singleRowDb/batchDb to satisfy the gate is one fakeDb() again.", "tests": "Red first: main's gate (f273c9fe) over the restored test, check-engine-double-contract exit 1, 'x PINNED [findOne]: packages/drivers/driver-mongodb/src/mongodb-declared-column-null-on-write.test.ts declares 1 engine double(s) whose findOne() does not route through assertEngineFindOnePredicate (line 65)'. Green on f443d8b1: full run exit 0 'OK — 1230 pinned, 120 in the DEBT ledger, 3 exempt.', --self-test exit 0 (new battery 'The NATIVE COLLECTION, the fourth shape (#29859).' 7 cases, floor 7, roster floor 34 -> 35), --census exit 0 'NATIVE_COLLECTION_ONLY_MEMBERS veto moves 1 construct(s); 0 of them pinned'. Full-repo before/after (main + split test vs branch + restored test, 0e5fa59b): output byte-identical apart from the exit line; 1230/120/3, 1133 retained, provenance 7122/4386/1252/1133 both. Ablation once via scripts/ablation-replace.mjs (anchor 1 -> 0, blob 6bad367f -> de0d3adc, veto if prefixed 'false &&'): --self-test 3 failures (five-member native fake out of scope; one-parameter native findOne out of scope; mixed fixture exact set), full run exit 1 naming the Mongo test; restored blob == HEAD 6bad367f, git diff HEAD empty. Under os-verify-lock (VERDICT command-exit 0): driver-mongodb dependency closure build, driver-mongodb test (Test Files 35 passed | 6 skipped; Tests 728 passed | 194 skipped), driver-mongodb typecheck (tsc + check:test-typecheck OK, 0 debt). Restored file alone 3/3.", "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack on f443d8b1: 68 commands (list identical to the 0e5fa59b derivation), each run with its exit recorded before any pipe: 68 exit 0. --ran: '68 derived, 68 run, 0 NOT-MEASURED, 0 UNRUN.' (On 0e5fa59b the first sweep had check-plugin-teardown-shape --self-test exit 3, shallow, exit 0 after git fetch origin 621a4876, and check:dual-build-cjs-loads exit 3 PREREQUISITE NOT MET; both exit 0 on the f443d8b1 sweep.) pnpm lint exit 0 on f443d8b1; check-nul-bytes exit 0. No test file runs the gate script (git grep hits are comments in fakes); its --self-test is its suite. PR check-runs: in_progress at report time.", "line_budget": "204 changed lines (+159 / -45) across 2 files vs merge base; under the 3000-line class", "files_changed": "scripts/check-engine-double-contract.mjs; packages/drivers/driver-mongodb/src/mongodb-declared-column-null-on-write.test.ts", "deviations": "Changeset: none, skip-changeset on pr_create (scripts/** is repo tooling; the driver-mongodb file is a test, files = dist/README/CHANGELOG, tsup entry src/index.ts). Merged origin/main once (f506b79d, 53 files, no overlap) before the PR and re-ran the whole derived sweep, lint and the gate's own three modes on the merge head. Session-context assign/review step skipped per the order (no MCP write). A stray /build.pid file was written at the container root by a background-job typo; a safety check refused its removal, left in place (container-local, not in the repo).", "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm", "mcp_calls": "4 — issue_read x3 (#29859 get, get_comments x2), ToolSearch schema load not counted; no write tool", "api_writes": "2 — relay pr_create (POST /repos/objectstack-ai/objectstack/dispatches, run 42037173551 success, read-back 8824/8824 bytes identical, PR #30499 draft, labels [skip-changeset], no assignees); this os-dev-report comment via post-stamped (POST /repos/objectstack-ai/objectstack/issues/29859/comments). Plus git push of the designated branch (not REST). Reads: 2 REST GETs (Claim comment 6657967578, PR #30499).", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [] }Report taken 2026-11-05T13:37Z.
objectstack-fleet commentedon Nov 5, 2026
domain:server#6 · os-bill · session_01Utp6CXCS98uhsFQYk64epE
ACCEPT → PR #30499 comment 6659440182 (head
f443d8b1). Ready + auto-merge on.objectstack-fleet commentedon Nov 5, 2026
domain:server#6 · os-bill · session_01Utp6CXCS98uhsFQYk64epE
Landed · 2026-11-05T15:20Z · PR #30499
merged, merge commit400b41b1f5, merged at 2026-11-05T15:17Z through the merge queue (seat ACCEPT 6659440182, record 6659663931, follow-up 6659848176)closed·completedby the PR'sFixesState change:
pm:dispatchedremoved; card closed; card thread resolved. Nothing remains on this card.