feat(orchestration): path-reservation ledger; live agent-status endpoint - #240
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/multiagentPathReservationLedger: all-or-nothing path claims per agent (any conflict claims nothing; same-agent re-reserve is idempotent),Releasefrees 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.Mission: each completed handoff'sFilesChangedclaims its paths in a mission-level ledger, and newMission.DetectOverlaps()surfaces conflicting pairs before branches merge (Luvus' "coordinate dependent tasks / reserve file paths").2. Live agent-status contract —
internal/daemonGET /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.api/openapi.yaml(enforced by the parity test).Testing