Repository navigation
Description
Summary
Rename the origin-filtered mirror of the domain-event channel for what it does, as ADR-083 §4 recommends (proposed; decision 4-A):
subscribe_for_pushbecomessubscribe_to_events_excluding_origin.set_push_excluded_originbecomesset_excluded_event_origin.- The internal names follow.
Behaviour does not change. There is no gate: only the pinned Pro daemon calls these methods, and it switches to the new names in its pin-bump PR.
Context
What the channel is. A second broadcast of domain events that withholds events tagged with one configured source_client_id. This stops one origin's bulk re-apply from flooding a consumer's buffer. Core itself configures no origin, and nothing outside tests subscribes. ADR-082 (proposed) lists it as core's outbound change feed.
Where it lives. packages/core/src/services/node_service/mod.rs (lines at af8ddb61):
push_forward_allowed(~644-667).BatchEmitGuard.push_txand.push_excluded_origin(~680-683), used in itsDrop(~701-702).flush_envelopes(~796-811), called at ~1003-1007 and ~3118-3119.- The
NodeService.push_event_txand.push_excluded_originfields and their docs (~1315-1332). - Where those fields are cloned (~1454-1455) and constructed (~1503-1521, ~1573, ~1592-1593), and where the batch guard is built (~3087-3088).
subscribe_for_push(~2920-2932) andset_push_excluded_origin(~2934-2948).- The tests, under the block header at ~8141. They pass the literal
"sync-service"as the excluded origin:push_channel_mirrors_main_when_no_origin_excluded(~8163);push_channel_excludes_configured_origin_for_node_events(~8200);push_channel_excludes_configured_origin_for_relationship_events(~8245);create_parent_edge_reparent_emits_former_parent_delete(~8300), which calls the setter;push_channel_excludes_configured_origin_for_batched_flush(~8386).
One reference elsewhere. The is_sync_originated doc in packages/core/src/playbook/engine.rs (~1520-1523) cites push_forward_allowed and push_excluded_origin.
The Pro daemon. At sync 17f9557 it calls the setter at nodespaced-pro/src/cloud_sync/orchestrator.rs ~111 and subscribes at ~324. It builds against pinned core 680c35d8, so this rename shows up as two compile errors in its next pin-bump PR.
Scope
Renames:
| Old | New |
|---|---|
subscribe_for_push |
subscribe_to_events_excluding_origin |
set_push_excluded_origin |
set_excluded_event_origin |
NodeService.push_event_tx |
origin_filtered_event_tx |
NodeService.push_excluded_origin, BatchEmitGuard.push_excluded_origin |
excluded_event_origin |
BatchEmitGuard.push_tx |
filtered_tx |
push_forward_allowed |
passes_origin_filter |
flush_envelopes params push_tx and push_excluded_origin, and the local push_excluded_origin_ref |
filtered_tx, excluded_origin, excluded_origin_ref |
tests push_channel_* |
origin_filtered_channel_* |
Also:
- the docs of everything in the table;
- the two names in the
is_sync_originateddoc.
Out of scope
SYNC_SERVICE_CLIENT_IDandis_sync_originatedthemselves (Give the replicated-apply origin constant and engine gate neutral names, value unchanged #3339).remote-update-policy.tsand its test (Sweep the Pro and sync wording C7 leaves around replicated writes and AI-chat privacy #3367).- Echo suppression (
x-ns-client-id) and per-window client ids. These are local features.
Steps
- Start. Follow core
CLAUDE.md's startup sequence:EnterWorktree({name: "issue-<N>-event-channel-names"});bun install;- the
bun run testbaseline; gh:assign, thengh:status.
- Rename everything in the Scope table. Use rust-analyzer rename, or
git grepeach old name and edit by hand. The names occur only in this file and the engine doc. - Rewrite the docs. Name no consumer, and don't use "push" or "cold pull".
subscribe_to_events_excluding_origin:- It delivers every domain event except those whose
source_client_idequals the origin set byset_excluded_event_origin. - With no origin set, it behaves like
subscribe_to_events. - It is for a consumer whose buffer one origin's bulk writes must not flood.
- It delivers every domain event except those whose
set_excluded_event_origin: the setting is shared by every clone of the service, and core assumes no particular id.- Keep the existing caveat that
create_node_streamingstamps a fixed source.
- Tests.
- Replace the
"sync-service"literal with a test-localconst EXCLUDED_ORIGIN: &str = "bulk-apply";, both in the setter calls and inwith_client(..). - Reword "push channel" in the assertion messages and in the block header comment.
- Replace the
- Grep.
git grep -n -E 'subscribe_for_push|set_push_excluded_origin|push_event_tx|push_excluded_origin|push_forward_allowed|push_channel_' -- packagesprints nothing. - Ratchet. Run
bun run scripts/check-pro-boundary.ts, then setBASELINESto the printed counts. This rename probably changes no count, but the step is required. - Finish.
- Run
bun run test:changed, thenbun run quality:fix, then commit. git push origin HEAD:issue-<N>-event-channel-names.gh pr create --repo NodeSpaceAI/nodespace-core --base main --head issue-<N>-event-channel-names.bun run gh:status <N> "In Review".- After approval, run
bun run merge <PR#>in the background.
- Run
Acceptance criteria
- The step 4 grep prints nothing.
- The renamed tests pass:
- the channel still withholds the excluded origin's node, relationship and batched-flush events;
- with no origin set, it mirrors every event.
- No doc or identifier on this seam names a consumer, and none says "push" or "sync".
-
bun run scripts/check-pro-boundary.tsexits 0, andBASELINESequals its printed counts. - Core builds, all tests pass, and the free app is unchanged.
Tests and verification
bun run test:changed.tools/bin/cargo-nextest nextest run -p nodespace-core --lib origin_filtered_channel.tools/bin/cargo-nextest nextest run -p nodespace-core --lib create_parent_edge_reparentcargo clippy -p nodespace-core --all-targets -- -D warnings -D clippy::unused-async
Dependencies
- NodeSpaceAI/nodespace-docs#92 (ADR-083) (ADR-083, proposed): decision 4 chooses the rename and the final names.
- Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299: the ratchet.
- No gate (ADR-083 §7 item 3).
- Sync note (not filed yet): at its next pin bump, sync renames its two
orchestrator.rscall sites.
Risks and rollback
- No runtime risk. This is a pure rename, and the tests are unchanged apart from names.
- Sync's next pin bump fails to compile until it renames two call sites. That failure is the intended signal.
- Rollback: revert the PR.
Plan key: C7.3 (pro-boundary DAG).
🤖 Generated with Claude Code
Activity
mstomar125 commentedon Sep 30, 2026
Completed in #3394 (merged). Auto-close did not fire; closing manually.