Skip to content

feat(orchestration): path-reservation ledger; live agent-status endpoint - #240

Merged
Patel230 merged 1 commit into
mainfrom
feat/luvus-orchestration
Aug 23, 2026
Merged

feat(orchestration): path-reservation ledger; live agent-status endpoint#240
Patel230 merged 1 commit into
mainfrom
feat/luvus-orchestration

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

Summary

Two orchestration primitives adopted from Luvus (mission control for coding agents), mapped onto hawk's existing mission/daemon architecture.

1. File-path reservation + overlap forecasting — internal/multiagent

  • PathReservationLedger: all-or-nothing path claims per agent (any conflict claims nothing; same-agent re-reserve is idempotent), Release frees the whole set, canonical-path normalization.
  • DetectFileOverlaps: compares completed handoffs pairwise and reports every feature pair whose changed-file sets intersect — a merge-conflict forecast for parallel branches.
  • Wired into Mission: each completed handoff's FilesChanged claims its paths in a mission-level ledger, and new Mission.DetectOverlaps() surfaces conflicting pairs before branches merge (Luvus' "coordinate dependent tasks / reserve file paths").

2. Live agent-status contract — internal/daemon

  • New GET /v1/agent/status: machine-readable per-session state (working | idle | stale) derived from daemon ground truth — an in-flight generation (registered cancel) means working; last-use recency separates idle from stale. Includes session id, agent, turns, cwd, last_used.
  • Lets external mission-control dashboards (Luvus-style supervisors) poll hawk instead of scraping terminal output.
  • Registered with auth+rate like sibling routes and documented in api/openapi.yaml (enforced by the parity test).

Testing

  • New: reservation ledger (7 tests incl. all-or-nothing conflicts + normalization), overlap detection (2), agent-status endpoint (2 states + empty)
  • Full daemon suite incl. openapi parity passes; multiagent suite passes; golangci-lint 0 issues; gofmt clean

Two orchestration primitives adopted from Luvus (mission control for
coding agents), mapped onto hawk's existing mission/daemon architecture.

File-path reservation + overlap forecasting (internal/multiagent):
- PathReservationLedger: all-or-nothing path claims per agent (a conflict
  claims nothing; same-agent re-reserve is idempotent), Release frees the
  agent's whole set, canonical-path normalization (./ prefix, slash form).
- DetectFileOverlaps compares completed handoffs pairwise and reports
  every feature pair whose changed-file sets intersect — a merge-conflict
  forecast for parallel branches.
- Wired into Mission: each completed handoff's FilesChanged claims its
  paths in a mission-level ledger (conflicts recorded best-effort; the
  authoritative signal is DetectOverlaps at wave end), and a new
  Mission.DetectOverlaps() surfaces pairs before merging branches.

Live agent-status contract (internal/daemon):
- GET /v1/agent/status returns machine-readable per-session state
  (working | idle | stale) derived from daemon ground truth: an in-flight
  generation (registered cancel) means working; recency of last use
  separates idle from stale. Includes session id, agent, turns, cwd,
  last_used. This lets external mission-control dashboards supervise hawk
  by polling instead of scraping terminal output.
- Registered with auth+rate like sibling routes and documented in
  api/openapi.yaml (parity test enforced).

Verification: new tests green (reservation 7, overlap 2, agent-status 2);
full daemon suite incl. openapi parity passes; multiagent suite passes;
golangci-lint 0 issues; gofmt clean; go build ./... clean.
@Patel230
Patel230 merged commit 1ee93fd into main Aug 23, 2026
26 checks passed
@Patel230
Patel230 deleted the feat/luvus-orchestration branch August 23, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant