Skip to content

Compiler: type an untyped nested response field as any (unblocks Calendar events) - #161

Merged
sykosyber merged 1 commit into
mainfrom
wp/omni/untyped-output-fields
Oct 13, 2026
Merged

sykosyber merged 1 commit into
mainfrom
wp/omni/untyped-output-fields

Conversation

@sykosyber

Copy link
Copy Markdown
Member

Objective. Unblock Google Calendar events.list (and events.get, events.instances), refused because one field deep in the response (Event.workingLocationProperties.homeOffice) declares no type. This is the design call flagged in #159.

Decision. A response field below the top level that declares no type becomes { kind: 'any' } with its description. It is kept, not dropped: the API returns it, and dropping it would hide data the person can see in the raw result. It cannot loosen wiring, because isAssignable(any → typed) is already false, so an any field can only feed an any input. The line is drawn where the block would otherwise know nothing:

  • still refused: a response untyped as a whole, a result list whose items are untyped, and any untyped input (Flyspace must know what it sends);
  • provider admission used to refuse any anywhere in an output. It now refuses the same two cases (untypedResult in admission.ts), so the install dialog and provider proposals agree. Maxun's "no declared fields" robot is still refused by its own rule.

What changed. jsonSchema.ts: ConvertOptions { untypedBelowTop: 'any' }, threaded through refs, allOf, properties, map values and items (items of a result list stay as strict as the list). openapi.ts: response schemas convert with that option; parameters and request bodies do not. admission.ts: containsAny → untypedResult. DESIGN.md: the exception, stated next to the "fail instead of becoming any" rule.

What did not change. Inputs, request bodies, MCP schemas (mcp.ts calls fromJsonSchema without the option), wire admission, and existing digests (a manifest that compiled before has no untyped field).

Tests run

  • npm run typecheck 0 errors; npm run lint 0 errors (8 existing warnings).
  • npm test: 1632 passed, 1 failed (fieldHarness.test.ts, known Windows-only CRLF failure). Existing tests on any (maxunProvider, asyncExecution top-level any) pass unchanged.
  • New untypedOutputFields.test.ts (6): a nested untyped field → any and the operation compiles; an untyped whole response and a list of untyped items are refused; an untyped input is refused; the default converter still refuses; any is not assignable to string; a provider proposal with a nested any is admitted.
  • npm run build + npm run scan:bundle PASS; npm run build:next + npm run test:e2e 9 passed.

Measurements. Real Google Calendar v3 spec (APIs.guru): 7 → 10 operations (events.list, events.get, events.instances added). All remaining refusals are writes or write-capable scopes.

Known failures. fieldHarness.test.ts on Windows only.

Claim ceiling. Implemented and tested with fixtures. No Calendar call made (no OAuth client registered).

Architectural decisions introduced. any is admitted inside a typed response, never as the response or its items, and never on an input.

Evidence that could falsify it. A wire admitted from an any field into a typed input. A compiled input or request body containing any.

Next permissible package. One npm run catalog:build after this and #160 are on main.

🤖 Generated with Claude Code

A response field below the top level that declares no type used to refuse
the whole operation (Google Calendar's events.list, for one untyped field
deep in an Event). It is now typed `any`: the API does return it, and an
`any` source is never assignable to a typed input, so it cannot carry an
unknown value into a typed wire.

Still refused: a response untyped as a whole, a result list of untyped
items, and any untyped input. Provider admission applies the same line
(untypedResult), so the install dialog and provider proposals agree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sykosyber
sykosyber enabled auto-merge October 13, 2026 03:06
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T03:10:03.814641Z cba452a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sykosyber
sykosyber merged commit 93de6fe into main Oct 13, 2026
4 checks passed
@sykosyber
sykosyber deleted the wp/omni/untyped-output-fields branch October 13, 2026 03:09
sykosyber added a commit that referenced this pull request Oct 13, 2026
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.

1 participant