diff --git a/bin/taskplane.mjs b/bin/taskplane.mjs index 0d02ffb6..f584ff49 100644 --- a/bin/taskplane.mjs +++ b/bin/taskplane.mjs @@ -212,7 +212,6 @@ orchestrator: max_lanes: ${vars.max_lanes} worktree_location: "subdirectory" worktree_prefix: "${vars.worktree_prefix}" - integration_branch: "${vars.integration_branch}" batch_id_format: "timestamp" spawn_mode: "subprocess" tmux_prefix: "${vars.tmux_prefix}" @@ -707,7 +706,6 @@ function getPresetVars(preset, projectRoot, tasksRootOverride = null) { const { test: test_cmd, build: build_cmd } = detectStack(projectRoot); return { project_name: dirName, - integration_branch: "main", max_lanes: 3, worktree_prefix: `${slug}-wt`, tmux_prefix: `${slug}-orch`, @@ -725,7 +723,6 @@ async function getInteractiveVars(projectRoot, tasksRootOverride = null) { const detected = detectStack(projectRoot); const project_name = await ask("Project name", dirName); - const integration_branch = await ask("Default branch (fallback — orchestrator uses your current branch at runtime)", "main"); const max_lanes = parseInt(await ask("Max parallel lanes", "3")) || 3; const tasks_root = tasksRootOverride || await ask("Tasks directory", "taskplane-tasks"); const default_area = await ask("Default area name", "general"); @@ -736,7 +733,6 @@ async function getInteractiveVars(projectRoot, tasksRootOverride = null) { const slug = slugify(project_name); return { project_name, - integration_branch, max_lanes, worktree_prefix: `${slug}-wt`, tmux_prefix: `${slug}-orch`, diff --git a/docs/how-to/configure-task-orchestrator.md b/docs/how-to/configure-task-orchestrator.md index 5f646625..938db7b8 100644 --- a/docs/how-to/configure-task-orchestrator.md +++ b/docs/how-to/configure-task-orchestrator.md @@ -24,7 +24,6 @@ orchestrator: max_lanes: 3 worktree_location: "subdirectory" worktree_prefix: "taskplane-wt" - integration_branch: "main" batch_id_format: "timestamp" spawn_mode: "subprocess" tmux_prefix: "orch" @@ -34,7 +33,6 @@ orchestrator: - `worktree_location`: - `subdirectory` → `.worktrees/-N` - `sibling` → `../-N` -- `integration_branch`: branch merges target - `spawn_mode`: - `subprocess`: headless, no tmux dependency - `tmux`: attachable sessions for deep visibility @@ -132,7 +130,6 @@ Polling interval (seconds) for orchestrator monitoring loop. orchestrator: max_lanes: 3 spawn_mode: "subprocess" - integration_branch: "main" failure: on_task_failure: "skip-dependents" diff --git a/docs/reference/configuration/task-orchestrator.yaml.md b/docs/reference/configuration/task-orchestrator.yaml.md index ee3ed919..b83841e5 100644 --- a/docs/reference/configuration/task-orchestrator.yaml.md +++ b/docs/reference/configuration/task-orchestrator.yaml.md @@ -31,7 +31,6 @@ monitoring: | `orchestrator.max_lanes` | number | `3` | Maximum parallel execution lanes/worktrees. | | `orchestrator.worktree_location` | `"sibling"` \| `"subdirectory"` | `"subdirectory"` | Where lane worktree directories are created. | | `orchestrator.worktree_prefix` | string | `"taskplane-wt"` | Prefix used for worktree directory names and lane branch naming. | -| `orchestrator.integration_branch` | string | `"main"` | Branch that lane changes merge into. | | `orchestrator.batch_id_format` | `"timestamp"` \| `"sequential"` | `"timestamp"` | Batch ID format used in logs/branch naming. | | `orchestrator.spawn_mode` | `"tmux"` \| `"subprocess"` | `"subprocess"` | How lane sessions are spawned. | | `orchestrator.tmux_prefix` | string | `"orch"` | Prefix for orchestrator tmux sessions (tmux mode). | diff --git a/extensions/taskplane/engine.ts b/extensions/taskplane/engine.ts index 78d856c3..422eb004 100644 --- a/extensions/taskplane/engine.ts +++ b/extensions/taskplane/engine.ts @@ -8,7 +8,7 @@ import { join } from "path"; import { formatDiscoveryResults, runDiscovery } from "./discovery.ts"; import { execLog, executeWave, tmuxKillSession } from "./execution.ts"; import type { MonitorUpdateCallback } from "./execution.ts"; -import { runGit } from "./git.ts"; +import { getCurrentBranch, runGit } from "./git.ts"; import { mergeWave } from "./merge.ts"; import { ORCH_MESSAGES } from "./messages.ts"; import { deleteBatchState, loadBatchHistory, persistRuntimeState, saveBatchHistory, seedPendingOutcomesForAllocatedLanes, syncTaskOutcomesFromMonitor, upsertTaskOutcome } from "./persistence.ts"; @@ -51,6 +51,17 @@ export async function executeOrchBatch( batchState.pauseSignal = { paused: false }; batchState.mergeResults = []; + // Capture the current branch as the base for worktrees and merge target + const detectedBranch = getCurrentBranch(repoRoot); + if (!detectedBranch) { + batchState.phase = "failed"; + batchState.endedAt = Date.now(); + batchState.errors.push("Cannot determine current branch (detached HEAD or not a git repo)"); + onNotify("❌ Cannot determine current branch. Ensure HEAD is on a branch (not detached).", "error"); + return; + } + batchState.baseBranch = detectedBranch; + // When true, final cleanup is skipped so failed merge state is preserved // for manual intervention and TS-009 resume flow. let preserveWorktreesForResume = false; @@ -215,6 +226,7 @@ export async function executeOrchBatch( batchState.batchId, batchState.pauseSignal, depGraph, + batchState.baseBranch, handleWaveMonitorUpdate, (lanes) => { latestAllocatedLanes = lanes; @@ -321,6 +333,7 @@ export async function executeOrchBatch( orchConfig, repoRoot, batchState.batchId, + batchState.baseBranch, ); allMergeResults.push(mergeResult); batchState.mergeResults.push(mergeResult); @@ -474,7 +487,7 @@ export async function executeOrchBatch( "info", ); - const targetBranch = orchConfig.orchestrator.integration_branch; + const targetBranch = batchState.baseBranch; for (const wt of existingWorktrees) { const resetResult = safeResetWorktree(wt, targetBranch, repoRoot); if (!resetResult.success) { @@ -653,8 +666,8 @@ export async function executeOrchBatch( } } catch { /* .pi dir may not exist */ } - // Clean up worktrees — pass integration branch to protect unmerged work - const targetBranch = orchConfig.orchestrator.integration_branch; + // Clean up worktrees — pass base branch to protect unmerged work + const targetBranch = batchState.baseBranch; execLog("batch", batchState.batchId, "cleaning up worktrees"); const removeResult = removeAllWorktrees(prefix, repoRoot, targetBranch); diff --git a/extensions/taskplane/execution.ts b/extensions/taskplane/execution.ts index 00665ed8..37594822 100644 --- a/extensions/taskplane/execution.ts +++ b/extensions/taskplane/execution.ts @@ -1403,7 +1403,7 @@ export function computeTransitiveDependents( * * This function checks each wave task's folder for untracked or modified files, * stages them, and creates a commit on the current branch. This must run BEFORE - * allocateLanes() so that worktrees (which are based on the integration branch) + * allocateLanes() so that worktrees (which are based on the batch's base branch) * include the task files. * * Only task-specific folders are staged — no other working tree changes are touched. @@ -1522,6 +1522,7 @@ export function ensureTaskFilesCommitted( * @param batchId - Batch ID for naming * @param pauseSignal - Shared pause signal (mutated by stop-wave policy) * @param dependencyGraph - Dependency graph for computing transitive dependents + * @param baseBranch - Branch to base worktrees on (captured at batch start) * @param onMonitorUpdate - Optional callback for dashboard updates during monitoring * @param onLanesAllocated - Optional callback fired after lane allocation succeeds * @returns WaveExecutionResult with outcomes and blocked task IDs @@ -1535,6 +1536,7 @@ export async function executeWave( batchId: string, pauseSignal: { paused: boolean }, dependencyGraph: DependencyGraph, + baseBranch: string, onMonitorUpdate?: MonitorUpdateCallback, onLanesAllocated?: (lanes: AllocatedLane[]) => void, ): Promise { @@ -1576,7 +1578,7 @@ export async function executeWave( } // ── Stage 1: Allocate lanes ────────────────────────────────── - const allocResult = allocateLanes(waveTasks, pending, config, repoRoot, batchId); + const allocResult = allocateLanes(waveTasks, pending, config, repoRoot, batchId, baseBranch); if (!allocResult.success) { const errMsg = allocResult.error?.message || "Unknown allocation failure"; diff --git a/extensions/taskplane/git.ts b/extensions/taskplane/git.ts index 04cb363f..f3cc648a 100644 --- a/extensions/taskplane/git.ts +++ b/extensions/taskplane/git.ts @@ -5,6 +5,24 @@ import { execFileSync } from "child_process"; +// ── Branch Helpers ─────────────────────────────────────────────────── + +/** + * Get the current branch name (the branch checked out in the given directory). + * + * Uses `git rev-parse --abbrev-ref HEAD`. Returns the branch name or null + * if HEAD is detached or git fails. + * + * @param cwd - Working directory (defaults to process.cwd()) + */ +export function getCurrentBranch(cwd?: string): string | null { + const result = runGit(["rev-parse", "--abbrev-ref", "HEAD"], cwd); + if (!result.ok || !result.stdout.trim() || result.stdout.trim() === "HEAD") { + return null; + } + return result.stdout.trim(); +} + // ── Git Command Runner ─────────────────────────────────────────────── /** diff --git a/extensions/taskplane/merge.ts b/extensions/taskplane/merge.ts index 4af89114..d3a549f3 100644 --- a/extensions/taskplane/merge.ts +++ b/extensions/taskplane/merge.ts @@ -451,7 +451,7 @@ export function waitForMergeResult( } /** - * Merge a completed wave's lane branches into the integration branch. + * Merge a completed wave's lane branches into the base branch. * * Orchestration flow: * 1. Filter to only succeeded lanes (failed lanes are not merged) @@ -464,7 +464,7 @@ export function waitForMergeResult( * e. Handle result (continue, log, or pause) * 4. Return MergeWaveResult * - * Sequential execution is mandatory — the integration branch is a shared + * Sequential execution is mandatory — the base branch is a shared * resource, and each merge must see the prior merge's result. * * On CONFLICT_UNRESOLVED or BUILD_FAILURE: stops merging remaining lanes @@ -479,6 +479,7 @@ export function waitForMergeResult( * @param config - Orchestrator configuration * @param repoRoot - Main repository root * @param batchId - Batch ID for session naming + * @param baseBranch - Branch to merge into (captured at batch start) * @returns MergeWaveResult with per-lane outcomes */ export function mergeWave( @@ -488,10 +489,11 @@ export function mergeWave( config: OrchestratorConfig, repoRoot: string, batchId: string, + baseBranch: string, ): MergeWaveResult { const startTime = Date.now(); const tmuxPrefix = config.orchestrator.tmux_prefix; - const targetBranch = config.orchestrator.integration_branch; + const targetBranch = baseBranch; const laneResults: MergeLaneResult[] = []; // Build lane outcome lookup for merge eligibility checks. diff --git a/extensions/taskplane/persistence.ts b/extensions/taskplane/persistence.ts index eba683e8..d04fa8ae 100644 --- a/extensions/taskplane/persistence.ts +++ b/extensions/taskplane/persistence.ts @@ -319,6 +319,15 @@ export function validatePersistedState(data: unknown): PersistedBatchState { } } + // ── Optional string fields (backward-compatible) ───────────── + // baseBranch was added after schema v1; default to empty string if missing + if (obj.baseBranch !== undefined && typeof obj.baseBranch !== "string") { + throw new StateFileError( + "STATE_SCHEMA_INVALID", + `Invalid "baseBranch" field (expected string, got ${typeof obj.baseBranch})`, + ); + } + // ── Phase enum validation ──────────────────────────────────── if (!VALID_BATCH_PHASES.has(obj.phase as string)) { throw new StateFileError( @@ -520,6 +529,11 @@ export function validatePersistedState(data: unknown): PersistedBatchState { } } + // Default baseBranch for backward compatibility with older state files + if (!obj.baseBranch) { + (obj as any).baseBranch = ""; + } + return obj as unknown as PersistedBatchState; } @@ -612,6 +626,7 @@ export function serializeBatchState( schemaVersion: BATCH_STATE_SCHEMA_VERSION, phase: state.phase, batchId: state.batchId, + baseBranch: state.baseBranch, startedAt: state.startedAt, updatedAt: now, endedAt: state.endedAt, diff --git a/extensions/taskplane/resume.ts b/extensions/taskplane/resume.ts index 18f056a0..9bf6925c 100644 --- a/extensions/taskplane/resume.ts +++ b/extensions/taskplane/resume.ts @@ -442,6 +442,7 @@ export async function resumeOrchBatch( // ── 6. Reconstruct runtime state ───────────────────────────── batchState.phase = "executing"; batchState.batchId = persistedState.batchId; + batchState.baseBranch = persistedState.baseBranch || ""; batchState.startedAt = persistedState.startedAt; batchState.pauseSignal = { paused: false }; batchState.totalWaves = persistedState.totalWaves; @@ -684,6 +685,7 @@ export async function resumeOrchBatch( orchConfig, repoRoot, batchState.batchId, + batchState.baseBranch, ); if (reExecMergeResult.status === "succeeded") { @@ -693,7 +695,7 @@ export async function resumeOrchBatch( ); // Clean up merged branches - const targetBranch = orchConfig.orchestrator.integration_branch; + const targetBranch = batchState.baseBranch; for (const lr of reExecMergeResult.laneResults) { if (lr.result?.status === "SUCCESS" || lr.result?.status === "CONFLICT_RESOLVED") { deleteBranchBestEffort(lr.sourceBranch, repoRoot); @@ -809,6 +811,7 @@ export async function resumeOrchBatch( batchState.batchId, batchState.pauseSignal, depGraph, + batchState.baseBranch, handleResumeMonitorUpdate, (lanes) => { latestAllocatedLanes = lanes; @@ -918,6 +921,7 @@ export async function resumeOrchBatch( orchConfig, repoRoot, batchState.batchId, + batchState.baseBranch, ); batchState.mergeResults.push(mergeResult); @@ -1018,7 +1022,7 @@ export async function resumeOrchBatch( // Post-merge: reset worktrees for next wave if (mergeResult && mergeResult.status === "succeeded") { - const targetBranch = orchConfig.orchestrator.integration_branch; + const targetBranch = batchState.baseBranch; for (const lr of mergeResult.laneResults) { if (lr.result?.status === "SUCCESS" || lr.result?.status === "CONFLICT_RESOLVED") { const ancestorCheck = runGit(["merge-base", "--is-ancestor", lr.sourceBranch, targetBranch], repoRoot); @@ -1033,7 +1037,7 @@ export async function resumeOrchBatch( const wtPrefix = orchConfig.orchestrator.worktree_prefix; const existingWorktrees = listWorktrees(wtPrefix, repoRoot); if (existingWorktrees.length > 0) { - const targetBranch = orchConfig.orchestrator.integration_branch; + const targetBranch = batchState.baseBranch; for (const wt of existingWorktrees) { const resetResult = safeResetWorktree(wt, targetBranch, repoRoot); if (!resetResult.success) { @@ -1047,7 +1051,7 @@ export async function resumeOrchBatch( // ── 11. Cleanup and terminal state ─────────────────────────── if (!preserveWorktreesForResume) { const wtPrefix = orchConfig.orchestrator.worktree_prefix; - const targetBranch = orchConfig.orchestrator.integration_branch; + const targetBranch = batchState.baseBranch; removeAllWorktrees(wtPrefix, repoRoot, targetBranch); } diff --git a/extensions/taskplane/types.ts b/extensions/taskplane/types.ts index da2271c8..2a31eff0 100644 --- a/extensions/taskplane/types.ts +++ b/extensions/taskplane/types.ts @@ -12,7 +12,6 @@ export interface OrchestratorConfig { max_lanes: number; worktree_location: "sibling" | "subdirectory"; worktree_prefix: string; - integration_branch: string; batch_id_format: "timestamp" | "sequential"; spawn_mode: "tmux" | "subprocess"; tmux_prefix: string; @@ -136,7 +135,6 @@ export const DEFAULT_ORCHESTRATOR_CONFIG: OrchestratorConfig = { max_lanes: 3, worktree_location: "subdirectory", worktree_prefix: "taskplane-wt", - integration_branch: "main", batch_id_format: "timestamp", spawn_mode: "subprocess", tmux_prefix: "orch", @@ -790,6 +788,8 @@ export interface OrchBatchRuntimeState { phase: OrchBatchPhase; /** Unique batch identifier (timestamp format, e.g., "20260308T214300") */ batchId: string; + /** Branch that was active when /orch started — used as base for worktrees and merge target */ + baseBranch: string; /** Shared pause signal — set by /orch-pause, read by executeLane/executeWave */ pauseSignal: { paused: boolean }; /** All wave results in order (grows as waves complete) */ @@ -866,6 +866,7 @@ export function freshOrchBatchState(): OrchBatchRuntimeState { return { phase: "idle", batchId: "", + baseBranch: "", pauseSignal: { paused: false }, waveResults: [], currentWaveIndex: -1, @@ -1208,6 +1209,8 @@ export interface PersistedBatchState { phase: OrchBatchPhase; /** Unique batch identifier (timestamp format) */ batchId: string; + /** Branch that was active when /orch started — used as base for worktrees and merge target */ + baseBranch: string; /** Epoch ms when batch started */ startedAt: number; /** Epoch ms when state was last written */ diff --git a/extensions/taskplane/waves.ts b/extensions/taskplane/waves.ts index e1fa7287..ff049ec1 100644 --- a/extensions/taskplane/waves.ts +++ b/extensions/taskplane/waves.ts @@ -628,14 +628,6 @@ export function validateAllocationInputs( ); } - // Validate integration branch is non-empty - if (!config.orchestrator.integration_branch?.trim()) { - return new AllocationError( - "ALLOC_INVALID_CONFIG", - `integration_branch must be a non-empty string`, - ); - } - return null; } @@ -673,6 +665,7 @@ export function validateAllocationInputs( * @param config - Orchestrator configuration * @param repoRoot - Absolute path to the main repository root * @param batchId - Batch ID for branch/session naming (e.g., "20260308T111750") + * @param baseBranch - Branch to base worktrees on (captured at batch start) * @returns - AllocateLanesResult with success flag and lane details */ export function allocateLanes( @@ -681,6 +674,7 @@ export function allocateLanes( config: OrchestratorConfig, repoRoot: string, batchId: string, + baseBranch: string, ): AllocateLanesResult { // ── Stage 0: Input validation ──────────────────────────────── const validationError = validateAllocationInputs(waveTasks, pending, config); @@ -731,7 +725,7 @@ export function allocateLanes( } // ── Stage 3: Ensure lane worktrees exist (reuse across waves + create missing) ─ - const worktreeResult = ensureLaneWorktrees(sortedLaneNumbers, batchId, config, repoRoot); + const worktreeResult = ensureLaneWorktrees(sortedLaneNumbers, batchId, config, repoRoot, baseBranch); if (!worktreeResult.success) { const failedLanes = worktreeResult.errors diff --git a/extensions/taskplane/worktree.ts b/extensions/taskplane/worktree.ts index 470438a1..d2b6d488 100644 --- a/extensions/taskplane/worktree.ts +++ b/extensions/taskplane/worktree.ts @@ -1103,8 +1103,9 @@ export function escapeRegex(str: string): string { * * @param count - Number of worktrees to create (1-indexed: lane 1..count) * @param batchId - Batch ID timestamp for branch naming - * @param config - Orchestrator config (prefix, baseBranch extracted from it) + * @param config - Orchestrator config (prefix extracted from it) * @param repoRoot - Absolute path to the main repository root + * @param baseBranch - Branch to base worktrees on (captured at batch start) * @returns - CreateLaneWorktreesResult with success flag and details */ export function createLaneWorktrees( @@ -1112,9 +1113,9 @@ export function createLaneWorktrees( batchId: string, config: OrchestratorConfig, repoRoot: string, + baseBranch: string, ): CreateLaneWorktreesResult { const prefix = config.orchestrator.worktree_prefix; - const baseBranch = config.orchestrator.integration_branch; const created: WorktreeInfo[] = []; const errors: BulkWorktreeError[] = []; @@ -1175,7 +1176,7 @@ export function createLaneWorktrees( * Ensure required lane worktrees exist for the current wave. * * Reuses existing worktrees when present (multi-wave behavior), resetting - * them to integration HEAD before use, and only creates missing lanes. + * them to the base branch HEAD before use, and only creates missing lanes. * If creation of a missing lane fails, newly-created lanes in this call are * rolled back. * @@ -1187,9 +1188,9 @@ export function ensureLaneWorktrees( batchId: string, config: OrchestratorConfig, repoRoot: string, + baseBranch: string, ): CreateLaneWorktreesResult { const prefix = config.orchestrator.worktree_prefix; - const baseBranch = config.orchestrator.integration_branch; const existing = listWorktrees(prefix, repoRoot); const existingByLane = new Map(); @@ -1205,7 +1206,7 @@ export function ensureLaneWorktrees( for (const lane of needed) { const reused = existingByLane.get(lane); if (reused) { - // Reused worktrees must be reset to integration branch HEAD before use. + // Reused worktrees must be reset to base branch HEAD before use. // This covers normal multi-wave reuse and stale leftovers from prior batches. const resetResult = safeResetWorktree(reused, baseBranch, repoRoot); if (resetResult.success) { diff --git a/extensions/tests/worktree-lifecycle.test.ts b/extensions/tests/worktree-lifecycle.test.ts index 6926439c..888fa49f 100644 --- a/extensions/tests/worktree-lifecycle.test.ts +++ b/extensions/tests/worktree-lifecycle.test.ts @@ -1087,7 +1087,6 @@ describe("5.6 createLaneWorktrees — bulk creation", () => { max_lanes: 3, worktree_location: "sibling" as const, worktree_prefix: prefix, - integration_branch: "develop", batch_id_format: "timestamp" as const, spawn_mode: "tmux" as const, tmux_prefix: "orch", @@ -1100,7 +1099,7 @@ describe("5.6 createLaneWorktrees — bulk creation", () => { monitoring: { poll_interval: 5 }, }; - const result = createLaneWorktrees(3, "bulk001", config, repoDir); + const result = createLaneWorktrees(3, "bulk001", config, repoDir, "develop"); assertEqual(result.success, true, "should succeed"); assertEqual(result.worktrees.length, 3, "should have 3 worktrees"); @@ -1128,7 +1127,6 @@ describe("5.6 createLaneWorktrees — bulk creation", () => { max_lanes: 3, worktree_location: "sibling" as const, worktree_prefix: prefix, - integration_branch: "develop", batch_id_format: "timestamp" as const, spawn_mode: "tmux" as const, tmux_prefix: "orch", @@ -1141,7 +1139,7 @@ describe("5.6 createLaneWorktrees — bulk creation", () => { monitoring: { poll_interval: 5 }, }; - const result = createLaneWorktrees(3, "bulkfail", config, repoDir); + const result = createLaneWorktrees(3, "bulkfail", config, repoDir, "develop"); assertEqual(result.success, false, "should fail"); assert(result.errors.length > 0, "should have errors"); diff --git a/taskplane-tasks/CONTEXT.md b/taskplane-tasks/CONTEXT.md new file mode 100644 index 00000000..1ad45055 --- /dev/null +++ b/taskplane-tasks/CONTEXT.md @@ -0,0 +1,40 @@ +# General — Context + +**Last Updated:** 2026-03-15 +**Status:** Active +**Next Task ID:** TP-013 + +--- + +## Current State + +This is the default task area for Taskplane. Tasks for developing and improving +the Taskplane package itself are created here. + +Taskplane is an AI agent orchestration system built as a pi package. It provides: +- Single-task autonomous execution (`/task`) +- Dependency-aware parallel orchestration (`/orch*`) +- File-backed state, resumability, and observability + +--- + +## Key Files + +| Category | Path | +|----------|------| +| Tasks | `taskplane-tasks/` | +| Config | `.pi/task-runner.yaml` | +| Config | `.pi/task-orchestrator.yaml` | +| Extensions | `extensions/task-runner.ts`, `extensions/task-orchestrator.ts` | +| Orchestrator modules | `extensions/taskplane/` | +| Tests | `extensions/tests/` | +| CLI | `bin/taskplane.mjs` | +| Dashboard | `dashboard/` | +| Templates | `templates/` | +| Skills | `skills/` | + +--- + +## Technical Debt / Future Work + +_Items discovered during task execution are logged here by agents._ diff --git a/taskplane-tasks/TP-001-workspace-config-and-execution-context/PROMPT.md b/taskplane-tasks/TP-001-workspace-config-and-execution-context/PROMPT.md new file mode 100644 index 00000000..e8a1bfb8 --- /dev/null +++ b/taskplane-tasks/TP-001-workspace-config-and-execution-context/PROMPT.md @@ -0,0 +1,132 @@ +# Task: TP-001 - Workspace Config and Execution Context Foundations + +**Created:** 2026-03-15 +**Size:** M + +## Review Level: 2 (Plan and Code) + +**Assessment:** Introduces a new runtime mode and shared context contracts spanning orchestrator startup and execution paths. +**Score:** 5/8 — Blast radius: 2, Pattern novelty: 2, Security: 0, Reversibility: 1 + +## Canonical Task Folder +``` +taskplane-tasks/TP-001-workspace-config-and-execution-context/ +├── PROMPT.md ← This file (immutable above --- divider) +├── STATUS.md ← Execution state (worker updates this) +├── .reviews/ ← Reviewer output (task-runner creates this) +└── .DONE ← Created when complete +``` + +## Mission + +Add workspace-mode foundations so Taskplane can run from a non-git workspace root while preserving existing monorepo behavior. Define and validate a canonical execution context consumed by orchestrator modules. + +## Dependencies + +- **None** + +## Context to Read First + +> Only list docs the worker actually needs. Less is better. + +**Tier 2 (area context):** +- `taskplane-tasks/CONTEXT.md` + +**Tier 3 (load only if needed):** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Primary architecture and constraints for polyrepo support +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Concrete ticket decomposition and dependencies +- `.pi/local/docs/taskplane/lane-agent-design.md` — Lane/session supervision and team-scale observability patterns +- `extensions/taskplane/config.ts` — Current config loading behavior + +## Environment + +- **Workspace:** Taskplane extension and dashboard codebase +- **Services required:** None + +## File Scope + +> The orchestrator uses this to avoid merge conflicts: tasks with overlapping +> file scope run on the same lane (serial), not in parallel. + +- `extensions/taskplane/types.ts` +- `extensions/taskplane/workspace.ts` +- `extensions/taskplane/extension.ts` +- `extensions/taskplane/engine.ts` +- `extensions/taskplane/config.ts` +- `extensions/tests/*workspace*` + +## Steps + +> **Hydration:** STATUS.md checkboxes must match the granularity below. +> See task-worker agent for full hydration rules. + +### Step 0: Define workspace/runtime contracts + +- [ ] Add workspace-mode types (WorkspaceConfig, repo/routing structures, execution context) in types.ts +- [ ] Define clear validation/error surfaces for invalid workspace configuration + +### Step 1: Implement workspace config loading + +- [ ] Create extensions/taskplane/workspace.ts loader/validator for .pi/taskplane-workspace.yaml +- [ ] Resolve canonical workspace/task roots and repo map with normalized absolute paths + +### Step 2: Wire orchestrator startup context + +- [ ] Load execution context during session start in extension.ts +- [ ] Thread execution context into engine entry points without changing repo-mode defaults + +### Step 3: Testing & Verification + +> ZERO test failures allowed. + +- [ ] Run unit/regression tests: `cd extensions && npx vitest run` +- [ ] Run targeted tests for changed modules +- [ ] Fix all failures +- [ ] CLI smoke checks pass: `node bin/taskplane.mjs help` + +### Step 4: Documentation & Delivery + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged in STATUS.md +- [ ] `.DONE` created in this folder +- [ ] Task archived (auto — handled by task-runner extension) + +## Documentation Requirements + +**Must Update:** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Record schema or mode-contract adjustments +- `.pi/local/docs/taskplane/polyrepo-implementation-plan.md` — Keep notes aligned with delivered foundations + +**Check If Affected:** +- `docs/reference/commands.md` — Update only if new user-visible commands/options introduced + +## Completion Criteria + +- [ ] All steps complete +- [ ] All tests passing +- [ ] Documentation updated +- [ ] `.DONE` created + +## Git Commit Convention + +All commits for this task MUST include the task ID for traceability: + +- **Implementation:** `feat(TP-001): description` +- **Bug fixes:** `fix(TP-001): description` +- **Tests:** `test(TP-001): description` +- **Checkpoints:** `checkpoint: TP-001 description` + +## Do NOT + +- Expand task scope — add tech debt to CONTEXT.md instead +- Skip tests +- Modify framework/standards docs without explicit user approval +- Load docs not listed in "Context to Read First" +- Commit without the task ID prefix in the commit message + +--- + +## Amendments (Added During Execution) + + diff --git a/taskplane-tasks/TP-001-workspace-config-and-execution-context/STATUS.md b/taskplane-tasks/TP-001-workspace-config-and-execution-context/STATUS.md new file mode 100644 index 00000000..5027c186 --- /dev/null +++ b/taskplane-tasks/TP-001-workspace-config-and-execution-context/STATUS.md @@ -0,0 +1,80 @@ +# TP-001: Workspace Config and Execution Context Foundations — Status + +**Current Step:** Not Started +​**Status:** 🔵 Ready for Execution +**Last Updated:** 2026-03-15 +**Review Level:** 2 +**Review Counter:** 0 +**Iteration:** 0 +**Size:** M + +> **Hydration:** Checkboxes below must be granular — one per unit of work. +> Steps marked `⚠️ Hydrate` will be expanded by the worker. + +--- + +### Step 0: Define workspace/runtime contracts +**Status:** ⬜ Not Started + +- [ ] Add workspace-mode types (WorkspaceConfig, repo/routing structures, execution context) in types.ts +- [ ] Define clear validation/error surfaces for invalid workspace configuration + +--- + +### Step 1: Implement workspace config loading +**Status:** ⬜ Not Started + +- [ ] Create extensions/taskplane/workspace.ts loader/validator for .pi/taskplane-workspace.yaml +- [ ] Resolve canonical workspace/task roots and repo map with normalized absolute paths + +--- + +### Step 2: Wire orchestrator startup context +**Status:** ⬜ Not Started + +- [ ] Load execution context during session start in extension.ts +- [ ] Thread execution context into engine entry points without changing repo-mode defaults + +--- + +### Step 3: Testing & Verification +**Status:** ⬜ Not Started + +- [ ] Unit/regression tests passing +- [ ] Targeted tests for changed modules passing +- [ ] All failures fixed +- [ ] CLI smoke checks passing + +--- + +### Step 4: Documentation & Delivery +**Status:** ⬜ Not Started + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged +- [ ] `.DONE` created +- [ ] Archive and push + +--- + +## Reviews +| # | Type | Step | Verdict | File | +|---|------|------|---------|------| + +## Discoveries +| Discovery | Disposition | Location | +|-----------|-------------|----------| + +## Execution Log +| Timestamp | Action | Outcome | +|-----------|--------|---------| +| 2026-03-15 | Task staged | PROMPT.md and STATUS.md created | + +## Blockers + +*None* + +## Notes + +*Reserved for execution notes* diff --git a/taskplane-tasks/TP-002-task-repo-routing-and-execution-target-parsing/PROMPT.md b/taskplane-tasks/TP-002-task-repo-routing-and-execution-target-parsing/PROMPT.md new file mode 100644 index 00000000..e5a4a521 --- /dev/null +++ b/taskplane-tasks/TP-002-task-repo-routing-and-execution-target-parsing/PROMPT.md @@ -0,0 +1,129 @@ +# Task: TP-002 - Task-to-Repo Routing and Execution Target Parsing + +**Created:** 2026-03-15 +**Size:** M + +## Review Level: 2 (Plan and Code) + +**Assessment:** Adds routing semantics that directly control where code executes. Medium blast radius with clear reversibility. +**Score:** 5/8 — Blast radius: 2, Pattern novelty: 2, Security: 0, Reversibility: 1 + +## Canonical Task Folder +``` +taskplane-tasks/TP-002-task-repo-routing-and-execution-target-parsing/ +├── PROMPT.md ← This file (immutable above --- divider) +├── STATUS.md ← Execution state (worker updates this) +├── .reviews/ ← Reviewer output (task-runner creates this) +└── .DONE ← Created when complete +``` + +## Mission + +Enable deterministic task-to-repo routing in workspace mode by parsing execution targets from PROMPT metadata and applying fallback routing rules from workspace configuration. + +## Dependencies + +- **Task:** TP-001 (workspace execution context must exist before routing can resolve repo targets) + +## Context to Read First + +> Only list docs the worker actually needs. Less is better. + +**Tier 2 (area context):** +- `taskplane-tasks/CONTEXT.md` + +**Tier 3 (load only if needed):** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Primary architecture and constraints for polyrepo support +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Concrete ticket decomposition and dependencies +- `.pi/local/docs/taskplane/lane-agent-design.md` — Lane/session supervision and team-scale observability patterns +- `extensions/taskplane/discovery.ts` — Current argument resolution and PROMPT parser implementation + +## Environment + +- **Workspace:** Taskplane extension and dashboard codebase +- **Services required:** None + +## File Scope + +> The orchestrator uses this to avoid merge conflicts: tasks with overlapping +> file scope run on the same lane (serial), not in parallel. + +- `extensions/taskplane/discovery.ts` +- `extensions/taskplane/messages.ts` +- `extensions/tests/*discovery*` +- `extensions/tests/*routing*` + +## Steps + +> **Hydration:** STATUS.md checkboxes must match the granularity below. +> See task-worker agent for full hydration rules. + +### Step 0: Parse execution target metadata + +- [ ] Extend PROMPT parser to read ## Execution Target / Repo: metadata +- [ ] Preserve backward compatibility for prompts that omit execution target + +### Step 1: Implement routing precedence chain + +- [ ] Resolve repo using: prompt repo -> area map -> workspace default repo +- [ ] Emit explicit errors for unresolved or unknown repo IDs (TASK_REPO_UNRESOLVED, TASK_REPO_UNKNOWN) + +### Step 2: Annotate discovery outputs + +- [ ] Attach resolved repoId to parsed tasks before planning +- [ ] Ensure routing errors fail planning with actionable messages + +### Step 3: Testing & Verification + +> ZERO test failures allowed. + +- [ ] Run unit/regression tests: `cd extensions && npx vitest run` +- [ ] Run targeted tests for changed modules +- [ ] Fix all failures +- [ ] CLI smoke checks pass: `node bin/taskplane.mjs help` + +### Step 4: Documentation & Delivery + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged in STATUS.md +- [ ] `.DONE` created in this folder +- [ ] Task archived (auto — handled by task-runner extension) + +## Documentation Requirements + +**Must Update:** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Reflect final routing precedence and error semantics + +**Check If Affected:** +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Update ticket sequencing if implementation order changes + +## Completion Criteria + +- [ ] All steps complete +- [ ] All tests passing +- [ ] Documentation updated +- [ ] `.DONE` created + +## Git Commit Convention + +All commits for this task MUST include the task ID for traceability: + +- **Implementation:** `feat(TP-002): description` +- **Bug fixes:** `fix(TP-002): description` +- **Tests:** `test(TP-002): description` +- **Checkpoints:** `checkpoint: TP-002 description` + +## Do NOT + +- Expand task scope — add tech debt to CONTEXT.md instead +- Skip tests +- Modify framework/standards docs without explicit user approval +- Load docs not listed in "Context to Read First" +- Commit without the task ID prefix in the commit message + +--- + +## Amendments (Added During Execution) + + diff --git a/taskplane-tasks/TP-002-task-repo-routing-and-execution-target-parsing/STATUS.md b/taskplane-tasks/TP-002-task-repo-routing-and-execution-target-parsing/STATUS.md new file mode 100644 index 00000000..6eb67fdd --- /dev/null +++ b/taskplane-tasks/TP-002-task-repo-routing-and-execution-target-parsing/STATUS.md @@ -0,0 +1,80 @@ +# TP-002: Task-to-Repo Routing and Execution Target Parsing — Status + +**Current Step:** Not Started +​**Status:** 🔵 Ready for Execution +**Last Updated:** 2026-03-15 +**Review Level:** 2 +**Review Counter:** 0 +**Iteration:** 0 +**Size:** M + +> **Hydration:** Checkboxes below must be granular — one per unit of work. +> Steps marked `⚠️ Hydrate` will be expanded by the worker. + +--- + +### Step 0: Parse execution target metadata +**Status:** ⬜ Not Started + +- [ ] Extend PROMPT parser to read ## Execution Target / Repo: metadata +- [ ] Preserve backward compatibility for prompts that omit execution target + +--- + +### Step 1: Implement routing precedence chain +**Status:** ⬜ Not Started + +- [ ] Resolve repo using: prompt repo -> area map -> workspace default repo +- [ ] Emit explicit errors for unresolved or unknown repo IDs (TASK_REPO_UNRESOLVED, TASK_REPO_UNKNOWN) + +--- + +### Step 2: Annotate discovery outputs +**Status:** ⬜ Not Started + +- [ ] Attach resolved repoId to parsed tasks before planning +- [ ] Ensure routing errors fail planning with actionable messages + +--- + +### Step 3: Testing & Verification +**Status:** ⬜ Not Started + +- [ ] Unit/regression tests passing +- [ ] Targeted tests for changed modules passing +- [ ] All failures fixed +- [ ] CLI smoke checks passing + +--- + +### Step 4: Documentation & Delivery +**Status:** ⬜ Not Started + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged +- [ ] `.DONE` created +- [ ] Archive and push + +--- + +## Reviews +| # | Type | Step | Verdict | File | +|---|------|------|---------|------| + +## Discoveries +| Discovery | Disposition | Location | +|-----------|-------------|----------| + +## Execution Log +| Timestamp | Action | Outcome | +|-----------|--------|---------| +| 2026-03-15 | Task staged | PROMPT.md and STATUS.md created | + +## Blockers + +*None* + +## Notes + +*Reserved for execution notes* diff --git a/taskplane-tasks/TP-003-external-task-folder-path-resolution/PROMPT.md b/taskplane-tasks/TP-003-external-task-folder-path-resolution/PROMPT.md new file mode 100644 index 00000000..5492a83a --- /dev/null +++ b/taskplane-tasks/TP-003-external-task-folder-path-resolution/PROMPT.md @@ -0,0 +1,128 @@ +# Task: TP-003 - External Task Folder .DONE and STATUS Path Resolution + +**Created:** 2026-03-15 +**Size:** M + +## Review Level: 2 (Plan and Code) + +**Assessment:** Fixes correctness-critical path translation where task folders live outside execution repos. +**Score:** 5/8 — Blast radius: 2, Pattern novelty: 1, Security: 0, Reversibility: 2 + +## Canonical Task Folder +``` +taskplane-tasks/TP-003-external-task-folder-path-resolution/ +├── PROMPT.md ← This file (immutable above --- divider) +├── STATUS.md ← Execution state (worker updates this) +├── .reviews/ ← Reviewer output (task-runner creates this) +└── .DONE ← Created when complete +``` + +## Mission + +Make orchestrator monitoring and completion detection robust when canonical task packets live in a docs repo while execution occurs in service-repo worktrees. + +## Dependencies + +- **Task:** TP-001 (workspace context is required to distinguish canonical task roots from execution repo roots) + +## Context to Read First + +> Only list docs the worker actually needs. Less is better. + +**Tier 2 (area context):** +- `taskplane-tasks/CONTEXT.md` + +**Tier 3 (load only if needed):** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Primary architecture and constraints for polyrepo support +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Concrete ticket decomposition and dependencies +- `.pi/local/docs/taskplane/lane-agent-design.md` — Lane/session supervision and team-scale observability patterns +- `extensions/taskplane/execution.ts` — Current resolveTaskDonePath and monitoring logic + +## Environment + +- **Workspace:** Taskplane extension and dashboard codebase +- **Services required:** None + +## File Scope + +> The orchestrator uses this to avoid merge conflicts: tasks with overlapping +> file scope run on the same lane (serial), not in parallel. + +- `extensions/taskplane/execution.ts` +- `extensions/tests/*execution*` +- `extensions/tests/*orchestration*` + +## Steps + +> **Hydration:** STATUS.md checkboxes must match the granularity below. +> See task-worker agent for full hydration rules. + +### Step 0: Introduce canonical task-path resolver + +- [ ] Add helper(s) to resolve canonical task folder paths in workspace mode +- [ ] Retain existing repo-relative fallback behavior for monorepo mode + +### Step 1: Fix completion probing + +- [ ] Update .DONE resolution logic to probe correct canonical locations +- [ ] Update STATUS probing/monitor paths for external task roots + +### Step 2: Add regression coverage + +- [ ] Add tests for external task folders outside repo root +- [ ] Verify no monorepo regressions in completion detection + +### Step 3: Testing & Verification + +> ZERO test failures allowed. + +- [ ] Run unit/regression tests: `cd extensions && npx vitest run` +- [ ] Run targeted tests for changed modules +- [ ] Fix all failures +- [ ] CLI smoke checks pass: `node bin/taskplane.mjs help` + +### Step 4: Documentation & Delivery + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged in STATUS.md +- [ ] `.DONE` created in this folder +- [ ] Task archived (auto — handled by task-runner extension) + +## Documentation Requirements + +**Must Update:** +- `.pi/local/docs/taskplane/polyrepo-implementation-plan.md` — Record final path-resolution strategy and fallback behavior + +**Check If Affected:** +- `docs/explanation/waves-lanes-and-worktrees.md` — Update if implementation meaningfully changes operator expectations + +## Completion Criteria + +- [ ] All steps complete +- [ ] All tests passing +- [ ] Documentation updated +- [ ] `.DONE` created + +## Git Commit Convention + +All commits for this task MUST include the task ID for traceability: + +- **Implementation:** `feat(TP-003): description` +- **Bug fixes:** `fix(TP-003): description` +- **Tests:** `test(TP-003): description` +- **Checkpoints:** `checkpoint: TP-003 description` + +## Do NOT + +- Expand task scope — add tech debt to CONTEXT.md instead +- Skip tests +- Modify framework/standards docs without explicit user approval +- Load docs not listed in "Context to Read First" +- Commit without the task ID prefix in the commit message + +--- + +## Amendments (Added During Execution) + + diff --git a/taskplane-tasks/TP-003-external-task-folder-path-resolution/STATUS.md b/taskplane-tasks/TP-003-external-task-folder-path-resolution/STATUS.md new file mode 100644 index 00000000..954421e9 --- /dev/null +++ b/taskplane-tasks/TP-003-external-task-folder-path-resolution/STATUS.md @@ -0,0 +1,80 @@ +# TP-003: External Task Folder .DONE and STATUS Path Resolution — Status + +**Current Step:** Not Started +​**Status:** 🔵 Ready for Execution +**Last Updated:** 2026-03-15 +**Review Level:** 2 +**Review Counter:** 0 +**Iteration:** 0 +**Size:** M + +> **Hydration:** Checkboxes below must be granular — one per unit of work. +> Steps marked `⚠️ Hydrate` will be expanded by the worker. + +--- + +### Step 0: Introduce canonical task-path resolver +**Status:** ⬜ Not Started + +- [ ] Add helper(s) to resolve canonical task folder paths in workspace mode +- [ ] Retain existing repo-relative fallback behavior for monorepo mode + +--- + +### Step 1: Fix completion probing +**Status:** ⬜ Not Started + +- [ ] Update .DONE resolution logic to probe correct canonical locations +- [ ] Update STATUS probing/monitor paths for external task roots + +--- + +### Step 2: Add regression coverage +**Status:** ⬜ Not Started + +- [ ] Add tests for external task folders outside repo root +- [ ] Verify no monorepo regressions in completion detection + +--- + +### Step 3: Testing & Verification +**Status:** ⬜ Not Started + +- [ ] Unit/regression tests passing +- [ ] Targeted tests for changed modules passing +- [ ] All failures fixed +- [ ] CLI smoke checks passing + +--- + +### Step 4: Documentation & Delivery +**Status:** ⬜ Not Started + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged +- [ ] `.DONE` created +- [ ] Archive and push + +--- + +## Reviews +| # | Type | Step | Verdict | File | +|---|------|------|---------|------| + +## Discoveries +| Discovery | Disposition | Location | +|-----------|-------------|----------| + +## Execution Log +| Timestamp | Action | Outcome | +|-----------|--------|---------| +| 2026-03-15 | Task staged | PROMPT.md and STATUS.md created | + +## Blockers + +*None* + +## Notes + +*Reserved for execution notes* diff --git a/taskplane-tasks/TP-004-repo-scoped-lane-allocation-and-worktrees/PROMPT.md b/taskplane-tasks/TP-004-repo-scoped-lane-allocation-and-worktrees/PROMPT.md new file mode 100644 index 00000000..4beaf437 --- /dev/null +++ b/taskplane-tasks/TP-004-repo-scoped-lane-allocation-and-worktrees/PROMPT.md @@ -0,0 +1,143 @@ +# Task: TP-004 - Repo-Scoped Lane Allocation and Worktree Lifecycle + +**Created:** 2026-03-15 +**Size:** L + +## Review Level: 3 (Full) + +**Assessment:** Core orchestration mechanics change across lane identity, assignment, and worktree lifecycle. High blast radius requiring full review. +**Score:** 7/8 — Blast radius: 2, Pattern novelty: 2, Security: 1, Reversibility: 2 + +## Canonical Task Folder +``` +taskplane-tasks/TP-004-repo-scoped-lane-allocation-and-worktrees/ +├── PROMPT.md ← This file (immutable above --- divider) +├── STATUS.md ← Execution state (worker updates this) +├── .reviews/ ← Reviewer output (task-runner creates this) +└── .DONE ← Created when complete +``` + +## Mission + +Refactor wave execution to allocate and manage lanes per target repo so a single batch can safely execute tasks across multiple repositories. + +## Dependencies + +- **Task:** TP-002 (tasks must carry resolved repo IDs before lane allocation) +- **Task:** TP-003 (external task-path handling must be stable before cross-repo lane execution) + +## Context to Read First + +> Only list docs the worker actually needs. Less is better. + +**Tier 2 (area context):** +- `taskplane-tasks/CONTEXT.md` + +**Tier 3 (load only if needed):** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Primary architecture and constraints for polyrepo support +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Concrete ticket decomposition and dependencies +- `.pi/local/docs/taskplane/lane-agent-design.md` — Lane/session supervision and team-scale observability patterns +- `extensions/taskplane/waves.ts` — Current lane assignment and worktree provisioning flow +- `extensions/taskplane/worktree.ts` — Current CRUD assumptions tied to one repo root + +## Environment + +- **Workspace:** Taskplane extension and dashboard codebase +- **Services required:** None + +## File Scope + +> The orchestrator uses this to avoid merge conflicts: tasks with overlapping +> file scope run on the same lane (serial), not in parallel. + +- `extensions/taskplane/waves.ts` +- `extensions/taskplane/worktree.ts` +- `extensions/taskplane/engine.ts` +- `extensions/taskplane/execution.ts` +- `extensions/tests/*waves*` +- `extensions/tests/*worktree*` + +## Steps + +> **Hydration:** STATUS.md checkboxes must match the granularity below. +> See task-worker agent for full hydration rules. + +### Step 0: Refactor lane allocation model + +- [ ] Group wave tasks by repoId and allocate lanes per repo group +- [ ] Extend lane identity contracts to include repo dimension (repoId, repo-aware lane IDs) + +### Step 1: Make worktree operations repo-scoped + +- [ ] Ensure create/reset/remove worktree operations execute against each target repo root +- [ ] Keep deterministic ordering across repo groups and lane numbers + +### Step 2: Update execution contracts + +- [ ] Thread repo-aware lane contracts through execution engine callbacks and state updates +- [ ] Preserve single-repo behavior when workspace mode is disabled + +### Step 3: Testing & Verification + +> ZERO test failures allowed. + +- [ ] Run unit/regression tests: `cd extensions && npx vitest run` +- [ ] Run targeted tests for changed modules +- [ ] Fix all failures +- [ ] CLI smoke checks pass: `node bin/taskplane.mjs help` + +### Step 4: Documentation & Delivery + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged in STATUS.md +- [ ] `.DONE` created in this folder +- [ ] Task archived (auto — handled by task-runner extension) + +## Documentation Requirements + +**Must Update:** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Document finalized lane identity and repo-scoped worktree rules + +**Check If Affected:** +- `extensions/taskplane/messages.ts` — Update user-facing text if lane identifiers change + +## Completion Criteria + +- [ ] All steps complete +- [ ] All tests passing +- [ ] Documentation updated +- [ ] `.DONE` created + +## Git Commit Convention + +All commits for this task MUST include the task ID for traceability: + +- **Implementation:** `feat(TP-004): description` +- **Bug fixes:** `fix(TP-004): description` +- **Tests:** `test(TP-004): description` +- **Checkpoints:** `checkpoint: TP-004 description` + +## Do NOT + +- Expand task scope — add tech debt to CONTEXT.md instead +- Skip tests +- Modify framework/standards docs without explicit user approval +- Load docs not listed in "Context to Read First" +- Commit without the task ID prefix in the commit message + +--- + +## Amendments (Added During Execution) + +### Amendment 1: integration_branch removed — baseBranch is now runtime state + +The `integration_branch` config setting has been removed from `OrchestratorConfig`. +The orchestrator now captures the current branch at `/orch` start via `getCurrentBranch()` +(in `git.ts`) and stores it as `baseBranch` on `OrchBatchRuntimeState` and `PersistedBatchState`. + +**Impact on this task:** +- `allocateLanes()` in `waves.ts` now takes a `baseBranch: string` parameter (last arg) +- `createLaneWorktrees()` and `ensureLaneWorktrees()` in `worktree.ts` now take a `baseBranch: string` parameter (last arg) +- These functions no longer read `config.orchestrator.integration_branch` +- When adding repo-scoped worktree support, pass the appropriate per-repo base branch through these functions diff --git a/taskplane-tasks/TP-004-repo-scoped-lane-allocation-and-worktrees/STATUS.md b/taskplane-tasks/TP-004-repo-scoped-lane-allocation-and-worktrees/STATUS.md new file mode 100644 index 00000000..1336bddf --- /dev/null +++ b/taskplane-tasks/TP-004-repo-scoped-lane-allocation-and-worktrees/STATUS.md @@ -0,0 +1,80 @@ +# TP-004: Repo-Scoped Lane Allocation and Worktree Lifecycle — Status + +**Current Step:** Not Started +​**Status:** 🔵 Ready for Execution +**Last Updated:** 2026-03-15 +**Review Level:** 3 +**Review Counter:** 0 +**Iteration:** 0 +**Size:** L + +> **Hydration:** Checkboxes below must be granular — one per unit of work. +> Steps marked `⚠️ Hydrate` will be expanded by the worker. + +--- + +### Step 0: Refactor lane allocation model +**Status:** ⬜ Not Started + +- [ ] Group wave tasks by repoId and allocate lanes per repo group +- [ ] Extend lane identity contracts to include repo dimension (repoId, repo-aware lane IDs) + +--- + +### Step 1: Make worktree operations repo-scoped +**Status:** ⬜ Not Started + +- [ ] Ensure create/reset/remove worktree operations execute against each target repo root +- [ ] Keep deterministic ordering across repo groups and lane numbers + +--- + +### Step 2: Update execution contracts +**Status:** ⬜ Not Started + +- [ ] Thread repo-aware lane contracts through execution engine callbacks and state updates +- [ ] Preserve single-repo behavior when workspace mode is disabled + +--- + +### Step 3: Testing & Verification +**Status:** ⬜ Not Started + +- [ ] Unit/regression tests passing +- [ ] Targeted tests for changed modules passing +- [ ] All failures fixed +- [ ] CLI smoke checks passing + +--- + +### Step 4: Documentation & Delivery +**Status:** ⬜ Not Started + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged +- [ ] `.DONE` created +- [ ] Archive and push + +--- + +## Reviews +| # | Type | Step | Verdict | File | +|---|------|------|---------|------| + +## Discoveries +| Discovery | Disposition | Location | +|-----------|-------------|----------| + +## Execution Log +| Timestamp | Action | Outcome | +|-----------|--------|---------| +| 2026-03-15 | Task staged | PROMPT.md and STATUS.md created | + +## Blockers + +*None* + +## Notes + +*Reserved for execution notes* diff --git a/taskplane-tasks/TP-005-repo-scoped-merge-orchestration/PROMPT.md b/taskplane-tasks/TP-005-repo-scoped-merge-orchestration/PROMPT.md new file mode 100644 index 00000000..c8b26c3b --- /dev/null +++ b/taskplane-tasks/TP-005-repo-scoped-merge-orchestration/PROMPT.md @@ -0,0 +1,139 @@ +# Task: TP-005 - Repo-Scoped Merge Orchestration with Explicit Partial Outcomes + +**Created:** 2026-03-15 +**Size:** L + +## Review Level: 3 (Full) + +**Assessment:** Alters merge semantics and user-visible outcome reporting across multiple repos. High orchestration impact. +**Score:** 7/8 — Blast radius: 2, Pattern novelty: 2, Security: 1, Reversibility: 2 + +## Canonical Task Folder +``` +taskplane-tasks/TP-005-repo-scoped-merge-orchestration/ +├── PROMPT.md ← This file (immutable above --- divider) +├── STATUS.md ← Execution state (worker updates this) +├── .reviews/ ← Reviewer output (task-runner creates this) +└── .DONE ← Created when complete +``` + +## Mission + +Implement repo-scoped merge sequencing so completed lanes are merged in their owning repositories while clearly reporting non-atomic cross-repo outcomes. + +## Dependencies + +- **Task:** TP-004 (repo-scoped lane/worktree contracts are required before merge can be partitioned by repo) + +## Context to Read First + +> Only list docs the worker actually needs. Less is better. + +**Tier 2 (area context):** +- `taskplane-tasks/CONTEXT.md` + +**Tier 3 (load only if needed):** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Primary architecture and constraints for polyrepo support +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Concrete ticket decomposition and dependencies +- `.pi/local/docs/taskplane/lane-agent-design.md` — Lane/session supervision and team-scale observability patterns +- `extensions/taskplane/merge.ts` — Current single-repo merge-worktree flow + +## Environment + +- **Workspace:** Taskplane extension and dashboard codebase +- **Services required:** None + +## File Scope + +> The orchestrator uses this to avoid merge conflicts: tasks with overlapping +> file scope run on the same lane (serial), not in parallel. + +- `extensions/taskplane/merge.ts` +- `extensions/taskplane/engine.ts` +- `extensions/taskplane/messages.ts` +- `extensions/tests/*state-persistence*` +- `extensions/tests/*direct-implementation*` + +## Steps + +> **Hydration:** STATUS.md checkboxes must match the granularity below. +> See task-worker agent for full hydration rules. + +### Step 0: Partition merge flow by repo + +- [ ] Group mergeable lanes by repoId before merge execution +- [ ] Run per-repo merge loops with correct repo roots and integration branches + +### Step 1: Update outcome modeling + +- [ ] Extend merge result models to include repo attribution +- [ ] Emit explicit partial-success summaries when repos diverge in outcome + +### Step 2: Harden failure behavior + +- [ ] Ensure pause/abort policies remain deterministic with repo-scoped failures +- [ ] Preserve debug artifacts needed for manual intervention + +### Step 3: Testing & Verification + +> ZERO test failures allowed. + +- [ ] Run unit/regression tests: `cd extensions && npx vitest run` +- [ ] Run targeted tests for changed modules +- [ ] Fix all failures +- [ ] CLI smoke checks pass: `node bin/taskplane.mjs help` + +### Step 4: Documentation & Delivery + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged in STATUS.md +- [ ] `.DONE` created in this folder +- [ ] Task archived (auto — handled by task-runner extension) + +## Documentation Requirements + +**Must Update:** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Document per-repo merge semantics and non-atomic policy + +**Check If Affected:** +- `docs/reference/commands.md` — Update if merge status output format changes for operators + +## Completion Criteria + +- [ ] All steps complete +- [ ] All tests passing +- [ ] Documentation updated +- [ ] `.DONE` created + +## Git Commit Convention + +All commits for this task MUST include the task ID for traceability: + +- **Implementation:** `feat(TP-005): description` +- **Bug fixes:** `fix(TP-005): description` +- **Tests:** `test(TP-005): description` +- **Checkpoints:** `checkpoint: TP-005 description` + +## Do NOT + +- Expand task scope — add tech debt to CONTEXT.md instead +- Skip tests +- Modify framework/standards docs without explicit user approval +- Load docs not listed in "Context to Read First" +- Commit without the task ID prefix in the commit message + +--- + +## Amendments (Added During Execution) + +### Amendment 1: integration_branch removed — baseBranch is now runtime state + +The `integration_branch` config setting has been removed from `OrchestratorConfig`. +The orchestrator now captures the current branch at `/orch` start via `getCurrentBranch()` +(in `git.ts`) and stores it as `baseBranch` on `OrchBatchRuntimeState` and `PersistedBatchState`. + +**Impact on this task:** +- `mergeWave()` in `merge.ts` now takes a `baseBranch: string` parameter (last arg) instead of reading `config.orchestrator.integration_branch` +- The step "Run per-repo merge loops with correct repo roots and integration branches" refers to per-repo target branches from the workspace config — not the removed global setting +- When implementing repo-scoped merge, resolve per-repo base branches from workspace config and pass them to `mergeWave()` diff --git a/taskplane-tasks/TP-005-repo-scoped-merge-orchestration/STATUS.md b/taskplane-tasks/TP-005-repo-scoped-merge-orchestration/STATUS.md new file mode 100644 index 00000000..9a6c6a4a --- /dev/null +++ b/taskplane-tasks/TP-005-repo-scoped-merge-orchestration/STATUS.md @@ -0,0 +1,80 @@ +# TP-005: Repo-Scoped Merge Orchestration with Explicit Partial Outcomes — Status + +**Current Step:** Not Started +​**Status:** 🔵 Ready for Execution +**Last Updated:** 2026-03-15 +**Review Level:** 3 +**Review Counter:** 0 +**Iteration:** 0 +**Size:** L + +> **Hydration:** Checkboxes below must be granular — one per unit of work. +> Steps marked `⚠️ Hydrate` will be expanded by the worker. + +--- + +### Step 0: Partition merge flow by repo +**Status:** ⬜ Not Started + +- [ ] Group mergeable lanes by repoId before merge execution +- [ ] Run per-repo merge loops with correct repo roots and integration branches + +--- + +### Step 1: Update outcome modeling +**Status:** ⬜ Not Started + +- [ ] Extend merge result models to include repo attribution +- [ ] Emit explicit partial-success summaries when repos diverge in outcome + +--- + +### Step 2: Harden failure behavior +**Status:** ⬜ Not Started + +- [ ] Ensure pause/abort policies remain deterministic with repo-scoped failures +- [ ] Preserve debug artifacts needed for manual intervention + +--- + +### Step 3: Testing & Verification +**Status:** ⬜ Not Started + +- [ ] Unit/regression tests passing +- [ ] Targeted tests for changed modules passing +- [ ] All failures fixed +- [ ] CLI smoke checks passing + +--- + +### Step 4: Documentation & Delivery +**Status:** ⬜ Not Started + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged +- [ ] `.DONE` created +- [ ] Archive and push + +--- + +## Reviews +| # | Type | Step | Verdict | File | +|---|------|------|---------|------| + +## Discoveries +| Discovery | Disposition | Location | +|-----------|-------------|----------| + +## Execution Log +| Timestamp | Action | Outcome | +|-----------|--------|---------| +| 2026-03-15 | Task staged | PROMPT.md and STATUS.md created | + +## Blockers + +*None* + +## Notes + +*Reserved for execution notes* diff --git a/taskplane-tasks/TP-006-persisted-state-schema-v2-repo-aware/PROMPT.md b/taskplane-tasks/TP-006-persisted-state-schema-v2-repo-aware/PROMPT.md new file mode 100644 index 00000000..28a61119 --- /dev/null +++ b/taskplane-tasks/TP-006-persisted-state-schema-v2-repo-aware/PROMPT.md @@ -0,0 +1,137 @@ +# Task: TP-006 - Persisted State Schema v2 with Repo-Aware Records + +**Created:** 2026-03-15 +**Size:** M + +## Review Level: 3 (Full) + +**Assessment:** State schema migration impacts resume reliability and backward compatibility. High correctness requirement. +**Score:** 6/8 — Blast radius: 2, Pattern novelty: 1, Security: 1, Reversibility: 2 + +## Canonical Task Folder +``` +taskplane-tasks/TP-006-persisted-state-schema-v2-repo-aware/ +├── PROMPT.md ← This file (immutable above --- divider) +├── STATUS.md ← Execution state (worker updates this) +├── .reviews/ ← Reviewer output (task-runner creates this) +└── .DONE ← Created when complete +``` + +## Mission + +Add repo identity to persisted orchestrator state and implement schema-v1 compatibility handling so resume can operate safely in multi-repo batches. + +## Dependencies + +- **Task:** TP-004 (repo-aware lane/task runtime contracts must exist before persistence can serialize them) + +## Context to Read First + +> Only list docs the worker actually needs. Less is better. + +**Tier 2 (area context):** +- `taskplane-tasks/CONTEXT.md` + +**Tier 3 (load only if needed):** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Primary architecture and constraints for polyrepo support +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Concrete ticket decomposition and dependencies +- `.pi/local/docs/taskplane/lane-agent-design.md` — Lane/session supervision and team-scale observability patterns +- `extensions/taskplane/persistence.ts` — Current schema v1 serialization/validation logic + +## Environment + +- **Workspace:** Taskplane extension and dashboard codebase +- **Services required:** None + +## File Scope + +> The orchestrator uses this to avoid merge conflicts: tasks with overlapping +> file scope run on the same lane (serial), not in parallel. + +- `extensions/taskplane/types.ts` +- `extensions/taskplane/persistence.ts` +- `extensions/tests/orch-state-persistence.test.ts` +- `extensions/tests/fixtures/*` + +## Steps + +> **Hydration:** STATUS.md checkboxes must match the granularity below. +> See task-worker agent for full hydration rules. + +### Step 0: Define schema v2 + +- [ ] Bump batch-state schema version and add repo-aware fields on lane/task records +- [ ] Document field contracts and compatibility expectations + +### Step 1: Implement serialization and validation + +- [ ] Persist repo-aware fields at all state transition checkpoints +- [ ] Validate schema v2 with explicit errors for malformed records + +### Step 2: Handle schema v1 compatibility + +- [ ] Add v1->v2 up-conversion or explicit migration guardrails +- [ ] Add regression tests covering v1 and v2 loading paths + +### Step 3: Testing & Verification + +> ZERO test failures allowed. + +- [ ] Run unit/regression tests: `cd extensions && npx vitest run` +- [ ] Run targeted tests for changed modules +- [ ] Fix all failures +- [ ] CLI smoke checks pass: `node bin/taskplane.mjs help` + +### Step 4: Documentation & Delivery + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged in STATUS.md +- [ ] `.DONE` created in this folder +- [ ] Task archived (auto — handled by task-runner extension) + +## Documentation Requirements + +**Must Update:** +- `.pi/local/docs/taskplane/polyrepo-implementation-plan.md` — Capture final persistence schema and migration strategy + +**Check If Affected:** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Adjust acceptance criteria if migration policy differs + +## Completion Criteria + +- [ ] All steps complete +- [ ] All tests passing +- [ ] Documentation updated +- [ ] `.DONE` created + +## Git Commit Convention + +All commits for this task MUST include the task ID for traceability: + +- **Implementation:** `feat(TP-006): description` +- **Bug fixes:** `fix(TP-006): description` +- **Tests:** `test(TP-006): description` +- **Checkpoints:** `checkpoint: TP-006 description` + +## Do NOT + +- Expand task scope — add tech debt to CONTEXT.md instead +- Skip tests +- Modify framework/standards docs without explicit user approval +- Load docs not listed in "Context to Read First" +- Commit without the task ID prefix in the commit message + +--- + +## Amendments (Added During Execution) + +### Amendment 1: baseBranch already added to persisted state schema + +The `baseBranch` field has already been added to both `OrchBatchRuntimeState` and +`PersistedBatchState` in `types.ts`. It is serialized in `persistence.ts` and validated +with backward compatibility (defaults to `""` if missing from older state files). + +**Impact on this task:** +- When bumping to schema v2, `baseBranch` is already present — account for it in the v1→v2 migration path +- The old `integration_branch` config field no longer exists — do not reference it in schema design diff --git a/taskplane-tasks/TP-006-persisted-state-schema-v2-repo-aware/STATUS.md b/taskplane-tasks/TP-006-persisted-state-schema-v2-repo-aware/STATUS.md new file mode 100644 index 00000000..8c8cf28f --- /dev/null +++ b/taskplane-tasks/TP-006-persisted-state-schema-v2-repo-aware/STATUS.md @@ -0,0 +1,80 @@ +# TP-006: Persisted State Schema v2 with Repo-Aware Records — Status + +**Current Step:** Not Started +​**Status:** 🔵 Ready for Execution +**Last Updated:** 2026-03-15 +**Review Level:** 3 +**Review Counter:** 0 +**Iteration:** 0 +**Size:** M + +> **Hydration:** Checkboxes below must be granular — one per unit of work. +> Steps marked `⚠️ Hydrate` will be expanded by the worker. + +--- + +### Step 0: Define schema v2 +**Status:** ⬜ Not Started + +- [ ] Bump batch-state schema version and add repo-aware fields on lane/task records +- [ ] Document field contracts and compatibility expectations + +--- + +### Step 1: Implement serialization and validation +**Status:** ⬜ Not Started + +- [ ] Persist repo-aware fields at all state transition checkpoints +- [ ] Validate schema v2 with explicit errors for malformed records + +--- + +### Step 2: Handle schema v1 compatibility +**Status:** ⬜ Not Started + +- [ ] Add v1->v2 up-conversion or explicit migration guardrails +- [ ] Add regression tests covering v1 and v2 loading paths + +--- + +### Step 3: Testing & Verification +**Status:** ⬜ Not Started + +- [ ] Unit/regression tests passing +- [ ] Targeted tests for changed modules passing +- [ ] All failures fixed +- [ ] CLI smoke checks passing + +--- + +### Step 4: Documentation & Delivery +**Status:** ⬜ Not Started + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged +- [ ] `.DONE` created +- [ ] Archive and push + +--- + +## Reviews +| # | Type | Step | Verdict | File | +|---|------|------|---------|------| + +## Discoveries +| Discovery | Disposition | Location | +|-----------|-------------|----------| + +## Execution Log +| Timestamp | Action | Outcome | +|-----------|--------|---------| +| 2026-03-15 | Task staged | PROMPT.md and STATUS.md created | + +## Blockers + +*None* + +## Notes + +*Reserved for execution notes* diff --git a/taskplane-tasks/TP-007-resume-reconciliation-across-repos/PROMPT.md b/taskplane-tasks/TP-007-resume-reconciliation-across-repos/PROMPT.md new file mode 100644 index 00000000..9551a277 --- /dev/null +++ b/taskplane-tasks/TP-007-resume-reconciliation-across-repos/PROMPT.md @@ -0,0 +1,138 @@ +# Task: TP-007 - Resume Reconciliation and Continuation Across Repos + +**Created:** 2026-03-15 +**Size:** L + +## Review Level: 3 (Full) + +**Assessment:** Resume logic is failure-path critical and now must reconcile multi-repo lane/session/worktree state. +**Score:** 7/8 — Blast radius: 2, Pattern novelty: 2, Security: 1, Reversibility: 2 + +## Canonical Task Folder +``` +taskplane-tasks/TP-007-resume-reconciliation-across-repos/ +├── PROMPT.md ← This file (immutable above --- divider) +├── STATUS.md ← Execution state (worker updates this) +├── .reviews/ ← Reviewer output (task-runner creates this) +└── .DONE ← Created when complete +``` + +## Mission + +Extend /orch-resume to reconstruct and continue polyrepo batches using repo-aware persisted state, lane ownership, and merge progression. + +## Dependencies + +- **Task:** TP-005 (resume must align with final repo-scoped merge semantics) +- **Task:** TP-006 (resume requires schema-v2 repo-aware persisted records) + +## Context to Read First + +> Only list docs the worker actually needs. Less is better. + +**Tier 2 (area context):** +- `taskplane-tasks/CONTEXT.md` + +**Tier 3 (load only if needed):** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Primary architecture and constraints for polyrepo support +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Concrete ticket decomposition and dependencies +- `.pi/local/docs/taskplane/lane-agent-design.md` — Lane/session supervision and team-scale observability patterns +- `extensions/taskplane/resume.ts` — Current single-repo reconciliation and continuation flow + +## Environment + +- **Workspace:** Taskplane extension and dashboard codebase +- **Services required:** None + +## File Scope + +> The orchestrator uses this to avoid merge conflicts: tasks with overlapping +> file scope run on the same lane (serial), not in parallel. + +- `extensions/taskplane/resume.ts` +- `extensions/taskplane/persistence.ts` +- `extensions/tests/orch-state-persistence.test.ts` +- `extensions/tests/orch-direct-implementation.test.ts` + +## Steps + +> **Hydration:** STATUS.md checkboxes must match the granularity below. +> See task-worker agent for full hydration rules. + +### Step 0: Implement repo-aware reconciliation + +- [ ] Match persisted tasks/lanes to live sessions using repo-aware identifiers +- [ ] Resolve alive/dead/.DONE states correctly across repo-specific worktrees + +### Step 1: Compute repo-aware resume point + +- [ ] Update wave/task continuation logic for mixed repo outcomes +- [ ] Ensure blocked/skipped semantics remain deterministic + +### Step 2: Execute resumed waves safely + +- [ ] Run resumed allocation/execution/merge using repo-scoped context +- [ ] Persist reconciliation and continuation checkpoints with repo attribution + +### Step 3: Testing & Verification + +> ZERO test failures allowed. + +- [ ] Run unit/regression tests: `cd extensions && npx vitest run` +- [ ] Run targeted tests for changed modules +- [ ] Fix all failures +- [ ] CLI smoke checks pass: `node bin/taskplane.mjs help` + +### Step 4: Documentation & Delivery + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged in STATUS.md +- [ ] `.DONE` created in this folder +- [ ] Task archived (auto — handled by task-runner extension) + +## Documentation Requirements + +**Must Update:** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Document resume guarantees and limitations in workspace mode + +**Check If Affected:** +- `docs/explanation/persistence-and-resume.md` — Update public docs after behavior is finalized and stable + +## Completion Criteria + +- [ ] All steps complete +- [ ] All tests passing +- [ ] Documentation updated +- [ ] `.DONE` created + +## Git Commit Convention + +All commits for this task MUST include the task ID for traceability: + +- **Implementation:** `feat(TP-007): description` +- **Bug fixes:** `fix(TP-007): description` +- **Tests:** `test(TP-007): description` +- **Checkpoints:** `checkpoint: TP-007 description` + +## Do NOT + +- Expand task scope — add tech debt to CONTEXT.md instead +- Skip tests +- Modify framework/standards docs without explicit user approval +- Load docs not listed in "Context to Read First" +- Commit without the task ID prefix in the commit message + +--- + +## Amendments (Added During Execution) + +### Amendment 1: integration_branch removed — baseBranch is now runtime state + +The `integration_branch` config setting has been removed. `resume.ts` now reads +`baseBranch` from `persistedState.baseBranch` (with `""` fallback for older state files) +and stores it on `batchState.baseBranch`. + +**Impact on this task:** +- All resume code already uses `batchState.baseBranch` instead of `orchConfig.orchestrator.integration_branch` +- When extending for polyrepo, per-repo base branches should be resolved from workspace config, not from the removed global setting diff --git a/taskplane-tasks/TP-007-resume-reconciliation-across-repos/STATUS.md b/taskplane-tasks/TP-007-resume-reconciliation-across-repos/STATUS.md new file mode 100644 index 00000000..3e524630 --- /dev/null +++ b/taskplane-tasks/TP-007-resume-reconciliation-across-repos/STATUS.md @@ -0,0 +1,80 @@ +# TP-007: Resume Reconciliation and Continuation Across Repos — Status + +**Current Step:** Not Started +​**Status:** 🔵 Ready for Execution +**Last Updated:** 2026-03-15 +**Review Level:** 3 +**Review Counter:** 0 +**Iteration:** 0 +**Size:** L + +> **Hydration:** Checkboxes below must be granular — one per unit of work. +> Steps marked `⚠️ Hydrate` will be expanded by the worker. + +--- + +### Step 0: Implement repo-aware reconciliation +**Status:** ⬜ Not Started + +- [ ] Match persisted tasks/lanes to live sessions using repo-aware identifiers +- [ ] Resolve alive/dead/.DONE states correctly across repo-specific worktrees + +--- + +### Step 1: Compute repo-aware resume point +**Status:** ⬜ Not Started + +- [ ] Update wave/task continuation logic for mixed repo outcomes +- [ ] Ensure blocked/skipped semantics remain deterministic + +--- + +### Step 2: Execute resumed waves safely +**Status:** ⬜ Not Started + +- [ ] Run resumed allocation/execution/merge using repo-scoped context +- [ ] Persist reconciliation and continuation checkpoints with repo attribution + +--- + +### Step 3: Testing & Verification +**Status:** ⬜ Not Started + +- [ ] Unit/regression tests passing +- [ ] Targeted tests for changed modules passing +- [ ] All failures fixed +- [ ] CLI smoke checks passing + +--- + +### Step 4: Documentation & Delivery +**Status:** ⬜ Not Started + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged +- [ ] `.DONE` created +- [ ] Archive and push + +--- + +## Reviews +| # | Type | Step | Verdict | File | +|---|------|------|---------|------| + +## Discoveries +| Discovery | Disposition | Location | +|-----------|-------------|----------| + +## Execution Log +| Timestamp | Action | Outcome | +|-----------|--------|---------| +| 2026-03-15 | Task staged | PROMPT.md and STATUS.md created | + +## Blockers + +*None* + +## Notes + +*Reserved for execution notes* diff --git a/taskplane-tasks/TP-008-workspace-aware-doctor-diagnostics/PROMPT.md b/taskplane-tasks/TP-008-workspace-aware-doctor-diagnostics/PROMPT.md new file mode 100644 index 00000000..b4d6f455 --- /dev/null +++ b/taskplane-tasks/TP-008-workspace-aware-doctor-diagnostics/PROMPT.md @@ -0,0 +1,128 @@ +# Task: TP-008 - Workspace-Aware Doctor Diagnostics and Validation + +**Created:** 2026-03-15 +**Size:** M + +## Review Level: 2 (Plan and Code) + +**Assessment:** CLI diagnostics change is medium scope but important for operator confidence and onboarding across large teams. +**Score:** 4/8 — Blast radius: 1, Pattern novelty: 1, Security: 0, Reversibility: 2 + +## Canonical Task Folder +``` +taskplane-tasks/TP-008-workspace-aware-doctor-diagnostics/ +├── PROMPT.md ← This file (immutable above --- divider) +├── STATUS.md ← Execution state (worker updates this) +├── .reviews/ ← Reviewer output (task-runner creates this) +└── .DONE ← Created when complete +``` + +## Mission + +Upgrade taskplane doctor to validate workspace-mode topology (non-git root, mapped repos, routing completeness) with actionable guidance. + +## Dependencies + +- **Task:** TP-001 (workspace config/schema definitions are required before doctor can validate them) + +## Context to Read First + +> Only list docs the worker actually needs. Less is better. + +**Tier 2 (area context):** +- `taskplane-tasks/CONTEXT.md` + +**Tier 3 (load only if needed):** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Primary architecture and constraints for polyrepo support +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Concrete ticket decomposition and dependencies +- `.pi/local/docs/taskplane/lane-agent-design.md` — Lane/session supervision and team-scale observability patterns +- `bin/taskplane.mjs` — Current doctor checks and output model + +## Environment + +- **Workspace:** Taskplane extension and dashboard codebase +- **Services required:** None + +## File Scope + +> The orchestrator uses this to avoid merge conflicts: tasks with overlapping +> file scope run on the same lane (serial), not in parallel. + +- `bin/taskplane.mjs` +- `docs/tutorials/install.md` +- `docs/reference/commands.md` + +## Steps + +> **Hydration:** STATUS.md checkboxes must match the granularity below. +> See task-worker agent for full hydration rules. + +### Step 0: Detect workspace mode in doctor + +- [ ] Load workspace config when present and branch diagnostics accordingly +- [ ] Avoid false negatives when workspace root is intentionally non-git + +### Step 1: Validate repo and routing topology + +- [ ] Check each configured repo path exists and is a git repo +- [ ] Validate area/default routing targets reference known repos + +### Step 2: Improve operator guidance + +- [ ] Emit actionable remediation hints for missing repos/mappings +- [ ] Keep existing repo-mode doctor output unchanged + +### Step 3: Testing & Verification + +> ZERO test failures allowed. + +- [ ] Run unit/regression tests: `cd extensions && npx vitest run` +- [ ] Run targeted tests for changed modules +- [ ] Fix all failures +- [ ] CLI smoke checks pass: `node bin/taskplane.mjs help` + +### Step 4: Documentation & Delivery + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged in STATUS.md +- [ ] `.DONE` created in this folder +- [ ] Task archived (auto — handled by task-runner extension) + +## Documentation Requirements + +**Must Update:** +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Mark diagnostics acceptance criteria and any sequencing updates + +**Check If Affected:** +- `docs/reference/commands.md` — Document doctor behavior differences in workspace mode + +## Completion Criteria + +- [ ] All steps complete +- [ ] All tests passing +- [ ] Documentation updated +- [ ] `.DONE` created + +## Git Commit Convention + +All commits for this task MUST include the task ID for traceability: + +- **Implementation:** `feat(TP-008): description` +- **Bug fixes:** `fix(TP-008): description` +- **Tests:** `test(TP-008): description` +- **Checkpoints:** `checkpoint: TP-008 description` + +## Do NOT + +- Expand task scope — add tech debt to CONTEXT.md instead +- Skip tests +- Modify framework/standards docs without explicit user approval +- Load docs not listed in "Context to Read First" +- Commit without the task ID prefix in the commit message + +--- + +## Amendments (Added During Execution) + + diff --git a/taskplane-tasks/TP-008-workspace-aware-doctor-diagnostics/STATUS.md b/taskplane-tasks/TP-008-workspace-aware-doctor-diagnostics/STATUS.md new file mode 100644 index 00000000..d9fcc61e --- /dev/null +++ b/taskplane-tasks/TP-008-workspace-aware-doctor-diagnostics/STATUS.md @@ -0,0 +1,80 @@ +# TP-008: Workspace-Aware Doctor Diagnostics and Validation — Status + +**Current Step:** Not Started +​**Status:** 🔵 Ready for Execution +**Last Updated:** 2026-03-15 +**Review Level:** 2 +**Review Counter:** 0 +**Iteration:** 0 +**Size:** M + +> **Hydration:** Checkboxes below must be granular — one per unit of work. +> Steps marked `⚠️ Hydrate` will be expanded by the worker. + +--- + +### Step 0: Detect workspace mode in doctor +**Status:** ⬜ Not Started + +- [ ] Load workspace config when present and branch diagnostics accordingly +- [ ] Avoid false negatives when workspace root is intentionally non-git + +--- + +### Step 1: Validate repo and routing topology +**Status:** ⬜ Not Started + +- [ ] Check each configured repo path exists and is a git repo +- [ ] Validate area/default routing targets reference known repos + +--- + +### Step 2: Improve operator guidance +**Status:** ⬜ Not Started + +- [ ] Emit actionable remediation hints for missing repos/mappings +- [ ] Keep existing repo-mode doctor output unchanged + +--- + +### Step 3: Testing & Verification +**Status:** ⬜ Not Started + +- [ ] Unit/regression tests passing +- [ ] Targeted tests for changed modules passing +- [ ] All failures fixed +- [ ] CLI smoke checks passing + +--- + +### Step 4: Documentation & Delivery +**Status:** ⬜ Not Started + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged +- [ ] `.DONE` created +- [ ] Archive and push + +--- + +## Reviews +| # | Type | Step | Verdict | File | +|---|------|------|---------|------| + +## Discoveries +| Discovery | Disposition | Location | +|-----------|-------------|----------| + +## Execution Log +| Timestamp | Action | Outcome | +|-----------|--------|---------| +| 2026-03-15 | Task staged | PROMPT.md and STATUS.md created | + +## Blockers + +*None* + +## Notes + +*Reserved for execution notes* diff --git a/taskplane-tasks/TP-009-dashboard-repo-aware-observability/PROMPT.md b/taskplane-tasks/TP-009-dashboard-repo-aware-observability/PROMPT.md new file mode 100644 index 00000000..469e602e --- /dev/null +++ b/taskplane-tasks/TP-009-dashboard-repo-aware-observability/PROMPT.md @@ -0,0 +1,129 @@ +# Task: TP-009 - Dashboard Repo-Aware Lanes, Tasks, and Merge Panels + +**Created:** 2026-03-15 +**Size:** M + +## Review Level: 2 (Plan and Code) + +**Assessment:** Improves observability contracts across server/frontend with moderate blast radius and low security risk. +**Score:** 5/8 — Blast radius: 1, Pattern novelty: 2, Security: 0, Reversibility: 2 + +## Canonical Task Folder +``` +taskplane-tasks/TP-009-dashboard-repo-aware-observability/ +├── PROMPT.md ← This file (immutable above --- divider) +├── STATUS.md ← Execution state (worker updates this) +├── .reviews/ ← Reviewer output (task-runner creates this) +└── .DONE ← Created when complete +``` + +## Mission + +Make orchestrator observability repo-aware so operators in large teams can quickly isolate failures and progress by repository. + +## Dependencies + +- **Task:** TP-006 (repo-aware state fields are required for dashboard payloads) + +## Context to Read First + +> Only list docs the worker actually needs. Less is better. + +**Tier 2 (area context):** +- `taskplane-tasks/CONTEXT.md` + +**Tier 3 (load only if needed):** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Primary architecture and constraints for polyrepo support +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Concrete ticket decomposition and dependencies +- `.pi/local/docs/taskplane/lane-agent-design.md` — Lane/session supervision and team-scale observability patterns +- `.pi/local/docs/taskplane/lane-agent-design.md` — Use lane observability hierarchy concepts for UI grouping decisions + +## Environment + +- **Workspace:** Taskplane extension and dashboard codebase +- **Services required:** None + +## File Scope + +> The orchestrator uses this to avoid merge conflicts: tasks with overlapping +> file scope run on the same lane (serial), not in parallel. + +- `dashboard/server.cjs` +- `dashboard/public/app.js` +- `dashboard/public/index.html` +- `extensions/taskplane/formatting.ts` + +## Steps + +> **Hydration:** STATUS.md checkboxes must match the granularity below. +> See task-worker agent for full hydration rules. + +### Step 0: Extend dashboard data model + +- [ ] Include repo attribution in lane/task/merge payloads served by dashboard backend +- [ ] Maintain backward compatibility for repo-mode payload consumers + +### Step 1: Implement repo-aware UI + +- [ ] Add repo labels and filters in dashboard frontend +- [ ] Group merge outcomes by repo for clear partial-result visibility + +### Step 2: Preserve existing UX guarantees + +- [ ] Ensure monorepo views remain clear and unchanged by default +- [ ] Verify no regressions in conversation/sidecar panels + +### Step 3: Testing & Verification + +> ZERO test failures allowed. + +- [ ] Run unit/regression tests: `cd extensions && npx vitest run` +- [ ] Run targeted tests for changed modules +- [ ] Fix all failures +- [ ] CLI smoke checks pass: `node bin/taskplane.mjs help` + +### Step 4: Documentation & Delivery + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged in STATUS.md +- [ ] `.DONE` created in this folder +- [ ] Task archived (auto — handled by task-runner extension) + +## Documentation Requirements + +**Must Update:** +- `.pi/local/docs/taskplane/polyrepo-implementation-plan.md` — Document final dashboard repo-grouping behavior + +**Check If Affected:** +- `docs/tutorials/use-the-dashboard.md` — Update once repo-aware UI ships publicly + +## Completion Criteria + +- [ ] All steps complete +- [ ] All tests passing +- [ ] Documentation updated +- [ ] `.DONE` created + +## Git Commit Convention + +All commits for this task MUST include the task ID for traceability: + +- **Implementation:** `feat(TP-009): description` +- **Bug fixes:** `fix(TP-009): description` +- **Tests:** `test(TP-009): description` +- **Checkpoints:** `checkpoint: TP-009 description` + +## Do NOT + +- Expand task scope — add tech debt to CONTEXT.md instead +- Skip tests +- Modify framework/standards docs without explicit user approval +- Load docs not listed in "Context to Read First" +- Commit without the task ID prefix in the commit message + +--- + +## Amendments (Added During Execution) + + diff --git a/taskplane-tasks/TP-009-dashboard-repo-aware-observability/STATUS.md b/taskplane-tasks/TP-009-dashboard-repo-aware-observability/STATUS.md new file mode 100644 index 00000000..916a7621 --- /dev/null +++ b/taskplane-tasks/TP-009-dashboard-repo-aware-observability/STATUS.md @@ -0,0 +1,80 @@ +# TP-009: Dashboard Repo-Aware Lanes, Tasks, and Merge Panels — Status + +**Current Step:** Not Started +​**Status:** 🔵 Ready for Execution +**Last Updated:** 2026-03-15 +**Review Level:** 2 +**Review Counter:** 0 +**Iteration:** 0 +**Size:** M + +> **Hydration:** Checkboxes below must be granular — one per unit of work. +> Steps marked `⚠️ Hydrate` will be expanded by the worker. + +--- + +### Step 0: Extend dashboard data model +**Status:** ⬜ Not Started + +- [ ] Include repo attribution in lane/task/merge payloads served by dashboard backend +- [ ] Maintain backward compatibility for repo-mode payload consumers + +--- + +### Step 1: Implement repo-aware UI +**Status:** ⬜ Not Started + +- [ ] Add repo labels and filters in dashboard frontend +- [ ] Group merge outcomes by repo for clear partial-result visibility + +--- + +### Step 2: Preserve existing UX guarantees +**Status:** ⬜ Not Started + +- [ ] Ensure monorepo views remain clear and unchanged by default +- [ ] Verify no regressions in conversation/sidecar panels + +--- + +### Step 3: Testing & Verification +**Status:** ⬜ Not Started + +- [ ] Unit/regression tests passing +- [ ] Targeted tests for changed modules passing +- [ ] All failures fixed +- [ ] CLI smoke checks passing + +--- + +### Step 4: Documentation & Delivery +**Status:** ⬜ Not Started + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged +- [ ] `.DONE` created +- [ ] Archive and push + +--- + +## Reviews +| # | Type | Step | Verdict | File | +|---|------|------|---------|------| + +## Discoveries +| Discovery | Disposition | Location | +|-----------|-------------|----------| + +## Execution Log +| Timestamp | Action | Outcome | +|-----------|--------|---------| +| 2026-03-15 | Task staged | PROMPT.md and STATUS.md created | + +## Blockers + +*None* + +## Notes + +*Reserved for execution notes* diff --git a/taskplane-tasks/TP-010-team-scale-session-and-worktree-naming/PROMPT.md b/taskplane-tasks/TP-010-team-scale-session-and-worktree-naming/PROMPT.md new file mode 100644 index 00000000..253ca9c8 --- /dev/null +++ b/taskplane-tasks/TP-010-team-scale-session-and-worktree-naming/PROMPT.md @@ -0,0 +1,139 @@ +# Task: TP-010 - Team-Scale Session and Worktree Naming Hardening + +**Created:** 2026-03-15 +**Size:** M + +## Review Level: 3 (Full) + +**Assessment:** Naming contracts affect every runtime artifact and are critical for avoiding collisions in large-team parallel usage. +**Score:** 6/8 — Blast radius: 2, Pattern novelty: 1, Security: 1, Reversibility: 2 + +## Canonical Task Folder +``` +taskplane-tasks/TP-010-team-scale-session-and-worktree-naming/ +├── PROMPT.md ← This file (immutable above --- divider) +├── STATUS.md ← Execution state (worker updates this) +├── .reviews/ ← Reviewer output (task-runner creates this) +└── .DONE ← Created when complete +``` + +## Mission + +Implement collision-resistant lane/session/worktree naming that remains deterministic and traceable across repos, operators, and concurrent batches. + +## Dependencies + +- **Task:** TP-004 (repo-scoped lane model must exist before naming contracts can be hardened) + +## Context to Read First + +> Only list docs the worker actually needs. Less is better. + +**Tier 2 (area context):** +- `taskplane-tasks/CONTEXT.md` + +**Tier 3 (load only if needed):** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Primary architecture and constraints for polyrepo support +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Concrete ticket decomposition and dependencies +- `.pi/local/docs/taskplane/lane-agent-design.md` — Lane/session supervision and team-scale observability patterns +- `extensions/taskplane/execution.ts` — Current session naming and sidecar naming behavior + +## Environment + +- **Workspace:** Taskplane extension and dashboard codebase +- **Services required:** None + +## File Scope + +> The orchestrator uses this to avoid merge conflicts: tasks with overlapping +> file scope run on the same lane (serial), not in parallel. + +- `extensions/taskplane/waves.ts` +- `extensions/taskplane/execution.ts` +- `extensions/taskplane/merge.ts` +- `extensions/taskplane/sessions.ts` +- `extensions/tests/*orchestration*` + +## Steps + +> **Hydration:** STATUS.md checkboxes must match the granularity below. +> See task-worker agent for full hydration rules. + +### Step 0: Define naming contract + +- [ ] Design deterministic naming including repo slug + operator identifier + batch components +- [ ] Document fallback rules when operator metadata is unavailable + +### Step 1: Apply naming contract consistently + +- [ ] Update lane TMUX sessions, worker/reviewer prefixes, merge sessions, and worktree prefixes +- [ ] Ensure log/sidecar file naming aligns with new identifiers + +### Step 2: Validate collision resistance + +- [ ] Add tests/smoke scenarios for concurrent runs in shared environments +- [ ] Confirm naming remains human-readable for debugging and lane-agent-style supervision views + +### Step 3: Testing & Verification + +> ZERO test failures allowed. + +- [ ] Run unit/regression tests: `cd extensions && npx vitest run` +- [ ] Run targeted tests for changed modules +- [ ] Fix all failures +- [ ] CLI smoke checks pass: `node bin/taskplane.mjs help` + +### Step 4: Documentation & Delivery + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged in STATUS.md +- [ ] `.DONE` created in this folder +- [ ] Task archived (auto — handled by task-runner extension) + +## Documentation Requirements + +**Must Update:** +- `.pi/local/docs/taskplane/lane-agent-design.md` — Align naming assumptions with lane-supervision observability patterns +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Document finalized naming contract + +**Check If Affected:** +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Adjust hardening backlog if implementation scope shifts + +## Completion Criteria + +- [ ] All steps complete +- [ ] All tests passing +- [ ] Documentation updated +- [ ] `.DONE` created + +## Git Commit Convention + +All commits for this task MUST include the task ID for traceability: + +- **Implementation:** `feat(TP-010): description` +- **Bug fixes:** `fix(TP-010): description` +- **Tests:** `test(TP-010): description` +- **Checkpoints:** `checkpoint: TP-010 description` + +## Do NOT + +- Expand task scope — add tech debt to CONTEXT.md instead +- Skip tests +- Modify framework/standards docs without explicit user approval +- Load docs not listed in "Context to Read First" +- Commit without the task ID prefix in the commit message + +--- + +## Amendments (Added During Execution) + +### Amendment 1: integration_branch removed — baseBranch is now runtime state + +The `integration_branch` config setting has been removed from `OrchestratorConfig`. +The base branch is now captured at batch start and passed as a parameter through the +execution pipeline (`executeWave`, `allocateLanes`, `mergeWave`, etc.). + +**Impact on this task:** +- Functions in `waves.ts`, `execution.ts`, and `merge.ts` now take `baseBranch` as an explicit parameter +- When hardening naming contracts, use `batchState.baseBranch` for any naming components that reference the target branch diff --git a/taskplane-tasks/TP-010-team-scale-session-and-worktree-naming/STATUS.md b/taskplane-tasks/TP-010-team-scale-session-and-worktree-naming/STATUS.md new file mode 100644 index 00000000..5bb62e85 --- /dev/null +++ b/taskplane-tasks/TP-010-team-scale-session-and-worktree-naming/STATUS.md @@ -0,0 +1,80 @@ +# TP-010: Team-Scale Session and Worktree Naming Hardening — Status + +**Current Step:** Not Started +​**Status:** 🔵 Ready for Execution +**Last Updated:** 2026-03-15 +**Review Level:** 3 +**Review Counter:** 0 +**Iteration:** 0 +**Size:** M + +> **Hydration:** Checkboxes below must be granular — one per unit of work. +> Steps marked `⚠️ Hydrate` will be expanded by the worker. + +--- + +### Step 0: Define naming contract +**Status:** ⬜ Not Started + +- [ ] Design deterministic naming including repo slug + operator identifier + batch components +- [ ] Document fallback rules when operator metadata is unavailable + +--- + +### Step 1: Apply naming contract consistently +**Status:** ⬜ Not Started + +- [ ] Update lane TMUX sessions, worker/reviewer prefixes, merge sessions, and worktree prefixes +- [ ] Ensure log/sidecar file naming aligns with new identifiers + +--- + +### Step 2: Validate collision resistance +**Status:** ⬜ Not Started + +- [ ] Add tests/smoke scenarios for concurrent runs in shared environments +- [ ] Confirm naming remains human-readable for debugging and lane-agent-style supervision views + +--- + +### Step 3: Testing & Verification +**Status:** ⬜ Not Started + +- [ ] Unit/regression tests passing +- [ ] Targeted tests for changed modules passing +- [ ] All failures fixed +- [ ] CLI smoke checks passing + +--- + +### Step 4: Documentation & Delivery +**Status:** ⬜ Not Started + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged +- [ ] `.DONE` created +- [ ] Archive and push + +--- + +## Reviews +| # | Type | Step | Verdict | File | +|---|------|------|---------|------| + +## Discoveries +| Discovery | Disposition | Location | +|-----------|-------------|----------| + +## Execution Log +| Timestamp | Action | Outcome | +|-----------|--------|---------| +| 2026-03-15 | Task staged | PROMPT.md and STATUS.md created | + +## Blockers + +*None* + +## Notes + +*Reserved for execution notes* diff --git a/taskplane-tasks/TP-011-routing-ownership-enforcement/PROMPT.md b/taskplane-tasks/TP-011-routing-ownership-enforcement/PROMPT.md new file mode 100644 index 00000000..c8d2d62f --- /dev/null +++ b/taskplane-tasks/TP-011-routing-ownership-enforcement/PROMPT.md @@ -0,0 +1,128 @@ +# Task: TP-011 - Routing Ownership Enforcement and Strict Workspace Policy + +**Created:** 2026-03-15 +**Size:** M + +## Review Level: 2 (Plan and Code) + +**Assessment:** Adds governance controls for large teams with moderate parser/config impacts and straightforward reversibility. +**Score:** 4/8 — Blast radius: 1, Pattern novelty: 1, Security: 0, Reversibility: 2 + +## Canonical Task Folder +``` +taskplane-tasks/TP-011-routing-ownership-enforcement/ +├── PROMPT.md ← This file (immutable above --- divider) +├── STATUS.md ← Execution state (worker updates this) +├── .reviews/ ← Reviewer output (task-runner creates this) +└── .DONE ← Created when complete +``` + +## Mission + +Add policy controls to enforce task ownership clarity in workspace mode, reducing accidental misrouting in large multi-team environments. + +## Dependencies + +- **Task:** TP-002 (base routing and execution-target parsing must be complete first) + +## Context to Read First + +> Only list docs the worker actually needs. Less is better. + +**Tier 2 (area context):** +- `taskplane-tasks/CONTEXT.md` + +**Tier 3 (load only if needed):** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Primary architecture and constraints for polyrepo support +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Concrete ticket decomposition and dependencies +- `.pi/local/docs/taskplane/lane-agent-design.md` — Lane/session supervision and team-scale observability patterns +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Ticket TP-POLY-012 ownership enforcement requirements + +## Environment + +- **Workspace:** Taskplane extension and dashboard codebase +- **Services required:** None + +## File Scope + +> The orchestrator uses this to avoid merge conflicts: tasks with overlapping +> file scope run on the same lane (serial), not in parallel. + +- `extensions/taskplane/discovery.ts` +- `extensions/taskplane/messages.ts` +- `extensions/tests/*routing*` + +## Steps + +> **Hydration:** STATUS.md checkboxes must match the granularity below. +> See task-worker agent for full hydration rules. + +### Step 0: Add strict-routing policy controls + +- [ ] Introduce config option(s) for requiring explicit execution target metadata +- [ ] Define warning/error behavior for missing ownership declarations + +### Step 1: Enforce policy during discovery + +- [ ] Apply strict mode validation in workspace-mode discovery pipeline +- [ ] Emit clear errors with remediation instructions for contributors + +### Step 2: Cover governance scenarios + +- [ ] Add tests for permissive vs strict routing behavior +- [ ] Ensure repo-mode defaults remain unaffected + +### Step 3: Testing & Verification + +> ZERO test failures allowed. + +- [ ] Run unit/regression tests: `cd extensions && npx vitest run` +- [ ] Run targeted tests for changed modules +- [ ] Fix all failures +- [ ] CLI smoke checks pass: `node bin/taskplane.mjs help` + +### Step 4: Documentation & Delivery + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged in STATUS.md +- [ ] `.DONE` created in this folder +- [ ] Task archived (auto — handled by task-runner extension) + +## Documentation Requirements + +**Must Update:** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Document strict-mode behavior and recommended team policies + +**Check If Affected:** +- `docs/reference/configuration/task-orchestrator.yaml.md` — Update if policy controls become public config + +## Completion Criteria + +- [ ] All steps complete +- [ ] All tests passing +- [ ] Documentation updated +- [ ] `.DONE` created + +## Git Commit Convention + +All commits for this task MUST include the task ID for traceability: + +- **Implementation:** `feat(TP-011): description` +- **Bug fixes:** `fix(TP-011): description` +- **Tests:** `test(TP-011): description` +- **Checkpoints:** `checkpoint: TP-011 description` + +## Do NOT + +- Expand task scope — add tech debt to CONTEXT.md instead +- Skip tests +- Modify framework/standards docs without explicit user approval +- Load docs not listed in "Context to Read First" +- Commit without the task ID prefix in the commit message + +--- + +## Amendments (Added During Execution) + + diff --git a/taskplane-tasks/TP-011-routing-ownership-enforcement/STATUS.md b/taskplane-tasks/TP-011-routing-ownership-enforcement/STATUS.md new file mode 100644 index 00000000..03c6aa1d --- /dev/null +++ b/taskplane-tasks/TP-011-routing-ownership-enforcement/STATUS.md @@ -0,0 +1,80 @@ +# TP-011: Routing Ownership Enforcement and Strict Workspace Policy — Status + +**Current Step:** Not Started +​**Status:** 🔵 Ready for Execution +**Last Updated:** 2026-03-15 +**Review Level:** 2 +**Review Counter:** 0 +**Iteration:** 0 +**Size:** M + +> **Hydration:** Checkboxes below must be granular — one per unit of work. +> Steps marked `⚠️ Hydrate` will be expanded by the worker. + +--- + +### Step 0: Add strict-routing policy controls +**Status:** ⬜ Not Started + +- [ ] Introduce config option(s) for requiring explicit execution target metadata +- [ ] Define warning/error behavior for missing ownership declarations + +--- + +### Step 1: Enforce policy during discovery +**Status:** ⬜ Not Started + +- [ ] Apply strict mode validation in workspace-mode discovery pipeline +- [ ] Emit clear errors with remediation instructions for contributors + +--- + +### Step 2: Cover governance scenarios +**Status:** ⬜ Not Started + +- [ ] Add tests for permissive vs strict routing behavior +- [ ] Ensure repo-mode defaults remain unaffected + +--- + +### Step 3: Testing & Verification +**Status:** ⬜ Not Started + +- [ ] Unit/regression tests passing +- [ ] Targeted tests for changed modules passing +- [ ] All failures fixed +- [ ] CLI smoke checks passing + +--- + +### Step 4: Documentation & Delivery +**Status:** ⬜ Not Started + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged +- [ ] `.DONE` created +- [ ] Archive and push + +--- + +## Reviews +| # | Type | Step | Verdict | File | +|---|------|------|---------|------| + +## Discoveries +| Discovery | Disposition | Location | +|-----------|-------------|----------| + +## Execution Log +| Timestamp | Action | Outcome | +|-----------|--------|---------| +| 2026-03-15 | Task staged | PROMPT.md and STATUS.md created | + +## Blockers + +*None* + +## Notes + +*Reserved for execution notes* diff --git a/taskplane-tasks/TP-012-polyrepo-fixtures-and-regression-suite/PROMPT.md b/taskplane-tasks/TP-012-polyrepo-fixtures-and-regression-suite/PROMPT.md new file mode 100644 index 00000000..0cdf3d1a --- /dev/null +++ b/taskplane-tasks/TP-012-polyrepo-fixtures-and-regression-suite/PROMPT.md @@ -0,0 +1,136 @@ +# Task: TP-012 - Polyrepo Integration Fixtures and Regression Test Suite + +**Created:** 2026-03-15 +**Size:** L + +## Review Level: 3 (Full) + +**Assessment:** Establishes end-to-end confidence for high-risk multi-repo orchestration and resume paths. +**Score:** 6/8 — Blast radius: 2, Pattern novelty: 1, Security: 0, Reversibility: 3 + +## Canonical Task Folder +``` +taskplane-tasks/TP-012-polyrepo-fixtures-and-regression-suite/ +├── PROMPT.md ← This file (immutable above --- divider) +├── STATUS.md ← Execution state (worker updates this) +├── .reviews/ ← Reviewer output (task-runner creates this) +└── .DONE ← Created when complete +``` + +## Mission + +Build an integration-grade polyrepo fixture and automated regression suite that validates workspace-mode orchestration while guaranteeing monorepo behavior remains stable. + +## Dependencies + +- **Task:** TP-007 (resume behavior must be finalized before end-to-end validation) +- **Task:** TP-008 (doctor diagnostics must be testable in workspace topology) +- **Task:** TP-009 (dashboard payload contracts should be stable before fixture assertions) +- **Task:** TP-010 (team-scale naming must be represented in fixtures) +- **Task:** TP-011 (routing policy enforcement scenarios must be covered) + +## Context to Read First + +> Only list docs the worker actually needs. Less is better. + +**Tier 2 (area context):** +- `taskplane-tasks/CONTEXT.md` + +**Tier 3 (load only if needed):** +- `.pi/local/docs/taskplane/polyrepo-support-spec.md` — Primary architecture and constraints for polyrepo support +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Concrete ticket decomposition and dependencies +- `.pi/local/docs/taskplane/lane-agent-design.md` — Lane/session supervision and team-scale observability patterns +- `.pi/local/docs/taskplane/polyrepo-execution-backlog.md` — Milestone and acceptance mapping for polyrepo v1 + +## Environment + +- **Workspace:** Taskplane extension and dashboard codebase +- **Services required:** None + +## File Scope + +> The orchestrator uses this to avoid merge conflicts: tasks with overlapping +> file scope run on the same lane (serial), not in parallel. + +- `extensions/tests/fixtures/*` +- `extensions/tests/orch-state-persistence.test.ts` +- `extensions/tests/orch-direct-implementation.test.ts` +- `extensions/tests/task-runner-orchestration.test.ts` +- `extensions/tests/orch-pure-functions.test.ts` +- `docs/maintainers/testing.md` + +## Steps + +> **Hydration:** STATUS.md checkboxes must match the granularity below. +> See task-worker agent for full hydration rules. + +### Step 0: Build polyrepo fixture workspace + +- [ ] Create fixture with non-git workspace root, docs repo task root, and multiple service repos +- [ ] Add representative task packets and dependency graph spanning repos + +### Step 1: Add end-to-end polyrepo regression tests + +- [ ] Cover /task routing, /orch-plan, /orch execution, per-repo merge outcomes, and resume +- [ ] Assert collision-safe naming artifacts and repo-aware persisted state fields + +### Step 2: Protect monorepo compatibility + +- [ ] Add/expand assertions ensuring existing monorepo behavior is unchanged +- [ ] Document fixture usage and limitations for maintainers + +### Step 3: Testing & Verification + +> ZERO test failures allowed. + +- [ ] Run unit/regression tests: `cd extensions && npx vitest run` +- [ ] Run targeted tests for changed modules +- [ ] Fix all failures +- [ ] CLI smoke checks pass: `node bin/taskplane.mjs help` + +### Step 4: Documentation & Delivery + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged in STATUS.md +- [ ] `.DONE` created in this folder +- [ ] Task archived (auto — handled by task-runner extension) + +## Documentation Requirements + +**Must Update:** +- `docs/maintainers/testing.md` — Document how to run polyrepo fixture tests +- `.pi/local/docs/taskplane/polyrepo-implementation-plan.md` — Record validated rollout completion criteria + +**Check If Affected:** +- `docs/maintainers/repository-governance.md` — Update CI gating recommendations if integration tests added to required checks + +## Completion Criteria + +- [ ] All steps complete +- [ ] All tests passing +- [ ] Documentation updated +- [ ] `.DONE` created + +## Git Commit Convention + +All commits for this task MUST include the task ID for traceability: + +- **Implementation:** `feat(TP-012): description` +- **Bug fixes:** `fix(TP-012): description` +- **Tests:** `test(TP-012): description` +- **Checkpoints:** `checkpoint: TP-012 description` + +## Do NOT + +- Expand task scope — add tech debt to CONTEXT.md instead +- Skip tests +- Modify framework/standards docs without explicit user approval +- Load docs not listed in "Context to Read First" +- Commit without the task ID prefix in the commit message + +--- + +## Amendments (Added During Execution) + + diff --git a/taskplane-tasks/TP-012-polyrepo-fixtures-and-regression-suite/STATUS.md b/taskplane-tasks/TP-012-polyrepo-fixtures-and-regression-suite/STATUS.md new file mode 100644 index 00000000..13e4eaa6 --- /dev/null +++ b/taskplane-tasks/TP-012-polyrepo-fixtures-and-regression-suite/STATUS.md @@ -0,0 +1,80 @@ +# TP-012: Polyrepo Integration Fixtures and Regression Test Suite — Status + +**Current Step:** Not Started +​**Status:** 🔵 Ready for Execution +**Last Updated:** 2026-03-15 +**Review Level:** 3 +**Review Counter:** 0 +**Iteration:** 0 +**Size:** L + +> **Hydration:** Checkboxes below must be granular — one per unit of work. +> Steps marked `⚠️ Hydrate` will be expanded by the worker. + +--- + +### Step 0: Build polyrepo fixture workspace +**Status:** ⬜ Not Started + +- [ ] Create fixture with non-git workspace root, docs repo task root, and multiple service repos +- [ ] Add representative task packets and dependency graph spanning repos + +--- + +### Step 1: Add end-to-end polyrepo regression tests +**Status:** ⬜ Not Started + +- [ ] Cover /task routing, /orch-plan, /orch execution, per-repo merge outcomes, and resume +- [ ] Assert collision-safe naming artifacts and repo-aware persisted state fields + +--- + +### Step 2: Protect monorepo compatibility +**Status:** ⬜ Not Started + +- [ ] Add/expand assertions ensuring existing monorepo behavior is unchanged +- [ ] Document fixture usage and limitations for maintainers + +--- + +### Step 3: Testing & Verification +**Status:** ⬜ Not Started + +- [ ] Unit/regression tests passing +- [ ] Targeted tests for changed modules passing +- [ ] All failures fixed +- [ ] CLI smoke checks passing + +--- + +### Step 4: Documentation & Delivery +**Status:** ⬜ Not Started + +- [ ] "Must Update" docs modified +- [ ] "Check If Affected" docs reviewed +- [ ] Discoveries logged +- [ ] `.DONE` created +- [ ] Archive and push + +--- + +## Reviews +| # | Type | Step | Verdict | File | +|---|------|------|---------|------| + +## Discoveries +| Discovery | Disposition | Location | +|-----------|-------------|----------| + +## Execution Log +| Timestamp | Action | Outcome | +|-----------|--------|---------| +| 2026-03-15 | Task staged | PROMPT.md and STATUS.md created | + +## Blockers + +*None* + +## Notes + +*Reserved for execution notes* diff --git a/taskplane-tasks/dependencies.json b/taskplane-tasks/dependencies.json new file mode 100644 index 00000000..41311fb0 --- /dev/null +++ b/taskplane-tasks/dependencies.json @@ -0,0 +1,47 @@ +{ + "version": 1, + "generatedAt": "2026-03-15T04:50:17.327Z", + "source": "prompt", + "tasks": { + "TP-001": [], + "TP-002": [ + "TP-001" + ], + "TP-003": [ + "TP-001" + ], + "TP-004": [ + "TP-002", + "TP-003" + ], + "TP-005": [ + "TP-004" + ], + "TP-006": [ + "TP-004" + ], + "TP-007": [ + "TP-005", + "TP-006" + ], + "TP-008": [ + "TP-001" + ], + "TP-009": [ + "TP-006" + ], + "TP-010": [ + "TP-004" + ], + "TP-011": [ + "TP-002" + ], + "TP-012": [ + "TP-007", + "TP-008", + "TP-009", + "TP-010", + "TP-011" + ] + } +} diff --git a/templates/config/task-orchestrator.yaml b/templates/config/task-orchestrator.yaml index b7191556..94a9ab56 100644 --- a/templates/config/task-orchestrator.yaml +++ b/templates/config/task-orchestrator.yaml @@ -24,9 +24,6 @@ orchestrator: worktree_location: "subdirectory" worktree_prefix: "project-wt" - # Integration branch that lanes merge into. - integration_branch: "main" - # Batch ID format used in branch names and logs. batch_id_format: "timestamp" diff --git a/templates/config/task-runner.yaml b/templates/config/task-runner.yaml index e255370a..dbc76d40 100644 --- a/templates/config/task-runner.yaml +++ b/templates/config/task-runner.yaml @@ -69,14 +69,10 @@ context: # Define the task areas that exist in your project. task_areas: - core: - path: "tasks/core" - prefix: "CORE" - context: "tasks/core/CONTEXT.md" - docs: - path: "tasks/docs" - prefix: "DOC" - context: "tasks/docs/CONTEXT.md" + general: + path: "taskplane-tasks" + prefix: "TP" + context: "taskplane-tasks/CONTEXT.md" # Reference docs available for higher-context task prompts. reference_docs: