Repository navigation
feat(loop): adversarial review rung, reviewer profile, and a learning reflect - #32
Merged
Merged
Conversation
…er profile A critic-side pass on loop-authored PRs, distinct in kind from finalize-pr's author-side six-lens review: that pass asks "is this code good", this one asks "should this PR exist in this shape". Two lenses carry the weight - simplicity and scope measured against the linked ticket, and cross-repo contract surfaces read from the consumer side - because those are what the human reviewer's own history shows they care about most. The skill is holistic on purpose. Its only criteria are a short stance and the sibling reviewer-profile.md, a model of how Ardnived actually reviews, seeded from the full backfilled history of their review activity across the five repos (55 inline comments, 32 reviews, 33 PR comments). The profile is data, not a checklist: the Sunday reflect rung refines it on recurring evidence, so the review learns the reviewer's intent rather than accumulating DO/DONTs. Reviews are always COMMENT-event (GitHub forbids stronger self-reviews, and approval authority stays with the reviewer), always in a fresh context (the skill carries context:fork, and rung 5 spawns it in a clean subagent - a critic that inherits the builder's reasoning inherits its blind spots), and once ever per PR. No Edit or Write in allowed-tools: a critic with a keyboard is an author. The failure this prevents: every loop PR today waits on the reviewer for its first genuinely critical read, so scope creep and contract breaks are found at the most expensive moment - by the human, at approval time. Co-Authored-By: Claude Fable 5 <[email protected]>
New last-priority rung in loop runs, renumbering Survey 5->6 and Journal 6->7. It spends only leftover maxWorkItemsPerRun budget - no reserved slot, no new ceiling - so on a saturated day it starves, and that is the design: every rung above it serves the reviewer more directly, and a pre-filter is worth exactly the budget nothing else claimed. Worklist is one server-side query (is:pr author:<bot> -reviewed-by:<bot>, green CI by rung 1's definition), prioritising PRs already handed to the reviewer over bot-assigned ones, deferring PRs mid-revision. One review per PR ever, keyed on an own-login review read from get_reviews just before writing - search is a derived index and lags. Each review runs in a fresh Task subagent handed only the PR's coordinates, never inline: the review must not share the implementer's context. Rung 2 gains the author filter's one exception, keyed structurally rather than by marker string: an unresolved review thread whose root comment is the own login can only be the adversarial review, because starting review threads is rung 5's exclusive privilege - bot replies inside a human's thread keep a human root and stay excluded. The review block in loop-config carries the body header (the fallback-only idempotency key) and the profile path. Stories for all six new rules live in docs/why.md; README and routine-setup pick up the renumbering and the new supervised-bootstrap case. Co-Authored-By: Claude Fable 5 <[email protected]>
…e, reach product repos Reflect's friction table has always carried "the same review comment recurring" as a signal, but nothing in its Evidence section could produce that observation - it never read review-comment text at all. Now it does: one reviewed-by:<reviewer> query over the window (previous reflection PR's merge date, else seven days), then the review bodies and inline comments, read as text rather than counted. Three new signal rows close the review-rung feedback circuit: a reviewer theme recurring across 2+ PRs, a substantive catch on a PR the adversarial review passed clean (a profile gap), and bot findings the reviewer overrode (over-flagging - trim the profile, not the code). Profile edits are gated on recurrence and written at the level of intent, not incident: the question is what value made the reviewer write those comments, so the review generalises to cases the week never showed. One comment is weather. Lessons that belong to a product repo follow the evidence out: small doc and CLAUDE.md corrections as direct ticketless PRs (their allowlists already cover **/*.md; never under .claude/, which stalls unattended runs), anything structural as a proposal issue under the existing ceiling. Also fixes the hard-coded repo:sydevs/claude-workflow journal query - org and repo now come from loop-config like everywhere else - and states the skill-vs-ceiling PR split as a hard rule reflect itself must honour. Co-Authored-By: Claude Fable 5 <[email protected]>
… review The trigger pattern covered SKILL.md alone, but sibling files are instruction surfaces too: the new reviewer-profile.md steers what the adversarial review flags and ignores, and pr-template.md shapes every PR body. An injection into either reaches an agent holding write access to five repos just as surely as one into a SKILL.md. Widened workflow/skills/<name>/SKILL.md to workflow/skills/<name>/<any>.md. Co-Authored-By: Claude Fable 5 <[email protected]>
Ardnived
added a commit
that referenced
this pull request
Sep 2, 2026
Both sides were largely additive; four files conflicted and three of the resolutions were judgement calls worth recording. **The CI-green rule now has one home.** #28 landed the same fix as this branch, as prose, with its own `why.md` anchor — so main and this branch each carried a statement of what "green" means, plus `merge-gate.mjs` implementing it. Deleted my anchor in favour of main's `#ci-truth-lives-in-check-runs`, which is the better write-up (it also reasons about `skipped`/`neutral` and about why the mirror-image status clause is deliberately absent), repointed the citations, and cut rung 1's restatement down to a pointer at the script. The implementation was checked against main's prose clause by clause: they agree. **Kept #32's `review` block, dropped its essay.** A four-sentence `$comment` explaining the fallback idempotency key is a rule, and rules live in the skill that enforces it — `adversarial-review/SKILL.md` already says all of it. **Fixed a bug #32 inherited rather than introduced.** Its rung-5 census, its proposal-ceiling check, its dropped-baton sweep and reflect's new review query all scope `org:$ORG`. The org still holds retired repositories, and that scope put seven-year-old Atlas and WeMeditate issues into the reviewer's queue the first time it was run as a real query. Every search in both skills now uses `$SCOPE`, built from `repos`, and the rule is stated once at rung 0. **Rung 5 no longer restates the green rule or hardcodes a repo fact.** It said "claude-workflow is the one exception: it has no CI" — which `merge-gate.mjs` derives from the workflow count, so it cannot go stale the day someone adds a workflow. Two more things this pass found, neither from #32: - The journal body still carried a `## This month` table from the era of monthly journal issues. The journal has been one issue per day since the baton work; a day's body cannot summarise a month, and the Sunday reflect rung is what reads across issues. - The awaiting-you table went into the per-run comment while the BODY — the surface the reviewer actually reads, and the one the rules single out as "never leave stale" — kept bullets. Both are tables now. `identity.mentionQuery` removed: nothing reads it since rung 0 spells the query out, and a config key no code reads is exactly what the values-only rule exists to prevent. Co-Authored-By: Claude Opus 5 <[email protected]>
Ardnived
added a commit
that referenced
this pull request
Sep 2, 2026
Same audit as loop-config.json, applied to the five `.claude/workflow.json` files. Every key was checked against what actually reads it: the hooks read `packageManager` and `generatedFiles`; the skills read `leanGate`, `securityReview`, `prAllowlistGlobs`, `devServer`, `worktreeSetup`, `contractStep` and `deployTarget`. Nothing read any `*Note` key. Dropped, all five repos: `prAllowlistNote` — a restatement of a rule `implement-issue` already carries. Plus, in claude-workflow, `packageManagerNote`, `selfModificationNote` and `journalNote`, each of which duplicates a section of AGENTS.md, and in SahajCloud `worktreeSetupNote`, whose story is in `docs/rules/testing-reqs.md`. **The duplication had already gone wrong.** `approved` was renamed to `ready-to-implement` some time ago; four repos' `prAllowlistNote` were updated and SahajCloud's was not, so it has been describing a label that does not exist. That is the whole argument for values-only, in one key. AGENTS.md carried "`selfModificationNote` states the same rule; keep the two in agreement if you change either" — an instruction to maintain a copy by hand, in the repo whose failure history is copies drifting. The copy is gone. `worktreeNotes` stays. It is one line of per-repo operational fact (which env file a fresh worktree needs), it qualifies the `worktreeSetup` value it sits beside, and two of the three repos document it nowhere else — a bare value that is ambiguous on sight is exactly what a one-line comment is for. claude-workflow's securityReview rationale, three sentences after #32, is back to one. Co-authored-by: Claude Opus 5 <[email protected]>
Ardnived
added a commit
that referenced
this pull request
Sep 2, 2026
…ne over shared bookends (#35) * refactor(loop): rung means one thing — split the two routines into two run skills The survey routine and the working-day loop diverged long ago — the survey was split out precisely so a busy queue could not starve it — but both kept sharing one skill file and one rung numbering. That numbering described a ladder no run ever descended: the nightly run executed "rung 6" without climbing 1-5, the loop run stepped over 6 on its way to 7, and preflight and journal wore rung numbers despite being every run's bookends rather than priority steps of anything. The costs were concrete: adding one loop rung (#32) forced a renumbering sweep across four files for a nightly run that had not changed, and the nightly run's spec formally omitted preflight - auth, identity, ceilings - because "rung 0" read as the ladder's business. Now: two run skills over shared bookends. - preflight - ground rules (prompt-not-spec, writing style, non-negotiables, never-subscribe) plus run start (auth, identity, capability limits, census). Explicitly both runs': the nightly run's missing preflight is fixed by construction. - journal - the whole journal spec and the run's ending, shared verbatim. - loop-run - the ladder alone, rungs 1-5 keeping their numbers, so every existing rung citation (docs/why.md#rung-2-competes-for-the-same-budget, finalize-pr's "rung 1", adversarial-review's "rung 5") stays true. Keeps a redirect: a prompt still carrying RUN_KIND=nightly is sent to nightly-run, so the stored nightly prompt cannot silently lose its survey while it awaits updating. - nightly-run - survey dispatch and the reconciliation sweeps, stated as what it is: a fixed set of once-a-day tasks, not a ladder, no rungs. In passing: deduplicates rung 1's verdict table and mergePolicy paragraphs (a #30/#32 merge artifact stated everything twice), removes the duplicated "GitHub metadata" heading in routine-setup, and corrects surveyCalendar's comment - surveys are dispatched by the nightly run, not "morning runs". The nightly routine's stored prompt should be repointed at nightly-run/SKILL.md after this merges; routine-setup documents that, and the redirect covers the gap. Co-Authored-By: Claude Fable 5 <[email protected]> * refactor(loop): name the run skills for what they do — queue-routine and survey-routine loop-run and nightly-run named when and how the skills ran, not what they did — and "loop-run" doubly so once the nightly routine stopped being part of any loop pass. The queue routine advances the work queue (the assignee field IS the worklist): merge, revise, implement, review. The survey routine surveys: the day's calendar survey plus the reconciliation sweeps that keep the queue honest. Directory renames carry merge-verdict.mjs along; frontmatter names, the ${CLAUDE_PLUGIN_ROOT} script path, the nightly-prompt redirect, loop-config comments, README, routine-setup, AGENTS.md, and the why.md section heading (now covering all four run-adjacent skills) all follow. The system-level name — "the loop", loop-config.json, the identity marker — stays: that names the whole machine, not a skill. Co-Authored-By: Claude Fable 5 <[email protected]> * chore(loop): keep a transition pointer at the old loop-run path Both stored routine prompts name the path workflow/skills/loop-run/SKILL.md, and routines clone main fresh each run - so the moment the rename merges, every run would open a path that no longer exists, hourly, until someone updates the prompts. The stub redirects each routine to its new skill, journals that it was used (the signal the prompts still need updating), and says to delete itself once both prompts point at the new paths. Co-Authored-By: Claude Fable 5 <[email protected]> * refactor(loop): work-routine replaces queue-routine; new routines replace the prompt shim Renamed the working-day skill to work-routine and removed the loop-run transition stub: instead of shimming the old path, the cutover is two new cloud routines created alongside the old ones - sydevs-work-hourly (trig_01BUwH4WjazMXjG2bnC3TVRL) and sydevs-survey-nightly (trig_01WzJ2EnTKEk9BJ2Xf6AQ4x6) - same schedules, same environment, same tool set, created paused. Their prompts point straight at the new skills and enumerate no rungs; the old routines' prompts had drifted ("rungs 0 through 4, then rung 6"), which is the staleness their own text warns about. The reviewer enables the new pair and deletes the old pair, so no run ever reads a path that does not exist. routine-setup now records the real stored prompt verbatim, the new ids, and which predecessors to delete; the RUN_KIND redirect is gone from work-routine along with the rest of the shim. Co-Authored-By: Claude Fable 5 <[email protected]> --------- Co-authored-by: Claude Fable 5 <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
/workflow:adversarial-reviewskill: holistic, profile-driven, COMMENT-only, always in a fresh subagent; findings hand the PR back to the bot, rung 2 gains the author filter's one structural exception.reflectnow reads Ardnived's actual review comments weekly and refines the seededreviewer-profile.mdon recurrence — intent, not incident — and carries small lessons out to product repos as ticketless doc PRs or proposal issues.Test results
claude plugin validate ./workflow --strictloop-config.json,.claude/workflow.jsonparserung 5/6references outside the new meaningsManual verification
create_pending_pull_request_review/add_comment_to_pending…/submit_pending…resolve and can submitevent:COMMENTon a scratchclaude/probe-reviewPR, and that thread resolution works. If absent, the skill's issue-comment fallback becomes the primary path — say so in the skill before merging./workflow:loop-run --dry-runlocally: rung 5 prints its two-group worklist and stops.sydevs-loopmanually, read journal and transcript — review ran in a spawned subagent, one review, correct verdict path, 🧐 journal line. Second run confirms idempotency; first Sunday confirms reflect's new queries ran and the signal gate held.Notes for reviewer
workflow/skills/adversarial-review/reviewer-profile.md), seeded from your full review history (55 inline comments, 32 reviews, 33 PR comments). Correcting it in this review is its first calibration pass.claude/branch-alias-and-journal-titlerewritesloop-run/SKILL.md,loop-config.json,why.mdandroutine-setup.md. Whichever lands second must be re-merged carefully — in particular the rung renumbering and its scripted merge gate (rung 5's "green by rung 1's definition" should switch toworkflow/lib/merge-gate.mjsonce that lands)..claude/workflow.jsonsecurityReview pattern widened soreviewer-profile.md(an instruction surface) triggers the branch security review.Detail
review.bodyHeadermatters only in the no-MCP-tools fallback, where an issue comment is invisible toget_reviews.reviewMarkerstring (drifts, leaks, forgettable), a nightly review sweep and a reserved slot (both re-tax the budget), re-reviews after revisions (a bot arguing with itself doubles your reading).