Repository navigation
Pare back #1736 to the generic access-gate seam only (#1870) - #1875
Conversation
PR #1868 landed the full vertical slice: SubtreeAccessGate trait + AlwaysAllowGate default, plus a complete error-propagation chain (NodeServiceError::InaccessibleDescendants, an OpsError variant, a dedicated gRPC FailedPrecondition status, a Tauri CommandError code, and a terminal frontend refusal modal) for a Denied state no caller in this codebase can produce today. Keeps the generic, already-wired seam: SubtreeAccessGate trait, AlwaysAllowGate, the NodeService injection point, and the collect_subtree_ids/delete_subtree_atomic refactor. Removes the product-surface plumbing built only against a synthetic test gate: the typed error, gRPC status mapping, Tauri command code, and frontend refusal modal/state. The delete_node call site keeps invoking the gate, but a Denied decision now maps to the existing HierarchyViolation error as a placeholder until a real Pro gate lands with its own typed error and UI treatment. reactive-node-service.svelte.ts's deleteNode reverts to optimistic-for-leaf-nodes behavior (no unconditional await), since the non-optimistic path existed solely to protect the now-removed refusal UX. Co-Authored-By: Claude <[email protected]>
Code Review SummaryThis is a precise, well-executed pare-back. I independently re-derived the diff against Requirements Check (issue #1870)
FindingsCritical IssuesNone. Suggested ImprovementsNone. The doc comment above Nitpicks
Recommendation: APPROVEThis PR does exactly what issue #1870 asked, verified line-by-line against the acceptance criteria, with zero scope creep (the two untouched files were confirmed to have literal zero diff) and zero orphaned references. Both test suites and clippy are clean. Merge is the user's call, but from a correctness/completeness standpoint this is ready. |
malibio
left a comment
There was a problem hiding this comment.
Review complete — recommendation: APPROVE (see detailed report above). Note: could not submit a formal --approve review since this PR is authored by the same account as the reviewer session (GitHub blocks self-approval); posting as --comment instead. Full findings in the PR comment above.
Review responseReviewed the findings from the pragmatic-code-review above.
No code changes made — nothing in this review requires a PR update. |
Summary
PR #1868 landed the full vertical slice for the access-gated cascade delete: a
SubtreeAccessGatetrait +AlwaysAllowGatedefault, plus a complete error-propagation chain (NodeServiceError::InaccessibleDescendants, anOpsErrorvariant, a dedicated gRPCFailedPreconditionstatus, a TauriCommandErrorcode, and a terminal frontend refusal modal) for aDeniedstate no caller in this codebase can produce today.This PR pares that back to exactly the generic, already-wired seam:
Kept (unchanged in shape):
SubtreeAccessGatetrait,SubtreeAccessDecisionenum,AlwaysAllowGateOnceLock-based injection point (set_subtree_access_gate/subtree_access_gate()) onNodeServicecollect_subtree_ids/delete_subtree_atomicsignature refactor (computes the subtree id set once, shared between the gate check and the delete)delete_nodecall site still invokes the gate — aDenieddecision now maps to the existingNodeServiceError::HierarchyViolationas a placeholder, until a real Pro gate lands with its own typed error and UI treatmentRemoved (product-surface plumbing built only against a synthetic test gate):
NodeServiceError::InaccessibleDescendants,OpsError::InaccessibleDescendants+ conversionx-inaccessible-descendantsgRPC status mapping inpackages/daemon/src/services/node_service.rsINACCESSIBLE_DESCENDANTSCommandErrorcode path inpackages/desktop-app/src-tauri/src/commands/nodes.rspendingRefusal,showInaccessibleDescendantsRefusal, the terminal UI indelete-confirmation-modal.svelte,isInaccessibleDescendantsinerrors.ts)reactive-node-service.svelte.ts'sdeleteNodereverts to optimistic-for-leaf-nodes behavior (no unconditional await) — that non-optimistic behavior was motivated entirely by the refusal caseThe full error/gRPC/frontend wire-up is tracked as part of nodespace-cloud#103's scope, to land together with the real Pro RPC once there's an actual gate to test the refusal path against end-to-end.
Test plan
bun run test— 170 files / 4097 tests passing (baseline was 4102; the 5 removed tests were refusal-UI-specific)cargo test --lib --bins --tests --workspace --exclude nodespace-app --exclude nodespace-app-test-support— all passing, including the 4 gate/OCC-precedence tests innode_service/mod.rs(now assertingHierarchyViolationinstead of the removed typed error) and the 2access_gatemodule testsbun run quality:fix— cleantest:all+cargo build --bin nodespaced+test:e2e+cargo test -p nodespace-app) — passingCloses #1870.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DkqjrfV1G6kugsEjvyU9wU