Skip to content

INF-01: appendix A–F generators + 2 CI lints (YAO-62)#16

Closed
luyao618 wants to merge 3 commits into
mainfrom
agent/cc-dev/3a71280a
Closed

INF-01: appendix A–F generators + 2 CI lints (YAO-62)#16
luyao618 wants to merge 3 commits into
mainfrom
agent/cc-dev/3a71280a

Conversation

@luyao618

Copy link
Copy Markdown
Owner

Summary

Ships the V2-REVISION-SPEC §7 infrastructure that hard-blocks every chapter PR (YAO-62 / INF-01).

  • 6 manifest generators (scripts/gen-{tool,commands,hooks,agents,tasktypes,module-matrix}-table.ts) producing docs/appendix/{A..F}.{md,manifest.json} from CLI source @ 290fdc9.
  • 2 CI lints: check-source-commits (§0.3) and lint-no-fuzzy-quantifiers (§0.4).
  • gen-module-matrix --check-orphans (§7.6) for reverse coverage with allowlist.
  • CI workflow at .github/workflows/docs-ci.yml runs the three gates plus git diff --exit-code docs/appendix for manifest drift.

Manifest diff summary (initial)

Appendix Items Notes
A · Tools 43 family / runtime-leaf / feature-gated split derived from tools.ts
B · Commands 101 86 dirs + 15 top-level files
C · Hooks 31 27 HOOK_EVENTS + 4 hook command kinds (command/prompt/http/agent)
D · Built-in agents 6 source-defined; gating per builtInAgents.ts (feature flags / entrypoint / coordinator)
E · TaskType 7 4 default + 2 feature-gated + 1 in-process special
F · Module matrix 35 34 chapters + 1 CROSSCUT, 0 orphans (allowlist: cli/, plugins/, types/)

Test plan

  • pnpm gen:appendix regenerates all six manifests; counts match spec §C10/§C20/§C16/§C32.
  • pnpm check:source-commits — 7 declarations align on 290fdc9.
  • pnpm check:fuzzy-quantifiers — clean on current docs; rejects seeded fixture (大概/主要 hits).
  • pnpm check:orphans — 0 orphans.
  • Drift fixture (source_commit: deadbeefcafe1234) → check:source-commits exits 1 with informative diff.
  • Maintainer wires the CLI_SOURCE_PATH secret so gen:appendix + check:orphans run in CI on internal PRs.

Source-code grounding

  • Tools: tools/ (43 dirs), tools.ts (registration + feature/env gates)
  • Commands: commands/ (86 dirs + 15 files), commands.ts (import graph)
  • Hooks: entrypoints/sdk/coreTypes.ts:25-52 (HOOK_EVENTS), schemas/hooks.ts:33,68,98,129,183 (4 command kinds)
  • Agents: tools/AgentTool/built-in/{generalPurpose,statuslineSetup,explore,plan,claudeCodeGuide,verification}Agent.ts, gated via tools/AgentTool/builtInAgents.ts:23-71
  • Tasks: Task.ts:6-13 (TaskType union), tasks.ts:9-15,22-31 (default vs feature-gated registration)

Deferred / out of scope

  • §0 frontmatter is not retro-applied to v1 chapters in this PR; that lands per chapter as part of the C01-C05-C16-C18-C32 骨架 wave.
  • 法律/合规 spec §9.4 only applies to C24/C25 chapter PRs, not infra.

🤖 Generated with Claude Code

Yao Lu and others added 3 commits May 21, 2026 23:51
YAO-62: ship the §7 spec infrastructure that unblocks every chapter PR
in the v2 revision. Eight scripts in `scripts/` (six manifest generators
+ two CI lints), wired through `package.json` and a `.github` workflow.

Manifests committed for source_commit 290fdc9:
  A   43 tools     (43 top-level tools/* entries; family/runtime-leaf/feature-gated split derived from tools.ts)
  B  101 commands  (86 dirs + 15 files = 101 top-level entries; runtime-cmd cross-ref via commands.ts imports)
  C   31 items     (27 HOOK_EVENTS @ entrypoints/sdk/coreTypes.ts + 4 hook command kinds @ schemas/hooks.ts)
  D    6 agents    (built-in agents under tools/AgentTool/built-in/, gated by feature flags / entrypoint / coordinator)
  E    7 wire types (parsed from Task.ts TaskType union; 4 default + 2 feature-gated + 1 in-process special)
  F   34 chapters + 1 CROSSCUT, 0 orphans (allowlist: cli/, plugins/, types/)

CI gates (.github/workflows/docs-ci.yml):
  check-source-commits  §0.3  fail when chapter / manifest commits diverge
  lint-no-fuzzy-quantifiers §0.4  fail on 约/大概/左右/大量/不少/主要/大部分/几乎/很多/一些 in fact paragraphs
  gen-module-matrix --check-orphans §7.6  fail on unclaimed top-level CLI dirs

Verified locally: all 6 generators run clean, all 3 lints pass on the
current docs tree, and both lints reject seeded fixtures (fuzzy hit +
commit drift). See scripts/README.md for design rationale and CI flow.

Co-authored-by: multica-agent <github@multica.ai>
…tection, source_files line anchors)

- .github/workflows/docs-ci.yml: hoist CLI_SOURCE to job-level env so step
  `if: env.CLI_SOURCE != ''` actually evaluates. Step-level env is not
  available when `if:` is evaluated, which would silently skip
  gen:appendix + check:orphans even with the secret configured.

- scripts/gen-tool-table.ts: parse getAllBaseTools() body and the
  declaration list together. Inline gates (process.env, isXxxEnabled(),
  feature(...), getter functions, conditional spreads) are now detected
  in addition to require-time gates. ConfigTool / TungstenTool /
  TaskCreate/Get/Update/List / LSPTool / EnterWorktreeTool /
  ExitWorktreeTool / PowerShellTool are now correctly classified
  feature-gated, not runtime-leaf, and their flags are surfaced.

- scripts/gen-commands-table.ts, scripts/gen-tasktypes-table.ts: emit
  source_files entries in spec §7.3 'path:line-line' contract instead of
  bare paths. gen-tasktypes resolves the on-disk task class file when it
  exists and falls back to the Task.ts union literal anchor otherwise
  (instead of fabricating a guessed path).

Re-running the full pipeline:
- appendix-A: +0 -0 (43 items, 1 family / 19 runtime-leaf / 23 feature-gated)
- appendix-B/C/D/E/F: +0 -0
- check-source-commits OK (7 declarations align with 290fdc9)
- lint-no-fuzzy-quantifiers OK
- gen-module-matrix --check-orphans OK (0 orphans)

Co-authored-by: multica-agent <github@multica.ai>
…spread)

- gen-commands-table.ts: accept .ts/.tsx/.js/.jsx/.mjs/.cjs in source_files
  scan so runtime commands shipped as .js (ant-trace, autofix-pr,
  backfill-sessions, break-cache, bughunter) populate per spec §7.3.
- gen-tool-table.ts: parse getter-call symbols inside conditional spreads
  (e.g. ...(getPowerShellTool() ? [getPowerShellTool()] : []) at
  tools.ts:242), and broaden lazyRe to handle multi-statement getter
  bodies, restoring fn:isPowerShellToolEnabled / fn:getPowerShellTool
  evidence on PowerShellTool's feature_flags.

Co-authored-by: multica-agent <github@multica.ai>
@luyao618 luyao618 closed this May 21, 2026
@luyao618 luyao618 deleted the agent/cc-dev/3a71280a branch June 3, 2026 08:06
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.

1 participant