Skip to content

create_schema description route folds the type keyword into the inferred field name #1789

Closed

Description

@malibio

Found while implementing #1785 (PR #1788). Out of scope there, and explicitly noted as a separate concern in ADR-063.

Current behavior

#1785 made the two create_schema routes agree on namespacing — both now store bare field names. They still disagree on the field name itself, because the description route infers a name from the surrounding words and folds the type keyword into it:

Call Stored field name
{"name": "Venue", "description": "capacity number"} capacity_number
{"name": "Venue", "fields": [{"name": "capacity", "type": "number"}]} capacity

The description route reads "capacity number" as name capacity number + type number, then normalize_field_name (packages/core/src/schema/mod.rs) slugifies the whole phrase — including the type keyword — into capacity_number. The type keyword is consumed for type inference and retained in the name.

This is visible in the #1785 work: test_create_schema_paths_agree_on_stored_field_names uses the description "capacity" rather than "capacity number", with a comment explaining why, precisely so it tests namespacing rather than this.

Why it matters

Same reason the namespace divergence mattered — stored field names are user-visible keys, not an internal detail:

  • titleTemplate tokens resolve against stored names
  • CEL selectors in playbook rules
  • Query filter property names
  • Frontend property lookups

A user describing "capacity number" almost certainly wants a field called capacity of type number, not a field called capacity_number. The agent then has to guess which name was actually stored when it writes a subsequent template or filter.

Scope note

Unlike #1785 this is not a convention question with two defensible answers — capacity_number is not what the caller meant. But the fix is not purely mechanical either: stripping the type keyword needs care around names where the keyword is genuinely part of the field (invoice number, phone number, date of birth, account number). Naive stripping turns invoice number into invoice, which is a different wrong answer.

Worth checking how parse_field_descriptions splits name from type before picking an approach, and whether the type keyword should be dropped only when the remaining name is non-empty and the keyword sits at the end.

Acceptance criteria

  • Decide the inference rule, including what happens to names where the type keyword is part of the intended name (invoice number, phone number)
  • "capacity number" infers field name capacity with type number
  • Names where the keyword is intrinsic are not mangled — "invoice number" does not become invoice
  • A test asserts both create_schema routes agree on the stored name for the same intent, using a description where the type keyword is present (the create_schema paths disagree on whether field names carry a namespace prefix #1785 test deliberately avoids this case and should be extended or complemented)
  • Existing parse_field_descriptions / normalize_field_name tests updated to the decided rule

Activity

  1. malibio commented on Jul 28, 2026

    @malibio
    CollaboratorAuthor

    Baseline on worktree issue-1789-strip-type-keyword: Frontend 4106 passed (170 files). Rust schema (cargo test -p nodespace-core --lib schema): 121 passed, 0 failed.

  2. self-assigned this
    on Jul 28, 2026
  3. malibio commented on Jul 29, 2026

    @malibio
    CollaboratorAuthor

    Superseded in approach by #1800.

    Post-merge review of this work, plus the eval traces in scripts/results-e4b.json, established that the underlying problem is not that the description route infers badly — it is that the route exists at all, as an undocumented second meaning for a description parameter the tool schema documents as a prose blurb.

    #1800 deletes the route, which removes the STRIPPABLE_TYPE_KEYWORDS / INTRINSIC_KEYWORD_PREFIXES keep-list added here. That list grew 12 → 24 entries within this PR's review cycle, is English-only, and each entry's correctness is unfalsifiable — the tell that the mechanism was wrong rather than incomplete.

    Two things from this work survive in #1800: the tightened assert_eq! assertions, and the RESERVED_CORE_PROPERTIES shadowing check — the latter moved onto the explicit-fields path, where it is currently missing entirely.

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