Skip to content

Core's update_schema holds a field change that saved queries or plays name, not only the agent's tool #3786

Closed

Description

@malibio

Overview

update_schema does not enforce that a built-in type's declared fields are fixed, and the check for what names a field before a rename or removal lives only in the local agent's tool path. Both belong in core's write.

Problem Statement

  • ADR-086 says a built-in type is closed, and ADR-100 §5 says its declared fields cannot be changed or removed; a user adds a prefixed field of their own, or a value to a list that accepts them.
  • Core's update_schema refuses a rename or removal only for a field whose protection is core or system (packages/core/src/schema/mod.rs, Phase 0, via can_delete_field/can_modify_field). A declared field of a built-in type with user protection, such as task.priority, can be removed, or renamed to a prefixed name, through the CLI or any other caller.
  • The chat bound to a type says such a field cannot be changed, so what the chat says and what core enforces differ.
  • The saved queries, plays and title templates that name a field are looked up and held for the user's agreement only in the local agent's update_schema tool (field_change_refusal). CLI and other callers get no warning, and core's own play-impact check is the only one they meet.

Proposed Solution

  • In update_schema, refuse a removal or rename of a field a built-in schema declares, whatever its protection level, with the reason and what is allowed (a prefixed field, an added value). Decide whether this reads the schema's is_core or sets protection: core on every field a core schema seeds.
  • Move the what-names-it check (schema::field_references::find_field_references) into the write, beside check_schema_change_impact, with one agreement parameter for the whole set (plays, saved queries, title templates) rather than the tool's confirmed and core's force being two. Remove the guard from the tool.
  • The tool keeps telling the model what to do after a refusal, from core's message.

Documentation

Acceptance Criteria

  • Removing or renaming a declared field of a built-in type through update_schema is refused with the reason, for any protection level; a prefixed field and an added value still work
  • A rename or removal that a saved query, play or title template names is refused by core until agreed, with the list, for the CLI and the agent alike
  • The local agent tool no longer carries its own copy of the check; its refusal text comes from core
  • A test per refusal in schema_test.rs, and the agent tool test updated
  • bun run test:changed passes

Technical Specifications

Reference Files

  • packages/core/src/schema/mod.rs - update_schema Phase 0, check_schema_change_impact call
  • packages/core/src/schema/field_references.rs - the lookup
  • packages/agent/src/local_agent/tools.rs - field_change_refusal, def_update_schema
  • packages/core/src/models/core_schemas.rs - seeded protection levels

Implementation Details

  • A field name is also a user-visible key; a core field's rename must stay refused even when the new name is prefixed.
  • Seeded core schemas already declare protection per field; check whether setting it there is simpler than reading is_core in the write.

Non-Goals

  • Changing what a user may add to a built-in type
  • A visual schema editor

Activity

  1. self-assigned this
    on Oct 13, 2026
  2. changed the title [-]Core's update_schema refuses a built-in type's declared fields and holds a change something names[/-] [+]Core's update_schema holds a field change that saved queries or plays name, not only the agent's tool[/+] on Oct 13, 2026
  3. added a commit that references this issue on Oct 13, 2026
    d237a25
  4. added a commit that references this issue on Oct 13, 2026
    a6bb9aa
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