Skip to content

docs: document overnight session behavior and live monitoring - #2

Merged
c0d3ster merged 1 commit into
mainfrom
docs/document-runner-behavior
Aug 1, 2026
Merged

docs: document overnight session behavior and live monitoring#2
c0d3ster merged 1 commit into
mainfrom
docs/document-runner-behavior

Conversation

@c0d3ster

@c0d3ster c0d3ster commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Document that overnight sessions run continuously through all Agent-Ready/Verify/Research items and don't pause between tasks
  • Clarify that same-stack tasks build on each other's branch tip immediately, without waiting for human review, and that NEEDS HUMAN doesn't pause a stack
  • Clarify blocked is reserved for cross-stack dependencies, not same-stack ordering
  • Note that logs/<repo>-<date>.log is teed live, so tail -f plus watching for gh pr create lines is how to monitor a session in progress and know when a task is ready to check

Test plan

  • N/A — docs only

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added guidance on live log monitoring and pull request creation timing during overnight runs.
    • Clarified that tasks continue without pausing, later stacked tasks proceed without waiting for review, and blocked applies only to cross-stack dependencies.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f1dd3e8-257c-47b9-aa00-06feae89902b

📥 Commits

Reviewing files that changed from the base of the PR and between 03631ba and 1b24ce6.

📒 Files selected for processing (1)
  • README.md

📝 Walkthrough

Walkthrough

The README now documents live log monitoring, per-task pull request timing, continuous overnight execution, same-stack branch progression without review gates, and the use of blocked for cross-stack dependencies.

Changes

Overnight run documentation

Layer / File(s) Summary
Document overnight run behavior
README.md
Usage notes describe log tailing, per-task pull request availability, continuous execution, same-stack progression, and cross-stack blocked dependencies.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the README changes for overnight session behavior and live monitoring.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/document-runner-behavior

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@c0d3ster
c0d3ster merged commit 1261337 into main Aug 1, 2026
1 check passed
c0d3ster added a commit that referenced this pull request Aug 6, 2026
- #11 [stack: solo] Make DB schema/migration generation NEEDS HUMAN
- Amend #2's NEEDS HUMAN trial to require a cache-read cost comparison
  against the 2026-08-06 baseline before adopting split-per-task as default
- nextTaskNumber -> 12 (only #11 was formally assigned here; the
  out-of-band format-stream.jq log fix, PR #21, was never written into
  TASKS.md under a number, so it never consumed one)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
c0d3ster added a commit that referenced this pull request Aug 6, 2026
- #11 [stack: solo] Make DB schema/migration generation NEEDS HUMAN
- Amend #2's NEEDS HUMAN trial to require a cache-read cost comparison
  against the 2026-08-06 baseline before adopting split-per-task as default
- nextTaskNumber -> 12 (only #11 was formally assigned here; the
  out-of-band format-stream.jq log fix, PR #21, was never written into
  TASKS.md under a number, so it never consumed one)

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
c0d3ster added a commit that referenced this pull request Aug 7, 2026
- split_tasks(): an untagged leading task (no [stack: x], no predecessor
  in file order) now defaults to "solo" instead of an empty stack name,
  which previously produced "This task starts stack \"\"" prompts and a
  docs/stack-notes/.md path.
- dispatch(): capture claude's own exit status via PIPESTATUS[0] instead
  of the trailing tee's, and return it. run_repo's task loop now aborts
  the repo's run after 2 consecutive dispatch failures instead of
  ploughing through every remaining task the same way (e.g. an auth
  error or a missing format-stream.jq); the override-prompt and
  housekeeping call sites surface a warning on failure too.
- Anchor the TASK_RESULT branch= extraction to the structured field
  (^TASK_RESULT: #<n> status=... branch=...) instead of a greedy match
  that could pick up a literal "branch=" inside the free-form note
  field, and verify the reported branch actually exists locally before
  recording it as a stack's next base.
- Document Bash 4.3+ as a requirement (local -n namerefs, local -A
  associative arrays) and switch every script's shebang to
  /usr/bin/env bash.
- README: correct stack-notes ownership -- the task subprocess creates
  and appends its own entry, overnight.sh only reads it.

Task #2.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
c0d3ster added a commit that referenced this pull request Aug 7, 2026
- Record the second failed dispatch's stats (update_stats) before
  aborting on 2 consecutive failures, not just discarding it.
- Anchor TASK_RESULT validation to the current task's own #<n> before
  trusting it for run_summary or a stack's next base branch, instead of
  accepting any TASK_RESULT line regardless of which task number it
  names -- a stale or malformed one now falls back to the same
  synthesized status=unknown line a missing TASK_RESULT would produce.

Task #2.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
c0d3ster added a commit that referenced this pull request Aug 7, 2026
* feat: fresh-subprocess-per-task execution model for overnight.sh

Task #2. overnight.sh previously ran one continuous claude -p session
across a whole repo's TASKS.md, so context (and cache-read cost)
compounded across every task in a run -- confirmed against the
2026-08-06 c0d3ster run that hit its usage limit at 42.8M cache-read
tokens / $16.61 after just 2 tasks in one session.

Restructures the loop in overnight.sh to dispatch one fresh claude -p
subprocess per open task, plus one more for end-of-run housekeeping:

- split_tasks() parses TASKS.md's Agent-Ready/Verify/Research sections
  into per-task blocks, computing each task's effective stack (own tag
  or inherited) so --stack/--stop-after/--limit can filter in bash
  before any subprocess launches, instead of asking a mega-session to
  self-filter.
- Stacked tasks read predecessor context from docs/stack-notes/<stack>.md
  in the target repo (append-only, one entry per task: decisions,
  interfaces/exports, deviations, and its own branch name) instead of a
  raw diff/commit dump. resolve_base_branch() resolves which branch a
  task builds on -- the stack's latest branch this run, or the last
  Branch: line in stack-notes when resuming a stack from an earlier run.
- Each task subprocess reports a TASK_RESULT: #<n> status=... line at
  the end of its final message; overnight.sh collects these across the
  run and feeds them to the housekeeping subprocess as its starting
  point (housekeeping still confirms real PR/branch state via git/gh
  before trusting it).
- --override-prompt now explicitly bypasses the dispatch loop for a
  single one-off session, same as before.
- logs/ keeps its existing per-repo-per-day file layout (task #4 owns
  splitting those further); stats/<repo>.json now also tracks
  cache_read/cache_creation token totals, needed to judge whether this
  actually keeps cache-read volume down per the task's NEEDS HUMAN gate.

CLAUDE.md and README.md updated to document the new execution model,
the stack-notes/TASK_RESULT contracts, and updated stats.sh's rollup
to match.

NEEDS HUMAN: this needs the supervised trial run specified in task #2's
acceptance criteria before it's adopted as default -- a --limit 2 run
on a low-stakes repo across at least two different stacks, comparing
total_cache_read_tokens in stats/<repo>.json against the 42.8M baseline
above. Don't skip it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix: address CodeRabbit review findings on PR #24

- split_tasks(): an untagged leading task (no [stack: x], no predecessor
  in file order) now defaults to "solo" instead of an empty stack name,
  which previously produced "This task starts stack \"\"" prompts and a
  docs/stack-notes/.md path.
- dispatch(): capture claude's own exit status via PIPESTATUS[0] instead
  of the trailing tee's, and return it. run_repo's task loop now aborts
  the repo's run after 2 consecutive dispatch failures instead of
  ploughing through every remaining task the same way (e.g. an auth
  error or a missing format-stream.jq); the override-prompt and
  housekeeping call sites surface a warning on failure too.
- Anchor the TASK_RESULT branch= extraction to the structured field
  (^TASK_RESULT: #<n> status=... branch=...) instead of a greedy match
  that could pick up a literal "branch=" inside the free-form note
  field, and verify the reported branch actually exists locally before
  recording it as a stack's next base.
- Document Bash 4.3+ as a requirement (local -n namerefs, local -A
  associative arrays) and switch every script's shebang to
  /usr/bin/env bash.
- README: correct stack-notes ownership -- the task subprocess creates
  and appends its own entry, overnight.sh only reads it.

Task #2.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix: address second round of CodeRabbit findings on PR #24

- Record the second failed dispatch's stats (update_stats) before
  aborting on 2 consecutive failures, not just discarding it.
- Anchor TASK_RESULT validation to the current task's own #<n> before
  trusting it for run_summary or a stack's next base branch, instead of
  accepting any TASK_RESULT line regardless of which task number it
  names -- a stale or malformed one now falls back to the same
  synthesized status=unknown line a missing TASK_RESULT would produce.

Task #2.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
c0d3ster added a commit that referenced this pull request Aug 8, 2026
- Archive #2 (fresh-subprocess-per-task execution model, PR #24) as
  complete; NEEDS HUMAN cache-read comparison trial ongoing outside
  TASKS.md tracking, see archive note
- Add #12 [stack: solo], bundling four turn/cache-read efficiency
  findings from the c0d3ster cost audit, placed at the top of
  Agent-Ready
- #1 confirmed not implemented, left open and untouched
- nextTaskNumber 12 -> 13, tasksCompleted 0 -> 1

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant