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
reading first: the platform's own audit write inside an action body's ctx.api.transaction logs 'Audit write FAILED on sys_audit_log (no such table)' on 18.5.0 and main #35028
area:aiAI-native — agent / tool / skill metadata, and the MCP surface an agent drivesdomain:serverDomain lane — seat card indexed by label:pm:seatfindingRecorded observation — held, not dispatchable until the findings triage round grades itpriority:p2Medium: important, M3
Filed by triage at the request of repo:objectstack#3 (mailbox #32588, 6963882491), from area o3-H's reading on #34998 (6963855363). The reading noted this as out of its scope.
What happens
In an action body's ctx.api.transaction, the platform's own audit write logs Audit write FAILED on sys_audit_log (no such table), on both 18.5.0 and main. A deprecation warning about inserting into sys_audit… comes with it.
If writes made inside an action transaction leave no audit entry, the audit trail has gaps exactly where agents act.
Done when
A reading shows:
whether audit entries for writes inside an action transaction are lost, both on a booted app and on the scenario runner;
which table name or connection the transaction path uses.
Then the fix is made, with a pin that an in-transaction write leaves its audit row.
Parent: #34659.
Grade: p2 · domain:server · area:ai, reading first. Theme: performance and security (the audit trail). Raise it to p1 if the reading confirms that audit entries are lost on a real deployment.
Claim: PM loop round 8 (reading first) · 2026-11-17T23:51Z
Session: session_01WGufzfrh8TiPJf1i2kMSoa
Account: os-support-ai
Branch: claude/issue-35028-audit-write-in-action-tx (only once the reading names a fix the seat routes here)
Worktree: objectstack-issue-35028
Domain: domain:server
Seat: repo:objectstack#3
File surface: reading first, no file. Any fix is scoped by the reading and brought to the seat before code. A likely surface is the audit plugin's write path and the sandbox body-transaction routing (packages/runtime/src/sandbox/**, the audit writer), with their card-named tests or the packages' existing shared harness tests, plus a root .changeset/. ⛔ No packages/spec or metadata-protocol change without escalation.
Container & model: M, mode:subagent (area o3-H), model: TIER_DEFAULT, effort: high
Clause-②: no — the reading writes no code. A fix that narrows or changes a contract is escalated before code.
Metadata-protocol: none
Responsibility: objectstack: a write an action body makes inside ctx.api.transaction logs 'Audit write FAILED on sys_audit_log (no such table)', so the audit trail may have a gap exactly where agents act | none | every operator who relies on the audit trail for writes made by action bodies and agents
Thread-read: none
Premise: under reading. Seen in the #34998 repro's server logs (6963855363) on both 18.5.0 and origin/main 444301463: each write the action body made inside ctx.api.transaction logged the failure. Seed inserts outside a transaction did not. The log line names its two candidate causes: the table lives on the sibling telemetry datasource, and the write reached the primary.
Serial constraints cleared: n/a (reading)
Pre-claim lane: domain:server + area:ai, epic #34659. Routed to area o3-H by the seat at 23:29Z.
Pre-claim deps: none
Prior rulings read: triage filing (mailbox #32588, 6963882491). Thread: none on the card.
Lease o3-H (seat post #34584). Route: on a booted app and on the scenario runner, run an action body that writes inside ctx.api.transaction, then read sys_audit_log for its rows. Name which connection or table the transaction path uses (file:line). Say whether the rows are lost, and report it so the seat can regrade to p1 if they are. Then bring the fix route to the seat, with a pin that an in-transaction write leaves its audit row.
Result: yes, rows are lost on a real deployment. On origin/main 65ec3c50a, when an action body writes inside ctx.api.transaction and a telemetry datasource is registered, the business write commits but its sys_audit_log and sys_activity rows are lost. The API answers 200, and the loss logs one ERROR line per process. This happens on every os dev boot (sibling telemetry SQLite) and on a production os serve with OS_TELEMETRY_DB. Single-datasource deployments lose nothing. Proposed grade: p1 (p0 if cloud runs a Postgres primary with a telemetry datasource; see the Postgres row). The seat routes the fix: it changes a recorded ADR limit (below).
Measured rows (probe app: 2 inserts in tx, 1 plain insert, REST direct, 1 insert then throw in tx)
Layout
in-tx insert
plain / REST
in-tx rollback
os dev split (default)
2 business rows committed, 0 audit, 0 activity
audited
0 rows, 0 audit
os dev with OS_TELEMETRY_DB=0
2 + 2 audit
audited
business + audit both rolled back
os serve production, OS_TELEMETRY_DB set
same loss as dev split
audited
—
Postgres primary, single
4/4 audited
audited
nothing left
Postgres primary + telemetry driver (in-process only, no framework door produces it)
trio with 1 insert: audit statement 42P01, commitTransaction resolves, 0 business rows on disk (Postgres turned COMMIT into ROLLBACK); trio with 2 inserts: 25P02, body throws
—
—
18.5.0 shows the same failure (server-18.5.0.log:1244-1246 in the #34998 evidence).
Mechanism
packages/runtime/src/sandbox/quickjs-runner.ts:776-794: __txBegin uses ctx.api.beginTransaction() (the trio). Its comment at :731-734 says the handle never enters the engine's txStore.
packages/objectql/src/engine-scoped-context.ts:315-341: beginTransaction opens on the default driver (:333) and queues commit (:336), but never publishes to txStore, unlike transaction(cb) (runOpenedUnit, :234-245).
plugin-audit persistAuditTrailRow (audit-writers.ts:1514-1515) writes through api.sudo(), which carries the body's transaction handle along (engine-scoped-context.ts:115).
With txStore empty, both same-origin gates step aside: enforceTransactionOrigin (engine-execute-transactions.ts:259, if (!scope) return;) and transactionCoversDriverFor (engine-middleware-and-context.ts:441). So the primary's handle goes to the telemetry driver (engine-driver-options.ts:303-317, 378-379; ADR-0057 §3.6 routing at engine-secrets-and-routing.ts:248-250), and the statement runs on the primary connection, which has no sys_audit_log.
A (recommended): trio parity. Record the trio-opened handle's owner (a WeakMap keyed by handle, at engine-scoped-context.ts:333-337). Have both gates consult it when txStore is empty. Ledger rows then take the existing ambient 事务句柄跨数据源泄漏:凡在事务中执行的被审计写入,合规审计行全部静默丢失(#5226 的真实根因) #5351 carve-out: written on telemetry outside the body transaction, surviving a rollback as the orphan row the 2026-08-06 ruling accepted. A cross-datasource business write gets CrossDatasourceTransactionWriteError, which also closes the Postgres silent rollback. No IDataDriver change. It narrows ADR-0119's LIMIT paragraph to truly foreign handles, so it needs L2 or the maintainer.
B: defer ledger writes to commit for both paths. This reopens the 2026-08-06 ruling and is larger (commit-queue plumbing in the audit writer). Not recommended.
Workaround today:OS_TELEMETRY_DB=0.
Pins for A: a new describe in engine-transaction-same-origin.test.ts (trio handle attributed; audit lands on telemetry; cross-driver business write refused; same-datasource trio still one handle). The existing :558 case stays as the narrowed limit. Plus a runtime sandbox case under a split engine with plugin-audit, a live pg cell (an off-origin ledger write neither aborts nor silently rolls back), and the plugin-security case below.
A second, separate defect (independent of transactions)
action-execution.ts:3852 marks the body's ctx.api with the 'action' app-automation elevation. Platform sudo() (engine-scoped-context.ts:114-120) keeps an inherited mark. So plugin-security sees the platform's OWN audit and activity inserts as an app-authored append-only insert and warns (flow-system-identity-write-refusal.ts:288-312, via security-plugin-authz-middleware.ts:673). That contradicts its own contract at :63-66 ("platform code's sudo() … carry no mark"). This was measured on a plain, non-transaction action write on every layout. When the announced refusal ships, every action-body write's audit row would be refused everywhere. It needs the plugin-security owner's care, so app code cannot reach a mark-free sudo. Routed to the seat as its own card.
Scenario runner
auditActor reads sys_audit_log over REST (packages/qa/scenarios/src/runner/app.ts:309-317, called at orchestrate.ts:1622-1626). Under the dev layout, any operation whose write runs in an action-body transaction would grade audit-actor: named null (a false red). It explains none of the #34998 outcomes: there, op0 was NOT MEASURED on main, and on 18.5.0 it was downstream of the 30 s stall.
Not measured
The Postgres + telemetry layout through a public door. No framework producer exists, and a config-declared datasources.telemetry did not register. Cloud should check whether it runs this layout.
MySQL (no server here).
A scenario runner re-run (needs the AI driver).
Also noted: the "Audit write FAILED" fix text (audit-writers.ts ~1443-1460) lists two causes. This is a third (the table exists on telemetry, and a foreign transaction handle carried the write to the primary). Fold it into the fix.
This amends claim 6964496798 after reading 6964984927. The seat ruled route A at 2026-11-18 00:20Z. The fix is dispatched from this area at effort: high once a dev slot frees.
packages/objectql/src/engine-scoped-context.ts: the trio beginTransaction / commitTransaction / rollbackTransaction records the opened handle's owner (driver and datasource), keyed by handle.
packages/objectql/src/engine-middleware-and-context.ts (transactionCoversDriverFor) and packages/objectql/src/engine-execute-transactions.ts (enforceTransactionOrigin): both consult that owner when txStore holds no scope.
Their tests: engine-transaction-same-origin.test.ts and card-named tests beside it.
A runtime sandbox test under packages/runtime/src/sandbox/** or the action-execution harness, with plugin-audit loaded on a split engine.
A live-pg cell in packages/drivers/driver-sql if it costs little.
The plugin-audit "Audit write FAILED" fix text (packages/plugins/plugin-audit/src/audit-writers.ts ~1443-1460) may name the third cause.
docs/adr/0119-plugin-reachable-transactions-and-honest-atomic-batch.md: an add-only dated note under "The declared LIMIT of the same-origin gate", narrowing it to truly foreign handles.
A root .changeset/.
⛔ No IDataDriver / packages/spec change. The sudo() 'action' elevation-mark defect is out of scope; triage files it for the plugin-security owner.
Clause-②: yes (narrowing) — a business write inside a sandbox ctx.api.transaction that targets an object on a datasource other than the transaction's is now refused with CrossDatasourceTransactionWriteError. Before, it ran on the wrong connection.
Metadata-protocol: none
Governance: Tier H (docs/adr/**). The narrowing needs os-zhuang's APPROVED review on the current head. The seat runs its fable narrowing L2 after L1.
Premise: corrected by reading 6964984927 (rows lost on os dev and on production os serve with OS_TELEMETRY_DB; mechanism at file:line there).
Pins (seat ruling):
An action-body write in a transaction with a telemetry datasource keeps its sys_audit_log and sys_activity rows.
Single-datasource behaviour is unchanged.
A cross-datasource business write is refused with a named reason.
Regraded p2 → p1 (00:2xZ). The reading (area o3-H, 6964984927) confirms the card's own p1 condition, audit rows are lost:
When an action body writes inside ctx.api.transaction and a telemetry datasource is registered, the business row commits, but its sys_audit_log and sys_activity rows are lost.
The API answers 200, and one ERROR line per process is the only trace.
It happens on every os dev boot, and on os serve with OS_TELEMETRY_DB. Single-datasource layouts are unaffected.
Theme: performance and security (the audit trail). Seat route: A (record which driver owns each trio-opened handle), at o3-H.
Open question, relayed to the cloud lane (mailbox #34159): on a Postgres primary plus a telemetry driver, the reading measured the business write itself silently rolling back while the action reports success (in-process only; no framework door produces that layout). If hosted runs it, it may be p0 there. Workaround: OS_TELEMETRY_DB=0.
Claim: PM loop round 1 · 2026-11-18T03:45Z
Session: session_01JQwxbXGvw43spR79ztEvWt
Account: os-warren
Branch: claude/issue-35028-audit-write-in-action-tx
Worktree: objectstack-issue-35028
Domain: domain:server
Seat: repo:objectstack#1 (area o1-A)
File surface: the 12 paths of PR #35102 at 1ea3deab98; the remaining dev work is verification and the PR body only, plus any fix the battery forces inside these paths
Container & model: L, mode:subagent, model: judgment tier (implementation is done; the remaining work is the full battery and gate reconciliation), the narrowing L2 at CONTRACT_REVIEW_TIER, effort: high
Clause-②: yes
Metadata-protocol: none
Responsibility: objectstack objectql/runtime (ScopedContext transaction handle owner) | none | any action body writing inside ctx.api.transaction while audit runs; yes
Thread-read: 6968096049
Premise: holds (seat 3 hand-off on PR #35102 comment 6968079792; route A in claim amendment 6965031920)
Serial constraints cleared: overlap-check at 2026-11-18T03:45Z: clean with origin/main, #35089, #34978, #34817, #34709.
Resume-from: claude/issue-35028-audit-write-in-action-tx@1ea3deab98f4bd87cad11e6acfa28355b5766ee1
Pre-claim lane: packages/objectql, packages/runtime, docs/adr/** (ADR-0119 note) of PR #35102 — repo:objectstack whole-repo lane, area o1-A; Tier H, handed to seat 1 for the approver.
Pre-claim deps: no Blocked-by: on the card.
Prior rulings read: seat reading 6964984927 (route A); claim amendment 6965031920 (route A ruled; the sudo() action-mark defect is out of scope, now #35052); triage regrade 6965047110; cloud answer 6965538696.
Taking over seat 3's hand-off (seat 3 brief objectstack#34584 comment 6968205670; maintainer to seat 3, 2026-11-18 03:30Z: 「代码已推送,交给下一任,用信箱 交接给刚入座的 objectstack#1」; seat 1 split to area o1-A, maintainer 03:32Z: 「已经认领的4个 p1 也开工,不再认领新任务」 in the project thread). The card was released to pm:queue by seat 3, so this is a fresh claim that resumes the same branch and PR.
Owed, in order: full dogfood battery and gate reconciliation on the final head (os-dev), the PR body update and os-dev report, L1 (L1-a), the narrowing contract review, the Tier H seat record, then the approver; and the Skills-docs: follow-up card.
{
"issue": 35028,
"status": "done",
"branch": "claude/issue-35028-audit-write-in-action-tx",
"pr": "https://github.com/objectstack-ai/objectstack/pull/35102",
"session": "session_01JQwxbXGvw43spR79ztEvWt",
"premise_still_valid": true,
"summary": "Verification-only resume of seat 3's route-A implementation on head 1ea3deab98 (no new commit, files_changed 0). No merge from main was needed: GitHub mergeable clean, local merge-tree against main 0e46840fca conflict-free, main not red. Full build, the full dogfood battery, the dogfood typecheck and all 82 derived gate families are green on the final head; the PR body was patched through the relay (WIP line dropped, battery and gate results filled in), and the PR stays draft.",
"tests": "head 1ea3deab98. (1) pnpm build --concurrency=2 under os-verify-lock: Tasks 120 successful, 120 total; VERDICT command-exit 0. (2) pnpm --filter @objectstack/dogfood test under os-verify-lock (no shard, no path): Test Files 480 passed | 3 skipped (483); Tests 4075 passed | 68 skipped (4143); VERDICT command-exit 0; the new pin action-body-transaction-audit-split.dogfood.test.ts ran. (3) pnpm --filter @objectstack/dogfood typecheck: tsc --noEmit, VERDICT command-exit 0. No ablation this round: no tested behaviour changed (seat 3's ablation record stands in the PR body).",
"gates": "node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack on 1ea3deab98 after the full build: 82 commands, each run sequentially with exit captured before any pipe: 82 exit 0. --ran reconciliation (with ':: exit N' records): 'Run reconciliation — 82 derived, 82 run, 0 NOT-MEASURED, 0 UNRUN' / 'a DERIVED zero — all 82 recorded an exit code and none of them is 3'. check:dual-build-cjs-loads exit 0 (124 require entry points across 72 packages load). node scripts/pm/check-governed-merges.mjs --pr 35102: exit 3 = GOVERNED, Tier H, docs/adr/** x1 (ADR-0119), +705/-34 under the 3000 threshold. CI check-runs on head 1ea3deab98 (55 runs): Lint & Repo Gates success, TypeScript Type Check success, Test Core success (10/10 shards), Build Core success, Governed Surface Queue Guard success, Live E2E UI success, Test UI success, Dogfood Regression Gate success, Check Changeset success, PR-body guards success; Lint UI / Type Check UI / Build & E2E UI skipped by path filter.",
"dogfood_battery": "1ea3deab98 · os-verify-lock: VERDICT command-exit 0 · Test Files 480/480 run passed (3 skipped of 483) · Tests 4075/4075 run passed (68 skipped of 4143) · no failures",
"mcp_calls": "0",
"api_writes": "2 — (1) relay issue_patch on PR #35102 body (POST /repos/objectstack-ai/objectstack/dispatches, run 44240266808 success, read-back 11842 bytes sent = stored, identical); (2) this os-dev-report comment on #35028 via post-stamped.mjs. git push: 0 (no commit).",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: none · noted, not filed — dogfood battery logs show ERROR 'Schema sync FAILED for object showcase_invoice' on driver-sqlite-wasm (alter table add column invoice_date with a non-constant strftime default) and a SeedLoader roll-up recompute 'no such column: amount' following from it; log reading only, no public-door reach measured, unrelated to this diff."
]
}
Regraded p1 → p2 by the maintainer's grading principle of 2026-11-18, accepted in triage's session (「刚才你建议的分级调整,我全部接受」).
The principle, in order:
What a new user or a prospect meets first (looks and the main flow), the cloud core (Turso, hosted sign-up and onboarding, hosted install and upgrade, plans) and a developer's first contact come first.
Data loss or a permission breach in normal use stays first.
Details and rare configurations are improved over time.
Internal items are frozen.
Why this card: rare deployment: audit loss only with a separate telemetry datasource, which hosted does not register.
{
"issue": 35028,
"status": "done",
"branch": "claude/issue-35028-audit-write-in-action-tx",
"pr": "https://github.com/objectstack-ai/objectstack/pull/35102",
"session": "session_01JQwxbXGvw43spR79ztEvWt",
"premise_still_valid": true,
"summary": "Fix round for contract review S1 (6969574094). S1 confirmed by a test written before the fix: on 1ea3deab98 an async afterFind run, detached from an open trio handle, had its cross-datasource business write refused with CrossDatasourceTransactionWriteError. enforceTransactionOrigin now discards an explicit handle for which isClosedUnitHandle is true before reading the trio record (the same predicate buildDriverOptions uses); the rest of route A is unchanged. The ADR-0119 note gains an add-only paragraph (the detached run, and N1: a primitive handle stays unattributed); the PR's own changeset gains one sentence; the Skills-docs bullet left the body's Still owed list. N2 is not touched (seat files it). New head 91960c4f5a.",
"tests": "Disproof first, on 1ea3deab98 with no fix: engine-transaction-same-origin.test.ts 1 failed | 28 passed (29), received 'FAILED CrossDatasourceTransactionWriteError: insert of ledger inside transaction() resolves to datasource ledger_db, but the transaction is open on primary'. With the guard (fe13609b7b): 29/29 passed. Ablation E via scripts/ablation-replace.mjs (anchor '!this.isClosedUnitHandle(explicitTransaction)' x1 to x0, replacement marker x0 to x1, blob 9ed8195b6c32 to c224861e208a): 1 failed | 28 passed, the new pin red with the same refusal; restored, blob == HEAD, git diff HEAD empty. A first attempt whose replacement was a substring of the anchor was refused by the tool before any test ran (no-op, restored). The objectql tests import source, so no dist leg. On 91960c4f5a: objectql test 610 files / 13733 tests passed (VERDICT command-exit 0); objectql typecheck exit 0.",
"gates": "On 91960c4f5a after a full build (pnpm build --concurrency=2, 120/120, VERDICT command-exit 0): dispatch-gates --commands --repo objectstack-ai/objectstack derived 82, all 82 run, all exit 0; --ran: 'Run reconciliation — 82 derived, 82 run, 0 NOT-MEASURED, 0 UNRUN.' overlap-check VERDICT clean exit 0 before both pushes. check-governed-merges --pr 35102 exit 3 (GOVERNED, Tier H, 793 lines). CI on 91960c4f5a: Lint & Repo Gates success, TypeScript Type Check success, Build Core success, Governed Surface Queue Guard success, Live E2E UI success, Test UI success, Dogfood Regression Gate success, Check Changeset success; Test Core 9/10 success, Test Core (7/10) failure: plugin-security src/org-admin-assignment-boundary.posture.test.ts:1153 'Test timed out in 5000ms', the known flake tracked on #35111, no plugin-security path in this diff. The Lint & Repo Gates and TypeScript Type Check reds on fe13609b7b are cancellation aggregates (run cancelled 06:20Z by the 91960c4f5a push; every sub-lane cancelled).",
"dogfood_battery": "91960c4f5a · test: os-verify-lock VERDICT command-exit 0 · Test Files 480 passed | 3 skipped (483) · Tests 4075 passed | 68 skipped (4143) · no failures; typecheck: VERDICT command-exit 0",
"mcp_calls": "0",
"api_writes": "2 relay writes: issue_patch PR #35102 body (fleet-write run 44259895119, read-back identical 13839 bytes); comment on #35028 (this report, post-stamped.mjs). Plus 2 git pushes (fe13609b7b, 91960c4f5a), not REST.",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": []
}
PR #35102 (Tier H, narrowing) merged at 2026-11-18T08:42Z as a6cf988eb3afc4cbe23fac4caf71206943806c23, and its Fixes #35028 closed this card. Records at head 91960c4f, carried to the merge-only head d7aba967 (patch-id unchanged): L1-a ACCEPT 6972259586, contract review PASS 6972358126, seat record 6972399097. The maintainer readied the PR and armed auto-merge.
Follow-ups stay open on their own: #35149 (a committed trio handle should read as closed, not unattributed) and #35117 (Skills-docs). This stroke removes the pm:dispatched state label.
area:aiAI-native — agent / tool / skill metadata, and the MCP surface an agent drivesdomain:serverDomain lane — seat card indexed by label:pm:seatfindingRecorded observation — held, not dispatchable until the findings triage round grades itpriority:p2Medium: important, M3
Activity
objectstack-fleet commentedon Nov 17, 2026
repo:objectstack#3 · os-support-ai · session_01WGufzfrh8TiPJf1i2kMSoa
Claim: PM loop round 8 (reading first) · 2026-11-17T23:51Z
Session:
session_01WGufzfrh8TiPJf1i2kMSoaAccount:
os-support-aiBranch:
claude/issue-35028-audit-write-in-action-tx(only once the reading names a fix the seat routes here)Worktree:
objectstack-issue-35028Domain:
domain:serverSeat:
repo:objectstack#3File surface: reading first, no file. Any fix is scoped by the reading and brought to the seat before code. A likely surface is the audit plugin's write path and the sandbox body-transaction routing (
packages/runtime/src/sandbox/**, the audit writer), with their card-named tests or the packages' existing shared harness tests, plus a root.changeset/. ⛔ Nopackages/specor metadata-protocol change without escalation.Container & model:
M,mode:subagent(area o3-H),model: TIER_DEFAULT,effort: highClause-②: no — the reading writes no code. A fix that narrows or changes a contract is escalated before code.
Metadata-protocol: none
Responsibility:
objectstack: a write an action body makes inside ctx.api.transaction logs 'Audit write FAILED on sys_audit_log (no such table)', so the audit trail may have a gap exactly where agents act | none | every operator who relies on the audit trail for writes made by action bodies and agentsThread-read: none
Premise: under reading. Seen in the #34998 repro's server logs (6963855363) on both 18.5.0 and origin/main
444301463: each write the action body made insidectx.api.transactionlogged the failure. Seed inserts outside a transaction did not. The log line names its two candidate causes: the table lives on the sibling telemetry datasource, and the write reached the primary.Serial constraints cleared: n/a (reading)
Pre-claim lane:
domain:server+area:ai, epic #34659. Routed to area o3-H by the seat at 23:29Z.Pre-claim deps: none
Prior rulings read: triage filing (mailbox #32588, 6963882491). Thread: none on the card.
Lease
o3-H(seat post #34584). Route: on a booted app and on the scenario runner, run an action body that writes insidectx.api.transaction, then readsys_audit_logfor its rows. Name which connection or table the transaction path uses (file:line). Say whether the rows are lost, and report it so the seat can regrade to p1 if they are. Then bring the fix route to the seat, with a pin that an in-transaction write leaves its audit row.objectstack-fleet commentedon Nov 18, 2026
repo:objectstack#3 · os-support-ai · session_01WGufzfrh8TiPJf1i2kMSoa
Reading (area o3-H) · 2026-11-18T00:17Z
Result: yes, rows are lost on a real deployment. On origin/main
65ec3c50a, when an action body writes insidectx.api.transactionand atelemetrydatasource is registered, the business write commits but itssys_audit_logandsys_activityrows are lost. The API answers 200, and the loss logs one ERROR line per process. This happens on everyos devboot (sibling telemetry SQLite) and on a productionos servewithOS_TELEMETRY_DB. Single-datasource deployments lose nothing. Proposed grade: p1 (p0 if cloud runs a Postgres primary with atelemetrydatasource; see the Postgres row). The seat routes the fix: it changes a recorded ADR limit (below).Measured rows (probe app: 2 inserts in tx, 1 plain insert, REST direct, 1 insert then throw in tx)
os devsplit (default)os devwithOS_TELEMETRY_DB=0os serveproduction,OS_TELEMETRY_DBsettelemetrydriver (in-process only, no framework door produces it)commitTransactionresolves, 0 business rows on disk (Postgres turned COMMIT into ROLLBACK); trio with 2 inserts: 25P02, body throws18.5.0 shows the same failure (
server-18.5.0.log:1244-1246in the #34998 evidence).Mechanism
packages/runtime/src/sandbox/quickjs-runner.ts:776-794:__txBeginusesctx.api.beginTransaction()(the trio). Its comment at :731-734 says the handle never enters the engine'stxStore.packages/objectql/src/engine-scoped-context.ts:315-341:beginTransactionopens on the default driver (:333) and queues commit (:336), but never publishes totxStore, unliketransaction(cb)(runOpenedUnit, :234-245).persistAuditTrailRow(audit-writers.ts:1514-1515) writes throughapi.sudo(), which carries the body'stransactionhandle along (engine-scoped-context.ts:115).txStoreempty, both same-origin gates step aside:enforceTransactionOrigin(engine-execute-transactions.ts:259,if (!scope) return;) andtransactionCoversDriverFor(engine-middleware-and-context.ts:441). So the primary's handle goes to the telemetry driver (engine-driver-options.ts:303-317, 378-379; ADR-0057 §3.6 routing atengine-secrets-and-routing.ts:248-250), and the statement runs on the primary connection, which has nosys_audit_log.docs/adr/0119-…md:293-311, maintainer 2026-08-06 on ambient 事务句柄跨数据源泄漏:凡在事务中执行的被审计写入,合规审计行全部静默丢失(#5226 的真实根因) #5351/[spec] engine.transaction 契约收紧:opts.requirefail-closed、跨驱动拒绝、owned-vs-joined 信号(#4619 的契约半边,维护者已批 P2) #5696), pinned byengine-transaction-same-origin.test.ts:558. The premise behind it (an opaque handle with no owner) does not hold for a handle the trio itself opened:engine-scoped-context.ts:333holds the owning driver at begin.Fix routes (needs a decision, contract face)
engine-scoped-context.ts:333-337). Have both gates consult it whentxStoreis empty. Ledger rows then take the existing ambient 事务句柄跨数据源泄漏:凡在事务中执行的被审计写入,合规审计行全部静默丢失(#5226 的真实根因) #5351 carve-out: written on telemetry outside the body transaction, surviving a rollback as the orphan row the 2026-08-06 ruling accepted. A cross-datasource business write getsCrossDatasourceTransactionWriteError, which also closes the Postgres silent rollback. NoIDataDriverchange. It narrows ADR-0119's LIMIT paragraph to truly foreign handles, so it needs L2 or the maintainer.OS_TELEMETRY_DB=0.engine-transaction-same-origin.test.ts(trio handle attributed; audit lands on telemetry; cross-driver business write refused; same-datasource trio still one handle). The existing :558 case stays as the narrowed limit. Plus a runtime sandbox case under a split engine with plugin-audit, a live pg cell (an off-origin ledger write neither aborts nor silently rolls back), and the plugin-security case below.A second, separate defect (independent of transactions)
action-execution.ts:3852marks the body'sctx.apiwith the'action'app-automation elevation. Platformsudo()(engine-scoped-context.ts:114-120) keeps an inherited mark. So plugin-security sees the platform's OWN audit and activity inserts as an app-authored append-only insert and warns (flow-system-identity-write-refusal.ts:288-312, viasecurity-plugin-authz-middleware.ts:673). That contradicts its own contract at :63-66 ("platform code's sudo() … carry no mark"). This was measured on a plain, non-transaction action write on every layout. When the announced refusal ships, every action-body write's audit row would be refused everywhere. It needs the plugin-security owner's care, so app code cannot reach a mark-free sudo. Routed to the seat as its own card.Scenario runner
auditActorreadssys_audit_logover REST (packages/qa/scenarios/src/runner/app.ts:309-317, called atorchestrate.ts:1622-1626). Under the dev layout, any operation whose write runs in an action-body transaction would gradeaudit-actor: named null(a false red). It explains none of the #34998 outcomes: there, op0 was NOT MEASURED on main, and on 18.5.0 it was downstream of the 30 s stall.Not measured
datasources.telemetrydid not register. Cloud should check whether it runs this layout.Also noted: the "Audit write FAILED" fix text (
audit-writers.ts~1443-1460) lists two causes. This is a third (the table exists on telemetry, and a foreign transaction handle carried the write to the primary). Fold it into the fix.objectstack-fleet commentedon Nov 18, 2026
repo:objectstack#3 · os-support-ai · session_01WGufzfrh8TiPJf1i2kMSoa
Claim amendment (area o3-H) · 2026-11-18T00:20Z
This amends claim 6964496798 after reading 6964984927. The seat ruled route A at 2026-11-18 00:20Z. The fix is dispatched from this area at
effort: highonce a dev slot frees.Branch:
claude/issue-35028-audit-write-in-action-txFile surface:
packages/objectql/src/engine-scoped-context.ts: the triobeginTransaction/commitTransaction/rollbackTransactionrecords the opened handle's owner (driver and datasource), keyed by handle.packages/objectql/src/engine-middleware-and-context.ts(transactionCoversDriverFor) andpackages/objectql/src/engine-execute-transactions.ts(enforceTransactionOrigin): both consult that owner whentxStoreholds no scope.engine-transaction-same-origin.test.tsand card-named tests beside it.packages/runtime/src/sandbox/**or the action-execution harness, with plugin-audit loaded on a split engine.packages/drivers/driver-sqlif it costs little.packages/plugins/plugin-audit/src/audit-writers.ts~1443-1460) may name the third cause.docs/adr/0119-plugin-reachable-transactions-and-honest-atomic-batch.md: an add-only dated note under "The declared LIMIT of the same-origin gate", narrowing it to truly foreign handles..changeset/.⛔ No
IDataDriver/packages/specchange. The sudo()'action'elevation-mark defect is out of scope; triage files it for the plugin-security owner.Clause-②: yes (narrowing) — a business write inside a sandbox
ctx.api.transactionthat targets an object on a datasource other than the transaction's is now refused withCrossDatasourceTransactionWriteError. Before, it ran on the wrong connection.Metadata-protocol: none
Governance: Tier H (
docs/adr/**). The narrowing needs os-zhuang's APPROVED review on the current head. The seat runs its fable narrowing L2 after L1.Premise: corrected by reading 6964984927 (rows lost on
os devand on productionos servewithOS_TELEMETRY_DB; mechanism at file:line there).Pins (seat ruling):
telemetrydatasource keeps itssys_audit_logandsys_activityrows.Nothing else in the claim changes.
objectstack-fleet commentedon Nov 18, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Regraded p2 → p1 (00:2xZ). The reading (area o3-H, 6964984927) confirms the card's own p1 condition, audit rows are lost:
ctx.api.transactionand atelemetrydatasource is registered, the business row commits, but itssys_audit_logandsys_activityrows are lost.os devboot, and onos servewithOS_TELEMETRY_DB. Single-datasource layouts are unaffected.Theme: performance and security (the audit trail). Seat route: A (record which driver owns each trio-opened handle), at o3-H.
Open question, relayed to the cloud lane (mailbox #34159): on a Postgres primary plus a telemetry driver, the reading measured the business write itself silently rolling back while the action reports success (in-process only; no framework door produces that layout). If hosted runs it, it may be p0 there. Workaround:
OS_TELEMETRY_DB=0.7 remaining items
objectstack-fleet commentedon Nov 18, 2026
repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt
Claim: PM loop round 1 · 2026-11-18T03:45Z
Session:
session_01JQwxbXGvw43spR79ztEvWtAccount:
os-warrenBranch:
claude/issue-35028-audit-write-in-action-txWorktree:
objectstack-issue-35028Domain:
domain:serverSeat:
repo:objectstack#1(areao1-A)File surface: the 12 paths of PR #35102 at
1ea3deab98; the remaining dev work is verification and the PR body only, plus any fix the battery forces inside these pathsContainer & model:
L,mode:subagent,model: judgment tier (implementation is done; the remaining work is the full battery and gate reconciliation), the narrowing L2 at CONTRACT_REVIEW_TIER,effort: highClause-②: yes
Metadata-protocol: none
Responsibility:
objectstack objectql/runtime (ScopedContext transaction handle owner) | none | any action body writing inside ctx.api.transaction while audit runs; yesThread-read: 6968096049
Premise: holds (seat 3 hand-off on PR #35102 comment 6968079792; route A in claim amendment 6965031920)
Serial constraints cleared: overlap-check at 2026-11-18T03:45Z: clean with origin/main, #35089, #34978, #34817, #34709.
Resume-from:
claude/issue-35028-audit-write-in-action-tx@1ea3deab98f4bd87cad11e6acfa28355b5766ee1Pre-claim lane:
packages/objectql,packages/runtime,docs/adr/**(ADR-0119 note) of PR #35102 — repo:objectstack whole-repo lane, area o1-A; Tier H, handed to seat 1 for the approver.Pre-claim deps: no
Blocked-by:on the card.Prior rulings read: seat reading 6964984927 (route A); claim amendment 6965031920 (route A ruled; the sudo() action-mark defect is out of scope, now #35052); triage regrade 6965047110; cloud answer 6965538696.
Taking over seat 3's hand-off (seat 3 brief objectstack#34584 comment 6968205670; maintainer to seat 3, 2026-11-18 03:30Z: 「代码已推送,交给下一任,用信箱 交接给刚入座的 objectstack#1」; seat 1 split to area o1-A, maintainer 03:32Z: 「已经认领的4个 p1 也开工,不再认领新任务」 in the project thread). The card was released to
pm:queueby seat 3, so this is a fresh claim that resumes the same branch and PR.Owed, in order: full dogfood battery and gate reconciliation on the final head (os-dev), the PR body update and os-dev report, L1 (L1-a), the narrowing contract review, the Tier H seat record, then the approver; and the
Skills-docs:follow-up card.objectstack-fleet commentedon Nov 18, 2026
repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt
os-dev-report
{ "issue": 35028, "status": "done", "branch": "claude/issue-35028-audit-write-in-action-tx", "pr": "https://github.com/objectstack-ai/objectstack/pull/35102", "session": "session_01JQwxbXGvw43spR79ztEvWt", "premise_still_valid": true, "summary": "Verification-only resume of seat 3's route-A implementation on head 1ea3deab98 (no new commit, files_changed 0). No merge from main was needed: GitHub mergeable clean, local merge-tree against main 0e46840fca conflict-free, main not red. Full build, the full dogfood battery, the dogfood typecheck and all 82 derived gate families are green on the final head; the PR body was patched through the relay (WIP line dropped, battery and gate results filled in), and the PR stays draft.", "tests": "head 1ea3deab98. (1) pnpm build --concurrency=2 under os-verify-lock: Tasks 120 successful, 120 total; VERDICT command-exit 0. (2) pnpm --filter @objectstack/dogfood test under os-verify-lock (no shard, no path): Test Files 480 passed | 3 skipped (483); Tests 4075 passed | 68 skipped (4143); VERDICT command-exit 0; the new pin action-body-transaction-audit-split.dogfood.test.ts ran. (3) pnpm --filter @objectstack/dogfood typecheck: tsc --noEmit, VERDICT command-exit 0. No ablation this round: no tested behaviour changed (seat 3's ablation record stands in the PR body).", "gates": "node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack on 1ea3deab98 after the full build: 82 commands, each run sequentially with exit captured before any pipe: 82 exit 0. --ran reconciliation (with ':: exit N' records): 'Run reconciliation — 82 derived, 82 run, 0 NOT-MEASURED, 0 UNRUN' / 'a DERIVED zero — all 82 recorded an exit code and none of them is 3'. check:dual-build-cjs-loads exit 0 (124 require entry points across 72 packages load). node scripts/pm/check-governed-merges.mjs --pr 35102: exit 3 = GOVERNED, Tier H, docs/adr/** x1 (ADR-0119), +705/-34 under the 3000 threshold. CI check-runs on head 1ea3deab98 (55 runs): Lint & Repo Gates success, TypeScript Type Check success, Test Core success (10/10 shards), Build Core success, Governed Surface Queue Guard success, Live E2E UI success, Test UI success, Dogfood Regression Gate success, Check Changeset success, PR-body guards success; Lint UI / Type Check UI / Build & E2E UI skipped by path filter.", "dogfood_battery": "1ea3deab98 · os-verify-lock: VERDICT command-exit 0 · Test Files 480/480 run passed (3 skipped of 483) · Tests 4075/4075 run passed (68 skipped of 4143) · no failures", "mcp_calls": "0", "api_writes": "2 — (1) relay issue_patch on PR #35102 body (POST /repos/objectstack-ai/objectstack/dispatches, run 44240266808 success, read-back 11842 bytes sent = stored, identical); (2) this os-dev-report comment on #35028 via post-stamped.mjs. git push: 0 (no commit).", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "carrier: none · noted, not filed — dogfood battery logs show ERROR 'Schema sync FAILED for object showcase_invoice' on driver-sqlite-wasm (alter table add column invoice_date with a non-constant strftime default) and a SeedLoader roll-up recompute 'no such column: amount' following from it; log reading only, no public-door reach measured, unrelated to this diff." ] }objectstack-fleet commentedon Nov 18, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Regraded p1 → p2 by the maintainer's grading principle of 2026-11-18, accepted in triage's session (「刚才你建议的分级调整,我全部接受」).
The principle, in order:
Why this card: rare deployment: audit loss only with a separate telemetry datasource, which hosted does not register.
objectstack-fleet commentedon Nov 18, 2026
repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt
os-dev-report
{ "issue": 35028, "status": "done", "branch": "claude/issue-35028-audit-write-in-action-tx", "pr": "https://github.com/objectstack-ai/objectstack/pull/35102", "session": "session_01JQwxbXGvw43spR79ztEvWt", "premise_still_valid": true, "summary": "Fix round for contract review S1 (6969574094). S1 confirmed by a test written before the fix: on 1ea3deab98 an async afterFind run, detached from an open trio handle, had its cross-datasource business write refused with CrossDatasourceTransactionWriteError. enforceTransactionOrigin now discards an explicit handle for which isClosedUnitHandle is true before reading the trio record (the same predicate buildDriverOptions uses); the rest of route A is unchanged. The ADR-0119 note gains an add-only paragraph (the detached run, and N1: a primitive handle stays unattributed); the PR's own changeset gains one sentence; the Skills-docs bullet left the body's Still owed list. N2 is not touched (seat files it). New head 91960c4f5a.", "tests": "Disproof first, on 1ea3deab98 with no fix: engine-transaction-same-origin.test.ts 1 failed | 28 passed (29), received 'FAILED CrossDatasourceTransactionWriteError: insert of ledger inside transaction() resolves to datasource ledger_db, but the transaction is open on primary'. With the guard (fe13609b7b): 29/29 passed. Ablation E via scripts/ablation-replace.mjs (anchor '!this.isClosedUnitHandle(explicitTransaction)' x1 to x0, replacement marker x0 to x1, blob 9ed8195b6c32 to c224861e208a): 1 failed | 28 passed, the new pin red with the same refusal; restored, blob == HEAD, git diff HEAD empty. A first attempt whose replacement was a substring of the anchor was refused by the tool before any test ran (no-op, restored). The objectql tests import source, so no dist leg. On 91960c4f5a: objectql test 610 files / 13733 tests passed (VERDICT command-exit 0); objectql typecheck exit 0.", "gates": "On 91960c4f5a after a full build (pnpm build --concurrency=2, 120/120, VERDICT command-exit 0): dispatch-gates --commands --repo objectstack-ai/objectstack derived 82, all 82 run, all exit 0; --ran: 'Run reconciliation — 82 derived, 82 run, 0 NOT-MEASURED, 0 UNRUN.' overlap-check VERDICT clean exit 0 before both pushes. check-governed-merges --pr 35102 exit 3 (GOVERNED, Tier H, 793 lines). CI on 91960c4f5a: Lint & Repo Gates success, TypeScript Type Check success, Build Core success, Governed Surface Queue Guard success, Live E2E UI success, Test UI success, Dogfood Regression Gate success, Check Changeset success; Test Core 9/10 success, Test Core (7/10) failure: plugin-security src/org-admin-assignment-boundary.posture.test.ts:1153 'Test timed out in 5000ms', the known flake tracked on #35111, no plugin-security path in this diff. The Lint & Repo Gates and TypeScript Type Check reds on fe13609b7b are cancellation aggregates (run cancelled 06:20Z by the 91960c4f5a push; every sub-lane cancelled).", "dogfood_battery": "91960c4f5a · test: os-verify-lock VERDICT command-exit 0 · Test Files 480 passed | 3 skipped (483) · Tests 4075 passed | 68 skipped (4143) · no failures; typecheck: VERDICT command-exit 0", "mcp_calls": "0", "api_writes": "2 relay writes: issue_patch PR #35102 body (fleet-write run 44259895119, read-back identical 13839 bytes); comment on #35028 (this report, post-stamped.mjs). Plus 2 git pushes (fe13609b7b, 91960c4f5a), not REST.", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [] }objectstack-fleet commentedon Nov 18, 2026
repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt
Close-out · 2026-11-18T08:42Z
PR #35102 (Tier H, narrowing) merged at 2026-11-18T08:42Z as
a6cf988eb3afc4cbe23fac4caf71206943806c23, and itsFixes #35028closed this card. Records at head91960c4f, carried to the merge-only headd7aba967(patch-id unchanged): L1-a ACCEPT 6972259586, contract review PASS 6972358126, seat record 6972399097. The maintainer readied the PR and armed auto-merge.Follow-ups stay open on their own: #35149 (a committed trio handle should read as closed, not unattributed) and #35117 (Skills-docs). This stroke removes the
pm:dispatchedstate label.