Skip to content

chore(tasks): number and stack self-targeting task list - #11

Merged
c0d3ster merged 2 commits into
mainfrom
chore/plan-self-target-tasks
Aug 3, 2026
Merged

chore(tasks): number and stack self-targeting task list#11
c0d3ster merged 2 commits into
mainfrom
chore/plan-self-target-tasks

Conversation

@c0d3ster

@c0d3ster c0d3ster commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

Test plan

  • Review TASKS.md numbering, stack groupings, and acceptance criteria for accuracy
  • Confirm docs/nightlight-meta.json's nextTaskNumber (11) is correct for future planning sessions
  • No code changes in this PR — planning-output only, nothing to execute/test

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added a task-tracking guide covering implementation work, verification, research, decision-making, retries, recovery, logging, and archival.
    • Added metadata to track task numbering and completion status.

Assign #1-#10 task numbers and [stack] annotations to TASKS.md's
Agent-Ready/Verify/Research/Decisions items for nightlight's
self-improvement backlog. Introduce docs/nightlight-meta.json with
nextTaskNumber: 11.

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

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@c0d3ster, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d4a0d2e4-08d2-4d21-83c8-246ba5f5fd5f

📥 Commits

Reviewing files that changed from the base of the PR and between 64e6161 and f75cc2c.

📒 Files selected for processing (1)
  • .gitignore
📝 Walkthrough

Walkthrough

Added TASKS.md with implementation, verification, research, and decision queues. Added docs/nightlight-meta.json with task numbering and completion metadata.

Changes

Nightlight task roadmap

Layer / File(s) Summary
Task roadmap and tracking metadata
TASKS.md, docs/nightlight-meta.json
TASKS.md defines execution, recovery, logging, permission, isolation, packaging, and policy tasks. nightlight-meta.json records the next task number and completed or blocked task counts.

Estimated code review effort: 1 (Trivial) | ~5 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 summarizes the main changes: numbering tasks and adding stack annotations to the self-targeting task list.
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 chore/plan-self-target-tasks

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.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@TASKS.md`:
- Around line 48-52: Add [stack: ...] annotations to the checkbox entries for
tasks `#7` and `#8` in TASKS.md, using the same named stack for task `#8` and its
dependency task `#5` so the dependency is represented; if stacking is not
appropriate, document an explicit exemption instead. Preserve the existing task
descriptions and prohibitions.
- Line 19: Update the supervised trial instructions in TASKS.md to require runs
covering two distinct stacks, using two explicit pnpm overnight invocations or
the documented multi-stack syntax. Specify the stack-notes handoff evidence that
must be checked for each stack, while retaining the --limit 2 requirement.
- Around line 21-24: Define the contract for `[/]` tasks before implementation:
specify how housekeeping extracts or stores the associated PR number, which
archive file receives merged tasks, and the exact archive entry format including
the task number, text, PR number, and human-step note. Also state whether and
how `tasksCompleted` and `tasksBlocked` in `docs/nightlight-meta.json` are
updated when a `[/]` task is archived.
- Around line 27-31: Persist whether the interrupted-task retry has already been
consumed, using durable branch or run metadata. Update the session-start orphan
scan to retry matching no-PR branches only when that marker is absent, record
the marker before retrying, and avoid further retries when it is present;
preserve the existing behavior for open PRs and clean orphaned branches.
- Around line 27-31: Update the orphaned-branch scan to query pull requests with
gh pr list --head using the matching task branch name, rather than performing a
repository-wide lookup. Treat matching branches with open or closed-but-unmerged
PRs as safe to leave untouched; only discard and retry branches whose matching
branch has no such PR.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: aca9fe89-fc50-4a26-97e8-993f8acd6e3c

📥 Commits

Reviewing files that changed from the base of the PR and between a570dc0 and 64e6161.

📒 Files selected for processing (2)
  • TASKS.md
  • docs/nightlight-meta.json

Comment thread TASKS.md

Acceptance criteria: per-task dispatch loop in `overnight.sh`; stack-notes created/appended per above; stacked-task prompts read from stack-notes, not raw diffs; housekeeping still runs once at the end of the full loop (optionally folding a completed stack's notes into that day's archive entry).

NEEDS HUMAN: before treating this as default, do a supervised trial run on a low-stakes repo — `--limit 2` across at least two different stacks (e.g. `pnpm overnight <repo> --limit 2 --stack <name>`) — confirming dispatch and stack-notes handoff work as intended. Don't skip this trial.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make the supervised trial cover two stacks.

The requirement says “across at least two different stacks,” but the procedure shows one --stack <name> invocation. Define two explicit invocations or the supported multi-stack syntax. State the stack-notes evidence to verify. Otherwise, a one-stack run can satisfy the procedure without testing cross-stack handoff.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@TASKS.md` at line 19, Update the supervised trial instructions in TASKS.md to
require runs covering two distinct stacks, using two explicit pnpm overnight
invocations or the documented multi-stack syntax. Specify the stack-notes
handoff evidence that must be checked for each stack, while retaining the
--limit 2 requirement.

Comment thread TASKS.md
Comment on lines +21 to +24
- [ ] #9 [stack: core-loop] **Add TASKS.md status glyphs and auto-archive NEEDS HUMAN tasks on PR merge**
Right now blocked and NEEDS HUMAN tasks are only distinguishable by reading each line's free-text annotation, and NEEDS HUMAN tasks stay in TASKS.md indefinitely with no defined path back to archive once you've completed the manual step and merged the PR. Replace `- [ ]` with distinct glyphs written only by housekeeping (preserving its single-writer role): `[!]` for blocked, `[/]` for NEEDS HUMAN. Each housekeeping run also checks every `[/]`-annotated task's PR merge state (`gh pr view <PR> --json state,mergedAt`); if merged, archive it as completed (task number, text, PR number, note that it required a human step) and remove it from TASKS.md — no manual edit required from you beyond merging the PR.

Acceptance criteria: CLAUDE.md's "Section semantics" and "TASKS.md maintenance" sections document `[ ]`/`[!]`/`[/]` semantics; housekeeping sets `[!]`/`[/]` when annotating blocked/NEEDS HUMAN tasks; housekeeping checks merge state of every `[/]` task's PR each run and auto-archives any now-merged ones.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Define the [/] task PR and archive contract.

The task does not define where housekeeping gets <PR> from. It also does not define the archive file, entry format, or whether tasksCompleted and tasksBlocked in docs/nightlight-meta.json must change. Specify these contracts before implementation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@TASKS.md` around lines 21 - 24, Define the contract for `[/]` tasks before
implementation: specify how housekeeping extracts or stores the associated PR
number, which archive file receives merged tasks, and the exact archive entry
format including the task number, text, PR number, and human-step note. Also
state whether and how `tasksCompleted` and `tasksBlocked` in
`docs/nightlight-meta.json` are updated when a `[/]` task is archived.

Comment thread TASKS.md
Comment on lines +27 to +31
Once tasks run as separate subprocesses (see task #2), a session interrupted mid-task (window closed, machine slept) needs to be detected on the next run without writing anything to TASKS.md mid-session, since only housekeeping may write there. Give each task branch's first commit a `Task: #<n>` trailer. At the start of a session, scan local branches for that trailer against every currently-open (`[ ]`) task; if a matching branch exists with no open PR (`gh pr list`), housekeeping never ran for it — treat it as an interrupted attempt: discard the branch and retry the task once from a clean state, per task #1's retry-once rule. If a matching branch has an open PR, leave it alone; that's just "done, housekeeping hasn't run yet," not interrupted.

Note: this reuses task #1's retry-once behavior, which lives in a different (solo) stack. If #1 hasn't merged to main by the time this task is reached, treat that as a cross-stack dependency per existing rules (stop, annotate blocked, move on) rather than reimplementing the rule inline.

Acceptance criteria: task branches' first commit includes a `Task: #<n>` trailer; session start includes a scan step that identifies orphaned branches (matching trailer, no open PR) for open tasks; orphaned branches are discarded and their task retried once from a clean state; branches with an open PR are left untouched. Depends on task #2.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Persist the one-retry budget.

A matching branch with no PR identifies an orphaned attempt, but it does not identify whether the allowed retry was already used. If the retry is interrupted before a PR opens, the next session will see the same condition and retry indefinitely. Store a durable retry marker in branch metadata or run metadata, and include it in the scan rules.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@TASKS.md` around lines 27 - 31, Persist whether the interrupted-task retry
has already been consumed, using durable branch or run metadata. Update the
session-start orphan scan to retry matching no-PR branches only when that marker
is absent, record the marker before retrying, and avoid further retries when it
is present; preserve the existing behavior for open PRs and clean orphaned
branches.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Files matching TASKS.md:\n'
fd -a '^TASKS\.md$' . || true

printf '\nRelevant TASKS.md lines:\n'
if [ -f TASKS.md ]; then
  nl -ba TASKS.md | sed -n '1,80p'
else
  TASK_FILE="$(fd '^TASKS\.md$' . | head -n1 || true)"
  if [ -n "${TASK_FILE:-}" ]; then nl -ba "$TASK_FILE" | sed -n '1,80p'; fi
fi

printf '\nSearch for gh pr list / Task trailer / housekeeping terms:\n'
rg -n "gh pr list|Task: #|housekeeping|retry-once|interrupted|orphan|clean state" -S . || true

Repository: c0d3ster/nightlight

Length of output: 276


🌐 Web query:

GitHub CLI gh pr list head branch option state open closed merged

💡 Result:

The GitHub CLI (gh) command gh pr list provides options to filter pull requests by state and head branch, among other criteria [1][2]. State Filtering You can filter pull requests by their state using the --state flag [1]. The available states are open, closed, merged, or all [1][2]. By default, gh pr list only returns open pull requests [1][2]. Example: gh pr list --state merged Head Branch Filtering You can filter pull requests by the head branch name using the --head flag [1]. Usage: gh pr list --head "branch-name" Important considerations for the --head flag: - Syntax: It does not support the "owner:branch" (or "owner:ref") qualified syntax [1][3][4]. It expects only the branch name [1][4]. - Matching: The --head flag performs an exact match on the branch name [5]. Alternative Searching If you need more flexible matching (such as fuzzy matching or using the "owner:branch" syntax), you can use the --search flag to leverage GitHub's PR search query syntax [2][5]. Example: gh pr list --search "head:my-branch-name" For more advanced requirements, such as filtering for multiple branches or specific criteria not covered by these flags, you can retrieve the data in JSON format and filter it locally using tools like jq [1][5]: gh pr list --json number,headRefName --jq 'map(select(.headRefName == "branch-name"))'

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'TASKS.md line 20-40:\n'
awk 'NR>=20 && NR<=40 {printf "%6d\t%s\n", NR, $0}' TASKS.md

printf '\nDetailed references to PR lookup and branch handling:\n'
grep -nE "gh pr list|Task: #[0-9]+|interrupted|housekeeping|retry-once|orphan|branch" TASKS.md || true

Repository: c0d3ster/nightlight

Length of output: 8572


Scope the PR lookup to the matching task branch.

gh pr list has no head-branch option; a bare query can map a matching branch to another work-in-progress PR and delete local task work. Use gh pr list --head <branch-name> for the matching task branch, and include closed but unmerged states as safe branches to leave alone before treating a branch as an orphaned interrupted attempt.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@TASKS.md` around lines 27 - 31, Update the orphaned-branch scan to query pull
requests with gh pr list --head using the matching task branch name, rather than
performing a repository-wide lookup. Treat matching branches with open or
closed-but-unmerged PRs as safe to leave untouched; only discard and retry
branches whose matching branch has no such PR.

Comment thread TASKS.md
Comment on lines +48 to +52
- [ ] #7 **Resolve whether nightlight needs npm/package distribution at all**
This blocks further naming work. nightlight is used only by us, across repos we own — it isn't something anyone else installs. Options on the table: skip packaging entirely and keep nightlight as files in a personal dotfiles-style repo (current de facto state); package it as a Claude Code plugin/skill for "install once, use everywhere" convenience across machines; or proceed with an npm package under a scoped name (`@c0d3ster/nightlight` or similar) despite the unscoped name being taken. Requires your input — not an agent judgment call.

- [ ] #8 **Decide whether to layer `--permission-mode auto` under the existing allowlist, or hold at `acceptEdits`**
Depends on the Verify task above confirming eligibility. If eligible, decide whether to add `auto` mode as an additional safety layer underneath the existing `.claude/settings.json` allow/deny list, or hold at current `acceptEdits` behavior. Note: do not adopt a `bypassPermissions`-style fallback under any circumstance — if `auto` isn't available, staying on `acceptEdits` plus the explicit list is the safer posture.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Add stack annotations to the Decision tasks.

The repository workflow contract requires every checkbox line to have a [stack: ...] annotation. Tasks #7 and #8 omit this annotation. Task #8 also depends on task #5, but task #5 is marked [stack: solo]; this does not encode the dependency. Add stack tags and use the same named stack for dependent tasks, or document an explicit exemption.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@TASKS.md` around lines 48 - 52, Add [stack: ...] annotations to the checkbox
entries for tasks `#7` and `#8` in TASKS.md, using the same named stack for task `#8`
and its dependency task `#5` so the dependency is represented; if stacking is not
appropriate, document an explicit exemption instead. Preserve the existing task
descriptions and prohibitions.

@c0d3ster
c0d3ster merged commit 77f8fb4 into main Aug 3, 2026
1 check passed
@c0d3ster
c0d3ster deleted the chore/plan-self-target-tasks branch August 3, 2026 05:33
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>
@coderabbitai coderabbitai Bot mentioned this pull request Aug 8, 2026
2 tasks
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