Repository navigation
Description
Overview
create_schema's description parameter has two meanings. The tool schema documents one; the code implements a second, undocumented one.
packages/agent/src/local_agent/tools.rs:615-618 declares:
"description": {
"type": "string",
"description": "Brief description of what this entity type represents"
}A prose blurb. Nowhere does it say that omitting fields causes description to be parsed into a field list — inferring both field names and field types from English.
Every bug in the create_schema cluster (#1777, #1785, #1789) is a consequence of that hidden second meaning. This issue removes it.
Why inference cannot be made trustworthy
The inference is built on contains_any (packages/core/src/schema/mod.rs:1362), a plain substring match over the whole description. Simulated against 26 realistic descriptions, 7 are mistyped — a 27% silent-wrong-type rate:
| Description | Inferred | Correct | Cause |
|---|---|---|---|
notes, note, notes text |
boolean | string | contains no |
nominee |
boolean | string | contains no |
summary |
number | string | contains sum |
country |
number | string | contains count |
timezone |
date | string | contains time |
is_field_required (:1353) has the same defect — any description containing "must" or "critical" anywhere marks the field required. AdditionalConstraints' matching is substring-based and bidirectional (req.contains(field.name) || field.name.contains(req), :1380-1383), so required_fields: ["date"] marks every field whose name contains "date".
These are not ambiguous prose losing a coin flip. They are plain words mistyped by an implementation detail — and the wrong type is silent: the schema is created, the UI renders the wrong control, and writes fail validation later.
Name inference has the same character. #1789 added STRIPPABLE_TYPE_KEYWORDS and INTRINSIC_KEYWORD_PREFIXES — a hand-maintained list of English nouns recording which ones own the word "number" (invoice, phone, ticket, flight, …). That list grew from 12 to 24 entries within a single PR's review cycle, is English-only in a product with no such constraint, and each entry's correctness is unfalsifiable. Its own follow-up commit had to add 24 assertions that prove the list contains what the list contains.
The premise behind that work was correct — "capacity number" and "invoice number" are structurally identical, so intent cannot be read from the phrase. The right conclusion is to require the caller to state the type, not to encode a lexicon.
The route is barely used anyway
The eval traces show the model does not reach for prose. On the failing scenario it supplies neither fields nor description — just name + title_template (see #1799). So the inference engine is a maintenance burden on a path the model barely takes, while making fields look optional in a way the tool schema never intended.
Work
Delete from packages/core/src/schema/mod.rs (~450 lines, roughly :972-1409 plus the struct at :168):
parse_field_descriptions, split_field_descriptions, parse_single_field_description, extract_field_name, extract_before_paren, extract_before_keyword, strip_trailing_type_keyword, STRIPPABLE_TYPE_KEYWORDS, INTRINSIC_KEYWORD_PREFIXES, infer_field_type, extract_enum_values, is_field_required, contains_any, apply_constraints, normalize_inferred_fields, InferredField, AdditionalConstraints, and the additional_constraints parameter.
Keep the description parameter. It is load-bearing for a different reason: create_description_subtree (:895) stores it as a child node so it lands in the schema's embedding and enables semantic discovery. Unaffected by this change.
Move, do not lose: RESERVED_CORE_PROPERTIES and its shadowing warning currently fire only on the inferred path (normalize_inferred_fields, :1435). Deleting the route would drop that check entirely. Move it to run over explicit fields, where it is currently absent — this is the ADR-063 shadowing rule and applies to caller-supplied names at least as much as inferred ones.
Keep unconditionally: the tightened assert_eq! assertions from #1789 wherever they apply to surviving code. .contains() on a schema field list is precisely the weakness that made #1775's regression tests vacuous (#1783).
Acceptance Criteria
- The description-inference route is gone;
create_schemawith adescriptionand nofieldscreates a schema with no inferred fields - A call with no
fieldsreturns an actionable error naming what is missing, rather than silently creating a property-less type - Tool-schema text for
descriptioncloses the ambiguity at source:"Brief prose summary of what this entity type represents. This is NOT parsed into fields — define every field explicitly in \"fields\"." -
RESERVED_CORE_PROPERTIESshadowing warning fires on explicitfields, with a test that fails without it -
AdditionalConstraintsandadditional_constraintsremoved; CLI docstring updated (packages/cli/src/commands/schema.rs:5) - No remaining references to the deleted functions anywhere in the workspace
- Existing tests updated or deleted, not weakened — no
.contains()assertions reintroduced on field lists
Relationship to other issues
- create_schema succeeds with no fields: agent is routed around the guidance that teaches them, and noExtraTypes cannot see the failure #1799 — the agent-guidance and eval-assertion half. Land create_schema succeeds with no fields: agent is routed around the guidance that teaches them, and noExtraTypes cannot see the failure #1799's assertion fix first: it converts scenario 3 from a false pass into an honest failure, giving a real baseline to measure this against.
- create_schema description route folds the type keyword into the inferred field name #1789 (merged
43ad456d) — this reverts its inference scaffolding. The keep-list falls out with the route; the tightened assertions and the reserved-property check survive as described above. - Supersedes any standalone fix to
contains_any's substring matching — the measurement above is evidence for deletion, not a bug to fix in place.
Notes
No migration needed. The inference behavior was never advertised in the tool schema, so this deletes an undocumented behavior, not a contract. The CLI (packages/cli/src/commands/schema.rs) and gRPC seam (packages/daemon/src/services/node_service.rs:1145) are JSON passthroughs; no frontend caller exists.
Activity
malibio commentedon Jul 29, 2026
Documentation impact
Checked
nodespace-docsfor whether the inference route is specified anywhere as intended design. It is not. No ADR decides it; the tool schema documentsdescriptionas a prose blurb. It appears only descriptively.Two updates belong in this issue's PR, after the code change:
components/schema-management.md:83— reword "Bothcreate_schemaroutes (explicitfieldsand inferreddescription) store the name they are given" once only one route remains.decisions/063-namespace-prefixes-scope.md— its decision (bare names on user-defined types, prefixes only on core types) is unaffected and stays. But line 40's mechanism sentence — "The description route therefore stops namespacing inferred fields on user-defined types, and both routes converge on the caller's names" — describes a route that will no longer exist. Needs a short amendment noting the convergence is now structural.Worth recording: ADR-063 line 29 already stated "The agent uses the explicit-fields route almost exclusively", and line 70 flagged the name-inference divergence as "out of scope here." That scoping was correct for that ADR, but downstream it was read as "a bug to fix on its own terms" rather than "an open question about whether this route should exist" — which is how #1789 came to add a 24-entry English noun keep-list to a route the same ADR described as barely used.
mstomar125 commentedon Jul 29, 2026
Picking this up now (remote/mini session).
mstomar125 commentedon Jul 29, 2026
Handing this to @malibio — it falls under the local-agent / skills work he flagged he's actively on, so reassigning to avoid a collision. Unassigning myself; not starting or continuing it on the remote side.
malibio commentedon Jul 30, 2026
Cross-reference: #1809 also edits the
create_schemaregion ofpackages/agent/src/local_agent/tools.rs— it removes anENUM FIELDSline from resident prose that contradicts the tool schema's (correct)coreValueskey attools.rs:630/:698.Different defect, adjacent lines. Worth coordinating if both are in flight, though they should not conflict — this issue removes the description-inference route, #1809 touches the enum-values key and
deny_unknown_fields.Both are instances of the same underlying pattern now recorded in ADR-064: a parameter carrying two meanings across two instruction channels, with the undocumented one winning.
malibio commentedon Jul 30, 2026
Frontend baseline: 4111 passed, 1 flaky (architecture-benchmarks.test.ts perf threshold — known machine-load flake, not related to this issue). 170/171 test files passed.
Delete the create_schema description-inference route: an undocumented…
Make the agent eval diagnostic: raw-output trace, uniformity guard, e…
Record the honest post-ADR-064 baseline: 9/12 (6/9/8 across 3 runs), …
Make the agent eval diagnostic before recording a baseline; revisit A…