|
| 1 | +# AST task coordination |
| 2 | + |
| 3 | +Architecture version: 1 |
| 4 | +Task contract version: 1 |
| 5 | + |
| 6 | +## Selection |
| 7 | + |
| 8 | +Run the configured task planner before claiming work. A task may start only |
| 9 | +when `canStart=true`, its declared dependencies are done, no higher-priority |
| 10 | +frontier suppresses it, its write scope is clean apart from its own task brief, |
| 11 | +and it does not overlap active work. |
| 12 | + |
| 13 | +The primary checkout is the default. Parallel work in one checkout is expected |
| 14 | +when write scopes are disjoint. A dedicated worktree is reserved for work that |
| 15 | +is logically disjoint but cannot safely share generated outputs, dependency |
| 16 | +state or runtime fixtures. |
| 17 | + |
| 18 | +## Claim and lifecycle |
| 19 | + |
| 20 | +The coordinator owns lifecycle transitions. Workers request them through the |
| 21 | +task work log and handoff. |
| 22 | + |
| 23 | +```text |
| 24 | +proposed -> ready -> claimed -> in_progress -> review -> done |
| 25 | + \-> blocked |
| 26 | +proposed | ready | blocked -> cancelled |
| 27 | +``` |
| 28 | + |
| 29 | +Claiming records owner, owner kind, lease, base SHA, branch and checkout. The |
| 30 | +brief above `## Work log` is immutable while claimed. After admission, workers |
| 31 | +may update only `base_sha`, `branch`, `worktree` and `updated_at`, plus the work |
| 32 | +log and handoff. The coordinator alone changes lifecycle, ownership, lease, |
| 33 | +dependencies, decision dependencies, conflicts and `write_scope`. |
| 34 | + |
| 35 | +## Shared-checkout concurrency |
| 36 | + |
| 37 | +- Compare every candidate against all active `write_scope`, `conflicts_with`, |
| 38 | + generated outputs and current dirty paths. |
| 39 | +- One task owns one source or test path. Globs must describe a cohesive slice, |
| 40 | + not reserve a package for convenience. |
| 41 | +- `ROADMAP.md`, `STATUS.md`, package manifests, root exports, lockfiles, CI and |
| 42 | + generated API documentation are coordinator surfaces unless a task names one |
| 43 | + explicitly and runs without an overlapping task. |
| 44 | +- A worker does not run repository-wide formatting, dependency installation, |
| 45 | + documentation generation, commits, release commands or destructive cleanup. |
| 46 | +- Cross-task requests are recorded in the handoff. Do not expand a task into a |
| 47 | + concurrent owner’s path. |
| 48 | +- Review is a separate ownership pass. The implementer stops editing when the |
| 49 | + task enters `review` unless the coordinator reopens it. |
| 50 | + |
| 51 | +The common task brief and `STATUS.md` are deliberately absent from ordinary |
| 52 | +implementation write scopes. This avoids turning coordination metadata into a |
| 53 | +false global mutex. The coordinator integrates requested lifecycle updates |
| 54 | +after checking all active scopes. |
| 55 | + |
| 56 | +## Versioning |
| 57 | + |
| 58 | +- `architecture_version` versions this programme’s architecture decisions. |
| 59 | +- Project manifest `schemaVersion` versions planner/workbench configuration. |
| 60 | +- Project manifest `taskSchemaVersion` versions the Markdown task-brief shape. |
| 61 | +- Planner JSON has its own output `schemaVersion`. |
| 62 | +- Versioned contracts use explicit filenames such as |
| 63 | + `source-bridge-v1.md`; implementations state the exact contract consumed. |
| 64 | +- Generated ownership markers, codec envelopes and migration manifests are |
| 65 | + compatibility contracts. A breaking shape requires a new explicit version, |
| 66 | + fixtures for both sides of the boundary and a migration decision. |
| 67 | +- Package versions, packed artefacts and runtime matrices are evidence. They do |
| 68 | + not silently advance an architecture or protocol version. |
| 69 | + |
| 70 | +## Handoff |
| 71 | + |
| 72 | +Every active task records: |
| 73 | + |
| 74 | +```text |
| 75 | +Execution mode: shared-checkout | dedicated-worktree |
| 76 | +Execution rationale: <why this checkout is safe> |
| 77 | +Concurrency evaluation: <active task IDs and overlap result> |
| 78 | +Concurrent task scopes: none | <task IDs and disjoint scopes> |
| 79 | +Swarm delegation: none | <owner -> delegate: bounded output> |
| 80 | +``` |
| 81 | + |
| 82 | +The handoff includes changed paths, exact verification commands and results, |
| 83 | +behaviour or contract changes, remaining risk and the recommended next task. |
0 commit comments