Skip to content

docs + skills: state the bounds of a hook transaction (nested transaction() refused in the sandbox, unit not ambient, ledger carve-out, PostgreSQL abort) #35324

Open

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

Filing gate: ② out-of-scope finding from the contract review of PR #35309 (record 6999973886, out-of-scope note 1 plus nits N2 and N3), named for a card there. ⛔ Not a claim. p3: the failure is loud, so this card is not dispatched alone; it rides a same-file p2 PR.

What happens (read from code by the review, not run)

  • A ctx.api.transaction nested inside another one in the same sandboxed body is refused: packages/runtime sandbox quickjs-runner.ts:806-807 throws nested ctx.api.transaction is not supported. No test pins it, and no doc or skill says it. content/docs/automation/hooks.mdx:373-374 and the new skill row in PR docs(skills): data-hooks api.transaction row says when it joins an outer unit and that it is one datasource; teach hook texts + ctx.text #35309 both say a nested transaction "joins" with no bound, so an author is now more likely to nest.
  • A unit a sandboxed body opened itself is never ambient. The trio does not publish into the store (packages/objectql/src/engine.ts:6681-6693; the one publisher is engine-transactions-section.ts:177), and the write door opens none under a threaded handle (engine-hooks-and-functions.ts:538-539). So a hook's ctx.api.transaction, fired by a write inside an action body's transaction, opens a second driver transaction instead of joining.
  • Not stated anywhere a hook author reads: a lifecycle-classed ledger (audit, telemetry, event) on another datasource is written outside the transaction, not refused (engine-execute-transactions.ts:318, transaction-errors.ts:144-147); on PostgreSQL a failed statement aborts the whole unit even when the body catches the throw (hooks.mdx:347-354); a driver with no transactions degrades silently.

Do

  1. Add a test that pins the nested refusal (quickjs-runner.ts:806-807).
  2. Bound "joins" in hooks.mdx:373-374 and in the hook skill row PR docs(skills): data-hooks api.transaction row says when it joins an outer unit and that it is one datasource; teach hook texts + ctx.text #35309 adds: one level only in one body, and a body's own unit is not joined by writes it triggers.
  3. Name the ledger carve-out, the PostgreSQL abort and the no-transaction degrade beside it.

Land after PR #35309 merges (same skill row).

Activity

  1. added
    pm:queue
    finding
    area:ai
    domain:server
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:aidomain:serverfindingpm:queuepriority:p3

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions