Repository navigation
Seeded content never reaches an existing install: replace type-level skip with per-node versioned re-seed - #1818
Conversation
Seeded prompt/skill/tool nodes now carry a `_seed` object (key, content-hash version, system/starter tier) so a template content change reaches an already-seeded database on next start instead of being permanently frozen by the first node of that type. System-tier content always replaces on hash mismatch; starter-tier content replaces until the user edits it, then is skipped and logged once. `_seed` is nested under a single object key so core schema types (prompt, skill) don't hoist its contents into their own properties namespace on write. Co-Authored-By: Claude <[email protected]>
Code Review SummaryThis is a well-targeted fix for a real measurement-integrity bug (#1812): the type-level seed skip meant any change to seeded skill/prompt/tool content was permanently frozen after first install. The replacement — per-node reconciliation keyed by The main gap is that the mechanism the PR is built around — Requirements Check
FindingsCritical IssuesNone. No security, data-loss-on-the-happy-path, or architectural-regression issues found. Suggested Improvements
Nitpicks
Recommendation: COMMENT |
malibio
left a comment
There was a problem hiding this comment.
See detailed comment above.
…ass and ID-churn tradeoffs - Add reseed tests for skill (real schema fields, exercises namespace hoisting) and tool (pre-namespaced properties) node types, plus a mixed-batch test — the existing tests only covered prompt, whose empty schema never exercises the hoisting path the whole fix depends on. - Document set_property_bool's OCC-bypass as intentionally best-effort, safe only for idempotent values (crud.rs, nodes.rs). - Document that the replace path assigns a fresh UUID rather than reusing the deleted node's ID — safe today since nothing references seeded content by stable ID, called out as a latent trap for future features. Addresses reviewer recommendations from PR #1818 review. Co-Authored-By: Claude <[email protected]>
Addressed review feedbackAll 3 🟡 suggestions from the initial review were addressed (none were skipped):
New commit: feb1e38. All 1042 Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: All changes are additive (new tests) or doc-comment-only — no logic changes to the reconciliation algorithm, |
…inference test Fixes two Important findings from the PR review: 1. seed_core_schemas_if_needed() gated the entire schema-seeding batch on a single task_exists check — the exact type-level skip pattern #1818 (06a94ee) eliminated for seeded content, just one abstraction level up. On any pre-existing dev database, the new agent-guidance schema node introduced by this PR would never be created, silently orphaning it. Now checks each core schema individually and creates only what's missing, so a schema added after a database's first run still reaches that database on the next start. Covered by a new test that deletes agent-guidance post-seed, reopens the same DB file (mirroring a daemon restart), and confirms it's recreated without touching the already-present task schema. 2. No test exercised seed_skill_nodes()'s real templates through the actual child_node_type: None inference path and asserted on the resulting children's node_type — the literal claim of this PR's item 1. Added a test that runs every seeded skill through prepare_nodes_from_template and confirms children are header/text (never prompt), with at least one header node per skill (every seed's guidance starts with a markdown heading). Verified both new tests fail against the pre-fix code and pass against the fix, by temporarily reverting each in isolation and confirming the failure before restoring. Suggestions from the same review (markdown_test.rs's inert "prompt" placeholder strings, core_schemas.rs's longer doc comment, props.rs's doc-example swap, the reconciliation test's count/comment update) were left as-is per the reviewer's own assessment that none warranted a change. Co-Authored-By: Claude <[email protected]>
… type; expose skill in nav (#1824) * Skill guidance becomes real markdown children; retire prompt type for agent-guidance (closes #1699) seed_skill_nodes() no longer routes children through child_node_type: Some("prompt") — they now come out as ordinary header/text nodes via markdown type inference, consistent with every other markdown-ingested document in NodeSpace. The prompt schema/behavior is retired, but PromptAssembler's base-system-prompt override nodes had a live, every-turn consumer keyed on node_type == "prompt", so this introduces a purpose-named agent-guidance schema in its place rather than leaving that lookup with no valid identity. agent-guidance carries no discovery metadata (unlike skill, which is matched via search_skills) — it's simply fetched by type, same mechanism prompt used, just named for what it is. NON_EMBEDDABLE_CONTAINER_TYPES and its parity test were updated in lockstep so embeddability stays correctly gated. The subtree-render consolidation and SIDENAV_CORE_TYPES nav exposure from this issue's remaining scope already shipped in #1755. Co-Authored-By: Claude <[email protected]> * Address review: per-schema seed reconciliation + skill-children type-inference test Fixes two Important findings from the PR review: 1. seed_core_schemas_if_needed() gated the entire schema-seeding batch on a single task_exists check — the exact type-level skip pattern #1818 (06a94ee) eliminated for seeded content, just one abstraction level up. On any pre-existing dev database, the new agent-guidance schema node introduced by this PR would never be created, silently orphaning it. Now checks each core schema individually and creates only what's missing, so a schema added after a database's first run still reaches that database on the next start. Covered by a new test that deletes agent-guidance post-seed, reopens the same DB file (mirroring a daemon restart), and confirms it's recreated without touching the already-present task schema. 2. No test exercised seed_skill_nodes()'s real templates through the actual child_node_type: None inference path and asserted on the resulting children's node_type — the literal claim of this PR's item 1. Added a test that runs every seeded skill through prepare_nodes_from_template and confirms children are header/text (never prompt), with at least one header node per skill (every seed's guidance starts with a markdown heading). Verified both new tests fail against the pre-fix code and pass against the fix, by temporarily reverting each in isolation and confirming the failure before restoring. Suggestions from the same review (markdown_test.rs's inert "prompt" placeholder strings, core_schemas.rs's longer doc comment, props.rs's doc-example swap, the reconciliation test's count/comment update) were left as-is per the reviewer's own assessment that none warranted a change. Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
…essions (#2559) * Add fetch-at-activation guidance mechanism for external agent skill sessions Implements the two unbuilt pieces #2532 tracked for issue #1958's fetched, hybrid-shaped delivery-channel decision: - `nodespace skill guidance <query>` (packages/cli) fetches procedural guidance from the graph's seeded `skill` nodes via the existing NodeService.SearchNodes RPC (node_type=skill, subtree markdown attached), wrapping every result in a provenance marker -- a `GRAPH-FETCHED GUIDANCE` banner in human mode, a `"provenance": "graph-fetched"` envelope in `--json` -- so fetched content is never silently indistinguishable from the skill's own static instructions. - SKILL.md's body gains a `## Graph-Authored Guidance (Fetched)` section instructing an activated agent to run this command before a nontrivial operation, and a new on-demand reference (references/graph-authored-guidance.md) spells out the trust boundary: fetched content can supply procedure, never permission, and any fetched instruction that tries to skip a confirmation or claims system/developer authority is itself the signal of a compromised graph entry. - The new reference file is wired through every place that ships packages/skill's reference tier: all five installer targets' `shims` lists (agents.ts), the PTY-spawned-agent path's embedded reference tier (context_assembly.rs, mechanical addition mirroring the two existing embeds -- required because that path reuses the same SKILL.md/references/ verbatim), and the public-repo publish script (publish-skill-repo.ts, already derived dynamically from agents.ts's shim lists so no logic change was needed there, only comments/tests). Also verifies, via new tests against the real seed_skill_nodes() registry, that the seeding-skips-by-node-type prerequisite #2532 listed as still-needed is already fixed (PR #1818/#1812, per-node versioned reconciliation, merged 2026-07-30 -- predating both #1958 and #2532): a compiled-template content change reaches an already-seeded database on next seed, and a live graph edit is immediately visible to a fetch with no reseed or restart. Manually verified end-to-end against a real isolated daemon + embedding model: edited a seeded guidance node's content, then confirmed `nodespace skill guidance` returned the edit. Co-Authored-By: Claude Sonnet 5 <[email protected]> * Address review: cap guidance --limit, remove bare issue refs, harden banner against spoofing - Cap `--limit` itself (not just include_markdown) at the server's markdown-attachment ceiling in a new build_guidance_request(), so a guidance entry can no longer print a full provenance banner around empty content when more than 5 results are requested. - Reword code/test comments that cited issue or PR numbers to describe the underlying behavior or history directly instead. - Harden print_guidance's human-mode provenance banner against a malicious or corrupted graph node forging a banner-shaped line: each banner now carries a per-invocation random tag (fresh UUIDv4, generated at call time and announced once at the top of the output) that fetched content authored before the call cannot have predicted. Fetched title, description, and markdown content is also passed through a new sanitize_for_terminal that strips ANSI CSI sequences and other control characters, so raw escape bytes in fetched content can no longer redraw or conceal the banner. --json output is unchanged (already unspoofable by construction). Also updates the reference doc to explain the tag mechanism to an agent reading it, and adds a uuid dependency to nodespace-cli for the tag. Co-Authored-By: Claude Sonnet 5 <[email protected]> --------- Co-authored-by: Claude Sonnet 5 <[email protected]>
Closes #1812