Repository navigation
Remove the superseded replicated-apply client id (closes #3435) - #3754
Conversation
|
HOLD: do not merge yet. This is phase 2 of #3435 and it deletes the superseded 🤖 Generated with Claude Code |
|
Independent review: APPROVE (head Question: does deleting the string path change any behaviour for core users or for Sync's typed-context writes? (a) Core users: no change, except the intended security fix. A local gRPC client that presents (b) Sync's typed-context writes: no change. Every Sync-labelled handle carries both flags, and core keeps the label and the context together on every path to the engine and the invariant checks. Findings
Evidence that Sync is unaffected (run against this PR's head, before merge)
🤖 Generated with Claude Code |
|
Review addressed (no code change was needed; head stays
The HOLD from the earlier comment is lifted. Next: mark ready, then 🤖 Generated with Claude Code |
REPLICATED_APPLY_CLIENT_ID and is_replicated_apply are deleted: only a WriteContext set in process through NodeService::with_write_context skips playbook triggers or invariant rules. A client id, the former reserved value included, is only a label for echo suppression. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ture remote-update-policy describes a stale broadcast as a replayed write and its test names another client as the foreign writer; the MCP integration test's external update uses a neutral server id. Co-Authored-By: Claude Opus 5.5 <[email protected]>
c361cb5 to
d4a07db
Compare
Closes #3435. This is phase 2 of 2, on top of #3752 (merged).
Merge condition met. nodespace-sync now uses the typed write context (NodeSpaceAI/nodespace-sync#679, merged to Sync main
2b25acf): its apply services are built withwith_write_context(WriteContext { skip_playbook_triggers: true, skip_invariant_rules: true }), and its daemon reserves the id withDaemonExtensions::reserved_client_id(SYNC_SERVICE_CLIENT_ID). Sync's canary and test suite pass against this PR's head (evidence in the review comment). Sync never imported the constant, so this does not break its compilation.What changes
REPLICATED_APPLY_CLIENT_ID,is_replicated_apply, and the client-id comparisons in the engine gate (write_context_of) and inskips_invariant_rules. Only aWriteContextset in process now skips playbook triggers or invariant rules. A client id, including the formerly reserved value, is only a label for echo suppression.bulk_createis refused; a play fires on such a write;x-ns-client-idis the old value is still refused by an invariant;build_shared_services: a play fires for a request presenting it.CLIENT_ID_HEADERdoc now says the id never changes how the daemon treats a write.c361cb5fe): the last three incidentalsync-servicestrings in core are gone. Two comments inremote-update-policy.tsand its test are reworded, and aserverIdtest fixture inmcp-integration.test.tsis renamed. Nothing in core now mentions the value.Core behaviour
x-ns-client-id: sync-servicecan no longer switch off invariants and playbook triggers.Tests
Targeted runs pass: core 727 tests, daemon 29.
Mutation testing put the old-value comparison back:
skips_invariant_rules: killed by the core invariant tests and the daemon invariant-refusal test;The daemon's
a_client_id_header_never_sets_a_write_contextchecks that the header never sets a context. It does not guard the engine gate, because the old path never set a context.Before merge, the PR goes through the full gate (
bun run merge) like any other.🤖 Generated with Claude Code