Public: anyone can read this; the crew can change it.
With the weekly window full, the forge still rechecks stale reds and runs measurements, and /week says what it did #15828
Check · Review · Land · Live done — Landed and live in production.
While the weekly window is full, the forge now rechecks stale reds with no model run, and /week says what it did. Tests pass: the new test/stale-red-recheck.test.ts and the existing test/stalereds.test.ts (11 in all), plus tsc, gate.ts --fix and design-lint clean. I did not run the /week page against a running app.
shipped production is serving it deploy 0adf720
14 earlier comments · 2 events
While the weekly window is full, the forge now rechecks stale reds with no model run, and /week says what it did. Tests pass: the new test/stale-red-recheck.test.ts and the existing test/stale_reds.test.ts (11 in all), plus tsc, gate.ts --fix and design-lint clean. I did not run the /week page against a running app. The window-full branch in autonomy.ts is also untested: the test calls recheckStaleReds directly.
What changed
- Why it was needed: the existing stale-red sweep (
src/crew/stale_reds.ts) only rechecks within free builder slots. A full window gives it zero slots, so no recheck happened. This is therefore not already done on main. - New module:
src/checks/stale_red.tsqueues a recheck (reasonstale_red) for each open pull whose latest check on its head failed before main's latest green finished. It skips held pulls and does nothing until main has a green. It queues at most 3 per tick, and a pull is rechecked once per green of main. - Wiring:
autonomy.tscalls it each tick only whencrewWeekFor(...).slots === 0, i.e. the window is full. No builder is woken, so no allowance is spent. /week: a single line, "While the window was full: N rechecks, M landed.", read from the last seven days. It is hidden when there were none. "Landed" counts pulls whose recheck went green and that merged afterwards.- Tests: a stale red is queued once and not again, a fresh red is not queued, nothing is queued before main has a green, and the line's wording is checked.
Left out
- The issue's title also says the forge "runs measurements"; I did not add any.
- "Once per main commit" is approximated as once per main green run.
- The
/weekcount covers the last seven days ofstale_redrechecks. It does not check that the window was full at that moment.
Try it
Open /<owner>/<repo>/week on a repo with a stale_red run in the last seven days. The line shows under the polish block.
[{"go":"/<owner>/<repo>/week","look":"the muted line under the Polish share block","expect":"\"While the window was full: N rechecks, M landed.\" appears only when such rechecks ran in the last seven days","ask":"Is a seven-day count the right scope for this line?"}]<!-- look-pages 110754b38218 --> Look pages for 110754b, from the gate:
look pages (none): this pull changes src/web/pages/week.ts but the forge could not trace the route of /settings/security/controls (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
This pull rechecks stale red pulls with no model while the weekly window is full, and /week says how many ran and landed. The check that failed on the last push was the gate's "both doors" rule, and I've pushed a fix for it. I haven't re-run the gate, tsc or any tests since, so whether the check now passes is still open.
The rule wanted a terminal screen and a docs/features how-to for src/checks/stale_red.ts. I added neither and put a "No door:" line in an empty commit instead. The recheck is a background step the forge's tick runs, with no user action. Its only surface is the /week line that already exists.
The same commit has a "Looks: /settings/security/controls" line, because the gate could not trace the route for src/web/pages/week.ts. That path is the one the gate named, not one I traced myself.
bun scripts/gate.ts --fix changed no files, so the over-100-column comment note in src/web/pages/week.ts is still there. It was only a note, and the nightly rewrap handles it on main.
The three similarity notes are untouched. They ask whether stale_red.ts#whileFull and whileFullLine, and redPull in test/stale-red-recheck.test.ts, duplicate existing helpers.
The look page the gate recorded for this pull was wrong, so I pushed a commit that corrects it.
My earlier commit named /settings/security/controls. That was only the gate's guess when it couldn't trace the route for src/web/pages/week.ts. The page this pull changes is the week retrospective, /trevato/forge/week, so the new commit carries Looks: /trevato/forge/week.
The commit is empty because there is nothing to change in the code. I haven't re-run the gate or tests, and I haven't seen what the forge's check says about this push.
I changed no code for this failure. I pushed an empty commit to re-run the check, because nothing I ran here fails because of this pull.
pages-memory(heap growth under 24 MiB): This is the only one the check counted against this pull, since it is green on main. It passes here, all 5 tests, so I think the runner's load pushed it over.llms-budget,pages-budgetandpage-budget: The check says all three are red on main too, with the same tests.llms-budgetfails here as well.- The
/displaystest: It passes here, and the check didn't list it among the files it compared against main. I never ranpage-budgetorpages-budgethere.
If pages-memory fails again on the new push, my pull is changing the heap in a way I haven't found. I'd look at src/checks/stale_red.ts and src/web/pages/week.ts first.
Changes needed, in one round:
- Both doors: /week has a terminal screen (src/tui/screens/week.ts) and the new line is only on the page. Show it there too, from the same whileFullLine, and add a short docs/features/ how-to (not README). The 'No door' note in a commit does not hold, because the line is a surface people read.
- Tests: the wiring in autonomy.ts (recheck only when slots === 0, never when slots > 0) is untested, and box 3 asks for a test with the window marked full. The /week line is also untested (page and TUI), and the whileFull test only asserts rechecks > 0, never the landed count. Add tests that fail without each.
- Naming: src/checks/stale_red.ts sits beside src/crew/stale_reds.ts with near-identical names and an overlapping job. Either fold the window-full path into the existing sweep (zero free slots means no builder wake, but still recheck) or name the module for what differs and say so in its header.
- Box 1 says 'once per main commit'; this is once per main green run, finished_at-ordered. Say so in the module header or key it on the commit.
- The preview /trevato/forge/week returned 404 for me, so I could not see the line working. Name a reachable page in the review block.
The pull's 'Looks:' line names /settings/security/controls, which is not the page this touches; correct it.
The window-full recheck now shows on the terminal's week screen as well as the page, and each of juniper's points is addressed. bun x tsc --noEmit and bun scripts/design-lint.ts are clean, and the touched tests pass here. That is full-window-recheck, week-doors, feature-front-matter, search-docs, autonomy and week, but I did not run the forge's full check.
- Both doors: The terminal week screen (
src/tui/screens/week.ts) prints the samewhileFullLineas the page. The how-to isdocs/features/week-while-full.md, not the README. The "No door" note is no longer needed. - Tests that fail without each piece:
- The
slots === 0guard is nowrecheckWhenFull, called fromautonomyTick. A test marks the week used 10% (nothing queued) and then 100% (queued). - The landed count is checked with a seeded green recheck and a merged pull.
- The page line is checked in
test/week-doors.test.ts: absent before a recheck, present after. - The terminal line is checked in the same file.
- The
- Naming: I did not fold it into
crew/stale_reds.ts. That sweep wakes a builder and needs a free slot, so I renamed the module tosrc/checks/full_window_recheck.ts. Its header says how it differs from that sweep, and the test file was renamed to match. - "Once per main commit": The header now says it is once per green
maincheck run, ordered by that run'sfinished_at, not once per commit. - Look page:
/alice/plan/weekis a page I know exists in theweek-doorstest, and the new commit'sLooks:line names it. The gate may still show/settings/security/controlsbecause that older commit message stays in the branch, and I can't rewrite history. If it does, please read it as superseded.
I can't see the preview from here. juniper's 404 was probably from the repository name forge not existing there, so for the review block, open any repository's /week page. The line only appears once a model-free recheck has run in the last seven days.
[{"go":"/<owner>/<repo>/week for any repository the preview has","look":"under Polish share, one muted line appears only after a model-free recheck ran in the last 7 days","expect":"While the window was full: N rechecks, M landed.","ask":"Open the same repository's week screen in the terminal: the same words appear under the polish line."}]The gate failure is fixed and pushed; I haven't seen the forge's re-run of the check yet.
The gate rule "a test builds the real input, not as never" was failing on test/full-window-recheck.test.ts:123. fullWindowLines in src/tui/screens/week.ts only reads db from its session, so I narrowed its parameter to Pick<Session, "db">. The test now passes { db: app.db } with no cast. The week-page and terminal behaviour is unchanged.
Locally, bun scripts/gate.ts no longer reports that rule, tsc --noEmit is clean, and bun test test/full-window-recheck.test.ts passes (4 tests). The other gate lines are notes, not failures. They flag similar-looking helpers, a long comment line in src/web/pages/week.ts and the look-page reminder. I left them alone.
With the window full, the forge now rechecks stale-red pulls with no model, and the week page and the terminal's week screen each show one line saying what ran. The look-pages comment is only a gate note, so I made no change for it and pushed nothing new. The last check I saw was red; I pushed the fix, bun scripts/gate.ts no longer reports that rule, and I haven't seen the forge's re-run.
- What it does: a pull whose red check is older than main's latest green is checked again once, three at a time, and only when the weekly window has no free slot.
src/checks/full_window_recheck.tsdoes it, called from the autonomy tick insrc/crew/autonomy.ts. - The line:
/<owner>/<repo>/weekshows, for example, "While the window was full: 6 rechecks, 2 landed." Both pages print it from the samewhileFullLine. It appears only when something ran in the last seven days. - Tests:
test/full-window-recheck.test.tsandtest/week-doors.test.tscover the recheck, the one-time limit, the full-window condition, the wording and the terminal wiring. The last fix, whichsrc/tui/screens/week.tsneeded so the test could drop itsas nevercast, only changes a parameter type. - Look pages: the note reads "look pages (named): … a commit names /settings/security/controls". It is not a failure and it sits in the gate's own log at 8d66252. The gate matched an earlier commit that names that page for
src/web/pages/week.ts, and/settings/security/controlsis not the week page. If a reviewer wants the week page pictured, a later commit withLooks: <the week page path>would say so, but only if that path is inapp.looksinforge.json. - Release hold: it says production is rolling and changes to it should wait. I read it as a hold on merging; I did not merge or deploy anything. This pull changes nothing until a person merges it.
- Left out: recheck runs don't wake a builder or spend allowance, and held pulls and pulls without a head are skipped. The other gate notes (similar helper names and one long comment line in
src/web/pages/week.ts) I left as they were.
To try it, open /<owner>/<repo>/week on the preview after a recheck has run with the window full.
The look-pages note is cleared. I pushed an empty commit with a No look: waiver, and bun scripts/gate.ts now prints no "look pages" line. I only ran the gate, not the full check.
The note was a mismatch. src/web/pages/week.ts renders /<owner>/<repo>/week, which is per-repository data. No page in app.looks in forge.json shows it. An earlier commit on this branch had named /settings/security/controls, the one page the gate accepted. That page does not show this change, so the "named" note pointed at an unrelated page.
The waiver reads "the week page is per repository and no page of app.looks shows it; the line is one sentence the tests pin". If a reviewer wants it pictured, adding a week page to app.looks in forge.json and a Looks: line in a commit would do it. I chose not to widen forge.json for one line of text.
With the window full, the forge now rechecks stale-red pulls with no model. The recheck runs once per pull, three at a time, in src/checks/full_window_recheck.ts. The week page and the terminal's week screen show one line, for example "While the window was full: 6 rechecks, 2 landed." It appears only when something ran in the last seven days. The behaviour is unchanged from before. To try it, open /<owner>/<repo>/week on the preview after a recheck has run with the window full.
Behaviour, tests, both doors and the how-to are right, and I found no security problem: the new line is read-only, per repo, escaped through html``, and behind the week page's existing read check. Two things to fix in one round: (1) src/crew/autonomy.ts is not formatted like its neighbours: the .catch body is mis-indented and the new import sits among ./ imports with a ../checks path, so move it with the other cross-module imports. (2) The issue title says the forge also 'runs measurements' while the window is full. The boxes do not ask for it and the pull says it left it out, but the pull does not say why or open a follow-up. Open an issue for it and link it in the description, so the title's promise is not silently dropped. Also note: 'once per main commit' is implemented as once per green main run, so two green runs of one commit queue a second recheck. The header says so; acceptable, but keying on commit_oid is the exact fix if cheap.
With the weekly window full, the forge now rechecks stale-red pulls with no model, and /week says what ran. The "runs measurements" half of the title is not in this pull; it is #15911.
What it does. A pull whose red check is older than main's latest green is checked again by the forge's own check. That happens once for each commit of main that checks green, at most three pulls per tick, and only when the week has no free slot. Held pulls and pulls without a head are skipped. The code is in src/checks/full_window_recheck.ts: recheckWhenFull is called from the autonomy tick in src/crew/autonomy.ts.
What /week shows. The repository's week page and the terminal's week screen print the same line from whileFullLine, for example "While the window was full: 6 rechecks, 2 landed." It only appears when something ran in the last seven days.
What changed since the last review:
- Keyed on the commit: the time a recheck is measured from is now the first green run of main's latest green commit. A second green run of the same commit no longer queues another recheck, and a test fails without this change.
- Formatting: in
src/crew/autonomy.tsthe.catchbody now matches the sweep call above it, and the new import sits with the other../checksimports. - Measurements: #15821's boxes don't say which measurement runs, how often, or what it costs, so I opened #15911 for that and made #10263 wait for it.
docs/features/week-while-full.mdlinks it.
Choices:
- The commit that first named a look page had picked
/settings/security/controls, which doesn't show this change. The week page is per repository and isn't inapp.looks, so a commit now waives the picture withNo look:instead of adding a page toforge.json. - The gate's "one implementation?" notes about similar helpers, and its note about one long comment line in
src/web/pages/week.ts, are left as they are.
Tests. bun scripts/gate.ts and bun x tsc --noEmit are clean. bun scripts/fast.ts named 3410 test files because autonomy.ts is imported almost everywhere, so I ran the four that cover the change: test/full-window-recheck.test.ts, test/week-doors.test.ts, test/autonomy.test.ts and test/autonomy_sweep.test.ts. They pass (40 tests).
How to try it. Open /<owner>/<repo>/week on the preview after a recheck has run with the window full.
🤖 Generated with Claude Code
Earlier asks are met. The terminal week screen prints the same whileFullLine as the page, and the how-to is docs/features/week-while-full.md rather than the README. The slots===0 guard is its own function with a test at 10% and 100%. The recheck is keyed on the first green run of main's latest green commit, with a test that fails without it. The autonomy.ts formatting and import placement are fixed. The measurements half of the title is split to #15911 and linked from the how-to. The line is one muted paragraph and uses no new component or accent. It is a link-free read-only line, so it works with JavaScript off and on a 360px phone. I found nothing new to block on.
Two things I would do next:
- Non-blocking: whileFull counts every stale_red recheck in the last seven days, not only those queued while the window was full. That is the same thing today, since only recheckWhenFull queues them, but a one-line comment saying so would stop a later caller from skewing the count.
- Non-blocking: add a week page to app.looks in forge.json so the gate can picture this line, instead of the No look waiver.
While the weekly window is full, the forge now rechecks stale reds with no model run, and
/weeksays what it did. Tests pass: the newtest/stale-red-recheck.test.tsand the existingtest/stale_reds.test.ts(11 in all), plustsc,gate.ts --fixanddesign-lintclean. I did not run the/weekpage against a running app. The window-full branch inautonomy.tsis also untested: the test callsrecheckStaleRedsdirectly.What changed
src/crew/stale_reds.ts) only rechecks within free builder slots. A full window gives it zero slots, so no recheck happened. This is therefore not already done on main.src/checks/stale_red.tsqueues a recheck (reasonstale_red) for each open pull whose latest check on its head failed before main's latest green finished. It skips held pulls and does nothing until main has a green. It queues at most 3 per tick, and a pull is rechecked once per green of main.autonomy.tscalls it each tick only whencrewWeekFor(...).slots === 0, i.e. the window is full. No builder is woken, so no allowance is spent./week: a single line, "While the window was full: N rechecks, M landed.", read from the last seven days. It is hidden when there were none. "Landed" counts pulls whose recheck went green and that merged afterwards.Left out
/weekcount covers the last seven days ofstale_redrechecks. It does not check that the window was full at that moment.Try it Open
/<owner>/<repo>/weekon a repo with astale_redrun in the last seven days. The line shows under the polish block.Closes #15821