feat(plugins): add source-control extension contracts (#2117)

This commit is contained in:
José Almeida
2026-08-13 08:29:29 +01:00
committed by GitHub
parent 064b852884
commit f218880ecb
530 changed files with 39054 additions and 7518 deletions
@@ -174,6 +174,43 @@ for the full contract.
assert.deepEqual(findings, []);
});
test("validatePluginApiClaims keeps unrelated absence prose sentence-scoped", async () => {
const dir = await createFixture({
"types.ts": FIXTURE_TYPES_TS,
"AGENTS.md": `# Frontend
The Host can be unavailable during construction, so resolve it when handling
work. Honor context cancellation and use host.storage for user settings.
`,
});
const { findings } = await validatePluginApiClaims({
repoRoot: dir,
typesPath: path.join(dir, "types.ts"),
scanFiles: [path.join(dir, "AGENTS.md")],
});
assert.deepEqual(findings, []);
});
test("validatePluginApiClaims ignores ordinary words that share an API name", async () => {
const dir = await createFixture({
"types.ts": FIXTURE_TYPES_TS,
"AGENTS.md": `# Reviews
Expand the review before deciding whether its thread context is unavailable.
`,
});
const { findings } = await validatePluginApiClaims({
repoRoot: dir,
typesPath: path.join(dir, "types.ts"),
scanFiles: [path.join(dir, "AGENTS.md")],
});
assert.deepEqual(findings, []);
});
test("validatePluginApiClaims exits clean against the real kandev tree", async () => {
const repoRoot = path.resolve(import.meta.dirname, "..");
const { findings } = await validatePluginApiClaims({ repoRoot });