Skip to content

Link mentions of nodes created by an invariant play action - #4385

Merged
mstomar125 merged 1 commit into
mainfrom
issue-4358-invariant-mentions
Nov 26, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-4358-invariant-mentions

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

A node an invariant play action creates (execute_create_node_in_tx) inserts through insert_node_in_tx_no_invariant_dispatch, which never calls sync_created_mentions, so a nodespace:// link in its content had no mentions edge until the node was next edited. Reaction actions go through create_node and were linked.

Decision

Link mentions on the invariant path (the issue's first option). Mentions stay derived, best-effort state outside the transaction (ADR-069 section 5): the action records the created node on NodeServiceTx (defer_mention_links) and with_transaction links it after commit via sync_created_mentions, the same routine create_node uses. A rolled-back transaction links nothing. The deferred-after-commit bookkeeping is now one DeferredWork struct alongside the existing embedding refresh.

Tests

a_node_an_invariant_action_creates_is_linked_to_what_its_content_mentions (integration): failed before the fix (no edge), passes after. Mutation checks, each reverted: removing the defer_mention_links call fails it; making the post-commit loop a no-op fails it.
Ran: the 56 playbook_invariant tests, bun run quality:fix, bun run test:changed (all green). The packages/agent lane is signed off for this batch; this PR does not touch it.

Closes #4358

🤖 Generated with Claude Code

…nsaction commits

An invariant create_node action inserts through the no-dispatch in-transaction
path, which never linked mention edges. The action now records the node on the
transaction and with_transaction links its mentions after commit, as
create_node does.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@mstomar125
mstomar125 force-pushed the issue-4358-invariant-mentions branch from 7806a28 to 2a9a985 Compare November 26, 2026 08:40
@mstomar125
mstomar125 merged commit 7144f4e into main Nov 26, 2026
@mstomar125
mstomar125 deleted the issue-4358-invariant-mentions branch November 26, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nodes created by an invariant play action get no mentions edges until their content is next edited

1 participant