gunk-dev/the-valley

ida-594df79-klaus-s3-requirements-oracle.md

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