Skip to content

test(build): structural CI invariant for primitive-catalog wireability (#788) - #789

Merged
urbantech merged 1 commit into
mainfrom
test/primitive-wireability-invariant-788
Sep 16, 2026
Merged

urbantech merged 1 commit into
mainfrom
test/primitive-wireability-invariant-788

Conversation

@urbantech

Copy link
Copy Markdown
Contributor

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 from codegenCompositionBlock's wireable list). 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:

  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, 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 — clean
  • npx vitest run — full suite: 397 files, 5619 tests passed, 0 failures
  • Manually verified the check actually fires: temporarily added a fake unwired primitive to PRIMITIVE_CATALOG, confirmed the test failed with a clear, actionable message, then reverted (zero diff) before committing

#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.
@urbantech
urbantech merged commit edd3742 into main Sep 16, 2026
1 check passed
@urbantech
urbantech deleted the test/primitive-wireability-invariant-788 branch September 16, 2026 08:17
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.

[SYSTEMIC] Primitive catalog coverage gaps recur one-at-a-time — needs a structural CI invariant, not the 8th piecemeal patch

1 participant