Repository navigation
Add per-aspect seed durability guard with explicit reset (#2560) - #2564
Conversation
…set (closes #2560) Extends the starter-tier user_modified durability guard to system-tier seeded skill/prompt/tool nodes, tracked independently per aspect (config: root properties, vs guidance: markdown children) since editing one doesn't touch the other. Reconciliation keeps auto-replacing an untouched aspect on every daemon startup exactly as before; an edited aspect is now permanently protected until explicitly discarded via the new `nodespace skill reset <key> --guidance|--config|--all` command, which requires confirmation (refusing outright in a non-interactive context without --yes, since this is the one destructive path in the system). Implements the design in ADR-072 (nodespace-docs), written to resolve the design question this issue opened around durability vs. the always-replace system tier. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NbFkxrpERmx9QNkkwoD4Dz
Code Review SummaryThis implements ADR-072 faithfully: config and guidance are tracked and reconciled as independent aspects via All unit/integration tests specific to this PR pass locally ( FindingsCritical IssuesNone. Suggested Improvements
Nitpicks
Verification Notes
Verdict: Approve, with the ArgGroup fix and the guidance-version cross-contamination noted above strongly recommended before/shortly after merge (neither blocks — both fail-safe rather than fail-silent-and-lossy). The 🤖 Generated with Claude Code |
malibio
left a comment
There was a problem hiding this comment.
Pragmatic code review complete (full report posted above). Verdict: APPROVE with two recommended-but-non-blocking fixes — (1) the ResetArgs ArgGroup rejects combining --guidance --config, contradicting the documented 'equivalent to --all' behavior (verified via isolated clap probe), and (2) replace_seed_config overwrites _seed.guidance_version even when guidance wasn't touched in that pass, desyncing version telemetry (traced through — no data loss, since the guidance_modified flag itself is untouched and still gates replacement correctly). A perf note on update_node's new unconditional get_root_id walk on every non-seed-root edit is flagged for awareness, not blocking. Posting as --comment, not --approve, since this PR is self-authored by the same account driving this review.
… confirmation stream - packages/cli/src/commands/skill.rs: ResetArgs's ArgGroup now allows combining --guidance/--config/--all (.multiple(true)) — previously clap treated them as mutually exclusive, contradicting the documented "equivalent to passing both flags" behavior for --all. - packages/core/src/services/node_service/mod.rs: replace_seed_config no longer overwrites _seed.guidance_version/guidance_modified with the template's values when only config replaces — those fields are now preserved from the existing node, so a config-only replace can't desync guidance's stored hash from its actual content. - Fixed a second, related bug found while addressing the above: replace_seed_guidance never stamped _seed.guidance_version after recreating children, so a completed guidance replace was silently redone on every subsequent reconciliation pass. Added SqliteStore::set_property_string (mirroring set_property_bool) to fix it. New regression tests cover both bugs. - packages/daemon/src/services/node_service.rs: resolve_seed_template now debug_asserts uniqueness of (node_type, seed_key) across the three chained seed sources, so a future collision fails loud instead of silently picking whichever template iterates first. - confirm_reset's prompt now prints to stderr, not stdout, so a --json caller's stdout can never have prompt text interleaved with the JSON result even on a real terminal. Skipped: the update_node get_root_id perf concern (flagged for awareness, not blocking — pre-release with no production load, and a speculative fix risks incorrectness for legitimate deep guidance nesting without a measured problem to fix). SeedTier doc-comment nit (marginal value). Addresses reviewer recommendations from PR #2564's pragmatic-code-review. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NbFkxrpERmx9QNkkwoD4Dz
Address-review summaryAddressed all three substantive findings from the pragmatic-code-review, plus one additional bug found while fixing them. ✅ Addressed
⏭️ Skipped
Verification
Re-Review DecisionDecision: RE-REVIEW NEEDED Rationale: Two of the three addressed items were genuine bugs in core reconciliation logic ( Run |
Re-review (verified directly — the automated reviewer agent stalled twice on this pass, so I traced the diff myself)Reviewed only the Findings verification
Verification commands run
No new issues found. All 5 findings from the initial review were properly and correctly addressed. Verdict: Approve. (Posted as a comment, not an approval review — this PR is self-authored by the same account performing the review, and GitHub rejects self-approval.) 🤖 Generated with Claude Code |
malibio
left a comment
There was a problem hiding this comment.
Re-review complete (full findings posted above). All 5 items from the initial review verified as correctly fixed; no new issues found. Verdict: APPROVE (posted as a comment, not an approval review — self-authored PR, GitHub rejects self-approval).
Summary
Fixes the design gap in #2560: seeded
skill/prompt/toolnodes are reconciled against their compiled templates on every daemon startup (seed_nodes_from_templates), and system-tier nodes had no protection against a user's live edit being silently discarded the next time an unrelated code change touched that node's template.Implements the design in ADR-072 (
nodespace-docs/decisions/072-per-aspect-seed-durability-with-explicit-reset.md, committed tonodespace-docsmain):config(root properties — description/tool_whitelist/max_iterations) andguidance(markdown children) are tracked and reconciled independently via_seed.config_modified/_seed.guidance_modified, since editing one doesn't touch the other. An untouched aspect keeps auto-replacing on every restart exactly as before; a user-touched aspect is now permanently protected.nodespace skill reset <key> --guidance|--config|--all— the one path allowed to discard a modified aspect, via a newResetSeedNodegRPC RPC andNodeService::reset_seed_node. Requires confirmation; in a non-interactive context with no--yes, it refuses outright rather than auto-proceeding (unlikeinstall/mcp enable), since this is the sole destructive path in the system.Key implementation notes
seed_nodes_from_templates's single whole-subtree "replace" became two independent operations: a config-only in-place property merge (update_node_unchecked, no delete/recreate) and a guidance-only delete-children-then-recreate (leaving the root untouched).compute_seed_version's single content hash split intoconfig_version/guidance_version.update_node's stamping logic (previously starter-tier only) now applies to every tier, walking up to a child's seeded root viaget_root_idwhen the edited node isn't itself the seed root.Test plan
nodespace-coreunit tests: per-aspect independence (editing guidance doesn't block a config-only reseed, and vice versa) andreset_seed_nodeoverriding the guardnodespace-agentintegration test against the real productionseed_skill_nodes()registrynodespace-clitests:ArgGrouprequiring an explicit scope flag, and an end-to-end gRPC round trip throughrun_resetbun run test:all,cargo build --bin nodespaced, andtest:e2eall pass via the pre-push gatebun run quality:fix(Rust + TS) cleanCloses #2560
🤖 Generated with Claude Code
https://claude.ai/code/session_01NbFkxrpERmx9QNkkwoD4Dz