c2038952c7
---ci--- project: orca phase: 0 milestone: v0.1 status: plan phases_planned: 6 waves: 4 ---/ci---
5.8 KiB
5.8 KiB
Phase Plans: Orca v0.1
All 6 phases with vertical-slice structure, wave ordering, and REQ-ID mapping.
Phase 1: CLI Skeleton (Wave 1)
Branch: phase/01-cli-skeleton
REQ Coverage: REQ-001, REQ-002, REQ-013, REQ-015, REQ-016, REQ-019, REQ-024
Must-Haves
go.modwithgo 1.25cmd/orca/main.go— entry pointinternal/cli/root.go— Cobra root command with--jsonglobal flaginternal/cli/version.go—orca versionsubcommandinternal/cli/init.go—orca initsubcommand (stub)internal/cli/status.go—orca statussubcommand (stub)internal/cli/node.go—orca node {join,leave,list}stubsinternal/cli/job.go—orca job {run,list,stop,logs}stubsMakefilewithbuild,test,lint,fmttargetsLICENSE(MIT)README.mdwith quickstart.gitignoreforbin/,coverage.out,*.test.githooks/pre-push→scripts/trigger_coreci.shscripts/trigger_coreci.sh— curl-based CoreCI trigger
Verification
go build ./cmd/orcasucceedsorca --helplists all subcommandsorca versionprints versionorca --json versionprints JSONmake build,make test,make lint,make fmtall succeed
Phase 2: Node Management (Wave 2)
Branch: phase/02-node-mgmt
REQ Coverage: REQ-002, REQ-005, REQ-012, REQ-017, REQ-018
Must-Haves
internal/store/sqlite.go— SQLite connection (modernc/sqlite)internal/store/migrations/0001_nodes.sql— nodes table schemainternal/store/node_repo.go— Node repository (CRUD)internal/engine/registry.go— In-memory node registry with SQLite persistence- Wire
orca node jointo registry - Wire
orca node leaveto registry - Wire
orca node listto registry - Audit log on all node operations
- Config loading from
~/.orca/config.hcl
Verification
orca node join --name test --addr localhost:8443adds nodeorca node listshows added nodeorca node leave <id>removes node- Restart daemon, node state persists
Phase 3: Task Execution Engine (Wave 2)
Branch: phase/03-task-exec
REQ Coverage: REQ-004, REQ-009, REQ-021, REQ-022
Must-Haves
internal/store/migrations/0002_jobs_tasks.sql— jobs + tasks tablesinternal/store/job_repo.go— Job repositoryinternal/store/task_repo.go— Task repositoryinternal/engine/executor.go—os/execwithWaitDelay(Go 1.25+)internal/engine/scheduler.go— Single-node FIFO schedulerinternal/jobspec/hcl.go— HCL job spec parser- Wire
orca job run <spec.hcl>to executor - Wire
orca job listto repository - Wire
orca job stop <id>to executor - Wire
orca job logs <id>to task output
Verification
orca job runwith valid HCL spec executes command- Task status transitions: pending → running → complete
orca job listshows job historyorca job stopkills running process cleanly (WaitDelay)
Phase 4: Local State Persistence Hardening (Wave 3)
Branch: phase/04-state-persistence
REQ Coverage: REQ-005, REQ-018
Must-Haves
internal/store/migrate.go— Migration runnerinternal/store/audit_repo.go— Audit log repositoryinternal/store/migrations/0003_audit_log.sql— audit_log table- Embed migrations via
//go:embed - Transaction wrapping for all writes
- Connection pool tuning
- Graceful shutdown flushes pending writes
Verification
- Migrations apply on first run
- Audit log entries persist across restarts
- Concurrent writes don't corrupt state (test with
go test -race)
Phase 5: Health Checks (Wave 3)
Branch: phase/05-health-checks
REQ Coverage: REQ-006, REQ-017
Must-Haves
internal/daemon/server.go—net/httpserver withhttp.ServeMuxinternal/daemon/health.go—/healthzand/readyzhandlersinternal/daemon/jobs_handler.go—/v1/jobs/*handlersinternal/daemon/nodes_handler.go—/v1/nodes/*handlersinternal/daemon/tasks_handler.go—/v1/tasks/*handlers- Graceful shutdown via
signal.NotifyContext - Health endpoint checks SQLite connectivity
- Wire CLI subcommands to daemon API
Verification
curl http://localhost:8080/healthzreturns 200curl http://localhost:8080/readyzreturns 200 when readycurl http://localhost:8080/v1/jobsreturns job list as JSON- Daemon shuts down cleanly on SIGTERM
Phase 6: CoreCI Full Release Flow (Wave 4)
Branch: phase/06-coreci-release
REQ Coverage: REQ-007, REQ-014
Must-Haves
.coreci.yml— validate, build, test, release pipelinesscripts/release.sh—tea releases createwrapperMakefilereleasetarget invokes release script- Tarball generation in release pipeline
- Version injection via
-ldflags CHANGELOG.md(auto-generated from---ci---blocks)
Verification
make releasecreates Gitea release with tarball- Tarball contains
orcabinary - Release notes include phase summary
- CoreCI
validate,build,test,releasepipelines all green
Wave Ordering
- Wave 1 (Phase 1): Foundation — CLI skeleton, build system, hooks
- Wave 2 (Phases 2-3): Core functionality — node registry, task execution
- Wave 3 (Phases 4-5): Hardening — state persistence, health checks
- Wave 4 (Phase 6): Release — CoreCI integration
Phases within a wave can be parallelized if parallelization.enabled=true.
For v0.1, parallelization.enabled=false — phases run sequentially.
Versioning
- Milestone type:
feature(Phases 1-6 all produce features) - Patch per phase:
v0.1.1,v0.1.2, ...,v0.1.6 - Final tag on COMPLETE:
v0.2.0(next minor perrun.mdversioning logic)