Skip to content

Record the types each signature uses - #303

Merged
tnkuehne merged 3 commits into
feat/method-describefrom
feat/exact-type-references
Nov 22, 2026
Merged

tnkuehne merged 3 commits into
feat/method-describefrom
feat/exact-type-references

Conversation

@tnkuehne

@tnkuehne tnkuehne commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Why

#297 finds the types a described method needs by searching its signature texts for documented type names. Generated names take several forms (Item, One.Item, Page<Item>, import("./model").Item), and review already found two matching gaps. The extractor resolves every type it documents, so it can state the references exactly instead.

What changes

  • Extractor: every signature and every type definition gets uses, the names of the documented types it uses directly. Undocumented types in between (unions, arrays, library generics such as Promise or Map) pass their uses through.
  • Contract: documentation format 2 with uses (defaults to an empty list). Documentation of format 1 counts as missing in the runtime and the control plane until the app is deployed again.
  • Selection: selectServiceMethods follows uses from the selected signatures through the type definitions. The text matching is removed.

Verification

  • pnpm check
  • pnpm exec vitest run (all suites)
  • RUN_CLI_TESTS=1 CLI, network CLI, app-services CLI and documentation extraction tests with a freshly built CLI; the extraction tests for generic and namespaced types assert the selected types
  • RUN_WASM_TESTS=1 pnpm exec vitest run packages/service-docs with the rebuilt WebAssembly module
  • RUN_SERVICE_TESTS=1 runtime service tests (workerd and celld), RUN_CLOUDFLARE_TESTS=1 Cloudflare suite, playwright test tests/e2e/auth.spec.ts
  • bash tools/cargo.sh test and clippy --all-targets -D warnings for platform-service-docs, platform-service-docs-wasm and platform-cli; fmt --all --check

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with both earlier findings fixed and no new issues found.

Summary

Records exact type references in documentation format 2 and follows those references when selecting methods.

  • API documentation records the types used by each signature and definition.
  • Selected API methods include types linked from their signatures.
  • Older API documentation is treated as missing until the app is redeployed.

Reviews (3) · Last reviewed commit: "Expect recorded type uses in the app bui..." · Reviewed by Greptile

Describing methods found their types by searching signature texts for type
names, which needed rules for generic, namespaced and qualified names. The
extractor already resolves every type it documents, so it now records on each
signature and each type definition the documented types it uses directly, and
describing methods follows those references. The documentation format becomes
version 2; documentation of the earlier format counts as missing until the app
is deployed again.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
widefleet-docs e24ceb2 Nov 22 2026, 04:15 PM

Comment thread packages/app-runtime/src/catalog.ts Resolved
A type's call signature can name types only in its own type parameters, such as
`<T extends Item = Item>`. Their constraints and defaults are now part of the
types it uses. The search index format moves to 3, so indexes built from
documentation of the earlier format are rebuilt instead of advertising methods
that describe can no longer read.
@tnkuehne
tnkuehne merged commit ff82910 into main Nov 22, 2026
17 checks passed
@tnkuehne
tnkuehne deleted the feat/exact-type-references branch November 22, 2026 16:57
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