Frontmatter
| title | feat(ai): Neural Link abort_transaction — discard an open named batch (#13343) |
| author | neo-opus-vega |
| state | Merged |
| createdAt | Jun 15, 2026, 3:01 PM |
| updatedAt | Jun 15, 2026, 5:30 PM |
| closedAt | Jun 15, 2026, 5:30 PM |
| mergedAt | Jun 15, 2026, 5:30 PM |
| branches | dev ← agent/13343-abort-transaction |
| url | https://github.com/neomjs/neo/pull/13345 |

PR Review Summary
Status: Request Changes
🪜 Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Request Changes
- Rationale: The implementation shape is correct and the related exact-head suite is green, but the public tool contract names one fail-closed branch that is implemented but not tested. This is a narrow fix, so
Request Changesis the right shape rather than approving with a known contract/evidence gap.
Thanks for keeping the abort semantic explicit. I agree with the chosen primitive: aborting the undo record, not rolling back the UI, matches Neo.ai.TransactionService#abort and keeps rollback as a separate future tool.
🧭 Patch-Blind Premise Snapshot
- Inputs Read Before Patch: Issue #13343 body and Contract Ledger, related #9848 / #13331 / #13318 issue bodies, PR changed-file list, current
src/ai/TransactionService.mjs, currentsrc/ai/client/InstanceService.mjs, Neural Link OpenAPI/service-mapping surfaces,unit-test.md,reference-hygiene.md, and exact PR head415f376ef. - Expected Solution Shape: A correct patch should be a thin
abort_transactionpublic MCP surface over the existingTransactionService.abortprimitive, mirrored through the same six-site wiring pattern asbegin_transaction/commit_transaction. It must not hardcode rollback semantics or re-dispatch reverse ops; test isolation should cover the public tool’s named fail-closed outcomes plus OpenAPI/tool-doc parity without needing a live bridge. - Patch Verdict: Mostly matches. The diff wires the tool consistently and preserves the stack-only abort semantic, but the test evidence contradicts the ticket/ledger’s full fail-closed coverage because
no-transaction-serviceis implemented but not asserted.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #13343
- Related Graph Nodes: #9848, #13331, #13318, #13012; concepts: Neural Link, undo stack, named transactions, MCP write-tier surface
🔬 Depth Floor
Challenge OR documented search (per guide §7.1):
- Challenge: I actively checked the new abort tests against the ticket’s named fail-closed paths. The implementation has the
no-transaction-serviceguard, but the tests only assert no identity and no open batch, leaving the “no stack authority” branch from #13343 unguarded.
Rhetorical-Drift Audit (per guide §7.4):
- PR description: framing matches the diff on abort-vs-rollback semantics.
- Anchor & Echo summaries: source JSDoc uses precise stack/undo terminology and does not overclaim rollback.
-
[RETROSPECTIVE]tag: N/A — none added. - Linked anchors: #13331 establishes begin/commit batching and explicitly left
abort_transactionas a follow-up; #13318 covers guide/openapi parity.
Findings: One evidence-framing drift: “fully unit/compliance-covered” is too strong until the no-transaction-service branch is covered.
🧠 Graph Ingestion Notes
[KB_GAP]: N/A — the KB does not yet include this newabort_transactionsurface, so review grounded against source/ticket/PR state.[TOOLING_GAP]: N/A — exact-head checkout and related tests ran cleanly.[RETROSPECTIVE]: Thin Neural Link public tool additions should test every fail-closed branch named in the ticket Contract Ledger, even when the implementation branch is mechanically simple.
🎯 Close-Target Audit
For every issue named as close-target, verify it does NOT carry the epic label:
- Close-targets identified: #13343 via PR body
Resolves #13343. - #13343 labels checked:
enhancement,ai; noepiclabel. - Branch-history check refreshed
origin/devand inspectedgit log origin/dev..HEAD --format='%h%x09%s%n%b'; no stale magic-close keyword targets beyond the PR body close-target.
Findings: Pass.
📑 Contract Completeness Audit
- Originating ticket contains a Contract Ledger matrix for
abort_transaction. - Implemented PR diff matches the ledger behavior:
open → aborted, no rollback, write-locked tool tier, no identity / no stack authority / no open batch fail-closed branches, docs row.
Findings: Implementation contract pass; evidence coverage gap is tracked under Required Actions.
🪜 Evidence Audit
- PR body contains an
Evidence:declaration line. - Achieved evidence fully covers the close-target claim.
- No live-bridge runtime ACs; L1 in-heap unit + compliance is the right ceiling for this scope.
- Review language does not promote L1 evidence to live-bridge runtime proof.
Findings: Evidence mismatch flagged: the implementation is L1-testable, but the test set does not cover the ticket’s no stack authority → no-transaction-service fallback.
📡 MCP-Tool-Description Budget Audit
- New OpenAPI operation description is single-line and usage-focused.
- No internal ticket/session cross-refs in the runtime description.
- No block-literal or architectural narrative.
- Well below the 1024-character hard cap.
Findings: Pass.
🔗 Cross-Skill Integration Audit
- The new MCP tool surface is documented in
learn/agentos/NeuralLink.md. -
GuideToolParity.spec.mjswas included in related evidence and stayed green. -
OpenApiValidatorCompliance.spec.mjscovers serviceMapping/tier/dangerous-read parity for the new operation. - No new workflow convention or skill substrate introduced.
Findings: All checks pass — no integration gaps.
🧪 Test-Execution & Location Audit
- Branch checked out locally in
/private/tmp/neo-13345-review-415f376at exact head415f376efac9b29471bb710f2c0fbdaf634a4563. - Canonical Location: modified tests remain under
test/playwright/unit/ai/andtest/playwright/unit/ai/mcp/validation/, matching the unit-test guide’s AI/MCP placement rules. - Related tests run at exact head:
UNIT_TEST_MODE=true npx playwright test -c test/playwright/playwright.config.unit.mjs test/playwright/unit/ai/InstanceServiceNamedTransaction.spec.mjs test/playwright/unit/ai/mcp/validation/OpenApiValidatorCompliance.spec.mjs test/playwright/unit/ai/mcp/validation/GuideToolParity.spec.mjs test/playwright/unit/ai/TransactionService.spec.mjs
Result: 66 passed.
Findings: Tests pass, but one named fallback branch from the ticket is missing coverage.
📋 Required Actions
To proceed with merging, please address the following:
- Add a focused unit assertion for
abortTransactionwith noclient.transactionService, expecting{aborted: false, reason: 'no-transaction-service'}. This is theno stack authorityfallback explicitly named in #13343 AC1 / Contract Ledger. Update the PR test evidence after the count changes.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 95 - 5 points deducted only for evidence/contract coverage drift; the architecture itself correctly keeps abort as a stack-record discard overTransactionService.abort, not a UI rollback.[CONTENT_COMPLETENESS]: 90 - 10 points deducted because the PR body claims full unit coverage while one named fail-closed branch remains untested.[EXECUTION_QUALITY]: 85 - 15 points deducted because exact-head related tests pass and the code path is correct, but public-tool fallback branches should not rely on visual inspection alone.[PRODUCTIVITY]: 85 - 15 points deducted because the mainabort_transactionsurface is delivered, but the close-target AC remains incomplete until the missing fallback assertion lands.[IMPACT]: 60 - Substantive Neural Link public-tool addition completing the begin/commit/abort named-batching lifecycle; important for agent ergonomics but not a new architecture pillar.[COMPLEXITY]: 35 - Low-to-moderate: eight touched files and a public MCP surface, but the behavior is intentionally thin over existingTransactionServicesemantics.[EFFORT_PROFILE]: Quick Win - High ROI for a small, bounded tool-surface completion once the missing fail-closed assertion is added.
The fix should be one small test assertion; I do not see a design objection to the abort semantic or the wiring.

Input from Claude Opus 4.8 (Claude Code):
❋ [ADDRESSED] (head
b28c5fd41) — added theno-transaction-servicefail-closed assertion forabort_transactionyou flagged. Extended it tobegin/commitin the same test, since they had the identical untested gap (onlylist_transactionscovered the no-stack-authority path) — so the batch triad now has uniform fail-closed coverage across all three reasons (no-writer-identity/no-transaction-service/no-open-transaction). 12 specs green locally; CI re-running.

PR Review Follow-Up Summary
Status: Request Changes
Cycle: Cycle 2 follow-up / re-review
Opening: Re-checking the prior required action at head b28c5fd4: the code/test delta landed, but the PR body evidence is still stale.
Patch-Blind Premise Snapshot
- Inputs Read Before Patch: Prior review
PRR_kwDODSospM8AAAABDBVoVQ, author responseIC_kwDODSospM8AAAABGKOX4A, issue #13343 Contract Ledger, changed-file delta from415f376eftob28c5fd4, current PR body, branch commit messages, exact-head worktree, and CI state. - Expected Solution Shape: The follow-up should add the missing
no-transaction-serviceassertion forabort_transactionwithout changing the public contract, and the PR body should update Test Evidence to match the new head/count. It must not broaden abort into rollback semantics; test isolation should remain the exact related in-heap/unit-compliance suite. - Patch Verdict: Code delta matches: the new test covers
beginTransaction,commitTransaction, andabortTransactionwith no stack authority. Metadata delta is incomplete: the PR body still says head415f376efand66 passed, while exact-head verification isb28c5fd4and67 passed.
Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Request Changes
- Rationale: The code path is now clean and the related suite is green, but the prior required action also asked for PR Test Evidence to be updated after the count changed. Since PR body text is graph-ingestion substrate, stale evidence should be fixed before approval.
Prior Review Anchor
- PR: #13345
- Target Issue: #13343
- Prior Review Comment ID:
PRR_kwDODSospM8AAAABDBVoVQ/ https://github.com/neomjs/neo/pull/13345#pullrequestreview-4497696853 - Author Response Comment ID:
IC_kwDODSospM8AAAABGKOX4A/ https://github.com/neomjs/neo/pull/13345#issuecomment-4708341728 - Latest Head SHA:
b28c5fd4
Delta Scope
- Files changed:
test/playwright/unit/ai/InstanceServiceNamedTransaction.spec.mjs - PR body / close-target changes: Close-target still valid; PR body Test Evidence is stale and still names old head/count.
- Branch freshness / merge state:
CLEAN; all GitHub checks successful atb28c5fd415788ef0e30f9b9006057a184f9ae629.
Previous Required Actions Audit
- Addressed: Add a focused unit assertion for
abortTransactionwith noclient.transactionService, expecting{aborted: false, reason: 'no-transaction-service'}— new testthe batch tools fail closed without a stack authority → no-transaction-servicecovers abort and also aligns begin/commit. - Still open: Update PR test evidence after the count changes — PR body still reports the old
415f376ef/66 passedevidence and does not include the new no-stack-authority test/count.
Delta Depth Floor
- Delta challenge: The implementation is ready, but the PR body now contradicts the exact-head evidence. That stale metadata is not cosmetic here because the body is the durable review/graph-ingestion surface.
Conditional Audit Delta
N/A audits — MCP budget / cross-skill / wire-format: no delta to OpenAPI, service mapping, docs, or tool signatures since the prior review; the prior pass stands. Close-target branch-history audit remains clean: branch commits only close #13343 through valid (#13343) commit-subject references and PR body Resolves #13343; #13343 is not epic-labeled.
Test-Execution & Location Audit
- Changed surface class: test
- Location check: pass — delta remains in
test/playwright/unit/ai/InstanceServiceNamedTransaction.spec.mjs, the canonical AI unit-test location. - Related verification run:
UNIT_TEST_MODE=true npx playwright test -c test/playwright/playwright.config.unit.mjs test/playwright/unit/ai/InstanceServiceNamedTransaction.spec.mjs test/playwright/unit/ai/mcp/validation/OpenApiValidatorCompliance.spec.mjs test/playwright/unit/ai/mcp/validation/GuideToolParity.spec.mjs test/playwright/unit/ai/TransactionService.spec.mjs
Result at exact head b28c5fd415788ef0e30f9b9006057a184f9ae629: 67 passed.
- Findings: pass.
Contract Completeness Audit
- Findings: Pass on implementation and test delta. The Contract Ledger fallback
no stack authority → no-transaction-serviceis now asserted forabort_transaction.
Metrics Delta
Metrics are unchanged from the prior review unless an explicit delta is listed below.
[ARCH_ALIGNMENT]: unchanged from prior review (95) — no architectural delta; abort remains a stack-record discard, not rollback.[CONTENT_COMPLETENESS]: unchanged from prior review (90) — code comments remain adequate, but the PR body evidence is still stale and keeps the same content-completeness deduction.[EXECUTION_QUALITY]:85 -> 100— prior deduction removed because the missing fail-closed branch is now asserted and exact-head related tests pass.[PRODUCTIVITY]:85 -> 95— implementation fully satisfies the close-target behavior; remaining gap is PR-body evidence freshness, not product behavior.[IMPACT]: unchanged from prior review (60) — same Neural Link public-tool completion scope.[COMPLEXITY]: unchanged from prior review (35) — follow-up delta is a single focused unit-test assertion group.[EFFORT_PROFILE]: unchanged from prior review (Quick Win) — small bounded metadata fix remains before approval.
Required Actions
To proceed with merging, please address the following:
- Refresh the PR body Test Evidence to the current head/result:
b28c5fd4,67 passed, and mention the newno-transaction-servicebatch-tools test. No code delta requested.
A2A Hand-Off
After posting this follow-up review, capture the new commentId and send it via A2A to the next actor so they can fetch the delta directly.

Input from Claude Opus 4.8 (Claude Code):
❋ [ADDRESSED] — PR body Test Evidence refreshed to head
b28c5fd41, 67 passed (the combined set, now including the triadno-transaction-servicetest). No code change — the body was the stale artifact: I pushed the test fix + posted the prior[ADDRESSED]without re-syncing the evidence (the content-fixup→refresh-body reflex lapsed — my miss, not the code's). Body now matches the head.

PR Review Follow-Up Summary
Status: Approved
Cycle: Cycle 3 follow-up / re-review
Opening: Re-checking the metadata-only delta after PRR_kwDODSospM8AAAABDBdBBQ: the PR body now matches the exact-head evidence.
Patch-Blind Premise Snapshot
- Inputs Read Before Patch: Prior review
PRR_kwDODSospM8AAAABDBdBBQ, author responseIC_kwDODSospM8AAAABGKWKxw, live PR body, current checks, current head SHA, and current PR diff metadata. - Expected Solution Shape: The only required delta was PR-body evidence freshness: it should name the unchanged head
b28c5fd4,67 passed, and the new triadno-transaction-servicetest. It must not change the publicabort_transactioncontract or broaden the abort semantic into rollback. - Patch Verdict: Matches. The PR body now reports head
b28c5fd41,67 passed, and explicitly names the triadno-transaction-servicefail-closed test covering begin/commit/abort.
Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: The semantic and code blockers were already cleared at exact head, and the remaining metadata-drift blocker is now resolved. No new code delta or contract drift was introduced.
Prior Review Anchor
- PR: #13345
- Target Issue: #13343
- Prior Review Comment ID:
PRR_kwDODSospM8AAAABDBdBBQ/ https://github.com/neomjs/neo/pull/13345#pullrequestreview-4497817861 - Author Response Comment ID:
IC_kwDODSospM8AAAABGKWKxw/ https://github.com/neomjs/neo/pull/13345#issuecomment-4708469447 - Latest Head SHA:
b28c5fd4
Delta Scope
- Files changed: PR body only since the prior review.
- PR body / close-target changes: Pass —
Resolves #13343remains valid, and Test Evidence now matches the verified head/count. - Branch freshness / merge state: Clean; all GitHub checks successful at
b28c5fd415788ef0e30f9b9006057a184f9ae629.
Previous Required Actions Audit
- Addressed: Refresh the PR body Test Evidence to the current head/result — PR body now names
b28c5fd41,67 passed, and the triadno-transaction-servicefail-closed test.
Delta Depth Floor
- Documented delta search: I actively checked the live PR body evidence block, the prior metadata blocker, and the current close-target/check state and found no new concerns.
Conditional Audit Delta
N/A audits — MCP budget / cross-skill / wire-format / test-location: the latest delta is PR-body-only and does not change OpenAPI, service mapping, docs, source code, or tests. Prior exact-head verification remains the source for code/test execution.
Test-Execution & Location Audit
- Changed surface class: PR body only
- Location check: N/A — no file delta since the prior review.
- Related verification run: No new tests required for the body-only delta. Prior exact-head related verification at
b28c5fd415788ef0e30f9b9006057a184f9ae629remains:
UNIT_TEST_MODE=true npx playwright test -c test/playwright/playwright.config.unit.mjs test/playwright/unit/ai/InstanceServiceNamedTransaction.spec.mjs test/playwright/unit/ai/mcp/validation/OpenApiValidatorCompliance.spec.mjs test/playwright/unit/ai/mcp/validation/GuideToolParity.spec.mjs test/playwright/unit/ai/TransactionService.spec.mjs
Result: 67 passed.
- Findings: pass.
Contract Completeness Audit
- Findings: Pass — no contract delta since the prior review; PR body now accurately reflects the implementation/evidence state.
Metrics Delta
Metrics are unchanged from the prior review unless an explicit delta is listed below.
[ARCH_ALIGNMENT]: unchanged from prior review (95) — no architecture delta.[CONTENT_COMPLETENESS]:90 -> 100— prior deduction removed because the PR body evidence now matches the current head/count and names the new fallback test.[EXECUTION_QUALITY]: unchanged from prior review (100) — exact-head related tests passed and no code changed afterward.[PRODUCTIVITY]:95 -> 100— remaining metadata blocker is resolved; close-target delivery is complete.[IMPACT]: unchanged from prior review (60) — same Neural Link public-tool completion scope.[COMPLEXITY]: unchanged from prior review (35) — the loop ended with a body-only evidence refresh.[EFFORT_PROFILE]: unchanged from prior review (Quick Win) — bounded public-tool completion with focused evidence cleanup.
Required Actions
No required actions — eligible for human merge.
A2A Hand-Off
After posting this follow-up review, capture the new commentId and send it via A2A to the next actor so they can fetch the delta directly.
Resolves #13343
Adds the
abort_transactionNeural Link write tool — the third batch-lifecycle arm, completing thebegin_transaction/commit_transaction/abort_transactiontriad (#13331). Discards the writer's open named batch without committing.Authored by Claude Opus 4.8 (Claude Code), @neo-opus-vega (Vega). Session a0bc6b23-78c5-4bd7-b944-9db5e236f42d.
Evidence: L1 (in-heap unit + MCP-compliance — exercised against a real
TransactionService, no live bridge). No live-bridge-runtime ACs. No residuals.What changed
src/ai/client/InstanceService.mjs—abortTransaction(params, context): aborts the writer's open batch viaTransactionService.abort(open → aborted, dropped, never undoable) →{aborted: true, txId}. Uses the clone-freeopenTxIdprobe; fail-closed on no-identity / no-stack-authority / no-open-batch (idempotent).undobeforeabort) or a future dedicated tool — explicitly out of scope./instance/abort_transaction(write-locked) +AbortTransactionRequest;toolServiceserviceMapping; server-sideInstanceServiceforward;Client.mjsdispatch; the in-app method; theOpenApiValidatorCompliancetier + dangerous-read-forbidden fixtures.learn/agentos/NeuralLink.md— theabort_transactiondoc row (the #13318GuideToolParityguard stayed green).Deltas from ticket
None — scope as filed. The just-drop-vs-rollback semantic choice is flagged in #13343 (and the
[lane-claim]A2A) for reviewer objection.Test Evidence
UNIT_TEST_MODE=true npx playwright test -c test/playwright/playwright.config.unit.mjs test/playwright/unit/ai/InstanceServiceNamedTransaction.spec.mjs test/playwright/unit/ai/mcp/validation/OpenApiValidatorCompliance.spec.mjs test/playwright/unit/ai/mcp/validation/GuideToolParity.spec.mjs test/playwright/unit/ai/TransactionService.spec.mjsat headb28c5fd41— 67 passed:InstanceServiceNamedTransaction.spec.mjs— abort coverage: abort drops the open batch (committed stack + redo branch untouched); fail-closed (no-identity / no-open-batch); + a triadno-transaction-servicefail-closed test covering begin/commit/abort (added per this review). Plus the existing begin/commit/undo/redo/list-integration coverage.OpenApiValidatorCompliance.spec.mjs— green: the openapi parses (the new path +AbortTransactionRequest), theabort_transaction: 'write-locked'tier + dangerous-read-forbidden, serviceMapping↔tier parity.GuideToolParity.spec.mjs(#13318) — green: doc==openapi parity held with the new doc-row.TransactionService.spec.mjs— regression green.Post-Merge Validation
Related
Parent: #9848 (undo-stack umbrella). Completes the named-batching triad with #13331 (begin/commit). Siblings: #13326 (list_transactions), #13318 (the doc-parity guard). Refs #13012 (Agent Harness Pillar-2). Core:
src/ai/TransactionService.mjsabort.