Skip to content

fields.describe answers the scope's scheme on its first call - #73

Merged
jallers merged 1 commit into
masterfrom
claude/fields-describe-cold-schema
Nov 27, 2026
Merged

jallers merged 1 commit into
masterfrom
claude/fields-describe-cold-schema

Conversation

@jallers

@jallers jallers commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

What was wrong

On a client that had not yet loaded the Scope type, the first client.fields.describe(type, scope) answered scheme: undefined, important: [] and requiredAtClose: false, whatever the scope's scheme said. A second call on the same client, or any earlier read of a Scope, got it right. Reported by a chat-bot consumer, who reproduced it against a live instance.

Why

describe reads the scope's scheme with a sub-select and hands the schema to the wire module to translate the row. Translation only uses types already loaded, and describe never loaded Scope (or Scheme), unlike the client's own read methods. Untranslated, the sub-select stays the endpoint's array, and nothing in describe reads an array.

The existing tests missed it: the unit test seeded a full metamodel, and the live test ran on a client other tests had already warmed.

The change

  • describe calls schema.ensureFor for its scheme query before sending it, still in parallel with api/visibleFields.
  • Unit test on a client that has loaded nothing: the first answer carries the scheme, meta.v1/Scope is asked before the query, and a second call answers the same. It fails without the fix.
  • Live test: a fresh client's first describe equals a warm client's.
  • Changelog entry under Unreleased (to be 1.0.0-alpha.14), with the migration line: a client.schema.load("Scope") workaround can be removed.

Generated by Claude Code

… the answer

On a client that had not loaded the Scope type the row was left
untranslated, so the first call answered no scheme and no important
fields.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
@jallers
jallers merged commit f29469f into master Nov 27, 2026
4 checks passed
@jallers
jallers deleted the claude/fields-describe-cold-schema branch November 27, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants