Files
orca/internal/model
Jon Chery 9580f347c6 feat(P02): node management with SQLite-backed registry
Implements Phase 2 of v0.1 Foundation:
- internal/model/node.go: Node struct with state machine (pending/ready/left)
- internal/store/store.go: SQLite open with WAL + foreign_keys pragmas
- internal/store/migrate.go: embedded SQL migration runner
- internal/store/migrations/0001_nodes.sql: nodes table schema
- internal/store/node_repo.go: CRUD operations for nodes
- internal/store/node_repo_test.go: 4 tests covering insert/get/list/update/delete
- internal/engine/registry.go: in-memory wrapper with slog audit logging
- internal/cli/node.go: orca node {join,leave,list} wired to registry

Verified: node join/list/leave work end-to-end, JSON output, slog audit logs,
state persists in SQLite, all tests pass with -race.

---ci---
project: orca
phase: 2
milestone: v0.1
status: execute
req_covered:
  - REQ-002
  - REQ-005
  - REQ-008
  - REQ-012
  - REQ-017
  - REQ-018
---/ci---
2026-06-03 12:38:46 +00:00
..