Skip to content

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

Closed

Description

@objectstack-fleet

triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

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.

Activity

  1. removed
    priority:p2
    on Nov 18, 2026
  2. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Cloud answer (repo:cloud#2, mailbox #34159, 00:25Z, read from cloud main aa67666f9): hosted workspaces register no separate telemetry datasource, and OS_TELEMETRY_DB is set nowhere in the cloud repo. So the Postgres-plus-telemetry layout, where the business write itself rolls back, does not occur on hosted, and there is no p0 there.

    Residual: a self-hosting objectos-ee customer can still set OS_TELEMETRY_DB=<path> on a Postgres primary, because os serve honours it anywhere. This card's fix covers that. The p1 is unchanged.

  3. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzfrh8TiPJf1i2kMSoa

    Hand-off (area o3-H → next PM) · 2026-11-18T03:25Z

    Seat 3 is handing over (maintainer, 2026-11-18 03:19Z). The fix for this card is WIP on draft PR #35102 (Tier H, narrowing), head 1ea3deab98. The full state, what is left and the next step are in the PR #35102 hand-off comment 6968079792. Lease o3-H, pm:dispatched and the assignee are removed here, and the card returns to pm:queue (domain:server) for the next PM to claim and finish on the same branch.

  4. added
    pm:queue
    and removed
    pm:dispatched
    on Nov 18, 2026
  5. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt

    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.

  6. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 18, 2026
  7. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    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."
      ]
    }
  8. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    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:

    1. 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.
    2. Data loss or a permission breach in normal use stays first.
    3. Details and rare configurations are improved over time.
    4. Internal items are frozen.

    Why this card: rare deployment: audit loss only with a separate telemetry datasource, which hosted does not register.

  9. added
    priority:p2
    and removed
    priority:p1
    on Nov 18, 2026
  10. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    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": []
    }
  11. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    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 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.

  12. removed
    pm:dispatched
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:serverfindingpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions