test(build): structural CI invariant for primitive-catalog wireability (#788) - #789
Merged
Merged
Conversation
#788) Real pattern found while shipping #774's Stripe primitive: my own first draft nearly shipped with the identical gap it was meant to fix elsewhere (no apiBase/sdk, silently excluded from codegenCompositionBlock's wireable list). Grep of this repo's own history shows this exact bug class -- a primitive selected by trigger-matching but never actually callable, or callable but invisible to the #518 compliance safety net -- has been found and fixed one primitive at a time at least 7 times before today (#518, #530, #624, #626, #632, #636, #640). There was no test that would catch a NEW primitive shipping with this gap. Adds two structural checks against the real, live catalog: 1. every non-foundational primitive with real triggers must have apiBase or sdk (else it's named to Cody but never gets a real call instruction) 2. every primitive with a real apiBase must have a RUNTIME_PROXY_PATH_ SUBSTRINGS compliance entry (else an unwired selection goes completely undetected) Both checks pass today via a small, explicit, individually-commented exemption list -- the REAL, live-confirmed current gaps (Context Graph, Data Marketplace, Multimodal for #1; ZeroERP, ZeroBooks, QNN API, Ocean, SpaceTime OS, Intent-Casting Marketplace, Search & Discovery for #2), each linked to #788 as a tracked TODO rather than silently ignored. A manual test (temporarily adding a fake unwired primitive, confirmed to fail with a clear message, then reverted) verified the check genuinely fires on a new violation rather than being a tautology. Also guards the exemption lists themselves: a name that no longer exists in CATALOG, or a primitive fixed for one gap but not the other, both fail.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #788.
Real pattern found while shipping #774's Stripe primitive: my own first draft nearly shipped with the identical gap it was meant to fix elsewhere (no
apiBase/sdk, silently excluded fromcodegenCompositionBlock'swireablelist). This exact bug class — a primitive selected by trigger-matching but never actually callable, or callable but invisible to the #518 compliance safety net — has been found and fixed one primitive at a time at least 7 times before today (#518, #530, #624, #626, #632, #636, #640). There was no test that would catch primitive #N+1 shipping with this gap.Adds two structural checks against the real, live catalog:
apiBaseorsdk— else it's named to Cody but never gets a real call instruction.apiBasemust have aRUNTIME_PROXY_PATH_SUBSTRINGScompliance entry — else an unwired selection goes completely undetected.Both checks pass today via a small, explicit, individually-commented exemption list — the real, live-confirmed current gaps, each linked to #788 as a tracked TODO. A dedicated test also guards the exemption lists themselves (no stale/renamed names, no partial fixes).
Test plan
npx tsc --noEmit— cleannpx vitest run— full suite: 397 files, 5619 tests passed, 0 failuresPRIMITIVE_CATALOG, confirmed the test failed with a clear, actionable message, then reverted (zero diff) before committing