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
MongoDB standalone: a write on an object with a metadata before* hook is refused with a driver hint (retryWrites=false) that does not fix it, and nothing says so at boot #37991
Filing gate: ① (a measured answer that misleads the operator) · Source: fleet (the #34563 measurement, PR #37990; probe and raw results kept with the card thread)
What happens
Measured on a MongoDB 8.0 standalone server as the default store (#34563, cell N3): every write on an object that carries a metadata before* hook is refused, even when nothing in the write fails, because the write opens a unit and a standalone server has no transactions. That a replica set is needed is documented (the objectql CHANGELOG entry for the unit, hooks.mdx). Two things are not:
The refusal names the wrong fix. The user sees the driver's own text, "This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string." Measured: with retryWrites=false the answer is the same. Expected: the refusal says the object's before* hook needs a transaction and the store needs a replica set, not the driver's hint.
Nothing is loud before the first write. A standalone default store boots clean, and the first hooked write is where the operator learns it. Expected: say at boot (or at the first unit) that this store cannot carry units, naming the objects it affects, or state why the first write is the right place.
Writes to an object with no such hook were not measured on the standalone cell; measure one as the control.
Grade: area:data · bug · reach: MongoDB standalone deployments with metadata before* hooks · evidence: the #34563 measurement
Suggested-grade: p3
Size: S
Related: #34563, PR #37990, PR #34503.
Correction · 2026-11-27T14:28Z: the body's last line is wrong. The control was measured: each of the ten standalone runs (five on the default connection string, five with retryWrites=false) first wrote a row to an object with no hook on the same engine and driver, and all ten were stored; only the hooked object's write was refused (see the #34563 measurement comments). No control is owed here.
Triage: lands in area:data · domain:server · Bug · p2 · pm:queue · size S; rationale: on a MongoDB standalone server, every write on an object with a metadata before* hook is refused, and the refusal's driver hint (retryWrites=false) does not fix it. The operator is sent the wrong way by a measured, misleading message. The refusal is loud and no data is lost, so p2. Recorded 2026-11-27T15:14Z.
Picked by card-pick.mjs --order area:data --seat repo:objectstack#8 at 2026-11-28T01:22Z: rank 6 (p2, order 1; ranks 1–4 are p1 jumps outside the intake held for a live console or fleet tooling, rank 5 is #35815, claimed in the same round). The maintainer in this seat's session, verbatim: 「开一个 objectstack 全仓座位」 with intake area:data.
Claim: PM loop round 1
Session: session_017xRBcSAaBEfQpU2yJexSJ8
Account: sunhaolin
Branch: claude/issue-37991-mongo-standalone-unit
Worktree: objectstack-issue-37991
Domain: domain:server
Seat: repo:objectstack#8
File surface: packages/drivers/driver-mongodb/src/**, packages/objectql/src/engine-execute-transactions.ts and the unit-opening helpers it shares with engine-hooks-and-functions.ts (only if the boot/first-unit warning lives there), co-located tests, content/docs/automation/hooks.mdx (the replica-set line, if the refusal text changes), one changeset per moved package; ⛔ no packages/spec/src/** (stop on breach; explain in the report)
Container & model: S, mode:subagent, model: default (dispatch-gates.mjs --tier: no path-derived mandate), effort: high (a design point: what the refusal says and where the early warning fires)
Clause-②: no
Metadata-protocol: none
Responsibility: objectstack — packages/drivers/driver-mongodb advertises transactions unconditionally (supports at mongodb-driver.ts:224-227, beginTransaction at 716-720) and passes the driver error through; objectql opens the unit for metadata before* hooks (engine-hooks-and-functions.ts:537-551) | none — warnTransactionUnsupported (engine-execute-transactions.ts:234-266) covers only the transaction() path and only a driver that declares no transactions | operators of a MongoDB standalone default store with metadata before* hooks; measured by #34563 cell N3
Thread-read: 7221806517
Premise: holds — read-only check on origin/main at 2026-11-28T01:22Z (unit gate engine-hooks-and-functions.ts:549 trusts the declarative driverSupportsTransactions; no probe in connect() mongodb-driver.ts:278-287; zero retryWrites|retryable handling in the driver, control session hits)
Serial constraints cleared: seat 3 claims #37856 and #36495 declare packages/**; seat 1 #38017 holds packages/objectql/src/recycle-bin/restore.ts (disjoint). No open in-flight claim names driver-mongodb (check-handover.mjs --inflight, 34 threads read). Textual overlap re-checked with overlap-check.mjs before every push.
Scope this dispatch: the whole card. Fixes #37991.
Claim amendment · 2026-11-28T01:26Z — the size line of claim 7231627291 is corrected to what 定档 reads for this card (an S card whose judgement is in the design, not the gates, takes M treatment). Everything else in that claim stands.
Container & model: M, mode:subagent, model: opus (dispatch-gates --tier: no path-derived mandate; default tier), effort: high
Dispatched: one os-dev subagent from this seat's session, same branch claude/issue-37991-mongo-standalone-unit.
{
"issue": 37991,
"status": "done",
"branch": "claude/issue-37991-mongo-standalone-unit",
"pr": "https://github.com/objectstack-ai/objectstack/pull/38099",
"session": "session_017xRBcSAaBEfQpU2yJexSJ8",
"premise_still_valid": true,
"summary": "Premise held on origin/main 815e882b. The driver never mapped the standalone failure: it has zero retryWrites/retryable/IllegalOperation handling, and the unit gate trusts the declarative driverSupportsTransactions. Measured in mongodb 7.7.0 execute_operation.js: a write under a txn session on a standalone server gets the client's retryable-writes hint, a code-less MongoServerError whose originalError is code 20 'Transaction numbers are only allowed on a replica set member or mongos', and a read gets the code-20 error itself. Fix, landing only in driver-mongodb (new mongodb-standalone-unit.ts, wired into mongodb-driver.ts): every command sent with a session carries .catch(unitFault(session)), which maps either spelling to NOT_IMPLEMENTED/501. The new message says the server is a standalone mongod, why the write runs in a transaction (metadata before* hook / aborting after* hook / engine.transaction()), that nothing written inside it was stored, and the fix (a replica set, single-node is enough), and says retryWrites=false does not help. The client error is kept as cause, and other errors and session-less commands pass through by reference. connect() sends one hello and warns once on a standalone server (no setName, not isdbgrid). It cannot name the objects, because the store connects before hooks bind, and the line says so and that the first such write is refused with this cause (the card's 'or state why the first write is the right place' branch). The refusal is mapped at the command, not at beginTransaction: startTransaction sends nothing, so refusing at begin would break units that send no session command and commit today. WHEN is unchanged and only WHAT changes. The transactionsUnsupported fork was not taken, and no engine or spec file moved. hooks.mdx: the standalone sentence quoted the client hint and now quotes the new refusal.",
"tests": "At b01490a1: pnpm --filter @objectstack/driver-mongodb test gave Test Files 40 passed | 6 skipped (46), Tests 788 passed | 202 skipped (990), lock VERDICT command-exit 0. The skips are the opt-in mongodb-memory-server suites. pnpm --filter @objectstack/driver-mongodb typecheck exited 0, with check:test-typecheck OK (0 errors in the test layer). The new src/mongodb-standalone-unit.test.ts has 13 cases. Through ObjectQL + bindHooksToEngine with non-failing metadata hooks, insert (beforeInsert), update (beforeUpdate) and delete (beforeDelete) on the standalone fake are each refused with code NOT_IMPLEMENTED, status 501, the first sentence, no 'Please add retryWrites=false', cause = the client error, and nothing stored. CONTROL replica-set fake: the same hooked insert is stored in a committed unit. CONTROL no hook: a standalone write is stored with 0 sessions. Pass-through: an E11000 under a session, and the standalone shape without a session, come back as the same reference. Recogniser cases. Boot: standalone hello gives 1 warn (exact text), replica set / mongos / failed probe give 0 warn, and the failed probe logs 1 debug. The fakes throw real MongoServerError instances shaped as the client builds them. Ablation via scripts/ablation-replace.mjs, mapping removed (anchor x1 to x0, blob 140571bd22dc to 6b0cfc507913, restored to blob == HEAD, git diff HEAD empty): 3 failed | 10 passed. The insert pin got code undefined (the client hint, which is the measured defect). The update pin and the session read got code 20. All controls stayed green. The subject imports from src in the same package, so no dist leg was needed.",
"gates": "Local subset at b01490a1: dispatch-gates --commands --repo objectstack-ai/objectstack derived 99 families. All 99 ran, each exit captured before any pipe. 96 exited 0 on the first run. check-plugin-teardown-shape --self-test exited 3 (shallow clone, fixture 621a4876 unreachable), was re-run after git fetch --depth=1 of that commit, exit 0, '48 cases pass'. pnpm --filter @objectstack/spec run check:skill-examples exited 3 (client-react not built), was re-run after building the client-react closure, exit 0, '351 prose examples type-check'. pnpm check:dual-build-cjs-loads exited 3 (PREREQUISITE NOT MET: 80 packages have no dist), so it is NOT MEASURED; CI runs it in Lint & Repo Gates. Reconciliation with dispatch-gates --ran (exit codes recorded): 'Run reconciliation — 99 derived, 98 run, 1 NOT-MEASURED, 0 UNRUN', '✓ dispatch-gates --ran: 99 derived famil(ies) accounted for'. Also overlap-check.mjs exited 0 'merges cleanly' before each push and before pr_create. check-platform-checklist was not run, because no exported symbol was renamed or removed (index.ts untouched). CI check-runs for PR #38099: in_progress at report time, not waited on.",
"dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
"mcp_calls": "0 — no MCP GitHub calls; issue and comments read with gh api GET",
"api_writes": "3 — git push (3 pushes of claude/issue-37991-mongo-standalone-unit, after the dev-worktree probe push of the empty branch); fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/dispatches leading to POST pulls plus POST issues/38099/assignees, read back identical 7906 bytes, assignees sunhaolin); post-stamped os-dev-report comment on issue 37991 (POST issues/37991/comments)",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: none · noted, not filed — the refusal cannot name the object or the hook that opened the unit. The driver sees only a session-bearing command. Naming them would take an engine-side wrap at inAfterAbortUnit (packages/objectql/src/engine-hook-dispatch.ts) plus its three write-door call sites, and a refusal signal the engine can recognise, which means a new error-ledger code in packages/spec. Both are outside this card's file surface. This is recorded in the PR's Acceptance notes.",
"carrier: none · noted, not filed — when OS_TEST_MONGODB_MEMORY_SERVER_ENABLED=1, the opt-in real-server suites run on a standalone MongoMemoryServer and now log the boot warning once per connect. No assertion reads it."
],
"deviations": "Container line differs: the claim says S, the dispatch order says M (the seat amended it). I worked to the dispatch. File surface: engine files were not touched and the landing is driver-mongodb src plus hooks.mdx plus one changeset, all inside the surface. The commit trailers use the AGENTS.md model-free pair, not the harness reminder's model-named Co-Authored-By (AGENTS.md outranks the reminder). Lock hold: one client-react closure build held the shared lock for 6m49s, to satisfy the check:skill-examples prerequisite.",
"files_changed": [
".changeset/37991-mongo-standalone-unit-refusal.md",
"content/docs/automation/hooks.mdx",
"packages/drivers/driver-mongodb/src/mongodb-driver.ts",
"packages/drivers/driver-mongodb/src/mongodb-standalone-unit.ts",
"packages/drivers/driver-mongodb/src/mongodb-standalone-unit.test.ts"
],
"l2_review": "Not owed in my reading: driver-only runtime-string change plus a docs sentence, with no governed surface, no spec, and no contract shape (NOT_IMPLEMENTED is an existing StandardErrorCode)."
}
Done · 2026-11-28T03:07Z — PR #38099 merged; this card closed as completed by its Fixes line. Delivered: on a standalone MongoDB server a write that runs in a transaction is refused with NOT_IMPLEMENTED (501) naming the missing replica set (and that retryWrites=false does not help), and connect() warns once on a standalone server. Nothing remains on this card; the one limit (the refusal cannot name the object or hook) is in the PR's Acceptance notes. pm:dispatched removed.
Activity
objectstack-fleet commentedon Nov 27, 2026
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA
Correction · 2026-11-27T14:28Z: the body's last line is wrong. The control was measured: each of the ten standalone runs (five on the default connection string, five with
retryWrites=false) first wrote a row to an object with no hook on the same engine and driver, and all ten were stored; only the hooked object's write was refused (see the #34563 measurement comments). No control is owed here.objectstack-fleet commentedon Nov 27, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Triage: lands in area:data · domain:server · Bug · p2 · pm:queue · size S; rationale: on a MongoDB standalone server, every write on an object with a metadata
before*hook is refused, and the refusal's driver hint (retryWrites=false) does not fix it. The operator is sent the wrong way by a measured, misleading message. The refusal is loud and no data is lost, so p2. Recorded 2026-11-27T15:14Z.objectstack-fleet commentedon Nov 28, 2026
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8
Picked by
card-pick.mjs --order area:data --seat repo:objectstack#8at 2026-11-28T01:22Z: rank 6 (p2, order 1; ranks 1–4 are p1 jumps outside the intake held for a live console or fleet tooling, rank 5 is #35815, claimed in the same round). The maintainer in this seat's session, verbatim: 「开一个 objectstack 全仓座位」 with intakearea:data.Claim: PM loop round 1
Session:
session_017xRBcSAaBEfQpU2yJexSJ8Account:
sunhaolinBranch:
claude/issue-37991-mongo-standalone-unitWorktree:
objectstack-issue-37991Domain:
domain:serverSeat:
repo:objectstack#8File surface:
packages/drivers/driver-mongodb/src/**,packages/objectql/src/engine-execute-transactions.tsand the unit-opening helpers it shares withengine-hooks-and-functions.ts(only if the boot/first-unit warning lives there), co-located tests,content/docs/automation/hooks.mdx(the replica-set line, if the refusal text changes), one changeset per moved package; ⛔ nopackages/spec/src/**(stop on breach; explain in the report)Container & model:
S,mode:subagent,model: default(dispatch-gates.mjs --tier: no path-derived mandate),effort: high(a design point: what the refusal says and where the early warning fires)Clause-②: no
Metadata-protocol: none
Responsibility:
objectstack — packages/drivers/driver-mongodb advertises transactions unconditionally (supports at mongodb-driver.ts:224-227, beginTransaction at 716-720) and passes the driver error through; objectql opens the unit for metadata before* hooks (engine-hooks-and-functions.ts:537-551)|none — warnTransactionUnsupported (engine-execute-transactions.ts:234-266) covers only the transaction() path and only a driver that declares no transactions|operators of a MongoDB standalone default store with metadata before* hooks; measured by #34563 cell N3Thread-read: 7221806517
Premise: holds — read-only check on origin/main at 2026-11-28T01:22Z (unit gate engine-hooks-and-functions.ts:549 trusts the declarative
driverSupportsTransactions; no probe inconnect()mongodb-driver.ts:278-287; zeroretryWrites|retryablehandling in the driver, controlsessionhits)Serial constraints cleared: seat 3 claims #37856 and #36495 declare
packages/**; seat 1 #38017 holdspackages/objectql/src/recycle-bin/restore.ts(disjoint). No open in-flight claim namesdriver-mongodb(check-handover.mjs --inflight, 34 threads read). Textual overlap re-checked withoverlap-check.mjsbefore every push.Scope this dispatch: the whole card.
Fixes #37991.objectstack-fleet commentedon Nov 28, 2026
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8
Claim amendment · 2026-11-28T01:26Z — the size line of claim 7231627291 is corrected to what 定档 reads for this card (an S card whose judgement is in the design, not the gates, takes M treatment). Everything else in that claim stands.
Container & model:
M,mode:subagent,model: opus (dispatch-gates --tier: no path-derived mandate; default tier),effort: highDispatched: one
os-devsubagent from this seat's session, same branchclaude/issue-37991-mongo-standalone-unit.objectstack-fleet commentedon Nov 28, 2026
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8
os-dev-report
{ "issue": 37991, "status": "done", "branch": "claude/issue-37991-mongo-standalone-unit", "pr": "https://github.com/objectstack-ai/objectstack/pull/38099", "session": "session_017xRBcSAaBEfQpU2yJexSJ8", "premise_still_valid": true, "summary": "Premise held on origin/main 815e882b. The driver never mapped the standalone failure: it has zero retryWrites/retryable/IllegalOperation handling, and the unit gate trusts the declarative driverSupportsTransactions. Measured in mongodb 7.7.0 execute_operation.js: a write under a txn session on a standalone server gets the client's retryable-writes hint, a code-less MongoServerError whose originalError is code 20 'Transaction numbers are only allowed on a replica set member or mongos', and a read gets the code-20 error itself. Fix, landing only in driver-mongodb (new mongodb-standalone-unit.ts, wired into mongodb-driver.ts): every command sent with a session carries .catch(unitFault(session)), which maps either spelling to NOT_IMPLEMENTED/501. The new message says the server is a standalone mongod, why the write runs in a transaction (metadata before* hook / aborting after* hook / engine.transaction()), that nothing written inside it was stored, and the fix (a replica set, single-node is enough), and says retryWrites=false does not help. The client error is kept as cause, and other errors and session-less commands pass through by reference. connect() sends one hello and warns once on a standalone server (no setName, not isdbgrid). It cannot name the objects, because the store connects before hooks bind, and the line says so and that the first such write is refused with this cause (the card's 'or state why the first write is the right place' branch). The refusal is mapped at the command, not at beginTransaction: startTransaction sends nothing, so refusing at begin would break units that send no session command and commit today. WHEN is unchanged and only WHAT changes. The transactionsUnsupported fork was not taken, and no engine or spec file moved. hooks.mdx: the standalone sentence quoted the client hint and now quotes the new refusal.", "tests": "At b01490a1: pnpm --filter @objectstack/driver-mongodb test gave Test Files 40 passed | 6 skipped (46), Tests 788 passed | 202 skipped (990), lock VERDICT command-exit 0. The skips are the opt-in mongodb-memory-server suites. pnpm --filter @objectstack/driver-mongodb typecheck exited 0, with check:test-typecheck OK (0 errors in the test layer). The new src/mongodb-standalone-unit.test.ts has 13 cases. Through ObjectQL + bindHooksToEngine with non-failing metadata hooks, insert (beforeInsert), update (beforeUpdate) and delete (beforeDelete) on the standalone fake are each refused with code NOT_IMPLEMENTED, status 501, the first sentence, no 'Please add retryWrites=false', cause = the client error, and nothing stored. CONTROL replica-set fake: the same hooked insert is stored in a committed unit. CONTROL no hook: a standalone write is stored with 0 sessions. Pass-through: an E11000 under a session, and the standalone shape without a session, come back as the same reference. Recogniser cases. Boot: standalone hello gives 1 warn (exact text), replica set / mongos / failed probe give 0 warn, and the failed probe logs 1 debug. The fakes throw real MongoServerError instances shaped as the client builds them. Ablation via scripts/ablation-replace.mjs, mapping removed (anchor x1 to x0, blob 140571bd22dc to 6b0cfc507913, restored to blob == HEAD, git diff HEAD empty): 3 failed | 10 passed. The insert pin got code undefined (the client hint, which is the measured defect). The update pin and the session read got code 20. All controls stayed green. The subject imports from src in the same package, so no dist leg was needed.", "gates": "Local subset at b01490a1: dispatch-gates --commands --repo objectstack-ai/objectstack derived 99 families. All 99 ran, each exit captured before any pipe. 96 exited 0 on the first run. check-plugin-teardown-shape --self-test exited 3 (shallow clone, fixture 621a4876 unreachable), was re-run after git fetch --depth=1 of that commit, exit 0, '48 cases pass'. pnpm --filter @objectstack/spec run check:skill-examples exited 3 (client-react not built), was re-run after building the client-react closure, exit 0, '351 prose examples type-check'. pnpm check:dual-build-cjs-loads exited 3 (PREREQUISITE NOT MET: 80 packages have no dist), so it is NOT MEASURED; CI runs it in Lint & Repo Gates. Reconciliation with dispatch-gates --ran (exit codes recorded): 'Run reconciliation — 99 derived, 98 run, 1 NOT-MEASURED, 0 UNRUN', '✓ dispatch-gates --ran: 99 derived famil(ies) accounted for'. Also overlap-check.mjs exited 0 'merges cleanly' before each push and before pr_create. check-platform-checklist was not run, because no exported symbol was renamed or removed (index.ts untouched). CI check-runs for PR #38099: in_progress at report time, not waited on.", "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm", "mcp_calls": "0 — no MCP GitHub calls; issue and comments read with gh api GET", "api_writes": "3 — git push (3 pushes of claude/issue-37991-mongo-standalone-unit, after the dev-worktree probe push of the empty branch); fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/dispatches leading to POST pulls plus POST issues/38099/assignees, read back identical 7906 bytes, assignees sunhaolin); post-stamped os-dev-report comment on issue 37991 (POST issues/37991/comments)", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "carrier: none · noted, not filed — the refusal cannot name the object or the hook that opened the unit. The driver sees only a session-bearing command. Naming them would take an engine-side wrap at inAfterAbortUnit (packages/objectql/src/engine-hook-dispatch.ts) plus its three write-door call sites, and a refusal signal the engine can recognise, which means a new error-ledger code in packages/spec. Both are outside this card's file surface. This is recorded in the PR's Acceptance notes.", "carrier: none · noted, not filed — when OS_TEST_MONGODB_MEMORY_SERVER_ENABLED=1, the opt-in real-server suites run on a standalone MongoMemoryServer and now log the boot warning once per connect. No assertion reads it." ], "deviations": "Container line differs: the claim says S, the dispatch order says M (the seat amended it). I worked to the dispatch. File surface: engine files were not touched and the landing is driver-mongodb src plus hooks.mdx plus one changeset, all inside the surface. The commit trailers use the AGENTS.md model-free pair, not the harness reminder's model-named Co-Authored-By (AGENTS.md outranks the reminder). Lock hold: one client-react closure build held the shared lock for 6m49s, to satisfy the check:skill-examples prerequisite.", "files_changed": [ ".changeset/37991-mongo-standalone-unit-refusal.md", "content/docs/automation/hooks.mdx", "packages/drivers/driver-mongodb/src/mongodb-driver.ts", "packages/drivers/driver-mongodb/src/mongodb-standalone-unit.ts", "packages/drivers/driver-mongodb/src/mongodb-standalone-unit.test.ts" ], "l2_review": "Not owed in my reading: driver-only runtime-string change plus a docs sentence, with no governed surface, no spec, and no contract shape (NOT_IMPLEMENTED is an existing StandardErrorCode)." }objectstack-fleet commentedon Nov 28, 2026
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8
ACCEPT → PR #38099 comment 7232548842 · 2026-11-28T02:44Z · landing armed (comment 7232556119); this card closes on merge (
Fixes #37991).objectstack-fleet commentedon Nov 28, 2026
repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8
Done · 2026-11-28T03:07Z — PR #38099 merged; this card closed as completed by its
Fixesline. Delivered: on a standalone MongoDB server a write that runs in a transaction is refused withNOT_IMPLEMENTED(501) naming the missing replica set (and thatretryWrites=falsedoes not help), andconnect()warns once on a standalone server. Nothing remains on this card; the one limit (the refusal cannot name the object or hook) is in the PR's Acceptance notes.pm:dispatchedremoved.