Skip to content

Token quick wins: no futile fix-ci re-runs, a wider critic skip, one-line config comments - #320

Merged
Ardnived merged 8 commits into
mainfrom
claude/quick-wins
Nov 25, 2026
Merged

Ardnived merged 8 commits into
mainfrom
claude/quick-wins

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Three quick wins against the Routines account's usage limit, and the review round's five fixes. Each is in its own commit and can be reverted on its own.

  1. fix(dispatcher): a fix-ci that stood down is not fired again by a merge. A repair pass records the names of the red checks it was fired on, and its unlock records the head it ended on. If the last pass pushed nothing, a new head with the same red checks keeps the hand-back. A push from a person, or a different set of red checks, fires it again.
  2. chore(config): review.skipWhen 2 files / 40 lines → 3 / 100.
  3. chore(config): one-line $comments. Each comment is now one line naming what its values mean. The long text is cut, not rehoused: every fact in it already had a home in a skill, in docs/why.md, or in a code comment beside its reader. Every value except skipWhen is unchanged; I checked by diffing the parsed JSON.
  4. The adversarial review's five findings, one commit each. The first is a real bug: the stand-down match fired on an empty red set. The other four are prose.

The failures these prevent

  1. From 2026-11-22 to 25, 12 of 25 fix-ci sessions stood down without pushing. Most were on a contract check waiting for an open producer PR. Each merge of main into the branch gave it a new head, which cleared the refusal, so fix-ci ran again and reached the same verdict. WeMeditateWeb#321 was fired twice this way.
  2. Every critic run is an Opus session at max effort. Of the 45 PRs the critic read in those four days, 2 fall under the new threshold. I tried 4 / 120 first, which would have caught 5. It would also have marked SahajCloud#1216, a four-file, 91-line migration and the review-scope test fixture that must stay FULL, as tiny and skipped its critic. I stopped at 3 / 100. A small diff still gets the self-review at review.selfReview.tinyLevel.
  3. Every dispatch reads loop-config.json first, 25 to 40 times a day, and 8,903 of its 19,599 bytes were comments. The cut saves 5,977 bytes, roughly 1,500 tokens, on every run.
  4. The stand-down match compared the stored red-check names to the current ones. On the merge-queue path ci.failing is empty, so a pass fired there stored [], and a later queue failure matched '' === ''. The PR was handed back claiming "the same checks are still red" with nothing red, and the note left a blank where the names go. gather fetches headAuthor only when failingNames.size, so on that path it stays null and !isHuman(null) holds — a person's push could never ask again, and the hand-back was permanent.

Why one PR

The owner asked for one PR. The hard split in AGENTS.md (never a skill change and a ceiling change together) holds, because no skill file changes here. The two behaviour changes move different handlers, fix-ci and review-pr, and the journal tallies each handler separately, so their effects stay attributable.

Risks

  • A check name is a job, not a failure. A bot commit that breaks the same job in a new way stays handed back instead of being repaired. That costs a hand-back the person already holds, never a merge.
  • A fix that lands through the relay moves the head after the unlock. Its pass therefore reads as a stand-down. If CI is still red on the relayed head with the same checks, it is handed back rather than tried again.
  • This conflicts with feat(dispatcher): resolve a conflict once the base has settled #317 in the dispatch $comment. Whichever merges second needs a one-line rebase.

Not included

The nightly audit being woken by the subscription GitHub adds when it opens a PR is platform behaviour. finish-run already unsubscribes, and the woken session writes nothing and stops. No repo change prevents the wake.

Tests

  • node --test dispatcher/test/*.test.mjs: 447 pass. New cases: same checks on a new head are held, a person's push fires, a different red set fires, a pass that pushed is not a stand-down, an entry from before this change is not a stand-down, and a pass fired where nothing was red does not match a later empty red set.
  • Lean gate is green: claude plugin validate ./workflow --strict, then 184 workflow/lib tests. review-scope tests pass with the new threshold.
  • rule-delta.mjs --base origin/main workflow/skills: 94 → 94 directives, none removed.

Notes for reviewer

Four of the five review findings were prose, and all four are adopted rather than rebutted, so docs/loop-config.md is gone and docs/why.md now names review.skipWhen instead of copying its counts. The page's deletion is the one judgement call worth a second look: I checked that each fact its long comments carried still has a home — restLogin's reasoning in predicates.mjs:44-51, the roadmap notes v1 fold in implement-roadmap/SKILL.md:24, reconcileMaxPerEvent in resolve.mjs:64 and why.md:2420 — and Sentry's DE host and missing org:read stay in the one-line comment beside the values they bite.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Mg9rjXVzHFGn5WDVDZ5GpK

Ardnived and others added 3 commits November 25, 2026 13:52
12 of 25 fix-ci sessions from 2026-11-22 to 25 stood down, pushing nothing,
mostly on a contract check waiting on an open producer PR. A merge of main
then gave the branch a new head with the same check red, which cleared the
refusal and fired fix-ci again to reach the same verdict.

A repair pass now records the red check names it was fired on, and its unlock
the head it ended on. While the last pass stood down, a new head with the same
red checks keeps the hand-back. A person's push or a different red set asks
again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
review.skipWhen goes from 2 files / 40 lines to 3 / 100. Of the 45 PRs the
critic read from 2026-11-22 to 25, two fall under it. 4 / 120 would have
caught five, but it would also tier a four-file, 91-line migration
(SahajCloud#1216, the review-scope fixture) as tiny and skip its critic.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every dispatch reads loop-config.json first. Its $comment fields were 8.9 KB of
17.6 KB, mostly rules and history already stated in a skill or why.md. Each is
now one line naming what its values mean. The originals move verbatim to
docs/loop-config.md, which no run reads. This saves about 6 KB (~1.5k tokens)
per run, and the config stays valid JSON with every value unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-dispatcher

sydevs-dispatcher Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

🤖 no session running

recent dispatches
  • 21:10Z address-review · attempt 1 · session · done
  • 21:10Z address-review · attempt 1 · session
  • 20:58Z review-pr · attempt 1 · session · done
  • 20:58Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 25, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 25, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧐 Adversarial review

Every figure in the body checks out: only review.skipWhen moves among the values, and all 27 comments reached the new page verbatim. The dispatcher rule is the right shape — a stand-down derived from the record already kept, and an entry from before the change carries no end head, so nothing old reads as one. Two things I would change. The match is not guarded against an empty red set, so on the merge-queue path a PR is handed back claiming checks are red when none are. And the 6 KB cut is right while its destination is not: a page mirroring the config key by key is the fourth home docs/documentation.md forbids.

Findings

  • should-fix — the stand-down match fires on the merge-queue path, where nothing is red → decide.mjs:298
  • should-fix — Streamline: delete docs/loop-config.md, a fourth home → docs/loop-config.md:1
  • should-fix — Streamline: why.md:1222 keeps a stale copy of this threshold → why.md:379
  • should-fix — Streamline: two sentences restate finalize-pr and improve-loop rules → why.md:1234
  • consider — the file is 19,599 bytes, not 17.6 KB → why.md:2158

What was checked

  • Read whole: repairPlan and the CI branch of decide.mjs, gather.mjs's headAuthor block, the three rec.dispatches append sites in apply.mjs, predicates.mjs, review-scope.test.mjs, documentation.md, the new page.
  • Both gate suites pass from a git archive extract, never a checkout: 446 dispatcher, 184 lib.
  • Measured: comments 8,903 B, file 19,599 → 13,622 B, saving 5,977 B.
  • review-scope.test.mjs pins SahajCloud#1216 at 4 files, 91 lines, FULL from the real threshold, so 3/100 over 4/120 holds.
  • Ladder: the one new piece, stoodDownFixCi, is kept: two callers in two modules. No dependency added. Streamliner: 1 covered, 1 kept, 3 prose findings, each checked and posted.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread dispatcher/decide.mjs Resolved
Comment thread docs/loop-config.md Resolved
Comment thread docs/why.md Resolved
Comment thread docs/why.md Resolved
Comment thread docs/why.md Resolved
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 25, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 25, 2026
A merge-queue failure leaves `s.ci.failing` empty, so a `fix-ci` fired on
that path recorded `failing: []`. A later queue failure then matched the
stored empty set against its own, `'' === ''`, and the PR was handed back
claiming "the same checks are still red" with nothing red at all. The note
it wrote left a blank where the names go: "with  red".

`gather` fetches `headAuthor` only when `failingNames.size`, so on that
path it stays null and `!isHuman(null)` holds. A person's push could never
ask again: the hand-back was permanent.

Two empty sets are not the same checks. The match now needs names.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXVzHFGn5WDVDZ5GpK
The token win is the shortened `$comment`s. The page was not part of it:
it mirrored the file key by key, which `docs/documentation.md` forbids —
one home per fact, every other mention a link. Six of its sections both
explained a thing and cited the `why.md` anchor that already owned it.

Each fact the shortened comments drop already has its home beside its
reader: `restLogin`'s reasoning in `predicates.mjs:44-51`, the roadmap
notes `v1` fold in `implement-roadmap/SKILL.md:24`, `reconcileMaxPerEvent`
in `resolve.mjs:64` and `why.md:2420`. Sentry's DE host and its missing
`org:read` stay in the one-line comment, beside the values they bite.

`AGENTS.md` and the two `$comment`s that pointed at the page go with it.
Every value except `review.skipWhen` is still byte-identical to `main`'s,
checked by diffing the parsed JSON.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXVzHFGn5WDVDZ5GpK
Both sections retyped the threshold. §A tiny diff gets one read had to be
retyped by this PR to stay true, and §The critic skips small PRs was left
stale at "a two-file, twenty-line PR" — already wrong at 2/40, and wrong
twice over at 3/100.

`documentation.md` says name a constant, never its value. Naming the key
leaves nothing for the next tuning edit to miss. No test asserts either
figure out of the prose, so the Never-delete exception does not apply.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXVzHFGn5WDVDZ5GpK
The `review.selfReview.tinyLevel` sentence restated
`finalize-pr/SKILL.md:103`, and the `improve-loop` sentence its own table
row at line 98. Both are rules, and each skill is their home.

What a reader cannot re-derive stays: the motive, the 45-PR count, and
the rejected four-file, 120-line alternative with the fixture that killed
it. `documentation.md` never deletes a rejected alternative.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXVzHFGn5WDVDZ5GpK
`loop-config.json` on `main` is 19,599 bytes, not 17.6 KB. The comments
are 8,903 bytes and the cut saves 5,977, both measured again here. The
exact figures replace the rounded ones, since rounding is what let the
wrong one through.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXVzHFGn5WDVDZ5GpK
@sydevs-bot

Copy link
Copy Markdown
Contributor

All five findings adopted, one commit each. Nothing rebutted, nothing asked.

Lean gate green, 447 dispatcher tests, security review clean. The body is refreshed: the 17.6 KB figure and the claim that the comments moved to a page were both false after this round.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 25, 2026

@sydevs-dispatcher sydevs-dispatcher 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.

Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is

@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 25, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 25, 2026
@Ardnived
Ardnived added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 5008647 Nov 25, 2026
84 of 92 checks passed
@Ardnived
Ardnived deleted the claude/quick-wins branch November 25, 2026 22:14
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 25, 2026
sydevs-bot pushed a commit that referenced this pull request Nov 25, 2026
Three conflicts, all from #320 landing on main:

- dispatcher/gather.mjs: #320 widened the head-commit read to a stood-down
  repair; this branch folded that read into `commitFacts`. Kept both — the
  helper, called under the widened condition.
- dispatcher/test/decide.test.mjs: both sides appended a suite at the end of
  the file. Kept both suites.
- loop-config.json: #320 cut the dispatch `$comment` to one line, which is
  what it set out to do, and the three-homes rule wants. Took main's line;
  `conflictQuietMinutes` keeps its story in docs/why.md.

dispatcher/test: 453 pass. Lean gate green.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZ2VcTtaLzy8VMJ15p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants