Repository navigation
skills: gate self-initiated fixes on cost, not just evidence - #960
Merged
Merged
Conversation
The bot fleet's output has tilted toward machinery that prevents wasted compute — retry frameworks, skip-gates, window arithmetic — purchased with permanent complexity, while the existing gates price only evidence strength. Encode the maintainer's asymmetry: complexity is spent on wrong outward actions (what the bot posts, approves, merges, closes), never on saving compute, where the only sanctioned fixes are simple knobs. - CLAUDE.md: the vision statement, plus a bound on the YAML pre-check pattern so it can't be quoted as license for gate stacks. - review-gates.md: Gate 3 (cost class), a chain-upgrade ban, and a stochastic floor that no reclassification lowers. - running-in-ci: Weighing a Fix (the full statement), logic-to-tested- script rule, a 5-open-PR budget for self-initiated improvements, no stacked PRs, 2-3-sentence PR bodies. - review: challenge saved-compute mechanism in the repo's own automation. - review-runs / review-reviewers: reconcile the near-timeout and loop-filter guidance with Gate 3; lead PR bodies with the summary. Co-Authored-By: Claude Fable 5 <[email protected]>
tend-agent
reviewed
Aug 12, 2026
tend-agent
left a comment
Collaborator
There was a problem hiding this comment.
Three places where the new gate lands harder than the stated intent — one contradiction with Gate 3's own classification rule, one gap in the budget's exemption list, and one scoping question on the bundled review criterion. Details inline.
The Gate 3 / stochastic-floor / <details> reconciliations all check out: no two gates or Put full analysis text survives anywhere in the plugins, and the review-gates.md symlinks into both skill directories are intact.
…intenance from the budget, scope the review criterion to the bot's own automation Co-Authored-By: Claude Fable 5 <[email protected]>
tend-agent
approved these changes
Aug 12, 2026
This was referenced Aug 12, 2026
This was referenced Aug 12, 2026
proxy: the mitmproxy cache warm is the fourth pre-agent reach, and it's not on the retry window
#911
Closed
max-sixty
added a commit
that referenced
this pull request
Aug 13, 2026
…n window (#965) Cuts the four complexity hotspots from the recent bot-PR audit back to the #960 vision — mechanism only where it prevents wrong outward actions — and moves the surviving logic under real tests. Everything loaded or executed in production shrinks (~420 lines across the template, generated workflows, and skill prose); the growth is tests for scripts that previously had none. - **`mention.yaml.j2` verify gates: 4 → 2.** The stacked review-path skip gates collapse into two structural rules: a bot-authored review summons a session only as the reviewer→author handoff (fresh content on a PR the bot authored), and a contentless approval is terminal whoever submitted it. GitHub rejects self-approvals, so the empty-body-APPROVED gate was already subsumed by an author-keyed rule. Outward behavior is unchanged — verified case-by-case twice (by hand, and independently by the review sweep's verifier); each rendered workflow drops ~52 lines. - **`running-in-ci`: 869 → 677 lines.** The two markdown poll recipes become tested scripts. `poll-pr-checks.sh` polls by commit OID, never the PR head, fixing the false green a concurrent push caused (closes #829) and carrying the edge cases #837's five review rounds surfaced — null merge-ref rollups, superseded check runs, STARTUP_FAILURE/ACTION_REQUIRED bucketing — so it supersedes #837. `rerun-failed-jobs.sh` owns the rerun and finds the new attempt's jobs by `run_attempt`, so a fast rerun no longer reads as "nothing re-queued" and an unregistered one can't report stale conclusions as fresh. The rarely-taken skill-PR mechanics move to `references/skill-pr-workflow.md`. - **`list-recent-runs.sh`: 207 → 113 lines.** The completion window becomes "floor = the last successful run's start, clamped at 6h, else 6h with a coverage-gap warning". Any successful run's window opens at or before its own start, so consecutive windows overlap and never gap — which makes the cron parsing, tick tiling, dropped-tick recovery, and the schedule-event restriction all unnecessary, at any cadence. The retry wrapper goes too: a transient failure now fails loud, and the next tick's floor reaches back past the lost window. This supersedes the window-anchoring half of #845; its cadence-cut half stands alone and needs no script support under anchor-based windows. - **`review-reviewers` Non-issues: 7 carve-outs → 3 structural rules** (designed no-ops at whatever layer catches them, designed silence, reviewer-role independence), with the closed menu folded into Gate 3's cost classification. Also: pre-commit's shellcheck now covers `plugins/**/*.sh` (it covered none of them), and the fake-`gh` test scaffold consolidates into `generator/tests/__init__.py` (five copies → one). ## Testing The scripts are exercised end-to-end under pytest with fake `gh`/`date`/`sleep` binaries, with the scripts' own jq filters doing the reductions: 21 cases for the poll scripts (false-green guards: >100-context page, null rollup, superseded runs, moved head), 11 for the window logic (anchoring, clamping, self-exclusion, loud failure), and the mention gate consolidation is pinned by the reworked `test_generate.py` assertions plus regenerated snapshots. Full suite green. The verify gate itself is still string-shape-tested rather than executed — extracting it to a `.sh` template like `review-gate.sh` is the natural follow-up, left out here to keep this diff reviewable. <details><summary>Review-hardening notes (later commits)</summary> An 8-angle verified code-review of the first commit found the substantive gaps in the new scripts themselves, all fixed and pinned by tests: the GraphQL query's one 100-node page could hide a red check past the cap (now routes to UNVERIFIED); a nullable `startedAt` could let a stale settled check run outrank its QUEUED replacement (a group with any non-terminal entry now reads pending); a transient API blip on a late poll iteration discarded the pending list the cap report names (the last usable rollup is kept); rerun discovery by job status misread fast reruns (now keyed on `run_attempt` advancing); and overlapping workflow prefixes double-counted runs (`unique_by`). The known remaining limit: latest-wins can't distinguish two independent runs of a group-less workflow on one SHA — documented in the script header and the skill, with the instruction to read the specific run's conclusion where that distinction must be exact. A further tend-review round on the PR added: explicit `--repo`/owner arguments on the three `gh` calls that leaned on cwd remote detection (with test assertions pinning the flags), a Step 1 sentence in `review-reviewers` covering a failing `list-recent-runs.sh` call (retry once, then record a coverage gap — the run still concludes green, so the next tick anchors past the span), and the zero-checks commit named in `poll-pr-checks.sh`'s exit-2 docs. </details> > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Fable 5 <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Aug 13, 2026
…eck (#966) Drops the `47 * * * *` cron from `review-reviewers`, leaving `workflow_dispatch`. Its recent output had converged on maintaining its own evidence machinery, at the fleet's highest per-run cost and a seven-day quota ceiling that twice took the user-facing workflows down with it; each adopter's daily `tend-review-runs` already reviews that repo's runs from the inside and routes bundled-skill defects upstream, so this removes the direct loop rather than the only one. The skill is scoped to match: it described itself as hourly and told the session to analyze "the past hour". It now states the window `list-recent-runs.sh` actually hands it — floor at the previous successful run of the workflow, clamped 6h back — which with no cron makes the clamp the normal case rather than an outage signal, and scopes its claims to that window. (An earlier revision of this PR described a cron-payload branch; #965 replaced that logic while this branch was open, and the text was rebased onto what merges.) <details><summary>What the sweep caught, and when</summary> Its unique catches — the ones no inside-out session would have found — cluster in April–June: rubber-stamped APPROVEs over visibly failing checks (#667), backslash-backtick corruption in already-published comment bodies across repos (#359, #405, #424, #562), stale PRs silently dropping mentions (#391), and the stale/re-anchored approval family (#798, #821, #884). The last two weeks are dominated by fixes to its own machinery — evidence-gist plumbing, survey-window arithmetic, matrix branch naming, run→output attribution — while per-run cost climbed from $5.31 to $10.49. That is the shape the cost gate in #960 was written for. </details> Re-enable by dispatching it after a change that could move bot behavior fleet-wide: a release, a harness switch, a model bump — within the hour of that change, per the window note in the overlay. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Fable 5 <[email protected]>
Merged
max-sixty
added a commit
that referenced
this pull request
Aug 13, 2026
Release 0.1.16: the version bump, the lockfile sync, and the `CHANGELOG.md` section that `pypi-release.yaml` publishes verbatim as the release notes. 11 commits since 0.1.15. On the shipped surface: a cost gate on self-initiated fixes (#960), tested CI-poll scripts and an anchor-based run window (#965), one review-anchor resolver plus the head-resolution fix past 100 commits (#971), the mention engagement gate as a tested script (#970), `review-reviewers` paused to manual dispatch (#966), the stale re-anchored approval on rebased dependency PRs (#890), and a line-anchored evidence-log selector (#963). After merge: tag `0.1.16` to publish, then regenerate tend's own workflows with `uvx tend@latest init` and restamp `review-reviewers.yaml`, whose action pin `init` never rewrites. > _This was written by Claude Code on behalf of max-sixty_
max-sixty
pushed a commit
to max-sixty/worktrunk
that referenced
this pull request
Aug 15, 2026
Automated nightly regeneration of tend's workflow files. **tend version:** 0.1.15 → 0.1.17 **Notable changes** - 👀 reactions now mark a session in flight: the bot reacts when an issue or PR is opened, and the reaction comes off when the session ends (max-sixty/tend#974, max-sixty/tend#979). - Mention gating was reworked — coarser pre-check gates, tested poll scripts, and an anchor-based run window replace the hand-rolled matching (max-sixty/tend#965, max-sixty/tend#971). - Self-initiated fixes are now gated on cost as well as evidence, so the bot doesn't open a PR whose value doesn't justify the session (max-sixty/tend#960). - `tend check` reads the bot's own bypass verdict on repos where the actor list is withheld, instead of reporting a false FAIL (max-sixty/tend#976). - Weekly no longer trusts a re-anchored approval on a rebased dependency PR (max-sixty/tend#890), and review-reviewers is paused as a scheduled sweep, kept as a manual spot-check (max-sixty/tend#966). Compare: max-sixty/tend@0.1.15...0.1.17 Co-authored-by: worktrunk-bot <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Sep 17, 2026
…1267) Follow-on to #1265, which named the split between shipped guidance and tend's own but didn't move the text it judges. These are the three bundled sites that applied tend's judgement to the repo the bot is running in — mechanics ship, but what work is worth doing in a repo belongs to whoever maintains it. **`review/SKILL.md`** weighed changes "in the bot's own automation … and the repo's CI config", so a consumer contributor's own CI change was judged by tend's ranking of complexity against compute. The criterion now stops at the bot's *bundled* skills and the scheduled workflows that invoke them — "its skills" would still have covered the consumer-authored `running-tend` overlay. **`references/pr-creation.md`** opened "Open PRs compete for one maintainer's attention" and held self-initiated improvements at five open bot PRs. The five was written whole in #960 and never derived — set below an eleven observed at the time — and it isn't right for tend either, so no repo would set it and the mechanism goes with it, exemption list included. The branch-basing rule in that paragraph is mechanics and is kept. That cap was the only bound on **`nightly`**'s rolling survey, whose Step 8 read "For each finding: 1. Create a PR" with no limit — unlike `review-runs` and `review-reviewers` it references no gates and caps nothing, so an eight-finding survey would have opened eight PRs. Step 8 now groups findings by theme and keeps a run to a couple of PRs, with the rest in the run summary: the same restraint its siblings carry, in the skill that does the sweeping rather than as a global number. **`ci-fix/SKILL.md`** required "a knob-sized mitigation, one setting in one place" for an escalated infrastructure fault, limiting a consumer's own reliability work to tend's bar. Now the smallest mitigation that holds, with the 3b fallthrough turning on that instead of on "knob-sized", which the edit had left undefined in the file. Separately, the per-run caps in `review-runs` and `review-reviewers` read "a couple of PRs per run" rather than "at most 2". That number was never derived either, and the words carry the same instruction without the false precision. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5 (1M context) <[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.
The fleet's recent output has tilted toward machinery that prevents wasted compute — retry frameworks, skip-gates, window arithmetic — while the gates price only evidence strength, so a well-evidenced waste fix passes at any complexity. This encodes the asymmetry the repo runs on: complexity is spent on wrong outward actions (what the bot posts, approves, merges, closes), never on saving compute, where the only sanctioned fixes are simple knobs.
What changed, per file
CLAUDE.md— the vision paragraph, plus a bound on the "gating in YAML is cheap" pattern so it can't be quoted as license for gate stacks.shared/review-gates.md— Gate 3 (cost class: wrong outward action vs wasted compute); waste supports only knob-grade fixes at any occurrence count, and aggregates escalate to the maintainer as a number; a ban on upgrading the class via hypothetical chains; the stochastic 5+ floor is not lowered by reclassification or pre-registered conditions.running-in-ci— a "Weighing a Fix" section stating the value order; skill code blocks past ~two dozen lines move to tested scripts; a 5-open-PR budget for self-initiated improvements (never holds requested work or product fixes); no stacking PRs on unmerged bot branches; PR bodies lead with two-three sentences and fold analysis into<details>.review— one criterion: challenge new mechanism whose only payoff is saved agent compute, scoped to the bot's own automation.review-runs/review-reviewers— reconcile the passages that contradicted the new gate (near-timeout "one occurrence is enough to act", the loop-filter proposal path, "put full analysis in PR description").Validation
A context-blind agent applying only the edited files classified five scenarios mirroring the currently-held bot PRs (install-retry stack, survey-window ceiling, occurrence-2 skill bullet, re-anchored stale approval, false-green CI poll) the way the repo's stated values do: the first three blocked, the last two pass reshaped toward tested scripts. An adversarial pass over the full files closed the contradictions it found — the queue budget no longer holds ci-fix/triage product fixes, and the sibling skills no longer carry quotable pro-machinery text.