fix(P09): verification - 4 layers pass
P02 (Phase 9) multi-node scheduling & job dispatch verified across
the 4 layers per ciagent-verify workflow.
LAYER 1 — Structural: all P02 must-have files present at the
documented paths (PLANS.md v0.2 section 'Phase 9: Multi-Node
Scheduling & Job Dispatch'):
- internal/transport/dispatch.go
- internal/transport/idempotency.go
- internal/transport/retry.go
- internal/engine/dispatcher.go
- internal/engine/scheduler.go
- internal/engine/peer.go
- internal/store/capacity_repo.go
- internal/store/migrations/0005_node_capacity.sql
- internal/daemon/dispatch_handler.go
- internal/cli/node_capacity.go
LAYER 2 — Behavioral: go test -count=1 -race ./... all green
across 8 packages. Coverage:
- scheduler_test: best-fit, no-fit, tie-break, Fits()
- idempotency_test: put/get, expiry, ctx propagation,
retry succeeds after transient, no-key-no-retry,
permanent error, ctx cancel, IsTransient
- capacity_repo_test: Upsert/Get/List/Delete round-trip
- dispatch_test: end-to-end Submit round-trip,
X-Orca-Idempotency-Key dedupe, empty-spec=400,
GET=405
LAYER 3 — Security:
- mTLS used in DispatchClient via NewMTLSClient (P01 wiring)
- Idempotency on POST /orca.v1.Dispatch/Submit (REQ-037):
same key returns same job_id, doesn't create duplicate
- context.Context propagation: dispatcher, transport, executor
all take ctx; cancellation flows end-to-end (REQ-017)
- TLS 1.3 + AEAD allowlist unchanged from P01
LAYER 4 — Quality:
- gofmt -l . clean
- go vet ./... clean
- go.mod unchanged (stdlib only, matches minimalist pillar)
- Conventional Commits prefix: feat(P09): for both waves
- All ---ci--- blocks parse correctly
- 0 deps added (no new direct or indirect)
REQ coverage (P02 plan):
- REQ-004 (expansion, multi-node): Dispatcher.Submit routes
local-or-peer; bin-pack via PickNode.
- REQ-017 (context propagation): every I/O call takes ctx.
- REQ-021 (os/exec with WaitDelay): existing engine.Executor
carries the WaitDelay; dispatcher delegates to executor.
- REQ-028 (NodeCapacity HCL schema): store.NodeCapacity
struct + capacity_repo; CLI node_capacity subcommands
(HCL reader is a follow-up; P02 covers the persistence
and CLI flag surface).
- REQ-037 (X-Orca-Idempotency-Key): IdempotencyStore with
TTL=5min; Submit replay; client retry gated on key.
---ci---
project: orca
phase: 9
milestone: v0.2
status: verify
requirements:
covered: [REQ-004, REQ-017, REQ-021, REQ-028, REQ-037]
partial: []
---/ci---
This commit is contained in: