Summary
The third batch-lifecycle tool, completing the begin_transaction / commit_transaction / abort_transaction triad (#13331). abort_transaction discards the writer's currently-open named batch without committing it — the open transaction is aborted (dropped, never undoable). The TransactionService.abort core already exists (shipped with #13230); this is the thin tool surface.
Today the only escape from an open named batch is commit_transaction; an agent that opened a batch and decides not to keep it as an undoable unit has no clean discard. abort_transaction provides it.
Semantic (decided — open to review objection)
abort_transaction = discard the undo-RECORD, NOT a UI rollback. The open batch's reverse-ops are dropped (status: aborted); the forward mutations remain applied to the UI (they were enforcement-granted + dispatched when made). This is the clean primitive matching the core abort.
- It does NOT re-dispatch the reverses to revert the UI (that would be a rollback, a distinct/more-complex operation).
- Rollback is composable (an agent that wants the changes reverted can
undo them before aborting) or a future rollback_transaction tool — explicitly out of scope here.
(Flagging the just-drop-vs-rollback choice for the reviewer: I under-specified it in #13331's out-of-scope note; just-drop is the faithful MVP primitive, but say so if you read the use case differently.)
Acceptance Criteria
abort_transaction() write tool: aborts the writer's open named batch via TransactionService.abort → {aborted: true, txId}. Fail-closed: no writer identity → no-writer-identity; no stack authority → no-transaction-service; no open batch → no-open-transaction.
- 6-site wiring +
NeuralLink.md doc-row + OpenApiValidatorCompliance write-tier fixture + dangerous-read-forbidden.
- Unit (abort drops the open batch; the committed stack + redo branch are untouched; fail-closed paths) + compliance (tier, doc==openapi parity via #13318) green.
Contract Ledger — abort_transaction (T3, public MCP tool)
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback / Edge Case |
Docs |
Evidence |
abort_transaction MCP tool — POST /instance/abort_transaction (write-locked tier) |
this ticket + #9848 + #13331 (named-batching); Neo.ai.TransactionService#abort |
Aborts the writer's open named batch (open → aborted, dropped, never undoable) → {aborted: true, txId}. The UI changes remain applied; only the undo-record is discarded. |
No identity → {aborted: false, reason: 'no-writer-identity'}; no stack authority → no-transaction-service; no open batch → no-open-transaction (idempotent — nothing to abort). |
openapi.yaml /instance/abort_transaction + AbortTransactionRequest; NeuralLink.md row |
L1: InstanceServiceNamedTransaction.spec (abort drops the open batch; committed/redo untouched; fail-closed); OpenApiValidatorCompliance.spec (write-locked tier + dangerous-read); GuideToolParity.spec |
abort_transaction semantic |
#13331 |
Discard-the-undo-record (NOT a UI rollback). Rollback = composable (undo before abort) or a future tool. |
— |
NeuralLink.md + JSDoc coupling note |
— |
Context
Parent: #9848 (undo-stack umbrella). Refs #13012 (Agent Harness Pillar-2), #13331 (named-batching — the begin/commit pair this completes). Core: src/ai/TransactionService.mjs abort. Method site: src/ai/client/InstanceService.mjs.
Authored by Claude Opus 4.8 (Claude Code), @neo-opus-vega (Vega).
Summary
The third batch-lifecycle tool, completing the
begin_transaction/commit_transaction/abort_transactiontriad (#13331).abort_transactiondiscards the writer's currently-open named batch without committing it — the open transaction is aborted (dropped, never undoable). TheTransactionService.abortcore already exists (shipped with #13230); this is the thin tool surface.Today the only escape from an open named batch is
commit_transaction; an agent that opened a batch and decides not to keep it as an undoable unit has no clean discard.abort_transactionprovides it.Semantic (decided — open to review objection)
abort_transaction= discard the undo-RECORD, NOT a UI rollback. The open batch's reverse-ops are dropped (status: aborted); the forward mutations remain applied to the UI (they were enforcement-granted + dispatched when made). This is the clean primitive matching the coreabort.undothem before aborting) or a futurerollback_transactiontool — explicitly out of scope here.(Flagging the just-drop-vs-rollback choice for the reviewer: I under-specified it in #13331's out-of-scope note; just-drop is the faithful MVP primitive, but say so if you read the use case differently.)
Acceptance Criteria
abort_transaction()write tool: aborts the writer's open named batch viaTransactionService.abort→{aborted: true, txId}. Fail-closed: no writer identity →no-writer-identity; no stack authority →no-transaction-service; no open batch →no-open-transaction.NeuralLink.mddoc-row +OpenApiValidatorCompliancewrite-tier fixture + dangerous-read-forbidden.Contract Ledger —
abort_transaction(T3, public MCP tool)abort_transactionMCP tool —POST /instance/abort_transaction(write-lockedtier)Neo.ai.TransactionService#abortopen → aborted, dropped, never undoable) →{aborted: true, txId}. The UI changes remain applied; only the undo-record is discarded.{aborted: false, reason: 'no-writer-identity'}; no stack authority →no-transaction-service; no open batch →no-open-transaction(idempotent — nothing to abort).openapi.yaml/instance/abort_transaction+AbortTransactionRequest;NeuralLink.mdrowInstanceServiceNamedTransaction.spec(abort drops the open batch; committed/redo untouched; fail-closed);OpenApiValidatorCompliance.spec(write-locked tier + dangerous-read);GuideToolParity.specabort_transactionsemanticundobeforeabort) or a future tool.NeuralLink.md+ JSDoc coupling noteContext
Parent: #9848 (undo-stack umbrella). Refs #13012 (Agent Harness Pillar-2), #13331 (named-batching — the begin/commit pair this completes). Core:
src/ai/TransactionService.mjsabort. Method site:src/ai/client/InstanceService.mjs.Authored by Claude Opus 4.8 (Claude Code), @neo-opus-vega (Vega).