gsd-pi 2.79.0 → 2.80.0
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 +94 -47
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/extensions/gsd/auto/contracts.js +1 -0
- package/dist/resources/extensions/gsd/auto/orchestrator.js +146 -0
- package/dist/resources/extensions/gsd/auto/phases.js +61 -7
- package/dist/resources/extensions/gsd/auto/session.js +8 -0
- package/dist/resources/extensions/gsd/auto-artifact-paths.js +2 -2
- package/dist/resources/extensions/gsd/auto-dispatch.js +2 -0
- package/dist/resources/extensions/gsd/auto-prompts.js +52 -29
- package/dist/resources/extensions/gsd/auto-recovery.js +63 -55
- package/dist/resources/extensions/gsd/auto-runtime-state.js +4 -0
- package/dist/resources/extensions/gsd/auto-start.js +3 -2
- package/dist/resources/extensions/gsd/auto.js +159 -2
- package/dist/resources/extensions/gsd/bootstrap/agent-end-recovery.js +9 -1
- package/dist/resources/extensions/gsd/bootstrap/exec-tools.js +2 -2
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +41 -45
- package/dist/resources/extensions/gsd/bootstrap/write-gate.js +8 -8
- package/dist/resources/extensions/gsd/commands/context.js +1 -1
- package/dist/resources/extensions/gsd/gsd-db.js +34 -1
- package/dist/resources/extensions/gsd/guided-flow.js +40 -0
- package/dist/resources/extensions/gsd/paths.js +5 -1
- package/dist/resources/extensions/gsd/post-execution-checks.js +25 -6
- package/dist/resources/extensions/gsd/preferences-types.js +20 -2
- package/dist/resources/extensions/gsd/preferences-validation.js +3 -3
- package/dist/resources/extensions/gsd/tools/workflow-tool-executors.js +82 -2
- package/dist/resources/extensions/gsd/unit-context-composer.js +32 -0
- package/dist/resources/extensions/gsd/unit-context-manifest.js +21 -0
- package/dist/resources/extensions/gsd/uok/audit.js +23 -9
- package/dist/resources/extensions/gsd/uok/contracts.js +69 -1
- package/dist/resources/extensions/gsd/uok/dispatch-envelope.js +3 -0
- package/dist/resources/extensions/gsd/uok/loop-adapter.js +48 -33
- package/dist/resources/extensions/gsd/uok/timeline.js +125 -0
- package/dist/resources/extensions/shared/gsd-phase-state.js +45 -3
- package/dist/resources/extensions/shared/interview-ui.js +15 -4
- 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 +9 -9
- package/dist/web/standalone/.next/build-manifest.json +2 -2
- 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 +9 -9
- 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/package.json +1 -1
- package/packages/daemon/package.json +2 -2
- package/packages/mcp-server/dist/workflow-tools.d.ts +1 -1
- package/packages/mcp-server/dist/workflow-tools.d.ts.map +1 -1
- package/packages/mcp-server/dist/workflow-tools.js +53 -0
- package/packages/mcp-server/dist/workflow-tools.js.map +1 -1
- package/packages/mcp-server/package.json +2 -2
- package/packages/mcp-server/src/workflow-tools.test.ts +129 -2
- package/packages/mcp-server/src/workflow-tools.ts +81 -0
- package/packages/mcp-server/tsconfig.tsbuildinfo +1 -1
- package/packages/native/package.json +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-coding-agent/package.json +1 -1
- package/packages/pi-tui/package.json +1 -1
- package/packages/rpc-client/package.json +1 -1
- package/pkg/package.json +1 -1
- package/src/resources/extensions/gsd/auto/contracts.ts +87 -0
- package/src/resources/extensions/gsd/auto/loop-deps.ts +10 -3
- package/src/resources/extensions/gsd/auto/orchestrator.ts +161 -0
- package/src/resources/extensions/gsd/auto/phases.ts +88 -9
- package/src/resources/extensions/gsd/auto/session.ts +11 -0
- package/src/resources/extensions/gsd/auto-artifact-paths.ts +2 -2
- package/src/resources/extensions/gsd/auto-dispatch.ts +1 -0
- package/src/resources/extensions/gsd/auto-prompts.ts +106 -28
- package/src/resources/extensions/gsd/auto-recovery.ts +59 -53
- package/src/resources/extensions/gsd/auto-runtime-state.ts +7 -0
- package/src/resources/extensions/gsd/auto-start.ts +3 -2
- package/src/resources/extensions/gsd/auto.ts +167 -1
- package/src/resources/extensions/gsd/bootstrap/agent-end-recovery.ts +14 -1
- package/src/resources/extensions/gsd/bootstrap/exec-tools.ts +2 -2
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +49 -46
- package/src/resources/extensions/gsd/bootstrap/tests/write-gate-shouldblock-basepath.test.ts +97 -0
- package/src/resources/extensions/gsd/bootstrap/write-gate.ts +8 -4
- package/src/resources/extensions/gsd/commands/context.ts +1 -1
- package/src/resources/extensions/gsd/gsd-db.ts +35 -1
- package/src/resources/extensions/gsd/guided-flow.ts +47 -0
- package/src/resources/extensions/gsd/interrupted-session.ts +1 -0
- package/src/resources/extensions/gsd/paths.ts +6 -1
- package/src/resources/extensions/gsd/post-execution-checks.ts +31 -6
- package/src/resources/extensions/gsd/preferences-types.ts +23 -4
- package/src/resources/extensions/gsd/preferences-validation.ts +3 -3
- package/src/resources/extensions/gsd/tests/auto-abort-pause-regression.test.ts +32 -0
- package/src/resources/extensions/gsd/tests/auto-orchestrator.test.ts +353 -0
- package/src/resources/extensions/gsd/tests/auto-recovery.test.ts +108 -1
- package/src/resources/extensions/gsd/tests/auto-runtime-state.test.ts +39 -0
- package/src/resources/extensions/gsd/tests/auto-session-encapsulation.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/bootstrap-derive-state-db-open.test.ts +2 -2
- package/src/resources/extensions/gsd/tests/check-auto-start-pending-gate.test.ts +203 -0
- package/src/resources/extensions/gsd/tests/check-auto-start-ready-guard.test.ts +148 -0
- package/src/resources/extensions/gsd/tests/current-directory-root-homedir-fallback.test.ts +63 -0
- package/src/resources/extensions/gsd/tests/deep-planning-mode-dispatch.test.ts +42 -0
- package/src/resources/extensions/gsd/tests/deep-project-auto-loop.test.ts +63 -2
- package/src/resources/extensions/gsd/tests/execute-summary-save-empty-project.test.ts +109 -0
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +95 -0
- package/src/resources/extensions/gsd/tests/guided-flow-prompt-consolidation.test.ts +14 -0
- package/src/resources/extensions/gsd/tests/integration/auto-recovery.test.ts +79 -0
- package/src/resources/extensions/gsd/tests/journal-integration.test.ts +134 -0
- package/src/resources/extensions/gsd/tests/parallel-skill-prompt-integration.test.ts +8 -0
- package/src/resources/extensions/gsd/tests/paused-session-via-db.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/plan-slice.test.ts +27 -0
- package/src/resources/extensions/gsd/tests/post-execution-checks.test.ts +46 -0
- package/src/resources/extensions/gsd/tests/pre-exec-gate-loop.test.ts +3 -0
- package/src/resources/extensions/gsd/tests/register-hooks-compaction-checkpoint.test.ts +85 -0
- package/src/resources/extensions/gsd/tests/run-uat-composer.test.ts +2 -0
- package/src/resources/extensions/gsd/tests/subagent-model-dispatch.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/unit-context-composer.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/unit-context-manifest.test.ts +32 -0
- package/src/resources/extensions/gsd/tests/uok-contracts.test.ts +109 -1
- package/src/resources/extensions/gsd/tests/uok-loop-adapter-writer.test.ts +98 -0
- package/src/resources/extensions/gsd/tests/workflow-tool-executors.test.ts +132 -3
- package/src/resources/extensions/gsd/tests/worktree-path-injection.test.ts +3 -0
- package/src/resources/extensions/gsd/tools/workflow-tool-executors.ts +84 -1
- package/src/resources/extensions/gsd/unit-context-composer.ts +49 -0
- package/src/resources/extensions/gsd/unit-context-manifest.ts +34 -0
- package/src/resources/extensions/gsd/uok/audit.ts +25 -9
- package/src/resources/extensions/gsd/uok/contracts.ts +105 -0
- package/src/resources/extensions/gsd/uok/dispatch-envelope.ts +4 -0
- package/src/resources/extensions/gsd/uok/loop-adapter.ts +60 -45
- package/src/resources/extensions/gsd/uok/timeline.ts +158 -0
- package/src/resources/extensions/shared/gsd-phase-state.ts +56 -3
- package/src/resources/extensions/shared/interview-ui.ts +18 -5
- package/src/resources/extensions/shared/tests/gsd-phase-state.test.ts +43 -1
- package/src/resources/extensions/shared/tests/interview-notes-loop.test.ts +41 -0
- /package/dist/web/standalone/.next/static/{J-CU-p_sp45CJHT3R9TJS → V-3Ehy4B24f9FCGiLPWIM}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{J-CU-p_sp45CJHT3R9TJS → V-3Ehy4B24f9FCGiLPWIM}/_ssgManifest.js +0 -0
package/README.md
CHANGED
|
@@ -27,54 +27,95 @@ One command. Walk away. Come back to a built project with clean git history.
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
## What's New in v2.
|
|
30
|
+
## What's New in v2.79
|
|
31
31
|
|
|
32
|
-
###
|
|
32
|
+
### DB-Authoritative Runtime State
|
|
33
33
|
|
|
34
|
-
- **
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
- **
|
|
34
|
+
- **Auto-mode coordination tables (#5247)** — workers, leases, dispatches, and a command queue are now first-class DB rows, replacing ad-hoc files for cross-process auto coordination.
|
|
35
|
+
- **`auto.lock` + `paused-session.json` → DB (#5250)** — phase C pt 2 of the runtime-state migration. The on-disk lockfile and paused-session JSON are gone; lock acquisition, stale-lock detection, and pause state all live in `gsd.db`.
|
|
36
|
+
- **Stuck-state migration (#5249)** — `copyPlanningArtifacts` / `reconcile` deleted; auto-mode writers canonicalize through the DB instead of mirroring artifacts to disk.
|
|
37
|
+
- **`gsd headless recover`** — non-TTY DB recovery command for unattended environments where the interactive recover flow can't run.
|
|
38
|
+
- **Doctor surfaces DB locks** — `gsd doctor` reports DB-backed stale locks and flags exhausted `run-uat` retry counters so wedged runs are visible without log archaeology.
|
|
39
39
|
|
|
40
|
-
###
|
|
40
|
+
### Workspace & Worktree Isolation
|
|
41
41
|
|
|
42
|
-
-
|
|
43
|
-
- **
|
|
44
|
-
- **
|
|
45
|
-
- **
|
|
46
|
-
- **
|
|
47
|
-
- **
|
|
48
|
-
- **Opt-in `reassess-roadmap` (#4778)** — gated behind the `skip_clean_reassess` preference per ADR-003 §4; auto no longer triggers reassessment unprompted.
|
|
42
|
+
- **`GsdWorkspace` + `MilestoneScope` handle types** — workspace identity is now an explicit handle threaded through writers, metrics, and the DB connection instead of a module singleton.
|
|
43
|
+
- **Symlink-safe canonicalization** — `deriveState` read root and cache key are canonicalized; path normalization unified on `realpathSync.native`; `gsdRootCache` keys normalized and decoupled from per-turn cache clears; `git-root` anchor guarded against `~/.gsd` resolution.
|
|
44
|
+
- **Worktree-scoped DB + metrics** — `gsd-db` connections and metrics ledgers are scoped by workspace identity, so concurrent milestones in separate worktrees can't cross-contaminate state.
|
|
45
|
+
- **Worktree cwd anchoring** — subagent dispatch anchors to the canonical worktree path, `mergeAndExit` anchors cwd at project root (closes [#5079](https://github.com/gsd-build/GSD-2/issues/5079)), MCP cwd is hardened against drift, and dispatch stops on cwd anchor failures.
|
|
46
|
+
- **Slice isolation through resolver (#5246)** — slice merge isolation routed through the worktree resolver; `originalBase` checks use `isSamePath` instead of string equality; `auto-worktree` validates `milestoneId` match in `ByScope` wrappers.
|
|
47
|
+
- **Worktree CLI commands** — `gsd worktree {list, merge, clean, remove}` exposed in the TUI dispatcher.
|
|
49
48
|
|
|
50
|
-
###
|
|
49
|
+
### Deep Planning Mode (Phase 11)
|
|
51
50
|
|
|
52
|
-
-
|
|
53
|
-
- **
|
|
54
|
-
- **
|
|
55
|
-
- **
|
|
51
|
+
- **`/gsd new-project --deep`** — opt-in deep mode for new projects, with `research-decision` and `research-project` dispatch units, deep-mode artifact validators, and gated approval flows that pause the milestone instead of aborting on grounding/discovery questions.
|
|
52
|
+
- **EVAL-REVIEW system** — `/gsd eval-review` command, frontmatter schema, pre-ship soft warning when EVAL-REVIEW status is incomplete, and registration in the catalog + ops dispatcher.
|
|
53
|
+
- **Project-shape-aware discuss depth** — discuss-phase questioning depth scales via the project-shape classifier; tiny apps cap research and auto-skip stale research blockers; deep research is opt-in and blocked while a marker is in flight.
|
|
54
|
+
- **Approval-gate hardening** — deep approval gates verified, opening interview question protected from approval abort, plain-text setup approvals gated, deep setup state guarded against phantom transitions.
|
|
56
55
|
|
|
57
|
-
###
|
|
56
|
+
### Auto Pipeline & Dispatch
|
|
58
57
|
|
|
59
|
-
- **
|
|
60
|
-
- **
|
|
61
|
-
- **
|
|
62
|
-
- **
|
|
63
|
-
-
|
|
64
|
-
- **Visual postinstall (#4641)** — install shows a spinner/banner UX so first-run state is legible.
|
|
65
|
-
- **PR-risk verification** — risk prompt emits a copy-pasteable code block to make follow-up commands one step.
|
|
58
|
+
- **Delegation-policy verdicts** — dispatch actions are annotated with a per-tool background-safety policy verdict; the policy itself is codified instead of inferred per call.
|
|
59
|
+
- **Reactive-execute default** — auto-dispatch defaults to reactive-execute when ≥3 ready tasks are queued, replacing the always-sequential fallback.
|
|
60
|
+
- **Proactive rate limiting (#2996)** — `min_request_interval_ms` preference paces auto-mode requests; the interval is stamped at dispatch.
|
|
61
|
+
- **Manifest-driven skill surfacing** — `auto-prompts` surfaces manifest skills via recommendations + auto-match; planning-dispatch mode added to the unit manifest for slice plan/complete; runtime tools-policy enforced for planning units (#4934).
|
|
62
|
+
- **Subagent telemetry** — dispatch telemetry, stronger prompt guidelines, and model-override threading (`??` consistently used for `modelOverride`).
|
|
66
63
|
|
|
67
|
-
###
|
|
64
|
+
### MCP, Models & Cross-Platform
|
|
68
65
|
|
|
69
|
-
- **
|
|
70
|
-
-
|
|
71
|
-
- **
|
|
72
|
-
- **
|
|
73
|
-
- **
|
|
74
|
-
- **
|
|
75
|
-
- **Empty-turn recovery** — Claude Code CLI tool-block shape canonicalized so empty-turn recovery matches real provider output.
|
|
66
|
+
- **Global MCP config** — `mcp-client` reads `~/.gsd/mcp.json` for user-level MCP server config.
|
|
67
|
+
- **`ask_user_questions` over MCP** — host elicitation tried before remote channel; multi-select array shape preserved; explicit cancellation handled; remote answers normalized into `structuredContent`.
|
|
68
|
+
- **Model routing overhaul** — cross-provider tier resolution, provider-agnostic profile-tier defaults, disabled-provider routing denylist, resolved tier model IDs normalized, and `findModelForTier` with behavioral tests.
|
|
69
|
+
- **Ollama** — configurable probe/request timeouts via env vars (clamped); cloud / long-variant context windows reported correctly.
|
|
70
|
+
- **Windows fixes** — home directory resolved correctly (#5015), `Path` env lookup repaired, Windows-safe env CLI shims, DEP0190 avoided in Claude CLI binary probes, tool-bootstrap skipped when tools are on PATH.
|
|
71
|
+
- **Anthropic prompt-cache preserved (#5019)** — `pi-coding-agent` and `gsd` no longer thrash the cache on dispatch.
|
|
76
72
|
|
|
77
|
-
|
|
73
|
+
### Git, GitHub Sync & Reliability
|
|
74
|
+
|
|
75
|
+
- **Integration-branch self-merge guard (#5024)** — milestone refuses to self-merge when the integration branch equals the milestone branch; self-merge ref guard normalized.
|
|
76
|
+
- **Slice-cadence safety** — integration branch used for slice cadence, dirty worktree state preserved on merge, checked-out slice worktrees advance safely, slice PRs deferred until completion, slice-PR sync stays retryable on failure.
|
|
77
|
+
- **Milestone-ID reservation** — DB rows included in reservation; ghost IDs reused in `nextMilestoneId` to close gaps; `ensurePreconditions` guarded against phantom IDs (#4996); orphan milestone-dir doctor check (#4996); milestone-dir creation deferred until first artifact write.
|
|
78
|
+
- **Auto-commit hygiene** — task commits scoped to reported files, generated commit subjects sanitized, user hooks run on automated commits, milestone-tagged commits bound when `.gsd/` is gitignored (#5033), startup blocked on `git index.lock`.
|
|
79
|
+
- **GitHub sync** — issues no longer closed before delivery, failed task closure / slice PR sync stay retryable, config cache scoped by project, safe git environment used.
|
|
80
|
+
|
|
81
|
+
### Safety, Recovery & Hardening
|
|
82
|
+
|
|
83
|
+
- **Policy-block pause through dispatch errors** — pause state is preserved when dispatch errors out mid-policy-block.
|
|
84
|
+
- **Skip-validation persistence** — skip-validation state persists and gate rows are cleared on recover.
|
|
85
|
+
- **Cancelled-gate hard block** — redirected to `ask_user_questions`; false plain-text claim dropped from the message.
|
|
86
|
+
- **Write-gate basePath required** — `process.cwd()` defaults removed; basePath threaded through pre-existing tests.
|
|
87
|
+
- **Atomic metrics writes** — parallel-mode `metrics.json` writes merge atomically; ledger cache invalidated after prune; `saveLedger` aborts when lock not acquired; stale-lock detection adds PID stamp + async yield.
|
|
88
|
+
- **Auto-worktree teardown** — `activeWorkspace` guaranteed cleared on teardown failure; teardown try/finally broadened to cover `chdir`; cleanup steps mirrored on the abort path; warning emitted on resume when persisted worktree is missing.
|
|
89
|
+
- **Empty-turn nudge** — no longer auto-replies to user questions; deferred on mid-line approval prompts.
|
|
90
|
+
- **Refuses project writes from `$HOME`** — and surfaces real SQL errors from `capture_thought` instead of swallowing them.
|
|
91
|
+
|
|
92
|
+
### VS Code & TUI
|
|
93
|
+
|
|
94
|
+
- **Checkpoint tree view** — registered in the VS Code extension; checkpoint file existence restored; RPC file-mutation events tracked; agent diff scoped to tracked files.
|
|
95
|
+
- **TUI image paste** — pasted images preserved on regular submit.
|
|
96
|
+
- **Bundled `/gsd` slash command protected** — core handler refuses to overwrite the bundled command.
|
|
97
|
+
|
|
98
|
+
See the full [Changelog](./CHANGELOG.md) for the complete v2.79 entry and prior releases.
|
|
99
|
+
|
|
100
|
+
<details>
|
|
101
|
+
<summary>v2.78 highlights</summary>
|
|
102
|
+
|
|
103
|
+
- **Slice-cadence worktree collapse (#4765)** — `git.collapse_cadence: "milestone" | "slice"` shrinks the orphan window per-slice; pair with `git.milestone_resquash: true` to collapse to one milestone commit
|
|
104
|
+
- **Worktree telemetry (#4764)** — journal events + `summarizeWorktreeTelemetry`; `/gsd forensics` worktree section with `worktree-orphan` and `worktree-unmerged-exit` anomalies
|
|
105
|
+
- **Worktree-aware canonical milestone root (#4761)** — `resolveCanonicalMilestoneRoot` routes validators through the live worktree
|
|
106
|
+
- **Bootstrap orphan audit (#4762)** — in-progress milestones with commits ahead of main are no longer skipped
|
|
107
|
+
- **Unified component system** — skills, agents, pipelines, and marketplace as one component model wired through runtime, dispatch, and telemetry
|
|
108
|
+
- **UnitContextManifest v2 (#4924, #4934)** — typed manifest with declarative tools-policy and typed computed artifacts; CI-guarded
|
|
109
|
+
- **Composer migration phase 3 (#4782)** — `complete-slice`, `research-milestone`, `run-uat`, `reassess-roadmap` build context through the manifest composer
|
|
110
|
+
- **Milestone scope classifier + pipeline variants (#4781)** — auto picks a pipeline variant from milestone shape
|
|
111
|
+
- **Per-unit-type skill manifest resolver (#4779)** — skills wire into specific unit types instead of being globally on
|
|
112
|
+
- **Single-writer-v3 control plane** — durable-state writer gaps closed
|
|
113
|
+
- **Extensions framework** — `gsd extensions install / update / uninstall / list / info / validate`; topological load order; cmux↔gsd decoupling via `cmux-events`; extracted `@gsd-extensions/google-search`
|
|
114
|
+
- **GPT-5.5 Codex support** + `xhigh` thinking level; auth mode in `/model`; permission granularity picker; headless auto default → `bypassPermissions` (#4657)
|
|
115
|
+
- **Major git-safety pass** — TOCTOU ancestry guard, atomic sync-lock with PID-verified stale override, `.git/index.lock` 5-min gate, env overlay strip, rebase/cherry-pick/revert detection, working-tree stash before `reset --hard`, unborn-branch worktree guard, user hooks + `commit.gpgsign` on auto-commits
|
|
116
|
+
- **Atomic `.gsd/` state writes**; **compaction correctness fix (#4665)**; **write-gate hardening (#4950)**; **auto state-machine** non-retriable policy errors (#4973), baseline restoration (#4961, #4966); slice + crash recovery; empty-turn recovery shape canonicalized
|
|
117
|
+
|
|
118
|
+
</details>
|
|
78
119
|
|
|
79
120
|
<details>
|
|
80
121
|
<summary>v2.77 highlights</summary>
|
|
@@ -320,25 +361,27 @@ The database is authoritative for milestones, slices, tasks, requirements, decis
|
|
|
320
361
|
|
|
321
362
|
2. **Context pre-loading** — The dispatch prompt includes inlined task plans, slice plans, prior task summaries, dependency summaries, roadmap excerpts, and decisions register. The LLM starts with everything it needs instead of spending tool calls reading files.
|
|
322
363
|
|
|
323
|
-
3. **
|
|
364
|
+
3. **Context Mode** — Context Mode is enabled by default and gives every auto-mode unit guidance for preserving context. Agents are steered toward `gsd_exec` for noisy scans, builds, tests, and diagnostics; full stdout/stderr is saved under `.gsd/exec/` while only a short digest enters the conversation. `gsd_exec_search` lets agents reuse prior runs instead of repeating expensive checks, and `gsd_resume` reads `.gsd/last-snapshot.md` after compaction or resume. Opt out with `context_mode.enabled: false`; tune sandbox timeout/output caps with `context_mode.exec_timeout_ms`, `context_mode.exec_stdout_cap_bytes`, and `context_mode.exec_digest_chars`.
|
|
365
|
+
|
|
366
|
+
4. **Git isolation** — When `git.isolation` is set to `worktree` or `branch`, each milestone runs on its own `milestone/<MID>` branch (in a worktree or in-place). All slice work commits sequentially — no branch switching, no merge conflicts. When the milestone completes, it's squash-merged to main as one clean commit. The default is `none` (work on the current branch), configurable via preferences. If `worktree` is configured in a repo with no committed `HEAD`, GSD temporarily behaves as `none` until the first commit exists because git worktrees need a committed start point.
|
|
324
367
|
|
|
325
|
-
|
|
368
|
+
5. **Crash recovery** — Auto mode persists worker state, unit-dispatch state, and paused-session metadata in the project-root SQLite database. If the session dies, the next `/gsd auto` reconstructs the interrupted unit from DB-backed runtime state, reads the surviving session file, synthesizes a recovery briefing from every tool call that made it to disk, and resumes with full context. Parallel orchestrator IPC still lives under `.gsd/parallel/`, so multi-worker sessions survive crashes too. In headless mode, crashes trigger automatic restart with exponential backoff (default 3 attempts).
|
|
326
369
|
|
|
327
|
-
|
|
370
|
+
6. **Provider error recovery** — Transient provider errors (rate limits, 500/503 server errors, overloaded) auto-resume after a delay. Permanent errors (auth, billing) pause for manual review. The model fallback chain retries transient network errors before switching models.
|
|
328
371
|
|
|
329
|
-
|
|
372
|
+
7. **Stuck and artifact detection** — A sliding-window detector identifies repeated dispatch patterns (including multi-unit cycles). Missing expected artifacts use a separate bounded path: GSD retries artifact verification up to 3 times with failure context, then pauses auto mode with the missing artifact error instead of looping indefinitely.
|
|
330
373
|
|
|
331
|
-
|
|
374
|
+
8. **Timeout supervision** — Soft timeout warns the LLM to wrap up. Idle watchdog detects stalls. Hard timeout pauses auto mode. Recovery steering nudges the LLM to finish durable output before giving up.
|
|
332
375
|
|
|
333
|
-
|
|
376
|
+
9. **Cost tracking** — Every unit's token usage and cost is captured, broken down by phase, slice, and model. The dashboard shows running totals and projections. Budget ceilings can pause auto mode before overspending.
|
|
334
377
|
|
|
335
|
-
|
|
378
|
+
10. **Adaptive replanning** — After each slice completes, the roadmap is reassessed. If the work revealed new information that changes the plan, slices are reordered, added, or removed before continuing.
|
|
336
379
|
|
|
337
|
-
|
|
380
|
+
11. **Verification enforcement** — Configure shell commands (`npm run lint`, `npm run test`, etc.) that run automatically after task execution. Failures trigger auto-fix retries before advancing. Auto-discovered checks from `package.json` run in advisory mode — they log warnings but don't block on pre-existing errors. Configurable via `verification_commands`, `verification_auto_fix`, and `verification_max_retries` preferences.
|
|
338
381
|
|
|
339
|
-
|
|
382
|
+
12. **Milestone validation** — After all slices complete, a `validate-milestone` gate compares roadmap success criteria against actual results before sealing the milestone.
|
|
340
383
|
|
|
341
|
-
|
|
384
|
+
13. **Escape hatch** — Press Escape to pause. The conversation is preserved. Interact with the agent, inspect what happened, or just `/gsd auto` to resume from disk state.
|
|
342
385
|
|
|
343
386
|
### `/gsd` and `/gsd next` — Step Mode
|
|
344
387
|
|
|
@@ -616,6 +659,10 @@ auto_report: true
|
|
|
616
659
|
| `unique_milestone_ids` | Uses unique milestone names to avoid clashes when working in teams of people |
|
|
617
660
|
| `git.isolation` | `none` (default), `worktree`, or `branch` — enable worktree or branch isolation for milestone work. `worktree` requires a committed `HEAD`; zero-commit repos temporarily run as `none` |
|
|
618
661
|
| `git.manage_gitignore` | Set `false` to prevent GSD from modifying `.gitignore` |
|
|
662
|
+
| `context_mode.enabled` | Context Mode is default-on; set `false` to disable `gsd_exec`, exec history guidance, and resume snapshots |
|
|
663
|
+
| `context_mode.exec_timeout_ms` | Timeout for sandboxed `gsd_exec` runs (default: 30000) |
|
|
664
|
+
| `context_mode.exec_stdout_cap_bytes` | Persisted stdout cap for `gsd_exec` output (default: 1048576) |
|
|
665
|
+
| `context_mode.exec_digest_chars` | Trailing stdout characters returned to the agent context (default: 300) |
|
|
619
666
|
| `verification_commands` | Array of shell commands to run after task execution (e.g., `["npm run lint", "npm run test"]`) |
|
|
620
667
|
| `verification_auto_fix` | Auto-retry on verification failures (default: true) |
|
|
621
668
|
| `verification_max_retries` | Max retries for verification failures (default: 2) |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
63159c1114dd0d48
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
function now() {
|
|
2
|
+
return Date.now();
|
|
3
|
+
}
|
|
4
|
+
export class AutoOrchestrator {
|
|
5
|
+
status = {
|
|
6
|
+
phase: "idle",
|
|
7
|
+
transitionCount: 0,
|
|
8
|
+
};
|
|
9
|
+
deps;
|
|
10
|
+
lastAdvanceKey = null;
|
|
11
|
+
constructor(deps) {
|
|
12
|
+
this.deps = deps;
|
|
13
|
+
}
|
|
14
|
+
async start(_sessionContext) {
|
|
15
|
+
this.lastAdvanceKey = null;
|
|
16
|
+
this.status.phase = "running";
|
|
17
|
+
this.bumpTransition();
|
|
18
|
+
await this.deps.runtime.journalTransition({ name: "start" });
|
|
19
|
+
await this.deps.notifications.notifyLifecycle({ name: "start" });
|
|
20
|
+
return this.advance();
|
|
21
|
+
}
|
|
22
|
+
async advance() {
|
|
23
|
+
try {
|
|
24
|
+
await this.deps.runtime.ensureLockOwnership();
|
|
25
|
+
const gate = await this.deps.health.preAdvanceGate();
|
|
26
|
+
if (!gate.allow) {
|
|
27
|
+
const blocked = { kind: "blocked", reason: gate.reason ?? "health gate blocked" };
|
|
28
|
+
await this.deps.runtime.journalTransition({ name: "advance-blocked", reason: blocked.reason });
|
|
29
|
+
await this.deps.health.postAdvanceRecord(blocked);
|
|
30
|
+
return blocked;
|
|
31
|
+
}
|
|
32
|
+
const decision = await this.deps.dispatch.decideNextUnit();
|
|
33
|
+
if (!decision) {
|
|
34
|
+
const stopped = { kind: "stopped", reason: "no remaining units" };
|
|
35
|
+
this.status.phase = "stopped";
|
|
36
|
+
this.status.activeUnit = undefined;
|
|
37
|
+
this.lastAdvanceKey = null;
|
|
38
|
+
this.bumpTransition();
|
|
39
|
+
await this.deps.runtime.journalTransition({ name: "advance-stopped", reason: stopped.reason });
|
|
40
|
+
await this.deps.health.postAdvanceRecord(stopped);
|
|
41
|
+
return stopped;
|
|
42
|
+
}
|
|
43
|
+
const nextKey = `${decision.unitType}:${decision.unitId}`;
|
|
44
|
+
if (this.lastAdvanceKey === nextKey) {
|
|
45
|
+
const blocked = { kind: "blocked", reason: "idempotent advance: unit already active" };
|
|
46
|
+
await this.deps.runtime.journalTransition({
|
|
47
|
+
name: "advance-blocked",
|
|
48
|
+
reason: blocked.reason,
|
|
49
|
+
unitType: decision.unitType,
|
|
50
|
+
unitId: decision.unitId,
|
|
51
|
+
});
|
|
52
|
+
await this.deps.health.postAdvanceRecord(blocked);
|
|
53
|
+
return blocked;
|
|
54
|
+
}
|
|
55
|
+
this.status.activeUnit = { unitType: decision.unitType, unitId: decision.unitId };
|
|
56
|
+
this.status.phase = "running";
|
|
57
|
+
this.lastAdvanceKey = nextKey;
|
|
58
|
+
this.bumpTransition();
|
|
59
|
+
await this.deps.runtime.journalTransition({
|
|
60
|
+
name: "advance",
|
|
61
|
+
reason: decision.reason,
|
|
62
|
+
unitType: decision.unitType,
|
|
63
|
+
unitId: decision.unitId,
|
|
64
|
+
});
|
|
65
|
+
await this.deps.worktree.prepareForUnit(decision.unitType, decision.unitId);
|
|
66
|
+
await this.deps.worktree.syncAfterUnit(decision.unitType, decision.unitId);
|
|
67
|
+
const advanced = { kind: "advanced" };
|
|
68
|
+
await this.deps.health.postAdvanceRecord(advanced);
|
|
69
|
+
return advanced;
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
const recovery = await this.deps.recovery.classifyAndRecover({
|
|
73
|
+
error,
|
|
74
|
+
unitType: this.status.activeUnit?.unitType,
|
|
75
|
+
unitId: this.status.activeUnit?.unitId,
|
|
76
|
+
});
|
|
77
|
+
const result = recovery.action === "retry"
|
|
78
|
+
? { kind: "paused", reason: recovery.reason }
|
|
79
|
+
: recovery.action === "escalate"
|
|
80
|
+
? { kind: "error", reason: recovery.reason }
|
|
81
|
+
: { kind: "stopped", reason: recovery.reason };
|
|
82
|
+
if (result.kind === "paused") {
|
|
83
|
+
this.status.phase = "paused";
|
|
84
|
+
}
|
|
85
|
+
else if (result.kind === "stopped") {
|
|
86
|
+
this.status.phase = "stopped";
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
this.status.phase = "error";
|
|
90
|
+
}
|
|
91
|
+
if (result.kind === "stopped") {
|
|
92
|
+
this.lastAdvanceKey = null;
|
|
93
|
+
this.status.activeUnit = undefined;
|
|
94
|
+
}
|
|
95
|
+
this.bumpTransition();
|
|
96
|
+
const journalName = result.kind === "paused"
|
|
97
|
+
? "advance-paused"
|
|
98
|
+
: result.kind === "stopped"
|
|
99
|
+
? "advance-stopped"
|
|
100
|
+
: "advance-error";
|
|
101
|
+
await this.deps.runtime.journalTransition({ name: journalName, reason: recovery.reason });
|
|
102
|
+
if (result.kind === "paused") {
|
|
103
|
+
await this.deps.notifications.notifyLifecycle({ name: "pause", detail: recovery.reason });
|
|
104
|
+
}
|
|
105
|
+
else if (result.kind === "stopped") {
|
|
106
|
+
await this.deps.notifications.notifyLifecycle({ name: "stopped", detail: recovery.reason });
|
|
107
|
+
}
|
|
108
|
+
else if (result.kind === "error") {
|
|
109
|
+
await this.deps.notifications.notifyLifecycle({ name: "error", detail: recovery.reason });
|
|
110
|
+
}
|
|
111
|
+
await this.deps.health.postAdvanceRecord(result);
|
|
112
|
+
return result;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
async resume() {
|
|
116
|
+
this.lastAdvanceKey = null;
|
|
117
|
+
this.status.phase = "running";
|
|
118
|
+
this.bumpTransition();
|
|
119
|
+
await this.deps.runtime.journalTransition({ name: "resume" });
|
|
120
|
+
await this.deps.notifications.notifyLifecycle({ name: "resume" });
|
|
121
|
+
return this.advance();
|
|
122
|
+
}
|
|
123
|
+
async stop(reason) {
|
|
124
|
+
if (this.status.phase === "stopped") {
|
|
125
|
+
return { kind: "stopped", reason };
|
|
126
|
+
}
|
|
127
|
+
await this.deps.worktree.cleanupOnStop(reason);
|
|
128
|
+
this.status.phase = "stopped";
|
|
129
|
+
this.status.activeUnit = undefined;
|
|
130
|
+
this.lastAdvanceKey = null;
|
|
131
|
+
this.bumpTransition();
|
|
132
|
+
await this.deps.runtime.journalTransition({ name: "stop", reason });
|
|
133
|
+
await this.deps.notifications.notifyLifecycle({ name: "stop", detail: reason });
|
|
134
|
+
return { kind: "stopped", reason };
|
|
135
|
+
}
|
|
136
|
+
getStatus() {
|
|
137
|
+
return { ...this.status, activeUnit: this.status.activeUnit ? { ...this.status.activeUnit } : undefined };
|
|
138
|
+
}
|
|
139
|
+
bumpTransition() {
|
|
140
|
+
this.status.transitionCount += 1;
|
|
141
|
+
this.status.lastTransitionAt = now();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
export function createAutoOrchestrator(deps) {
|
|
145
|
+
return new AutoOrchestrator(deps);
|
|
146
|
+
}
|
|
@@ -28,7 +28,7 @@ import { writeUnitRuntimeRecord } from "../unit-runtime.js";
|
|
|
28
28
|
import { withTimeout, FINALIZE_PRE_TIMEOUT_MS, FINALIZE_POST_TIMEOUT_MS } from "./finalize-timeout.js";
|
|
29
29
|
import { getEligibleSlices } from "../slice-parallel-eligibility.js";
|
|
30
30
|
import { startSliceParallel } from "../slice-parallel-orchestrator.js";
|
|
31
|
-
import { isDbAvailable, getMilestoneSlices } from "../gsd-db.js";
|
|
31
|
+
import { isDbAvailable, getMilestoneSlices, refreshOpenDatabaseFromDisk } from "../gsd-db.js";
|
|
32
32
|
import { ensurePlanV2Graph, isEmptyPlanV2GraphResult, isMissingFinalizedContextResult } from "../uok/plan-v2.js";
|
|
33
33
|
import { resolveUokFlags } from "../uok/flags.js";
|
|
34
34
|
import { UokGateRunner } from "../uok/gate-runner.js";
|
|
@@ -42,6 +42,13 @@ import { getWorkflowTransportSupportError, getRequiredWorkflowToolsForAutoUnit,
|
|
|
42
42
|
function isSamePathLocal(a, b) {
|
|
43
43
|
return normalizeWorktreePathForCompare(a) === normalizeWorktreePathForCompare(b);
|
|
44
44
|
}
|
|
45
|
+
function refreshPlanSliceRecoveryDbIfNeeded(unitType) {
|
|
46
|
+
if (unitType !== "plan-slice")
|
|
47
|
+
return true;
|
|
48
|
+
if (!isDbAvailable())
|
|
49
|
+
return true;
|
|
50
|
+
return refreshOpenDatabaseFromDisk();
|
|
51
|
+
}
|
|
45
52
|
// ─── Session timeout auto-resume state ────────────────────────────────────────
|
|
46
53
|
let consecutiveSessionTimeouts = 0;
|
|
47
54
|
const MAX_SESSION_TIMEOUT_AUTO_RESUMES = 3;
|
|
@@ -145,6 +152,22 @@ async function emitCancelledUnitEnd(ic, unitType, unitId, unitStartSeq, errorCon
|
|
|
145
152
|
causedBy: { flowId: ic.flowId, seq: unitStartSeq },
|
|
146
153
|
});
|
|
147
154
|
}
|
|
155
|
+
export function _buildCancelledUnitStopReason(unitType, unitId, errorContext) {
|
|
156
|
+
const cancellationMessage = errorContext?.message ?? "unknown";
|
|
157
|
+
const isSessionCreationFailure = errorContext?.category === "session-failed";
|
|
158
|
+
if (isSessionCreationFailure) {
|
|
159
|
+
return {
|
|
160
|
+
notifyMessage: `Session creation failed for ${unitType} ${unitId}: ${cancellationMessage}. Stopping auto-mode.`,
|
|
161
|
+
stopReason: `Session creation failed: ${cancellationMessage}`,
|
|
162
|
+
loopReason: "session-failed",
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
return {
|
|
166
|
+
notifyMessage: `Unit ${unitType} ${unitId} aborted after dispatch: ${cancellationMessage}. Stopping auto-mode.`,
|
|
167
|
+
stopReason: `Unit aborted: ${cancellationMessage}`,
|
|
168
|
+
loopReason: "unit-aborted",
|
|
169
|
+
};
|
|
170
|
+
}
|
|
148
171
|
async function failClosedOnFinalizeTimeout(ic, iterData, loopState, stage, startedAt) {
|
|
149
172
|
const { ctx, pi, s, deps } = ic;
|
|
150
173
|
const now = Date.now();
|
|
@@ -710,7 +733,10 @@ export async function runDispatch(ic, preData, loopState) {
|
|
|
710
733
|
// See: https://github.com/gsd-build/gsd-2/issues/2474
|
|
711
734
|
if (dispatchResult.level === "warning") {
|
|
712
735
|
ctx.ui.notify(dispatchResult.reason, "warning");
|
|
713
|
-
await deps.pauseAuto(ctx, pi
|
|
736
|
+
await deps.pauseAuto(ctx, pi, {
|
|
737
|
+
message: dispatchResult.reason,
|
|
738
|
+
category: "unknown",
|
|
739
|
+
});
|
|
714
740
|
}
|
|
715
741
|
else {
|
|
716
742
|
await closeoutAndStop(ctx, pi, s, deps, dispatchResult.reason);
|
|
@@ -770,7 +796,13 @@ export async function runDispatch(ic, preData, loopState) {
|
|
|
770
796
|
action: "artifact-found",
|
|
771
797
|
});
|
|
772
798
|
ctx.ui.notify(`Stuck recovery: artifact for ${unitType} ${unitId} found on disk. Invalidating caches.`, "info");
|
|
799
|
+
if (!refreshPlanSliceRecoveryDbIfNeeded(unitType)) {
|
|
800
|
+
ctx.ui.notify(`Stuck recovery found ${unitType} ${unitId} artifacts, but the DB refresh failed. Keeping stuck state for retry.`, "warning");
|
|
801
|
+
return { action: "continue" };
|
|
802
|
+
}
|
|
773
803
|
deps.invalidateAllCaches();
|
|
804
|
+
loopState.recentUnits.length = 0;
|
|
805
|
+
loopState.stuckRecoveryAttempts = 0;
|
|
774
806
|
return { action: "continue" };
|
|
775
807
|
}
|
|
776
808
|
ctx.ui.notify(`Stuck on ${unitType} ${unitId} (${stuckSignal.reason}). Invalidating caches and retrying.`, "warning");
|
|
@@ -778,6 +810,22 @@ export async function runDispatch(ic, preData, loopState) {
|
|
|
778
810
|
}
|
|
779
811
|
else {
|
|
780
812
|
// Level 2: hard stop — genuinely stuck
|
|
813
|
+
deps.invalidateAllCaches();
|
|
814
|
+
const artifactExists = verifyExpectedArtifact(unitType, unitId, s.basePath);
|
|
815
|
+
if (artifactExists && unitType !== "complete-milestone") {
|
|
816
|
+
debugLog("autoLoop", {
|
|
817
|
+
phase: "stuck-recovery",
|
|
818
|
+
level: 2,
|
|
819
|
+
action: "artifact-found",
|
|
820
|
+
});
|
|
821
|
+
ctx.ui.notify(`Stuck recovery: artifact for ${unitType} ${unitId} found on disk after cache invalidation. Continuing.`, "info");
|
|
822
|
+
if (refreshPlanSliceRecoveryDbIfNeeded(unitType)) {
|
|
823
|
+
loopState.recentUnits.length = 0;
|
|
824
|
+
loopState.stuckRecoveryAttempts = 0;
|
|
825
|
+
return { action: "continue" };
|
|
826
|
+
}
|
|
827
|
+
ctx.ui.notify(`Stuck recovery found ${unitType} ${unitId} artifacts, but the DB refresh failed. Stopping for manual recovery.`, "warning");
|
|
828
|
+
}
|
|
781
829
|
debugLog("autoLoop", {
|
|
782
830
|
phase: "stuck-detected",
|
|
783
831
|
unitType,
|
|
@@ -1089,7 +1137,12 @@ export async function runUnitPhase(ic, iterData, loopState, sidecarItem) {
|
|
|
1089
1137
|
s.lastGitActionFailure = null;
|
|
1090
1138
|
s.lastGitActionStatus = null;
|
|
1091
1139
|
s.lastUnitAgentEndMessages = null;
|
|
1092
|
-
setCurrentPhase(unitType
|
|
1140
|
+
setCurrentPhase(unitType, {
|
|
1141
|
+
basePath: s.basePath,
|
|
1142
|
+
traceId: ic.flowId,
|
|
1143
|
+
turnId: `iter-${ic.iteration}`,
|
|
1144
|
+
causedBy: "unit-start",
|
|
1145
|
+
});
|
|
1093
1146
|
s.lastToolInvocationError = null; // #2883: clear stale error from previous unit
|
|
1094
1147
|
const unitStartSeq = ic.nextSeq();
|
|
1095
1148
|
deps.emitJournalEvent({ ts: new Date().toISOString(), flowId: ic.flowId, seq: unitStartSeq, eventType: "unit-start", data: { unitType, unitId } });
|
|
@@ -1379,10 +1432,11 @@ export async function runUnitPhase(ic, iterData, loopState, sidecarItem) {
|
|
|
1379
1432
|
}
|
|
1380
1433
|
await deps.autoCommitUnit?.(s.basePath, unitType, unitId, ctx);
|
|
1381
1434
|
await emitCancelledUnitEnd(ic, unitType, unitId, unitStartSeq, unitResult.errorContext);
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1435
|
+
const cancelledStop = _buildCancelledUnitStopReason(unitType, unitId, unitResult.errorContext);
|
|
1436
|
+
ctx.ui.notify(cancelledStop.notifyMessage, "warning");
|
|
1437
|
+
await deps.stopAuto(ctx, pi, cancelledStop.stopReason);
|
|
1438
|
+
debugLog("autoLoop", { phase: "exit", reason: cancelledStop.loopReason });
|
|
1439
|
+
return { action: "break", reason: cancelledStop.loopReason };
|
|
1386
1440
|
}
|
|
1387
1441
|
// ── Immediate unit closeout (metrics, activity log, memory) ────────
|
|
1388
1442
|
// Run right after runUnit() returns so telemetry is never lost to a
|
|
@@ -148,6 +148,8 @@ export class AutoSession {
|
|
|
148
148
|
// ── Remote command polling ───────────────────────────────────────────────
|
|
149
149
|
/** Cleanup function returned by startCommandPolling(); null when not running. */
|
|
150
150
|
commandPollingCleanup = null;
|
|
151
|
+
// ── Orchestration seam ───────────────────────────────────────────────────
|
|
152
|
+
orchestration = null;
|
|
151
153
|
// ── Loop promise state ──────────────────────────────────────────────────
|
|
152
154
|
// Per-unit resolve function and session-switch guard live at module level
|
|
153
155
|
// in auto-loop.ts (_currentResolve, _sessionSwitchInFlight).
|
|
@@ -268,9 +270,12 @@ export class AutoSession {
|
|
|
268
270
|
this.sigtermHandler = null;
|
|
269
271
|
// Remote command polling — cleanup must be called before reset (auto.ts stopAuto)
|
|
270
272
|
this.commandPollingCleanup = null;
|
|
273
|
+
// Orchestration seam
|
|
274
|
+
this.orchestration = null;
|
|
271
275
|
// Loop promise state lives in auto-loop.ts module scope
|
|
272
276
|
}
|
|
273
277
|
toJSON() {
|
|
278
|
+
const orchestrationStatus = this.orchestration?.getStatus();
|
|
274
279
|
return {
|
|
275
280
|
active: this.active,
|
|
276
281
|
paused: this.paused,
|
|
@@ -280,6 +285,9 @@ export class AutoSession {
|
|
|
280
285
|
activeRunDir: this.activeRunDir,
|
|
281
286
|
currentMilestoneId: this.currentMilestoneId,
|
|
282
287
|
currentUnit: this.currentUnit,
|
|
288
|
+
orchestrationPhase: orchestrationStatus?.phase,
|
|
289
|
+
orchestrationTransitionCount: orchestrationStatus?.transitionCount,
|
|
290
|
+
orchestrationLastTransitionAt: orchestrationStatus?.lastTransitionAt,
|
|
283
291
|
unitDispatchCount: Object.fromEntries(this.unitDispatchCount),
|
|
284
292
|
};
|
|
285
293
|
}
|
|
@@ -128,9 +128,9 @@ export function diagnoseExpectedArtifact(unitType, unitId, base) {
|
|
|
128
128
|
}
|
|
129
129
|
return `${relSliceFile(base, mid, sid, "RESEARCH")} (slice research)`;
|
|
130
130
|
case "plan-slice":
|
|
131
|
-
return `${relSliceFile(base, mid, sid, "PLAN")} (slice plan)`;
|
|
131
|
+
return `${relSliceFile(base, mid, sid, "PLAN")} plus tasks/T##-PLAN.md files (slice plan and task plans)`;
|
|
132
132
|
case "refine-slice":
|
|
133
|
-
return `${relSliceFile(base, mid, sid, "PLAN")} (refined slice plan
|
|
133
|
+
return `${relSliceFile(base, mid, sid, "PLAN")} plus tasks/T##-PLAN.md files (refined slice plan and task plans)`;
|
|
134
134
|
case "execute-task": {
|
|
135
135
|
return `Task ${tid} marked [x] in ${relSliceFile(base, mid, sid, "PLAN")} + summary written`;
|
|
136
136
|
}
|
|
@@ -559,6 +559,8 @@ export const DISPATCH_RULES = [
|
|
|
559
559
|
const hasContext = !!(contextFile && (await loadFile(contextFile)));
|
|
560
560
|
if (hasContext)
|
|
561
561
|
return null; // fall through to next rule
|
|
562
|
+
if (prefs?.planning_depth === "deep")
|
|
563
|
+
return null;
|
|
562
564
|
// H6 fix (#4973): keep the non-deep auto-mode bypass, but do not
|
|
563
565
|
// pre-verify deep planning's user-facing milestone approval gate.
|
|
564
566
|
if (shouldBypassMilestoneDepthGateInAuto(prefs)) {
|