| 1 | --- |
| 2 | type: idea |
| 3 | id: ida-594df79 |
| 4 | status: exploring |
| 5 | title: "Use Klaus to identify requirements for agent orchestration" |
| 6 | created: 2026-07-13 |
| 7 | source: directed review, 2026-07-13 |
| 8 | --- |
| 9 | |
| 10 | # Use Klaus to identify requirements for agent orchestration |
| 11 | |
| 12 | Klaus is a working agent orchestrator whose daily use can expose the requirements for |
| 13 | [S3](../../design/user-scenarios.md#the-ladder). Its dependence on GitHub reveals which capabilities |
| 14 | the-valley must supply for equivalent work. |
| 15 | |
| 16 | The migration needs more than a replacement event feed. Klaus currently uses pull requests as |
| 17 | workflow identities, GitHub as a state source, and pull-request metadata to persist some paused |
| 18 | work. |
| 19 | |
| 20 | ## Capabilities to preserve |
| 21 | |
| 22 | | Klaus capability | Capability needed from the-valley | |
| 23 | | ---------------------------------------------------- | ----------------------------------------------------------------- | |
| 24 | | Webhooks followed by state reconciliation | Replayable events and queryable current state | |
| 25 | | Approval and merge-readiness policy | Integration requests evaluated under declared policy | |
| 26 | | Opening a pull request | Submitting an identifiable change for integration | |
| 27 | | Launching work from an issue or prompt | Dispatch against an outcome with a complete brief | |
| 28 | | Run state, trajectories, dashboard, and watch stream | A queryable history linking runs, changes, and outcomes | |
| 29 | | Review feedback that triggers further work | Recorded feedback available to a repair or revision run | |
| 30 | | Budget pause and later resume | Durable pause state, work-in-progress changes, and a resume index | |
| 31 | |
| 32 | Klaus's `pr:approval-changed` event already anticipates merge-readiness sources beyond GitHub. That |
| 33 | is a useful point of separation, but other assumptions still need to be examined. |
| 34 | |
| 35 | ## Failure modes the migration must address |
| 36 | |
| 37 | A pushed branch must be discoverable as work awaiting integration even when no pull request exists. |
| 38 | A run ending with a generic exit status is insufficient. |
| 39 | |
| 40 | A budget pause must preserve both the work and the fact that it is paused. Pushing a |
| 41 | work-in-progress branch alone does not supply the resume marker that a GitHub draft, label, and |
| 42 | comment currently provide. |
| 43 | |
| 44 | Run attribution must be explicit. Scraping a transcript for a pull-request URL can associate the run |
| 45 | with an unrelated request it merely mentions. |
| 46 | |
| 47 | An interrupted stream may end without the final record expected by the harness. Crash and |
| 48 | usage-limit handling must still produce an accurate failure or attention state. These are examples |
| 49 | of the stalled work described in [[ida-3145b7a]](ida-3145b7a-demand-pressure.md). |
| 50 | |
| 51 | ## Events and request state |
| 52 | |
| 53 | Ref-update events need repository, ref, old and new revision, and pusher identity. Workstation |
| 54 | clients must be able to subscribe and replay. |
| 55 | |
| 56 | The orchestrator also needs queryable request status. Integration success and stale-evidence events |
| 57 | can invalidate its view, but it must recover the current state without receiving every event. A |
| 58 | branch awaiting integration must be a recognizable state. |
| 59 | |
| 60 | An absent expected push can help detect unfinished work, but detecting a dead run also needs |
| 61 | run-liveness information. |
| 62 | |
| 63 | ## Dispatch, attribution, and pause |
| 64 | |
| 65 | Dispatch targets an outcome as proposed in [[ida-eac723e]](ida-eac723e-outcome-dag.md). The node |
| 66 | must provide a sufficient brief, or dispatch must supply additional context explicitly. |
| 67 | |
| 68 | The host-signed provenance defined in |
| 69 | [[dcr-0de694f]](../decisions/dcr-0de694f-phase2-attestation-shape.md) records the relationship |
| 70 | between run and change. It removes the need to infer that relationship from transcript text. |
| 71 | |
| 72 | Klaus already stores resume trajectories through Git under `refs/klaus/data`. A valley workflow |
| 73 | still needs durable homes for the pause marker and resume lookup. A node plus work-in-progress |
| 74 | branch is a candidate arrangement. |
| 75 | |
| 76 | These are migration requirements to verify against the current Klaus implementation. They do not |
| 77 | imply that replacing its GitHub event source completes the migration. |