Repository navigation
test(cli): add AiTool registry conformance suite - #516
Merged
Merged
Conversation
Closes the original goal this backlog was built around: "adding an AI tool
is adding one file" is now guaranteed by a test that fails when it isn't,
instead of by human discipline.
Every assertion iterates getAllRegisteredTools() rather than a hardcoded
list, so a new tool file is automatically subject to all of them. Guards:
AiTool<C> shape and required methods; registry <-> AI_TOOL_IDS agreement
both ways; every tool reachable by at least one framework build
target/mode; every plugins-capable tool present in MARKETPLACE_PROBES; and
no probe/build entry naming an unregistered tool (stale-entry guard).
Scope note (user-confirmed before planning, not a silent reinterpretation):
US-E9-02/03 asked to *derive* the probe tables and adapter dispatch from
the tool contract. The spike found PluginFormat ("a native on-disk layout
aidd can read") and AiToolId ("a tool aidd installs into") are distinct
concepts that merely coincide in membership today — deriving one from the
other would couple them permanently and force a parser function reference
into an otherwise pure-data contract, for a guarantee this test delivers
with zero production change. Same shape as the #514 review outcome.
Assertions were chosen against the live registry, not invented: opencode
is deliberately absent from PLUGIN_MANIFEST_PROBES (flat plugin mode, no
per-plugin manifest dirs), so per-tool manifest-probe coverage is NOT
asserted. All five guards were verified to fail on a deliberate mutation
(removed tool id, removed build entry, removed marketplace probe, typo'd
probe format, malformed directory field) with messages naming the tool,
the field, and the file to fix.
2088/2088 tests pass (2059 + 29 new), tsc clean, zero production files
changed.
blafourcade
added a commit
that referenced
this pull request
Jul 31, 2026
Closes the original goal this backlog was built around: "adding an AI tool
is adding one file" is now guaranteed by a test that fails when it isn't,
instead of by human discipline.
Every assertion iterates getAllRegisteredTools() rather than a hardcoded
list, so a new tool file is automatically subject to all of them. Guards:
AiTool<C> shape and required methods; registry <-> AI_TOOL_IDS agreement
both ways; every tool reachable by at least one framework build
target/mode; every plugins-capable tool present in MARKETPLACE_PROBES; and
no probe/build entry naming an unregistered tool (stale-entry guard).
Scope note (user-confirmed before planning, not a silent reinterpretation):
US-E9-02/03 asked to *derive* the probe tables and adapter dispatch from
the tool contract. The spike found PluginFormat ("a native on-disk layout
aidd can read") and AiToolId ("a tool aidd installs into") are distinct
concepts that merely coincide in membership today — deriving one from the
other would couple them permanently and force a parser function reference
into an otherwise pure-data contract, for a guarantee this test delivers
with zero production change. Same shape as the #514 review outcome.
Assertions were chosen against the live registry, not invented: opencode
is deliberately absent from PLUGIN_MANIFEST_PROBES (flat plugin mode, no
per-plugin manifest dirs), so per-tool manifest-probe coverage is NOT
asserted. All five guards were verified to fail on a deliberate mutation
(removed tool id, removed build entry, removed marketplace probe, typo'd
probe format, malformed directory field) with messages naming the tool,
the field, and the file to fix.
2088/2088 tests pass (2059 + 29 new), tsc clean, zero production files
changed.
🎯 What & why
Closes the goal this whole cartography backlog was built around: "adding an AI tool is adding one file" is now guaranteed by a test that fails when it isn't, rather than by human discipline. Today, forgetting to add a new tool to
AI_TOOL_IDS, to the build target list, or to the marketplace probe table produces no error — just silently wrong behavior at runtime.🛠️ How it works
Every assertion iterates
getAllRegisteredTools()rather than a hardcoded list, so a new tool file is automatically subject to all of them. Guards:AiTool<C>shape and the three required content methodsAI_TOOL_IDSagreement, both directionsframework buildtarget/modeMARKETPLACE_PROBESAssertions were chosen against the live registry, not invented. Probing found opencode is deliberately absent from
PLUGIN_MANIFEST_PROBES(flat plugin mode — no per-plugin manifest directories), so per-tool manifest-probe coverage is explicitly not asserted. A naive "every tool must be in both probe tables" test would have been wrong.All five guards were verified to actually fail on a deliberate mutation — removed tool id, removed build entry, removed marketplace probe, typo'd probe format, malformed
directoryfield — each with a message naming the tool, the field, and the file to fix. A conformance test that can't fail is worthless, so this was checked rather than assumed.🧪 How to verify
pnpm --filter cli test— 2088/2088 (2059 + 29 new), tsc clean, zero production files changed.To see it bite: delete any entry from
AI_TOOL_IDS,FRAMEWORK_BUILD_TARGET_MODES, orMARKETPLACE_PROBESand re-run.Deliberate scope reduction of US-E9-02/03, user-confirmed before planning — not a silent reinterpretation. Those tickets asked to derive the probe tables and adapter dispatch from the tool contract. The spike found
PluginFormat("a native on-disk layout aidd can read") andAiToolId("a tool aidd installs into") are distinct concepts that merely coincide in membership today. Deriving one from the other would couple them permanently, force a parser function reference into an otherwise pure-data contract, and touch all 5 tool files plusPluginsCapability— for a guarantee this test delivers with zero production change. Same outcome shape as the #514 review.Also recorded in
spike-findings.mdfor separate triage, deliberately not fixed here:MARKETPLACE_PROBES's copilot entry points at a manifest filename (.github/plugin/plugin.json) — possibly intentional, possibly a copy-paste bugPLUGIN_MANIFEST_PATHSinplugin-content-translator.tsis a third hand-maintained manifest-path list that has already diverged (omits copilot's two paths)--helpstrings inframework.ts/ai.tshardcode the five tool names in prose