The audit-open case in gsd-tools.cjs called bare output() on both the --json and text paths. output is never in scope at the call site — the entire core module is imported as `const core`, so every other command uses core.output(). Two-part fix: - Replace output(...) with core.output(...) on both branches - Pass result (the raw object) on the --json path, not JSON.stringify(result) — core.output always calls JSON.stringify internally, so pre-serialising caused double-encoding and agents received a string instead of an object Adds three CLI-level regression tests to milestone-audit.test.cjs that invoke audit-open through runGsdTools (the same path the agent uses), so a recurrence at the dispatch layer is caught even if lib-level tests continue to pass. Closes #2236 Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -781,9 +781,9 @@ async function runCommand(command, args, cwd, raw, defaultValue) {
|
||||
const includeRaw = args.includes('--json');
|
||||
const result = auditOpenArtifacts(cwd);
|
||||
if (includeRaw) {
|
||||
output(JSON.stringify(result, null, 2), raw);
|
||||
core.output(result, raw);
|
||||
} else {
|
||||
output(formatAuditReport(result), raw);
|
||||
core.output(formatAuditReport(result), raw);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user