Skip to content

create_schema paths disagree on whether field names carry a namespace prefix #1785

Closed

Description

@malibio

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:

  • titleTemplate tokens 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)

Acceptance criteria

  • The convention is decided and recorded as an ADR in nodespace-docs
  • Both create_schema paths 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_schema tool schema and guidance examples match the stored convention
  • A test asserts the two paths agree, so the divergence cannot silently return

Activity

  1. malibio commented on Jul 28, 2026

    @malibio
    CollaboratorAuthor

    Drafted the AC-1 decision as ADR-063 (decisions/063-namespace-prefixes-scope.md in 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:

    Properties without a prefix are reserved for core behaviors. Adding unnamespaced user properties will conflict with future releases.

    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 task extended with custom:effort, where a future release might add a core effort. A user-defined type like Venue has 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:

    • The ADR is Proposed, not Accepted — if you prefer Direction 1, the argument against it is written down and can simply be overruled.
    • Its Consequences section flags that the eval's current run-to-run variance means this change should not be validated by matrix score.
  2. malibio commented on Jul 28, 2026

    @malibio
    CollaboratorAuthor

    Baseline (worktree issue-1785-schema-field-namespace): Frontend 4104 passed across 170 test files, 0 failures.

  3. self-assigned this
    on Jul 28, 2026
  4. added a commit that references this issue on Jul 28, 2026
    d875c8b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions