Write-path transaction-layering seam (graphdb_mgr:transaction/1)#41
Merged
Conversation
Decompose write-path completion into 5 slices (A-E) in TASKS.md; split slice A so a transaction-layering seam ships before delete_node. Add the seam design and its single-task implementation plan. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds the shared Mnesia transaction-runner that normalises
{atomic,R}->{ok,R} / {aborted,R}->{error,R} and anchors the tier-1
primitive / tier-2 wrapper / tier-3 batch convention. First consumers
(delete_node, remove_relationship) land in later slices.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…note
Adds transaction_crash_passes_through, closing the design doc section 4
contract row (uncaught crash -> {error, {Reason, Stack}}, rolled back) that
the three original cases left untested. Documents the scratch-nref band.
Final-review Minor follow-up.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
david-w-t
added a commit
to david-w-t/SeerStoneGraphDb
that referenced
this pull request
Jun 18, 2026
The seam shipped in PR davidwt-com#41 (81b2962); the heading still read "IN DESIGN". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EWukKCbrN8GybaScJGU2kF
david-w-t
added a commit
that referenced
this pull request
Jun 20, 2026
… transaction/1 (#43) * docs: mark transaction-layering seam IMPLEMENTED in TASKS.md The seam shipped in PR #41 (81b2962); the heading still read "IN DESIGN". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EWukKCbrN8GybaScJGU2kF * docs: add transaction-seam retrofit design (seam follow-up 1) Brainstormed spec for the first tracked Transaction-layering seam follow-up: route every hand-rolled mnesia:transaction site (40 across the six graphdb workers + bootstrap) through graphdb_mgr:transaction/1. Behaviour-preserving; documents the conversion taxonomy, four behaviour-preservation traps, the full per-site inventory, and the two-part testing standard (existing 537 are the oracle; new/reshaped paths get new tests). Atomic add_relationship and batch mutate/1 remain separate slices. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs: track atomic add_relationship follow-up; link retrofit design in TASKS.md Inserts the out-of-scope Atomic add_relationship item between the retrofit and batch-mutate follow-ups under the Transaction-layering seam section, and links the retrofit design doc on the retrofit bullet. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs: add transaction-seam retrofit implementation plan Task-by-task plan (7 tasks, one per worker module + final verification) to route all 40 mnesia:transaction sites through graphdb_mgr:transaction/1. Per-site before/after code, the four behaviour-preservation traps flagged at their sites, and the only 2 new tests (instance abort-relocation arms: characterization_not_found / reciprocal_not_found). Behaviour-preserving: existing 537 are the oracle, zero expectation edits. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor(graphdb_mgr,bootstrap): route txn sites through transaction/1 * refactor(graphdb_attr): route txn sites through transaction/1 * refactor(graphdb_class): route txn sites through transaction/1 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EWukKCbrN8GybaScJGU2kF * refactor(graphdb_language): route txn sites through transaction/1 * refactor(graphdb_rules): route txn sites through transaction/1 * test(graphdb_instance): cover add_relationship missing char/reciprocal arms * refactor(graphdb_instance): route txn sites through transaction/1 * docs: mark transaction-seam retrofit follow-up IMPLEMENTED in TASKS.md Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Write-path transaction-layering seam
First piece of the write-path completion track. Adds the shared Mnesia
transaction boundary that the upcoming node/relationship mutation work
(
delete_node,remove_relationship, a future batchmutate/1) all buildon, so those operations compose into one atomic transaction without nesting.
What's here
graphdb_mgr:transaction/1— a plain exported helper that runs a funinside one
mnesia:transaction/1and normalises the result:{atomic, R}→{ok, R},{aborted, Reason}→{error, Reason}. It is aplain function (not a
gen_server:call) becausemnesia:transaction/1runs in the calling process — routing writes through the server would
needlessly serialise them and risk deadlock.
(signal failure via
mnesia:abort/1, never open a transaction → compose);tier-2 single-op public wrappers (own one transaction); tier-3
batch/composite (wrap one transaction, call tier-1 primitives directly →
no nesting).
rollback, composition rollback (the property tier-3 relies on), and
uncaught-crash passthrough.
This slice is the minimal seam only — no consumers, no retrofit of the
existing inline
{atomic}/{aborted}mapping sites, no batchmutate/1.Those are tracked follow-ups in
TASKS.md. No existing behaviour changes.Why now
graphdb_mgralready carries the tier-1 pattern in embryo(
expected_parents/1,expected_classes/1,verify_one/1,rebuild_one/1are documented "must run inside an active mnesiatransaction") and hand-rolls the
{atomic}/{aborted}mapping inline indo_get_relationships/2,verify_caches/0, andrebuild_caches/0. Thisnames the convention and factors that mapping into one helper.
Docs
docs/designs/write-path-transaction-seam-design.mddocs/superpowers/plans/2026-06-17-write-path-transaction-seam.mdTASKS.mdwrite-path section restructured into slices A–E.Testing
graphdb_mgr_SUITE: 32/32 green (28 pre-existing + 4 new). Full treecompiles clean, zero warnings. Suite totals: 419 CT + 105 EUnit = 524.
🤖 Generated with Claude Code