Skip to content

feat(polyrepo): stage task packets and fix orchestrator branch handling - #10

Merged
HenryLach merged 5 commits into
mainfrom
feat/polyrepo-support
Mar 15, 2026
Merged

feat(polyrepo): stage task packets and fix orchestrator branch handling#10
HenryLach merged 5 commits into
mainfrom
feat/polyrepo-support

Conversation

@HenryLach

Copy link
Copy Markdown
Owner

Summary

Stage 12 polyrepo support task packets and fix critical orchestrator bugs discovered during first run.

Changes

Task staging

  • 12 structured task packets (TP-001 through TP-012) for polyrepo orchestration support
  • Dependency graph with 6 waves of parallel execution
  • CONTEXT.md for shared task area context

Bug fixes

  • fix(orch): use current branch instead of configured integration_branch — Worktrees were created from main even when running on a feature branch, causing task files to be missing. Removed the integration_branch config setting entirely; the orchestrator now captures the current branch at /orch start and uses it as the base for worktrees and merge target throughout the batch lifecycle.
  • fix(tasks): remove types.ts from file scopestypes.ts appeared in 9/12 task file scopes, creating false affinity chains that forced all tasks onto a single lane. Narrowed scopes to primary files only.
  • fix(templates): align task-runner template areas — Template task area config aligned with taskplane init defaults.

Testing

  • 53/53 worktree lifecycle tests pass
  • 0 regressions (3 pre-existing failures in unrelated source-inspection tests)
  • CLI help and doctor pass

…execution

Remove extensions/taskplane/types.ts from 7 task file scopes where it
was a secondary concern, not the primary deliverable. This shared file
was creating false affinity chains that forced all tasks onto a single
lane (serial execution).

Kept types.ts in TP-001 (workspace config) and TP-006 (schema v2)
where it is the core deliverable.

Also adds dependencies.json for orchestrator dependency resolution.
Remove the integration_branch config setting entirely. The orchestrator
now captures the current branch (git rev-parse --abbrev-ref HEAD) at
/orch start time and uses it as the base for worktree creation and
merge target throughout the batch lifecycle.

This fixes a bug where worktrees were created from the configured
integration_branch (defaulting to 'main'), which could be behind
the working branch — causing task files to be missing in worktrees.

Changes:
- types.ts: Remove integration_branch from OrchestratorConfig, add
  baseBranch to OrchBatchRuntimeState and PersistedBatchState
- git.ts: Add getCurrentBranch() helper
- engine.ts: Capture current branch at batch start, fail fast on
  detached HEAD, pass baseBranch through execution pipeline
- execution.ts: Accept baseBranch param in executeWave()
- waves.ts: Accept baseBranch param in allocateLanes(), remove
  integration_branch validation
- worktree.ts: Accept baseBranch param in createLaneWorktrees()
  and ensureLaneWorktrees()
- merge.ts: Accept baseBranch param in mergeWave()
- resume.ts: Restore baseBranch from persisted state
- persistence.ts: Serialize/validate baseBranch with backward
  compatibility for older state files
- config.ts: No changes needed (spread ignores unknown YAML keys)
- Updated template, docs, CLI init, and tests
Add amendments to TP-004, TP-005, TP-006, TP-007, and TP-010 explaining
the integration_branch removal and how baseBranch works now. This
prevents worker agents from searching for the removed config field
or misunderstanding changed function signatures.
@HenryLach
HenryLach merged commit d81de9b into main Mar 15, 2026
1 check passed
@HenryLach
HenryLach deleted the feat/polyrepo-support branch March 15, 2026 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant