* fix(#2376): emit absolute subagent-facing init/state paths Make init.* and state.* path fields absolute rather than cwd-relative so subagent prompts resolve correctly regardless of working directory. Adds intel_dir/conflicts_path/requirements_path/roadmap_path/state_path to cmdInitIngestDocs, an absolute debug_dir to cmdStateLoad, and replaces bare .planning/... literals in 12 workflow Agent() prompt blocks with the absolute init-JSON path fields. Includes decoy-cwd regression tests and realpath'd tmpdir fixtures for macOS. Squashed rebase of the #2376 commit series onto a fresh origin/next (previous merge ee25543a1 was against a now-stale next). * chore(#2376): add changeset * chore(#2376): regenerate golden fixtures + workflow size baseline Regenerated after rebasing the absolute-path fix onto current next (picks up #2351's run-with-timeout content in execute-phase.md too). * fix(#2376): trim execute-phase.md redundancy to stay under the size margin * chore(#2376): regenerate golden/size baseline after rebase onto next
This commit is contained in:
@@ -12,7 +12,7 @@ const { test, describe, beforeEach, afterEach } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { runGsdTools, createTempProject, cleanup } = require('./helpers.cjs');
|
||||
const { runGsdTools, createTempProject, cleanup, absPlanningPath } = require('./helpers.cjs');
|
||||
|
||||
const COMMANDS_DIR = path.join(__dirname, '..', 'commands', 'gsd');
|
||||
const WORKFLOWS_DIR = path.join(__dirname, '..', 'gsd-core', 'workflows');
|
||||
@@ -163,7 +163,12 @@ describe('quick task: research file in task directory', () => {
|
||||
let tmpDir;
|
||||
|
||||
beforeEach(() => {
|
||||
tmpDir = createTempProject();
|
||||
// #2376 macOS fix: realpath the fixture root so absolute path-field
|
||||
// assertions (absPlanningPath comparisons below) match the code's
|
||||
// process.cwd()-anchored output — macOS's tmpdir is a symlink
|
||||
// (/var/... -> /private/var/...) that a spawned child resolves via
|
||||
// realpath but createTempProject() does not. No-op on Linux (no symlink).
|
||||
tmpDir = fs.realpathSync(createTempProject());
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -176,8 +181,11 @@ describe('quick task: research file in task directory', () => {
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
assert.ok(output.task_dir, 'task_dir should be non-null');
|
||||
// #2376: task_dir is now absolute (anchored on tmpDir), not the historical
|
||||
// relative literal.
|
||||
const quickDirAbs = absPlanningPath(tmpDir, 'quick');
|
||||
assert.ok(
|
||||
output.task_dir.startsWith('.planning/quick/'),
|
||||
output.task_dir.startsWith(`${quickDirAbs}/`),
|
||||
'task_dir should be under .planning/quick/'
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user