Repository navigation
Description
Overview
strategy/vision.md states NodeSpace's core promise plainly: the knowledge graph is "dynamically assembled into the right context for each session, task, developer, and agent," and that "Methodologies become executable... Install a methodology... the community's collective learning about effective practices gets captured, refined, and redistributed." Investigated directly against the current implementation this session (prompted by designing two methodology recipes, #2596 and #2652, and asking whether an agent would actually know how to use their new schemas/relationships): schema-existence is already dynamically surfaced, but schema-meaning is not.
To be precise about what already works: a deterministic "EXISTING SCHEMAS" block is automatically pre-injected into the agent's prompt by Stage-2 routing (packages/agent/src/local_agent/tools.rs:2213-2222, packages/agent/src/local_agent/agent_loop.rs:10012-10115) — no tool call required, no staleness window. This genuinely gives the agent live awareness of which node types currently exist, and seeded skill guidance already references it directly ("Node Creation": "set node_type to the id shown in EXISTING SCHEMAS, copied exactly" — packages/agent/src/skill_pipeline.rs:462). This part of the vision's "dynamically assembled" promise is real and working.
What is confirmed missing is narrower: the block surfaces schema IDs only — not the description prose a schema author already writes explaining what a field means, why a relationship exists, or how to use it correctly. That richer content exists as real data today and is silently dropped before it ever reaches the model, confirmed via direct code inspection below.
Problem Statement
Three separate, already-existing description fields carry real agent-facing guidance content, and none of them reach the model:
SchemaField.description: Option<String>(packages/nodespace-types/src/schema.rs:150-156) — its own doc comment already states the intent: "What the field is for: meaning, purpose, usage, an example where helpful. Consumed by the model for schema comprehension." In practice, it is not consumed by the model at all.SchemaRelationship.description: Option<String>(packages/nodespace-types/src/schema.rs:281) — same shape, same gap.SchemaNode's own description — stored as a markdown child subtree, not a flat field (packages/core/src/models/schema_node.rs:10-19), already aggregated into the schema's embedding for semantic retrieval (get_aggregated_content) — but that embedding only helps a schema be found via search, it does not deliver the description's actual content to the model once found or once the schema is already known via the "EXISTING SCHEMAS" block.
The only schema-derived content that currently reaches the model is EntityTypeDescriptor::from_schema (packages/core/src/ops/entity_types_block.rs:108-141), attached as a schema_metadata sidecar to find_skills results (packages/core/src/ops/skill_ops.rs:344-394 — the MCP-exposed name for external agents including Claude via ACP; the local-model-facing equivalent, search_skills, is deliberately withheld from the local model per ADR-038, with schema-ID awareness instead delivered via the separate "EXISTING SCHEMAS" prompt injection described above). EntityTypeDescriptor carries only type_id, name, fields[{name, field_type, enum_values, required}], title_template — every description field is read from the schema struct and then dropped before serialization. find_skills itself only searches skill-typed nodes (skill_ops.rs:320, hardcoded "skill"), so a schema with no hand-authored skill describing it gets no schema_metadata at all via this path, regardless.
The practical consequence, surfaced directly while designing #2596/#2652: a newly-installed schema like epic or sprint gets its ID and field names/types surfaced automatically (via "EXISTING SCHEMAS"), but has no way to teach an agent what its fields mean or which relationship to use (e.g. epic.stories vs. has_child) unless a human separately hand-writes a full skill document for it. The description text schema authors already write — with a doc comment literally promising it's "consumed by the model" — is silently discarded.
Proposed Solution
No new schema field is required — the necessary content already exists on SchemaField, SchemaRelationship, and SchemaNode's description subtree. This is a rendering/plumbing fix, not a new data-modeling exercise:
EntityTypeDescriptor::from_schema/EntityFieldDescriptor::from_schema_field(entity_types_block.rs) include each field'sdescriptionand each relationship'sdescriptionin the renderedschema_metadata, rather than dropping them.find_skills(or a new, parallel schema-lookup path — see Non-Goals) fetches and includes theSchemaNode's own description subtree content (reusing the existing subtree-render utility consolidated under ADR-057,render_subtree_dfs/its shared successor) alongside the field/relationship-level descriptions.- This
schema_metadatabecomes available to the model whenever a schema is in context — via an existing skill result (today) or, if Add methodology recipe mechanism (TS source, generated CLI reference doc) with Linear-style as first recipe #2596/Add methodology recipe: Jira-style work tracking (Epic/Story/Bug hierarchy, Sprints) #2652-style recipes end up needing schema-only discovery independent of any hand-authored skill (a real possibility this issue does not resolve — see Non-Goals), via whatever mechanism a follow-up decides.
Architecture Impact
This does not reverse any ADR. ../nodespace-docs/decisions/057-skill-node-markdown-children.md (ADR-057) already establishes the shared-subtree-render pattern this issue's item 2 reuses, and explicitly scoped itself to skill node shape, not to whether schema descriptions reach the model — this issue closes a gap ADR-057 didn't address, it doesn't contradict it. ../nodespace-docs/decisions/038-skill-mediated-tool-routing.md (ADR-038, skill discovery) is unchanged — this issue does not alter how skills are found or how "EXISTING SCHEMAS" injection works, only what schema-derived content rides alongside a found skill's result. ../nodespace-docs/decisions/029-behavior-owned-embedding.md (ADR-029) was checked and confirmed unrelated (it governs the vector-embedding pipeline, not agent-facing prompt assembly).
Acceptance Criteria
-
EntityFieldDescriptorincludes each field'sdescription -
SchemaRelationship'sdescriptionis included inschema_metadata's relationship listing (relationship descriptors are not currently represented at all inEntityTypeDescriptorper current code — confirm during implementation whether relationships need a new descriptor sub-struct or fit into the existing shape) -
SchemaNode's description subtree content is fetched and included inschema_metadata(or the model-facing skill result more broadly), reusing the existing shared subtree-render utility rather than a third independent implementation - A schema authored with rich field/relationship/schema-level descriptions (e.g. a test fixture schema) is verifiably present in a
find_skillsresult'sschema_metadata, not silently dropped - Tests pass (
bun run test:all) - Code passes
bun run quality:fix
Technical Specifications
Reference Files
packages/nodespace-types/src/schema.rs—SchemaField.description(~line 150-156),SchemaRelationship.description(~line 281)packages/core/src/models/schema_node.rs—SchemaNode's description-as-child-subtree convention (~line 10-19)packages/core/src/ops/entity_types_block.rs—EntityTypeDescriptor::from_schema(~line 130-141),EntityFieldDescriptor::from_schema_field(~line 108-124) — both currently dropdescriptionpackages/core/src/ops/skill_ops.rs—find_skills(~line 299-390),render_skill_instructions/render_subtree_dfs(~line 54-101) — the shared subtree-render utility this issue's item 2 reusespackages/agent/src/local_agent/tools.rs(~line 2213-2222) andagent_loop.rs(~line 10012-10115) — the "EXISTING SCHEMAS" deterministic prompt-injection mechanism this issue does NOT change, cited here only to scope the boundary of what already works vs. what this issue fixes../nodespace-docs/decisions/057-schema-relationship-declarations-are-edges.md— precedent for the shared-utility consolidation pattern
Dependencies
None — independent of extends/#2598 and of any recipe work; this is a plumbing fix to existing, already-implemented schema/skill infrastructure.
Related Issues
- Add methodology recipe mechanism (TS source, generated CLI reference doc) with Linear-style as first recipe #2596 (Linear-style methodology recipe) and Add methodology recipe: Jira-style work tracking (Epic/Story/Bug hierarchy, Sprints) #2652 (Jira-style methodology recipe) — both surfaced this gap during design; both benefit directly once landed, since their newly-installed schemas (
issue/cycle,epic/sprint/story/bug) would have their existing field/relationship descriptions actually reach the agent instead of being silently dropped - A separate, not-yet-filed need surfaced alongside this one: existing seeded skills ("Node Creation", "Graph Editing") hardcode
task.status's literal 4-value set as prose (packages/agent/src/skill_pipeline.rs:458,packages/agent/src/skill_rules.rs:219-224), which will go stale the moment any recipe extendstask.statusviaadd_field_values(ADR-076) — this is a distinct problem (stale hardcoded prose vs. never-surfaced description text) from what this issue fixes, and needs its own follow-up
Non-Goals
- Whether schemas need to be discoverable independent of any hand-authored skill (i.e., whether
find_skills's"skill"-only search should be broadened, or a parallel schema-search path added) — this issue only fixes what happens to description content once a schema is already in context via an existing skill result; the discovery-gap for a schema with zero associated skill is real (confirmed during investigation) but is a separate, larger design question about ADR-038's retrieval mechanism, not resolved here - Changing the "EXISTING SCHEMAS" prompt-injection mechanism itself — it already works correctly for schema-ID awareness; this issue is scoped to description content only
- Updating existing seeded skills' stale hardcoded status-value prose — tracked separately, see Related Issues
- Seeding new recipe-specific skill guidance for Add methodology recipe mechanism (TS source, generated CLI reference doc) with Linear-style as first recipe #2596/Add methodology recipe: Jira-style work tracking (Epic/Story/Bug hierarchy, Sprints) #2652's own schemas (e.g. "how to add an issue to a Sprint") — this issue makes existing description fields reach the model; it does not author new procedural guidance content, which remains each recipe's own responsibility
Activity
Rebase onto main and route schema-kind results through #2653's descri…
Widen find_skills to discover schema-typed nodes with no associated s…