Repository navigation
Description
Found during review of #1782 (which fixed #1777). Not a regression from that work; it is the design question that fix deliberately left open.
Current behavior
The two create_schema routes produce different stored property keys for the same user intent:
| Call | Stored field name |
|---|---|
{"name": "Venue", "description": "capacity number"} |
custom:capacity |
{"name": "Venue", "fields": [{"name": "capacity", ...}]} |
capacity |
The description path namespaces during inference (normalize_and_namespace_fields, packages/core/src/schema/mod.rs). The explicit-fields path stores caller-supplied names verbatim — packages/core/src/schema/mod.rs hands explicit_fields straight through with no normalization.
#1782 made the field-name validator accept both forms, so the two paths no longer conflict — the create call succeeds either way. They still do not agree on the convention.
Why it matters
Stored field names are user-visible keys, not an internal detail. A schema created one way needs different call sites than the same schema created the other way:
titleTemplatetokens resolve against stored names —{custom:capacity}vs{capacity}- CEL selectors in playbook rules
- Query filter property names
- Frontend property lookups
CLAUDE.md states "No user properties without namespace prefix — conflicts with future core properties", which the explicit path silently permits.
The decision to make first
This is not obviously a "make the explicit path namespace" task. Two coherent directions, with different costs:
Direction 1 — namespace the explicit path too. Matches the stated CLAUDE.md rule and the core-property-collision rationale. Cost: the agent uses this path almost exclusively, so every agent-authored template, query, and rule then carries the custom: prefix. The create_schema tool schema and agent guidance examples currently show bare names and must change in lockstep, or the model writes calls that do not match what gets stored.
Direction 2 — stop namespacing in the description path. Treat the namespace as a caller concern, so both paths store what they are given. Less churn, and no change to the agent-facing contract. Cost: gives up the automatic collision protection for inferred fields, and diverges from the CLAUDE.md rule as written.
Pick the convention before implementing.
Blast radius (either direction)
- Existing schemas in dev DBs keep their old keys. Pre-release, so a DB reset is acceptable rather than a migration.
- The aichat-matrix eval asserts on tool-call shapes and is currently noisy (~8/12 with run-to-run variance per Agent emits malformed tool calls: title_template referencing undefined fields, and calls with empty arguments #1775/Agent emits malformed tool calls: title_template referencing undefined fields, and calls with empty arguments #1781). Landing a keying change while that variance is unresolved makes score movement hard to attribute — worth sequencing after, or measuring with extra runs.
- Agent tool schema + guidance examples must move with the code.
Acceptance criteria
- The convention is decided and recorded as an ADR in
nodespace-docs - Both
create_schemapaths produce the same stored field name for the same user intent -
validate_schema_field_name(packages/core/src/behaviors/mod.rs) is updated if the chosen direction makes one form invalid, and its doc comment reflects the decided rule - Agent
create_schematool schema and guidance examples match the stored convention - A test asserts the two paths agree, so the divergence cannot silently return
Activity
malibio commentedon Jul 28, 2026
Drafted the AC-1 decision as ADR-063 (
decisions/063-namespace-prefixes-scope.mdin nodespace-docs, pushed as c4ff6b8). Status is Proposed — it records the argument so the decision can be made deliberately, not defaulted into.It proposes a third option the issue's two directions don't cover, from reading the rule's stated rationale in
components/schema-management.md:The collision being prevented is with a core property that doesn't exist yet. That's only possible where a core schema and user fields share a namespace — a
taskextended withcustom:effort, where a future release might add a coreeffort. A user-defined type likeVenuehas no core fields and won't be given any, so the hazard can't arise there.Proposed: prefix when extending a type you don't own; store caller-supplied names verbatim on user-defined types. The description route stops namespacing inferred fields on user-defined types, and both routes converge on the caller's names.
This satisfies AC-2 (both paths agree) without the lockstep change Direction 1 requires — the agent tool schema and guidance examples already show bare names and stay correct, so there's no window where the model writes calls that don't match storage.
Direction 1 is recorded as rejected for cost, not correctness. It matches the rule's literal wording; it just pays a repository-wide keying change to prevent a collision that can't occur on the types where the change would land.
Trade-off stated honestly in the ADR: the rule becomes conditional on the target type ("prefix when extending a type you don't own") rather than universal, which is harder to state and will be re-litigated unless the validator and its doc comment carry the distinction.
Two things worth noting for whoever implements:
malibio commentedon Jul 28, 2026
Baseline (worktree issue-1785-schema-field-namespace): Frontend 4104 passed across 170 test files, 0 failures.
Make both create_schema paths agree on stored field names (closes #1785)