gsd-pi 2.80.0-dev.c5f2443b3 → 2.80.0-dev.d4fc28e6b
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 +4 -2
- package/dist/cli.js +0 -19
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/GSD-WORKFLOW.md +2 -2
- package/dist/resources/extensions/claude-code-cli/stream-adapter.js +29 -0
- package/dist/resources/extensions/github-sync/templates.js +39 -8
- package/dist/resources/extensions/gsd/auto/loop.js +119 -18
- package/dist/resources/extensions/gsd/auto/phases.js +212 -135
- package/dist/resources/extensions/gsd/auto/resolve.js +29 -0
- package/dist/resources/extensions/gsd/auto/run-unit.js +41 -45
- package/dist/resources/extensions/gsd/auto/session.js +8 -0
- package/dist/resources/extensions/gsd/auto/workflow-dispatch-claim.js +33 -1
- package/dist/resources/extensions/gsd/auto/workflow-worker-heartbeat.js +9 -1
- package/dist/resources/extensions/gsd/auto-dashboard.js +51 -15
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +5 -32
- package/dist/resources/extensions/gsd/auto-dispatch.js +26 -0
- package/dist/resources/extensions/gsd/auto-post-unit.js +27 -14
- package/dist/resources/extensions/gsd/auto-prompts.js +214 -17
- package/dist/resources/extensions/gsd/auto-recovery.js +197 -9
- package/dist/resources/extensions/gsd/auto-start.js +199 -9
- package/dist/resources/extensions/gsd/auto-supervisor.js +8 -1
- package/dist/resources/extensions/gsd/auto-timeout-recovery.js +2 -2
- package/dist/resources/extensions/gsd/auto-worktree.js +111 -1
- package/dist/resources/extensions/gsd/auto.js +95 -27
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +103 -3
- package/dist/resources/extensions/gsd/bootstrap/db-tools.js +49 -36
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +15 -5
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +33 -20
- package/dist/resources/extensions/gsd/bootstrap/journal-tools.js +7 -1
- package/dist/resources/extensions/gsd/bootstrap/memory-tools.js +9 -3
- package/dist/resources/extensions/gsd/bootstrap/query-tools.js +8 -2
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +330 -55
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +82 -23
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +129 -1
- package/dist/resources/extensions/gsd/clean-root-preflight.js +65 -9
- package/dist/resources/extensions/gsd/commands/dispatcher.js +5 -0
- package/dist/resources/extensions/gsd/commands-extract-learnings.js +17 -12
- package/dist/resources/extensions/gsd/commands-handlers.js +23 -9
- package/dist/resources/extensions/gsd/context-budget.js +37 -2
- package/dist/resources/extensions/gsd/crash-recovery.js +56 -10
- package/dist/resources/extensions/gsd/custom-workflow-engine.js +22 -2
- package/dist/resources/extensions/gsd/db/unit-dispatches.js +92 -0
- package/dist/resources/extensions/gsd/db-base-schema.js +18 -2
- package/dist/resources/extensions/gsd/db-migration-steps.js +22 -0
- package/dist/resources/extensions/gsd/detection.js +106 -0
- package/dist/resources/extensions/gsd/ecosystem/gsd-extension-api.js +2 -0
- package/dist/resources/extensions/gsd/git-service.js +36 -4
- package/dist/resources/extensions/gsd/graph.js +9 -3
- package/dist/resources/extensions/gsd/gsd-db.js +146 -13
- package/dist/resources/extensions/gsd/guided-flow.js +129 -44
- package/dist/resources/extensions/gsd/memory-store.js +69 -12
- package/dist/resources/extensions/gsd/migrate/command.js +40 -1
- package/dist/resources/extensions/gsd/migration-auto-check.js +87 -0
- package/dist/resources/extensions/gsd/native-git-bridge.js +32 -8
- package/dist/resources/extensions/gsd/orphan-stash-audit.js +101 -0
- package/dist/resources/extensions/gsd/parallel-orchestrator.js +13 -3
- package/dist/resources/extensions/gsd/planning-path-scope.js +26 -0
- package/dist/resources/extensions/gsd/pr-evidence.js +57 -16
- package/dist/resources/extensions/gsd/pre-execution-checks.js +22 -0
- package/dist/resources/extensions/gsd/prompt-loader.js +28 -2
- package/dist/resources/extensions/gsd/prompts/complete-milestone.md +21 -19
- package/dist/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/execute-task.md +4 -2
- package/dist/resources/extensions/gsd/prompts/parallel-research-slices.md +1 -1
- package/dist/resources/extensions/gsd/prompts/plan-milestone.md +3 -1
- package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/dist/resources/extensions/gsd/prompts/quick-task.md +1 -5
- package/dist/resources/extensions/gsd/prompts/replan-slice.md +2 -2
- package/dist/resources/extensions/gsd/prompts/validate-milestone.md +2 -2
- package/dist/resources/extensions/gsd/quick.js +34 -2
- package/dist/resources/extensions/gsd/safety/evidence-collector.js +10 -2
- package/dist/resources/extensions/gsd/tools/context-mode-tool-result.js +15 -0
- package/dist/resources/extensions/gsd/tools/exec-search-tool.js +5 -0
- package/dist/resources/extensions/gsd/tools/exec-tool.js +3 -15
- package/dist/resources/extensions/gsd/tools/memory-tools.js +1 -0
- package/dist/resources/extensions/gsd/tools/plan-slice.js +9 -0
- package/dist/resources/extensions/gsd/tools/plan-task.js +9 -0
- package/dist/resources/extensions/gsd/tools/resume-tool.js +5 -0
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +1 -1
- package/dist/resources/extensions/gsd/unit-context-composer.js +12 -3
- package/dist/resources/extensions/gsd/unit-runtime.js +22 -0
- package/dist/resources/extensions/gsd/workflow-protocol.js +131 -0
- package/dist/resources/extensions/gsd/working-output-messages.js +64 -0
- package/dist/resources/extensions/gsd/worktree-manager.js +16 -14
- package/dist/resources/extensions/gsd/worktree-resolver.js +68 -21
- 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 +3 -3
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/react-loadable-manifest.json +1 -1
- 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/api/onboarding/route.js +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/6897.js +3 -3
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/middleware-react-loadable-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/.next/static/chunks/{8336.6f6f30e410419aff.js → 8336.631939fb583761fa.js} +1 -1
- package/dist/web/standalone/.next/static/chunks/{webpack-d82dbee6356c1733.js → webpack-0481f1221120a7c6.js} +1 -1
- package/dist/welcome-screen.d.ts +2 -0
- package/dist/welcome-screen.js +9 -7
- package/package.json +12 -8
- package/packages/contracts/package.json +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +22 -17
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/src/workflow-tools.test.ts +75 -2
- package/packages/mcp-server/src/workflow-tools.ts +30 -16
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent-loop.js +4 -1
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/dist/agent.d.ts +5 -0
- 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/dist/index.d.ts +1 -0
- package/packages/pi-agent-core/dist/index.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/index.js +2 -0
- package/packages/pi-agent-core/dist/index.js.map +1 -1
- package/packages/pi-agent-core/dist/token-audit.d.ts +47 -0
- package/packages/pi-agent-core/dist/token-audit.d.ts.map +1 -0
- package/packages/pi-agent-core/dist/token-audit.js +221 -0
- package/packages/pi-agent-core/dist/token-audit.js.map +1 -0
- package/packages/pi-agent-core/dist/types.d.ts +9 -0
- package/packages/pi-agent-core/dist/types.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/types.js.map +1 -1
- package/packages/pi-agent-core/src/agent-loop.test.ts +128 -0
- package/packages/pi-agent-core/src/agent-loop.ts +4 -1
- package/packages/pi-agent-core/src/agent.ts +8 -0
- package/packages/pi-agent-core/src/index.ts +2 -0
- package/packages/pi-agent-core/src/token-audit.test.ts +189 -0
- package/packages/pi-agent-core/src/token-audit.ts +287 -0
- package/packages/pi-agent-core/src/types.ts +14 -0
- package/packages/pi-agent-core/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-ai/dist/models/fake-model.d.ts +12 -0
- package/packages/pi-ai/dist/models/fake-model.d.ts.map +1 -0
- package/packages/pi-ai/dist/models/fake-model.js +27 -0
- package/packages/pi-ai/dist/models/fake-model.js.map +1 -0
- package/packages/pi-ai/dist/models/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/models/index.js +8 -0
- package/packages/pi-ai/dist/models/index.js.map +1 -1
- package/packages/pi-ai/dist/providers/fake.d.ts +42 -0
- package/packages/pi-ai/dist/providers/fake.d.ts.map +1 -0
- package/packages/pi-ai/dist/providers/fake.js +319 -0
- package/packages/pi-ai/dist/providers/fake.js.map +1 -0
- package/packages/pi-ai/dist/providers/register-builtins.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/register-builtins.js +24 -0
- package/packages/pi-ai/dist/providers/register-builtins.js.map +1 -1
- package/packages/pi-ai/src/models/fake-model.ts +30 -0
- package/packages/pi-ai/src/models/index.ts +9 -0
- package/packages/pi-ai/src/providers/fake.ts +376 -0
- package/packages/pi-ai/src/providers/register-builtins.ts +23 -0
- package/packages/pi-ai/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js +32 -0
- package/packages/pi-coding-agent/dist/core/agent-session-abort-order.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.js +18 -0
- package/packages/pi-coding-agent/dist/core/agent-session-tool-refresh.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts +12 -0
- package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/agent-session.js +44 -7
- package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js +76 -0
- package/packages/pi-coding-agent/dist/core/chat-controller-ordering.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts +11 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js +9 -0
- package/packages/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.js +103 -0
- package/packages/pi-coding-agent/dist/core/compaction-threshold.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts +15 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.js +66 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.js +24 -0
- package/packages/pi-coding-agent/dist/core/db-snapshot.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/loader.js +8 -0
- package/packages/pi-coding-agent/dist/core/extensions/loader.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts +5 -0
- package/packages/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.js +20 -7
- package/packages/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js +102 -3
- package/packages/pi-coding-agent/dist/core/extensions/runner.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts +39 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.js +2 -0
- package/packages/pi-coding-agent/dist/core/hooks-runner.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/model-registry.js +5 -0
- package/packages/pi-coding-agent/dist/core/model-registry.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.js +46 -0
- package/packages/pi-coding-agent/dist/core/sdk-tool-filter.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/core/sdk.d.ts +10 -2
- package/packages/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/sdk.js +74 -2
- package/packages/pi-coding-agent/dist/core/sdk.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts +24 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/settings-manager.js +33 -0
- package/packages/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js +22 -0
- package/packages/pi-coding-agent/dist/core/skill-tool.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/slash-commands.js +1 -0
- package/packages/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts +6 -7
- package/packages/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/core/system-prompt.js +2 -3
- package/packages/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js +6 -4
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js +54 -15
- package/packages/pi-coding-agent/dist/modes/interactive/components/__tests__/tool-execution.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts +26 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js +112 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js +51 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/adaptive-layout.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js +10 -9
- package/packages/pi-coding-agent/dist/modes/interactive/components/chat-frame.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +3 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +11 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js +7 -6
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts +17 -0
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +109 -17
- package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js +69 -2
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js +93 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/chat-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/controllers/input-controller.test.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode-state.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +3 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +26 -0
- package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js +20 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.js +79 -0
- package/packages/pi-coding-agent/dist/modes/interactive/slash-command-handlers.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts +12 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js +13 -0
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme-schema.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +18 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js +36 -27
- package/packages/pi-coding-agent/dist/modes/interactive/theme/themes.js.map +1 -1
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.d.ts +11 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.js +18 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.js.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js +48 -0
- package/packages/pi-coding-agent/dist/modes/interactive/tui-mode.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts +2 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.d.ts.map +1 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js +10 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage-safety-guard.test.js.map +1 -0
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.d.ts.map +1 -1
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js +3 -2
- package/packages/pi-coding-agent/dist/resources/extensions/memory/storage.js.map +1 -1
- package/packages/pi-coding-agent/src/core/agent-session-abort-order.test.ts +36 -0
- package/packages/pi-coding-agent/src/core/agent-session-tool-refresh.test.ts +25 -0
- package/packages/pi-coding-agent/src/core/agent-session.ts +48 -7
- package/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +89 -0
- package/packages/pi-coding-agent/src/core/compaction/compaction.ts +18 -0
- package/packages/pi-coding-agent/src/core/compaction-threshold.test.ts +121 -0
- package/packages/pi-coding-agent/src/core/db-snapshot.test.ts +32 -0
- package/packages/pi-coding-agent/src/core/db-snapshot.ts +66 -0
- package/packages/pi-coding-agent/src/core/extensions/loader.ts +10 -0
- package/packages/pi-coding-agent/src/core/extensions/runner.test.ts +113 -3
- package/packages/pi-coding-agent/src/core/extensions/runner.ts +24 -6
- package/packages/pi-coding-agent/src/core/extensions/types.ts +42 -1
- package/packages/pi-coding-agent/src/core/hooks-runner.test.ts +2 -0
- package/packages/pi-coding-agent/src/core/model-registry.ts +4 -0
- package/packages/pi-coding-agent/src/core/sdk-tool-filter.test.ts +60 -0
- package/packages/pi-coding-agent/src/core/sdk.ts +85 -3
- package/packages/pi-coding-agent/src/core/settings-manager.ts +51 -1
- package/packages/pi-coding-agent/src/core/skill-tool.test.ts +28 -0
- package/packages/pi-coding-agent/src/core/slash-commands.ts +1 -0
- package/packages/pi-coding-agent/src/core/system-prompt.ts +8 -10
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/chat-frame-compaction-tone.test.ts +7 -5
- package/packages/pi-coding-agent/src/modes/interactive/components/__tests__/tool-execution.test.ts +78 -15
- package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.test.ts +59 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/adaptive-layout.ts +160 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/assistant-message.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/chat-frame.ts +10 -9
- package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +15 -0
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-card-cleanup-and-success-runtime.test.ts +10 -9
- package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +122 -17
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.test.ts +99 -1
- package/packages/pi-coding-agent/src/modes/interactive/controllers/chat-controller.ts +92 -3
- package/packages/pi-coding-agent/src/modes/interactive/controllers/input-controller.test.ts +1 -0
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode-state.ts +1 -1
- package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +28 -0
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.test.ts +95 -0
- package/packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts +24 -1
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme-schema.ts +13 -0
- package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +32 -2
- package/packages/pi-coding-agent/src/modes/interactive/theme/themes.ts +36 -27
- package/packages/pi-coding-agent/src/modes/interactive/tui-mode.test.ts +65 -0
- package/packages/pi-coding-agent/src/modes/interactive/tui-mode.ts +29 -0
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage-safety-guard.test.ts +14 -0
- package/packages/pi-coding-agent/src/resources/extensions/memory/storage.ts +3 -2
- package/packages/pi-coding-agent/tsconfig.tsbuildinfo +1 -1
- package/packages/pi-tui/dist/__tests__/style.test.d.ts +2 -0
- package/packages/pi-tui/dist/__tests__/style.test.d.ts.map +1 -0
- package/packages/pi-tui/dist/__tests__/style.test.js +63 -0
- package/packages/pi-tui/dist/__tests__/style.test.js.map +1 -0
- package/packages/pi-tui/dist/__tests__/tui.test.js +24 -3
- package/packages/pi-tui/dist/__tests__/tui.test.js.map +1 -1
- package/packages/pi-tui/dist/index.d.ts +1 -0
- package/packages/pi-tui/dist/index.d.ts.map +1 -1
- package/packages/pi-tui/dist/index.js +2 -0
- package/packages/pi-tui/dist/index.js.map +1 -1
- package/packages/pi-tui/dist/style.d.ts +41 -0
- package/packages/pi-tui/dist/style.d.ts.map +1 -0
- package/packages/pi-tui/dist/style.js +158 -0
- package/packages/pi-tui/dist/style.js.map +1 -0
- package/packages/pi-tui/dist/tui.d.ts +0 -1
- package/packages/pi-tui/dist/tui.d.ts.map +1 -1
- package/packages/pi-tui/dist/tui.js +21 -16
- package/packages/pi-tui/dist/tui.js.map +1 -1
- package/packages/pi-tui/src/__tests__/style.test.ts +76 -0
- package/packages/pi-tui/src/__tests__/tui.test.ts +29 -3
- package/packages/pi-tui/src/index.ts +9 -0
- package/packages/pi-tui/src/style.ts +225 -0
- package/packages/pi-tui/src/tui.ts +23 -16
- package/packages/pi-tui/tsconfig.tsbuildinfo +1 -1
- package/pkg/dist/modes/interactive/theme/theme-schema.d.ts +12 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme-schema.js +13 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/theme.js +18 -1
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.d.ts.map +1 -1
- package/pkg/dist/modes/interactive/theme/themes.js +36 -27
- package/pkg/dist/modes/interactive/theme/themes.js.map +1 -1
- package/src/resources/GSD-WORKFLOW.md +2 -2
- package/src/resources/extensions/claude-code-cli/stream-adapter.ts +30 -0
- package/src/resources/extensions/claude-code-cli/tests/stream-adapter.test.ts +26 -0
- package/src/resources/extensions/github-sync/templates.ts +38 -8
- package/src/resources/extensions/github-sync/tests/inline-code.test.ts +66 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +3 -2
- package/src/resources/extensions/gsd/auto/loop.ts +151 -26
- package/src/resources/extensions/gsd/auto/phases.ts +289 -196
- package/src/resources/extensions/gsd/auto/resolve.ts +42 -1
- package/src/resources/extensions/gsd/auto/run-unit.ts +52 -44
- package/src/resources/extensions/gsd/auto/session.ts +8 -0
- package/src/resources/extensions/gsd/auto/workflow-dispatch-claim.ts +63 -1
- package/src/resources/extensions/gsd/auto/workflow-worker-heartbeat.ts +14 -1
- package/src/resources/extensions/gsd/auto-dashboard.ts +57 -8
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +8 -34
- package/src/resources/extensions/gsd/auto-dispatch.ts +33 -0
- package/src/resources/extensions/gsd/auto-post-unit.ts +28 -14
- package/src/resources/extensions/gsd/auto-prompts.ts +228 -16
- package/src/resources/extensions/gsd/auto-recovery.ts +207 -7
- package/src/resources/extensions/gsd/auto-start.ts +237 -15
- package/src/resources/extensions/gsd/auto-supervisor.ts +7 -0
- package/src/resources/extensions/gsd/auto-timeout-recovery.ts +2 -2
- package/src/resources/extensions/gsd/auto-worktree.ts +123 -0
- package/src/resources/extensions/gsd/auto.ts +110 -22
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +119 -2
- package/src/resources/extensions/gsd/bootstrap/db-tools.ts +50 -36
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +16 -5
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +34 -19
- package/src/resources/extensions/gsd/bootstrap/journal-tools.ts +8 -1
- package/src/resources/extensions/gsd/bootstrap/memory-tools.ts +10 -3
- package/src/resources/extensions/gsd/bootstrap/query-tools.ts +9 -2
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +386 -55
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +90 -22
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +135 -1
- package/src/resources/extensions/gsd/clean-root-preflight.ts +72 -9
- package/src/resources/extensions/gsd/commands/dispatcher.ts +6 -0
- package/src/resources/extensions/gsd/commands-extract-learnings.ts +17 -12
- package/src/resources/extensions/gsd/commands-handlers.ts +34 -15
- package/src/resources/extensions/gsd/context-budget.ts +44 -2
- package/src/resources/extensions/gsd/crash-recovery.ts +67 -10
- package/src/resources/extensions/gsd/custom-workflow-engine.ts +24 -1
- package/src/resources/extensions/gsd/db/unit-dispatches.ts +107 -0
- package/src/resources/extensions/gsd/db-base-schema.ts +19 -2
- package/src/resources/extensions/gsd/db-migration-steps.ts +25 -0
- package/src/resources/extensions/gsd/detection.ts +128 -0
- package/src/resources/extensions/gsd/ecosystem/gsd-extension-api.ts +3 -0
- package/src/resources/extensions/gsd/git-service.ts +46 -8
- package/src/resources/extensions/gsd/graph.ts +12 -5
- package/src/resources/extensions/gsd/gsd-db.ts +168 -13
- package/src/resources/extensions/gsd/guided-flow.ts +150 -51
- package/src/resources/extensions/gsd/memory-store.ts +77 -12
- package/src/resources/extensions/gsd/migrate/command.ts +47 -1
- package/src/resources/extensions/gsd/migration-auto-check.ts +129 -0
- package/src/resources/extensions/gsd/native-git-bridge.ts +39 -6
- package/src/resources/extensions/gsd/orphan-stash-audit.ts +117 -0
- package/src/resources/extensions/gsd/parallel-orchestrator.ts +13 -3
- package/src/resources/extensions/gsd/planning-path-scope.ts +35 -0
- package/src/resources/extensions/gsd/pr-evidence.ts +63 -5
- package/src/resources/extensions/gsd/pre-execution-checks.ts +23 -0
- package/src/resources/extensions/gsd/preferences-types.ts +1 -1
- package/src/resources/extensions/gsd/prompt-loader.ts +27 -2
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +21 -19
- package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/execute-task.md +4 -2
- package/src/resources/extensions/gsd/prompts/parallel-research-slices.md +1 -1
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +3 -1
- package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
- package/src/resources/extensions/gsd/prompts/quick-task.md +1 -5
- package/src/resources/extensions/gsd/prompts/replan-slice.md +2 -2
- package/src/resources/extensions/gsd/prompts/validate-milestone.md +2 -2
- package/src/resources/extensions/gsd/quick.ts +37 -2
- package/src/resources/extensions/gsd/safety/evidence-collector.ts +11 -2
- package/src/resources/extensions/gsd/tests/artifact-retry-cap.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/auto-abort-pause-regression.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/auto-dashboard.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/auto-loop.test.ts +516 -15
- package/src/resources/extensions/gsd/tests/auto-phases-lifecycle.test.ts +56 -13
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +184 -2
- package/src/resources/extensions/gsd/tests/auto-wrapup-inflight-guard.test.ts +168 -6
- package/src/resources/extensions/gsd/tests/clean-root-preflight.test.ts +97 -2
- package/src/resources/extensions/gsd/tests/commands-extract-learnings.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/compaction-snapshot.test.ts +14 -1
- package/src/resources/extensions/gsd/tests/complete-milestone-excerpt.test.ts +31 -0
- package/src/resources/extensions/gsd/tests/complete-slice-composer.test.ts +3 -2
- package/src/resources/extensions/gsd/tests/context-budget.test.ts +10 -1
- package/src/resources/extensions/gsd/tests/context-store.test.ts +7 -1
- package/src/resources/extensions/gsd/tests/crash-handler-secondary.test.ts +55 -0
- package/src/resources/extensions/gsd/tests/crash-recovery-via-db.test.ts +22 -0
- package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +117 -7
- package/src/resources/extensions/gsd/tests/custom-workflow-engine.test.ts +40 -2
- package/src/resources/extensions/gsd/tests/db-migration-steps.integration.test.ts +428 -0
- package/src/resources/extensions/gsd/tests/db-schema-metadata.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/detection.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/dispatch-rule-coverage.test.ts +313 -0
- package/src/resources/extensions/gsd/tests/exec-history.test.ts +15 -0
- package/src/resources/extensions/gsd/tests/exec-sandbox.test.ts +65 -0
- package/src/resources/extensions/gsd/tests/execute-task-rendering.test.ts +5 -2
- package/src/resources/extensions/gsd/tests/fast-forward-reused-milestone-branch.test.ts +219 -0
- package/src/resources/extensions/gsd/tests/finalize-survivor-branch.test.ts +132 -0
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/commands-ship-basic.md +52 -0
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/commands-ship-empty-optionals.md +42 -0
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-no-blockers.md +55 -0
- package/src/resources/extensions/gsd/tests/fixtures/pr-body/swarm-lane-with-blockers.md +60 -0
- package/src/resources/extensions/gsd/tests/graph-operations.test.ts +10 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +44 -0
- package/src/resources/extensions/gsd/tests/has-pending-deep-stage.test.ts +33 -1
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +54 -0
- package/src/resources/extensions/gsd/tests/isolation-none-branch-guard.test.ts +6 -3
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +239 -1
- package/src/resources/extensions/gsd/tests/journal-query-tool.test.ts +32 -0
- package/src/resources/extensions/gsd/tests/knowledge.test.ts +47 -0
- package/src/resources/extensions/gsd/tests/memory-decay-factor.test.ts +90 -0
- package/src/resources/extensions/gsd/tests/merge-conflict-stops-loop.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +48 -0
- package/src/resources/extensions/gsd/tests/migration-auto-check.test.ts +127 -0
- package/src/resources/extensions/gsd/tests/milestone-merge-stash-restore.test.ts +242 -0
- package/src/resources/extensions/gsd/tests/native-git-bridge-exec-fallback.test.ts +34 -2
- package/src/resources/extensions/gsd/tests/originalbase-path-comparison.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/orphan-merge-bootstrap.test.ts +133 -0
- package/src/resources/extensions/gsd/tests/orphan-stash-audit.test.ts +201 -0
- package/src/resources/extensions/gsd/tests/parallel-orchestrator-fast-forward.test.ts +113 -0
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +50 -0
- package/src/resources/extensions/gsd/tests/plan-task.test.ts +21 -0
- package/src/resources/extensions/gsd/tests/pr-evidence-equivalence.test.ts +102 -0
- package/src/resources/extensions/gsd/tests/pr-evidence-hardening.test.ts +165 -0
- package/src/resources/extensions/gsd/tests/pre-execution-checks.test.ts +45 -5
- package/src/resources/extensions/gsd/tests/prompt-duplication-cuts.test.ts +230 -0
- package/src/resources/extensions/gsd/tests/prompt-path-audit.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/prompt-step-ordering.test.ts +19 -0
- package/src/resources/extensions/gsd/tests/query-tools-db-open.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/quick-external-gsd.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/restore-tools-after-discuss.test.ts +38 -17
- package/src/resources/extensions/gsd/tests/right-sized-workflow-prompts.test.ts +192 -0
- package/src/resources/extensions/gsd/tests/safety-harness-false-positives.test.ts +29 -0
- package/src/resources/extensions/gsd/tests/schema-v27-v28-sequence.test.ts +156 -0
- package/src/resources/extensions/gsd/tests/select-resumable-milestone.test.ts +96 -0
- package/src/resources/extensions/gsd/tests/session-start-footer.test.ts +77 -0
- package/src/resources/extensions/gsd/tests/session-switch-abort-misclassification.test.ts +166 -0
- package/src/resources/extensions/gsd/tests/signal-handlers.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/smart-entry-complete.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/stalled-tool-recovery.test.ts +49 -1
- package/src/resources/extensions/gsd/tests/start-auto-detached.test.ts +101 -2
- package/src/resources/extensions/gsd/tests/state-corruption-2945.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/status-db-open.test.ts +9 -0
- package/src/resources/extensions/gsd/tests/system-context-memory.test.ts +112 -0
- package/src/resources/extensions/gsd/tests/system-context-message-routing.test.ts +7 -9
- package/src/resources/extensions/gsd/tests/token-tool-gating.test.ts +291 -0
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +136 -4
- package/src/resources/extensions/gsd/tests/unit-dispatches.test.ts +80 -1
- package/src/resources/extensions/gsd/tests/unit-runtime.test.ts +37 -0
- package/src/resources/extensions/gsd/tests/unstructured-continue-context-injection.test.ts +5 -4
- package/src/resources/extensions/gsd/tests/uok-plan-v2-wiring.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/workflow-dispatch-claim.test.ts +142 -0
- package/src/resources/extensions/gsd/tests/workflow-protocol-excerpt.test.ts +99 -0
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/workflow-worker-heartbeat.test.ts +32 -1
- package/src/resources/extensions/gsd/tests/working-output-messages.test.ts +93 -0
- package/src/resources/extensions/gsd/tests/worktree-health-dispatch.test.ts +37 -6
- package/src/resources/extensions/gsd/tests/worktree-journal-events.test.ts +1 -0
- package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +7 -0
- package/src/resources/extensions/gsd/tests/worktree-nested-git-safety.test.ts +9 -2
- package/src/resources/extensions/gsd/tests/worktree-path-injection.test.ts +22 -19
- package/src/resources/extensions/gsd/tests/worktree-project-root-degrade.test.ts +66 -0
- package/src/resources/extensions/gsd/tests/worktree-resolver.test.ts +167 -4
- package/src/resources/extensions/gsd/tests/worktree-write-gate.test.ts +179 -0
- package/src/resources/extensions/gsd/tools/context-mode-tool-result.ts +25 -0
- package/src/resources/extensions/gsd/tools/exec-search-tool.ts +7 -7
- package/src/resources/extensions/gsd/tools/exec-tool.ts +4 -23
- package/src/resources/extensions/gsd/tools/memory-tools.ts +1 -0
- package/src/resources/extensions/gsd/tools/plan-slice.ts +13 -0
- package/src/resources/extensions/gsd/tools/plan-task.ts +10 -0
- package/src/resources/extensions/gsd/tools/resume-tool.ts +7 -7
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +1 -1
- package/src/resources/extensions/gsd/unit-context-composer.ts +19 -4
- package/src/resources/extensions/gsd/unit-runtime.ts +25 -0
- package/src/resources/extensions/gsd/workflow-protocol.ts +160 -0
- package/src/resources/extensions/gsd/working-output-messages.ts +120 -0
- package/src/resources/extensions/gsd/worktree-manager.ts +15 -4
- package/src/resources/extensions/gsd/worktree-resolver.ts +85 -19
- package/packages/contracts/tsconfig.tsbuildinfo +0 -1
- package/src/resources/extensions/gsd/tests/phases-merge-error-stops-auto.test.ts +0 -97
- /package/dist/web/standalone/.next/static/{bQDK5_LtkGVS64AirQgQG → cWaxzf-sdbSSbbwYu8q7a}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{bQDK5_LtkGVS64AirQgQG → cWaxzf-sdbSSbbwYu8q7a}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// GSD-2 + src/resources/extensions/gsd/tests/parallel-orchestrator-fast-forward.test.ts
|
|
2
|
+
// Regression: parallel-orchestrator's `_createMilestoneWorktree` must
|
|
3
|
+
// fast-forward a reused milestone branch onto integration before creating
|
|
4
|
+
// the worktree, matching the behavior added to the auto-mode path in
|
|
5
|
+
// commit 8996cb68e (#5549 post-merge audit, R3).
|
|
6
|
+
|
|
7
|
+
import { describe, test, beforeEach, afterEach } from "node:test";
|
|
8
|
+
import assert from "node:assert/strict";
|
|
9
|
+
import { execFileSync } from "node:child_process";
|
|
10
|
+
import { mkdtempSync, rmSync, writeFileSync, mkdirSync } from "node:fs";
|
|
11
|
+
import { tmpdir } from "node:os";
|
|
12
|
+
import { join } from "node:path";
|
|
13
|
+
|
|
14
|
+
import { _createMilestoneWorktree } from "../parallel-orchestrator.js";
|
|
15
|
+
|
|
16
|
+
const NO_PROMPT_ENV = {
|
|
17
|
+
...process.env,
|
|
18
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
19
|
+
GIT_AUTHOR_NAME: "test",
|
|
20
|
+
GIT_AUTHOR_EMAIL: "test@example.com",
|
|
21
|
+
GIT_COMMITTER_NAME: "test",
|
|
22
|
+
GIT_COMMITTER_EMAIL: "test@example.com",
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
function git(cwd: string, ...args: string[]): string {
|
|
26
|
+
return execFileSync("git", args, {
|
|
27
|
+
cwd,
|
|
28
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
29
|
+
encoding: "utf-8",
|
|
30
|
+
env: NO_PROMPT_ENV,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function rev(cwd: string, ref: string): string {
|
|
35
|
+
return git(cwd, "rev-parse", ref).trim();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
describe("_createMilestoneWorktree fast-forwards reused milestone branches (#5549 R3)", () => {
|
|
39
|
+
let repo: string;
|
|
40
|
+
|
|
41
|
+
beforeEach(() => {
|
|
42
|
+
repo = mkdtempSync(join(tmpdir(), "parallel-orch-ff-"));
|
|
43
|
+
git(repo, "init", "-q", "-b", "main");
|
|
44
|
+
git(repo, "config", "user.email", "test@example.com");
|
|
45
|
+
git(repo, "config", "user.name", "test");
|
|
46
|
+
writeFileSync(join(repo, "seed.txt"), "seed\n");
|
|
47
|
+
git(repo, "add", "seed.txt");
|
|
48
|
+
git(repo, "commit", "-q", "-m", "initial");
|
|
49
|
+
// Minimal .gsd/ structure so syncGsdStateToWorktree doesn't crash on a
|
|
50
|
+
// bare repo. We don't care if it copies anything — only that the FF ran.
|
|
51
|
+
mkdirSync(join(repo, ".gsd"), { recursive: true });
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
afterEach(() => {
|
|
55
|
+
rmSync(repo, { recursive: true, force: true });
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test("reused milestone branch behind main is fast-forwarded before worktree creation", () => {
|
|
59
|
+
// Worker N drained M001 in a previous run, leaving milestone/M001 forked
|
|
60
|
+
// from old main. Worker N+1 picks up M002 — but the milestone/M002 branch
|
|
61
|
+
// was created from old main in a sibling run, so it's now N commits behind.
|
|
62
|
+
git(repo, "branch", "milestone/M002");
|
|
63
|
+
const m002Initial = rev(repo, "milestone/M002");
|
|
64
|
+
|
|
65
|
+
writeFileSync(join(repo, "seed.txt"), "main moved forward\n");
|
|
66
|
+
git(repo, "add", "seed.txt");
|
|
67
|
+
git(repo, "commit", "-q", "-m", "main advanced");
|
|
68
|
+
const mainTip = rev(repo, "main");
|
|
69
|
+
|
|
70
|
+
assert.notEqual(m002Initial, mainTip, "main must be ahead before the test");
|
|
71
|
+
|
|
72
|
+
// _createMilestoneWorktree may throw inside createWorktree/syncGsdStateToWorktree
|
|
73
|
+
// (e.g. if the worktree-manager has stricter requirements than this minimal
|
|
74
|
+
// repo provides). The fast-forward runs BEFORE those calls, so the branch
|
|
75
|
+
// ref should have moved regardless. Catch and assert on observable state.
|
|
76
|
+
try {
|
|
77
|
+
_createMilestoneWorktree(repo, "M002");
|
|
78
|
+
} catch {
|
|
79
|
+
// Fine — we only care that FF executed.
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
assert.equal(
|
|
83
|
+
rev(repo, "milestone/M002"),
|
|
84
|
+
mainTip,
|
|
85
|
+
"milestone/M002 must be fast-forwarded to main's tip before worktree is built",
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test("diverged milestone branch is NOT touched (would lose work)", () => {
|
|
90
|
+
git(repo, "checkout", "-q", "-b", "milestone/M002");
|
|
91
|
+
writeFileSync(join(repo, "wip.txt"), "milestone-only work\n");
|
|
92
|
+
git(repo, "add", "wip.txt");
|
|
93
|
+
git(repo, "commit", "-q", "-m", "M002 work");
|
|
94
|
+
const m002Tip = rev(repo, "milestone/M002");
|
|
95
|
+
|
|
96
|
+
git(repo, "checkout", "-q", "main");
|
|
97
|
+
writeFileSync(join(repo, "seed.txt"), "main moved forward\n");
|
|
98
|
+
git(repo, "add", "seed.txt");
|
|
99
|
+
git(repo, "commit", "-q", "-m", "main advanced");
|
|
100
|
+
|
|
101
|
+
try {
|
|
102
|
+
_createMilestoneWorktree(repo, "M002");
|
|
103
|
+
} catch {
|
|
104
|
+
// ignored
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
assert.equal(
|
|
108
|
+
rev(repo, "milestone/M002"),
|
|
109
|
+
m002Tip,
|
|
110
|
+
"diverged milestone branch must NOT be touched — would lose committed work",
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
@@ -172,6 +172,56 @@ test('handlePlanSlice rejects invalid payloads', async () => {
|
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
174
|
|
|
175
|
+
test('handlePlanSlice rejects absolute task IO paths outside the active worktree', async () => {
|
|
176
|
+
const base = makeTmpBase();
|
|
177
|
+
openDatabase(join(base, '.gsd', 'gsd.db'));
|
|
178
|
+
|
|
179
|
+
try {
|
|
180
|
+
seedParentSlice();
|
|
181
|
+
const outside = join(tmpdir(), 'outside-checkout', 'index.html');
|
|
182
|
+
const result = await handlePlanSlice({
|
|
183
|
+
...validParams(),
|
|
184
|
+
tasks: [
|
|
185
|
+
{
|
|
186
|
+
...validParams().tasks[0],
|
|
187
|
+
inputs: [outside],
|
|
188
|
+
expectedOutput: [outside],
|
|
189
|
+
},
|
|
190
|
+
],
|
|
191
|
+
}, base);
|
|
192
|
+
|
|
193
|
+
assert.ok('error' in result);
|
|
194
|
+
assert.match(result.error, /validation failed: tasks\[0\]\.inputs contains absolute path outside working directory/);
|
|
195
|
+
assert.equal(getSliceTasks('M001', 'S02').length, 0, 'invalid planning IO must not persist tasks');
|
|
196
|
+
} finally {
|
|
197
|
+
cleanup(base);
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
test('handlePlanSlice accepts absolute task IO paths inside the active worktree', async () => {
|
|
202
|
+
const base = makeTmpBase();
|
|
203
|
+
openDatabase(join(base, '.gsd', 'gsd.db'));
|
|
204
|
+
|
|
205
|
+
try {
|
|
206
|
+
seedParentSlice();
|
|
207
|
+
const inside = join(base, 'index.html');
|
|
208
|
+
const result = await handlePlanSlice({
|
|
209
|
+
...validParams(),
|
|
210
|
+
tasks: [
|
|
211
|
+
{
|
|
212
|
+
...validParams().tasks[0],
|
|
213
|
+
inputs: [inside],
|
|
214
|
+
expectedOutput: [inside],
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
}, base);
|
|
218
|
+
|
|
219
|
+
assert.ok(!('error' in result), `unexpected error: ${'error' in result ? result.error : ''}`);
|
|
220
|
+
} finally {
|
|
221
|
+
cleanup(base);
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
|
|
175
225
|
test('handlePlanSlice rejects missing parent slice', async () => {
|
|
176
226
|
const base = makeTmpBase();
|
|
177
227
|
openDatabase(join(base, '.gsd', 'gsd.db'));
|
|
@@ -79,6 +79,27 @@ test('handlePlanTask rejects invalid payloads', async () => {
|
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
|
|
82
|
+
test('handlePlanTask rejects absolute task IO paths outside the active worktree', async () => {
|
|
83
|
+
const base = makeTmpBase();
|
|
84
|
+
openDatabase(join(base, '.gsd', 'gsd.db'));
|
|
85
|
+
|
|
86
|
+
try {
|
|
87
|
+
seedParent();
|
|
88
|
+
const outside = join(tmpdir(), 'outside-checkout', 'index.html');
|
|
89
|
+
const result = await handlePlanTask({
|
|
90
|
+
...validParams(),
|
|
91
|
+
inputs: [outside],
|
|
92
|
+
expectedOutput: [outside],
|
|
93
|
+
}, base);
|
|
94
|
+
|
|
95
|
+
assert.ok('error' in result);
|
|
96
|
+
assert.match(result.error, /validation failed: inputs contains absolute path outside working directory/);
|
|
97
|
+
assert.equal(getTask('M001', 'S02', 'T02'), null, 'invalid planning IO must not persist the task');
|
|
98
|
+
} finally {
|
|
99
|
+
cleanup(base);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
82
103
|
test('handlePlanTask rejects missing parent slice', async () => {
|
|
83
104
|
const base = makeTmpBase();
|
|
84
105
|
openDatabase(join(base, '.gsd', 'gsd.db'));
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Golden-fixture equivalence tests pinning PR-body output for buildPrEvidence and formatSwarmLanePRBody.
|
|
3
|
+
|
|
4
|
+
import test from "node:test";
|
|
5
|
+
import assert from "node:assert/strict";
|
|
6
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
import { dirname, join } from "node:path";
|
|
9
|
+
|
|
10
|
+
import { buildPrEvidence, type PrEvidenceInput } from "../pr-evidence.ts";
|
|
11
|
+
import {
|
|
12
|
+
formatSwarmLanePRBody,
|
|
13
|
+
type SwarmLanePRData,
|
|
14
|
+
} from "../../github-sync/templates.ts";
|
|
15
|
+
|
|
16
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
const FIXTURES_DIR = join(__dirname, "fixtures", "pr-body");
|
|
18
|
+
|
|
19
|
+
const UPDATE = process.env.UPDATE_GOLDENS === "1";
|
|
20
|
+
|
|
21
|
+
function compareGolden(name: string, actual: string): void {
|
|
22
|
+
const path = join(FIXTURES_DIR, name);
|
|
23
|
+
if (UPDATE) {
|
|
24
|
+
writeFileSync(path, actual, "utf8");
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const expected = readFileSync(path, "utf8");
|
|
28
|
+
assert.equal(actual, expected, `golden mismatch for ${name}`);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const SHIP_BASIC: PrEvidenceInput = {
|
|
32
|
+
milestoneId: "M001",
|
|
33
|
+
milestoneTitle: "Authentication",
|
|
34
|
+
changeType: "feat",
|
|
35
|
+
linkedIssue: "Closes #123",
|
|
36
|
+
summaries: ["### S01\nImplemented login flow."],
|
|
37
|
+
roadmapItems: ["- [x] **S01: Login**"],
|
|
38
|
+
metrics: ["**Units executed:** 3"],
|
|
39
|
+
testsRun: ["npm test", "npm run typecheck:extensions"],
|
|
40
|
+
why: "Users need to authenticate before accessing protected resources.",
|
|
41
|
+
how: "Added password hash check and session token issuance.",
|
|
42
|
+
rollbackNotes: ["Revert the merge commit."],
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const SHIP_EMPTY_OPTIONALS: PrEvidenceInput = {
|
|
46
|
+
milestoneId: "M001",
|
|
47
|
+
milestoneTitle: "Authentication",
|
|
48
|
+
changeType: "feat",
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const SWARM_WITH_BLOCKERS: SwarmLanePRData = {
|
|
52
|
+
lane: {
|
|
53
|
+
id: "writer",
|
|
54
|
+
branch: "lane/single-writer",
|
|
55
|
+
owner: "@owner",
|
|
56
|
+
latestCommit: "abc1234",
|
|
57
|
+
changedContracts: ["WriterToken"],
|
|
58
|
+
testEvidence: ["npm run typecheck:extensions"],
|
|
59
|
+
blockers: ["Awaiting state-lane writer-sequence merge", "Parity report incomplete"],
|
|
60
|
+
},
|
|
61
|
+
impactArea: "Single-writer UOK metadata.",
|
|
62
|
+
transitionRisks: ["Writer token lifecycle regression"],
|
|
63
|
+
rollbackPlan: ["Disable writer sequence enrichment"],
|
|
64
|
+
linkedIssue: 123,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const SWARM_NO_BLOCKERS: SwarmLanePRData = {
|
|
68
|
+
lane: {
|
|
69
|
+
id: "writer",
|
|
70
|
+
branch: "lane/single-writer",
|
|
71
|
+
owner: "@owner",
|
|
72
|
+
latestCommit: "abc1234",
|
|
73
|
+
changedContracts: ["WriterToken"],
|
|
74
|
+
testEvidence: ["npm run typecheck:extensions"],
|
|
75
|
+
},
|
|
76
|
+
impactArea: "Single-writer UOK metadata.",
|
|
77
|
+
transitionRisks: ["Writer token lifecycle regression"],
|
|
78
|
+
rollbackPlan: ["Disable writer sequence enrichment"],
|
|
79
|
+
linkedIssue: 123,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
test("pr-evidence golden: commands-ship basic", () => {
|
|
83
|
+
compareGolden("commands-ship-basic.md", buildPrEvidence(SHIP_BASIC).body);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test("pr-evidence golden: commands-ship empty optionals", () => {
|
|
87
|
+
compareGolden("commands-ship-empty-optionals.md", buildPrEvidence(SHIP_EMPTY_OPTIONALS).body);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
test("pr-evidence golden: swarm-lane with blockers", () => {
|
|
91
|
+
const body = formatSwarmLanePRBody(SWARM_WITH_BLOCKERS);
|
|
92
|
+
compareGolden("swarm-lane-with-blockers.md", body);
|
|
93
|
+
// Cross-check: top-level ## Blockers heading must appear (regression guard
|
|
94
|
+
// for the silent-drop fixed in this PR).
|
|
95
|
+
assert.ok(body.includes("\n## Blockers\n"), "swarm-lane body must emit a top-level ## Blockers heading");
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
test("pr-evidence golden: swarm-lane no blockers (no Blockers heading)", () => {
|
|
99
|
+
const body = formatSwarmLanePRBody(SWARM_NO_BLOCKERS);
|
|
100
|
+
compareGolden("swarm-lane-no-blockers.md", body);
|
|
101
|
+
assert.ok(!body.includes("## Blockers"), "swarm-lane body without blockers must not emit ## Blockers heading");
|
|
102
|
+
});
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Hardening tests for buildPrEvidence — HTML-comment stripping, fake commit-trailer removal, and per-item length capping.
|
|
3
|
+
|
|
4
|
+
import test from "node:test";
|
|
5
|
+
import assert from "node:assert/strict";
|
|
6
|
+
|
|
7
|
+
import { buildPrEvidence, type PrEvidenceInput } from "../pr-evidence.ts";
|
|
8
|
+
|
|
9
|
+
test("pr-evidence hardening: strips HTML comments from summaries", () => {
|
|
10
|
+
const evidence = buildPrEvidence({
|
|
11
|
+
milestoneId: "M001",
|
|
12
|
+
summaries: ["visible<!-- hidden secret -->tail"],
|
|
13
|
+
});
|
|
14
|
+
assert.ok(!evidence.body.includes("<!--"), "raw <!-- must not appear");
|
|
15
|
+
assert.ok(!evidence.body.includes("hidden secret"), "comment contents must be stripped");
|
|
16
|
+
assert.ok(evidence.body.includes("visibletail"), "non-comment text must remain");
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test("pr-evidence hardening: removes Co-Authored-By trailer from why", () => {
|
|
20
|
+
const evidence = buildPrEvidence({
|
|
21
|
+
milestoneId: "M001",
|
|
22
|
+
why: "Real reason here.\nCo-Authored-By: Evil <e@evil.com>\nMore reason.",
|
|
23
|
+
});
|
|
24
|
+
assert.ok(!evidence.body.includes("Evil <e@evil.com>"));
|
|
25
|
+
assert.ok(!/Co-Authored-By:/i.test(evidence.body));
|
|
26
|
+
assert.ok(evidence.body.includes("Real reason here."));
|
|
27
|
+
assert.ok(evidence.body.includes("More reason."));
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test("pr-evidence hardening: removes Signed-off-by trailer from how", () => {
|
|
31
|
+
const evidence = buildPrEvidence({
|
|
32
|
+
milestoneId: "M001",
|
|
33
|
+
how: "Step one.\nSigned-off-by: Forged <f@x.com>\nStep two.",
|
|
34
|
+
});
|
|
35
|
+
assert.ok(!evidence.body.includes("Forged <f@x.com>"));
|
|
36
|
+
assert.ok(!/Signed-off-by:/i.test(evidence.body));
|
|
37
|
+
assert.ok(evidence.body.includes("Step one."));
|
|
38
|
+
assert.ok(evidence.body.includes("Step two."));
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("pr-evidence hardening: trailer-name match is case-insensitive", () => {
|
|
42
|
+
const evidence = buildPrEvidence({
|
|
43
|
+
milestoneId: "M001",
|
|
44
|
+
why: "ok\nco-authored-by: lower <l@l.com>\nSIGNED-OFF-BY: upper <u@u.com>\nend",
|
|
45
|
+
});
|
|
46
|
+
assert.ok(!evidence.body.includes("lower <l@l.com>"));
|
|
47
|
+
assert.ok(!evidence.body.includes("upper <u@u.com>"));
|
|
48
|
+
assert.ok(evidence.body.includes("ok"));
|
|
49
|
+
assert.ok(evidence.body.includes("end"));
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test("pr-evidence hardening: caps oversize summaries item with truncation suffix", () => {
|
|
53
|
+
const big = "A".repeat(5 * 1024); // 5 KB
|
|
54
|
+
const evidence = buildPrEvidence({
|
|
55
|
+
milestoneId: "M001",
|
|
56
|
+
summaries: [big],
|
|
57
|
+
});
|
|
58
|
+
// Find the truncated A-block in the body and assert it is bounded.
|
|
59
|
+
const lines = evidence.body.split("\n");
|
|
60
|
+
const longLine = lines.find((l) => l.startsWith("AAAA"));
|
|
61
|
+
assert.ok(longLine, "expected truncated A-line in body");
|
|
62
|
+
assert.ok(longLine!.endsWith(" … [truncated]"), "must end with truncation suffix");
|
|
63
|
+
assert.ok(
|
|
64
|
+
Buffer.byteLength(longLine!, "utf8") <= 2048,
|
|
65
|
+
`truncated item must be within 2 KB cap, got ${Buffer.byteLength(longLine!, "utf8")}`,
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test("pr-evidence hardening: HTML comment split across summary items is preserved literally", () => {
|
|
70
|
+
// Documented behavior: each item is sanitized independently. A comment
|
|
71
|
+
// that begins in one item and closes in the next is NOT joined, so the
|
|
72
|
+
// open/close markers remain as literal text. This is intentional — joining
|
|
73
|
+
// items before sanitizing would let an attacker straddle items to inject
|
|
74
|
+
// an aligned comment that hides the second item from rendered view.
|
|
75
|
+
const evidence = buildPrEvidence({
|
|
76
|
+
milestoneId: "M001",
|
|
77
|
+
summaries: ["first item ends <!--", "--> second item begins"],
|
|
78
|
+
});
|
|
79
|
+
// The literal markers survive because each item was sanitized alone.
|
|
80
|
+
assert.ok(evidence.body.includes("<!--"), "open marker preserved as literal");
|
|
81
|
+
assert.ok(evidence.body.includes("-->"), "close marker preserved as literal");
|
|
82
|
+
assert.ok(evidence.body.includes("first item ends"));
|
|
83
|
+
assert.ok(evidence.body.includes("second item begins"));
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test("pr-evidence hardening: clean input is byte-identical to pre-hardening output", () => {
|
|
87
|
+
// This test is the contract that protects the golden fixtures: the
|
|
88
|
+
// sanitizer must be a true no-op for well-formed input. If this fails,
|
|
89
|
+
// there is a bug in the sanitizer (not in the goldens).
|
|
90
|
+
const cleanInput: PrEvidenceInput = {
|
|
91
|
+
milestoneId: "M001",
|
|
92
|
+
milestoneTitle: "Authentication",
|
|
93
|
+
changeType: "feat",
|
|
94
|
+
linkedIssue: "Closes #123",
|
|
95
|
+
summaries: ["### S01\nImplemented login flow."],
|
|
96
|
+
blockers: ["Awaiting design review"],
|
|
97
|
+
roadmapItems: ["- [x] **S01: Login**"],
|
|
98
|
+
metrics: ["**Units executed:** 3"],
|
|
99
|
+
testsRun: ["npm test", "npm run typecheck:extensions"],
|
|
100
|
+
why: "Users need to authenticate before accessing protected resources.",
|
|
101
|
+
how: "Added password hash check and session token issuance.",
|
|
102
|
+
rollbackNotes: ["Revert the merge commit."],
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const expected = [
|
|
106
|
+
"## TL;DR",
|
|
107
|
+
"",
|
|
108
|
+
"**What:** Ship milestone M001 - Authentication",
|
|
109
|
+
"**Why:** Users need to authenticate before accessing protected resources.",
|
|
110
|
+
"**How:** Added password hash check and session token issuance.",
|
|
111
|
+
"",
|
|
112
|
+
"## What",
|
|
113
|
+
"",
|
|
114
|
+
"### S01\nImplemented login flow.",
|
|
115
|
+
"",
|
|
116
|
+
"## Blockers",
|
|
117
|
+
"",
|
|
118
|
+
"- Awaiting design review",
|
|
119
|
+
"",
|
|
120
|
+
"## Why",
|
|
121
|
+
"",
|
|
122
|
+
"Users need to authenticate before accessing protected resources.",
|
|
123
|
+
"",
|
|
124
|
+
"## How",
|
|
125
|
+
"",
|
|
126
|
+
"Added password hash check and session token issuance.",
|
|
127
|
+
"",
|
|
128
|
+
"## Linked Issue",
|
|
129
|
+
"",
|
|
130
|
+
"Closes #123",
|
|
131
|
+
"",
|
|
132
|
+
"## Roadmap",
|
|
133
|
+
"",
|
|
134
|
+
"- [x] **S01: Login**",
|
|
135
|
+
"",
|
|
136
|
+
"## Metrics",
|
|
137
|
+
"",
|
|
138
|
+
"- **Units executed:** 3",
|
|
139
|
+
"",
|
|
140
|
+
"## Tests Run",
|
|
141
|
+
"",
|
|
142
|
+
"- npm test",
|
|
143
|
+
"- npm run typecheck:extensions",
|
|
144
|
+
"",
|
|
145
|
+
"## Change Type",
|
|
146
|
+
"",
|
|
147
|
+
"- [x] `feat` - New feature or capability",
|
|
148
|
+
"- [ ] `fix` - Bug fix",
|
|
149
|
+
"- [ ] `refactor` - Code restructuring",
|
|
150
|
+
"- [ ] `test` - Adding or updating tests",
|
|
151
|
+
"- [ ] `docs` - Documentation only",
|
|
152
|
+
"- [ ] `chore` - Build, CI, or tooling changes",
|
|
153
|
+
"",
|
|
154
|
+
"## Rollback And Compatibility",
|
|
155
|
+
"",
|
|
156
|
+
"- Revert the merge commit.",
|
|
157
|
+
"",
|
|
158
|
+
"## AI Assistance Disclosure",
|
|
159
|
+
"",
|
|
160
|
+
"This PR was prepared with AI assistance.",
|
|
161
|
+
].join("\n");
|
|
162
|
+
|
|
163
|
+
const actual = buildPrEvidence(cleanInput).body;
|
|
164
|
+
assert.equal(actual, expected, "clean input must produce byte-identical output (sanitizer is no-op)");
|
|
165
|
+
});
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Project/App: GSD-2
|
|
2
|
+
// File Purpose: Unit tests for pre-execution validation checks.
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* pre-execution-checks.test.ts — Unit tests for pre-execution validation checks.
|
|
3
6
|
*
|
|
@@ -1542,6 +1545,27 @@ describe("checkFilePathConsistency directory inputs (#4446)", () => {
|
|
|
1542
1545
|
assert.equal(results[0].blocking, true);
|
|
1543
1546
|
});
|
|
1544
1547
|
|
|
1548
|
+
test("runtime directory annotation is skipped as a pre-execution file dependency", (t) => {
|
|
1549
|
+
const tempDir = join(tmpdir(), `pre-exec-dir-runtime-${Date.now()}`);
|
|
1550
|
+
mkdirSync(tempDir, { recursive: true });
|
|
1551
|
+
t.after(() => rmSync(tempDir, { recursive: true, force: true }));
|
|
1552
|
+
|
|
1553
|
+
const tasks = [
|
|
1554
|
+
createTask({
|
|
1555
|
+
id: "T02",
|
|
1556
|
+
inputs: ["entries/ directory (runtime)"],
|
|
1557
|
+
expected_output: ["src/commands/delete.ts", "src/index.ts"],
|
|
1558
|
+
}),
|
|
1559
|
+
];
|
|
1560
|
+
|
|
1561
|
+
const results = checkFilePathConsistency(tasks, tempDir);
|
|
1562
|
+
assert.deepEqual(
|
|
1563
|
+
results,
|
|
1564
|
+
[],
|
|
1565
|
+
"Runtime-only directory inputs are created during command execution, not required before the task starts",
|
|
1566
|
+
);
|
|
1567
|
+
});
|
|
1568
|
+
|
|
1545
1569
|
test("tilde-prefixed input is matched against $HOME, not the project basePath", (t) => {
|
|
1546
1570
|
const fakeHome = join(tmpdir(), `pre-exec-tilde-home-${Date.now()}`);
|
|
1547
1571
|
const projectDir = join(tmpdir(), `pre-exec-tilde-proj-${Date.now()}`);
|
|
@@ -1597,6 +1621,20 @@ describe("checkTaskOrdering directory inputs (#4446)", () => {
|
|
|
1597
1621
|
"Directory reference should not be treated as reading a file created later",
|
|
1598
1622
|
);
|
|
1599
1623
|
});
|
|
1624
|
+
|
|
1625
|
+
test("runtime directory annotation does not produce an ordering violation", () => {
|
|
1626
|
+
const tasks = [
|
|
1627
|
+
createTask({
|
|
1628
|
+
id: "T02",
|
|
1629
|
+
sequence: 0,
|
|
1630
|
+
inputs: ["entries/ directory (runtime)"],
|
|
1631
|
+
expected_output: [],
|
|
1632
|
+
}),
|
|
1633
|
+
];
|
|
1634
|
+
|
|
1635
|
+
const results = checkTaskOrdering(tasks, "/tmp");
|
|
1636
|
+
assert.deepEqual(results, []);
|
|
1637
|
+
});
|
|
1600
1638
|
});
|
|
1601
1639
|
|
|
1602
1640
|
// ─── Regression Tests: checkTaskOrdering false positive for pre-execution refs (#4071) ──
|
|
@@ -1781,7 +1819,7 @@ describe("checkFilePathConsistency completed-task output exemption (#4071)", ()
|
|
|
1781
1819
|
);
|
|
1782
1820
|
});
|
|
1783
1821
|
|
|
1784
|
-
test("pending task at higher index
|
|
1822
|
+
test("pending task at higher index does NOT cause a duplicate consistency error (ordering check handles it)", (t) => {
|
|
1785
1823
|
const tempDir = join(tmpdir(), `pre-exec-fc-pending-${Date.now()}`);
|
|
1786
1824
|
mkdirSync(tempDir, { recursive: true });
|
|
1787
1825
|
t.after(() => rmSync(tempDir, { recursive: true, force: true }));
|
|
@@ -1803,14 +1841,16 @@ describe("checkFilePathConsistency completed-task output exemption (#4071)", ()
|
|
|
1803
1841
|
}),
|
|
1804
1842
|
];
|
|
1805
1843
|
|
|
1844
|
+
// checkFilePathConsistency suppresses the error here because checkTaskOrdering
|
|
1845
|
+
// will fire a more precise "sequence violation" error for the same file.
|
|
1846
|
+
// The combined output of runPreExecutionChecks still flags the issue — just
|
|
1847
|
+
// once, via the ordering check, instead of twice.
|
|
1806
1848
|
const results = checkFilePathConsistency(tasks, tempDir);
|
|
1807
1849
|
assert.equal(
|
|
1808
1850
|
results.length,
|
|
1809
|
-
|
|
1810
|
-
"
|
|
1851
|
+
0,
|
|
1852
|
+
"consistency check must not duplicate what the ordering check already reports",
|
|
1811
1853
|
);
|
|
1812
|
-
assert.equal(results[0].blocking, true);
|
|
1813
|
-
assert.equal(results[0].target, "artifacts/output.json");
|
|
1814
1854
|
});
|
|
1815
1855
|
});
|
|
1816
1856
|
|