Implement orch core scheduling

This commit is contained in:
2026-03-19 13:13:36 +08:00
parent b110bb24d9
commit 07f4a6fdae
19 changed files with 3230 additions and 23 deletions
+37 -8
View File
@@ -24,10 +24,11 @@ As of now:
- a reusable Codex skill package for `inbox` now exists under `skills/inbox/`, with a formal `SKILL.md`, `agents/openai.yaml`, and a bundled CLI binary asset
- an inbox skill forward-test plan directory now exists under `docs/tests/inbox-skill/`, with a shared execution template and multiple scenario cases
- an execution-roadmap workflow now exists under `docs/roadmaps/active/` and `docs/roadmaps/archive/` for agent-level work traces and completion archives
- `orch` currently exists as a command skeleton only
- no scheduler workflows have been implemented yet
- `orch` now implements `run init/show`, `task add`, `dep add`, `ready`, `dispatch`, `reconcile`, `blocked`, `answer`, and `status`
- `orch` can create runs, gate tasks through dependencies, dispatch work through `inbox`, reconcile worker thread state back into task state, and answer blocked tasks
- automated integration tests now cover the main `orch` scheduler slice, including dependency gating, dispatch, blocked-answer flow, and reconcile
This means the project is past design discovery and ready for `orch` implementation.
This means the project now has a working `orch` core scheduler and is ready for strict worktree-backed execution support.
## Source Of Truth
@@ -67,9 +68,10 @@ Current implementation status:
- `Milestone 1: Go Skeleton` is complete
- `Milestone 2: Shared DB Layer` is complete enough for both CLIs
- `Milestone 3: Inbox Happy Path` is complete
- `Milestone 4: Orch Core Scheduling` is complete for the current non-worktree scheduler scope
- `Milestone 6: Waiting Primitives` is partially complete through `inbox wait-reply`
The next practical coding target is `Milestone 4: Orch Core Scheduling`.
The next practical coding target is `Milestone 5: Strict Worktree Support`.
### Milestone 1: Go Skeleton
@@ -217,6 +219,30 @@ Definition of done:
- dispatch a task through `orch`
- see worker state reflected back after `reconcile`
Status:
- completed for the current non-worktree scheduling scope
Completed so far:
- `orch run init`
- `orch run show`
- `orch task add`
- `orch dep add`
- `orch ready`
- `orch dispatch`
- `orch reconcile`
- `orch blocked`
- `orch answer`
- `orch status`
- CLI integration tests cover single-task dispatch/reconcile, dependency gating, blocked-answer flow, and non-ready dispatch rejection
Remaining:
- strict worktree provisioning on dispatch
- `orch wait`
- retry, reassign, cancel, and cleanup workflows
### Milestone 5: Strict Worktree Support
Goal:
@@ -273,10 +299,11 @@ Definition of done:
If a new agent is taking over now, the next concrete step should be:
1. start `Milestone 4: Orch Core Scheduling`
2. keep the authored inbox test-plan set in `docs/tests/inbox/` synchronized if CLI behavior changes during `orch` work
1. start `Milestone 5: Strict Worktree Support`
2. add real worktree metadata population to `orch dispatch`
3. keep the authored inbox test-plan set in `docs/tests/inbox/` synchronized if CLI behavior changes during further `orch` work
The inbox implementation and its human-readable test-plan set are already in place, so the next meaningful project step is to build scheduler behavior on top of that stable base.
The inbox implementation and its human-readable test-plan set are already in place, and the initial `orch` scheduler loop now exists, so the next meaningful project step is to isolate code-writing attempts in real worktrees.
## Recommended Driver Choices
@@ -297,11 +324,13 @@ Completed so far:
- schema init test
- inbox command-level CLI integration coverage aligned to `docs/tests/inbox/`
- inbox workflow lifecycle coverage
- orch scheduler lifecycle coverage for run/task/dependency/dispatch/reconcile
- orch blocked-question and answer coverage
Still recommended before the codebase grows too much:
- single-task orch dispatch and reconcile test
- worktree path generation test
- `orch wait` event wake test
- council tally grouping test
## Inbox Test Documentation Roadmap
@@ -0,0 +1,64 @@
# Orch Core Scheduling
## Status
- `completed`
## Owner
- codex
## Started At
- `2026-03-19`
## Goal
- implement the first usable `orch` scheduling slice on top of the existing shared SQLite schema and `inbox` transport
- deliver a leader workflow that can create a run, add tasks and dependencies, dispatch ready work, reconcile inbox state, and answer blocked tasks
## Scope
- add `orch` store primitives for runs, tasks, dependencies, attempts, readiness, dispatch, reconcile, blocked lookup, and run status views
- add CLI commands for the first Milestone 4 surface
- add automated tests for the happy-path scheduler workflow and core state transitions
- update the implementation roadmap with the new progress state
## Checklist
- [x] inspect the current `orch` skeleton, schema, and project roadmaps
- [x] implement `orch` store types and DB operations for runs, tasks, dependencies, attempts, and task-state transitions
- [x] add CLI commands for `run init`, `run show`, `task add`, `dep add`, `ready`, `dispatch`, `reconcile`, `blocked`, `answer`, and `status`
- [x] add automated tests covering run creation, dependency gating, dispatch, blocked-answer flow, and reconcile
- [x] run `go test ./...`
- [x] update `docs/implementation-roadmap.md`
- [x] archive this roadmap with a completion summary when the workstream is complete
## Files
- `docs/roadmaps/active/orch-core-scheduling.md`
- `docs/implementation-roadmap.md`
- `cmd/orch/main.go`
- `internal/cli/orch/root.go`
- `internal/cli/orch/*.go`
- `internal/store/orch.go`
- `internal/cli/orch/*_test.go`
## Decisions
- start with the scheduler loop that reuses existing `inbox` behavior rather than attempting worktree orchestration in the same slice
- keep JSON response style aligned with `inbox` so both CLIs expose consistent machine-readable contracts
## Blockers
- none
## Next Step
- start `Milestone 5: Strict Worktree Support` by extending `orch dispatch` to resolve a concrete base commit and create real worktree metadata
## Completion Summary
- `orch` now has a usable core scheduler loop backed by shared SQLite state and `inbox`
- the implemented CLI surface covers `run init/show`, `task add`, `dep add`, `ready`, `dispatch`, `reconcile`, `blocked`, `answer`, and `status`
- integration tests now verify dispatch/reconcile lifecycle, dependency gating, blocked-question answers, and non-ready dispatch rejection