Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:10bdvndtlg is past its budget: trevato/forge: "each page stays inside its first-view budget" failed on 3 pulls in the last hour — the lane's red, not … #17106

opened this

Merged 2d 2h ago, live in production

scout/forge:scout/17087-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 0 commits fork

  • Merged. scout/17087-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as 18b6c25.

Review

Sign in to review this change.
2 files changed +30 −2
test/attention.test.ts +19
@@ -12,6 +12,7 @@
1212 import { afterAll, beforeAll, expect, test } from "bun:test";
1313 import { readFileSync, writeFileSync } from "node:fs";
1414 import { firstView, WIDTHS, type Attention } from "../src/measure/attention.ts";
15 import { noteKeeperAtBoot } from "../src/keeper/at_boot.ts";
1516 import { quietLogs } from "./helpers/globals.ts";
1617 import { freshStallState } from "./helpers/stall-state.ts";
1718 import { measure, openFirstViews, overBudget, pinnedSystem, type Budget, type FirstViews } from "./helpers/first-views.ts";
@@ -72,6 +73,24 @@ test("a /system read once its background measures finish counts as the unmeasure
7273 }
7374 });
7475
76 test("a /system drawn after the release keeper was noted off counts as one drawn before (#17087)", async () => {
77 // The keeper's boot answer is the process's: an earlier file that boots main.ts leaves it noted,
78 // and /system then lists it. The budget must not move with what ran first.
79 try {
80 noteKeeperAtBoot({ on: false, why: "FORGE_RELEASE_KEEPER=swap needs FORGE_SELF_SWAP=1" });
81 const raw = await views.get("/system");
82 expect(raw).toContain('id="sys-outside"');
83 const pinned = pinnedSystem(raw);
84 for (const w of WIDTHS) {
85 const want = firstView(pages.system!, w);
86 const got = firstView(pinned, w);
87 expect({ words: got.words, blocks: got.blocks }).toEqual({ words: want.words, blocks: want.blocks });
88 }
89 } finally {
90 noteKeeperAtBoot(undefined);
91 }
92 });
93
7594 test("the budget file names every page at both widths and no other", () => {
7695 // A budget for every page at both widths, and no stale page in the file.
7796 const budget = JSON.parse(readFileSync(BUDGET, "utf8")) as Budget;
test/helpers/first-views.ts +11 −2
@@ -88,8 +88,17 @@ const fixedReads = (html: string): string =>
8888 )
8989 .replace(/not read: not running in a cluster/g, UNREAD_CLUSTER);
9090
91 /** /system as the budget counts it: the cap lines fixed and the background readings unmeasured. */
92 export const pinnedSystem = (html: string): string => fixedReads(fixedCaps(html));
91 // "Needs a hand outside the forge" lists what the release keeper said at boot
92 // (`keeper/at_boot.ts`): process-wide state that main.ts, or any earlier file in the same
93 // `bun test` process, notes. Noted off it is one more line, 11 or 12 words and a block (#17087);
94 // the budget counts the page as a fresh process draws it, with nothing noted.
95 const noOutside = (html: string): string => html.replace(/<ul class="list small" id="sys-outside"[^>]*>[\s\S]*?<\/ul>/, "");
96
97 /**
98 * /system as the budget counts it: the cap lines fixed, the background readings unmeasured, and
99 * no keeper line.
100 */
101 export const pinnedSystem = (html: string): string => noOutside(fixedReads(fixedCaps(html)));
93102
94103 /** The measured pages, and the forge they came from, still serving until `close`. */
95104 export interface FirstViews {

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs