-
Notifications
You must be signed in to change notification settings - Fork 4
task-observer: new docs/ai/long-running-workstreams from 2026-06-26 #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
divad12
wants to merge
1
commit into
master
Choose a base branch
from
task-observer/long-running-workstreams-2026-06-26
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| > **IMPORTANT: Before reading, check if you already read this file earlier in this session. If yes, skip the read and announce "Context already loaded: long-running-workstreams.md (re-using from earlier)". If no, read it and announce "Context loaded: long-running-workstreams.md".** | ||
|
|
||
| # Long-Running Workstreams | ||
|
|
||
| Read this when managing a multi-hour or multi-session autonomous workstream where the agent must resume after compaction or hand off context across runs. | ||
|
|
||
| ## Contract | ||
|
|
||
| - Maintain a `scratch.md` control surface alongside any evidence or triage files. Evidence explains what happened; scratch state tells the next agent what to do without rediscovering the whole thread. | ||
| - Keep the "Current Truth" section current and sharp. Archaeology grows below it and stays compressed. | ||
| - Apply compaction-time maintenance every time context is compacted or a session resumes: update "Current Truth", move completed next-steps into a short archaeology entry, delete detail now covered by links or evidence files, and compact the top section before continuing. | ||
| - Do not let the scratch file grow into a second transcript. Garbage-collect it on every re-read after compaction. | ||
|
|
||
| ## Scratch File Structure | ||
|
|
||
| Use this shape for `scratch.md`: | ||
|
|
||
| ``` | ||
| ## Current Truth (update at every compaction) | ||
| <3-5 line summary of the actual state right now> | ||
|
|
||
| ## Next Steps | ||
| - [ ] <next immediate action> | ||
| - [ ] <next queued action> | ||
|
|
||
| ## Archaeology | ||
| ### <YYYY-MM-DD> - <brief session note> | ||
| <single short paragraph; delete detail covered by evidence files or issue trackers> | ||
| ``` | ||
|
|
||
| Keep "Current Truth" and "Next Steps" together at the top; archaeology grows at the bottom. If "Next Steps" is empty, the workstream is done. | ||
|
|
||
| ## Canonical Files | ||
|
|
||
| - `docs/specs/<feature>/scratch.md` — primary control surface for a feature workstream. | ||
| - Separate evidence files (`triage.md`, `shakedown-log.md`, run artifacts) hold full detail; scratch summarizes. | ||
|
|
||
| ## Verification | ||
|
|
||
| After any compaction or resume, check that "Current Truth" reflects the actual current state, not an earlier snapshot. A stale "Current Truth" is the sign that the compaction maintenance step was skipped. | ||
|
|
||
| ## Notes | ||
|
|
||
| - Do not write the same content to both scratch.md and evidence files. Scratch summarizes; evidence files contain full detail. | ||
| - This pattern is most valuable for: shakedown loops, experiment queues, autonomous workstreams, and any session expected to compact at least once. | ||
| - If the workstream has a living triage file, keep them separate: triage captures what was found; scratch captures what to do next. | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a long-running session resumes after
/compact, this banner tells the agent to skip re-reading the file if it knows it was loaded earlier in the same session, but the contract below is specifically needed after compaction/resume and even expects garbage-collection on every re-read after compaction. In that scenario the agent can miss the Current Truth/Next Steps cleanup and continue from stale scratch state; add a compaction/resume exception to the skip rule.Useful? React with 👍 / 👎.