Skip to content

chore(deps): bump actions/checkout from 4 to 6 - #1

Merged
HenryLach merged 1 commit into
mainfrom
dependabot/github_actions/actions/checkout-6
Mar 15, 2026
Merged

chore(deps): bump actions/checkout from 4 to 6#1
HenryLach merged 1 commit into
mainfrom
dependabot/github_actions/actions/checkout-6

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Mar 14, 2026

Copy link
Copy Markdown
Contributor

Bumps actions/checkout from 4 to 6.

Release notes

Sourced from actions/checkout's releases.

v6.0.0

What's Changed

Full Changelog: actions/checkout@v5.0.0...v6.0.0

v6-beta

What's Changed

Updated persist-credentials to store the credentials under $RUNNER_TEMP instead of directly in the local git config.

This requires a minimum Actions Runner version of v2.329.0 to access the persisted credentials for Docker container action scenarios.

v5.0.1

What's Changed

Full Changelog: actions/checkout@v5...v5.0.1

v5.0.0

What's Changed

⚠️ Minimum Compatible Runner Version

v2.327.1
Release Notes

Make sure your runner is updated to this version or newer to use this release.

Full Changelog: actions/checkout@v4...v5.0.0

v4.3.1

What's Changed

Full Changelog: actions/checkout@v4...v4.3.1

v4.3.0

What's Changed

... (truncated)

Changelog

Sourced from actions/checkout's changelog.

Changelog

v6.0.2

v6.0.1

v6.0.0

v5.0.1

v5.0.0

v4.3.1

v4.3.0

v4.2.2

v4.2.1

v4.2.0

v4.1.7

v4.1.6

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot @github

dependabot Bot commented on behalf of github Mar 14, 2026

Copy link
Copy Markdown
Contributor Author

Labels

The following labels could not be found: chore. Please create it before Dependabot can add it to a pull request.

Please fix the above issues or remove invalid values from dependabot.yml.

@dependabot dependabot Bot added the dependencies Dependency updates label Mar 14, 2026
@dependabot
dependabot Bot requested a review from HenryLach as a code owner March 14, 2026 22:20
@dependabot dependabot Bot added the dependencies Dependency updates label Mar 14, 2026
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot
dependabot Bot force-pushed the dependabot/github_actions/actions/checkout-6 branch from 5869d78 to 09fc86d Compare March 14, 2026 22:22
@HenryLach
HenryLach enabled auto-merge (squash) March 15, 2026 00:32
@HenryLach
HenryLach merged commit d768371 into main Mar 15, 2026
1 check passed
@HenryLach
HenryLach deleted the dependabot/github_actions/actions/checkout-6 branch March 15, 2026 00:33
HenryLach added a commit that referenced this pull request Mar 15, 2026
…egate status

R002 finding #1: mergeWave() can return status='failed' with
failedLane=null for pre-lane setup errors (temp branch creation,
worktree creation). mergeWaveByRepo() previously only checked
failedLane !== null, missing these setup failures entirely.

Fix: Track anyRepoFailed flag based on groupResult.status !== 'succeeded'
(not just failedLane). This catches both lane-level failures AND setup
failures. firstFailureReason is populated with setup error context when
failedLane is null.

R002 finding #2: Updated test helper computeAggregateStatus to match
the real implementation (uses repoStatuses array instead of single
firstFailedLane). Added 4 new test cases for setup-failure scenarios:
- repo setup failure with no lanes → failed
- repo setup failure + other repo success → partial
- all repos setup failure → failed
- repo setup failure + other repo partial → partial

All 207 tests pass.
HenryLach added a commit that referenced this pull request Mar 16, 2026
…egate status

R002 finding #1: mergeWave() can return status='failed' with
failedLane=null for pre-lane setup errors (temp branch creation,
worktree creation). mergeWaveByRepo() previously only checked
failedLane !== null, missing these setup failures entirely.

Fix: Track anyRepoFailed flag based on groupResult.status !== 'succeeded'
(not just failedLane). This catches both lane-level failures AND setup
failures. firstFailureReason is populated with setup error context when
failedLane is null.

R002 finding #2: Updated test helper computeAggregateStatus to match
the real implementation (uses repoStatuses array instead of single
firstFailedLane). Added 4 new test cases for setup-failure scenarios:
- repo setup failure with no lanes → failed
- repo setup failure + other repo success → partial
- all repos setup failure → failed
- repo setup failure + other repo partial → partial

All 207 tests pass.
HenryLach added a commit that referenced this pull request Mar 16, 2026
…ing, dashboard (#21)

* fix(tests): update source file paths and vitest wrappers for refactored modules

Tests were reading from the old monolith task-orchestrator.ts but functions
were refactored into taskplane/ modules (formatting.ts, execution.ts,
worktree.ts, messages.ts, etc). Updated source resolution to read from all
modules. Added vitest dual-mode wrapper to orch-direct-implementation.
Updated isOrchestratedMode tests to match simplified implementation.

* feat(TP-004): repo-scoped lane allocation model

Step 0: Refactor lane allocation model

Type changes:
- Add repoId?: string to LaneAssignment, AllocatedLane, PersistedLaneRecord

New functions in waves.ts:
- groupTasksByRepo(): deterministic grouping by resolvedRepoId
- generateLaneId(): repo-aware lane ID (lane-N or repoId/lane-N)
- generateTmuxSessionName(): repo-aware session names

Updated functions:
- assignTasksToLanes(): optional laneOffset + repoId params
- allocateLanes(): groups by repo, allocates per group, globally
  unique lane numbers, repo-aware laneId/tmuxSessionName

Downstream propagation:
- persistence.ts: persist repoId on lane records
- resume.ts: restore repoId when reconstructing AllocatedLane

Compatibility:
- Repo mode (no resolvedRepoId): all tasks in single group,
  identical output to pre-TP-004 behavior
- Lane numbers globally unique (engine.ts/resume.ts assumptions preserved)
- laneNumber-keyed lookups in engine.ts/formatting.ts unchanged

* checkpoint: TP-004 Step 0 complete

* checkpoint: TP-004 Step 0 verified and STATUS.md updated

* feat(TP-004): make worktree operations repo-scoped

- Add resolveRepoRoot() helper: resolves repoId → absolute repo root path
  from workspace config, falls back to default repoRoot in repo mode
- Add resolveBaseBranch() helper: fallback chain (per-repo defaultBranch →
  detected current branch → batch baseBranch)
- Add workspaceConfig parameter to allocateLanes()
- Refactor Stage 3: loop over repo groups, call ensureLaneWorktrees() per
  group with group-specific repoRoot and baseBranch
- Add cross-repo rollback: on failure in repo group N, roll back all
  previously-created worktrees from groups 1..N-1
- Update Stage 4: build worktree lookup from per-repo results
- Remove duplicate function definitions from prior iteration
- Add 19 unit tests for new helpers (resolveRepoRoot, resolveBaseBranch,
  groupTasksByRepo, generateLaneId, generateTmuxSessionName)
- Zero new test failures (4 pre-existing failures unchanged)

* checkpoint: TP-004 Step 1 complete — repo-scoped worktree operations

* checkpoint: TP-004 Step 1 verification — all tests passing, implementation confirmed

* feat(TP-004): thread workspaceConfig through execution contracts and fix abort for workspace-mode sessions

- Add workspaceConfig parameter to executeWave() and pass to allocateLanes()
- Thread workspaceConfig from executeOrchBatch() and resumeOrchBatch()
- Fix selectAbortTargetSessions() to match workspace-mode session names
  (<prefix>-<repoId>-lane-<N>) in addition to repo-mode (<prefix>-lane-<N>)
- Source laneId from PersistedLaneRecord instead of reconstructing as
  lane-${laneNumber}, preserving repo dimension in workspace mode
- Verify cleanup is already repo-agnostic (listWorktrees uses prefix matching)
- Add 7 unit tests for workspace-mode abort behavior

* docs(TP-004): document repo-scoped lane allocation and worktree lifecycle

- Add section 9 to waves-lanes-and-worktrees.md covering workspace mode:
  repo grouping, lane identity format, per-repo worktree provisioning,
  cross-repo rollback, and abort compatibility
- Create .pi/local/docs/taskplane/polyrepo-support-spec.md (internal,
  gitignored) as comprehensive reference for finalized lane identity
  contract and repo-scoped worktree rules
- Verify messages.ts unaffected: uses numeric laneNumber (globally unique),
  not string laneId

* checkpoint: TP-004 task artifacts (.DONE, STATUS.md)

* feat(TP-011): add strict-routing policy controls

- Add WorkspaceRoutingConfig.strict boolean field (default: false)
- Add TASK_ROUTING_STRICT fatal discovery error code
- Parse routing.strict from taskplane-workspace.yaml
- Enforce strict mode in resolveTaskRouting(): require explicit
  promptRepoId when strict is enabled, with actionable remediation
  guidance pointing users to ## Execution Target section
- Repo mode and permissive workspace mode behavior unchanged

* test(TP-011): add strict routing policy tests (19.x-24.x)

- 19 new tests covering strict routing enforcement in discovery
- Tests: strict mode rejects tasks without promptRepoId (19.x)
- Tests: strict mode accepts tasks with valid promptRepoId (20.x)
- Tests: permissive mode behavior unchanged / non-regression (21.x)
- Tests: TASK_ROUTING_STRICT is classified as fatal (22.x)
- Tests: repo mode unaffected by strict routing (23.x)
- Tests: end-to-end strict routing via runDiscovery pipeline (24.x)
- All 87 routing tests pass

* checkpoint: TP-011 Step 1 complete — verify strict routing enforcement in discovery pipeline

* checkpoint: TP-011 Step 1 status update — update test counts and execution log

* test(TP-011): add governance scenario tests (27.1-27.5) for strict vs permissive routing

* checkpoint: TP-011 Step 2 complete — governance scenarios verified, test counts updated

* checkpoint: TP-011 Step 3 complete — all tests verified, CLI smoke checks pass

* checkpoint: TP-011 Step 3 re-verified — all tests passing, CLI smoke OK

* checkpoint: TP-011 task artifacts (.DONE, STATUS.md)

* feat(TP-005): repo-scoped merge orchestration — partition by repo

- Add groupLanesByRepo() to partition lanes by repoId
- Add mergeWaveByRepo() that runs per-repo merge loops with correct
  repo roots and base branches (via resolveRepoRoot/resolveBaseBranch)
- In repo mode, single group passthrough preserves existing behavior
- In workspace mode, each repo group merges independently; failures in
  one repo don't block merging in other repos
- Add RepoMergeOutcome type for per-repo attribution on MergeWaveResult
- Add repoId field to MergeLaneResult for post-merge branch cleanup
- Update engine.ts to call mergeWaveByRepo with workspaceConfig
- Update engine.ts post-merge branch cleanup to use per-lane repo root
- Update resume.ts merge calls to use mergeWaveByRepo with workspaceConfig
- Update resume.ts branch cleanup to use per-lane repo root
- Fix hardcoded 'into develop' message text in messages.ts
- Add merge-repo-scoped.test.ts (10 tests: grouping, ordering, types)
- All 216 tests pass

* checkpoint: TP-005 Step 0 — hydrate plan per R001, mark complete

* fix(TP-005): address R002 findings — repoId propagation, status rollup, tests

- Set repoId on MergeLaneResult in mergeWave() success and error paths
- Fix aggregate status logic in mergeWaveByRepo() to use lane-level evidence
  (anyLaneSucceeded/anyLaneFailed) instead of repo-level status, correctly
  classifying 'all repos partial' as global partial (not failed)
- Add 10 new test cases: status rollup edge cases (all-succeed, mixed,
  all-fail, all-partial, vacuous, error-only, error+success) and repoId
  propagation verification

* checkpoint: TP-005 Step 0 — R002 findings addressed, re-verified

* fix(TP-005): detect repo-level setup failures in mergeWaveByRepo aggregate status

R002 finding #1: mergeWave() can return status='failed' with
failedLane=null for pre-lane setup errors (temp branch creation,
worktree creation). mergeWaveByRepo() previously only checked
failedLane !== null, missing these setup failures entirely.

Fix: Track anyRepoFailed flag based on groupResult.status !== 'succeeded'
(not just failedLane). This catches both lane-level failures AND setup
failures. firstFailureReason is populated with setup error context when
failedLane is null.

R002 finding #2: Updated test helper computeAggregateStatus to match
the real implementation (uses repoStatuses array instead of single
firstFailedLane). Added 4 new test cases for setup-failure scenarios:
- repo setup failure with no lanes → failed
- repo setup failure + other repo success → partial
- all repos setup failure → failed
- repo setup failure + other repo partial → partial

All 207 tests pass.

* checkpoint: TP-005 Step 0 R002 iter2 fixes applied, tests passing

* feat(TP-005): add repo-divergence partial-success summaries for merge outcomes

Step 1 implementation:
- Add formatRepoMergeSummary() shared helper in messages.ts
- Add orchMergePartialRepoSummary template to ORCH_MESSAGES
- Wire partial-summary emission in both engine.ts and resume.ts
- Emit repo-divergence summary only when status=partial AND
  repoResults show different statuses across repos
- No misleading repo-divergence text for mixed-outcome-lane partials
- 8 new test assertions covering: divergence formatting, mono-repo,
  deterministic ordering, template usage, same-status suppression,
  single-group suppression, mixed-outcome-lane suppression

* checkpoint: TP-005 Step 1 complete — repo-divergence partial-success summaries

* feat(TP-005): harden failure behavior with shared merge-failure policy helper

Step 2: Extract computeMergeFailurePolicy() pure function into messages.ts.
Both engine.ts and resume.ts now use this shared helper to guarantee
identical pause/abort policy decisions, failure attribution, error
messages, and notifications on repo-scoped merge failures.

Changes:
- messages.ts: add MergeFailurePolicyResult type and computeMergeFailurePolicy()
- engine.ts: replace inline merge-failure handler with shared helper call
- resume.ts: replace inline merge-failure handler with shared helper call (parity fix)
- tests: 7 new test sections (19-25) covering pause/abort policy, setup failures,
  multi-lane attribution, engine/resume parity, reason truncation, determinism

* checkpoint: TP-005 Step 2 verified — repo-level fallback + 15 policy tests, all 207 pass

* checkpoint: TP-005 step 3 testing & verification complete — 207/207 tests green

* fix(TP-005): R008 revise — dedupe review table, fix exact CLI command in execution log

* checkpoint: TP-005 task artifacts (.DONE, STATUS.md)

* feat(TP-006): define schema v2 — repo-aware fields on PersistedBatchState, PersistedTaskRecord, PersistedLaneRecord

- Bump BATCH_STATE_SCHEMA_VERSION from 1 to 2
- Add mode: WorkspaceMode to PersistedBatchState and OrchBatchRuntimeState
- Add repoId, resolvedRepoId to PersistedTaskRecord (optional, v2)
- Formalize repoId contract on PersistedLaneRecord with mode semantics
- Update serializeBatchState() to write mode and task repo fields
- Update persistRuntimeState() to enrich unallocated tasks with repo fields from discovery
- Document version history, compatibility policy, and field contracts in types.ts
- Document schema contract, fixture impact map, and test plan in STATUS.md

* feat(TP-006): implement v1→v2 upconversion, validation, fixtures, and tests

- persistence.ts: upconvertV1toV2() auto-upgrades v1 state files in memory
- persistence.ts: validatePersistedState accepts v1 and v2, rejects others
- persistence.ts: validates v2 optional fields (task repoId/resolvedRepoId,
  lane repoId, mode) with type checks
- persistence.ts: serializeBatchState emits mode and task repo fields
- persistence.ts: persistRuntimeState enriches task repo fields from discovery
- fixtures: batch-state-valid.json updated to v2 schema
- fixtures: new batch-state-v1-valid.json for backward compat testing
- fixtures: new batch-state-v2-workspace.json for workspace mode testing
- fixtures: bad-enums, bad-task-status, missing-fields bumped to v2
- tests: orch-state-persistence.test.ts updated to match v2 schema
  (constant, validator reimplementation, assertions)
- All 207 tests passing across 11 test files

* fix(TP-006): strict v2 mode validation and mode propagation in engine/resume

- Validate mode is required for schema v2 files (missing → STATE_SCHEMA_INVALID)
- Set batchState.mode from workspaceConfig in engine.ts (fresh batch start)
- Set batchState.mode from persistedState.mode in resume.ts (resume reconstruction)
- Add mode field to v2 test fixtures (bad-enums, bad-task-status)
- Add test: v2 missing mode rejected, v1 upconverts mode to 'repo'
- Update test reimplementation to match strict v2 validation

Addresses R002 code review findings for Step 0.

* feat(TP-006): step 1 — serialization and validation for repo-aware v2 fields

- Hydrate Step 1 plan per R003 review (6 granular checkboxes)
- Add malformed repo-aware record fixture (batch-state-v2-bad-repo-fields.json)
- Add comprehensive validator tests: null/object/array/boolean type rejection
  for task repoId, resolvedRepoId, and lane repoId; invalid/numeric/boolean
  mode values; empty-string acceptance (structurally valid); fixture test
- Fix serializeBatchState test reimplementation to build full task registry
  from wavePlan + outcomes (matching source behavior)
- Add serialization checkpoint tests: allocated workspace tasks, repo-mode
  field omission, discovery enrichment for unallocated tasks, full round-trip
- Update E2E test expectations for full task registry (5 tasks from wavePlan)
- All 207 tests passing across 11 test files

* checkpoint: TP-006 step 1 complete — serialization and validation

* checkpoint: TP-006 step 1 verified — all 207 tests passing, 357 assertions

* fix(TP-006): align test reimplementations with source — R004 fixes

- Serializer: use state.mode/baseBranch/mergeResults instead of hardcoded values
- reconcileTaskStates: add worktreeExists param and re-execute action (precedence 4)
- computeResumePoint: add reExecuteTaskIds, use re-execute (not mark-failed) for pending
- analyzeOrchestratorStartupState: add resumable-phase awareness for cleanup-stale
- Fix assertion: mark-failed tasks go to failedTaskIds not pendingTaskIds

* fix(TP-006): align test reimplementations with source for R004 review

- serializeBatchState: use state.mode ?? 'repo' instead of hardcoded 'repo'
- serializeBatchState: use state.mergeResults with 1-based→0-based normalization
- MinimalBatchState: add mode, baseBranch, mergeResults fields
- analyzeOrchestratorStartupState: add resumable-phase filtering logic
  (paused/executing/merging are resumable; others with 0 completed → cleanup)
- reconcileTaskStates: add existingWorktrees param and re-execute action
- computeResumePoint: add reExecuteTaskIds, fix pending categorization
  (mark-failed tasks are failed, not pending per source)
- Fix T3 assertion: pending+dead+no-worktree → mark-failed → failedTaskIds
- All 207 tests passing

* checkpoint: TP-006 step 1 R004 fixes verified — 207 tests passing

* test(TP-006): add v1→v2 schema compatibility regression tests

Add section 1.4 to orch-state-persistence.test.ts with 8 regression
tests covering loadBatchState v1/v2 loading paths:
- v1 fixture upconversion (schemaVersion=2, mode=repo, records intact)
- v1 file NOT rewritten on load (byte-level on-disk comparison)
- v2 repo-mode fixture loading
- v2 workspace-mode fixture with repo-aware fields
- Unsupported schema version rejection
- Malformed JSON rejection
- v2 missing required mode rejection
- v1→save→load round-trip producing v2 on disk

All 207 tests passing.

* checkpoint: TP-006 step 2 complete — v1 schema compatibility verified, 207 tests passing

Step 2 (Handle schema v1 compatibility) confirmed complete:
- Compatibility policy verified: loadBatchState → validatePersistedState → upconvertV1toV2 (in-memory only)
- 11 regression tests in sections 7.1–7.3: v1 load path, no-rewrite guarantee, v2 load paths, version guardrails (v0/v3/v99), malformed JSON, missing mode, v1 resume pipeline
- STATUS.md updated with Step 2 audit notes and execution log

* checkpoint: TP-006 task artifacts (.DONE, STATUS.md)

* checkpoint: TP-010 Step 0 complete — naming contract defined with operator ID, fallback matrix, parser compat plan

* feat(TP-010): apply naming contract — operator-scoped sessions, worktrees, branches, merge artifacts

- Create naming.ts with resolveOperatorId(), sanitizeNameComponent(), resolveRepoSlug()
- Add operator_id to OrchestratorConfig (auto-detected from OS username)
- Update TMUX sessions: {prefix}-{opId}-lane-{N} / {prefix}-{opId}-{repoId}-lane-{N}
- Update branches: task/{opId}-lane-{N}-{batchId}
- Update worktree dirs: {prefix}-{opId}-{N}
- Update merge: temp branch, workspace dir, session names, sidecar files
- Operator-scoped listWorktrees() with legacy fallback for opId='op'
- Propagate opId through waves.ts, worktree.ts, merge.ts, engine.ts, resume.ts
- Update tests for new naming patterns (207/207 passing)

* checkpoint: TP-010 Step 1 complete — naming contract applied consistently, all tests passing

* test(TP-010): add collision resistance validation tests (Step 2)

- Created naming-collision.test.ts with 48 tests in 4 categories:
  2a: Collision test matrix (multi-operator, multi-repo, concurrent batches)
  2b: Ownership-safe consumer validation (parseOrchSessionNames, sidecar cleanup)
  2c: Human-readability validation (length budgets, token order, sort order)
  2d: Sanitization edge cases (case folding, truncation collision documentation)
- Documented prefix-only cleanup/abort as intended team behavior
- Documented sanitization collision risks (case folding, special char normalization, truncation)
- All 255 tests passing

* test(TP-010): add naming collision resistance tests (83 tests)

Step 2: Validate collision resistance
- Collision matrix: operator × repo × batch × lane uniqueness for all artifact types
  (TMUX sessions, worktree paths, branches, merge temp branches, merge sidecars, merge sessions, merge workspace dirs)
- Shared-environment interference: parseOrchSessionNames prefix filtering, listWorktrees opId scoping,
  sidecar filename uniqueness, abort prefix-scoped kill (documented as intended team behavior)
- Human-readability: length bounds (TMUX ≤64, branches ≤100), token order consistency,
  safe character validation, provenance parseability, naming contract examples verification
- Naming utilities: sanitizeNameComponent, resolveOperatorId, resolveRepoSlug edge cases

All 290 tests passing (207 existing + 83 new).

* checkpoint: TP-010 Step 3 complete — all 290 tests passing, CLI smoke OK

* docs(TP-010): add operator_id config reference and naming contract docs

* feat(TP-007): repo-aware reconciliation — verify existing impl + add collectRepoRoots helper + mixed-repo tests

Step 0: Implement repo-aware reconciliation

- Verified that resume.ts already has repo-aware patterns for all 4 critical
  areas: reconnect polling, re-execute spawning, inter-wave worktree reset,
  and terminal worktree cleanup (from prior TP-005/TP-006 work)
- Added collectRepoRoots() helper function for collecting unique repo roots
  from persisted lane records (usable for test and future refactoring)
- Added 10 new tests for mixed-repo reconciliation scenarios:
  - Workspace v2: one repo lane alive + another dead
  - Workspace v2: .DONE in one repo + dead session in another
  - v1 state (no repo fields) reconciles correctly
  - Worktree exists vs missing split across repos
  - resolveRepoRoot integration (v2 vs v1/undefined)
  - collectRepoRoots for workspace and repo modes
  - computeResumePoint with mixed cross-repo outcomes
- Updated PersistedBatchStateForTest interface with mode/baseBranch fields
- All 290 tests passing across 12 test files

* feat(TP-007): repo-aware reconciliation in resumeOrchBatch

- Fix reconnect polling to use resolveRepoRoot() per-lane
- Fix re-execute spawning to use resolveRepoRoot() per-lane
- Fix inter-wave worktree reset to iterate unique repo roots
- Fix terminal worktree cleanup to iterate unique repo roots
- Add 8 mixed-repo reconciliation tests (section 8.1)
- v1 state files resume identically (undefined repoId → default root)

* feat(TP-007): repo-aware resume point computation with pending/blocked/skipped determinism

- Add 'pending' reconciliation action for never-started future-wave tasks
  (pending + no session) to prevent incorrect mark-failed classification
- Add 'skipped' to wave-skip condition in computeResumePoint (pre-existing gap)
- Fix blocked task counter double-counting with persistedBlockedTaskIds tracking
- Separate mark-complete from skip case in categorization for clarity
- Add 8 new test cases covering pending-vs-failed, skipped wave-skip,
  all-failed wave, counter stability, cross-repo blocked propagation,
  v1 fallback parity
- All 290 tests passing across 12 test files

* checkpoint: TP-007 Step 1 complete — resume point computation with repo-aware semantics

* feat(TP-007): execute resumed waves safely — fix re-exec merge indexing, blocked counter, repo attribution

Step 2 implementation:
- Fix re-exec merge indexing: use sentinel waveIndex -1, clamp persistence
  normalization with Math.max(0, ...) to prevent negative indices
- Fix blocked counter: count persisted-blocked tasks in unvisited waves
  at resume init (tasks blocked before their wave was entered were never counted)
- Fix repo attribution carry-forward: reconstructAllocatedLanes now accepts
  persistedTasks parameter to inject repoId/resolvedRepoId/taskFolder from
  prior state onto reconstructed AllocatedTask stubs
- Replace inline per-repo root collection loops with collectRepoRoots() helper
- Add 7 new tests covering checkpoint round-trip, blocked counter semantics,
  re-exec merge persistence, and mixed-repo metadata preservation
- All 290 tests passing across 12 test files

* checkpoint: TP-007 Step 2 verified — encounteredRepoRoots tracking, collectAllRepoRoots helper, 740 assertions passing

* test(TP-007): Step 3 complete — 290/290 tests pass, CLI smoke pass

* checkpoint: TP-007 task artifacts (.DONE, STATUS.md)

* feat(TP-009): add mode field to dashboard payload, verify repo field passthrough

Step 0: Extend dashboard data model — complete.

- Add batch.mode field ('repo'|'workspace') to buildDashboardState()
  in dashboard/server.cjs so the frontend knows the workspace mode.
- Verified that lane repoId, task repoId/resolvedRepoId, and merge
  repoResults already flow through from persisted state (TP-006).
- All 290 tests passing, CLI smoke check OK.
- Additive-only changes — backward compatible.

* feat(TP-009): add repoResults to persisted merge records for dashboard repo-aware observability

- Add PersistedRepoMergeOutcome type for compact per-repo merge outcomes
- Add optional repoResults field to PersistedMergeResult interface
- Serialize MergeWaveResult.repoResults in serializeBatchState()
- Add validation for repoResults in validatePersistedState()
- Additive-only: absent/undefined in repo mode, backward compatible

* feat(TP-009): implement repo-aware dashboard UI with filter, badges, and merge grouping

- Add repo filter dropdown to header (index.html), hidden by default
- Add repo badge styles and merge sub-row styles (style.css)
- Implement buildRepoSet() to derive repos from lanes/tasks/mergeResults
- Implement updateRepoFilter() with disappearing-repo reset to 'All'
- Add repo badges to lane headers and task rows in renderLanesTasks()
- Add per-repo sub-rows in renderMergeAgents() for workspace mode
- Filter lanes/tasks/merge panels consistently by selected repo
- Gate all repo UI by mode=workspace AND 2+ distinct repos
- Summary bar and footer remain global (unfiltered)
- No changes to conversation/STATUS.md viewer panels

* checkpoint: TP-009 Step 2 complete — verified monorepo UX and viewer panel guarantees

* checkpoint: TP-009 task artifacts (.DONE, STATUS.md)

* feat(TP-012): build polyrepo fixture workspace — Step 0

- Create polyrepo-builder.ts: runtime fixture with non-git workspace root,
  3 git repos (docs, api, frontend), shared task root, 3 task areas
- Define 6-task matrix with cross-repo deps spanning 3 waves:
  Wave 1: SH-001, AP-001, UI-001 (independent)
  Wave 2: AP-002, UI-002 (same-repo + cross-repo deps)
  Wave 3: SH-002 (cross-repo deps on wave 2)
- Add batch-state-v2-polyrepo.json static fixture for resume tests
- Add polyrepo-fixture.test.ts with 32 acceptance tests covering:
  topology, workspace config, discovery/routing, wave shape,
  static fixture validation, and ParsedTask builder helpers
- All 322 tests pass (including 32 new)

* test(TP-012): add polyrepo end-to-end regression tests

47 tests covering:
- /task routing with polyrepo discovery (4 tests)
- /orch-plan wave computation and lane allocation (7 tests)
- Serialization of repo-aware persisted state (4 tests)
- Per-repo merge outcomes and partial failures (4 tests)
- Resume reconciliation and resume-point for workspace mode (10 tests)
- Collision-safe naming across repos (8 tests)
- Repo-aware state validation and v1→v2 upconversion (10 tests)

All 369 suite tests pass.

* checkpoint: TP-012 Step 1 complete — 47/47 polyrepo regression tests pass, 369/369 suite

* test(TP-012): add monorepo compatibility regression tests and fixture docs

- Create monorepo-compat-regression.test.ts with 34 tests guarding:
  - v1→v2 persistence upconversion (mode=repo, no repo fields)
  - Repo-mode discovery (no routing, no resolvedRepoId)
  - Repo-mode naming (no repoId segments in lane IDs/sessions)
  - Repo-mode merge grouping (single group for undefined-repoId lanes)
  - Repo-mode resume (mode-agnostic eligibility, proper reconstruction)
  - Repo-mode serialization round-trip (serialize → validate → no repo fields)
  - freshOrchBatchState defaults regression

- Update docs/maintainers/testing.md with:
  - Polyrepo fixture usage guide and when to use polyrepo vs monorepo tests
  - Fixture limitations (temp FS, no real git history, fixed topology)
  - Updated key files listing

All 403 tests pass across 15 test files.

* docs(TP-012): add fixture files table, test file organization, and limitation to testing.md

* checkpoint: TP-012 step 3 testing & verification complete — 398/398 tests pass

* checkpoint: TP-012 task artifacts (.DONE, STATUS.md)
HenryLach added a commit that referenced this pull request Mar 17, 2026
HenryLach added a commit that referenced this pull request Mar 17, 2026
… (already implemented), fix stale module header
HenryLach added a commit that referenced this pull request Mar 17, 2026
* checkpoint: TP-014 fix R006 revisions — explicit key mapping preserves record keys in YAML→camelCase and camelCase→snake_case adapters, resolveConfigRoot uses per-file precedence

* checkpoint: TP-014 Step 2 R006 revisions complete - all 3 issues fixed

* hydrate: expand Step 3 checkboxes per R007 review

* test(TP-014): add project-config-loader tests — precedence/error matrix (50 tests passing)

* checkpoint: TP-014 workspace root resolution tests verified

* checkpoint: TP-014 key-preservation and adapter regression tests verified

* checkpoint: TP-014 defaults non-mutation and backward-compat wrappers verified

* checkpoint: TP-014 Step 3 complete — all 434 tests passing (16 files)

* hydrate: add R008 revision items to Step 3

* test(TP-014): fix test 4.5 to exercise loadProjectConfig throw + default fallback per R008

* test(TP-014): fix test 4.5 to actually call task-runner loadConfig with malformed JSON

* checkpoint: TP-014 Step 3 R008 revisions complete — all 434 tests passing

* test(TP-014): clean up test 4.5 to use static import of loadConfig instead of require()

* hydrate: expand Step 4 checkboxes per R009 review

* docs(TP-014): add JSON config section to task-runner.yaml.md reference

* docs(TP-014): add JSON config section to task-orchestrator.yaml.md reference

* checkpoint: TP-014 install.md checked - no update needed, YAML scaffolding references still correct

* checkpoint: TP-014 task artifacts (.DONE, STATUS.md)

* feat(TP-014): complete Step 4 - documentation & delivery, .DONE created

* hydrate: TP-017 expand Step 0 checkboxes per R001 review

* hydrate: TP-015 expand Step 0 checkboxes per R001 review

* checkpoint: TP-017 preflight path convention confirmed with PI_CODING_AGENT_DIR override and cross-platform resolution

* checkpoint: TP-015 read current cmdInit() implementation

* checkpoint: TP-015 read spec auto-detection and gitignore sections

* checkpoint: TP-015 verify spec reachability (found in main repo .pi/local/docs/)

* checkpoint: TP-015 verify TP-014 config loader/schema contract

* checkpoint: TP-015 record current cmdInit() behavior to preserve

* checkpoint: TP-015 identify downstream validation (no init-specific tests exist)

* checkpoint: TP-015 Step 0 Preflight complete

* checkpoint: TP-015 Step 0 preflight complete - all items verified

* hydrate: TP-017 expand Step 1 checkboxes with R002 review feedback

* checkpoint: TP-017 preferences schema, allowlist, and types defined in preferences.ts

* checkpoint: TP-017 loadUserPreferences and resolveUserPreferencesPath implemented

* hydrate: TP-015 add R002 revision items to Step 0

* checkpoint: TP-015 revert TP-014 file changes from TP-015 commits (R002 fix)

* checkpoint: TP-015 fix malformed STATUS.md tables (R002 revision)

* checkpoint: TP-015 Step 0 complete, orchestrator advancing to Step 1

* checkpoint: TP-017 merge logic updated with mergeModel, dashboardPort, empty-string semantics

* checkpoint: TP-017 Step 1 complete — exports wired, all 434 tests pass

* checkpoint: TP-017 Step 1 verified complete — all checkboxes done, 434 tests pass

* hydrate: expand Step 1 checkboxes per R003 review

* hydrate: TP-017 expand Step 2 checkboxes per R003 review

* checkpoint: TP-015 detection logic implemented (isGitRepo, findSubdirectoryGitRepos, detectInitMode)

* checkpoint: TP-015 error path verified (no git repo, no subdirectory repos)

* checkpoint: TP-015 ambiguous case handled (prompt + preset bypass)

* checkpoint: TP-015 Scenario B already-initialized detection verified

* checkpoint: TP-017 tests for path resolution, loading edge cases, unknown-key dropping

* checkpoint: TP-017 Layer 2 guardrails tests confirmed

* checkpoint: TP-017 merge integration tests confirmed (JSON + YAML backed, e2e)

* checkpoint: TP-017 Step 2 complete — full test suite passes (17 files, 461 tests)

* checkpoint: TP-015 all mode detection branches validated (repo, workspace, ambiguous, error)

* checkpoint: TP-015 Step 1 Mode Auto-Detection complete

* hydrate: TP-017 expand Step 3 checkboxes per R004 review

* checkpoint: TP-017 task artifacts (.DONE, STATUS.md)

* checkpoint: TP-017 verified completion criteria

* checkpoint: TP-017 confirmed no docs need updating

* checkpoint: TP-017 .DONE created

* feat(TP-017): user preferences layer complete

* hydrate: TP-015 add R004 revision items to Step 1

* checkpoint: TP-017 Step 3 complete — all items verified

* checkpoint: TP-015 fix findSubdirectoryGitRepos to use isGitRepoRoot

* checkpoint: TP-015 fix existingConfigPath mismatch for ambiguous→workspace resolution

* checkpoint: TP-015 Step 1 complete — all R004 revision items addressed

* hydrate: expand Step 2 checkboxes based on R005 review

* checkpoint: TP-015 define gitignore constants and reusable helpers

* checkpoint: TP-015 ensureGitignoreEntries and detectAndOfferUntrackArtifacts helpers implemented

* checkpoint: TP-015 integrate gitignore enforcement into cmdInit repo-mode flow

* checkpoint: TP-015 tracked-artifact detection and git rm --cached offer implemented

* checkpoint: TP-015 Step 2 complete — gitignore enforcement with dry-run output

* checkpoint: TP-015 Step 2 verified complete — all gitignore enforcement items done

* hydrate: TP-015 add R006 revision items to Step 2

* hydrate: TP-015 add R006 revision items to Step 2

* checkpoint: TP-015 fix patternToRegex directory prefix matching and switch to execFileSync

* checkpoint: TP-015 remove dead buildGitignoreBlock function

* checkpoint: TP-015 add gitignore pattern matching tests (18 tests), Step 2 R006 revisions complete

* feat(TP-015): R006 extract gitignore patterns to testable module with 26 tests

* hydrate: TP-015 expand Step 3 checkboxes based on R007 review

* checkpoint: TP-015 implement detectSpawnMode() reusable helper

* checkpoint: TP-015 wire spawn_mode into generateOrchestratorYaml via vars

* checkpoint: TP-015 tmux guidance message with preset/runner-only/dry-run handling

* checkpoint: TP-015 Step 3 verified and complete — tmux/spawn mode detection

* checkpoint: TP-015 Step 3 verification complete — all tmux detection behaviors verified

* hydrate: expand Step 4 checkboxes based on R009 review

* checkpoint: TP-015 config repo selection prompt and workspace vars gathering verified

* checkpoint: TP-015 .taskplane/ scaffolding in config repo verified

* checkpoint: TP-015 gitignore enforcement in config repo verified

* checkpoint: TP-015 pointer file creation verified

* checkpoint: TP-015 dry-run/preset/force compatibility for workspace mode verified

* checkpoint: TP-015 Step 4 complete — workspace mode init (Scenario C)

* hydrate: add R010 revision items to Step 4

* checkpoint: TP-015 R010 fix workspace gitignore prefix and tracked-artifact scanning

* checkpoint: TP-015 R010 include .gitignore in workspace auto-commit staging

* checkpoint: TP-015 R010 fix overwrite confirmation skipIfExists + execFileSync for git ls-files

* hydrate: expand Step 5 checkboxes for Scenario D

* feat(TP-015): implement Scenario D workspace join — pointer-only early return

* checkpoint: TP-015 pointer idempotency implemented

* checkpoint: TP-015 user confirmation messaging implemented

* checkpoint: TP-015 Step 5 complete — Scenario D workspace join verified

* hydrate: TP-015 add R012 revision items to Step 5

* checkpoint: TP-015 R012 fix --force bypassing Scenario D control flow

* checkpoint: TP-015 R012 wrap pointer JSON.parse in try/catch, Step 5 complete

* hydrate: expand Step 6 checkboxes per R013 review

* checkpoint: TP-015 baseline validation gates pass (478 tests, help, doctor)

* checkpoint: TP-015 Scenario A dry-run verified (repo mode, all presets)

* checkpoint: TP-015 all three presets verified (minimal, full, runner-only)

* checkpoint: TP-015 YAML output verified alongside JSON (both repo and workspace modes)

* feat(TP-015): add init-mode-detection tests (34 tests) and fix Windows 8.3 path bug in isGitRepoRoot

* checkpoint: TP-015 Step 6 complete — all testing & verification done

* hydrate: TP-015 add R014 revision items to Step 6

* checkpoint: TP-015 fix mirrored isGitRepoRoot() in test to match production realpathSync.native normalization, add regression test 1.8

* checkpoint: TP-015 full vitest suite passes (19 files, 513 tests) after R014 fixes

* checkpoint: TP-015 Step 6 complete, all R014 revision items addressed

* hydrate: expand Step 7 checkboxes per R015 review

* docs(TP-015): update install tutorial for init-v2 flow

* docs(TP-015): update commands.md init reference for mode detection and new behaviors

* docs(TP-015): update README quickstart with mode detection and gitignore note

* checkpoint: TP-015 final verification — 513 tests pass, CLI help/doctor OK, all commits use TP-015 prefix

* checkpoint: TP-015 task artifacts (.DONE, STATUS.md)

* feat(TP-015): task complete — .DONE created, all steps finished

* hydrate: TP-018 expand Step 0 checkboxes per R001 review

* checkpoint: TP-018 read pi ctx.ui API capabilities

* checkpoint: TP-018 read config schema from TP-014

* checkpoint: TP-018 reviewed Layer 2 allowlist and preferences boundary

* hydrate: TP-016 expand Step 0 checkboxes per R001 review

* checkpoint: TP-018 reviewed config root/path semantics in workspace mode

* checkpoint: TP-018 reviewed config root/path semantics in workspace mode

* checkpoint: TP-018 reviewed JSON-first + YAML fallback write-back behavior

* checkpoint: TP-018 reviewed JSON-first + YAML fallback for write-back alignment

* checkpoint: TP-016 inventoried all config/agent/state resolution call sites

* checkpoint: TP-016 resolver inventory table complete

* checkpoint: TP-018 preflight findings - field/source inventory with UI control types and layer mapping

* checkpoint: TP-016 documented mode matrix for pointer resolution

* checkpoint: TP-016 mode matrix documented

* checkpoint: TP-016 Step 0 preflight complete — resolution map, mode matrix, env-var precedence documented

* checkpoint: TP-018 reviewed JSON-first + YAML fallback behavior (already done)

* checkpoint: TP-016 env-var precedence documented, Step 0 complete

* hydrate: TP-018 add R002 revision items to Step 0

* checkpoint: TP-016 R002 revisions - unified pointer failure semantics, fixed STATUS.md formatting

* checkpoint: TP-018 R002 fixes — added missing fields (worker.spawnMode, context.maxWorkerMinutes, preWarm.autoDetect), CONTEXT.md review, schema coverage checklist

* checkpoint: TP-018 Step 0 R002 revisions complete — field inventory updated with missing fields and schema coverage checklist

* checkpoint: TP-016 R002 revision - unified pointer failure semantics, fixed function names, deduped log, merged mode matrices

* hydrate: TP-018 expand Step 1 checkboxes per R003 review

* hydrate: TP-016 expand Step 1 checkboxes per R003 review

* checkpoint: TP-018 section taxonomy, ordering, field-to-section assignment, and UI controls documented

* checkpoint: TP-018 source-indicator behavior rules documented for all layer combinations

* checkpoint: TP-018 schema coverage validated, Step 1 complete

* checkpoint: TP-016 resolvePointer() function implemented in workspace.ts

* checkpoint: TP-016 return contract verified - config/agent follow pointer, state stays at workspace .pi/

* checkpoint: TP-016 Step 1 complete - PointerResolution type and resolvePointer() implemented

* hydrate: add R003 revision items to Step 1

* checkpoint: TP-016 Step 1 confirmed complete on re-entry

* checkpoint: TP-018 Step 1 complete - R003 revisions applied (worker.spawnMode L1 fix, field contract table, non-editable surfacing)

* hydrate: TP-018 add R004 revision items to Step 1

* checkpoint: TP-018 R004 fix - consolidated canonical navigation map (12 sections)

* checkpoint: TP-018 R004 fix - aligned source-badge rules with type-specific merge semantics

* hydrate: TP-016 add R004 revision items to Step 1

* checkpoint: TP-016 fix config_path containment for Windows absolute paths and add defense-in-depth relative() check

* checkpoint: TP-018 R004 fix - canonical source rule matrix, spawnMode enum disambiguation

* hydrate: TP-018 expand Step 2 checkboxes with R005 items

* checkpoint: TP-016 add resolvePointer test suite (6.x) with 18 tests covering all failure modes + valid resolution

* hydrate: TP-016 expand Step 2 checkboxes per R005 review

* checkpoint: TP-018 create settings-tui.ts with section navigation, field display, source badges, and validation

* checkpoint: TP-016 thread pointer into resolveConfigRoot and loadProjectConfig

* checkpoint: TP-016 thread pointer into loadAgentDef for workspace agent resolution

* feat(TP-018): register /settings command with section navigation TUI

* checkpoint: TP-016 verified repo mode parity — all 576 tests pass

* checkpoint: TP-018 Step 2 complete - /settings command with TUI, source badges, validation

* checkpoint: TP-018 Step 2 complete - settings-tui.ts, /settings command, all tests pass (540/540)

* checkpoint: TP-016 Step 2 tests for pointer-threaded config resolution (5.x series in project-config-loader.test.ts)

* checkpoint: TP-016 Step 2 complete

* checkpoint: TP-016 Step 2 verified complete — all 593 tests passing

* hydrate: TP-018 add R006 revision items to Step 2

* checkpoint: TP-018 R006 fix #1 - use workspaceRoot for /settings config reads

* hydrate: TP-016 add R006 revision items to Step 2

* hydrate: TP-018 add R006 revision items for Step 2

* checkpoint: TP-018 R006 fix #2 - dynamic Advanced section discovery from schema

* checkpoint: TP-018 R006 fixes verified - all 540 tests pass, Step 2 complete

* checkpoint: TP-016 fix dual-layout config file resolution (standard .pi/ and flat pointer layout)

* checkpoint: TP-016 surface pointer warnings to stderr (once per session)

* checkpoint: TP-018 R006 fixes #3 (source detection type guards) and #4 (number validation > 0), dynamic JSON-only footer

* hydrate: TP-018 expand Step 3 checkboxes per R007 review

* checkpoint: TP-016 consolidate test suites, add flat-layout pointer tests, all 591 tests green

* checkpoint: TP-018 R006 fix #5 — add 58 unit tests for settings-tui pure functions

* checkpoint: TP-018 implement write-back destination matrix (L1/L2/L1+L2)

* checkpoint: TP-018 L1 writes to resolveConfigRoot JSON with atomic write pattern

* checkpoint: TP-018 L2 writes to resolveUserPreferencesPath with mkdir+atomic

* checkpoint: TP-016 add 6.x agent resolution + warning surfacing tests for Step 2 R006 coverage

* hydrate: expand Step 3 checkboxes with R007 revision items

* checkpoint: TP-018 confirmation gate already implemented in showSectionSettingsLoop

* feat(TP-018): R007 fix — YAML-only bootstrap writes full L1 snapshot via loadLayer1Config

* hydrate: TP-016 expand Step 3 checkboxes based on R007 review

* checkpoint: TP-018 Step 3 complete — all write-back items done, 598 tests pass

* feat(TP-018): fix ctx.ui.select/confirm API signatures and deep-clone safety

* checkpoint: TP-016 buildExecutionContext already resolves pointer and passes configRoot to loaders

* checkpoint: TP-016 spawnMergeAgent already uses pointer agentRoot, state files at stateRoot

* checkpoint: TP-016 pointer warning already logged at orchestrator startup via buildExecutionContext

* checkpoint: TP-016 verified state/sidecar paths invariant - never follow pointer

* hydrate: TP-018 add R008 revision items to Step 3

* checkpoint: TP-018 R008 fix #1 — malformed JSON throws explicit error (already implemented), fix stale module header

* checkpoint: TP-018 R008 fix #2 — unlinkSync already in place for temp-file cleanup

* checkpoint: TP-018 R008 fix #3 — add 30 unit tests for write-back helpers (coerceValueForWrite, writeProjectConfigField, writeUserPreference)

* checkpoint: TP-016 fix and deduplicate orchestrator pointer tests, all 597 tests passing

* hydrate: expand Step 4 checkboxes per R009 review

* checkpoint: TP-016 Step 3 complete - orchestrator pointer threading verified with 11 new tests

* checkpoint: TP-018 add YAML source-badge tests (16.x series — JSON-only, YAML-only, JSON+YAML precedence)

* checkpoint: TP-018 add zero-mutation path tests (17.x series — cancel/decline confirmation)

* checkpoint: TP-018 add Advanced section discoverability tests (18.x series)

* hydrate: TP-016 expand Step 4 checkboxes based on R009 review

* checkpoint: TP-018 remove duplicate test sections (16-18.x) from prior iteration

* checkpoint: TP-016 dashboard state paths verified as pointer-invariant, added clarifying comments

* checkpoint: TP-018 Step 4 complete — 682 tests pass (54 new: YAML source detection, zero-mutation paths, Advanced discoverability)

* checkpoint: TP-016 verified STATUS.md/task-folder resolution is pointer-independent in dashboard

* checkpoint: TP-016 Step 4 complete — dashboard pointer threading verified

* hydrate: TP-016 add R008 revision items to Step 3

* hydrate: add R010 revision items to Step 4

* feat(TP-016): thread workspaceRoot into resumeOrchBatch for consistent stateRoot

* feat(TP-018): extract resolveWriteAction decision logic, replace tautological tests with real decision-tree tests

* checkpoint: TP-018 Step 4 complete - fix test count, mark R010 revisions done

* feat(TP-016): replace source-text test assertions with behavioral state-root consistency tests

* hydrate: expand Step 5 checkboxes for TP-016

* hydrate: TP-018 expand Step 5 checkboxes per R011 review

* checkpoint: TP-016 verified test 7.11 is behavioral, Step 3 R008 already closed

* checkpoint: TP-018 add /settings to commands reference

* checkpoint: TP-016 verified pointer failure/parity matrix test coverage

* checkpoint: TP-018 add /settings to README command table

* checkpoint: TP-018 add /settings mention to install tutorial

* checkpoint: TP-016 verified integration split invariant test coverage

* checkpoint: TP-018 normalize STATUS.md top-level status field

* checkpoint: TP-016 Step 5 complete — all 609 tests passing

* checkpoint: TP-018 task artifacts (.DONE, STATUS.md)

* feat(TP-018): complete /settings TUI command — docs, README, .DONE

* hydrate: TP-018 add R012 revision items to Step 5

* hydrate: TP-016 add R012 revision items to Step 5

* hydrate: TP-016 add R012 revision items to Step 5

* checkpoint: TP-018 fix /settings common responses to match actual error paths

* checkpoint: TP-018 update commands.md intro and move Configuration Commands above CLI

* checkpoint: TP-018 add Example block to /settings command reference

* docs(TP-018): refine /settings Advanced description and Common responses per R012 review

* checkpoint: TP-016 R012 replace signature tests 7.11/7.12 with behavioral state-root tests

* checkpoint: TP-016 R012 full test suite passing (609 tests)

* checkpoint: TP-016 R012 — add VERIFICATION.md with full test coverage matrix for Step 5

* hydrate: TP-016 expand Step 6 checkboxes per R013 review

* checkpoint: TP-016 architecture doc impact check - no update needed

* checkpoint: TP-016 final acceptance reconciliation - all criteria met

* checkpoint: TP-016 task artifacts (.DONE, STATUS.md)

* checkpoint: TP-016 .DONE created - task complete

* feat: configurable merge agent timeout, default 10 min (was 5 min)

- OrchestratorConfig.merge.timeout_minutes field (default: 10)
- waitForMergeResult() uses config value instead of hardcoded constant
- Exposed in /settings TUI under Merge section
- Updated task-orchestrator.yaml template

Fixes merge agent timeouts on large batches.
HenryLach added a commit that referenced this pull request Mar 18, 2026
…9) (#53)

* hydrate: expand Step 4 checkboxes per R009 review

* docs(TP-014): add JSON config section to task-runner.yaml.md reference

* docs(TP-014): add JSON config section to task-orchestrator.yaml.md reference

* checkpoint: TP-014 install.md checked - no update needed, YAML scaffolding references still correct

* checkpoint: TP-014 task artifacts (.DONE, STATUS.md)

* feat(TP-014): complete Step 4 - documentation & delivery, .DONE created

* hydrate: TP-017 expand Step 0 checkboxes per R001 review

* hydrate: TP-015 expand Step 0 checkboxes per R001 review

* checkpoint: TP-017 preflight path convention confirmed with PI_CODING_AGENT_DIR override and cross-platform resolution

* checkpoint: TP-015 read current cmdInit() implementation

* checkpoint: TP-015 read spec auto-detection and gitignore sections

* checkpoint: TP-015 verify spec reachability (found in main repo .pi/local/docs/)

* checkpoint: TP-015 verify TP-014 config loader/schema contract

* checkpoint: TP-015 record current cmdInit() behavior to preserve

* checkpoint: TP-015 identify downstream validation (no init-specific tests exist)

* checkpoint: TP-015 Step 0 Preflight complete

* checkpoint: TP-015 Step 0 preflight complete - all items verified

* hydrate: TP-017 expand Step 1 checkboxes with R002 review feedback

* checkpoint: TP-017 preferences schema, allowlist, and types defined in preferences.ts

* checkpoint: TP-017 loadUserPreferences and resolveUserPreferencesPath implemented

* hydrate: TP-015 add R002 revision items to Step 0

* checkpoint: TP-015 revert TP-014 file changes from TP-015 commits (R002 fix)

* checkpoint: TP-015 fix malformed STATUS.md tables (R002 revision)

* checkpoint: TP-015 Step 0 complete, orchestrator advancing to Step 1

* checkpoint: TP-017 merge logic updated with mergeModel, dashboardPort, empty-string semantics

* checkpoint: TP-017 Step 1 complete — exports wired, all 434 tests pass

* checkpoint: TP-017 Step 1 verified complete — all checkboxes done, 434 tests pass

* hydrate: expand Step 1 checkboxes per R003 review

* hydrate: TP-017 expand Step 2 checkboxes per R003 review

* checkpoint: TP-015 detection logic implemented (isGitRepo, findSubdirectoryGitRepos, detectInitMode)

* checkpoint: TP-015 error path verified (no git repo, no subdirectory repos)

* checkpoint: TP-015 ambiguous case handled (prompt + preset bypass)

* checkpoint: TP-015 Scenario B already-initialized detection verified

* checkpoint: TP-017 tests for path resolution, loading edge cases, unknown-key dropping

* checkpoint: TP-017 Layer 2 guardrails tests confirmed

* checkpoint: TP-017 merge integration tests confirmed (JSON + YAML backed, e2e)

* checkpoint: TP-017 Step 2 complete — full test suite passes (17 files, 461 tests)

* checkpoint: TP-015 all mode detection branches validated (repo, workspace, ambiguous, error)

* checkpoint: TP-015 Step 1 Mode Auto-Detection complete

* hydrate: TP-017 expand Step 3 checkboxes per R004 review

* checkpoint: TP-017 task artifacts (.DONE, STATUS.md)

* checkpoint: TP-017 verified completion criteria

* checkpoint: TP-017 confirmed no docs need updating

* checkpoint: TP-017 .DONE created

* feat(TP-017): user preferences layer complete

* hydrate: TP-015 add R004 revision items to Step 1

* checkpoint: TP-017 Step 3 complete — all items verified

* checkpoint: TP-015 fix findSubdirectoryGitRepos to use isGitRepoRoot

* checkpoint: TP-015 fix existingConfigPath mismatch for ambiguous→workspace resolution

* checkpoint: TP-015 Step 1 complete — all R004 revision items addressed

* hydrate: expand Step 2 checkboxes based on R005 review

* checkpoint: TP-015 define gitignore constants and reusable helpers

* checkpoint: TP-015 ensureGitignoreEntries and detectAndOfferUntrackArtifacts helpers implemented

* checkpoint: TP-015 integrate gitignore enforcement into cmdInit repo-mode flow

* checkpoint: TP-015 tracked-artifact detection and git rm --cached offer implemented

* checkpoint: TP-015 Step 2 complete — gitignore enforcement with dry-run output

* checkpoint: TP-015 Step 2 verified complete — all gitignore enforcement items done

* hydrate: TP-015 add R006 revision items to Step 2

* hydrate: TP-015 add R006 revision items to Step 2

* checkpoint: TP-015 fix patternToRegex directory prefix matching and switch to execFileSync

* checkpoint: TP-015 remove dead buildGitignoreBlock function

* checkpoint: TP-015 add gitignore pattern matching tests (18 tests), Step 2 R006 revisions complete

* feat(TP-015): R006 extract gitignore patterns to testable module with 26 tests

* hydrate: TP-015 expand Step 3 checkboxes based on R007 review

* checkpoint: TP-015 implement detectSpawnMode() reusable helper

* checkpoint: TP-015 wire spawn_mode into generateOrchestratorYaml via vars

* checkpoint: TP-015 tmux guidance message with preset/runner-only/dry-run handling

* checkpoint: TP-015 Step 3 verified and complete — tmux/spawn mode detection

* checkpoint: TP-015 Step 3 verification complete — all tmux detection behaviors verified

* hydrate: expand Step 4 checkboxes based on R009 review

* checkpoint: TP-015 config repo selection prompt and workspace vars gathering verified

* checkpoint: TP-015 .taskplane/ scaffolding in config repo verified

* checkpoint: TP-015 gitignore enforcement in config repo verified

* checkpoint: TP-015 pointer file creation verified

* checkpoint: TP-015 dry-run/preset/force compatibility for workspace mode verified

* checkpoint: TP-015 Step 4 complete — workspace mode init (Scenario C)

* hydrate: add R010 revision items to Step 4

* checkpoint: TP-015 R010 fix workspace gitignore prefix and tracked-artifact scanning

* checkpoint: TP-015 R010 include .gitignore in workspace auto-commit staging

* checkpoint: TP-015 R010 fix overwrite confirmation skipIfExists + execFileSync for git ls-files

* hydrate: expand Step 5 checkboxes for Scenario D

* feat(TP-015): implement Scenario D workspace join — pointer-only early return

* checkpoint: TP-015 pointer idempotency implemented

* checkpoint: TP-015 user confirmation messaging implemented

* checkpoint: TP-015 Step 5 complete — Scenario D workspace join verified

* hydrate: TP-015 add R012 revision items to Step 5

* checkpoint: TP-015 R012 fix --force bypassing Scenario D control flow

* checkpoint: TP-015 R012 wrap pointer JSON.parse in try/catch, Step 5 complete

* hydrate: expand Step 6 checkboxes per R013 review

* checkpoint: TP-015 baseline validation gates pass (478 tests, help, doctor)

* checkpoint: TP-015 Scenario A dry-run verified (repo mode, all presets)

* checkpoint: TP-015 all three presets verified (minimal, full, runner-only)

* checkpoint: TP-015 YAML output verified alongside JSON (both repo and workspace modes)

* feat(TP-015): add init-mode-detection tests (34 tests) and fix Windows 8.3 path bug in isGitRepoRoot

* checkpoint: TP-015 Step 6 complete — all testing & verification done

* hydrate: TP-015 add R014 revision items to Step 6

* checkpoint: TP-015 fix mirrored isGitRepoRoot() in test to match production realpathSync.native normalization, add regression test 1.8

* checkpoint: TP-015 full vitest suite passes (19 files, 513 tests) after R014 fixes

* checkpoint: TP-015 Step 6 complete, all R014 revision items addressed

* hydrate: expand Step 7 checkboxes per R015 review

* docs(TP-015): update install tutorial for init-v2 flow

* docs(TP-015): update commands.md init reference for mode detection and new behaviors

* docs(TP-015): update README quickstart with mode detection and gitignore note

* checkpoint: TP-015 final verification — 513 tests pass, CLI help/doctor OK, all commits use TP-015 prefix

* checkpoint: TP-015 task artifacts (.DONE, STATUS.md)

* feat(TP-015): task complete — .DONE created, all steps finished

* hydrate: TP-018 expand Step 0 checkboxes per R001 review

* checkpoint: TP-018 read pi ctx.ui API capabilities

* checkpoint: TP-018 read config schema from TP-014

* checkpoint: TP-018 reviewed Layer 2 allowlist and preferences boundary

* hydrate: TP-016 expand Step 0 checkboxes per R001 review

* checkpoint: TP-018 reviewed config root/path semantics in workspace mode

* checkpoint: TP-018 reviewed config root/path semantics in workspace mode

* checkpoint: TP-018 reviewed JSON-first + YAML fallback write-back behavior

* checkpoint: TP-018 reviewed JSON-first + YAML fallback for write-back alignment

* checkpoint: TP-016 inventoried all config/agent/state resolution call sites

* checkpoint: TP-016 resolver inventory table complete

* checkpoint: TP-018 preflight findings - field/source inventory with UI control types and layer mapping

* checkpoint: TP-016 documented mode matrix for pointer resolution

* checkpoint: TP-016 mode matrix documented

* checkpoint: TP-016 Step 0 preflight complete — resolution map, mode matrix, env-var precedence documented

* checkpoint: TP-018 reviewed JSON-first + YAML fallback behavior (already done)

* checkpoint: TP-016 env-var precedence documented, Step 0 complete

* hydrate: TP-018 add R002 revision items to Step 0

* checkpoint: TP-016 R002 revisions - unified pointer failure semantics, fixed STATUS.md formatting

* checkpoint: TP-018 R002 fixes — added missing fields (worker.spawnMode, context.maxWorkerMinutes, preWarm.autoDetect), CONTEXT.md review, schema coverage checklist

* checkpoint: TP-018 Step 0 R002 revisions complete — field inventory updated with missing fields and schema coverage checklist

* checkpoint: TP-016 R002 revision - unified pointer failure semantics, fixed function names, deduped log, merged mode matrices

* hydrate: TP-018 expand Step 1 checkboxes per R003 review

* hydrate: TP-016 expand Step 1 checkboxes per R003 review

* checkpoint: TP-018 section taxonomy, ordering, field-to-section assignment, and UI controls documented

* checkpoint: TP-018 source-indicator behavior rules documented for all layer combinations

* checkpoint: TP-018 schema coverage validated, Step 1 complete

* checkpoint: TP-016 resolvePointer() function implemented in workspace.ts

* checkpoint: TP-016 return contract verified - config/agent follow pointer, state stays at workspace .pi/

* checkpoint: TP-016 Step 1 complete - PointerResolution type and resolvePointer() implemented

* hydrate: add R003 revision items to Step 1

* checkpoint: TP-016 Step 1 confirmed complete on re-entry

* checkpoint: TP-018 Step 1 complete - R003 revisions applied (worker.spawnMode L1 fix, field contract table, non-editable surfacing)

* hydrate: TP-018 add R004 revision items to Step 1

* checkpoint: TP-018 R004 fix - consolidated canonical navigation map (12 sections)

* checkpoint: TP-018 R004 fix - aligned source-badge rules with type-specific merge semantics

* hydrate: TP-016 add R004 revision items to Step 1

* checkpoint: TP-016 fix config_path containment for Windows absolute paths and add defense-in-depth relative() check

* checkpoint: TP-018 R004 fix - canonical source rule matrix, spawnMode enum disambiguation

* hydrate: TP-018 expand Step 2 checkboxes with R005 items

* checkpoint: TP-016 add resolvePointer test suite (6.x) with 18 tests covering all failure modes + valid resolution

* hydrate: TP-016 expand Step 2 checkboxes per R005 review

* checkpoint: TP-018 create settings-tui.ts with section navigation, field display, source badges, and validation

* checkpoint: TP-016 thread pointer into resolveConfigRoot and loadProjectConfig

* checkpoint: TP-016 thread pointer into loadAgentDef for workspace agent resolution

* feat(TP-018): register /settings command with section navigation TUI

* checkpoint: TP-016 verified repo mode parity — all 576 tests pass

* checkpoint: TP-018 Step 2 complete - /settings command with TUI, source badges, validation

* checkpoint: TP-018 Step 2 complete - settings-tui.ts, /settings command, all tests pass (540/540)

* checkpoint: TP-016 Step 2 tests for pointer-threaded config resolution (5.x series in project-config-loader.test.ts)

* checkpoint: TP-016 Step 2 complete

* checkpoint: TP-016 Step 2 verified complete — all 593 tests passing

* hydrate: TP-018 add R006 revision items to Step 2

* checkpoint: TP-018 R006 fix #1 - use workspaceRoot for /settings config reads

* hydrate: TP-016 add R006 revision items to Step 2

* hydrate: TP-018 add R006 revision items for Step 2

* checkpoint: TP-018 R006 fix #2 - dynamic Advanced section discovery from schema

* checkpoint: TP-018 R006 fixes verified - all 540 tests pass, Step 2 complete

* checkpoint: TP-016 fix dual-layout config file resolution (standard .pi/ and flat pointer layout)

* checkpoint: TP-016 surface pointer warnings to stderr (once per session)

* checkpoint: TP-018 R006 fixes #3 (source detection type guards) and #4 (number validation > 0), dynamic JSON-only footer

* hydrate: TP-018 expand Step 3 checkboxes per R007 review

* checkpoint: TP-016 consolidate test suites, add flat-layout pointer tests, all 591 tests green

* checkpoint: TP-018 R006 fix #5 — add 58 unit tests for settings-tui pure functions

* checkpoint: TP-018 implement write-back destination matrix (L1/L2/L1+L2)

* checkpoint: TP-018 L1 writes to resolveConfigRoot JSON with atomic write pattern

* checkpoint: TP-018 L2 writes to resolveUserPreferencesPath with mkdir+atomic

* checkpoint: TP-016 add 6.x agent resolution + warning surfacing tests for Step 2 R006 coverage

* hydrate: expand Step 3 checkboxes with R007 revision items

* checkpoint: TP-018 confirmation gate already implemented in showSectionSettingsLoop

* feat(TP-018): R007 fix — YAML-only bootstrap writes full L1 snapshot via loadLayer1Config

* hydrate: TP-016 expand Step 3 checkboxes based on R007 review

* checkpoint: TP-018 Step 3 complete — all write-back items done, 598 tests pass

* feat(TP-018): fix ctx.ui.select/confirm API signatures and deep-clone safety

* checkpoint: TP-016 buildExecutionContext already resolves pointer and passes configRoot to loaders

* checkpoint: TP-016 spawnMergeAgent already uses pointer agentRoot, state files at stateRoot

* checkpoint: TP-016 pointer warning already logged at orchestrator startup via buildExecutionContext

* checkpoint: TP-016 verified state/sidecar paths invariant - never follow pointer

* hydrate: TP-018 add R008 revision items to Step 3

* checkpoint: TP-018 R008 fix #1 — malformed JSON throws explicit error (already implemented), fix stale module header

* checkpoint: TP-018 R008 fix #2 — unlinkSync already in place for temp-file cleanup

* checkpoint: TP-018 R008 fix #3 — add 30 unit tests for write-back helpers (coerceValueForWrite, writeProjectConfigField, writeUserPreference)

* checkpoint: TP-016 fix and deduplicate orchestrator pointer tests, all 597 tests passing

* hydrate: expand Step 4 checkboxes per R009 review

* checkpoint: TP-016 Step 3 complete - orchestrator pointer threading verified with 11 new tests

* checkpoint: TP-018 add YAML source-badge tests (16.x series — JSON-only, YAML-only, JSON+YAML precedence)

* checkpoint: TP-018 add zero-mutation path tests (17.x series — cancel/decline confirmation)

* checkpoint: TP-018 add Advanced section discoverability tests (18.x series)

* hydrate: TP-016 expand Step 4 checkboxes based on R009 review

* checkpoint: TP-018 remove duplicate test sections (16-18.x) from prior iteration

* checkpoint: TP-016 dashboard state paths verified as pointer-invariant, added clarifying comments

* checkpoint: TP-018 Step 4 complete — 682 tests pass (54 new: YAML source detection, zero-mutation paths, Advanced discoverability)

* checkpoint: TP-016 verified STATUS.md/task-folder resolution is pointer-independent in dashboard

* checkpoint: TP-016 Step 4 complete — dashboard pointer threading verified

* hydrate: TP-016 add R008 revision items to Step 3

* hydrate: add R010 revision items to Step 4

* feat(TP-016): thread workspaceRoot into resumeOrchBatch for consistent stateRoot

* feat(TP-018): extract resolveWriteAction decision logic, replace tautological tests with real decision-tree tests

* checkpoint: TP-018 Step 4 complete - fix test count, mark R010 revisions done

* feat(TP-016): replace source-text test assertions with behavioral state-root consistency tests

* hydrate: expand Step 5 checkboxes for TP-016

* hydrate: TP-018 expand Step 5 checkboxes per R011 review

* checkpoint: TP-016 verified test 7.11 is behavioral, Step 3 R008 already closed

* checkpoint: TP-018 add /settings to commands reference

* checkpoint: TP-016 verified pointer failure/parity matrix test coverage

* checkpoint: TP-018 add /settings to README command table

* checkpoint: TP-018 add /settings mention to install tutorial

* checkpoint: TP-016 verified integration split invariant test coverage

* checkpoint: TP-018 normalize STATUS.md top-level status field

* checkpoint: TP-016 Step 5 complete — all 609 tests passing

* checkpoint: TP-018 task artifacts (.DONE, STATUS.md)

* feat(TP-018): complete /settings TUI command — docs, README, .DONE

* hydrate: TP-018 add R012 revision items to Step 5

* hydrate: TP-016 add R012 revision items to Step 5

* hydrate: TP-016 add R012 revision items to Step 5

* checkpoint: TP-018 fix /settings common responses to match actual error paths

* checkpoint: TP-018 update commands.md intro and move Configuration Commands above CLI

* checkpoint: TP-018 add Example block to /settings command reference

* docs(TP-018): refine /settings Advanced description and Common responses per R012 review

* checkpoint: TP-016 R012 replace signature tests 7.11/7.12 with behavioral state-root tests

* checkpoint: TP-016 R012 full test suite passing (609 tests)

* checkpoint: TP-016 R012 — add VERIFICATION.md with full test coverage matrix for Step 5

* hydrate: TP-016 expand Step 6 checkboxes per R013 review

* checkpoint: TP-016 architecture doc impact check - no update needed

* checkpoint: TP-016 final acceptance reconciliation - all criteria met

* checkpoint: TP-016 task artifacts (.DONE, STATUS.md)

* checkpoint: TP-016 .DONE created - task complete

* feat: configurable merge agent timeout, default 10 min (was 5 min) (#52)

* checkpoint: TP-014 fix R006 revisions — explicit key mapping preserves record keys in YAML→camelCase and camelCase→snake_case adapters, resolveConfigRoot uses per-file precedence

* checkpoint: TP-014 Step 2 R006 revisions complete - all 3 issues fixed

* hydrate: expand Step 3 checkboxes per R007 review

* test(TP-014): add project-config-loader tests — precedence/error matrix (50 tests passing)

* checkpoint: TP-014 workspace root resolution tests verified

* checkpoint: TP-014 key-preservation and adapter regression tests verified

* checkpoint: TP-014 defaults non-mutation and backward-compat wrappers verified

* checkpoint: TP-014 Step 3 complete — all 434 tests passing (16 files)

* hydrate: add R008 revision items to Step 3

* test(TP-014): fix test 4.5 to exercise loadProjectConfig throw + default fallback per R008

* test(TP-014): fix test 4.5 to actually call task-runner loadConfig with malformed JSON

* checkpoint: TP-014 Step 3 R008 revisions complete — all 434 tests passing

* test(TP-014): clean up test 4.5 to use static import of loadConfig instead of require()

* hydrate: expand Step 4 checkboxes per R009 review

* docs(TP-014): add JSON config section to task-runner.yaml.md reference

* docs(TP-014): add JSON config section to task-orchestrator.yaml.md reference

* checkpoint: TP-014 install.md checked - no update needed, YAML scaffolding references still correct

* checkpoint: TP-014 task artifacts (.DONE, STATUS.md)

* feat(TP-014): complete Step 4 - documentation & delivery, .DONE created

* hydrate: TP-017 expand Step 0 checkboxes per R001 review

* hydrate: TP-015 expand Step 0 checkboxes per R001 review

* checkpoint: TP-017 preflight path convention confirmed with PI_CODING_AGENT_DIR override and cross-platform resolution

* checkpoint: TP-015 read current cmdInit() implementation

* checkpoint: TP-015 read spec auto-detection and gitignore sections

* checkpoint: TP-015 verify spec reachability (found in main repo .pi/local/docs/)

* checkpoint: TP-015 verify TP-014 config loader/schema contract

* checkpoint: TP-015 record current cmdInit() behavior to preserve

* checkpoint: TP-015 identify downstream validation (no init-specific tests exist)

* checkpoint: TP-015 Step 0 Preflight complete

* checkpoint: TP-015 Step 0 preflight complete - all items verified

* hydrate: TP-017 expand Step 1 checkboxes with R002 review feedback

* checkpoint: TP-017 preferences schema, allowlist, and types defined in preferences.ts

* checkpoint: TP-017 loadUserPreferences and resolveUserPreferencesPath implemented

* hydrate: TP-015 add R002 revision items to Step 0

* checkpoint: TP-015 revert TP-014 file changes from TP-015 commits (R002 fix)

* checkpoint: TP-015 fix malformed STATUS.md tables (R002 revision)

* checkpoint: TP-015 Step 0 complete, orchestrator advancing to Step 1

* checkpoint: TP-017 merge logic updated with mergeModel, dashboardPort, empty-string semantics

* checkpoint: TP-017 Step 1 complete — exports wired, all 434 tests pass

* checkpoint: TP-017 Step 1 verified complete — all checkboxes done, 434 tests pass

* hydrate: expand Step 1 checkboxes per R003 review

* hydrate: TP-017 expand Step 2 checkboxes per R003 review

* checkpoint: TP-015 detection logic implemented (isGitRepo, findSubdirectoryGitRepos, detectInitMode)

* checkpoint: TP-015 error path verified (no git repo, no subdirectory repos)

* checkpoint: TP-015 ambiguous case handled (prompt + preset bypass)

* checkpoint: TP-015 Scenario B already-initialized detection verified

* checkpoint: TP-017 tests for path resolution, loading edge cases, unknown-key dropping

* checkpoint: TP-017 Layer 2 guardrails tests confirmed

* checkpoint: TP-017 merge integration tests confirmed (JSON + YAML backed, e2e)

* checkpoint: TP-017 Step 2 complete — full test suite passes (17 files, 461 tests)

* checkpoint: TP-015 all mode detection branches validated (repo, workspace, ambiguous, error)

* checkpoint: TP-015 Step 1 Mode Auto-Detection complete

* hydrate: TP-017 expand Step 3 checkboxes per R004 review

* checkpoint: TP-017 task artifacts (.DONE, STATUS.md)

* checkpoint: TP-017 verified completion criteria

* checkpoint: TP-017 confirmed no docs need updating

* checkpoint: TP-017 .DONE created

* feat(TP-017): user preferences layer complete

* hydrate: TP-015 add R004 revision items to Step 1

* checkpoint: TP-017 Step 3 complete — all items verified

* checkpoint: TP-015 fix findSubdirectoryGitRepos to use isGitRepoRoot

* checkpoint: TP-015 fix existingConfigPath mismatch for ambiguous→workspace resolution

* checkpoint: TP-015 Step 1 complete — all R004 revision items addressed

* hydrate: expand Step 2 checkboxes based on R005 review

* checkpoint: TP-015 define gitignore constants and reusable helpers

* checkpoint: TP-015 ensureGitignoreEntries and detectAndOfferUntrackArtifacts helpers implemented

* checkpoint: TP-015 integrate gitignore enforcement into cmdInit repo-mode flow

* checkpoint: TP-015 tracked-artifact detection and git rm --cached offer implemented

* checkpoint: TP-015 Step 2 complete — gitignore enforcement with dry-run output

* checkpoint: TP-015 Step 2 verified complete — all gitignore enforcement items done

* hydrate: TP-015 add R006 revision items to Step 2

* hydrate: TP-015 add R006 revision items to Step 2

* checkpoint: TP-015 fix patternToRegex directory prefix matching and switch to execFileSync

* checkpoint: TP-015 remove dead buildGitignoreBlock function

* checkpoint: TP-015 add gitignore pattern matching tests (18 tests), Step 2 R006 revisions complete

* feat(TP-015): R006 extract gitignore patterns to testable module with 26 tests

* hydrate: TP-015 expand Step 3 checkboxes based on R007 review

* checkpoint: TP-015 implement detectSpawnMode() reusable helper

* checkpoint: TP-015 wire spawn_mode into generateOrchestratorYaml via vars

* checkpoint: TP-015 tmux guidance message with preset/runner-only/dry-run handling

* checkpoint: TP-015 Step 3 verified and complete — tmux/spawn mode detection

* checkpoint: TP-015 Step 3 verification complete — all tmux detection behaviors verified

* hydrate: expand Step 4 checkboxes based on R009 review

* checkpoint: TP-015 config repo selection prompt and workspace vars gathering verified

* checkpoint: TP-015 .taskplane/ scaffolding in config repo verified

* checkpoint: TP-015 gitignore enforcement in config repo verified

* checkpoint: TP-015 pointer file creation verified

* checkpoint: TP-015 dry-run/preset/force compatibility for workspace mode verified

* checkpoint: TP-015 Step 4 complete — workspace mode init (Scenario C)

* hydrate: add R010 revision items to Step 4

* checkpoint: TP-015 R010 fix workspace gitignore prefix and tracked-artifact scanning

* checkpoint: TP-015 R010 include .gitignore in workspace auto-commit staging

* checkpoint: TP-015 R010 fix overwrite confirmation skipIfExists + execFileSync for git ls-files

* hydrate: expand Step 5 checkboxes for Scenario D

* feat(TP-015): implement Scenario D workspace join — pointer-only early return

* checkpoint: TP-015 pointer idempotency implemented

* checkpoint: TP-015 user confirmation messaging implemented

* checkpoint: TP-015 Step 5 complete — Scenario D workspace join verified

* hydrate: TP-015 add R012 revision items to Step 5

* checkpoint: TP-015 R012 fix --force bypassing Scenario D control flow

* checkpoint: TP-015 R012 wrap pointer JSON.parse in try/catch, Step 5 complete

* hydrate: expand Step 6 checkboxes per R013 review

* checkpoint: TP-015 baseline validation gates pass (478 tests, help, doctor)

* checkpoint: TP-015 Scenario A dry-run verified (repo mode, all presets)

* checkpoint: TP-015 all three presets verified (minimal, full, runner-only)

* checkpoint: TP-015 YAML output verified alongside JSON (both repo and workspace modes)

* feat(TP-015): add init-mode-detection tests (34 tests) and fix Windows 8.3 path bug in isGitRepoRoot

* checkpoint: TP-015 Step 6 complete — all testing & verification done

* hydrate: TP-015 add R014 revision items to Step 6

* checkpoint: TP-015 fix mirrored isGitRepoRoot() in test to match production realpathSync.native normalization, add regression test 1.8

* checkpoint: TP-015 full vitest suite passes (19 files, 513 tests) after R014 fixes

* checkpoint: TP-015 Step 6 complete, all R014 revision items addressed

* hydrate: expand Step 7 checkboxes per R015 review

* docs(TP-015): update install tutorial for init-v2 flow

* docs(TP-015): update commands.md init reference for mode detection and new behaviors

* docs(TP-015): update README quickstart with mode detection and gitignore note

* checkpoint: TP-015 final verification — 513 tests pass, CLI help/doctor OK, all commits use TP-015 prefix

* checkpoint: TP-015 task artifacts (.DONE, STATUS.md)

* feat(TP-015): task complete — .DONE created, all steps finished

* hydrate: TP-018 expand Step 0 checkboxes per R001 review

* checkpoint: TP-018 read pi ctx.ui API capabilities

* checkpoint: TP-018 read config schema from TP-014

* checkpoint: TP-018 reviewed Layer 2 allowlist and preferences boundary

* hydrate: TP-016 expand Step 0 checkboxes per R001 review

* checkpoint: TP-018 reviewed config root/path semantics in workspace mode

* checkpoint: TP-018 reviewed config root/path semantics in workspace mode

* checkpoint: TP-018 reviewed JSON-first + YAML fallback write-back behavior

* checkpoint: TP-018 reviewed JSON-first + YAML fallback for write-back alignment

* checkpoint: TP-016 inventoried all config/agent/state resolution call sites

* checkpoint: TP-016 resolver inventory table complete

* checkpoint: TP-018 preflight findings - field/source inventory with UI control types and layer mapping

* checkpoint: TP-016 documented mode matrix for pointer resolution

* checkpoint: TP-016 mode matrix documented

* checkpoint: TP-016 Step 0 preflight complete — resolution map, mode matrix, env-var precedence documented

* checkpoint: TP-018 reviewed JSON-first + YAML fallback behavior (already done)

* checkpoint: TP-016 env-var precedence documented, Step 0 complete

* hydrate: TP-018 add R002 revision items to Step 0

* checkpoint: TP-016 R002 revisions - unified pointer failure semantics, fixed STATUS.md formatting

* checkpoint: TP-018 R002 fixes — added missing fields (worker.spawnMode, context.maxWorkerMinutes, preWarm.autoDetect), CONTEXT.md review, schema coverage checklist

* checkpoint: TP-018 Step 0 R002 revisions complete — field inventory updated with missing fields and schema coverage checklist

* checkpoint: TP-016 R002 revision - unified pointer failure semantics, fixed function names, deduped log, merged mode matrices

* hydrate: TP-018 expand Step 1 checkboxes per R003 review

* hydrate: TP-016 expand Step 1 checkboxes per R003 review

* checkpoint: TP-018 section taxonomy, ordering, field-to-section assignment, and UI controls documented

* checkpoint: TP-018 source-indicator behavior rules documented for all layer combinations

* checkpoint: TP-018 schema coverage validated, Step 1 complete

* checkpoint: TP-016 resolvePointer() function implemented in workspace.ts

* checkpoint: TP-016 return contract verified - config/agent follow pointer, state stays at workspace .pi/

* checkpoint: TP-016 Step 1 complete - PointerResolution type and resolvePointer() implemented

* hydrate: add R003 revision items to Step 1

* checkpoint: TP-016 Step 1 confirmed complete on re-entry

* checkpoint: TP-018 Step 1 complete - R003 revisions applied (worker.spawnMode L1 fix, field contract table, non-editable surfacing)

* hydrate: TP-018 add R004 revision items to Step 1

* checkpoint: TP-018 R004 fix - consolidated canonical navigation map (12 sections)

* checkpoint: TP-018 R004 fix - aligned source-badge rules with type-specific merge semantics

* hydrate: TP-016 add R004 revision items to Step 1

* checkpoint: TP-016 fix config_path containment for Windows absolute paths and add defense-in-depth relative() check

* checkpoint: TP-018 R004 fix - canonical source rule matrix, spawnMode enum disambiguation

* hydrate: TP-018 expand Step 2 checkboxes with R005 items

* checkpoint: TP-016 add resolvePointer test suite (6.x) with 18 tests covering all failure modes + valid resolution

* hydrate: TP-016 expand Step 2 checkboxes per R005 review

* checkpoint: TP-018 create settings-tui.ts with section navigation, field display, source badges, and validation

* checkpoint: TP-016 thread pointer into resolveConfigRoot and loadProjectConfig

* checkpoint: TP-016 thread pointer into loadAgentDef for workspace agent resolution

* feat(TP-018): register /settings command with section navigation TUI

* checkpoint: TP-016 verified repo mode parity — all 576 tests pass

* checkpoint: TP-018 Step 2 complete - /settings command with TUI, source badges, validation

* checkpoint: TP-018 Step 2 complete - settings-tui.ts, /settings command, all tests pass (540/540)

* checkpoint: TP-016 Step 2 tests for pointer-threaded config resolution (5.x series in project-config-loader.test.ts)

* checkpoint: TP-016 Step 2 complete

* checkpoint: TP-016 Step 2 verified complete — all 593 tests passing

* hydrate: TP-018 add R006 revision items to Step 2

* checkpoint: TP-018 R006 fix #1 - use workspaceRoot for /settings config reads

* hydrate: TP-016 add R006 revision items to Step 2

* hydrate: TP-018 add R006 revision items for Step 2

* checkpoint: TP-018 R006 fix #2 - dynamic Advanced section discovery from schema

* checkpoint: TP-018 R006 fixes verified - all 540 tests pass, Step 2 complete

* checkpoint: TP-016 fix dual-layout config file resolution (standard .pi/ and flat pointer layout)

* checkpoint: TP-016 surface pointer warnings to stderr (once per session)

* checkpoint: TP-018 R006 fixes #3 (source detection type guards) and #4 (number validation > 0), dynamic JSON-only footer

* hydrate: TP-018 expand Step 3 checkboxes per R007 review

* checkpoint: TP-016 consolidate test suites, add flat-layout pointer tests, all 591 tests green

* checkpoint: TP-018 R006 fix #5 — add 58 unit tests for settings-tui pure functions

* checkpoint: TP-018 implement write-back destination matrix (L1/L2/L1+L2)

* checkpoint: TP-018 L1 writes to resolveConfigRoot JSON with atomic write pattern

* checkpoint: TP-018 L2 writes to resolveUserPreferencesPath with mkdir+atomic

* checkpoint: TP-016 add 6.x agent resolution + warning surfacing tests for Step 2 R006 coverage

* hydrate: expand Step 3 checkboxes with R007 revision items

* checkpoint: TP-018 confirmation gate already implemented in showSectionSettingsLoop

* feat(TP-018): R007 fix — YAML-only bootstrap writes full L1 snapshot via loadLayer1Config

* hydrate: TP-016 expand Step 3 checkboxes based on R007 review

* checkpoint: TP-018 Step 3 complete — all write-back items done, 598 tests pass

* feat(TP-018): fix ctx.ui.select/confirm API signatures and deep-clone safety

* checkpoint: TP-016 buildExecutionContext already resolves pointer and passes configRoot to loaders

* checkpoint: TP-016 spawnMergeAgent already uses pointer agentRoot, state files at stateRoot

* checkpoint: TP-016 pointer warning already logged at orchestrator startup via buildExecutionContext

* checkpoint: TP-016 verified state/sidecar paths invariant - never follow pointer

* hydrate: TP-018 add R008 revision items to Step 3

* checkpoint: TP-018 R008 fix #1 — malformed JSON throws explicit error (already implemented), fix stale module header

* checkpoint: TP-018 R008 fix #2 — unlinkSync already in place for temp-file cleanup

* checkpoint: TP-018 R008 fix #3 — add 30 unit tests for write-back helpers (coerceValueForWrite, writeProjectConfigField, writeUserPreference)

* checkpoint: TP-016 fix and deduplicate orchestrator pointer tests, all 597 tests passing

* hydrate: expand Step 4 checkboxes per R009 review

* checkpoint: TP-016 Step 3 complete - orchestrator pointer threading verified with 11 new tests

* checkpoint: TP-018 add YAML source-badge tests (16.x series — JSON-only, YAML-only, JSON+YAML precedence)

* checkpoint: TP-018 add zero-mutation path tests (17.x series — cancel/decline confirmation)

* checkpoint: TP-018 add Advanced section discoverability tests (18.x series)

* hydrate: TP-016 expand Step 4 checkboxes based on R009 review

* checkpoint: TP-018 remove duplicate test sections (16-18.x) from prior iteration

* checkpoint: TP-016 dashboard state paths verified as pointer-invariant, added clarifying comments

* checkpoint: TP-018 Step 4 complete — 682 tests pass (54 new: YAML source detection, zero-mutation paths, Advanced discoverability)

* checkpoint: TP-016 verified STATUS.md/task-folder resolution is pointer-independent in dashboard

* checkpoint: TP-016 Step 4 complete — dashboard pointer threading verified

* hydrate: TP-016 add R008 revision items to Step 3

* hydrate: add R010 revision items to Step 4

* feat(TP-016): thread workspaceRoot into resumeOrchBatch for consistent stateRoot

* feat(TP-018): extract resolveWriteAction decision logic, replace tautological tests with real decision-tree tests

* checkpoint: TP-018 Step 4 complete - fix test count, mark R010 revisions done

* feat(TP-016): replace source-text test assertions with behavioral state-root consistency tests

* hydrate: expand Step 5 checkboxes for TP-016

* hydrate: TP-018 expand Step 5 checkboxes per R011 review

* checkpoint: TP-016 verified test 7.11 is behavioral, Step 3 R008 already closed

* checkpoint: TP-018 add /settings to commands reference

* checkpoint: TP-016 verified pointer failure/parity matrix test coverage

* checkpoint: TP-018 add /settings to README command table

* checkpoint: TP-018 add /settings mention to install tutorial

* checkpoint: TP-016 verified integration split invariant test coverage

* checkpoint: TP-018 normalize STATUS.md top-level status field

* checkpoint: TP-016 Step 5 complete — all 609 tests passing

* checkpoint: TP-018 task artifacts (.DONE, STATUS.md)

* feat(TP-018): complete /settings TUI command — docs, README, .DONE

* hydrate: TP-018 add R012 revision items to Step 5

* hydrate: TP-016 add R012 revision items to Step 5

* hydrate: TP-016 add R012 revision items to Step 5

* checkpoint: TP-018 fix /settings common responses to match actual error paths

* checkpoint: TP-018 update commands.md intro and move Configuration Commands above CLI

* checkpoint: TP-018 add Example block to /settings command reference

* docs(TP-018): refine /settings Advanced description and Common responses per R012 review

* checkpoint: TP-016 R012 replace signature tests 7.11/7.12 with behavioral state-root tests

* checkpoint: TP-016 R012 full test suite passing (609 tests)

* checkpoint: TP-016 R012 — add VERIFICATION.md with full test coverage matrix for Step 5

* hydrate: TP-016 expand Step 6 checkboxes per R013 review

* checkpoint: TP-016 architecture doc impact check - no update needed

* checkpoint: TP-016 final acceptance reconciliation - all criteria met

* checkpoint: TP-016 task artifacts (.DONE, STATUS.md)

* checkpoint: TP-016 .DONE created - task complete

* feat: configurable merge agent timeout, default 10 min (was 5 min)

- OrchestratorConfig.merge.timeout_minutes field (default: 10)
- waitForMergeResult() uses config value instead of hardcoded constant
- Exposed in /settings TUI under Merge section
- Updated task-orchestrator.yaml template

Fixes merge agent timeouts on large batches.

* hydrate: TP-019 expand Step 0 checkboxes per R001 review

* checkpoint: TP-019 read cmdDoctor, spec, and reusable helpers

* checkpoint: TP-019 preflight complete — baseline, helpers, and spec criteria documented

* checkpoint: TP-019 gitignore entry validation in cmdDoctor

* checkpoint: TP-019 tracked artifact detection with remediation verified complete

* checkpoint: TP-019 workspace pointer chain validation (pointer → config repo → .taskplane/)

* checkpoint: TP-019 default branch check for .taskplane/ config presence

* checkpoint: TP-019 legacy YAML config migration warning in doctor

* feat: change checkpoint discipline from per-checkbox to per-step commits

Workers now commit at step boundaries instead of after every checkbox.
STATUS.md is still updated after each checkbox (that's the worker's memory),
but git commits only happen when a step is complete.

Exceptions that still get immediate commits:
- Hydration (STATUS.md expansion before implementing)
- REVISE response (adding reviewer revision items)
- Wrap-up signal (stopping mid-step)

This reduces git overhead by ~70-80% per task without losing any recovery
capability — STATUS.md on disk is the resumability mechanism, not git.

Updated:
- templates/agents/task-worker.md (base worker prompt)
- skills/create-taskplane-task/references/prompt-template.md (PROMPT template)
- skills/create-taskplane-task/SKILL.md (skill docs)

* feat(TP-019): complete Step 4 — tmux vs spawn_mode mismatch check in doctor

Doctor now reads project config spawn_mode and warns if set to 'tmux'
but tmux is not installed, with platform-specific install guidance.

Step 4 completed manually (worker stalled on API errors after 3 iterations).
Steps 5-6 verified and closed.

* fix(settings-onboarding): align workspace init, /settings pointer resolution, and doctor JSON checks

* docs: update CHANGELOG.md through v0.3.1 and strengthen release checklist in AGENTS.md

CHANGELOG was stale since v0.1.14 — added entries for v0.1.15 through
v0.3.1 plus unreleased changes. AGENTS.md release sequence now has
mandatory CHANGELOG step with formatting guidance and pre-release checklist.
HenryLach added a commit that referenced this pull request Mar 23, 2026
- Add Tier0RecoveryPattern, TIER0_RETRYABLE_CLASSIFICATIONS, TIER0_RETRY_BUDGETS,
  tier0ScopeKey/tier0WaveScopeKey to types.ts for non-merge retry scoping
- Add allocationError field to WaveExecutionResult for structured allocation
  failure propagation (reviewer R001 issue #1)
- Propagate ALLOC_WORKTREE_FAILED from executeWave to engine for detection
- Add attemptWorkerCrashRetry() in engine.ts: classifies failed task exits,
  retries retryable classifications (api_error, process_crash, session_vanished)
  with budget from TIER0_RETRY_BUDGETS.worker_crash (reviewer R001 issue #2)
- Add attemptStaleWorktreeRecovery() in engine.ts: on ALLOC_WORKTREE_FAILED,
  force-cleans all batch worktrees + prunes, then retries wave execution
- Add cleanup gate retry: before pausing on stale worktrees post-merge,
  retries force cleanup once per TIER0_RETRY_BUDGETS.cleanup_gate
- All retry counters persisted in resilience.retryCountByScope with t0: prefix
  namespace to avoid collision with merge retry scope keys
- All 1751 existing tests pass
HenryLach added a commit that referenced this pull request Mar 23, 2026
* feat(TP-037): complete Step 0 — Preflight

* feat(TP-038): complete Step 0 — Preflight

* feat(TP-037): complete Step 0 — Preflight analysis of resume bugs

* hydrate: expand Step 1 checkboxes

* feat(TP-038): complete Step 1 — check result before kill + config reload

* feat(TP-038): complete Step 2 — Add retry with backoff

* feat(TP-037): complete Step 1 — fix resume merge skip (Bug #102)

* hydrate: add R003 revision items to Step 3

* feat(TP-038): complete Step 3 — Testing & Verification

* feat(TP-038): complete Step 3 — fix CRLF normalization in merge-timeout-resilience tests

* checkpoint: TP-038 task artifacts (.DONE, STATUS.md)

* feat(TP-038): complete Step 4 — Documentation & Delivery

* feat(TP-038): complete Step 4 — Documentation & Delivery

* feat(TP-037): complete Step 2 — fix stale session names (bug #102b)

* feat(TP-037): complete Step 2 — fix stale session names (Bug #102b)

- Relax Precedence 5 in reconcileTaskStates(): pending tasks with dead
  sessions and no worktree are treated as pending, not failed
- Clear stale sessionName and laneNumber from persisted task records
- Prune stale-pending tasks from lane records to prevent serialization
  fallback (outcome?.sessionName || lane?.tmuxSessionName) from
  reintroducing stale values through serializeBatchState()
- Update polyrepo regression tests to reflect corrected behavior:
  SH-002 (pending + stale session) reconciles as 'pending' not 'mark-failed'

* feat(TP-037): complete Step 3 — Testing & Verification

* feat(TP-037): complete Step 3 — Testing & Verification

* checkpoint: TP-037 task artifacts (.DONE, STATUS.md)

* feat(TP-037): complete Step 4 — Documentation & Delivery

* feat(TP-037): complete Step 4 — Documentation & Delivery

* checkpoint: wave 1 task artifacts (.DONE, STATUS.md, REVIEW_VERDICT.json)

* feat(TP-039): complete Step 0 — Preflight

* hydrate: expand Step 1 checkboxes based on R001 review

* feat(TP-039): complete Step 1 — Wire Automatic Recovery into Engine

- Add Tier0RecoveryPattern, TIER0_RETRYABLE_CLASSIFICATIONS, TIER0_RETRY_BUDGETS,
  tier0ScopeKey/tier0WaveScopeKey to types.ts for non-merge retry scoping
- Add allocationError field to WaveExecutionResult for structured allocation
  failure propagation (reviewer R001 issue #1)
- Propagate ALLOC_WORKTREE_FAILED from executeWave to engine for detection
- Add attemptWorkerCrashRetry() in engine.ts: classifies failed task exits,
  retries retryable classifications (api_error, process_crash, session_vanished)
  with budget from TIER0_RETRY_BUDGETS.worker_crash (reviewer R001 issue #2)
- Add attemptStaleWorktreeRecovery() in engine.ts: on ALLOC_WORKTREE_FAILED,
  force-cleans all batch worktrees + prunes, then retries wave execution
- Add cleanup gate retry: before pausing on stale worktrees post-merge,
  retries force cleanup once per TIER0_RETRY_BUDGETS.cleanup_gate
- All retry counters persisted in resilience.retryCountByScope with t0: prefix
  namespace to avoid collision with merge retry scope keys
- All 1751 existing tests pass

* hydrate: add R002 revision items to Step 1

* feat(TP-039): complete Step 1 — Wire Automatic Recovery into Engine (R002 revisions)

* feat(TP-039): complete Step 1 — Wire Automatic Recovery into Engine

* hydrate: expand Step 2 checkboxes

* feat(TP-039): complete Step 2 — Tier 0 event logging

* feat(TP-039): complete Step 2 — Tier 0 event logging

* hydrate: add R004 revision items to Step 2

* feat(TP-039): complete Step 2 — Tier 0 Event Logging (R004 revisions)

* feat(TP-039): complete Step 2 — Tier 0 Event Logging

* hydrate: expand Step 3 checkboxes

* feat(TP-039): complete Step 3 — Escalation Interface

* feat(TP-039): complete Step 3 — Escalation Interface

* hydrate: expand Step 4 checkboxes

* feat(TP-039): complete Step 4 — Testing & Verification

* feat(TP-039): complete Step 4 — Testing & Verification

* hydrate: add R008 revision items to Step 4

* checkpoint: TP-039 task artifacts (.DONE, STATUS.md)

* feat(TP-039): complete Step 5 — Documentation & Delivery

* checkpoint: wave 2 task artifacts (.DONE, STATUS.md, REVIEW_VERDICT.json)

* feat(TP-040): complete Step 0 — Preflight analysis

* feat(TP-040): complete Step 0 — Preflight analysis

* hydrate: expand Step 1 checkboxes

* feat(TP-040): complete Step 1 — Engine Event Infrastructure

* feat(TP-040): complete Step 1 — Engine Event Infrastructure

* hydrate: add R002 revision items to Step 1

* feat(TP-040): complete Step 1 — Engine Event Infrastructure (R002 revisions)

* hydrate: expand Step 2 checkboxes

* feat(TP-040): complete Step 2 — Make Engine Non-Blocking

* hydrate: add R004 revision items to Step 2

* feat(TP-040): complete Step 2 — Make Engine Non-Blocking

* hydrate: expand Step 3 checkboxes

* feat(TP-040): complete Step 3 — Preserve Existing Behavior

- R005-1: launching phase set synchronously before setTimeout detach
  (verified already implemented from Step 2)
- R005-2: /orch-status falls back to disk-persisted batch-state.json
  when in-memory state is idle (covers fresh-session and post-crash)
- /orch-pause, /orch-resume, /orch-abort all handle launching phase
- All 1815 existing tests pass

* hydrate: add R006 revision items to Step 3

* hydrate: add R006 resume fix item to Step 3

* feat(TP-040): complete Step 3 — Preserve Existing Behavior (R006 fixes)

* feat(TP-040): complete Step 3 — Preserve Existing Behavior (R006 verified)

* hydrate: expand Step 4 checkboxes

* feat(TP-040): complete Step 4 — Testing & Verification

- Add non-blocking-engine.test.ts with 44 tests covering:
  - startBatchAsync fire-and-forget pattern with setTimeout detach
  - Engine event emission (emitEngineEvent, buildEngineEventBase)
  - JSONL persistence lifecycle records in events.jsonl
  - Terminal events (batch_complete/batch_paused) with guard
  - Launch-window command regression (launching phase recognized)
  - Resume early-return regression (phase reset to idle)
  - /orch-status disk fallback
- Full test suite passes: 1860 tests, 46 files, 0 failures

* feat(TP-040): complete Step 4 — Testing & Verification

* hydrate: add R008 revision items to Step 4

* feat(TP-040): complete Step 4 — Testing & Verification with R008 behavioral tests

* checkpoint: TP-040 task artifacts (.DONE, STATUS.md)

* feat(TP-040): complete Step 4 — behavioral tests for non-blocking engine

Added behavioral test sections (R008 revisions):
- 8.x: startBatchAsync with fake timers — verifies non-blocking return,
  error boundary state transitions, widget update callbacks
- 9.x: Launch-window command logic — phase compatibility checks
- 10.x: Engine event emission sequences — terminal events, one-shot
  guard semantics, full lifecycle JSONL ordering
- 11.x: resumeOrchBatch early-return phase reset — behavioral tests
  calling real function with empty/corrupt state

All 1891 tests passing across 46 test files.

* checkpoint: wave 3 task artifacts (.DONE, STATUS.md, REVIEW_VERDICT.json)

* feat(TP-041): complete Step 0 — Preflight

* feat(TP-041): complete Step 0 — Preflight

* hydrate: expand Step 1 checkboxes

* feat(TP-041): complete Step 1 — Supervisor System Prompt + Activation

- Create supervisor.ts with system prompt builder, activation/deactivation,
  and before_agent_start hook for persistent prompt injection
- Design comprehensive system prompt: identity, batch context, capabilities,
  standing orders, primer reference, autonomy level instructions
- Wire supervisor activation in /orch and /orch-resume after startBatchAsync
- Wire supervisor deactivation in /orch-abort
- Add SupervisorSectionConfig to config schema (model + autonomy)
- Add supervisorModel to UserPreferences + config-loader pipeline
- Add loadSupervisorConfig() in config.ts for config loading
- Export supervisor module from index.ts barrel
- All 1891 tests pass

* feat(TP-041): complete Step 1 — supervisor system prompt + activation

* hydrate: add R002 revision items to Step 1

* feat(TP-041): complete Step 1 — Supervisor System Prompt + Activation

R002 revisions implemented:
- Dynamic prompt rebuild: before_agent_start hook rebuilds prompt from live
  batchState ref each turn, ensuring batch metadata (batchId, wave/task
  counts) is always current despite async engine population
- Model override: activateSupervisor resolves supervisor.model via
  ctx.modelRegistry, switches via pi.setModel(), restores on deactivation
- Terminal deactivation: startBatchAsync onTerminal callback deactivates
  supervisor on completed/failed/stopped/crashed, plus existing abort path
- Fix settings-tui.ts section count comment (12 → 13)

* feat(TP-041): complete Step 1 — supervisor system prompt + activation (R002 fixes)

* hydrate: expand Step 2 checkboxes

* feat(TP-041): complete Step 2 — Lockfile + Session Takeover

* hydrate: add R004 revision items to Step 2

* feat(TP-041): complete Step 2 — Lockfile + Session Takeover (R004 fixes)

* feat(TP-041): complete Step 2 — /orch-takeover command + stale-lock messaging

* hydrate: expand Step 3 checkboxes

* feat(TP-041): complete Step 3 — Engine Event Consumption + Notifications

* hydrate: add R006 revision items to Step 3

* hydrate: expand Step 4 checkboxes

* feat(TP-041): complete Step 3 — Engine Event Consumption + Notifications (R006 fix)

* feat(TP-041): complete Step 4 — Recovery Action Execution + Audit Trail

* hydrate: add R008 revision items to Step 4

* feat(TP-041): complete Step 4 — Recovery Action Execution + Audit Trail (R008 fix)

* feat(TP-041): complete Step 5 — Testing & Verification

- Created supervisor.test.ts with 83 tests covering all supervisor components
- Section 1.x: System prompt injection (10 tests) — buildSupervisorSystemPrompt,
  registerSupervisorPromptHook, resolveSupervisorConfig
- Section 2.x: Lockfile lifecycle (16 tests) — write/read/remove, corrupt/malformed
  handling, isProcessAlive, isLockStale, isBatchTerminal
- Section 3.x: Heartbeat + yield detection (3 tests) — heartbeat update, force
  takeover yield, auto-stop on deactivation
- Section 4.x: Takeover (10 tests) — checkSupervisorLockOnStartup for all states
  (no-active-batch, no-lockfile, stale, live, corrupt), buildTakeoverSummary
- Section 5.x: Event notification (29 tests) — readNewBytes, parseJsonlLines,
  formatEventNotification, shouldNotify, formatTaskDigest, processEvents,
  event tailer lifecycle
- Section 6.x: Audit trail (9 tests) — appendAuditEntry, logRecoveryAction,
  readAuditTrail with filters
- Section 7.x: Recovery action classification (6 tests) — full 9-cell decision
  table for requiresConfirmation

All 2002 tests pass across 47 test files.

* feat(TP-041): complete Step 5 — Testing & Verification

* checkpoint: TP-041 task artifacts (.DONE, STATUS.md)

* hydrate: add R010 revision items to Step 5

* feat(TP-041): complete Step 6 — Documentation & Delivery

* checkpoint: wave 4 task artifacts (.DONE, STATUS.md, REVIEW_VERDICT.json)

* feat(TP-044): complete Step 0 — Preflight

* feat(TP-042): complete Step 0 — Preflight

* hydrate: add R001 revision items to Step 1

* hydrate: TP-044 expand Step 1 checkboxes with R001 revisions

* hydrate: TP-044 expand Step 1 checkboxes with R001 review feedback

* feat(TP-044): complete Step 1 — Dashboard Server serves supervisor data

* hydrate: expand Step 2 checkboxes

* feat(TP-042): complete Step 1 — /orch routing logic

- Export hasConfigFiles from config-loader.ts for config file detection
- Implement detectOrchState() with strict precedence: active-batch →
  completed-batch → no-config → pending-tasks → no-tasks (R001-3)
- Modify /orch handler: no-args activates supervisor with routing context;
  with-args early-returns to existing batch execution flow (preserved)
- Add SupervisorRoutingContext to activateSupervisor() — skips
  lockfile/heartbeat/event-tailer for non-batch routing modes
- Handle corrupt batch-state.json gracefully (try/catch, fall through)
- Update test 1.13 to account for routing activateSupervisor call
  appearing before startBatchAsync in the no-args path

* feat(TP-042): complete Step 1 — /orch routing logic

* feat(TP-044): complete Step 2 — Dashboard Frontend Supervisor Panel

* hydrate: add R002 revision items to Step 1

* feat(TP-044): complete Step 3 — Testing & Verification

* checkpoint: TP-044 task artifacts (.DONE, STATUS.md)

* feat(TP-044): complete Step 4 — Documentation & Delivery

* feat(TP-042): complete Step 1 — fix R002 root selection and orch branch validation

* feat(TP-042): complete Step 1 — /orch routing logic with R002 fixes

* hydrate: expand Step 2 checkboxes

* feat(TP-042): complete Step 2 — Onboarding Flow (Scripts 1-5)

* hydrate: add R004 revision items to Step 2

* feat(TP-042): complete Step 2 — Onboarding Flow (Scripts 1-5)

- Remove duplicate buildOnboardingSystemPrompt (buildRoutingSystemPrompt is canonical)
- Fix completed-batch routing: switch case matched wrong state name
- Add Config Generation Reference to supervisor-primer.md with full JSON config
  template, CONTEXT.md template, .pi/agents/ structure, and .gitignore patterns
- All 2002 tests pass

* feat(TP-042): complete Step 2 — fix routing→batch transition and config template shape

* hydrate: expand Step 3 checkboxes

* hydrate: add R004 revision items to Step 2

* feat(TP-042): complete Step 2 — fix R004 revision: testing.commands shape + agents artifact list

* feat(TP-042): complete Step 3 — Returning User Flows (Scripts 6-8)

* hydrate: expand Step 4 checkboxes

* feat(TP-042): complete Step 4 — testing & verification

* checkpoint: TP-042 task artifacts (.DONE, STATUS.md)

* feat(TP-043): complete Step 0 — Preflight

* hydrate: expand Step 1 checkboxes

* feat(TP-043): complete Step 1 — Supervisor-Managed Integration

- Add 'supervised' to integration mode type (types.ts, config-schema.ts,
  config-loader.ts, settings-tui.ts)
- Gate legacy attemptAutoIntegration in engine.ts and resume.ts — defer
  to supervisor for supervised/auto modes
- Defer supervisor deactivation in startBatchAsync onTerminal — supervisor
  stays alive through post-batch integration flow
- Update supervisor system prompt guardrails to conditionally allow
  push/PR operations in supervised/auto integration modes
- Implement detectBranchProtection helper using gh API
- Implement buildIntegrationPlan, formatIntegrationPlan, formatIntegrationOutcome
  helpers for integration mode selection
- Implement triggerSupervisorIntegration — builds plan, sends to supervisor
  with mode-appropriate instructions (supervised: confirm, auto: execute)
- Handle conflicts, CI failure, PR fallback in supervisor integration messages
- Update structural tests for new architecture

* hydrate: add R002 revision items to Step 1

* feat(TP-043): complete Step 1 — supervisor-managed integration with R002 revisions

* feat(TP-043): complete Step 1 — supervisor-managed integration with programmatic CI polling

* hydrate: expand Step 2 checkboxes

* hydrate: add R003 revision items to Step 2

* feat(TP-043): complete Step 2 — Batch Summary Generation with Tier 0 events

* feat(TP-043): complete Step 2 — batch summary generation

* hydrate: add R004 revision items to Step 2

* feat(TP-043): complete Step 2 — batch summary with R004 supervised-mode sequencing fix

* feat(TP-043): complete Step 2 — batch summary generation with R004 fix

* hydrate: expand Step 3 checkboxes

* hydrate: expand Step 3 checkboxes

* feat(TP-043): complete Step 3 — Testing & Verification (70 tests, 0 failures)

* hydrate: add R006 revision items to Step 3

* feat(TP-043): complete Step 3 — Testing & Verification (R006 revisions)

* checkpoint: TP-043 task artifacts (.DONE, STATUS.md)

* feat(TP-043): complete Step 4 — documentation & delivery

* checkpoint: wave 5 task artifacts (.DONE, STATUS.md, REVIEW_VERDICT.json)

* fix: harden merge result parsing and supervisor shutdown cleanup

* docs(tasks): reconcile TP-037..TP-044 status files after batch completion
HenryLach added a commit that referenced this pull request Mar 27, 2026
When a tmux session exits without the poll detecting .DONE on the
filesystem, the engine now checks the lane git branch via
'git show <branch>:<path>/.DONE' before declaring failure.

This handles the race condition where the worker completes all work,
commits .DONE to the lane branch, and exits — but the worktree
filesystem is stale or the poll timing barely misses the file.

Previously this was the #1 cause of false task failures in production
batches (seen in TP-065, TP-067, TP-072, TP-075, and user reports).
HenryLach added a commit that referenced this pull request Mar 27, 2026
When a tmux session exits without the poll detecting .DONE on the
filesystem, the engine now checks the lane git branch via
'git show <branch>:<path>/.DONE' before declaring failure.

This handles the race condition where the worker completes all work,
commits .DONE to the lane branch, and exits — but the worktree
filesystem is stale or the poll timing barely misses the file.

Previously this was the #1 cause of false task failures in production
batches (seen in TP-065, TP-067, TP-072, TP-075, and user reports).
HenryLach added a commit that referenced this pull request Mar 27, 2026
Priority #1 spec for true agent supervision. Three-layer architecture:
- Layer 1: Engine deterministic recovery (known patterns)
- Layer 2: Supervisor LLM for novel/ambiguous situations
- Layer 3: Feedback loop (supervisor files issues → patterns become code)

Key open question: how to wake the supervisor without a user message
(pi's model is request-response). Needs investigation into pi's
extension event system.
HenryLach added a commit that referenced this pull request Mar 27, 2026
Priority #1 spec for true agent supervision. Three-layer architecture:
- Layer 1: Engine deterministic recovery (known patterns)
- Layer 2: Supervisor LLM for novel/ambiguous situations
- Layer 3: Feedback loop (supervisor files issues → patterns become code)

Key open question: how to wake the supervisor without a user message
(pi's model is request-response). Needs investigation into pi's
extension event system.
HenryLach added a commit that referenced this pull request Apr 3, 2026
Three changes to improve progress visibility and prevent false stalls:

1. Worker template: Added RULE #1 at the top — 'Check off each checkbox
   IMMEDIATELY after completing it.' With explicit correct/wrong examples.
   Reinforced in Checkpoint Discipline section. Workers were batching all
   checkboxes at step end, leaving dashboard at 0% for entire steps.

2. Lane-runner prompt: Added explicit CHECKPOINT RULE reminder in the
   worker prompt sent on each iteration.

3. Stall timeout: 30 → 60 minutes default. With 120-min worker timeout,
   the 30-min stall timeout was acting as the effective worker limit for
   any step taking >30 min without a STATUS.md update.

3119 tests pass.
HenryLach added a commit that referenced this pull request Apr 11, 2026
… (Sage review)

Two fixes from Sage code review of TP-163:

1. merge-tree output validation: validate the tree SHA matches a 40-hex
   OID pattern before passing it to commit-tree. git merge-tree --write-tree
   exits 0 on clean merge but could produce unexpected output in edge cases.
   An invalid SHA would cause commit-tree to fail with a confusing error.

2. executeWave param renamed baseBranch -> orchBranch: the parameter is
   always the orch branch name (batchState.orchBranch at all call sites),
   not the user's working branch. The old name caused confusion in the new
   ensureTaskFilesCommitted code that explicitly handles orch branch updates.

Workspace multi-repo gap (Sage finding #1) tracked in #479 — requires
per-repo grouping of wave tasks and is a larger change.
HenryLach added a commit that referenced this pull request May 10, 2026
…ack + segment edge case)

Sage code-review of the merged TP-190 fix flagged 2 important
correctness issues. Both folded surgically before local-build.

## Sage finding #1: residual monitor hang on snapshot-write failure

The spawn-failure catch in execution.ts:2724 now writes a synthetic
terminal lane snapshot via writeLaneSnapshot() so monitorLanes exits
its poll loop. But the catch's comment claimed:

  // Best effort \u2014 if the snapshot write fails, the monitor's
  // 30s-staleness fallback (snap with old updatedAt) eventually
  // kicks in via the registry liveness check.

That claim was wrong. resolveTaskMonitorState's null-snapshot branch
only consults the registry when staleMs > 30_000. But when snap is
null (no file at all, e.g., write failed), staleMs == 0 (because
snap?.updatedAt is undefined). The 30s check never fires.

Result: snapshot-write failure (disk full, permission, transient I/O)
leaves snap == null indefinitely, sessionAlive stays true, monitor
polls forever \u2014 reintroducing the exact same hang the spawn-failure
catch was supposed to fix.

Fix: add a new branch in resolveTaskMonitorState's null-snapshot path:
when snap == null AND tracker has been observing this task for >= 60s
(past startup grace), call isV2AgentAlive() against the registry
instead of defaulting to alive. The 60s threshold matches the existing
startup-grace boundary so we don't false-fail a slow-starting worker
that hasn't yet written its first snapshot.

## Sage finding #2: segment-edge false-positive on phase=failed

isAllLanesSpawnFailedWave checked succeededTaskIds.length !== 0 to
gate the all-failed verdict. That field is the *terminal* completion
projection, populated only when a multi-segment task reaches its
final segment.

A wave with a multi-segment task A succeeding on segment 1 (with a
continuation segment scheduled for a later round) plus a separate
single-segment task B spawn-failing would have:

  failedTaskIds   = [B]
  succeededTaskIds = []     \u2190 A's segment 1 success NOT terminal
  laneResults[].tasks[]    = [{status: 'succeeded'}, {status: 'failed'}]

The previous logic would have flagged this as 'all-spawn-failed' and
transitioned phase to 'failed' \u2014 burying real progress and giving
the operator a false 'must fix Pi install' signal.

Fix: extend isAllLanesSpawnFailedWave to optionally accept laneResults
(WaveExecutionResult.laneResults) and scan per-task outcomes for any
status==='succeeded'. If found, return false (not all-failed). The
parameter is optional for backward compat with v0.29.0 callers and
the existing TP-190 unit test suite. The production call site in
engine.ts (post-wave handling) passes the full waveResult, which
structurally satisfies the new optional field.

## Tests

4 new tests in spawn-failure-visibility.test.ts:

- 3.1h (sage): segment-success-with-continuation \u2192 returns false
  even when succeededTaskIds is empty
- 3.1i (sage): all failures, no successes anywhere \u2192 returns true
  (no false negative on the new check)
- 3.1j (sage): laneResults parameter is optional (back-compat)
- 4.1 (sage): execution.ts source pattern asserts the
  null-snapshot tracker-age fallback is wired correctly

A full behavioral test for the snapshot-fallback would need a
mocked monitor loop \u2014 deferred to a future polish task. The source
pattern catches the most likely regression (someone removing the
fallback branch).

## Sage findings deferred (non-blocking for morning testing)

- spawn_failure over-classification (sage important/medium): catch
  applies 'spawn_failure' to ALL thrown executeTaskV2 exceptions, not
  just proven spawn-stage errors. Worth narrowing later, but blast
  radius is small in practice (executeTaskV2 catches its own runtime
  errors internally; only true spawn-time exceptions escape to the
  outer catch). Tracking as a polish item.

- /orch-resume parity check: should resume also handle
  'all-lanes-spawn-failed \u2192 phase=failed'? Currently mirrors alert
  payload but not phase shortcut. Deferred \u2014 resume isn't in scope
  for this fix.

## Validation

- 3624 passing / 1 skipped / 0 failed (was 3620 pre-fold, +4 new tests)
- All 37 spawn-failure-visibility tests pass

Closes TP-190 (#561) for the morning test cycle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependency updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant