@opengsd/gsd-pi 1.1.1-dev.9f86580 → 1.1.1-dev.b2556262
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-recover.js +56 -1
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/extensions/browser-tools/index.js +39 -22
- package/dist/resources/extensions/browser-tools/state.js +12 -0
- package/dist/resources/extensions/browser-tools/tools/session.js +3 -2
- package/dist/resources/extensions/browser-tools/utils.js +3 -3
- package/dist/resources/extensions/gsd/auto/loop.js +4 -2
- package/dist/resources/extensions/gsd/auto/phases.js +43 -10
- package/dist/resources/extensions/gsd/auto/session.js +20 -1
- package/dist/resources/extensions/gsd/auto/workflow-kernel.js +1 -0
- package/dist/resources/extensions/gsd/auto-dispatch.js +72 -12
- package/dist/resources/extensions/gsd/auto-model-selection.js +128 -9
- package/dist/resources/extensions/gsd/auto-post-unit.js +19 -2
- package/dist/resources/extensions/gsd/auto-prompts.js +24 -19
- package/dist/resources/extensions/gsd/auto-recovery.js +4 -2
- package/dist/resources/extensions/gsd/auto-runtime-state.js +3 -0
- package/dist/resources/extensions/gsd/auto-start.js +1 -1
- package/dist/resources/extensions/gsd/auto.js +14 -11
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +3 -3
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +172 -65
- package/dist/resources/extensions/gsd/closeout-wizard.js +32 -9
- package/dist/resources/extensions/gsd/commands/handlers/ops.js +2 -9
- package/dist/resources/extensions/gsd/commands-maintenance.js +93 -15
- package/dist/resources/extensions/gsd/commands-prefs-wizard.js +2 -2
- package/dist/resources/extensions/gsd/db-writer.js +35 -0
- package/dist/resources/extensions/gsd/docs/preferences-reference.md +50 -1
- package/dist/resources/extensions/gsd/gsd-db.js +480 -172
- package/dist/resources/extensions/gsd/markdown-renderer.js +37 -53
- package/dist/resources/extensions/gsd/md-importer.js +38 -3
- package/dist/resources/extensions/gsd/migration-auto-check.js +126 -31
- package/dist/resources/extensions/gsd/parsers-legacy.js +23 -0
- package/dist/resources/extensions/gsd/planning-path-scope.js +22 -4
- package/dist/resources/extensions/gsd/pre-execution-checks.js +10 -2
- package/dist/resources/extensions/gsd/preferences-models.js +110 -43
- package/dist/resources/extensions/gsd/preferences-types.js +13 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +68 -3
- package/dist/resources/extensions/gsd/preferences.js +4 -1
- package/dist/resources/extensions/gsd/prompts/gate-evaluate.md +1 -1
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/refine-slice.md +1 -1
- package/dist/resources/extensions/gsd/roadmap-slices.js +5 -1
- package/dist/resources/extensions/gsd/safety/content-validator.js +6 -4
- package/dist/resources/extensions/gsd/source-observations.js +306 -0
- package/dist/resources/extensions/gsd/state-reconciliation/drift/completion.js +15 -8
- package/dist/resources/extensions/gsd/state-reconciliation/drift/stale-render.js +33 -5
- package/dist/resources/extensions/gsd/state-reconciliation/drift/stale-worker.js +34 -13
- package/dist/resources/extensions/gsd/state-reconciliation/index.js +39 -14
- package/dist/resources/extensions/gsd/state-reconciliation/spawn-gate.js +4 -4
- package/dist/resources/extensions/gsd/state.js +7 -3
- package/dist/resources/extensions/gsd/tool-contract.js +14 -0
- package/dist/resources/extensions/gsd/tool-presentation-plan.js +1 -9
- package/dist/resources/extensions/gsd/tools/complete-slice.js +7 -6
- package/dist/resources/extensions/gsd/tools/plan-slice.js +42 -11
- package/dist/resources/extensions/gsd/tools/plan-task.js +7 -1
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +57 -429
- package/dist/resources/extensions/gsd/uat-policy.js +130 -0
- package/dist/resources/extensions/gsd/uat-run.js +414 -0
- package/dist/resources/extensions/gsd/unit-context-manifest.js +3 -4
- package/dist/resources/extensions/gsd/verdict-parser.js +3 -8
- package/dist/resources/extensions/gsd/workflow-manifest.js +132 -5
- package/dist/resources/extensions/gsd/workflow-projections.js +8 -0
- package/dist/resources/extensions/gsd/worktree-state-projection.js +18 -17
- package/dist/resources/extensions/subagent/agents.js +1 -0
- package/dist/resources/extensions/subagent/index.js +27 -12
- package/dist/resources/extensions/subagent/launch.js +7 -2
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +8 -8
- 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 +8 -8
- 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/dist/native.js +22 -0
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +1 -1
- package/package.json +4 -4
- 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/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js +21 -23
- package/packages/gsd-agent-modes/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts +3 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js +25 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.d.ts +1 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.js +66 -12
- package/packages/gsd-agent-modes/dist/modes/interactive/components/transcript-design.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js +18 -11
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.js +16 -0
- package/packages/gsd-agent-modes/dist/modes/interactive/interactive-chat-render.js.map +1 -1
- package/packages/gsd-agent-modes/package.json +7 -7
- package/packages/mcp-server/dist/workflow-tools.js +1 -1
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +3 -3
- package/packages/native/dist/native.js +22 -0
- package/packages/native/package.json +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-ai/dist/image-models.generated.d.ts +30 -0
- package/packages/pi-ai/dist/image-models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/image-models.generated.js +30 -0
- package/packages/pi-ai/dist/image-models.generated.js.map +1 -1
- package/packages/pi-ai/dist/models.generated.d.ts +23 -17
- package/packages/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/packages/pi-ai/dist/models.generated.js +25 -24
- package/packages/pi-ai/dist/models.generated.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/theme/themes.js +1 -1
- package/packages/pi-coding-agent/dist/theme/themes.js.map +1 -1
- package/packages/pi-coding-agent/package.json +7 -7
- package/packages/pi-tui/dist/utils.d.ts +11 -0
- package/packages/pi-tui/dist/utils.d.ts.map +1 -1
- package/packages/pi-tui/dist/utils.js +119 -6
- package/packages/pi-tui/dist/utils.js.map +1 -1
- package/packages/pi-tui/package.json +2 -1
- package/packages/rpc-client/package.json +2 -2
- package/pkg/dist/theme/themes.js +1 -1
- package/pkg/dist/theme/themes.js.map +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/browser-tools/index.ts +39 -22
- package/src/resources/extensions/browser-tools/state.ts +13 -0
- package/src/resources/extensions/browser-tools/tests/browser-tools-unit.test.cjs +57 -0
- package/src/resources/extensions/browser-tools/tools/session.ts +4 -2
- package/src/resources/extensions/browser-tools/utils.ts +3 -3
- package/src/resources/extensions/gsd/auto/loop-deps.ts +1 -0
- package/src/resources/extensions/gsd/auto/loop.ts +4 -2
- package/src/resources/extensions/gsd/auto/phases.ts +42 -10
- package/src/resources/extensions/gsd/auto/session.ts +22 -1
- package/src/resources/extensions/gsd/auto/workflow-kernel.ts +1 -0
- package/src/resources/extensions/gsd/auto-dispatch.ts +85 -12
- package/src/resources/extensions/gsd/auto-model-selection.ts +164 -12
- package/src/resources/extensions/gsd/auto-post-unit.ts +20 -2
- package/src/resources/extensions/gsd/auto-prompts.ts +23 -20
- package/src/resources/extensions/gsd/auto-recovery.ts +22 -3
- package/src/resources/extensions/gsd/auto-runtime-state.ts +5 -0
- package/src/resources/extensions/gsd/auto-start.ts +1 -1
- package/src/resources/extensions/gsd/auto.ts +13 -10
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +3 -3
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +225 -72
- package/src/resources/extensions/gsd/closeout-wizard.ts +47 -13
- package/src/resources/extensions/gsd/commands/handlers/ops.ts +2 -17
- package/src/resources/extensions/gsd/commands-maintenance.ts +124 -13
- package/src/resources/extensions/gsd/commands-prefs-wizard.ts +2 -2
- package/src/resources/extensions/gsd/db-writer.ts +38 -0
- package/src/resources/extensions/gsd/docs/preferences-reference.md +50 -1
- package/src/resources/extensions/gsd/gsd-db.ts +564 -186
- package/src/resources/extensions/gsd/markdown-renderer.ts +44 -66
- package/src/resources/extensions/gsd/md-importer.ts +49 -2
- package/src/resources/extensions/gsd/migration-auto-check.ts +154 -34
- package/src/resources/extensions/gsd/parsers-legacy.ts +20 -0
- package/src/resources/extensions/gsd/planning-path-scope.ts +22 -4
- package/src/resources/extensions/gsd/pre-execution-checks.ts +9 -2
- package/src/resources/extensions/gsd/preferences-models.ts +112 -43
- package/src/resources/extensions/gsd/preferences-types.ts +39 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +76 -2
- package/src/resources/extensions/gsd/preferences.ts +5 -0
- package/src/resources/extensions/gsd/prompts/gate-evaluate.md +1 -1
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/refine-slice.md +1 -1
- package/src/resources/extensions/gsd/roadmap-slices.ts +6 -1
- package/src/resources/extensions/gsd/safety/content-validator.ts +8 -5
- package/src/resources/extensions/gsd/source-observations.ts +402 -0
- package/src/resources/extensions/gsd/state-reconciliation/drift/completion.ts +20 -8
- package/src/resources/extensions/gsd/state-reconciliation/drift/stale-render.ts +44 -5
- package/src/resources/extensions/gsd/state-reconciliation/drift/stale-worker.ts +39 -11
- package/src/resources/extensions/gsd/state-reconciliation/index.ts +45 -15
- package/src/resources/extensions/gsd/state-reconciliation/spawn-gate.ts +4 -4
- package/src/resources/extensions/gsd/state.ts +7 -4
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/auto-model-selection.test.ts +299 -1
- package/src/resources/extensions/gsd/tests/auto-paused-ui-cleanup.test.ts +32 -0
- package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +75 -3
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +22 -1
- package/src/resources/extensions/gsd/tests/before-provider-context-management.test.ts +145 -0
- package/src/resources/extensions/gsd/tests/closeout-wizard.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/commands-dispatcher-unmerged-milestone.test.ts +26 -1
- package/src/resources/extensions/gsd/tests/content-validator.test.ts +74 -0
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +16 -2
- package/src/resources/extensions/gsd/tests/doctor-scope-db-unavailable.test.ts +1 -11
- package/src/resources/extensions/gsd/tests/gate-dispatch.test.ts +64 -0
- package/src/resources/extensions/gsd/tests/gate-storage.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/gsd-recover.test.ts +62 -1
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/markdown-renderer.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +99 -0
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +99 -2
- package/src/resources/extensions/gsd/tests/plan-task.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/preferences.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/register-hooks-depth-verification.test.ts +101 -1
- package/src/resources/extensions/gsd/tests/repository-registry.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/schema-v21-sequence.test.ts +5 -3
- package/src/resources/extensions/gsd/tests/schema-v27-v28-sequence.test.ts +162 -18
- package/src/resources/extensions/gsd/tests/skipped-validation-db-atomicity.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/source-observations.test.ts +275 -0
- package/src/resources/extensions/gsd/tests/stale-queued-milestone.test.ts +43 -0
- package/src/resources/extensions/gsd/tests/state-reconciliation-drift.test.ts +76 -21
- package/src/resources/extensions/gsd/tests/thinking-level-resolution.test.ts +203 -0
- package/src/resources/extensions/gsd/tests/uat-policy.test.ts +170 -0
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/workflow-kernel.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/workflow-manifest.test.ts +306 -1
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +73 -6
- package/src/resources/extensions/gsd/tests/worktree-db.test.ts +511 -1
- package/src/resources/extensions/gsd/tests/worktree-state-projection.test.ts +44 -0
- package/src/resources/extensions/gsd/tool-contract.ts +28 -0
- package/src/resources/extensions/gsd/tool-presentation-plan.ts +1 -11
- package/src/resources/extensions/gsd/tools/complete-slice.ts +7 -6
- package/src/resources/extensions/gsd/tools/plan-slice.ts +54 -12
- package/src/resources/extensions/gsd/tools/plan-task.ts +8 -1
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +66 -526
- package/src/resources/extensions/gsd/types.ts +1 -0
- package/src/resources/extensions/gsd/uat-policy.ts +191 -0
- package/src/resources/extensions/gsd/uat-run.ts +550 -0
- package/src/resources/extensions/gsd/unit-context-manifest.ts +3 -4
- package/src/resources/extensions/gsd/verdict-parser.ts +3 -10
- package/src/resources/extensions/gsd/workflow-manifest.ts +193 -7
- package/src/resources/extensions/gsd/workflow-projections.ts +9 -0
- package/src/resources/extensions/gsd/worktree-state-projection.ts +22 -22
- package/src/resources/extensions/shared/tests/format-utils.test.ts +8 -3
- package/src/resources/extensions/subagent/agents.ts +4 -0
- package/src/resources/extensions/subagent/index.ts +28 -3
- package/src/resources/extensions/subagent/launch.ts +8 -0
- package/src/resources/extensions/subagent/tests/model-override.test.ts +31 -0
- /package/dist/web/standalone/.next/static/{zzYMrKpPGfRQRxSFO32Jr → tJOKQbQRO-9MiFDO8DIDS}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{zzYMrKpPGfRQRxSFO32Jr → tJOKQbQRO-9MiFDO8DIDS}/_ssgManifest.js +0 -0
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { resolveManifest, } from "./unit-context-manifest.js";
|
|
4
4
|
import { getRequiredWorkflowToolsForAutoUnit } from "./workflow-mcp.js";
|
|
5
5
|
import { getUnitToolSurfaceContract } from "./unit-tool-contracts.js";
|
|
6
|
+
import { WHOLE_FILE_OBSERVATION_MAX_BYTES, WHOLE_FILE_OBSERVATION_MAX_LINES, } from "./source-observations.js";
|
|
6
7
|
export function compileUnitToolContract(unitType) {
|
|
7
8
|
const manifest = resolveManifest(unitType);
|
|
8
9
|
const surfaceContract = getUnitToolSurfaceContract(unitType);
|
|
@@ -40,8 +41,10 @@ export function compileUnitToolContract(unitType) {
|
|
|
40
41
|
"unit-manifest-present",
|
|
41
42
|
"workflow-tool-surface-present",
|
|
42
43
|
...(requiresCloseoutTool(unitType) ? ["closeout-tool-present"] : []),
|
|
44
|
+
...(unitType === "execute-task" ? ["source-observation-contract-present"] : []),
|
|
43
45
|
],
|
|
44
46
|
closeoutTools,
|
|
47
|
+
sourceObservations: sourceObservationContractForUnit(unitType),
|
|
45
48
|
artifacts: {
|
|
46
49
|
inline: manifest.artifacts.inline,
|
|
47
50
|
excerpt: manifest.artifacts.excerpt,
|
|
@@ -50,6 +53,17 @@ export function compileUnitToolContract(unitType) {
|
|
|
50
53
|
},
|
|
51
54
|
};
|
|
52
55
|
}
|
|
56
|
+
function sourceObservationContractForUnit(unitType) {
|
|
57
|
+
if (unitType !== "execute-task")
|
|
58
|
+
return { mode: "none" };
|
|
59
|
+
return {
|
|
60
|
+
mode: "whole-file-active-unit",
|
|
61
|
+
seedFields: ["task.files", "task.inputs"],
|
|
62
|
+
excludedFields: ["expectedOutput"],
|
|
63
|
+
maxBytes: WHOLE_FILE_OBSERVATION_MAX_BYTES,
|
|
64
|
+
maxLines: WHOLE_FILE_OBSERVATION_MAX_LINES,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
53
67
|
function requiresCloseoutTool(unitType) {
|
|
54
68
|
return /^(execute-task|reactive-execute|complete-slice|validate-milestone|complete-milestone|run-uat|gate-evaluate)$/.test(unitType);
|
|
55
69
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Project/App: gsd-pi
|
|
2
2
|
// File Purpose: Resolve phase-aware tool surfaces for GSD model presentations.
|
|
3
3
|
import { RUN_UAT_BROWSER_TOOL_NAMES, RUN_UAT_READ_ONLY_TOOL_NAMES, RUN_UAT_TOOL_PRESENTATION_PLAN_ID, RUN_UAT_WORKFLOW_TOOL_NAMES, } from "./unit-tool-contracts.js";
|
|
4
|
+
import { uatTypeIncludesBrowser } from "./uat-policy.js";
|
|
4
5
|
export { RUN_UAT_BROWSER_TOOL_NAMES, RUN_UAT_READ_ONLY_TOOL_NAMES, RUN_UAT_TOOL_PRESENTATION_PLAN_ID, RUN_UAT_WORKFLOW_TOOL_NAMES, } from "./unit-tool-contracts.js";
|
|
5
6
|
export const RUN_UAT_FORBIDDEN_TOOL_NAMES = [
|
|
6
7
|
"edit",
|
|
@@ -81,15 +82,6 @@ export function buildRunUatCanonicalToolNames(options = {}) {
|
|
|
81
82
|
// `human-experience` is told to capture screenshots. Without this, a webpage
|
|
82
83
|
// UAT classified as anything but `browser-executable` had no browser tools and
|
|
83
84
|
// downgraded its live checks to NEEDS-HUMAN (M001/S03 regression).
|
|
84
|
-
export const BROWSER_INCLUSIVE_UAT_TYPES = [
|
|
85
|
-
"browser-executable",
|
|
86
|
-
"live-runtime",
|
|
87
|
-
"mixed",
|
|
88
|
-
"human-experience",
|
|
89
|
-
];
|
|
90
|
-
function uatTypeIncludesBrowser(uatType) {
|
|
91
|
-
return uatType !== undefined && BROWSER_INCLUSIVE_UAT_TYPES.includes(uatType);
|
|
92
|
-
}
|
|
93
85
|
export function runUatBrowserToolsForType(uatType) {
|
|
94
86
|
return uatTypeIncludesBrowser(uatType) ? RUN_UAT_BROWSER_TOOL_NAMES : [];
|
|
95
87
|
}
|
|
@@ -17,8 +17,8 @@ import { getGatesForTurn } from "../gate-registry.js";
|
|
|
17
17
|
import { gsdProjectionRoot, clearPathCache, resolveMilestoneFile } from "../paths.js";
|
|
18
18
|
import { resolveCanonicalMilestoneRoot } from "../worktree-manager.js";
|
|
19
19
|
import { checkOwnership, sliceUnitKey } from "../unit-ownership.js";
|
|
20
|
-
import { saveFile, clearParseCache
|
|
21
|
-
import {
|
|
20
|
+
import { saveFile, clearParseCache } from "../files.js";
|
|
21
|
+
import { getDeclaredUatType, shouldEscalateArtifactUatToBrowser } from "../uat-policy.js";
|
|
22
22
|
import { invalidateStateCache } from "../state.js";
|
|
23
23
|
import { renderRoadmapFromDb } from "../markdown-renderer.js";
|
|
24
24
|
import { parseRoadmap } from "../parsers-legacy.js";
|
|
@@ -275,7 +275,7 @@ export async function handleCompleteSlice(params, basePath) {
|
|
|
275
275
|
// Otherwise the browser checks get silently deferred to a human and the slice
|
|
276
276
|
// passes on static checks alone (M001/S03 regression). `browser-executable`,
|
|
277
277
|
// `live-runtime`, and `mixed` all receive browser tools (see
|
|
278
|
-
//
|
|
278
|
+
// UAT_MODE_POLICIES); only the non-browser modes are rejected here.
|
|
279
279
|
//
|
|
280
280
|
// Reuse the canonical hasBrowserRequiredText detector (also used by dispatch
|
|
281
281
|
// and milestone validation): it skips Not-Proven/Out-of-Scope disclaimer
|
|
@@ -287,9 +287,10 @@ export async function handleCompleteSlice(params, basePath) {
|
|
|
287
287
|
// genuinely defers verification to a human. Every other mode has a real
|
|
288
288
|
// verification path: `runtime-executable` runs browser test commands like
|
|
289
289
|
// `npx playwright test` via gsd_uat_exec, and live-runtime/mixed/
|
|
290
|
-
// browser-executable receive browser tools (
|
|
291
|
-
const
|
|
292
|
-
|
|
290
|
+
// browser-executable receive browser tools (UAT_MODE_POLICIES).
|
|
291
|
+
const uatContent = params.uatContent || "";
|
|
292
|
+
const declaredUatMode = getDeclaredUatType(uatContent);
|
|
293
|
+
if (shouldEscalateArtifactUatToBrowser(uatContent)) {
|
|
293
294
|
return {
|
|
294
295
|
error: `UAT requires browser verification (opening a page in a browser, navigating to a page or localhost, screenshots) but declares "UAT mode: artifact-driven", which only runs static/file checks and would defer the browser work to a human. Use a mode that actually verifies the UI: "browser-executable" (interactive browser tools), "runtime-executable" (a browser test command such as playwright), or a browser-inclusive "mixed"/"live-runtime". Re-author the UAT Type section and complete the slice again.`,
|
|
295
296
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { existsSync, rmSync } from "node:fs";
|
|
2
|
-
import { join, relative } from "node:path";
|
|
2
|
+
import { join, relative, resolve } from "node:path";
|
|
3
3
|
import { clearParseCache } from "../files.js";
|
|
4
4
|
import { isClosedStatus, isDeferredStatus } from "../status-guards.js";
|
|
5
5
|
import { isNonEmptyString, validateStringArray } from "../validation.js";
|
|
6
|
+
import { getGateIdsForTurn } from "../gate-registry.js";
|
|
6
7
|
import { transaction, getMilestone, getSlice, getSliceTasks, insertTask, upsertSlicePlanning, upsertTaskPlanning, insertGateRow, updateSliceStatus, setSliceSketchFlag, deleteTask, deleteArtifactByPath, } from "../gsd-db.js";
|
|
7
8
|
import { invalidateStateCache } from "../state.js";
|
|
8
9
|
import { renderPlanFromDb } from "../markdown-renderer.js";
|
|
@@ -10,7 +11,7 @@ import { renderAllProjections } from "../workflow-projections.js";
|
|
|
10
11
|
import { writeManifest } from "../workflow-manifest.js";
|
|
11
12
|
import { appendEvent } from "../workflow-events.js";
|
|
12
13
|
import { logWarning } from "../workflow-logger.js";
|
|
13
|
-
import { validatePlanningPathScope } from "../planning-path-scope.js";
|
|
14
|
+
import { validatePathOnlyPlanningFields, validatePlanningPathScope } from "../planning-path-scope.js";
|
|
14
15
|
import { checkFilePathConsistency, checkTaskOrdering } from "../pre-execution-checks.js";
|
|
15
16
|
import { buildTaskFileName, gsdProjectionRoot } from "../paths.js";
|
|
16
17
|
import { loadEffectiveGSDPreferences } from "../preferences.js";
|
|
@@ -100,9 +101,24 @@ function validateParams(params) {
|
|
|
100
101
|
tasks: validateTasks(params.tasks),
|
|
101
102
|
};
|
|
102
103
|
}
|
|
103
|
-
function
|
|
104
|
+
function loadPlanningContext(basePath) {
|
|
104
105
|
const loaded = loadEffectiveGSDPreferences(basePath);
|
|
105
|
-
return
|
|
106
|
+
return {
|
|
107
|
+
repositoryRegistry: createRepositoryRegistryFromPreferences(basePath, loaded?.preferences),
|
|
108
|
+
gateEvaluation: loaded?.preferences?.gate_evaluation,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function resolveGateEvaluateSliceGates(config) {
|
|
112
|
+
const ownedGateIds = [...getGateIdsForTurn("gate-evaluate")];
|
|
113
|
+
if (!config?.slice_gates?.length)
|
|
114
|
+
return ownedGateIds;
|
|
115
|
+
const owned = new Set(ownedGateIds);
|
|
116
|
+
return config.slice_gates.filter((gateId) => owned.has(gateId));
|
|
117
|
+
}
|
|
118
|
+
function resolveTaskGates(config) {
|
|
119
|
+
if (config?.task_gates === false)
|
|
120
|
+
return [];
|
|
121
|
+
return [...getGateIdsForTurn("execute-task")];
|
|
106
122
|
}
|
|
107
123
|
function validateReferencedRepositories(params, registry, defaultTargets) {
|
|
108
124
|
const known = new Set(registry.repositories.map((repo) => repo.id));
|
|
@@ -171,11 +187,16 @@ function toTaskRows(params, defaultTargets) {
|
|
|
171
187
|
escalation_override_applied_at: null,
|
|
172
188
|
}));
|
|
173
189
|
}
|
|
174
|
-
function validateTaskPathsBeforePersist(params, basePath, defaultTargets) {
|
|
190
|
+
function validateTaskPathsBeforePersist(params, basePath, defaultTargets, allowedRoots) {
|
|
175
191
|
const taskRows = toTaskRows(params, defaultTargets);
|
|
192
|
+
const baseRoot = resolve(basePath);
|
|
193
|
+
const additionalRoots = allowedRoots
|
|
194
|
+
.map((root) => resolve(root))
|
|
195
|
+
.filter((root) => root !== baseRoot);
|
|
196
|
+
const context = additionalRoots.length > 0 ? { additionalRoots } : undefined;
|
|
176
197
|
const checks = [
|
|
177
|
-
...checkFilePathConsistency(taskRows, basePath),
|
|
178
|
-
...checkTaskOrdering(taskRows, basePath),
|
|
198
|
+
...checkFilePathConsistency(taskRows, basePath, context),
|
|
199
|
+
...checkTaskOrdering(taskRows, basePath, context),
|
|
179
200
|
];
|
|
180
201
|
const blocking = checks.filter((check) => !check.passed && check.blocking);
|
|
181
202
|
if (blocking.length === 0)
|
|
@@ -193,8 +214,11 @@ export async function handlePlanSlice(rawParams, basePath) {
|
|
|
193
214
|
return { error: `validation failed: ${err.message}` };
|
|
194
215
|
}
|
|
195
216
|
let repositoryRegistry;
|
|
217
|
+
let gateEvaluation;
|
|
196
218
|
try {
|
|
197
|
-
|
|
219
|
+
const context = loadPlanningContext(basePath);
|
|
220
|
+
repositoryRegistry = context.repositoryRegistry;
|
|
221
|
+
gateEvaluation = context.gateEvaluation;
|
|
198
222
|
}
|
|
199
223
|
catch (err) {
|
|
200
224
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -206,6 +230,13 @@ export async function handlePlanSlice(rawParams, basePath) {
|
|
|
206
230
|
return { error: `validation failed: ${repoValidationError}` };
|
|
207
231
|
}
|
|
208
232
|
const allowedAbsoluteRoots = resolveAllowedRootsForPathScope(params, repositoryRegistry, defaultTargets);
|
|
233
|
+
const pathOnlyError = validatePathOnlyPlanningFields(params.tasks.map((task, index) => ({
|
|
234
|
+
field: `tasks[${index}].expectedOutput`,
|
|
235
|
+
values: task.expectedOutput,
|
|
236
|
+
})));
|
|
237
|
+
if (pathOnlyError) {
|
|
238
|
+
return { error: `validation failed: ${pathOnlyError}` };
|
|
239
|
+
}
|
|
209
240
|
const pathScopeError = validatePlanningPathScope(basePath, params.tasks.flatMap((task, index) => [
|
|
210
241
|
{ field: `tasks[${index}].files`, values: task.files },
|
|
211
242
|
{ field: `tasks[${index}].inputs`, values: task.inputs },
|
|
@@ -214,7 +245,7 @@ export async function handlePlanSlice(rawParams, basePath) {
|
|
|
214
245
|
if (pathScopeError) {
|
|
215
246
|
return { error: `validation failed: ${pathScopeError}` };
|
|
216
247
|
}
|
|
217
|
-
const pathError = validateTaskPathsBeforePersist(params, basePath, defaultTargets);
|
|
248
|
+
const pathError = validateTaskPathsBeforePersist(params, basePath, defaultTargets, allowedAbsoluteRoots);
|
|
218
249
|
if (pathError) {
|
|
219
250
|
return { error: `pre-execution validation failed:\n${pathError}` };
|
|
220
251
|
}
|
|
@@ -296,11 +327,11 @@ export async function handlePlanSlice(rawParams, basePath) {
|
|
|
296
327
|
}
|
|
297
328
|
// Seed quality gate rows inside the transaction — all-or-nothing with
|
|
298
329
|
// the plan data so a crash can't leave orphaned gates without tasks.
|
|
299
|
-
const sliceGates =
|
|
330
|
+
const sliceGates = resolveGateEvaluateSliceGates(gateEvaluation);
|
|
300
331
|
for (const gid of sliceGates) {
|
|
301
332
|
insertGateRow({ milestoneId: params.milestoneId, sliceId: params.sliceId, gateId: gid, scope: "slice" });
|
|
302
333
|
}
|
|
303
|
-
const taskGates =
|
|
334
|
+
const taskGates = resolveTaskGates(gateEvaluation);
|
|
304
335
|
for (const task of params.tasks) {
|
|
305
336
|
for (const gid of taskGates) {
|
|
306
337
|
insertGateRow({ milestoneId: params.milestoneId, sliceId: params.sliceId, gateId: gid, scope: "task", taskId: task.taskId });
|
|
@@ -8,7 +8,7 @@ import { renderAllProjections } from "../workflow-projections.js";
|
|
|
8
8
|
import { writeManifest } from "../workflow-manifest.js";
|
|
9
9
|
import { appendEvent } from "../workflow-events.js";
|
|
10
10
|
import { logWarning } from "../workflow-logger.js";
|
|
11
|
-
import { validatePlanningPathScope } from "../planning-path-scope.js";
|
|
11
|
+
import { validatePathOnlyPlanningFields, validatePlanningPathScope } from "../planning-path-scope.js";
|
|
12
12
|
function validateParams(params) {
|
|
13
13
|
if (!isNonEmptyString(params?.milestoneId))
|
|
14
14
|
throw new Error("milestoneId is required");
|
|
@@ -42,6 +42,12 @@ export async function handlePlanTask(rawParams, basePath) {
|
|
|
42
42
|
catch (err) {
|
|
43
43
|
return { error: `validation failed: ${err.message}` };
|
|
44
44
|
}
|
|
45
|
+
const pathOnlyError = validatePathOnlyPlanningFields([
|
|
46
|
+
{ field: "expectedOutput", values: params.expectedOutput },
|
|
47
|
+
]);
|
|
48
|
+
if (pathOnlyError) {
|
|
49
|
+
return { error: `validation failed: ${pathOnlyError}` };
|
|
50
|
+
}
|
|
45
51
|
const pathScopeError = validatePlanningPathScope(basePath, [
|
|
46
52
|
{ field: "files", values: params.files },
|
|
47
53
|
{ field: "inputs", values: params.inputs },
|