Repository navigation
Description
Summary
Reword the docs of core's daemon extension points, and of the host conventions around them, so they describe the hook and name no product or repository. This covers:
- the subtree access gate (ADR-041);
- the shared router factory (ADR-043);
DbManagerLayerand the per-database gate factory (ADR-053);NodeServiceImpl's registry id and accessor;- the "empty
database_id" event convention that runs from the daemon through the proto to the Tauri watcher and window router; - the status-bar degrade for a daemon without
EmbeddingsService.
Also drop the five GitHub issue citations in node_service.proto.
Comments and docs only. No behaviour, signature or wire change.
Context
-
ADR-081 (proposed) §2a says an extension point is named and documented for what it does, and its doc comments don't name nodespace-sync, Supabase, tenants or RLS. ADR-082 (proposed) §4 lists
build_base_routerandSubtreeAccessGateas the daemon seams. -
Two of these docs are also stale:
- The
db_routing.rsmodule doc says the Pro daemon does not installDbManagerLayer, but nodespace-sync'snodespaced-pro/src/main.rsnow wraps its server inDbManagerLayer::new(manager). - The desktop crate's
commands/embeddings.rssaysnodespaced-pronever registersEmbeddingsService, but it now passes one inBaseServices.
The behaviour both docs describe is still correct and still needed:
- Handlers fall back to their own single-database service set when no manager was injected. Directly-constructed test impls rely on this.
build_base_routertakesembeddings: Option<..>.packages/daemon/src/services/assembly.rsonly builds it when a model exists (shared.has_model.then(..), line 339 at af8ddb6), so any daemon started without a model answersUnimplemented.
- The
-
The empty-id case.
nodespacedinstallsDbManagerLayerin all four serve paths inpackages/daemon/src/main.rs. An emptydatabase_idtherefore now comes only from an impl not opened through the registry, such as a test or a single-database host. -
Proto comments are not checked today.
scripts/check-code-references.tsscans only.rs,.ts,.svelteand.js, so the issue citations inpackages/proto/proto/node_service.protowere never counted. Drive every Pro-boundary ratchet count to zero and make the check a hard ban #3371 adds.prototo that scan, and this PR removes the citations it would otherwise flag.
Locating the code
Each item is named by its symbol. Line numbers are hints at af8ddb6; re-locate with git grep -n '<symbol>'.
If #3322 has already split the desktop crate into a library and a thin app (ADR-082 §3), the Tauri files below live in the library package, not in src-tauri/src/. Find them with:
git ls-files -- 'packages/desktop-app/*/src/watcher.rs' 'packages/desktop-app/*/src/window_routing.rs' 'packages/desktop-app/*/src/commands/embeddings.rs' 'packages/desktop-app/*/src/skill_setup.rs'That glob matches exactly those four files at af8ddb6. Below, <desktop>/ means whichever of packages/desktop-app/src-tauri/src/ or the library's src/ holds them.
Scope
packages/core/src/services/node_service/access_gate.rs
- Module doc (lines 1-12).
- Keep the first line and the OCC rationale, up to "being destroyed."
- Replace the rest, from "Community installs" through the
architecture/tenant-isolation-rls.mdpath. That covers community installs, the Pro daemon innodespace-syncand "the Pro tenant schema (Postgres RLS)". - The new text: core has no actor or access model of its own, so its default gate allows everything. A host that enforces access elsewhere injects its own gate through
NodeService::set_subtree_access_gate, an extension point (ADR-082). The gate is advisory: the host's own enforcement stays the authority, and the gate only lets the host refuse a local delete before it commits instead of after.
AlwaysAllowGatedoc (39-43). Call it "core's default gate": core has no actor whose read access differs from the local user's, so there is nothing to check. Don't claim there are "no restricted collections", becauseembedding_roots.rsuses them.set_subtree_access_gatedoc (54-57). A host calls it once its gate is ready. Keep the "ignored if called more than once" andArcnotes.subtree_access_gatedoc (62-63). "The injected gate if one has been set, otherwise [AlwaysAllowGate] (core's default)."
packages/core/src/services/node_service/mod.rs
- The
NodeService.subtree_access_gatefield doc (1366-1371).- Replace "community installs", "A Pro daemon (
nodespaced-pro)" and "the Pro tenant connection". - The new text: the default keeps the unconditional cascade, and a host injects its own gate after construction (ADR-082). The gate is held in a
OnceLockso it can be set once it is ready.
- Replace "community installs", "A Pro daemon (
- The comment above the access-gated delete tests (7757-7763) and the
DenyIfPresentGatedoc (7765-7767).- "Core's default is
AlwaysAllowGate; these tests inject a stub gate that denies part of a subtree, since core has no access model of its own to exercise." - The stub "stands in for an injected gate reporting a descendant the actor may not read".
- "Core's default is
packages/core/src/services/node_service/crud.rs
- The
delete_nodedoc (1996-1999). "With core's default gate (AlwaysAllowGate) there is never a refusal here; only an injected gate can deny."
packages/daemon/src/router.rs
- Module doc (1-7). "Shared gRPC router factory (ADR-043), one of core's daemon extension points (ADR-082)."
nodespacedcalls it, and any other daemon built on this crate calls it and chains its own services on top.- Adding a
BaseServicesfield is a compile error for every caller until it supplies the implementation, so no daemon silently falls behind the base set.
BaseServicesdoc (21-25). "Every daemon built on this crate constructs this and passes it to [build_base_router]; extra services are added after."build_base_routerdoc (39-58).- "with all base services registered" and "can be extended with more services".
- In the
rust,ignoreexample, rename the "Pro extension" comment to "Extra service". ReplaceCloudSyncServiceServer::new(cloud_sync)with a neutralExtraServiceServer::new(extra). Keep thewith_message_limits!advice.
packages/daemon/src/db_routing.rs
- Module doc (6-10).
nodespaced's serve loops install the layer. A host that serves a single database may leave it out: its handlers then find no manager and serve their own single-database service set, which is also how directly-constructed test impls behave. routed_database_servicesdoc (41-43). "…which is how a host without the layer, and directly-constructed test impls, behave."DbManagerLayerdoc (93-95). Point at the module doc for what happens when a host leaves the layer out.
packages/daemon/src/services/assembly.rs
- The
SharedContext.subtree_gate_factorydoc (61-77).- Open with: "Empty by default, so every database keeps
NodeService's always-allow gate; a host that enforces access fills it in (ADR-082)." - "the wrong tenant" becomes "the wrong database's access rules".
- "the Pro daemon cannot build this until after its cloud service exists" becomes "a host may only be able to build the factory after the
DatabaseManagerthat holds this context exists". - "gated explicitly by the Pro daemon" becomes "gated explicitly by the host".
- Open with: "Empty by default, so every database keeps
- The gate-factory comment in the per-database open path (277-280). "against its own access rules"; "Absent unless a host installed a gate factory."
- Not here: the ADR-073 origin comment naming
is_sync_originated(404-410). Rename the origin-filtered event channel to subscribe_to_events_excluding_origin #3338 rewrites it with the origin rename.
packages/daemon/src/services/node_service.rs
- The
NodeServiceImpl.database_iddoc (119-121). "Empty when the impl was not opened through the registry: a host serving one database withoutDbManagerLayer, or a test constructing the impl directly." - The
with_database_iddoc (175-177). "…left empty when the impl is not opened through the registry." - The
node_service()accessor doc (191-195). "Lets a host that composes extra services over a registry-opened database reuse the sameNodeService…" Keep the single-writer-lock rationale. - The two "not tenant-scoped" comments (1357, 1367). Both become "not database-scoped".
- The accessor test's comment (3185-3187). "…so a host can compose over it without opening a second store on the same file."
packages/daemon/src/services/database_manager.rs
- The
spawn_idle_reaperdoc (1052-1053). "the single-database community path is unaffected" becomes "a single-database install is unaffected".
packages/proto/proto/node_service.proto
- The
NodeEventrelationship-variant comment (567-571). Relationship events exist so that hierarchy changes made by another writer reach the frontend's structure tree. That writer can be another window, the CLI, an agent or an in-process writer. Drop "cloud-sync". - The
NodeEvent.database_idcomment (576-579). "Empty when the serving impl was not opened through the registry (a single-database host, or a test that constructs the service directly)." - Issue citations.
- Drop "(core#1734)" (line 52), "(core#2388)" (82), and "issue Relationship viewer: view and manage typed relationships between nodes #1918" (138, 141, 144).
- Each comment already states its constraint. Line 144 becomes "Relationship viewer: list…".
<desktop>/watcher.rs
- The
non_emptyhelper doc (46-50). "(a Pro daemon with no registry — …)" becomes "(an event from an impl not opened through the registry)". - The empty-id comment in
forward(193-198). The same convention, without "(Pro daemon)". - The relationship-variant comment (241-242). "Relationship variants — so hierarchy changes made by any other writer (another window, the CLI, an agent, an in-process writer) reach the frontend's reactiveStructureTree."
<desktop>/window_routing.rs
- The
resolve_targetsdoc (86-87). Drop "e.g. a Pro daemon with no registry".
<desktop>/commands/embeddings.rs
- The
stale_count_from_resultdoc (224-237).- The new text: "
Unimplementedcollapses toOk(0): the daemon serves noEmbeddingsService. A daemon registers it only when an embedding model was present at startup (BaseServices::embeddingsis anOption), so there is no embedding queue and zero is the honest count." - The sentence at 234 becomes "because
nodespaced'sEmbeddingsServiceimplements it". Keep the rest.
- The new text: "
- The
get_stale_root_countdoc (253-257). "(e.g.nodespaced-pro)" becomes "(no embedding model at daemon startup)". - Keep the match arm. The
stale_count_unimplemented_maps_to_zerotest already covers it.
<desktop>/skill_setup.rs
- The
run_installer_with_runtimesdoc (916-923). Replace the "nodespace-sync hit exactly this class of bug with a mutatedumask…" anecdote with the constraint itself: a test that narrows a process-global setting ($PATH,umask) races every other test in the same process.
Out of scope
- Any code, signature, test logic or proto field change.
- The
assembly.rsorigin comment and anything that namesSYNC_SERVICE_CLIENT_ID. Rename the origin-filtered event channel to subscribe_to_events_excluding_origin #3338 renames those; Sweep the Pro and sync wording C7 leaves around replicated writes and AI-chat privacy #3367 checks for leftovers. - The desktop frontend's
isActiveDatabaseEventdoc (Remove Pro and cloud-sync wording from frontend comments, tests and the fly-out tooltip #3366). - Adding
.prototoscripts/check-code-references.ts. That is Drive every Pro-boundary ratchet count to zero and make the check a hard ban #3371, after Move the Pro Tauri layer out of core: pro_* commands, ProClient, proto, update source #3336 deletes the vendored Pro proto and its 12 more citations. packages/daemon/src/main.rs,tray.rs,incompatible_database.rsandpackages/proto/src/socket.rs(Remove Pro edition branching from the core app, daemon, CLI and installer #3357).grpc_client.rsdocs (Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322 and Move the Pro Tauri layer out of core: pro_* commands, ProClient, proto, update source #3336).
Steps
- Follow CLAUDE.md's startup sequence:
- pull
main; EnterWorktree({name: "issue-<N>-seam-docs"});bun install, then thebun run testbaseline;- self-assign at pickup and set In Progress.
- pull
- Confirm ADR-082 has merged, and cite it as ADR-082:
git -C <docs> fetch origin main && git -C <docs> ls-tree --name-only origin/main decisions/ | grep '^decisions/082-'
- Locate each item by symbol (see "Locating the code"), then make the edits under Scope. Check every sentence against the code it documents, not against the old comment.
- Run
bun run scripts/check-pro-boundary.ts. It fails with "lowerBASELINES.<marker>to N" and prints aBASELINESblock; paste it intoscripts/check-pro-boundary.ts. The decreases measured at af8ddb6 are listed below; use the real output.cloudWording−22proWording−29tenantWording−13editionBranching−8proProtocol−2
- Run the verification below, then finish:
bun run quality:fix, and commit;git push origin HEAD:issue-<N>-seam-docs(the push check runs lint only);gh pr create --head issue-<N>-seam-docs;- review per CLAUDE.md, and merge only with
bun run merge <PR#>once approved.
Acceptance criteria
-
None of these edited files contains
Pro,community(as an edition),nodespaced-pro,nodespace-sync,CloudSyncService,tenant,Supabase,RLS,cloud-syncortenant-isolation-rls:access_gate.rs,router.rs,db_routing.rs;assembly.rs, outside the ADR-073 origin comment;- the daemon's
services/node_service.rs; watcher.rs,window_routing.rs,commands/embeddings.rs,skill_setup.rs;- the
node_service.protocomments above.
Neither do the listed symbols in core's
node_service/mod.rsandcrud.rs. -
node_service.protohas nocore#,issue #or#NNNNcitation left. -
Every new sentence is true of the code at this commit. In particular,
db_routing.rsno longer claims that any daemon skipsDbManagerLayer, andcommands/embeddings.rsgives the no-model reason. -
BASELINESinscripts/check-pro-boundary.tsis lowered to the counts the CLI prints, andbun run scripts/check-pro-boundary.tsexits 0. -
bun run scripts/check-code-references.tsstill passes, with no new issue or doc-path reference. -
No code, signature or proto field changed. This shows only comment lines:
git diff origin/main -- '*.rs' '*.proto' | grep '^[+-]' | grep -v '^[+-]\s*//' | grep -v '^[+-][+-]'
Tests and verification
cargo fmt --all --checkcargo clippy -p nodespace-core -p nodespace-daemon -p nodespace-proto -p <desktop package> --all-targets -- -D warnings.<desktop package>isnodespace-appat af8ddb6. After Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322's split, it is the library package that holdswatcher.rs: read itsnamefrom theCargo.tomlnext to thatsrc/.- Clippy's doc lints, for example
doc_lazy_continuation, apply to rewritten doc comments.
- Optional intra-doc link check:
RUSTDOCFLAGS='-D rustdoc::broken_intra_doc_links' cargo doc -p nodespace-daemon --no-deps --no-default-features. bun run test:changed. This runs the Rust tier, which takes the shared machine slot. The doctest inrouter.rsisrust,ignore.- Run
bun run scripts/check-pro-boundary.ts --list cloudWording, then--list proWording. None of the files above should appear. - This grep prints nothing:
git grep -n -I -P '(?i:nodespaced-pro|nodespace-sync|pro daemon|tenant|supabase|cloud-?sync|community)|CloudSync|\bRLS\b|\bPro\b' -- packages/core/src/services/node_service/access_gate.rs packages/daemon/src/router.rs packages/daemon/src/db_routing.rs $(git ls-files -- 'packages/desktop-app/*/src/watcher.rs' 'packages/desktop-app/*/src/window_routing.rs' 'packages/desktop-app/*/src/commands/embeddings.rs' 'packages/desktop-app/*/src/skill_setup.rs')
- No test is added or removed. This PR changes comments only.
Dependencies
- Guardrail: stop new Pro code from landing in core #3302: the ratchet whose baselines this lowers.
- NodeSpaceAI/nodespace-docs#90 (ADR-082): ADR-082 merged, so the new docs can cite it as the extension-point decision.
Risks and rollback
- A shared file may conflict with a Move Pro-owned data out of core's data model (ADR-083) #3345 PR.
node_service/mod.rs,assembly.rsanddatabase_manager.rsare also edited by Move Pro-owned data out of core's data model (ADR-083) #3345. The hunks differ, so a rebase resolves any conflict. - The desktop files may have moved. If Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322's split lands while this PR is open, rebase and re-run the
git ls-fileslookup. Git's rename detection usually carries the comment edits across. - A
BASELINESconflict with another marker-lowering PR. Rebase, rerun the CLI and paste. - Rollback. Revert the PR. It changes comments only.
Plan key: C10.1 (pro-boundary DAG).
🤖 Generated with Claude Code
Activity