Repository navigation
Consolidate subtree-render + drop dead code + expose skill in nav (part of #1699) - #1755
Merged
Merged
Conversation
…ll in nav The non-conflicting subset of #1699 (ADR-057): - Extract one shared flatten_subtree_content util in core (depth-first pre-order over the ordered adjacency list, skips empty content, root excluded) and use it from both skill_ops::render_skill_instructions and PromptAssembler::fetch_prompt_body, which carried independent copies of the same subtree walk. fetch_prompt_body now also skips empty-content nodes (it previously emitted blank sections) — a harmless unification. - Delete PromptAssembler::assemble_with_skill (zero callers). - Add 'skill' to SIDENAV_CORE_TYPES so skill nodes browse in the left nav. Items 2 (skill guidance -> markdown children) and 3 (retire the prompt type) are deferred: the prompt type has a LIVE consumer — the daemon seeds prompt-typed nodes (daemon/services/assembly.rs) and PromptAssembler::fetch_prompt_overrides queries them every agent turn — so retiring it would make those internal system-prompt override nodes embeddable (search pollution). That needs a re-spec (migrate the override mechanism off the prompt type). Detail on the issue. Part of #1699. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
Author
|
APPROVE Independent review — sound, safe to ship:
Merging as part of #1699; issue stays open for the deferred prompt-retirement (needs the override-node re-spec). |
malibio
added a commit
that referenced
this pull request
Jul 30, 2026
… 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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ships the non-conflicting subset of #1699 (ADR-057). Items 2 (skill guidance → markdown children) and 3 (retire the
prompttype) are deferred — see below and the issue comment.skill_ops::render_skill_instructionsandPromptAssembler::fetch_prompt_bodycarried two independent copies of the same DFS subtree walk. Extracted one sharedflatten_subtree_contentutil inpackages/core(node_service::hierarchy, re-exported atservices::), used by both.fetch_prompt_bodynow also skips empty-content nodes (previously emitted blank\n\nsections) — a harmless unification; nested children are still preserved.PromptAssembler::assemble_with_skill()(zero callers, leftover from the push-based discovery design ADR-038 replaced).'skill'added toSIDENAV_CORE_TYPES— skill nodes browse via the generic path (no new UI;skillis already a core schema).Why 2 & 3 are deferred
The issue's premise that the
prompttype has "zero remaining consumers" is incorrect: the daemon seeds prompt-typed nodes at startup (daemon/services/assembly.rs:229) andPromptAssembler::fetch_prompt_overridesqueriesnode_type == "prompt"every agent turn (agent_loop.rs:298→assemble(), a live path). Retiring the type would make those internal system-prompt override nodes fall back to the embeddableCustomNodeBehavior→ search pollution; item 2 has the same embeddability implication. Retiringpromptneeds a design decision (migrate the override mechanism off the type — theagent-configschema the issue gestures at) that's out of scope here. Full detail on the issue.Verification
flatten_subtree_contentis behavior-equivalent to both originals (same pre-order; the only change is the harmless empty-skip). core 973 / agent 301 lib tests pass; clippy clean; thefetch_prompt_bodybody-drop regression test still passes; pre-push gate green. Independent review: sound.Part of #1699 (issue stays open for items 2 & 3).