Repository navigation
Replies: 1 comment
|
Thanks @9710willy for the precise report and root-cause analysis. I prepared a minimal, cherry-pick-ready fix against upstream Patch
What changed
The patch changes 4 files only: the generator, its regression test, and the two generated catalogs. It does not change signatures or catalog shape; it restores the documented Verification
The patch is offered under the repository's MIT license. If the maintainers prefer to reimplement or squash it internally, please reference this Discussion/commit when practical so the report and contribution remain traceable. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
The catalog generator emits a broken regex into the generated API catalogs. The regex must match type names on word boundaries. Instead, it matches backspace control characters. Because of this,
referencedTypeClosurenever matches a type, andqueryServiceApi/queryEventApialways return an emptyreferencedTypeslist.Location
packages/typert/generator/src/cordis-catalog.ts:829packages/extensions/tool-cordis/src/api-catalog.ts:4671packages/extensions/cordis-client-runner/src/client/api-catalog.ts:891Details
The emitter writes the line from a single-quoted string:
In a single-quoted string,
\\bproduces the two characters\b. The generated file then contains:In a template literal,
\bis the backspace character (U+0008), not the two characters backslash + b. The regex source becomes<BS>TypeName<BS>. Signature text never contains backspace characters, so the regex never matches.Repro in Node:
Effect
The
cordis_inspecttool documents that its detail view includes the referenced type closure. Because the regex never matches, the tool always returnsreferencedTypes: []. The model gets the signatures but never the type declarations.Evidence of intent
The hand-written analog in the same package is correct.
packages/extensions/tool-cordis/src/inspect.ts:223uses a real template literal with\\b, which yields a word-boundary regex. Only the string-emitted copy lost one level of escaping. No test asserts the contents ofreferencedTypes, which is why this slipped through.Suggested fix
Add one more level of escaping in the emitter string (
\\\\b), then regenerate both catalog files. A test that asserts a non-emptyreferencedTypesfor a known service would prevent a regression.All reactions