fix(#1041): route all source agents through the canonical multi-runtime gsd-tools resolver (#1045)

* fix(#1041): route all source agents through the canonical multi-runtime gsd-tools resolver

Source agents/*.md (gsd-planner, gsd-executor, gsd-verifier, gsd-plan-checker,
gsd-intel-updater, gsd-debugger, …) called bare "gsd-tools …" in shell blocks.
On a shim-only install — where gsd-tools.cjs exists under the runtime home but
gsd-tools is NOT on PATH — those calls fail with "command not found" and the
agent silently skips init/state/validate/commit ceremony, deferring to the
orchestrator or bypassing GSD bookkeeping entirely.

were never migrated, so it persisted on Claude Code and every other runtime that
consumes the source agents directly. Only gsd-phase-researcher.md carried a
resolver — and a stale, claude-only truncated one.

Fix (all runtimes):
- Inject the canonical multi-runtime gsd_run preamble (byte-equal to
  _runtime-launcher.snippet.sh — claude/codex/cursor/gemini/copilot/windsurf/
  augment/trae/qwen/cline/opencode/kilo/hermes/antigravity homes) at the top of
  the first gsd_run block of all 12 gsd-tools-calling agents, and rewrite every
  command-position bare gsd-tools to gsd_run.
- Upgrade gsd-phase-researcher.md's stale resolver to the canonical one.
- Extend scripts/sync-runtime-launcher.cjs to maintain agents/ in parity (the
  sync caught and corrected a mis-placed preamble during development).
- Extend the bare-gsd-tools (#2851) and launcher-parity (#373) regression guards
  to agents/ so no runtime can silently regress.

Closes #1041

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* chore(#1041): backfill changeset PR number to 1045

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-06-11 11:42:59 -04:00
committed by GitHub
parent e4dfa6b9ea
commit 1fab2e10ba
20 changed files with 426 additions and 256 deletions

View File

@@ -13,7 +13,7 @@
* color — verbatim frontmatter `color:` value
* tools — verbatim frontmatter `tools:` value (single string, comma-separated)
* requiredIncludes — @~/.claude/gsd-core/references/<file>.md strings the body MUST contain
* requiredSeamCalls — `gsd-tools query <cmd>` strings the body MUST contain
* requiredSeamCalls — `gsd_run query <cmd>` strings the body MUST contain
* outputContract — strings the body MUST contain (output path, return marker, etc.)
*/
@@ -31,9 +31,9 @@ const PROFILES = [
'@~/.claude/gsd-core/references/research-verification-protocol.md',
],
requiredSeamCalls: [
'gsd-tools query research-plan',
'gsd-tools query research-store put',
'gsd-tools query classify-confidence',
'gsd_run query research-plan',
'gsd_run query research-store put',
'gsd_run query classify-confidence',
],
outputContract: [
'.planning/research/',
@@ -53,10 +53,10 @@ const PROFILES = [
'@~/.claude/gsd-core/references/research-verification-protocol.md',
],
requiredSeamCalls: [
'gsd-tools query research-plan',
'gsd-tools query research-store put',
'gsd-tools query classify-confidence',
'gsd-tools query package-legitimacy check',
'gsd_run query research-plan',
'gsd_run query research-store put',
'gsd_run query classify-confidence',
'gsd_run query package-legitimacy check',
],
outputContract: [
'.planning/phases/XX-name/{phase_num}-RESEARCH.md',
@@ -122,7 +122,7 @@ const PROFILES = [
'@~/.claude/gsd-core/references/research-documentation-lookup.md',
],
requiredSeamCalls: [
'gsd-tools query commit',
'gsd_run query commit',
],
outputContract: [
'UI-SPEC.md',
@@ -137,7 +137,7 @@ const PROFILES = [
tools: 'Read, Write, Bash',
requiredIncludes: [],
requiredSeamCalls: [
'gsd-tools query commit',
'gsd_run query commit',
],
outputContract: [
'.planning/research/SUMMARY.md',

View File

@@ -2,8 +2,8 @@
/**
* sync-runtime-launcher.cjs
*
* Idempotent transform: for every gsd-core/workflows/*.md (and subdirs),
* rewrite all bash/sh/shell fenced blocks to:
* Idempotent transform: for every gsd-core/workflows/*.md (and subdirs)
* AND every agents/*.md, rewrite all bash/sh/shell fenced blocks to:
* 1. Strip ALL old resolver forms from every bash block (GSD_TOOLS=,
* GSD_SDK=, the if/elif/else/fi resolver, _GSD_SHIM_NAME=, and any
* previously-inserted gsd_run preamble).
@@ -20,6 +20,7 @@ const fs = require('node:fs');
const path = require('node:path');
const WORKFLOWS_DIR = path.join(__dirname, '..', 'gsd-core', 'workflows');
const AGENTS_DIR = path.join(__dirname, '..', 'agents');
const SNIPPET_FILE = path.join(WORKFLOWS_DIR, '_runtime-launcher.snippet.sh');
// Read canonical preamble (full content of snippet file)
@@ -376,18 +377,33 @@ function escapeRegExp(str) {
// Main
function main() {
const preamble = loadPreamble();
const files = collectFiles(WORKFLOWS_DIR);
let transformedCount = 0;
let unchangedCount = 0;
for (const f of files) {
// Process workflow files
const workflowFiles = collectFiles(WORKFLOWS_DIR);
for (const f of workflowFiles) {
const content = fs.readFileSync(f, 'utf8');
const result = transformFile(content, preamble);
if (result !== null) {
fs.writeFileSync(f, result, 'utf8');
transformedCount++;
console.log(`transformed: ${path.relative(WORKFLOWS_DIR, f)}`);
console.log(`transformed (workflow): ${path.relative(WORKFLOWS_DIR, f)}`);
} else {
unchangedCount++;
}
}
// Process agent files
const agentFiles = collectFiles(AGENTS_DIR);
for (const f of agentFiles) {
const content = fs.readFileSync(f, 'utf8');
const result = transformFile(content, preamble);
if (result !== null) {
fs.writeFileSync(f, result, 'utf8');
transformedCount++;
console.log(`transformed (agent): ${path.relative(AGENTS_DIR, f)}`);
} else {
unchangedCount++;
}