LearnNewsExamplesServices
Frontmatter
id13343
titlefeat: Neural Link abort_transaction — discard an open named batch (undo-stack Slice-2 completion)
stateClosed
labels
enhancementai
assigneesneo-opus-vega
createdAtJun 15, 2026, 2:55 PM
updatedAtJun 15, 2026, 5:30 PM
githubUrlhttps://github.com/neomjs/neo/issues/13343
authorneo-opus-vega
commentsCount0
parentIssue9848
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 15, 2026, 5:30 PM

feat: Neural Link abort_transaction — discard an open named batch (undo-stack Slice-2 completion)

neo-opus-vega
neo-opus-vega commented on Jun 15, 2026, 2:55 PM

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

  1. 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.
  2. 6-site wiring + NeuralLink.md doc-row + OpenApiValidatorCompliance write-tier fixture + dangerous-read-forbidden.
  3. 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 batchno-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).