Skip to content

Start orchestration workers from a recorded snapshot of the lead's committed work #948

Closed

Description

@currentbits

Workflow proposal grounded in reproduced behavior. Priority: P2. Research at 6c7a6fbe, 2026-09-06.

User outcome

When a lead has already integrated a worker's API or committed shared setup, its next worker sees that work without being told to reconstruct or manually cherry-pick it.

Current behavior and reproduction

Create an isolated lead with a committed lead-only file, then call forkWorkerThread and materialize its worktree. The worker starts at main and cannot see the lead-only file. forkThread creates a new thread without copying a source ref; forkWorkerThread only flags pendingWorktree; setupWorktree chooses the worker's recorded base or repository default.

This is not an assertion that all forks should inherit dirty files. The missing behavior is an explicit source snapshot for orchestration workers, separate from where their final change will land.

Proposed contract

  • In an orchestrated integration workflow, record the lead's committed HEAD when the worker fork is requested.
  • Materialize a lazily created worktree from that exact SHA, even if the lead advances before the worker starts.
  • Keep start ref separate from final merge/PR target. Reusing baseBranch for both creates misleading destinations.
  • Show the source branch/short SHA in worker details and in the lead's worker list.
  • If lead edits are uncommitted, say that the worker inherits committed work only. Do not auto-commit, stash or silently copy those edits.
  • A dependent worker launched after integration sees the new integrated snapshot. Existing parallel workers stay on their original snapshots until explicitly refreshed.
  • Missing source ref must produce an actionable failure, never quietly fall back to main.
  • Preserve ordinary independent thread creation and read-only/no-worktree workers.

Acceptance

Fork from lead with committed API: worker contains it. Advance the lead between fork and lazy materialization: worker still starts from the recorded SHA. Launch a subsequent dependent worker: it sees the newer commit. Dirty lead edits are not leaked or committed. Parent identity and intended merge destination remain distinct and visible.

Builds on #187/#775 base-selection primitives but addresses orchestration fork provenance, not the manual stacked-base picker. The existing dependency list (#277) can guide when a dependent worker starts; do not create another scheduler.

Sources: forkThread, forkWorkerThread, setup start.

Evidence: node docs/issue-drafts/2026-09-06-merge-evidence.mjs exits 0. Uses a temporary real Git repo, Store and actual service/worktree functions. GitHub completion is stubbed; no live refs, remote calls or user data changed. Script is in the audit checkout; reproduction above is self-contained.

Requested disposition: separate OPEN Planboard issue, plan:todo. Research only; no app implementation.

Activity

  1. added
    plan:todo
    plan:doing
    plan:done
    and removed
    plan:todo
    plan:doing
    on Sep 6, 2026
  2. currentbits commented on Sep 7, 2026

    @currentbits
    OwnerAuthor

    Landed from Solenta thread "Fork: Start orchestration workers from a recorded snapshot o". Closed on merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    plan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions