Repository navigation
workstreams: the watching agent (morning and job-event wakes, undoable small changes, wake.* methods) - #2319
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…shot wake turn Co-Authored-By: Claude Opus 5.5 <[email protected]>
…; wake costs count toward spend Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…es only for today's slot; wake calls carry their purpose Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rder; replay knows the wake's role Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… from a defer Co-Authored-By: Claude Opus 5.5 <[email protected]>
AbirAbbas
force-pushed
the
workstreams/wp11-watch
branch
from
November 3, 2026 15:31
fae1bf8 to
04d0224
Compare
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.
The Workstreams plan, WP-11: the workstream agent watches. It wakes only each morning (when the workstream asked for it) and on a member job's event, runs one model turn with the event as context, and leaves one batched result per event: a summary, the small changes it applied (each undoable) and what it proposes.
What it does
automation.Schedule, checked every minute while the app is open, once per day per workstream. Job events:WorkstreamJobEventhook (finished, merged, failed, needs you), resolved byfactory_jobmembership; nothing calls it yet (the Factory's event source will). Never for a done workstream, autonomy Off, or wake.morning off. A unique (workstream, event key) row is inserted before the model call, so a repeated event or a second app process never makes a second turn. Caps: 24 wakes per workstream and 200 per home per day; one worker; 3-minute timeout.wake.list,wake.apply(one or all),wake.undo(one or all, only while unchanged),wake.not_now;wakeschange part; idempotent (no write, no event when nothing changes).cost_usd(absent when unknown) is recorded and counted inspend_usd.workstream_wakesandworkstream_wake_itemsby an additive migration on the first write; an older engine refuses a schema-4 file as before.Validation contract
(a) morning once per day, Off/morning-off none · (b) one hook call → one wake with one batch, duplicates and non-members none · (c) Propose only applies nothing · (d) Small changes applies only the allowed kinds, each undoable · (e) no Factory start, no person's page written · (f) cost recorded and in spend · (g) apply/undo/not now idempotent, one write each · (h) done never wakes · (i) schema 3→4 migration · (j) conformance for the four methods. Tests:
cmd/codeaf/appworkstreams_wake_test.go,internal/workstream/wakes_test.go,internal/workstream/wake_answer_test.go,internal/session/workstream_wake_test.go,internal/workspace/schema4_test.go, the conformance test.Left out
wake.related_issuesstays stored without behaviour.🤖 Generated with Claude Code