Repository navigation
Description
Problem
SchemaField has two name-ish fields doing three jobs:
name— unique key within the schema; storage/query key, CEL selector, titleTemplate tokendescription— currently doing double duty as both the human display label and the semantic explanation
Because description is rendered as the UI label (query table headers, kanban group-by, query editor, property forms), there is pressure to keep it short and label-like. The core task schema was authored that way — Some("Status"), Some("Priority"), Some("Due date") (packages/core/src/models/core_schemas.rs:80,111,129) — which reads fine in a header but tells an LLM nothing.
Where a field was authored with a genuine description, the prose leaks into the UI. Person (core_schemas.rs:1150,1168) renders column headers reading:
Display name; optional — a person may exist before a name is setEmail address; optional at schema level, required in practice for invited teammates
Task only looks correct by accident. The two goals are in direct conflict: a good label is a bad LLM description, and vice versa.
Proposal
Three fields per property, one consumer each:
| Field | Purpose | Consumer |
|---|---|---|
name |
unique key within the schema | storage, queries, CEL, titleTemplate |
friendly_name |
display label | all UI surfaces |
description |
what it's for, usage, examples | LLM schema comprehension |
This unblocks both sides at once: headers get short labels, and description becomes free to carry real semantic content — e.g. task status could become "Current workflow state; drives board columns and completion rollups" at zero UI cost. Given that schema retrieval embeds schema text, richer descriptions should improve retrieval rather than trading against display.
Design decisions
friendly_name is non-optional in storage; always populated. No read-time fallback, no UI branching — every reader does field.friendly_name unconditionally.
Defaulting happens once, at the write boundary. create_schema/update_schema derive friendly_name from name when the caller omits it (due_date → Due date, custom:capacity → Capacity). This keeps the agent-facing tool forgiving — the LLM is not forced to supply a third field per property or lose a turn to a rejected call — while guaranteeing the storage invariant.
Namespace prefixes are stripped for display (custom:capacity → Capacity) — verify against ADR-063 that this does not create ambiguity between a core and a prefixed field of the same base name in the same table.
Implementation notes
No backward compatibility. Pre-release, no users, no migration — reset the database. Per CLAUDE.md, do not add compat paths.
Two traps:
-
69 bare struct literals, no
Defaultimpl, no builder —SchemaFieldis constructed as an explicit literal in 69 places (48 incore_schemas.rs; alsomarkdown.rs,schema_node.rs,schema/mod.rs,context_ops.rs,entity_types_block.rs,schema.rs). Adding a field touches all 69. Add#[derive(Default)]or a builder in the same pass so the next field addition is not another 69-site change. -
The seeder will not update existing databases.
seed_core_schemas_if_needed(packages/core/src/services/node_service/mod.rs:1344) creates only schemas missing from the DB — its own doc says "Existing core schemas are left untouched".friendly_namevalues added tocore_schemas.rswill reach no existing install, making the change look broken on any non-reset database. Either require a DB reset for all devs, or extend the seeder to reconcile fields on existing core schemas. Decide explicitly; this is the same class of gap as previously seen with seeded guidance.
Also update: packages/nodespace-types/src/schema.rs:29-81 (note deny_unknown_fields at :30), TS mirror packages/desktop-app/src/lib/types/schema-node.ts:64-115, and the schema-editing UI so friendly_name is authorable.
Call sites to switch to friendly_name
Query surfaces (three near-duplicate copies of the same description-first regex):
packages/desktop-app/src/lib/components/query/table-view.svelte:42-49packages/desktop-app/src/lib/components/query/kanban-view.svelte:177-183packages/desktop-app/src/lib/components/query/query-editor-model.ts:42-49(labelForField)
Form surfaces:
schema-property-form.svelte:385,task-schema-form.svelte:646,generic-schema-form.svelte:163, plus nested-field editors
Consolidate into a single exported label helper; delete the duplicated regex. Stale doc comment at table-view.svelte:6 claims "field.label" — correct it.
Acceptance criteria
-
SchemaFieldcarriesname,friendly_name,descriptionwith distinct documented purposes -
friendly_namealways populated in storage; derived fromnameat the write boundary when omitted - No read-time fallback or null-branching on
friendly_namein any UI surface - Person query headers read
Name/Email; task headers unchanged - Core schema descriptions rewritten as genuine LLM-facing descriptions, no longer constrained to be label-like
- All UI label sites read
friendly_namevia one shared helper; duplicated regex removed -
SchemaFieldgainsDefault/builder so future field additions are not 69-site changes - Seeder question resolved explicitly (DB reset vs. field reconciliation) and documented
-
deny_unknown_fieldsstill satisfied; Rust and TS types in sync - Schema-editing UI allows authoring
friendly_name
Activity
malibio commentedon Aug 17, 2026
Scope addition — agent-facing tool schemas and skill guidance
friendly_nameis not only a storage/UI change.create_schemaandupdate_schemaare LLM-facing tools, and their parameter schemas are what the model reads when authoring a schema. Splitting the fields without updating them leaves the model unable to setfriendly_nameat all, and still being told the old meaning ofdescription. This is in scope for this issue — shipping the struct change without it would leave the agent path broken.1.
create_schematool schema —packages/agent/src/local_agent/tools.rs:758Per-field properties are defined at
:786-793. Today:That is circular and tells the model nothing about what to write — under-specified even before this change. Under the split it becomes actively misleading, since
descriptionstops being the UI label.Required changes:
friendly_nameto the per-field property list, described as the human-readable display label shown in table headers and forms (e.g."Due date"). State that omitting it is fine — it is derived fromnameat the write boundary.descriptionguidance to say what it is now for: an explanation of the field's meaning, purpose, and usage — with an example where helpful — consumed by the model when reasoning about the schema. It should encourage more detail, not less. The current one-liner implicitly encourages a terse label.2.
update_schematool schema —tools.rs:833add_fieldsitems (:857-865) carry an even barer"description": { "type": "string" }with no description at all. Addfriendly_namehere and givedescriptionthe same rewritten guidance.descriptionparameter (:844-847, "New description (optional)") refers to the schema's description, not a field's — verify it stays unambiguous once field-leveldescriptionis redefined.update_schemaneeds a way to change a field'sfriendly_namewithout touchingname.3.
rename_fields— display vs. identity renamerename_fields(tools.rs:877) "rekeys property data on ALL existing nodes of this schema type". Under the split there are now two distinct rename operations:name— an identity change; still requires data migration and remains breaking fortitleTemplatetokens, CEL selectors, and query filtersfriendly_name— display-only; must not trigger any data migrationThe tool must not let the model conflate these. Note
rename_fieldsitems useadditionalProperties: false(:886), so any new parameter must be added explicitly or calls will be rejected.4. Skill guidance content
The schema-authoring skill (
packages/agent/src/skill_pipeline.rs:370) is the retrieval-facing description covering "define fields", "create schema", "update schema", "add a field", "rename a field". Any skill body instructing the agent how to define fields needs to teach the three-field model. Specifically, any guidance that impliesdescriptionshould be short or label-like now says the opposite of what is wanted.Seeding caveat — same trap as the core-schema seeder noted in this issue. Skills are DB-seeded nodes and seeding skips by node type, so revised skill text will not reach an existing install without a database reset. Whatever is decided for core-schema reconciliation should cover skills too, or the revision silently fails to take effect and the agent keeps following the old guidance.
5. Verify, do not assume, the plumbing
handle_create_schemais imported attools.rs:15. Trace the full path from tool parameters →SchemaFieldconstruction and confirmfriendly_nameis threaded end to end, including the write-boundary derivation when the model omits it. A parameter accepted by the tool schema but dropped before storage would be worse than not adding it.Added acceptance criteria
create_schematool schema exposesfriendly_nameper field, documented as the display label and as optionalupdate_schema.add_fieldsexposesfriendly_namewith the same semanticsdescriptionguidance rewritten in both tools to describe LLM-facing semantic content, encouraging meaningful detail rather than a terse labelrename_fieldsdistinguishes identity rename (migrates data) from display rename (does not);additionalProperties: falserespectedfriendly_namethreaded end to end from tool parameters through to storage, with write-boundary derivation verified when omittedmalibio commentedon Aug 17, 2026
Two corrections to earlier comments, and one blocking prerequisite
1. BLOCKING — field
descriptionis not visible to the LLM todayThe rationale for this issue assumes
descriptionbecomes LLM-facing semantic content. It currently never reaches the model.EntityFieldDescriptor(packages/core/src/ops/entity_types_block.rs:46-56) carries onlyname,field_type,enum_values,required.from_schema_field(:108-124) dropsdescriptionentirely, andrender_shape(:91) emits justname: type {enums}.So splitting the fields and writing rich descriptions achieves nothing for the LLM unless
EntityFieldDescriptor, itsto_json, andrender_shapeare widened to carrydescriptioninto the ENTITY TYPES block.This is the load-bearing change of the whole issue — without it, the split is a pure UI fix and the stated LLM benefit does not materialise. Treat it as a prerequisite, not a follow-up.
Worth measuring rather than assuming: adding per-field descriptions grows every ENTITY TYPES block, and prior work here found a large resident prompt measurably hurt accuracy versus a minimal one. Verify the added context earns its tokens instead of diluting the prompt.
2. Correction — skills DO auto-propagate; core schemas do not
An earlier comment claimed revised skill text would not reach existing installs without a DB reset. That is wrong for skills.
Skills seed through
seed_nodes_from_templates(packages/core/src/services/node_service/mod.rs:1464), which uses content-hash reconciliation —compute_seed_version(packages/core/src/markdown/mod.rs:1451) SHA-256s node_type + content + properties, and a changed hash causes the seeded node to be deleted and recreated. Editing the Rust literals therefore propagates automatically.The one exception: nodes whose
_seed.user_modified == trueare skipped (mod.rs:1539-1550).The reseeding concern stands only for core schemas, where
seed_core_schemas_if_needed(mod.rs:1344) creates only missing schemas and leaves existing ones untouched. That remains a real trap forfriendly_namevalues added tocore_schemas.rs.3. There is no "keep it short" instruction to invert
A search for "keep it short" / "short label" / "display label" across
packages/agent/src,packages/core/src, andSKILL.mdreturns no hits. The problem is silence, not wrong instruction —tools.rs:790says only"Field description", andtools.rs:860has no description at all. The fix is to add substantive guidance, not to reverse existing guidance.Good exemplars of the target style already exist in
core_schemas.rs— personname: "Display name; optional — a person may exist before a name is set".4. Additional scope discovered
Few-shot examples dominate model behaviour — these matter more than prose:
packages/agent/src/skill_pipeline.rs:67-127— three worked EXAMPLE blocks (Customer, Invoice, Project). None showsfriendly_nameor a per-fielddescription.packages/agent/src/skill_rules.rs:123-127(UNIQUE_FIELD_FLAGS) and:111-115(TARGET_TYPE_MUST_EXIST) embed inline JSON field examples, rendered into both the seeded skill and SKILL.md.Naming collision risk:
skill_pipeline.rs:52currently says "A 'description' field is acceptable when it adds value beyond the title" — that is about a field nameddescription, which becomes badly confusable with the per-fielddescriptionattribute. Disambiguate regardless of this issue.update_schemacannot edit an existing field's description or friendly_name. It offers onlyadd_fields/remove_fields/rename_fields(tools.rs:852-889). Renaming a display label without a data migration is therefore impossible today — a missing capability, not just stale text. Decide whether this issue adds it.Wire-format spelling must be settled:
SchemaFielduses#[serde(rename_all = "camelCase")], so the wire key isfriendlyName, while the tool JSON schemas use snake_case elsewhere (title_template). Pick one and apply it consistently across the Rust struct, TS mirror, and tool schema.SKILL.mdis a hybrid. Only the block between<!-- BEGIN GENERATED: schema-rules -->/<!-- END -->regenerates, viacargo run -p nodespace-agent --bin gen_skill_md -- --write. Everything else is hand-written.gen_skill_md.rs:157gates the build if the generated block is stale. Alsoskill_rules.rs:45skill_md_key_phraseis hand-maintained and asserted by a test — rewording a rule requires updating its key phrase.Revised acceptance criteria
EntityFieldDescriptorcarriesdescriptioninto the ENTITY TYPES block (prerequisite — without this the LLM half is inert)skill_pipeline.rs:67-127and the inline JSON inskill_rules.rsupdated to show the three-field modeldescriptionvs. a field nameddescriptiondisambiguated inskill_pipeline.rs:52update_schemagains the ability to edit an existing field'sfriendly_name/descriptionfriendlyNamevsfriendly_name) settled and applied consistentlygen_skill_md --writere-run;skill_md_key_phrasevalues updated if rules rewordedmstomar125 commentedon Aug 17, 2026
Implemented in #2105.
Summary of what landed:
SchemaField.friendly_nameadded (non-optional in storage,#[serde(default)]-tolerant on input), derived fromnameat thecreate_schema/update_schemawrite boundary when omitted (derive_friendly_name()— strips namespace prefix, humanizes the rest).SchemaField/SchemaProtectionLevelgained#[derive(Default)], so future field additions can use..Default::default()instead of touching all 68 construction sites again.SchemaFieldliterals updated (48 incore_schemas.rs, 20 elsewhere).taskandprojectdescriptions rewritten as genuine LLM-facing prose;person's were already good examples, just neededfriendly_name(Name/Email).friendly_namethrough one shared helper (labelForField()), replacing five independently-duplicated name-humanizing regexes.seed_core_schemas_if_neededreconciliation pass — full reasoning in the PR description (short version: the storage-format change isn't additive-only-to-core-schemas, it affects every pre-existing schema's field JSON including user-created ones, so a core-schemas-only reconciliation would look complete while leaving custom schemas silently stale — worse than an honest reset).create_schema/update_schematool JSON schemas + skill guidance inpackages/agent) is deliberately deferred to Expose friendly_name in create_schema/update_schema tool schemas + skill guidance (agent lane, follow-up to #2101) #2104 — that's a different engineer's lane per this repo's ownership convention, and the underlying plumbing it depends on (thepackages/corewrite boundary) already acceptsfriendlyNamefrom any caller today.Full reasoning, testing, and acceptance-criteria checklist in the PR description.