Skip to content

ci(worktree-reaper): test_worktree_reaper.py is run by no workflow — the destructive reap gates are verified nowhere #5946

Closed

Description

@dezren39

ci(worktree-reaper): test_worktree_reaper.py is run by no workflow — the destructive reap gates are verified nowhere

Summary

infra/worktree-reaper/tests/test_worktree_reaper.py (8 tests) is enumerated by no workflow and no other automation: it runs only when a human follows the README's manual command. That suite is the only automated guard on the reaper's safety gates — the checks that must all hold before the tool deletes a worktree (dry-run, kill switch, the reap matrix, the quiet gate, and the run-log audit trail).

Evidence (verified this run, laptop primary @ 2b476fd)

  • grep -rn "worktree-reaper" .github/workflows/ → zero references; no workflow mentions the tool or its tests. No justfile/flake step runs the suite either. The only scheduled runner in the repo is infra/worktree-reaper/systemd/worktree-reaper.{service,timer}, whose ExecStart runs bin/worktree_reaper.py itself (the production reaper) — never its tests.
  • infra/worktree-reaper/README.md, "Tests" section: the sole documented runner is a manual python3 tests/test_worktree_reaper.py, with the note "Run them on the laptop — the occupied gate needs a real /proc" (a Linux CI runner has a real /proc).
  • The suite passes today, run on the laptop: python3 -m unittest discover -s infra/worktree-reaper/tests -v → Ran 8 tests in 0.888s — OK (GateTests ×4, RunLogCollisionTests ×1, UnitTests ×3; the gate tests build synthetic bare-origin/clone/worktree repos in tempdirs).
  • This gap has already bitten once: worktree-reaper: run-log filename collides for same-second runs — gate suite fails 6/6 and a second run overwrites the first run's audit log #5716 — a run-log filename collision that made the gate suite fail 6/6 and silently overwrote a prior run's audit log — was found only because a fleet creator happened to run the suite by hand during an unrelated run. The open worktree-reaper: fail closed when /proc cannot be scanned before removal #5740 (fail closed when /proc cannot be scanned before removal) is in the same gate surface this suite exercises. A regression in the kill switch or reap matrix would currently surface as a wrongly deleted worktree, not a failing check.

Why it matters

The worktree-reaper is a destructive tool running on a timer against the fleet's live worktree farm. Its gates are the entire safety case for unattended deletion, and the tests exist and pass in under a second — but nothing runs them, so gate regressions are discovered in production, after a tree is gone.

Acceptance criteria

  • Some workflow runs infra/worktree-reaper/tests/test_worktree_reaper.py and fails when a test fails (a dispatch-triggered workflow is consistent with the house pattern since 5a94833).
  • The full suite (8 tests) passes under the new wiring on the workflow's Python on a Linux runner (real /proc for the occupied gate).
  • A green run cannot be a silently skipped suite: the wiring names the test file/discovery directory explicitly.
  • No behaviour change to bin/worktree_reaper.py.

Dedup

Searched open + closed issues this run for "worktree-reaper tests / workflow / CI" and "test_worktree_reaper": #5740 (the /proc fail-closed bug, open — a behaviour fix, not CI wiring), #5716 (the run-log collision, closed — found by a hand run of this suite), and no CI-wiring filing for this suite. Sibling same-class filings cover different suites: #5945 (repo-universe), #5942 (fleet-paperwork), #5937 (github-backup).

Activity

  1. added
    kind/ciCI/CD pipelines, workflows, and build automation
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    on Nov 5, 2026
  2. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor
  3. added
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    area/infraInfrastructure, deployment, and operations
    on Nov 5, 2026
  4. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane A, slug new-issue-creator-code-a)
    • Session / ID: cron job new-issue-creator-code-a, run 2026-11-04 22:05 CST
    • Found via: filed this run
    • Task: Wire the worktree-reaper gate suite (test_worktree_reaper.py, 8 tests) into a workflow so the destructive reap gates are verified by automation instead of hand runs.
    • Expectation: effort s; done = a workflow runs the file on a Linux runner, fails on a test failure, and cannot go green on a silently skipped suite.
    • Links: body/evidence in this issue; queue packet enqueued this run to repo-health-code-pilot.
  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 5, 2026
  6. 60 remaining items

  7. removed
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 5, 2026
  8. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  9. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Agent note - handed off

  10. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    Picked up by repo-worker-code-a — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-a posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  11. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    Progress from repo-worker-code-a: claimed: revalidating worktree-reaper CI wiring gap against fresh state

  12. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    Progress from repo-worker-code-a: verified: PR #6357 diff matches acceptance, Codex zero findings on head, pm-stack failure pre-existing on main; running suite on laptop

  13. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    🤖 Agent note · done — PR #6357 merged, suite verified, workflow dispatched

    • Agent: queue worker, lane code-a (repo-worker-code-a), FALLBACK MODE (queue backend down, HTTP 503 PGRST002)
    • Task: ci(worktree-reaper): test_worktree_reaper.py is run by no workflow — the destructive reap gates are verified nowhere #5946 — wire infra/worktree-reaper/tests/test_worktree_reaper.py into a workflow
    • Found: the fix PR already existed — PR ci(worktree-reaper): run safety-gate tests #6357 (queue/9850-5946-worktree-reaper, +68/−0, one new file .github/workflows/worktree-reaper-tests.yml). This lane reviewed and merged it; no competing PR was created.
    • Verification before merge:
      • Diff matches every acceptance criterion: workflow_dispatch trigger (house pattern), Python 3.12 on ubuntu-latest, explicit test dir + file pattern, fails if the file is missing or discovery finds 0 tests, no change to bin/worktree_reaper.py.
      • Suite re-run on the laptop at current main with the workflow's exact command (python3 -m unittest discover -s infra/worktree-reaper/tests -p test_worktree_reaper.py): Ran 8 tests — OK.
      • Workflow YAML parses; jobs = tests; trigger = workflow_dispatch.
      • Codex review on head 787ba58683a0: completed, zero findings (has_any_findings=false, has_unresolved_findings=false).
      • The one red check (pm-stack tests / aggregator suites) is a pre-existing failure on main itself (run 42087275562, 2026-11-05T18:45Z) and on every branch in the window — an unrelated aa-explorer HTML assertion; this PR touches only a new workflow file.
    • Merge: PR ci(worktree-reaper): run safety-gate tests #6357 MERGED at 2026-11-07T04:08:45Z, merge commit 60c3d0a24b962815cf46c4ec070ef4de3e01f96e; this issue auto-closed via Closes #5946.
    • Post-merge proof: dispatched the new workflow on main — run 42337152052 (head 60c3d0a) created and queued (runner backlog fleet-wide this shift); its result lands asynchronously and the suite it runs is the one verified green above.
    • Links: PR ci(worktree-reaper): run safety-gate tests #6357 ci(worktree-reaper): run safety-gate tests #6357 · run https://github.com/developing-today/code/actions/runs/42337152052
  14. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    Released by repo-worker-code-a (outcome: done). Done: reviewed and merged existing fix PR #6357 (worktree-reaper tests workflow, +68/-0, one file) — merge commit 60c3d0a; #5946 auto-closed. Verified: diff meets all acceptance criteria, suite 8 tests OK on laptop with workflow's exact command, YAML valid, Codex zero findings on head; pm-stack red check is pre-existing on main (unrelated). Post-merge dispatch run 42337152052 queued at merge SHA (runner backlog).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/worktree-reaperinfra/worktree-reaperarea/infraInfrastructure, deployment, and operationskind/ciCI/CD pipelines, workflows, and build automationpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions