From ad49af2580c778bb6b04371467e7731275dbcef9 Mon Sep 17 00:00:00 2001 From: agentiknet Date: Tue, 1 Dec 2026 04:39:35 +0100 Subject: [PATCH 1/3] chore(skills): remove the legacy undocumented-tools list and its CI guard --- .changeset/remove-legacy-tool-docs-list.md | 5 + .github/workflows/ci.yml | 7 -- AGENTS.md | 5 +- .../runtime/src/__tests__/tool-docs.test.ts | 23 ++--- packages/runtime/src/tool-docs/index.ts | 3 +- packages/runtime/src/tool-docs/legacy.ts | 11 --- .../scripts/gen-skills.mjs | 5 +- .../scripts/render/index-skill.mjs | 16 +-- .../agentproto/reference/authoring-skills.md | 2 +- .../test/gen-skills.test.mjs | 4 +- .../test/render.test.mjs | 11 +-- scripts/check-tool-docs-legacy.mjs | 98 ------------------- scripts/check-tool-docs-legacy.test.mjs | 97 ------------------ 13 files changed, 24 insertions(+), 263 deletions(-) create mode 100644 .changeset/remove-legacy-tool-docs-list.md delete mode 100644 packages/runtime/src/tool-docs/legacy.ts delete mode 100644 scripts/check-tool-docs-legacy.mjs delete mode 100644 scripts/check-tool-docs-legacy.test.mjs diff --git a/.changeset/remove-legacy-tool-docs-list.md b/.changeset/remove-legacy-tool-docs-list.md new file mode 100644 index 000000000..5060cd481 --- /dev/null +++ b/.changeset/remove-legacy-tool-docs-list.md @@ -0,0 +1,5 @@ +--- +"@agentproto/runtime": patch +--- + +Remove `LEGACY_UNDOCUMENTED_TOOLS` from `@agentproto/runtime/tool-docs`: every daemon tool now has a family doc, and a test requires it. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3b01a07d..ce3f808f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -796,13 +796,6 @@ jobs: - name: Run provenance-footer check tests run: node --test scripts/check-provenance-footer.test.mjs - # LEGACY_UNDOCUMENTED_TOOLS may only shrink: fail when a name is added - # relative to main. Skips while the file does not exist. - - name: Check the legacy undocumented-tools list only shrinks - run: | - node --test scripts/check-tool-docs-legacy.test.mjs - node scripts/check-tool-docs-legacy.mjs --base origin/main - - name: Check scratch docs, AI-attribution trailers, and provenance footer # Pass PR_TITLE via env, not inline `${{ … }}` interpolation — see the # changeset-check step above for why (shell injection via backticks). diff --git a/AGENTS.md b/AGENTS.md index 75354a556..7961dcd7f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -264,9 +264,8 @@ gate when you genuinely want CI to write it. **Tool family docs (`packages/runtime/src/tool-docs/`).** Two review rules: touching a tool's code (its schema, description or behavior) means re-reading its family doc and fixing it if it went stale (the tests catch a schema drift, -not a behavior change); and never add a name to `LEGACY_UNDOCUMENTED_TOOLS`: -the list only shrinks, a new tool ships with its family doc -(`scripts/check-tool-docs-legacy.mjs` refuses an added line). +not a behavior change); and a new tool ships with its family doc: the +partition test in `tool-docs.test.ts` fails for a tool no family documents. **Don't stamp `[agentflow-reviewed]`** in a commit message, and don't run `review:ai --stamp` locally, unless a human explicitly told you to. That diff --git a/packages/runtime/src/__tests__/tool-docs.test.ts b/packages/runtime/src/__tests__/tool-docs.test.ts index 3ed934bf7..c93891125 100644 --- a/packages/runtime/src/__tests__/tool-docs.test.ts +++ b/packages/runtime/src/__tests__/tool-docs.test.ts @@ -12,7 +12,7 @@ import { fileURLToPath } from "node:url" import { afterAll, beforeAll, describe, expect, it } from "vitest" import { DAEMON_TOOL_NAMES } from "../daemon-tool-names.generated.js" import { bootToolSurface, type ToolSurfaceHandle } from "../tool-surface.js" -import { isDeprecatedDescription, LEGACY_UNDOCUMENTED_TOOLS, missingKeys, TOOL_FAMILY_DOCS } from "../tool-docs/index.js" +import { isDeprecatedDescription, missingKeys, TOOL_FAMILY_DOCS } from "../tool-docs/index.js" import type { ToolFamilyDoc } from "../tool-docs/types.js" const here = dirname(fileURLToPath(import.meta.url)) @@ -52,30 +52,19 @@ function deprecatedFields(args: unknown, schema: unknown, path = ""): string[] { describe("tool docs: partition", () => { const documented = TOOL_FAMILY_DOCS.flatMap(d => Object.keys(d.tools)) - const legacy = [...LEGACY_UNDOCUMENTED_TOOLS] const known = new Set(DAEMON_TOOL_NAMES) - it("lists no unknown tool name", () => { - expect([...documented, ...legacy].filter(n => !known.has(n))).toEqual([]) + it("documents no unknown tool name", () => { + expect(documented.filter(n => !known.has(n))).toEqual([]) }) - it("never documents a tool twice or lists it twice", () => { + it("never documents a tool twice", () => { expect(documented.filter((n, i) => documented.indexOf(n) !== i)).toEqual([]) - expect(legacy.filter((n, i) => legacy.indexOf(n) !== i)).toEqual([]) }) - it("puts every daemon tool in exactly one place (doc xor legacy)", () => { + it("documents every daemon tool", () => { const inDoc = new Set(documented) - const inLegacy = new Set(legacy) - expect(DAEMON_TOOL_NAMES.filter(n => inDoc.has(n) && inLegacy.has(n)), "in both").toEqual([]) - expect(DAEMON_TOOL_NAMES.filter(n => !inDoc.has(n) && !inLegacy.has(n)), "in neither").toEqual([]) - }) - - it("keeps the legacy list sorted, one entry per line (the CI guard parses it that way)", () => { - expect(legacy).toEqual([...legacy].sort()) - const text = readFileSync(resolve(here, "../tool-docs/legacy.ts"), "utf8") - const lines = text.split("\n").filter(l => /^\s+"[a-z0-9_]+",$/.test(l)) - expect(lines.length).toBe(legacy.length) + expect(DAEMON_TOOL_NAMES.filter(n => !inDoc.has(n)), "without a family doc").toEqual([]) }) it("declares distinct, non-empty family ids", () => { diff --git a/packages/runtime/src/tool-docs/index.ts b/packages/runtime/src/tool-docs/index.ts index b21642579..a349deec2 100644 --- a/packages/runtime/src/tool-docs/index.ts +++ b/packages/runtime/src/tool-docs/index.ts @@ -1,6 +1,6 @@ /** * Tool family docs. Pure data, exported as `@agentproto/runtime/tool-docs`. - * A tool is documented here, or listed in `LEGACY_UNDOCUMENTED_TOOLS`, never both. + * Every daemon tool is documented in exactly one family. */ import { authProfileToolDoc } from "./auth-profile.js" import { catalogToolDoc } from "./catalog.js" @@ -62,7 +62,6 @@ import { workspaceBrainToolDoc } from "./workspace-brain.js" import type { ToolFamilyDoc } from "./types.js" import { worktreeToolDoc } from "./worktree.js" -export { LEGACY_UNDOCUMENTED_TOOLS } from "./legacy.js" export { isDeprecatedDescription, missingKeys } from "./check-helpers.js" export { defineToolFamilyDoc } from "./types.js" export type { diff --git a/packages/runtime/src/tool-docs/legacy.ts b/packages/runtime/src/tool-docs/legacy.ts deleted file mode 100644 index be13711af..000000000 --- a/packages/runtime/src/tool-docs/legacy.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Daemon tools that have no family doc yet. This list may only shrink: never - * add a name (CI refuses it, see scripts/check-tool-docs-legacy.mjs). To - * document a tool, add it to a family doc and delete its line here. - * - * Format read by the CI guard: one quoted name per line, sorted. - */ -import type { DaemonToolName } from "../daemon-tool-names.generated.js" - -export const LEGACY_UNDOCUMENTED_TOOLS: readonly DaemonToolName[] = [ -] diff --git a/packages/skill-pack-agentproto/scripts/gen-skills.mjs b/packages/skill-pack-agentproto/scripts/gen-skills.mjs index e158d7ab8..3428cb75c 100644 --- a/packages/skill-pack-agentproto/scripts/gen-skills.mjs +++ b/packages/skill-pack-agentproto/scripts/gen-skills.mjs @@ -78,7 +78,7 @@ async function listMarkdown(dir) { * Pure staging: returns `{ files: Map, manifest }`-like data * written by `generate`. Kept separate from disk reads where possible. */ -export async function generate({ packageDir, surface, families, legacy, log = () => {} }) { +export async function generate({ packageDir, surface, families, log = () => {} }) { const srcSkills = join(packageDir, "src", "skills") const genDir = join(packageDir, "dist", "gen") const outSkills = join(genDir, "skills") @@ -122,7 +122,7 @@ export async function generate({ packageDir, surface, families, legacy, log = () // 2. The index skill and its reference pages. const indexDir = join(outSkills, INDEX) await mkdir(join(indexDir, "reference"), { recursive: true }) - await writeFile(join(indexDir, "SKILL.md"), renderIndexSkill({ families, surface, legacy, claims })) + await writeFile(join(indexDir, "SKILL.md"), renderIndexSkill({ families, claims })) for (const doc of families) { await writeFile(join(indexDir, "reference", `${doc.family}.md`), renderReferencePage(doc, surface)) } @@ -178,7 +178,6 @@ async function main() { packageDir, surface, families: docs.TOOL_FAMILY_DOCS, - legacy: docs.LEGACY_UNDOCUMENTED_TOOLS, log: (m) => process.stdout.write(`${m}\n`), }) } diff --git a/packages/skill-pack-agentproto/scripts/render/index-skill.mjs b/packages/skill-pack-agentproto/scripts/render/index-skill.mjs index 586e7786c..5a7e1efa7 100644 --- a/packages/skill-pack-agentproto/scripts/render/index-skill.mjs +++ b/packages/skill-pack-agentproto/scripts/render/index-skill.mjs @@ -1,19 +1,17 @@ -import { finish, firstSentence } from "./text.mjs" +import { finish } from "./text.mjs" /** * The `ap-tool-index` SKILL.md. * @param {object} input * @param {Array} input.families family docs * @param {{tools: Array}} input.surface - * @param {readonly string[]} input.legacy tool names without a doc * @param {Record} [input.claims] family -> dedicated skill name */ -export function renderIndexSkill({ families, surface, legacy, claims = {} }) { - const byName = new Map(surface.tools.map((t) => [t.name, t])) +export function renderIndexSkill({ families, claims = {} }) { const lines = [ "---", "name: ap-tool-index", - "description: Find the right agentproto daemon tool before guessing a name. Index of every documented tool family (desktop chats, sessions, reviews, apps, tunnels, accounts and more) with a reference page per family, plus the tools not yet documented. Open it for any agentproto need not covered by another skill.", + "description: Find the right agentproto daemon tool before guessing a name. Index of every documented tool family (desktop chats, sessions, reviews, apps, tunnels, accounts and more) with a reference page per family. Open it for any agentproto need not covered by another skill.", "---", "", "# Tool index", @@ -26,13 +24,5 @@ export function renderIndexSkill({ families, surface, legacy, claims = {} }) { const tail = skill ? ` Dedicated skill: \`${skill}\`.` : "" lines.push(`- **${f.family}**: ${f.summary} [reference](reference/${f.family}.md).${tail}`) } - lines.push("", "## Not yet documented", "") - const names = [...legacy].sort() - if (names.length === 0) lines.push("None.") - for (const n of names) { - const t = byName.get(n) - if (!t) throw new Error(`legacy tool "${n}" is absent from the tool surface`) - lines.push(`- \`${n}\`: ${firstSentence(t.description)}`) - } return finish(lines) } diff --git a/packages/skill-pack-agentproto/src/skills/agentproto/reference/authoring-skills.md b/packages/skill-pack-agentproto/src/skills/agentproto/reference/authoring-skills.md index 347871af7..5da9c6a89 100644 --- a/packages/skill-pack-agentproto/src/skills/agentproto/reference/authoring-skills.md +++ b/packages/skill-pack-agentproto/src/skills/agentproto/reference/authoring-skills.md @@ -108,7 +108,7 @@ The staging step (`scripts/gen-skills.mjs`) replaces that line with the family block and writes `dist/gen/`. It also: - writes the `ap-tool-index` skill with one `reference/.md` page per - family and a "Not yet documented" list for tools without a doc; + family; - fills the tool count and the skills table of the master card from the markers `` and ``; - writes the derived `dist/gen/manifest.json`, which diff --git a/packages/skill-pack-agentproto/test/gen-skills.test.mjs b/packages/skill-pack-agentproto/test/gen-skills.test.mjs index 77012c354..dbdec34ce 100644 --- a/packages/skill-pack-agentproto/test/gen-skills.test.mjs +++ b/packages/skill-pack-agentproto/test/gen-skills.test.mjs @@ -19,7 +19,7 @@ function skill(name, body, description = `The ${name} skill. Second sentence.`) } const read = (...p) => readFileSync(join(dir, "dist", "gen", ...p), "utf8") const run = () => - generate({ packageDir: dir, surface, families: [widgetDoc, gadgetDoc], legacy: ["orphan_tool"] }) + generate({ packageDir: dir, surface, families: [widgetDoc, gadgetDoc] }) beforeEach(() => { writeFileSync(join(dir, "manifest.json"), JSON.stringify({ name: "p", description: "d", skills: ["zeta"] })) @@ -37,7 +37,7 @@ describe("gen-skills", () => { expect(zeta).not.toContain("