Skip to content

Review jam: reviewer bee as a service, merger that reads the bee's discounted checks, publisher heading that passes check #5776

Closed

Description

@gHashTag

Problem (measured 2026-10-03)

The review column on the Queen kanban does not drain.

  • auto-merge-ready-prs.yml merged 0 pull requests since 2026-09-20; all 300 merges in that window were by hand.
  • Its gate demands every check green. Advisory checks are red on nearly every pull request, and spec-guards is red on master itself, so that gate can never pass.
  • It is also cron-only: an approval waits up to an hour.
  • The reviewer bee (Reviewer bees approve under their own bot identity (t27-bees GitHub App) #5547, t27-bees[bot]) exists only as a session someone remembers to start.
  • Every pull request tools/queen/publish.py opens fails the required-by-convention check job. It writes # NOW -- <title> (published YYYY-MM-DD), and tools/check_now_entry_shape.py requires the heading to end in (YYYY-MM-DD). So a correct reviewer must refuse every queen pull request.

Change

  1. tools/bees/reviewer.py runs the reviewer bee as a launchd service.
    • The runner gathers the facts: the selection, the required checks from the ruleset, and each red check's failing step, log tail and conclusion on master.
    • A sandboxed claude -p (--restricted --safe-mode --tools Read,Grep,Glob, no token in its environment) judges the pull request.
    • The runner validates the verdict, re-reads the head, then approves and labels as t27-bees[bot].
    • It runs several reviews at a time.
  2. In auto-merge-ready-prs.yml, a red check passes only when all three hold: it is not required by the ruleset, it has concluded, and the bot's approval of that head carries discounted-check: <name> -- <why>. Required checks must be present and green. An unreadable ruleset fails closed.
  3. The merger also runs on pull_request_target: labeled (bee-reviewed), so the bot's label merges at once. The cron stays as the backstop.
  4. The publisher writes # NOW -- Published: <title> (YYYY-MM-DD). Its self-test runs the real check_now_entry_shape.check_entry on that entry, so the rule is not copied.

Original checks (kept for history; the Queen does not run these)

    1. python3 tools/bees/reviewer.py self-test prints self-test: 0 failure(s)
    1. python3 tools/bees/merger_gate_selftest.py prints merger gate self-test: 0 failure(s) of 26
    1. the same self-test with MERGER_WORKFLOW pointing at master's copy of the workflow reports 4 failures (negative control: discounted red check, StatusContext, own run, required check never posted)
    1. python3 tools/queen/publish.py --self-test prints ok: 26 shapes, and with the old heading restored it fails on "the entry this writes passes the check gate"
    1. python3 tools/bees/reviewer.py run --dry-run --pr N on an open queen pull request writes a verdict and posts nothing

Original file list

  • tools/bees/merger_gate_selftest.py
  • tools/bees/reviewer.py
  • tools/check_now_entry_shape.py
  • tools/queen/publish.py

Queen-runnable restatement (2026-10-05)

Items 1-3 are Python and workflow YAML (open PR #5777), which the only-t27 rule refuses without the owner's label; item 4 is moot because master removed the NOW gate (0d5424b). The part a bee can do in t27 is to state the merger's discounted-check rule as a spec with tests, so the rule lives in one place.

Boundary

  • specs/queen/merger_gate.t27

User Scenarios & Testing

  • Given master, where no spec states when a red check may be discounted, when the rule spec lands, then its tests state that a red check passes only when it is not required, has concluded, and the bot's approval of that head names it in discounted-check:, and that an unreadable ruleset fails closed.

Requirements

  • FR-001: specs/queen/merger_gate.t27 MUST declare fn red_check_passes(required: bool, concluded: bool, discounted: bool) -> bool (true only when not required, concluded and discounted) and fn required_check_passes(posted: bool, green: bool) -> bool and fn gate_open(ruleset_readable: bool, all_checks_pass: bool) -> bool (false whenever the ruleset is unreadable).
  • FR-002: The change MUST NOT add or modify non-t27 hand-written code (specs/policy/own_language.t27).
  • FR-003: Tests MUST include the four negative controls named in the issue: a discounted required check, an unconcluded check, a required check never posted, an unreadable ruleset; plus one positive case, so the spec holds at least 5 tests.

Success Criteria

  • grep -cE 'fn (red_check_passes|required_check_passes|gate_open)' specs/queen/merger_gate.t27 prints 3
  • grep -cE '^[[:space:]]*test ' specs/queen/merger_gate.t27 prints at least 5
  • t27c test-report specs/queen/merger_gate.t27 2>&1 | grep -cE '^ (FAIL +0|pass +[1-9][0-9]*)$' prints 2

Activity

  1. 44 remaining items

  2. gHashTag commented on Oct 4, 2026

    @gHashTag
    OwnerAuthor

    Review Warden, round 2026-10-04T16:41Z (method: .claude/agents/review-warden.md on #6089)

    Moved

    Red

    Needs the owner

    1. The escalation reason for tri review-log: a health card from a window of the reviewer bee's own log (scripts/tri_loop/review_log.py) #6086 on /queen/needs-you.
    2. bees/merger/publisher: reviewer bee as a service, merger reads discounted checks, publisher heading passes check (Closes #5776) #5777: resolve the conflict and give the pinned-origin confirmation. Move the reviewer bee from the workstation's launchd to a Railway service #6117 (move to Railway) waits on this. Move the reviewer bee from the workstation's launchd to a Railway service #6117 is skipped by the Queen for having no Boundary, which is expected because it is an owner-items issue.
    3. Optional: ~/.config/review-warden/queen-report.token, if these reports should also go to the Queen's board.
  3. gHashTag commented on Oct 4, 2026

    @gHashTag
    OwnerAuthor

    Review Warden, round 2026-10-04T18:40Z (method: .claude/agents/review-warden.md on master)

    Moved

    Red

    Needs the owner

    1. bees/merger/publisher: reviewer bee as a service, merger reads discounted checks, publisher heading passes check (Closes #5776) #5777: resolve the conflict and the pinned-origin confirmation. Every reviewer-bee fix above lives in tools/bees/reviewer.py, which is not on master, so the Queen cannot take it as a task.
    2. The tri review-log: a health card from a window of the reviewer bee's own log (scripts/tri_loop/review_log.py) #6086 escalation reason on /queen/needs-you (a guarded route I do not read), still open from 16:01Z.

    No new Queen tasks this round (0 of 2). Queen board report skipped: no ~/.config/review-warden/queen-report.token.

  4. gHashTag commented on Oct 4, 2026

    @gHashTag
    OwnerAuthor

    Review Warden, round 2026-10-04T20:40Z

    Moved

    Red

    Needs the owner

    No new Queen tasks this round. Queen board report skipped: no token file at ~/.config/review-warden/queen-report.token.

  5. added a commit that references this issue on Oct 6, 2026
    36a393b
  6. added a commit that references this issue on Oct 6, 2026
    fd9c918
  7. gHashTag commented on Oct 6, 2026

    @gHashTag
    OwnerAuthor

    Finding from the #6657 merge-jam work (2026-10-06 ~14:40Z), for the reviewer's blame() / Facts.on_base:

    on_base(name) reads the check on the newest base commit that ran it. A pull_request run, and any re-run of it, is pinned to the merge commit made when the run started, so its first parent is the master of that moment, not today's.

    The case it gets wrong is about to happen: spec-guards is red on master (ring-096 DRIFTED) and on 116 of 136 open bee PRs. #5921 fixes master. Once it merges, master's newest spec-guards is green, so every one of those 116 stale reds will be classified "PR-caused (green on master)", although none of the PRs touches ring-096.

    Proposed change, deterministic and with no model call: classify against the first parent of the run's merge commit (the run's head_sha on refs/pull/N/merge), falling back to the newest base commit only when that commit has no run of the check. A red that was red on the master it merged onto is master-caused, whatever master did since.

    Until then I am updating the affected bee branches in small batches after #5921 lands, so their checks re-run against the fixed master.

    🤖 Generated with Claude Code

  8. added
    owner-approved-foreignOwner-approved exception to the only-t27 rule: hand-written foreign code allowed in this PR
    on Oct 6, 2026
  9. added 3 commits that reference this issue on Oct 7, 2026
    5913764
    0a264c0
    5abee84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    owner-approved-foreignOwner-approved exception to the only-t27 rule: hand-written foreign code allowed in this PR

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions