Repository navigation
Give the replicated-apply origin constant and engine gate neutral names, value unchanged - #3396
Conversation
|
Review Type: Initial Review Requirements Check (core#3339, verified against commit a19e04d by reading the diff and grepping the branch; I did not run builds or tests, per instructions)
Cross-repo caller check (claim 3): confirmed. In nodespace-sync at origin/main, Deliberate decisions:
Also checked: origin/main is one commit ahead of this branch's base (9d93d24, settings extension points). It shares no files with this diff, so no conflict is expected. Code Review Findings Critical / Blocker: None Improvements: None Nits (optional polish, none block merge):
Recommendation: APPROVE The change is a faithful identifier-only rename. The value is byte-identical and pinned by a non-tautological test. All old-identifier references are gone across all file types. Gate semantics are unchanged (exact match, all three invariant early-returns updated). The docs match the issue's prescribed wording. The description's claims hold up: I verified the callers, grep, and ratchet-delta claims directly and found no overclaim. The |
mstomar125
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment; GitHub blocks self-approval). Full findings in the review comment above.
Address-review summary (round 1)Review verdict: APPROVE, 0 critical, 0 improvements, 4 nits. Addressed (1 of 4)
Skipped (3 of 4), with reasons
Tests are unchanged by this round (no code change), so the earlier results stand: Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: The only change since the review is one reworded doc-comment line (zero non-comment lines changed, no logic, no test, no rename touched). The reviewer approved with no blocking or improvement findings. 🤖 Generated with Claude Code |
…l names (closes #3339) SYNC_SERVICE_CLIENT_ID becomes REPLICATED_APPLY_CLIENT_ID and is_sync_originated becomes is_replicated_apply, so the names say what they do (a write applied from another device) instead of who calls them. The constant's value stays "sync-service": writers outside core tag replicated writes with that literal, so changing it would silently re-enable plays and invariants on replicated writes. A new test in db/events.rs pins the value. Also renames the three is_sync_originated_* unit tests, rewords the constant's and the gate's docs and the skip debug message, and updates every caller in core's src, its integration tests and the daemon's assembly comment. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Reads better as prose than "replicated-apply event"; doc comment only. The other review nits are left as is: "sync" stays as the ADR-060/073 term for a write from another device, and the integration tests' prose belongs to the separate prose pass. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
49ac254 to
fdcfbb5
Compare
Closes #3339
Summary
Gives the replicated-apply origin constant and its engine gate names that say what they do, per ADR-083 rule 2 (proposed):
SYNC_SERVICE_CLIENT_IDbecomesREPLICATED_APPLY_CLIENT_ID.is_sync_originatedbecomesis_replicated_apply.The constant's value stays
"sync-service", byte for byte. Writers outside core tag replicated writes with that literal, so changing it would silently re-enable plays and invariants on replicated writes with no compile error. A new test pins it.Part of the Pro/core boundary epic (#3298). Implemented ahead of the ADR-083 PR, as authorized.
Changes
db/events.rs: rename the constant and rewrite its doc as a storage contract (stable tag, set as a literal by writers outside core, changing it makes replicated writes fire local rules again). New testreplicated_apply_client_id_value_is_stable.playbook/engine.rs: rename the gate, rewrite its doc (denylist rationale kept, built on the names Rename the origin-filtered event channel to subscribe_to_events_excluding_origin #3394 introduced), gate comment, and the skip debug message ("... for replicated-apply event").node_service/invariants.rs(3 gates),node_service/mod.rs(2 batch tests), the three integration test files, and theassembly.rscomment: identifier renames only.playbook/tests.rs: the threeis_sync_originated_*tests becomeis_replicated_apply_*. The first drops the now-misleadingsync_client_idfrom its name (..._true_for_reserved_client_id).Not touched (out of scope per the issue): the value, product and repository names in prose such as "
nodespace-sync's real apply path", and the integration tests' own function names (sync_originated_*), which are not the renamed identifiers.Callers
git grep -n -E 'SYNC_SERVICE_CLIENT_ID|is_sync_originated' -- packagesnow prints nothing, andREPLICATED_APPLY_CLIENT_ID: &strindb/events.rsstill shows"sync-service".External callers: none found. I checked nodespace-sync at
origin/mainand on every remote branch, plus nodespace-cloud, nodespace-website, homebrew-nodespace and nodespace-docs. nodespace-sync never imports core's constant or gate. It defines its ownnodespace_sync::echo::SYNC_SERVICE_CLIENT_ID = "sync-service"and about 25"sync-service"literals, and pins core at680c35d8. So the rename is invisible to it, and it does not break at its next pin bump. No other open PR or local branch adds a use of the old names.Ratchet
bun run scripts/check-pro-boundary.tsexits 0. The printed counts are identical before and after this change (neither identifier matches a marker), so the delta is 0 for every marker.BASELINESis untouched, per the standing instruction not to lower ceilings in parallel PRs. This deviates from the issue's step 4 ("set BASELINES to the printed counts"), which the instruction supersedes. No Pro lines are added.Tests and mutation checks
Every test in the issue's verification list passes on the rebased tree, and
cargo clippy -p nodespace-core -p nodespace-daemon --all-targets -- -D warnings -D clippy::unused-asyncis clean.bun run test:changedpassed (scripts tier and the Rust workspace nextest run).Each mutation was applied to product code, the targeted tests were run, and the change was reverted:
"replicated-apply"replicated_apply_client_id_value_is_stablefails; the gate tests and the integration tests still pass because they use the constant on both sidescontains()instead of an exact matchis_replicated_apply_is_an_exact_match_not_a_substring_checkfailsfalseis_replicated_apply_true_for_reserved_client_idfailstrueis_replicated_apply_false_for_local_client_ids_and_noneand the exact-match test failRisks
Only the identifier changes, so the wire and stored value is unchanged. Rollback is a revert.
🤖 Generated with Claude Code