@opengsd/gsd-pi 1.8.1-dev.897b3c90 → 1.9.0-dev.5c1a3ff2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -8
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/GSD-WORKFLOW.md +2 -2
- package/dist/resources/extensions/gsd/artifact-verification.js +3 -4
- package/dist/resources/extensions/gsd/auto-artifact-paths.js +14 -8
- package/dist/resources/extensions/gsd/auto-prompts.js +90 -17
- package/dist/resources/extensions/gsd/auto-recovery.js +10 -5
- package/dist/resources/extensions/gsd/auto-worktree-cleanup.js +4 -0
- package/dist/resources/extensions/gsd/auto-worktree-teardown.js +1 -1
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +2 -0
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +31 -5
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +10 -3
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +4 -24
- package/dist/resources/extensions/gsd/constants.js +12 -13
- package/dist/resources/extensions/gsd/context-masker.js +97 -21
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +22 -0
- package/dist/resources/extensions/gsd/doctor-engine-checks.js +3 -6
- package/dist/resources/extensions/gsd/git-service.js +19 -7
- package/dist/resources/extensions/gsd/guided-flow.js +9 -3
- package/dist/resources/extensions/gsd/markdown-renderer.js +2 -12
- package/dist/resources/extensions/gsd/md-importer.js +5 -6
- package/dist/resources/extensions/gsd/model-cost-table.js +2 -0
- package/dist/resources/extensions/gsd/model-router.js +11 -0
- package/dist/resources/extensions/gsd/paths.js +51 -10
- package/dist/resources/extensions/gsd/planning-subagent-policy.js +37 -0
- package/dist/resources/extensions/gsd/planning-subagent-registry.js +25 -0
- package/dist/resources/extensions/gsd/preferences-types.js +5 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +48 -1
- package/dist/resources/extensions/gsd/preferences.js +17 -0
- package/dist/resources/extensions/gsd/provider-payload-policy.js +16 -5
- package/dist/resources/extensions/gsd/safety/destructive-guard.js +1 -1
- package/dist/resources/extensions/gsd/skill-activation.js +17 -3
- package/dist/resources/extensions/gsd/templates/PREFERENCES.md +5 -0
- package/dist/resources/extensions/gsd/tools/complete-task.js +12 -5
- package/dist/resources/extensions/gsd/tools/reopen-milestone.js +14 -5
- package/dist/resources/extensions/gsd/tools/reopen-slice.js +15 -5
- package/dist/resources/extensions/gsd/tools/reopen-task.js +16 -10
- package/dist/resources/extensions/gsd/unit-context-composer.js +28 -5
- package/dist/resources/extensions/gsd/workflow-projections.js +2 -3
- package/dist/resources/extensions/gsd/workspace.js +2 -1
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +5 -5
- package/dist/web/standalone/.next/build-manifest.json +2 -2
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +5 -5
- package/dist/web/standalone/.next/server/chunks/8357.js +1 -1
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/node_modules/@gsd/native/package.json +1 -1
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +1 -1
- package/integrations/hermes/open_gsd_hermes/gsd_client.py +1 -1
- package/integrations/hermes/pyproject.toml +1 -1
- package/package.json +6 -6
- package/packages/cloud-mcp-gateway/package.json +2 -2
- package/packages/contracts/package.json +1 -1
- package/packages/daemon/package.json +4 -4
- package/packages/gsd-agent-core/dist/compaction/compaction.d.ts.map +1 -1
- package/packages/gsd-agent-core/dist/compaction/compaction.js +36 -4
- package/packages/gsd-agent-core/dist/compaction/compaction.js.map +1 -1
- package/packages/gsd-agent-core/dist/sdk.d.ts.map +1 -1
- package/packages/gsd-agent-core/dist/sdk.js +1 -0
- package/packages/gsd-agent-core/dist/sdk.js.map +1 -1
- package/packages/gsd-agent-core/package.json +5 -5
- package/packages/gsd-agent-modes/package.json +7 -7
- package/packages/gsd-cloud/package.json +1 -1
- package/packages/mcp-server/README.md +7 -2
- package/packages/mcp-server/dist/server.d.ts.map +1 -1
- package/packages/mcp-server/dist/server.js +5 -5
- package/packages/mcp-server/dist/server.js.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts +4 -3
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +4 -4
- package/packages/native/package.json +1 -1
- package/packages/pi-agent-core/dist/agent.d.ts +5 -1
- package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent.js +2 -0
- package/packages/pi-agent-core/dist/agent.js.map +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-ai/dist/models.generated.d.ts +59 -0
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +53 -0
- package/packages/pi-ai/dist/models.generated.js.map +1 -1
- package/packages/pi-ai/dist/providers/anthropic.js +6 -1
- package/packages/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.js +1 -1
- package/packages/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-responses.js +1 -1
- package/packages/pi-ai/dist/providers/openai-responses.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/capability-patches.js +1 -1
- package/packages/pi-coding-agent/dist/core/capability-patches.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js +1 -1
- package/packages/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +11 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +8 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/package.json +7 -7
- package/packages/pi-tui/package.json +2 -2
- package/packages/rpc-client/package.json +2 -2
- package/pkg/package.json +1 -1
- package/src/resources/GSD-WORKFLOW.md +2 -2
- package/src/resources/extensions/gsd/artifact-verification.ts +3 -8
- package/src/resources/extensions/gsd/auto-artifact-paths.ts +14 -7
- package/src/resources/extensions/gsd/auto-prompts.ts +104 -15
- package/src/resources/extensions/gsd/auto-recovery.ts +10 -8
- package/src/resources/extensions/gsd/auto-worktree-cleanup.ts +4 -0
- package/src/resources/extensions/gsd/auto-worktree-teardown.ts +1 -1
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +1 -0
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +39 -10
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +11 -3
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +7 -29
- package/src/resources/extensions/gsd/constants.ts +14 -13
- package/src/resources/extensions/gsd/context-masker.ts +98 -2
- package/src/resources/extensions/gsd/docs/preferences-reference.md +22 -0
- package/src/resources/extensions/gsd/doctor-engine-checks.ts +3 -5
- package/src/resources/extensions/gsd/git-service.ts +19 -6
- package/src/resources/extensions/gsd/guided-flow.ts +9 -2
- package/src/resources/extensions/gsd/markdown-renderer.ts +2 -14
- package/src/resources/extensions/gsd/md-importer.ts +5 -5
- package/src/resources/extensions/gsd/model-cost-table.ts +2 -0
- package/src/resources/extensions/gsd/model-router.ts +12 -0
- package/src/resources/extensions/gsd/paths.ts +58 -10
- package/src/resources/extensions/gsd/planning-subagent-policy.ts +58 -0
- package/src/resources/extensions/gsd/planning-subagent-registry.ts +31 -0
- package/src/resources/extensions/gsd/preferences-types.ts +16 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +62 -0
- package/src/resources/extensions/gsd/preferences.ts +25 -0
- package/src/resources/extensions/gsd/provider-payload-policy.ts +18 -4
- package/src/resources/extensions/gsd/safety/destructive-guard.ts +1 -1
- package/src/resources/extensions/gsd/skill-activation.ts +17 -3
- package/src/resources/extensions/gsd/templates/PREFERENCES.md +5 -0
- package/src/resources/extensions/gsd/tests/auto-artifact-paths.test.ts +7 -7
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/before-provider-context-management.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/complete-task.test.ts +76 -1
- package/src/resources/extensions/gsd/tests/context-masker.test.ts +204 -8
- package/src/resources/extensions/gsd/tests/db-tools-alias-suppression.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/destructive-confirmation.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/destructive-guard.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/integration/paths.test.ts +22 -4
- package/src/resources/extensions/gsd/tests/integration-branch-meta-location.test.ts +62 -0
- package/src/resources/extensions/gsd/tests/markdown-renderer.test.ts +5 -5
- package/src/resources/extensions/gsd/tests/model-cost-table.test.ts +9 -1
- package/src/resources/extensions/gsd/tests/model-router.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/parallel-skill-prompt-integration.test.ts +7 -5
- package/src/resources/extensions/gsd/tests/preferences.test.ts +84 -0
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +4 -0
- package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/reactive-executor.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/service-tier.test.ts +4 -0
- package/src/resources/extensions/gsd/tests/single-writer-v3-tool-surface.test.ts +33 -7
- package/src/resources/extensions/gsd/tests/skill-activation.test.ts +20 -16
- package/src/resources/extensions/gsd/tests/system-context-message-routing.test.ts +13 -7
- package/src/resources/extensions/gsd/tests/tool-naming.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/workflow-projections.test.ts +4 -4
- package/src/resources/extensions/gsd/tests/write-gate-planning-unit.test.ts +34 -0
- package/src/resources/extensions/gsd/tools/complete-task.ts +20 -5
- package/src/resources/extensions/gsd/tools/reopen-milestone.ts +24 -5
- package/src/resources/extensions/gsd/tools/reopen-slice.ts +25 -5
- package/src/resources/extensions/gsd/tools/reopen-task.ts +23 -9
- package/src/resources/extensions/gsd/unit-context-composer.ts +34 -8
- package/src/resources/extensions/gsd/workflow-projections.ts +2 -3
- package/src/resources/extensions/gsd/workspace.ts +2 -1
- /package/dist/web/standalone/.next/static/{TezjdjSHBVRRr54XjAvte → 6YWV7VAPg-jqjfPswrKZb}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{TezjdjSHBVRRr54XjAvte → 6YWV7VAPg-jqjfPswrKZb}/_ssgManifest.js +0 -0
|
@@ -36,7 +36,15 @@ import {
|
|
|
36
36
|
} from "../gsd-db.js";
|
|
37
37
|
import { getWorkflowDatabasePath, ensureWorkflowDbAtPath } from "../db-workspace.js";
|
|
38
38
|
import { getGatesForTurn } from "../gate-registry.js";
|
|
39
|
-
import {
|
|
39
|
+
import {
|
|
40
|
+
buildFlatTaskFileName,
|
|
41
|
+
buildTaskFileName,
|
|
42
|
+
gsdProjectionRoot,
|
|
43
|
+
clearPathCache,
|
|
44
|
+
legacyMilestonesDir,
|
|
45
|
+
resolveMilestonePath,
|
|
46
|
+
resolveSlicePath,
|
|
47
|
+
} from "../paths.js";
|
|
40
48
|
import { resolveCanonicalMilestoneRoot } from "../worktree-manager.js";
|
|
41
49
|
import { checkOwnership, taskUnitKey } from "../unit-ownership.js";
|
|
42
50
|
import { saveFile, clearParseCache } from "../files.js";
|
|
@@ -89,13 +97,20 @@ function taskSummaryPath(
|
|
|
89
97
|
// a legacy layout and breaks all subsequent path resolution for the session.
|
|
90
98
|
const slicePath = resolveSlicePath(basePath, milestoneId, sliceId);
|
|
91
99
|
const phaseDir = resolveMilestonePath(basePath, milestoneId);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
100
|
+
const legacyBase = legacyMilestonesDir(basePath);
|
|
101
|
+
const isLegacy = phaseDir
|
|
102
|
+
? phaseDir.startsWith(legacyBase + "/") || phaseDir.startsWith(legacyBase + "\\")
|
|
103
|
+
: false;
|
|
104
|
+
if (isLegacy && phaseDir) {
|
|
105
|
+
// Legacy layout: the slice has its own slices/SID/ subdir → tasks/ subdir.
|
|
106
|
+
const legacySlicePath = slicePath && slicePath !== phaseDir
|
|
107
|
+
? slicePath
|
|
108
|
+
: join(phaseDir, "slices", sliceId);
|
|
109
|
+
return join(legacySlicePath, "tasks", buildTaskFileName(taskId, "SUMMARY"));
|
|
95
110
|
}
|
|
96
111
|
if (phaseDir) {
|
|
97
112
|
// Flat-phase: task summaries go in the phase dir (no tasks/ subdir)
|
|
98
|
-
return join(phaseDir,
|
|
113
|
+
return join(phaseDir, buildFlatTaskFileName(sliceId, taskId, "SUMMARY"));
|
|
99
114
|
}
|
|
100
115
|
// Fallback: legacy hardcoded path (milestone/slice dir not on disk yet)
|
|
101
116
|
return join(
|
|
@@ -22,7 +22,15 @@ import { logWarning } from "../workflow-logger.js";
|
|
|
22
22
|
import { debugLog } from "../debug-logger.js";
|
|
23
23
|
import { existsSync, unlinkSync } from "node:fs";
|
|
24
24
|
import { join } from "node:path";
|
|
25
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
buildFlatTaskFileName,
|
|
27
|
+
buildTaskFileName,
|
|
28
|
+
legacyMilestonesDir,
|
|
29
|
+
resolveMilestonePath,
|
|
30
|
+
resolveSlicePath,
|
|
31
|
+
resolveTasksDir,
|
|
32
|
+
clearPathCache,
|
|
33
|
+
} from "../paths.js";
|
|
26
34
|
|
|
27
35
|
export interface ReopenMilestoneParams {
|
|
28
36
|
milestoneId: string;
|
|
@@ -69,6 +77,10 @@ export async function handleReopenMilestone(
|
|
|
69
77
|
// auto-corrects entities back to "complete", making reopen a no-op (#3161).
|
|
70
78
|
try {
|
|
71
79
|
const milestoneDir = resolveMilestonePath(basePath, params.milestoneId);
|
|
80
|
+
const legacyBase = legacyMilestonesDir(basePath);
|
|
81
|
+
const isLegacy = !!milestoneDir && (
|
|
82
|
+
milestoneDir.startsWith(legacyBase + "/") || milestoneDir.startsWith(legacyBase + "\\")
|
|
83
|
+
);
|
|
72
84
|
if (milestoneDir) {
|
|
73
85
|
const milestoneSummary = join(milestoneDir, `${params.milestoneId}-SUMMARY.md`);
|
|
74
86
|
if (existsSync(milestoneSummary)) unlinkSync(milestoneSummary);
|
|
@@ -85,10 +97,17 @@ export async function handleReopenMilestone(
|
|
|
85
97
|
}
|
|
86
98
|
|
|
87
99
|
const tasksDir = resolveTasksDir(basePath, params.milestoneId, slice.id);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
100
|
+
const tasks = getSliceTasks(params.milestoneId, slice.id);
|
|
101
|
+
for (const task of tasks) {
|
|
102
|
+
const taskSummaries = isLegacy
|
|
103
|
+
? (tasksDir ? [join(tasksDir, buildTaskFileName(task.id, "SUMMARY"))] : [])
|
|
104
|
+
: milestoneDir
|
|
105
|
+
? [
|
|
106
|
+
join(milestoneDir, buildFlatTaskFileName(slice.id, task.id, "SUMMARY")),
|
|
107
|
+
join(milestoneDir, buildTaskFileName(task.id, "SUMMARY")),
|
|
108
|
+
]
|
|
109
|
+
: [];
|
|
110
|
+
for (const taskSummary of taskSummaries) {
|
|
92
111
|
if (existsSync(taskSummary)) unlinkSync(taskSummary);
|
|
93
112
|
}
|
|
94
113
|
}
|
|
@@ -27,7 +27,15 @@ import { appendEvent } from "../workflow-events.js";
|
|
|
27
27
|
import { logWarning } from "../workflow-logger.js";
|
|
28
28
|
import { existsSync, unlinkSync } from "node:fs";
|
|
29
29
|
import { join } from "node:path";
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
buildFlatTaskFileName,
|
|
32
|
+
buildTaskFileName,
|
|
33
|
+
legacyMilestonesDir,
|
|
34
|
+
resolveMilestonePath,
|
|
35
|
+
resolveTasksDir,
|
|
36
|
+
resolveSlicePath,
|
|
37
|
+
clearPathCache,
|
|
38
|
+
} from "../paths.js";
|
|
31
39
|
|
|
32
40
|
export interface ReopenSliceParams {
|
|
33
41
|
milestoneId: string;
|
|
@@ -80,11 +88,23 @@ export async function handleReopenSlice(
|
|
|
80
88
|
// Without this, the DB-filesystem reconciler sees SUMMARY.md files and
|
|
81
89
|
// auto-corrects tasks back to "complete", making reopen a no-op (#3161).
|
|
82
90
|
try {
|
|
91
|
+
const milestoneDir = resolveMilestonePath(basePath, params.milestoneId);
|
|
92
|
+
const legacyBase = legacyMilestonesDir(basePath);
|
|
93
|
+
const isLegacy = !!milestoneDir && (
|
|
94
|
+
milestoneDir.startsWith(legacyBase + "/") || milestoneDir.startsWith(legacyBase + "\\")
|
|
95
|
+
);
|
|
83
96
|
const tasksDir = resolveTasksDir(basePath, params.milestoneId, params.sliceId);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
97
|
+
const tasks = getSliceTasks(params.milestoneId, params.sliceId);
|
|
98
|
+
for (const task of tasks) {
|
|
99
|
+
const summaryPaths = isLegacy
|
|
100
|
+
? (tasksDir ? [join(tasksDir, buildTaskFileName(task.id, "SUMMARY"))] : [])
|
|
101
|
+
: milestoneDir
|
|
102
|
+
? [
|
|
103
|
+
join(milestoneDir, buildFlatTaskFileName(params.sliceId, task.id, "SUMMARY")),
|
|
104
|
+
join(milestoneDir, buildTaskFileName(task.id, "SUMMARY")),
|
|
105
|
+
]
|
|
106
|
+
: [];
|
|
107
|
+
for (const summaryPath of summaryPaths) {
|
|
88
108
|
if (existsSync(summaryPath)) unlinkSync(summaryPath);
|
|
89
109
|
}
|
|
90
110
|
}
|
|
@@ -25,8 +25,16 @@ import { appendEvent } from "../workflow-events.js";
|
|
|
25
25
|
import { logWarning } from "../workflow-logger.js";
|
|
26
26
|
import { writeReopenReason } from "../reopen-reason.js";
|
|
27
27
|
import { existsSync, unlinkSync } from "node:fs";
|
|
28
|
-
import { join
|
|
29
|
-
import {
|
|
28
|
+
import { join } from "node:path";
|
|
29
|
+
import {
|
|
30
|
+
buildFlatTaskFileName,
|
|
31
|
+
buildTaskFileName,
|
|
32
|
+
legacyMilestonesDir,
|
|
33
|
+
resolveMilestonePath,
|
|
34
|
+
resolveTasksDir,
|
|
35
|
+
resolveSlicePath,
|
|
36
|
+
clearPathCache,
|
|
37
|
+
} from "../paths.js";
|
|
30
38
|
|
|
31
39
|
export interface ReopenTaskParams {
|
|
32
40
|
milestoneId: string;
|
|
@@ -113,13 +121,19 @@ export async function handleReopenTask(
|
|
|
113
121
|
// summary cleanup into tasks/ (#1208).
|
|
114
122
|
try {
|
|
115
123
|
const slicePath = resolveSlicePath(basePath, params.milestoneId, params.sliceId);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
const milestonePath = resolveMilestonePath(basePath, params.milestoneId);
|
|
125
|
+
if (milestonePath) {
|
|
126
|
+
const legacyBase = legacyMilestonesDir(basePath);
|
|
127
|
+
const isLegacy = milestonePath.startsWith(legacyBase + "/") || milestonePath.startsWith(legacyBase + "\\");
|
|
128
|
+
const summaryPaths = isLegacy
|
|
129
|
+
? [join(resolveTasksDir(basePath, params.milestoneId, params.sliceId) ?? slicePath ?? join(milestonePath, "slices", params.sliceId, "tasks"), buildTaskFileName(params.taskId, "SUMMARY"))]
|
|
130
|
+
: [
|
|
131
|
+
join(milestonePath, buildFlatTaskFileName(params.sliceId, params.taskId, "SUMMARY")),
|
|
132
|
+
join(milestonePath, buildTaskFileName(params.taskId, "SUMMARY")),
|
|
133
|
+
];
|
|
134
|
+
for (const summaryPath of summaryPaths) {
|
|
135
|
+
if (existsSync(summaryPath)) unlinkSync(summaryPath);
|
|
136
|
+
}
|
|
123
137
|
}
|
|
124
138
|
} catch (cleanupErr) {
|
|
125
139
|
logWarning("tool", `reopen-task artifact cleanup warning: ${(cleanupErr as Error).message}`);
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
type ToolsPolicy,
|
|
47
47
|
type UnitContextManifest,
|
|
48
48
|
} from "./unit-context-manifest.js";
|
|
49
|
+
import { resolveEffectivePlanningToolsPolicy } from "./planning-subagent-policy.js";
|
|
49
50
|
import { getUnitToolSurfaceContract } from "./unit-tool-contracts.js";
|
|
50
51
|
import type { UnitPromptContextContract } from "./tool-contract.js";
|
|
51
52
|
|
|
@@ -207,6 +208,7 @@ export function composeContextModeInstructions(
|
|
|
207
208
|
|
|
208
209
|
export interface ComposeToolSurfaceInstructionOptions {
|
|
209
210
|
readonly renderMode: ContextModeRenderMode;
|
|
211
|
+
readonly basePath?: string;
|
|
210
212
|
}
|
|
211
213
|
|
|
212
214
|
const TOOL_SURFACE_GUIDANCE_BY_UNIT: Record<string, string> = {
|
|
@@ -226,16 +228,39 @@ const TOOL_SURFACE_GUIDANCE_BY_UNIT: Record<string, string> = {
|
|
|
226
228
|
"Persist completion only through `gsd_complete_milestone` after verification passes. Do not query `.gsd/gsd.db` directly. Do not write `.gsd/PROJECT.md` or `.gsd/REQUIREMENTS.md` by hand — use `gsd_summary_save` and `gsd_requirement_update`.",
|
|
227
229
|
"replan-slice":
|
|
228
230
|
"Persist replans through `gsd_replan_slice` only. Do not edit `PLAN.md` or task plans directly.",
|
|
229
|
-
"plan-slice":
|
|
230
|
-
"Persist planning through `gsd_plan_slice` only. Dispatch subagents only to **scout** or **planner** for reconnaissance — not implementation agents. Do not edit user source files outside `.gsd/**`.",
|
|
231
|
-
"refine-slice":
|
|
232
|
-
"Persist refinements through `gsd_plan_slice` only. Dispatch subagents only to **scout** or **planner**. Do not edit user source files outside `.gsd/**`.",
|
|
233
|
-
"plan-milestone":
|
|
234
|
-
"Persist milestone planning through `gsd_plan_milestone` / `gsd_plan_slice`. Do not edit user source files outside `.gsd/**`.",
|
|
235
231
|
"research-slice":
|
|
236
232
|
"Dispatch subagents only to **scout** or **planner** for reconnaissance. Do not edit user source files outside `.gsd/**`.",
|
|
237
233
|
};
|
|
238
234
|
|
|
235
|
+
function formatAllowedAgents(agents: readonly string[]): string {
|
|
236
|
+
return agents.map((agent) => `**${agent}**`).join(", ");
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function guidanceForUnitToolsPolicy(unitType: string, policy: ToolsPolicy): string | undefined {
|
|
240
|
+
if (unitType === "plan-slice") {
|
|
241
|
+
const dispatch = policy.mode === "planning-dispatch"
|
|
242
|
+
? ` Dispatch subagents only to ${formatAllowedAgents(policy.allowedSubagents)} for reconnaissance — not implementation agents.`
|
|
243
|
+
: " Do not dispatch subagents.";
|
|
244
|
+
return `Persist planning through \`gsd_plan_slice\` only.${dispatch} Do not edit user source files outside \`.gsd/**\`.`;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (unitType === "refine-slice") {
|
|
248
|
+
const dispatch = policy.mode === "planning-dispatch"
|
|
249
|
+
? ` Dispatch subagents only to ${formatAllowedAgents(policy.allowedSubagents)}.`
|
|
250
|
+
: " Do not dispatch subagents.";
|
|
251
|
+
return `Persist refinements through \`gsd_plan_slice\` only.${dispatch} Do not edit user source files outside \`.gsd/**\`.`;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (unitType === "plan-milestone") {
|
|
255
|
+
const dispatch = policy.mode === "planning-dispatch"
|
|
256
|
+
? ` Dispatch subagents only to ${formatAllowedAgents(policy.allowedSubagents)}.`
|
|
257
|
+
: "";
|
|
258
|
+
return `Persist milestone planning through \`gsd_plan_milestone\` / \`gsd_plan_slice\`.${dispatch} Do not edit user source files outside \`.gsd/**\`.`;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return undefined;
|
|
262
|
+
}
|
|
263
|
+
|
|
239
264
|
function guidanceForToolsPolicy(policy: ToolsPolicy): string | null {
|
|
240
265
|
switch (policy.mode) {
|
|
241
266
|
case "planning":
|
|
@@ -280,8 +305,9 @@ export function composeToolSurfaceInstructions(
|
|
|
280
305
|
const manifest = resolveManifest(unitType);
|
|
281
306
|
if (!manifest) return "";
|
|
282
307
|
|
|
283
|
-
const
|
|
284
|
-
const
|
|
308
|
+
const effectiveTools = resolveEffectivePlanningToolsPolicy(unitType, manifest.tools, opts.basePath) ?? manifest.tools;
|
|
309
|
+
const unitGuidance = guidanceForUnitToolsPolicy(unitType, effectiveTools) ?? TOOL_SURFACE_GUIDANCE_BY_UNIT[unitType];
|
|
310
|
+
const policyGuidance = unitGuidance ? null : guidanceForToolsPolicy(effectiveTools);
|
|
285
311
|
const forbiddenLine = formatForbiddenWorkflowToolsLine(unitType, unitGuidance);
|
|
286
312
|
const parts = [unitGuidance, policyGuidance, forbiddenLine].filter(
|
|
287
313
|
(part): part is string => typeof part === "string" && part.length > 0,
|
|
@@ -26,7 +26,7 @@ import { deriveState } from "./state.js";
|
|
|
26
26
|
import type { GSDState } from "./types.js";
|
|
27
27
|
import { renderPlanFromDb, renderRoadmapFromDb } from "./markdown-renderer.js";
|
|
28
28
|
import { readManifest } from "./workflow-manifest.js";
|
|
29
|
-
import { gsdRoot, resolveMilestoneFile, resolveSliceFile, resolveTaskFile,
|
|
29
|
+
import { gsdRoot, resolveMilestoneFile, resolveSliceFile, resolveTaskFile, targetTaskFile } from "./paths.js";
|
|
30
30
|
|
|
31
31
|
// ─── Helpers ─────────────────────────────────────────────────────────────
|
|
32
32
|
|
|
@@ -329,8 +329,7 @@ export function renderSummaryProjection(basePath: string, milestoneId: string, s
|
|
|
329
329
|
const evidenceRows = getVerificationEvidence(milestoneId, sliceId, taskId);
|
|
330
330
|
const content = renderSummaryContent(taskRow, sliceId, milestoneId, evidenceRows);
|
|
331
331
|
|
|
332
|
-
const summaryPath =
|
|
333
|
-
?? join(basePath, relTaskFile(basePath, milestoneId, sliceId, taskId, "SUMMARY", getMilestone(milestoneId)?.title));
|
|
332
|
+
const summaryPath = targetTaskFile(basePath, milestoneId, sliceId, taskId, "SUMMARY", getMilestone(milestoneId)?.title);
|
|
334
333
|
mkdirSync(dirname(summaryPath), { recursive: true });
|
|
335
334
|
atomicWriteSync(summaryPath, content);
|
|
336
335
|
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
normalizeRealPath,
|
|
11
11
|
} from "./paths.js";
|
|
12
12
|
import { isGsdWorktreePath, resolveWorktreeProjectRoot } from "./worktree-root.js";
|
|
13
|
+
import { milestoneMetaPath } from "./git-service.js";
|
|
13
14
|
|
|
14
15
|
export type GsdWorkspaceMode = "project" | "worktree";
|
|
15
16
|
|
|
@@ -107,7 +108,7 @@ export function scopeMilestone(workspace: GsdWorkspace, milestoneId: string): Mi
|
|
|
107
108
|
stateFile: () => join(gsd, "STATE.md"),
|
|
108
109
|
dbPath: () => contract.projectDb,
|
|
109
110
|
milestoneDir: () => scopeMilestoneDir(basePath, milestoneId),
|
|
110
|
-
metaJson: () =>
|
|
111
|
+
metaJson: () => milestoneMetaPath(basePath, milestoneId),
|
|
111
112
|
});
|
|
112
113
|
|
|
113
114
|
return scope;
|
|
File without changes
|
|
File without changes
|