refactor(#1173): defer agents-kind descriptor declarations (option a)

Adopt maintainer-recommended option (a): keep the convertedAgentsKind /
stageAgentsForRuntimeWithConverter scope-threading plumbing, but DEFER the
8 runtimes' capability.json `agents`-kind declarations to a follow-up that
first ships the ADR-1235 §0 byte-for-byte parity harness.

The declarations were a live regression: the second `layout.kinds` consumer,
applySurface / `/gsd:surface` / `--materialize` (src/surface.cts), does not
mirror the legacy agent pipeline (copilot `.agent.md` rename, path-prefix
rewrite + attribution, stale cleanup), so a `/gsd:surface` toggle deleted
installed copilot `gsd-*.agent.md` and path-unrewrote the other 7 runtimes.
trek-e + davesienkowski both flagged this.

- Revert the agents-kind entries from the 8 capability.json files and
  regenerate capability-registry.cjs (now matches next; 0 converted agents
  kinds declared).
- Revert the declaration-driven kind-count test bumps
  (runtime-artifact-layout, descriptor-drive, bug-782, enh-789, enh-790).
- Keep the synthetic-descriptor seam tests for convertedAgentsKind dispatch;
  add a synthetic scope-threading test so the kept isGlobal plumbing stays
  covered without depending on real declarations.
- Update the convertedAgentsKind doc comment to state declarations are
  deferred pending the ADR-1235 §0 parity harness.
- Move ADR-1235 to Accepted.
- Reword the changeset to plumbing-only (docs-exempt now honest: no runtime
  declares the kind, legacy loop authoritative, installed output unchanged).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Behruz Nassre Esfahani
2026-06-21 11:29:50 -07:00
parent 9e1ab856ae
commit 2b6107d46f
18 changed files with 78 additions and 537 deletions

View File

@@ -175,15 +175,19 @@ function agentsKind(destSubpath: string, prefix: string, configDir: string): Art
* Agent filenames are preserved verbatim (the prefix is already embedded in the
* agent stem — e.g. `gsd-planner.md`).
*
* #1173 SCOPE: this wires the per-runtime agent CONVERTER (frontmatter/body +
* isGlobal scope) into the descriptor path. The remaining byte-for-byte parity
* behaviors of the legacy `bin/install.js` agent loop — Copilot's `.agent.md`
* filename rename, the cross-cutting path-prefix rewrite + attribution, and the
* config-reading steps (claude effort, opencode model override) — are NOT applied
* here yet; they are tracked by the ADR-1235 cutover (later steps) and remain
* provided by the legacy loop, which runs after `installRuntimeArtifacts` and is
* authoritative for the real install. So this kind is correct for converter
* coverage but not yet a full standalone replacement for these runtimes.
* #1173 SCOPE — plumbing only (declarations deferred): this provides the
* converter dispatch + `isGlobal` scope threading for the descriptor's `agents`
* kind, but NO runtime currently declares a converted `agents` kind in its
* `capability.json`. The descriptor declarations for the 8 non-Claude runtimes
* (copilot/antigravity/cursor/windsurf/augment/trae/codebuddy/cline) are
* DEFERRED to a follow-up that first ships the ADR-1235 §0 byte-for-byte parity
* harness, because the second `layout.kinds` consumer — `applySurface` /
* `/gsd:surface` / `--materialize` (`src/surface.cts`) — does not yet mirror the
* legacy agent pipeline (Copilot's `.agent.md` filename rename, the cross-cutting
* path-prefix rewrite + attribution, stale-file cleanup, config-reading steps),
* so declaring the kind now would regress the surface path. Until then the legacy
* `bin/install.js` agent loop remains authoritative for the real install, and
* this `convertedAgentsKind` is exercised only by synthetic-descriptor seam tests.
*
* Mirrors the `convertedCommandsKind` pattern (#785).
*