docs(audit): fix .ciagent/ file discipline issues

Audit findings addressed:
- PROJECT.md: add 'What This Is' and 'Key Decisions' sections (per audit Step 2)
- ARCHITECTURE.md: add internal/jobspec (HCL parser) and internal/model (domain types) to system diagram and component details
- PLANS.md: expand REQ coverage lines for Phase 1 and Phase 3 to include all REQ-IDs the work actually delivers (REQ-003 offline-first, REQ-008 slog, REQ-010 --json, REQ-020 hashicorp/hcl)

---ci---
project: orca
phase: 0
milestone: v0.1
status: fix
---/ci---
This commit is contained in:
ciagent
2026-06-03 20:14:03 +00:00
parent 37b6a14023
commit f1c55ca79b
3 changed files with 37 additions and 3 deletions
+18 -1
View File
@@ -2,7 +2,7 @@
## System Overview
Orca is a single-binary, offline-first orchestration engine. The system consists of three logical components, all compiled into one `orca` binary and selected via subcommands.
Orca is a single-binary, offline-first orchestration engine. The system consists of six logical components, all compiled into one `orca` binary and selected via subcommands.
```
┌─────────────────────────────────────────────────────────────┐
@@ -22,6 +22,13 @@ Orca is a single-binary, offline-first orchestration engine. The system consists
│ ├── /v1/nodes/* (node registry API) │
│ └── /v1/tasks/* (task lifecycle API) │
├─────────────────────────────────────────────────────────────┤
│ Job Spec Parser (hashicorp/hcl/v2) │
│ └── reads .hcl files → validates → hands to engine │
├─────────────────────────────────────────────────────────────┤
│ Domain Model (internal/model) │
│ ├── Node, Job, Task structs (no I/O) │
│ └── shared by store, engine, daemon │
├─────────────────────────────────────────────────────────────┤
│ Core Engine │
│ ├── Node Registry (in-memory + SQLite persistence) │
│ ├── Task Executor (os/exec with WaitDelay, Go 1.25+) │
@@ -59,6 +66,16 @@ Orca is a single-binary, offline-first orchestration engine. The system consists
- **Schema**: `nodes`, `jobs`, `tasks`, `audit_log` tables
- **Migrations**: Embedded SQL files, applied on startup
### 5. Job Spec Parser (`internal/jobspec`)
- **Parser**: `hashicorp/hcl/v2` (industry-standard, familiar to Nomad users)
- **Format**: HCL files (`.hcl`); YAML fallback considered but deferred
- **Use**: `orca job run <spec.hcl>` reads and validates the spec, hands off to the engine
### 6. Domain Model (`internal/model`)
- **Types**: `Node`, `Job`, `Task` — pure data structs with no I/O
- **State machines**: Node (pending/ready/left), Task (pending/running/complete/failed)
- **Use**: shared by `internal/store`, `internal/engine`, `internal/daemon` to avoid circular dependencies
## Data Model
### Node
+2 -2
View File
@@ -7,7 +7,7 @@ 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
**REQ Coverage**: REQ-001 (Go 1.25), REQ-002 (CLI-first single binary), REQ-003 (offline-first — no network deps in CLI), REQ-008 (slog structured logging), REQ-010 (`--json` output flag), REQ-013 (pre-push hook), REQ-015 (MIT LICENSE), REQ-016 (README quickstart), REQ-019 (Cobra), REQ-024 (Makefile)
### Must-Haves
- [ ] `go.mod` with `go 1.25`
@@ -61,7 +61,7 @@ All 6 phases with vertical-slice structure, wave ordering, and REQ-ID mapping.
## Phase 3: Task Execution Engine (Wave 2)
**Branch**: `phase/03-task-exec`
**REQ Coverage**: REQ-004, REQ-009, REQ-021, REQ-022
**REQ Coverage**: REQ-004 (task execution), REQ-009 (HCL/YAML parsing), REQ-020 (hashicorp/hcl parser), REQ-021 (os/exec with WaitDelay), REQ-022 (iter.Seq streaming — deferred)
### Must-Haves
- [ ] `internal/store/migrations/0002_jobs_tasks.sql` — jobs + tasks tables
+17
View File
@@ -1,5 +1,8 @@
# Project: Orca
## What This Is
A minimalist, offline-first, CLI-first orchestration engine inspired by HashiCorp Nomad, prioritizing stability, security, and simplicity over feature richness. Single-binary distribution, no container runtime, no cloud dependencies, no K8s-level complexity.
## Vision
A minimalist, offline-first, CLI-first orchestration engine inspired by HashiCorp Nomad, prioritizing stability, security, and simplicity over feature richness.
@@ -44,3 +47,17 @@ Build a lightweight system to manage and execute workloads across a set of nodes
- Container runtime integration.
- Service mesh / sidecar injection.
- Auto-scaling / horizontal pod autoscaler.
## Key Decisions
- **Single binary** (D-001): one `orca` binary with subcommands — no multi-binary distribution.
- **modernc/sqlite** (D-002): CGO-free SQLite for state — single file, cross-compile friendly.
- **Embedded HTTP over loopback** (D-003): net/http for v0.1; mTLS for cross-node (REQ-011, REQ-023 deferred to v0.2).
- **Single-node only** (D-004): no multi-node scheduling in v0.1 (deferred to v0.2).
- **Human-readable + `--json`** (D-005): both outputs supported from the start.
- **HCL/YAML specs** (D-006): familiar to Nomad/HashiCorp users.
- **mTLS for v0.1, tokens deferred** (D-007): most secure default; tokens if needed later.
- **Direct process execution** (D-008): no container runtime — pure process management.
- **`~/.orca/config.hcl` and `/etc/orca/orca.hcl`** (D-009): standard XDG-style paths.
- **Structured JSON via `log/slog`** (D-010): native Go 1.21+ slog, no external dependency.
See **Clarified Decisions** below for full table with confidence scores.