Repository navigation
Description
Overview
#1736 landed the full vertical slice for the access-gated cascade delete: a SubtreeAccessGate trait + AlwaysAllowGate default (PR #1868), plus a complete error-propagation chain — NodeServiceError::InaccessibleDescendants, an OpsError variant, a dedicated gRPC FailedPrecondition status with x-inaccessible-descendants metadata, a CommandError code on the Tauri layer, and a terminal frontend refusal modal.
On review, that's more than nodespace-core (the community codebase) should carry right now. The trait/injection-point is genuinely generic infrastructure — matches the existing embedding_waker pattern for optional host-injected capabilities, has zero Pro-specific knowledge, and community installs are unaffected since AlwaysAllowGate is the only implementation that exists. That part is fine to keep.
The error/gRPC/frontend plumbing is different: it is real product surface (a distinct error type, a wire status code, user-facing copy) built and tested only against a synthetic stub gate, for a state (Denied) that cannot occur anywhere in the actual system today — no caller anywhere produces it. Shipping unreachable error paths and dead UI states in a community codebase for a feature only Pro will ever trigger cuts against this project's greenfield/no-speculative-code stance (see CLAUDE.md: no dead code, no building ahead of a real caller).
Proposed Solution
Pare nodespace-core back to exactly the generic seam:
- Keep:
SubtreeAccessGatetrait,SubtreeAccessDecisionenum,AlwaysAllowGate, theOnceLock-based injection point (set_subtree_access_gate/subtree_access_gate()) onNodeService, and the refactor that computes the subtree id set once (collect_subtree_ids) and threads it intodelete_subtree_atomic. This is the stable extension point a future Pro daemon compiles against. - Remove from this repo:
NodeServiceError::InaccessibleDescendants, theOpsError::InaccessibleDescendantsvariant + conversion, thex-inaccessible-descendantsgRPC status mapping inpackages/daemon/src/services/node_service.rs, theINACCESSIBLE_DESCENDANTSCommandErrorcode path inpackages/desktop-app/src-tauri/src/commands/nodes.rs, and the frontend refusal modal state (pendingRefusalindelete-confirmation.svelte.ts, the terminal UI indelete-confirmation-modal.svelte,isInaccessibleDescendantsinerrors.ts, and the now-unconditional-await change inreactive-node-service.svelte.ts'sdeleteNode— that non-optimistic-delete behavior was motivated entirely by the refusal case and can revert to the pre-CASCADE delete must abort when the subtree contains nodes the actor cannot read #1736 optimistic-for-leaf-nodes behavior once the refusal path doesn't exist). - The
SubtreeAccessGate::check_subtree_accesscall inNodeService::delete_nodestays, but itsDeniedbranch becomes dead until the wire-up work below reintroduces it — actually, simplest: also revert the call site itself back to unconditional delete, and leave only the trait/gate machinery unused-but-present (a#[allow(dead_code)]-free, genuinely inert extension point with no caller), OR keep the call site ifNodeService::delete_nodereturning a genericNodeServiceError::hierarchy_violation-style error forDeniedis judged acceptable as a placeholder. Needs a decision during implementation — leaning toward keeping the call site (so the trait is provably wired to something real, not just theoretically pluggable) but mappingDeniedto a generic existing error variant rather than a new bespoke one, until the real wire-up work (see companion issue below) gives it a proper typed error and UI treatment.
Companion work
The full error/gRPC/frontend wire-up (what's being removed here) should land together with nodespace-cloud#103's RPC, in a follow-up PR, once there's a real Pro-backed gate to test the refusal path against end-to-end instead of a synthetic stub. Tracked as part of nodespace-cloud#103's scope (that issue is being updated to absorb this).
Acceptance Criteria
-
SubtreeAccessGatetrait,AlwaysAllowGate, and theNodeServiceinjection point remain, unchanged in shape -
collect_subtree_ids/delete_subtree_atomicsignature refactor remains (no correctness regression, already tested) -
NodeServiceError::InaccessibleDescendants,OpsError::InaccessibleDescendants, the gRPC status mapping, and the frontend refusal modal are removed -
reactive-node-service.svelte.ts'sdeleteNodereverts to optimistic-for-leaf-nodes behavior (no unconditional await), since that change was solely in service of the now-removed refusal UX - Existing tests updated: the four Rust gate/OCC-precedence tests in
node_service/mod.rskeep exercisingAllowedvs. a gate decision, but assertions on the now-removed typed error are removed or adjusted to whatever placeholder behavior is decided -
bun run test:allpasses,bun run quality:fixclean
Related Issues
- CASCADE delete must abort when the subtree contains nodes the actor cannot read #1736 (original issue this pares back; PR Gate cascade delete on subtree read access (ADR-041) #1868 is the change being partially reverted)
- nodespace-cloud#103 (being updated to own the full wire-up as a companion to the real RPC)
Activity
malibio commentedon Aug 1, 2026
Frontend baseline: 170 test files passed, 4102 tests passed (49.28s)
Pare back #1736 to the generic access-gate seam only (#1870) (#1875)