@opengsd/gsd-pi 1.9.0-dev.5c1a3ff2 → 1.9.0-dev.d2070876
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/dist/headless.js +2 -1
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/extensions/gsd/auto/loop.js +24 -4
- package/dist/resources/extensions/gsd/auto/run-unit.js +19 -1
- package/dist/resources/extensions/gsd/auto/unit-phase.js +37 -5
- package/dist/resources/extensions/gsd/auto-dispatch.js +2 -0
- package/dist/resources/extensions/gsd/auto-prompts.js +12 -4
- package/dist/resources/extensions/gsd/auto-runtime-state.js +5 -5
- package/dist/resources/extensions/gsd/auto-start.js +29 -9
- package/dist/resources/extensions/gsd/auto-tool-tracking.js +40 -0
- package/dist/resources/extensions/gsd/auto-worktree-sync.js +7 -3
- package/dist/resources/extensions/gsd/auto.js +15 -5
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +2 -2
- package/dist/resources/extensions/gsd/commands-verdict.js +10 -9
- package/dist/resources/extensions/gsd/compat/compat-marker.js +80 -5
- package/dist/resources/extensions/gsd/db/engine.js +5 -2
- package/dist/resources/extensions/gsd/doctor-engine-checks.js +21 -2
- package/dist/resources/extensions/gsd/error-classifier.js +12 -2
- package/dist/resources/extensions/gsd/exec-sandbox.js +1 -0
- package/dist/resources/extensions/gsd/flat-phase-migration.js +12 -0
- package/dist/resources/extensions/gsd/gsd-db.js +75 -31
- package/dist/resources/extensions/gsd/guided-flow.js +2 -2
- package/dist/resources/extensions/gsd/markdown-renderer.js +3 -9
- package/dist/resources/extensions/gsd/paths.js +17 -7
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +5 -5
- package/dist/resources/extensions/gsd/state-reconciliation/drift/external-markdown-edit.js +98 -2
- package/dist/resources/extensions/gsd/state-reconciliation/drift/external-planning-edit.js +4 -1
- package/dist/resources/extensions/gsd/state-reconciliation/drift/roadmap.js +5 -2
- package/dist/resources/extensions/gsd/stop-notice.js +9 -0
- package/dist/resources/extensions/gsd/worktree-state-projection.js +20 -18
- package/dist/resources/extensions/shared/interview-ui.js +43 -6
- 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 +11 -11
- 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 +11 -11
- package/dist/web/standalone/.next/server/chunks/1991.js +2 -2
- package/dist/web/standalone/.next/server/chunks/5124.js +1 -1
- 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/package.json +2 -1
- 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/package.json +5 -5
- package/packages/gsd-agent-modes/package.json +7 -7
- package/packages/gsd-cloud/README.md +9 -3
- package/packages/gsd-cloud/dist/background-cli.test.d.ts +2 -0
- package/packages/gsd-cloud/dist/background-cli.test.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/background-cli.test.js +248 -0
- package/packages/gsd-cloud/dist/background-cli.test.js.map +1 -0
- package/packages/gsd-cloud/dist/cli.d.ts.map +1 -1
- package/packages/gsd-cloud/dist/cli.js +121 -15
- package/packages/gsd-cloud/dist/cli.js.map +1 -1
- package/packages/gsd-cloud/dist/cloud-config.d.ts +1 -1
- package/packages/gsd-cloud/dist/cloud-config.d.ts.map +1 -1
- package/packages/gsd-cloud/dist/cloud-config.js +7 -1
- package/packages/gsd-cloud/dist/cloud-config.js.map +1 -1
- package/packages/gsd-cloud/dist/cloud-runtime.d.ts +1 -3
- package/packages/gsd-cloud/dist/cloud-runtime.d.ts.map +1 -1
- package/packages/gsd-cloud/dist/cloud-runtime.js +9 -7
- package/packages/gsd-cloud/dist/cloud-runtime.js.map +1 -1
- package/packages/gsd-cloud/dist/runtime-process.d.ts +27 -0
- package/packages/gsd-cloud/dist/runtime-process.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/runtime-process.js +272 -0
- package/packages/gsd-cloud/dist/runtime-process.js.map +1 -0
- package/packages/gsd-cloud/dist/runtime-process.test.d.ts +2 -0
- package/packages/gsd-cloud/dist/runtime-process.test.d.ts.map +1 -0
- package/packages/gsd-cloud/dist/runtime-process.test.js +97 -0
- package/packages/gsd-cloud/dist/runtime-process.test.js.map +1 -0
- package/packages/gsd-cloud/package.json +2 -2
- package/packages/mcp-server/dist/cli-runner.d.ts +3 -0
- package/packages/mcp-server/dist/cli-runner.d.ts.map +1 -1
- package/packages/mcp-server/dist/cli-runner.js +119 -33
- package/packages/mcp-server/dist/cli-runner.js.map +1 -1
- package/packages/mcp-server/package.json +4 -4
- package/packages/native/package.json +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-ai/dist/models.generated.d.ts +17 -0
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +17 -0
- package/packages/pi-ai/dist/models.generated.js.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/openai-completions.js +103 -0
- package/packages/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/skills.d.ts +5 -0
- package/packages/pi-coding-agent/dist/core/skills.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/skills.js +54 -0
- package/packages/pi-coding-agent/dist/core/skills.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/extensions/gsd/auto/loop.ts +48 -4
- package/src/resources/extensions/gsd/auto/run-unit.ts +20 -1
- package/src/resources/extensions/gsd/auto/unit-phase.ts +41 -5
- package/src/resources/extensions/gsd/auto-dispatch.ts +1 -0
- package/src/resources/extensions/gsd/auto-prompts.ts +14 -4
- package/src/resources/extensions/gsd/auto-runtime-state.ts +12 -7
- package/src/resources/extensions/gsd/auto-start.ts +31 -8
- package/src/resources/extensions/gsd/auto-tool-tracking.ts +56 -0
- package/src/resources/extensions/gsd/auto-worktree-sync.ts +10 -3
- package/src/resources/extensions/gsd/auto.ts +20 -7
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +2 -2
- package/src/resources/extensions/gsd/commands-verdict.ts +16 -9
- package/src/resources/extensions/gsd/compat/compat-marker.ts +99 -5
- package/src/resources/extensions/gsd/db/engine.ts +5 -2
- package/src/resources/extensions/gsd/doctor-engine-checks.ts +27 -2
- package/src/resources/extensions/gsd/error-classifier.ts +13 -2
- package/src/resources/extensions/gsd/exec-sandbox.ts +1 -0
- package/src/resources/extensions/gsd/flat-phase-migration.ts +14 -0
- package/src/resources/extensions/gsd/gsd-db.ts +85 -33
- package/src/resources/extensions/gsd/guided-flow.ts +2 -2
- package/src/resources/extensions/gsd/markdown-renderer.ts +3 -9
- package/src/resources/extensions/gsd/paths.ts +17 -7
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +5 -5
- package/src/resources/extensions/gsd/state-reconciliation/drift/external-markdown-edit.ts +132 -2
- package/src/resources/extensions/gsd/state-reconciliation/drift/external-planning-edit.ts +4 -1
- package/src/resources/extensions/gsd/state-reconciliation/drift/roadmap.ts +4 -2
- package/src/resources/extensions/gsd/stop-notice.ts +11 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +264 -0
- package/src/resources/extensions/gsd/tests/auto-start-index-lock.test.ts +21 -1
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +74 -1
- package/src/resources/extensions/gsd/tests/commands-verdict.test.ts +10 -0
- package/src/resources/extensions/gsd/tests/compat-marker.test.ts +25 -0
- package/src/resources/extensions/gsd/tests/db-engine-cjs-compat.test.ts +12 -0
- package/src/resources/extensions/gsd/tests/doctor-scope-db-unavailable.test.ts +83 -0
- package/src/resources/extensions/gsd/tests/exec-sandbox.test.ts +33 -1
- package/src/resources/extensions/gsd/tests/external-markdown-edit.test.ts +38 -1
- package/src/resources/extensions/gsd/tests/flat-phase-migration.test.ts +8 -9
- package/src/resources/extensions/gsd/tests/flat-phase-validation-path.test.ts +20 -1
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +32 -0
- package/src/resources/extensions/gsd/tests/guided-discuss-milestone-prompt-rendering.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +13 -0
- package/src/resources/extensions/gsd/tests/prompt-budget-enforcement.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/provider-errors.test.ts +121 -1
- package/src/resources/extensions/gsd/tests/register-hooks-loop-guard-auto.test.ts +105 -0
- package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +52 -0
- package/src/resources/extensions/gsd/tests/stop-notice.test.ts +21 -1
- package/src/resources/extensions/gsd/tests/terminated-transient.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/tool-invocation-error-loop-break.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/validate-milestone-prompt-verification-classes.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/worktree-state-projection.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +60 -0
- package/src/resources/extensions/gsd/worktree-state-projection.ts +21 -24
- package/src/resources/extensions/shared/interview-ui.ts +47 -8
- package/src/resources/extensions/shared/tests/interview-ui-border.test.ts +29 -0
- /package/dist/web/standalone/.next/static/{6YWV7VAPg-jqjfPswrKZb → sggX-h41OjePo-FjdArP5}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{6YWV7VAPg-jqjfPswrKZb → sggX-h41OjePo-FjdArP5}/_ssgManifest.js +0 -0
|
@@ -47,6 +47,7 @@ describe("#2883: tool invocation error tracking on AutoSession", () => {
|
|
|
47
47
|
import {
|
|
48
48
|
isDeterministicPolicyError,
|
|
49
49
|
isPendingUserApprovalGateError,
|
|
50
|
+
isScheduleWakeupContinuationError,
|
|
50
51
|
isToolInvocationError,
|
|
51
52
|
isToolUnavailableError,
|
|
52
53
|
isQueuedUserMessageSkip,
|
|
@@ -118,6 +119,24 @@ describe("#2883: isToolInvocationError classification", () => {
|
|
|
118
119
|
assert.equal(isToolInvocationError("Invalid arguments for tool gsd_slice_complete"), true);
|
|
119
120
|
});
|
|
120
121
|
|
|
122
|
+
test("scopes conditional required-field validation to ScheduleWakeup", () => {
|
|
123
|
+
const error = "`prompt` is required when `stop` is not true";
|
|
124
|
+
|
|
125
|
+
assert.equal(isToolInvocationError(error), false);
|
|
126
|
+
assert.equal(
|
|
127
|
+
isScheduleWakeupContinuationError("ScheduleWakeup", error),
|
|
128
|
+
true,
|
|
129
|
+
);
|
|
130
|
+
assert.equal(isScheduleWakeupContinuationError("read", error), false);
|
|
131
|
+
assert.equal(
|
|
132
|
+
isScheduleWakeupContinuationError(
|
|
133
|
+
"ScheduleWakeup",
|
|
134
|
+
"`evidence` is required when `status` is blocking",
|
|
135
|
+
),
|
|
136
|
+
false,
|
|
137
|
+
);
|
|
138
|
+
});
|
|
139
|
+
|
|
121
140
|
test("detects 'No such tool available' error", () => {
|
|
122
141
|
assert.equal(isToolInvocationError("No such tool available: mcp__gsd-workflow__memory_query"), true);
|
|
123
142
|
});
|
package/src/resources/extensions/gsd/tests/validate-milestone-prompt-verification-classes.test.ts
CHANGED
|
@@ -22,3 +22,10 @@ test("validate-milestone prompt routes verification class analysis into verifica
|
|
|
22
22
|
assert.match(prompt, /If Reviewer C omitted a planned class, reconstruct the missing row/i);
|
|
23
23
|
assert.match(prompt, /Do not call `gsd_validate_milestone` with a partial `verificationClasses` table/i);
|
|
24
24
|
});
|
|
25
|
+
|
|
26
|
+
test("validate-milestone prompt forbids reading phase directories as files", () => {
|
|
27
|
+
assert.match(prompt, /find \.gsd -type f/i);
|
|
28
|
+
assert.match(prompt, /\.gsd\/phases\/<NN>-<slug>\/` is a directory, not an artifact/i);
|
|
29
|
+
assert.match(prompt, /never pass a phase, slice, `tasks\/`, or `slices\/` directory/i);
|
|
30
|
+
assert.doesNotMatch(prompt, /Read a full SUMMARY under `\.gsd\/milestones\/\{\{milestoneId\}\}\/slices\/`/i);
|
|
31
|
+
});
|
|
@@ -117,8 +117,8 @@ test("projectRootToWorktree projects flat-phase discuss artifacts before dispatc
|
|
|
117
117
|
new WorktreeStateProjection().projectRootToWorktree(scope);
|
|
118
118
|
|
|
119
119
|
assert.ok(
|
|
120
|
-
existsSync(join(worktree, ".gsd", "milestones"
|
|
121
|
-
"
|
|
120
|
+
!existsSync(join(worktree, ".gsd", "milestones")),
|
|
121
|
+
"stale metadata-only legacy milestones/ scaffold is not projected into the worktree",
|
|
122
122
|
);
|
|
123
123
|
assert.ok(
|
|
124
124
|
existsSync(join(worktree, ".gsd", "phases", "01-foundation", "01-CONTEXT.md")),
|
|
@@ -246,6 +246,66 @@ describe('worktree-sync-milestones', async () => {
|
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
+
// ─── 7b. flat-phase sync skips empty legacy milestones root ───────────
|
|
250
|
+
console.log('\n=== 7b. flat-phase sync skips empty legacy milestones root ===');
|
|
251
|
+
{
|
|
252
|
+
const mainBase = mkdtempSync(join(tmpdir(), 'gsd-wt-sync-flat-main-'));
|
|
253
|
+
const wtBase = mkdtempSync(join(tmpdir(), 'gsd-wt-sync-flat-wt-'));
|
|
254
|
+
|
|
255
|
+
try {
|
|
256
|
+
const phaseDir = join(mainBase, '.gsd', 'phases', '01-foundation');
|
|
257
|
+
mkdirSync(phaseDir, { recursive: true });
|
|
258
|
+
mkdirSync(join(mainBase, '.gsd', 'milestones'), { recursive: true });
|
|
259
|
+
mkdirSync(join(wtBase, '.gsd'), { recursive: true });
|
|
260
|
+
writeFileSync(join(phaseDir, '01-CONTEXT.md'), '# Foundation\n');
|
|
261
|
+
|
|
262
|
+
syncGsdStateToWorktree(mainBase, wtBase);
|
|
263
|
+
|
|
264
|
+
assert.ok(
|
|
265
|
+
existsSync(join(wtBase, '.gsd', 'phases', '01-foundation', '01-CONTEXT.md')),
|
|
266
|
+
'flat-phase artifact is synced to worktree',
|
|
267
|
+
);
|
|
268
|
+
assert.ok(
|
|
269
|
+
!existsSync(join(wtBase, '.gsd', 'milestones')),
|
|
270
|
+
'empty legacy milestones/ root is not recreated in worktree',
|
|
271
|
+
);
|
|
272
|
+
} finally {
|
|
273
|
+
rmSync(mainBase, { recursive: true, force: true });
|
|
274
|
+
rmSync(wtBase, { recursive: true, force: true });
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// ─── 7c. flat-phase sync skips metadata-only legacy milestone dirs ────
|
|
279
|
+
console.log('\n=== 7c. flat-phase sync skips metadata-only legacy milestone dirs ===');
|
|
280
|
+
{
|
|
281
|
+
const mainBase = mkdtempSync(join(tmpdir(), 'gsd-wt-sync-flat-meta-main-'));
|
|
282
|
+
const wtBase = mkdtempSync(join(tmpdir(), 'gsd-wt-sync-flat-meta-wt-'));
|
|
283
|
+
|
|
284
|
+
try {
|
|
285
|
+
const phaseDir = join(mainBase, '.gsd', 'phases', '01-foundation');
|
|
286
|
+
const metaDir = join(mainBase, '.gsd', 'milestones', 'M001');
|
|
287
|
+
mkdirSync(phaseDir, { recursive: true });
|
|
288
|
+
mkdirSync(metaDir, { recursive: true });
|
|
289
|
+
mkdirSync(join(wtBase, '.gsd'), { recursive: true });
|
|
290
|
+
writeFileSync(join(phaseDir, '01-CONTEXT.md'), '# Foundation\n');
|
|
291
|
+
writeFileSync(join(metaDir, 'M001-META.json'), '{"integrationBranch":"main"}\n');
|
|
292
|
+
|
|
293
|
+
syncGsdStateToWorktree(mainBase, wtBase);
|
|
294
|
+
|
|
295
|
+
assert.ok(
|
|
296
|
+
existsSync(join(wtBase, '.gsd', 'phases', '01-foundation', '01-CONTEXT.md')),
|
|
297
|
+
'flat-phase artifact is synced to worktree',
|
|
298
|
+
);
|
|
299
|
+
assert.ok(
|
|
300
|
+
!existsSync(join(wtBase, '.gsd', 'milestones')),
|
|
301
|
+
'metadata-only legacy milestones/ scaffold is not recreated in worktree',
|
|
302
|
+
);
|
|
303
|
+
} finally {
|
|
304
|
+
rmSync(mainBase, { recursive: true, force: true });
|
|
305
|
+
rmSync(wtBase, { recursive: true, force: true });
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
249
309
|
// ─── 8. syncWorktreeStateBack does not copy task projections ───────────
|
|
250
310
|
console.log('\n=== 8. syncWorktreeStateBack leaves task projections in worktree ===');
|
|
251
311
|
{
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import { join } from "node:path";
|
|
33
33
|
|
|
34
34
|
import { reconcileWorktreeDb } from "./gsd-db.js";
|
|
35
|
-
import { resolveGsdPathContract } from "./paths.js";
|
|
35
|
+
import { dirIsContentBearingLegacyMilestone, resolveGsdPathContract } from "./paths.js";
|
|
36
36
|
import { safeCopy, safeCopyRecursive } from "./safe-fs.js";
|
|
37
37
|
import type { MilestoneScope } from "./workspace.js";
|
|
38
38
|
import { logError, logWarning } from "./workflow-logger.js";
|
|
@@ -161,6 +161,7 @@ function syncOtherMilestoneArtifacts(
|
|
|
161
161
|
// additive safeCopyRecursive; skip it here to avoid redundant work.
|
|
162
162
|
if (milestoneEntry.name === currentMilestoneId) continue;
|
|
163
163
|
const srcMilestoneDir = join(srcMilestonesDir, milestoneEntry.name);
|
|
164
|
+
if (!dirIsContentBearingLegacyMilestone(srcMilestoneDir)) continue;
|
|
164
165
|
const dstMilestoneDir = join(dstMilestonesDir, milestoneEntry.name);
|
|
165
166
|
|
|
166
167
|
// Additively project the entire milestone subtree (force:false), not just
|
|
@@ -271,36 +272,32 @@ export function _projectRootToWorktreeImpl(
|
|
|
271
272
|
// Without this, worktree-local files (e.g. VALIDATION.md written
|
|
272
273
|
// by validate-milestone) get clobbered by stale project root copies,
|
|
273
274
|
// causing an infinite re-validation loop (#1886).
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
{ force: false }
|
|
278
|
-
|
|
275
|
+
const prMilestoneDir = join(prGsd, "milestones", milestoneId);
|
|
276
|
+
const wtMilestoneDir = join(wtGsd, "milestones", milestoneId);
|
|
277
|
+
if (dirIsContentBearingLegacyMilestone(prMilestoneDir)) {
|
|
278
|
+
safeCopyRecursive(prMilestoneDir, wtMilestoneDir, { force: false });
|
|
279
|
+
|
|
280
|
+
// Force-sync ASSESSMENT files that have a verdict from project root (#2821).
|
|
281
|
+
// The additive-only copy above preserves worktree-local files, but
|
|
282
|
+
// ASSESSMENT files are special: after run-uat writes a verdict and post-unit
|
|
283
|
+
// syncs it to the project root, the worktree may retain a stale copy (e.g.
|
|
284
|
+
// verdict:fail while the project root has verdict:pass from a retry). On
|
|
285
|
+
// session resume the DB is rebuilt from disk, and if the stale ASSESSMENT
|
|
286
|
+
// persists, checkNeedsRunUat finds no passing verdict → re-dispatches
|
|
287
|
+
// run-uat indefinitely (stuck-loop ×9).
|
|
288
|
+
forceOverwriteValidationWithVerdict(prMilestoneDir, wtMilestoneDir, milestoneId);
|
|
289
|
+
forceOverwriteAssessmentsWithVerdict(prMilestoneDir, wtMilestoneDir);
|
|
290
|
+
}
|
|
279
291
|
|
|
280
|
-
// Additively project the full subtree of every OTHER
|
|
281
|
-
// worktree-bound units can read prior-milestone context artifacts
|
|
282
|
-
//
|
|
283
|
-
// UAT.md on the worktree filesystem (otherwise the stale-render detector
|
|
284
|
-
// flags them as "complete in DB but missing on disk").
|
|
292
|
+
// Additively project the full subtree of every OTHER content-bearing legacy
|
|
293
|
+
// milestone so worktree-bound units can read prior-milestone context artifacts
|
|
294
|
+
// without recreating empty/meta-only milestones/ scaffolds in flat-phase projects.
|
|
285
295
|
syncOtherMilestoneArtifacts(
|
|
286
296
|
join(prGsd, "milestones"),
|
|
287
297
|
join(wtGsd, "milestones"),
|
|
288
298
|
milestoneId,
|
|
289
299
|
);
|
|
290
300
|
|
|
291
|
-
// Force-sync ASSESSMENT files that have a verdict from project root (#2821).
|
|
292
|
-
// The additive-only copy above preserves worktree-local files, but
|
|
293
|
-
// ASSESSMENT files are special: after run-uat writes a verdict and post-unit
|
|
294
|
-
// syncs it to the project root, the worktree may retain a stale copy (e.g.
|
|
295
|
-
// verdict:fail while the project root has verdict:pass from a retry). On
|
|
296
|
-
// session resume the DB is rebuilt from disk, and if the stale ASSESSMENT
|
|
297
|
-
// persists, checkNeedsRunUat finds no passing verdict → re-dispatches
|
|
298
|
-
// run-uat indefinitely (stuck-loop ×9).
|
|
299
|
-
const prMilestoneDir = join(prGsd, "milestones", milestoneId);
|
|
300
|
-
const wtMilestoneDir = join(wtGsd, "milestones", milestoneId);
|
|
301
|
-
forceOverwriteValidationWithVerdict(prMilestoneDir, wtMilestoneDir, milestoneId);
|
|
302
|
-
forceOverwriteAssessmentsWithVerdict(prMilestoneDir, wtMilestoneDir);
|
|
303
|
-
|
|
304
301
|
// Forward-sync completed-units.json from project root to worktree.
|
|
305
302
|
// Project root is authoritative for completion state after crash recovery;
|
|
306
303
|
// without this, the worktree re-dispatches already-completed units (#1886).
|
|
@@ -252,6 +252,11 @@ export async function showInterviewRound(
|
|
|
252
252
|
let previewTotal = 0;
|
|
253
253
|
function resetPreviewScroll() { previewScroll = 0; }
|
|
254
254
|
|
|
255
|
+
let optionsScroll = 0;
|
|
256
|
+
let optionsViewport = 0;
|
|
257
|
+
let optionsTotal = 0;
|
|
258
|
+
function resetOptionsScroll() { optionsScroll = 0; }
|
|
259
|
+
|
|
255
260
|
function finish(result: RoundResult) {
|
|
256
261
|
if (completed) return;
|
|
257
262
|
completed = true;
|
|
@@ -318,6 +323,7 @@ export async function showInterviewRound(
|
|
|
318
323
|
saveEditorToState();
|
|
319
324
|
currentIdx = newIdx;
|
|
320
325
|
resetPreviewScroll();
|
|
326
|
+
resetOptionsScroll();
|
|
321
327
|
loadStateToEditor();
|
|
322
328
|
focusNotes = states[currentIdx].notesVisible && states[currentIdx].notes.length > 0;
|
|
323
329
|
refresh();
|
|
@@ -464,20 +470,39 @@ export async function showInterviewRound(
|
|
|
464
470
|
if (matchesKey(data, Key.right)) { switchQuestion((currentIdx + 1) % questions.length); return; }
|
|
465
471
|
}
|
|
466
472
|
|
|
467
|
-
// ──
|
|
473
|
+
// ── Side-by-side panel scrolling ─────────────────────────────
|
|
468
474
|
if (matchesKey(data, Key.pageUp)) {
|
|
469
|
-
|
|
475
|
+
let didScroll = false;
|
|
476
|
+
if (optionsScroll > 0) {
|
|
477
|
+
optionsScroll = Math.max(0, optionsScroll - optionsViewport);
|
|
478
|
+
didScroll = true;
|
|
479
|
+
}
|
|
480
|
+
if (previewScroll > 0) {
|
|
481
|
+
previewScroll = Math.max(0, previewScroll - previewViewport);
|
|
482
|
+
didScroll = true;
|
|
483
|
+
}
|
|
484
|
+
if (didScroll) refresh();
|
|
470
485
|
return;
|
|
471
486
|
}
|
|
472
487
|
if (matchesKey(data, Key.pageDown)) {
|
|
488
|
+
let didScroll = false;
|
|
489
|
+
const maxOptionsScroll = Math.max(0, optionsTotal - optionsViewport);
|
|
490
|
+
if (optionsScroll < maxOptionsScroll) {
|
|
491
|
+
optionsScroll = Math.min(maxOptionsScroll, optionsScroll + optionsViewport);
|
|
492
|
+
didScroll = true;
|
|
493
|
+
}
|
|
473
494
|
const maxScroll = Math.max(0, previewTotal - previewViewport);
|
|
474
|
-
if (previewScroll < maxScroll) {
|
|
495
|
+
if (previewScroll < maxScroll) {
|
|
496
|
+
previewScroll = Math.min(maxScroll, previewScroll + previewViewport);
|
|
497
|
+
didScroll = true;
|
|
498
|
+
}
|
|
499
|
+
if (didScroll) refresh();
|
|
475
500
|
return;
|
|
476
501
|
}
|
|
477
502
|
|
|
478
503
|
// ── Cursor navigation ────────────────────────────────────────
|
|
479
|
-
if (matchesKey(data, Key.up)) { st.cursorIndex = (st.cursorIndex - 1 + optCount) % optCount; resetPreviewScroll(); refresh(); return; }
|
|
480
|
-
if (matchesKey(data, Key.down)) { st.cursorIndex = (st.cursorIndex + 1) % optCount; resetPreviewScroll(); refresh(); return; }
|
|
504
|
+
if (matchesKey(data, Key.up)) { st.cursorIndex = (st.cursorIndex - 1 + optCount) % optCount; resetPreviewScroll(); resetOptionsScroll(); refresh(); return; }
|
|
505
|
+
if (matchesKey(data, Key.down)) { st.cursorIndex = (st.cursorIndex + 1) % optCount; resetPreviewScroll(); resetOptionsScroll(); refresh(); return; }
|
|
481
506
|
|
|
482
507
|
if (multiSel) {
|
|
483
508
|
const doneI = noneOrDoneIdx(currentIdx);
|
|
@@ -695,6 +720,8 @@ export async function showInterviewRound(
|
|
|
695
720
|
// No scrollable preview unless the side-by-side path sets these below.
|
|
696
721
|
previewTotal = 0;
|
|
697
722
|
previewViewport = 0;
|
|
723
|
+
optionsTotal = 0;
|
|
724
|
+
optionsViewport = 0;
|
|
698
725
|
|
|
699
726
|
if (useSideBySide) {
|
|
700
727
|
// ── Preview path ──────────────────────────────────────
|
|
@@ -734,10 +761,21 @@ export async function showInterviewRound(
|
|
|
734
761
|
const leftWidth = Math.max(MIN_OPTIONS_WIDTH, contentWidth - previewWidth - DIVIDER_WIDTH);
|
|
735
762
|
|
|
736
763
|
const fullLeft = renderOptionsColumn(leftWidth);
|
|
737
|
-
|
|
764
|
+
optionsTotal = fullLeft.length;
|
|
765
|
+
optionsViewport = maxBody;
|
|
766
|
+
const maxOptionsScroll = Math.max(0, fullLeft.length - maxBody);
|
|
767
|
+
if (optionsScroll > maxOptionsScroll) optionsScroll = maxOptionsScroll;
|
|
768
|
+
|
|
769
|
+
const leftLines = fullLeft.slice(optionsScroll, optionsScroll + maxBody);
|
|
738
770
|
if (fullLeft.length > maxBody) {
|
|
739
|
-
const
|
|
740
|
-
|
|
771
|
+
const hiddenAbove = optionsScroll;
|
|
772
|
+
const hiddenBelow = fullLeft.length - (optionsScroll + maxBody);
|
|
773
|
+
if (hiddenAbove > 0) {
|
|
774
|
+
leftLines[0] = scrollIndicator(`▲ ${hiddenAbove} more`, leftWidth);
|
|
775
|
+
}
|
|
776
|
+
if (hiddenBelow > 0) {
|
|
777
|
+
leftLines[leftLines.length - 1] = scrollIndicator(`▼ ${hiddenBelow} more · PgUp/PgDn`, leftWidth);
|
|
778
|
+
}
|
|
741
779
|
}
|
|
742
780
|
|
|
743
781
|
const preview = getCurrentPreview();
|
|
@@ -791,6 +829,7 @@ export async function showInterviewRound(
|
|
|
791
829
|
hints.push(isLast && allAnswered() ? "enter to review" : "enter to next");
|
|
792
830
|
}
|
|
793
831
|
if (previewTotal > previewViewport) hints.push("pgup/pgdn scroll preview");
|
|
832
|
+
if (optionsTotal > optionsViewport) hints.push("pgup/pgdn scroll options");
|
|
794
833
|
hints.push("esc to exit");
|
|
795
834
|
const footer = ui.hints(hints)[0] ?? "";
|
|
796
835
|
|
|
@@ -192,4 +192,33 @@ describe("interview-ui dialog borders", () => {
|
|
|
192
192
|
const back = stripAnsi(widget.render(100).join("\n"));
|
|
193
193
|
assert.doesNotMatch(back, /▲ \d+ more/, "top indicator should disappear after scrolling back to top");
|
|
194
194
|
});
|
|
195
|
+
|
|
196
|
+
it("makes overflowing side-by-side options scrollable with PgUp/PgDn", async () => {
|
|
197
|
+
const overflowOptions = Array.from({ length: 8 }, (_, i) => ({
|
|
198
|
+
label: `Overflow Option ${i + 1}`,
|
|
199
|
+
description: `Detailed explanation for option ${i + 1} that is intentionally long enough to wrap in the options column and force vertical overflow.`,
|
|
200
|
+
...(i === 0 ? { preview: "Short preview" } : {}),
|
|
201
|
+
}));
|
|
202
|
+
const widget = await captureInterviewWidget([{
|
|
203
|
+
...questions[0],
|
|
204
|
+
options: overflowOptions,
|
|
205
|
+
}]);
|
|
206
|
+
|
|
207
|
+
const initial = stripAnsi(widget.render(100).join("\n"));
|
|
208
|
+
assertFullOuterBorder(widget.render(100), 100);
|
|
209
|
+
assert.match(initial, /▼ \d+ more/, "bottom scroll indicator should appear when options overflow");
|
|
210
|
+
assert.match(initial, /pgup\/pgdn scroll options/, "footer should hint at options scrolling");
|
|
211
|
+
assert.doesNotMatch(initial, /\+\d+ lines hidden/, "options overflow should not be a dead-end hidden-lines marker");
|
|
212
|
+
assert.doesNotMatch(initial, /▲ \d+ more/, "top indicator should be absent before scrolling");
|
|
213
|
+
|
|
214
|
+
widget.handleInput(PAGE_DOWN);
|
|
215
|
+
const scrolled = stripAnsi(widget.render(100).join("\n"));
|
|
216
|
+
assertFullOuterBorder(widget.render(100), 100);
|
|
217
|
+
assert.match(scrolled, /▲ \d+ more/, "top scroll indicator should appear after scrolling down");
|
|
218
|
+
assert.ok(scrolled !== initial, "scrolling should change the rendered options");
|
|
219
|
+
|
|
220
|
+
widget.handleInput(PAGE_UP);
|
|
221
|
+
const back = stripAnsi(widget.render(100).join("\n"));
|
|
222
|
+
assert.doesNotMatch(back, /▲ \d+ more/, "top indicator should disappear after scrolling back to top");
|
|
223
|
+
});
|
|
195
224
|
});
|
|
File without changes
|
|
File without changes
|