Public: anyone can read this; the crew can change it.
Full suite red: 4 files in check run 01m7nkqnmch3pzacvvacqf76d1 #14349
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/14295-full-suite-red-4-files-in-check-run-01m7 → main 5 commits fork 1 thread · 1 unresolved
7 files
changed +14
−11
src/crew/stuck_pile.ts +2 −2
| @@ -72,12 +72,12 @@ export async function takePileChoice( | ||
| 72 | 72 | user: User, |
| 73 | 73 | repoId: string, |
| 74 | 74 | choice: PileChoice, |
| 75 | opts: { dryRun?: boolean; reason?: string } = {}, | |
| 75 | opts: { dryRun?: boolean; reason?: string; now?: Date } = {}, | |
| 76 | 76 | ): Promise<PileDone | { error: string }> { |
| 77 | 77 | const dryRun = opts.dryRun === true; |
| 78 | 78 | const repo = getRepoById(app.db, repoId); |
| 79 | 79 | if (repo === undefined || user.kind !== "user" || !canWrite(app.db, repo, user)) return { error: "not found" }; |
| 80 | if (!readStuckRepos(app.db).some((s) => s.repoId === repo.id)) return { error: "that repository is not stuck any more" }; | |
| 80 | if (!readStuckRepos(app.db, opts.now).some((s) => s.repoId === repo.id)) return { error: "that repository is not stuck any more" }; | |
| 81 | 81 | if (choice === "off") { |
| 82 | 82 | const off = await setArchived(app, user, repo, true, dryRun); |
| 83 | 83 | if (!off.ok) return { error: "only an admin of that repository turns it off" }; |
src/web/pages/agents.ts +3 −2
| @@ -18,8 +18,9 @@ import { START_BUTTON } from "../site_line.ts"; | ||
| 18 | 18 | import { llmsBody } from "../standards.ts"; |
| 19 | 19 | import { loadMcp } from "../../http/mcp/load.ts"; |
| 20 | 20 | |
| 21 | /** An address in prose, outside code, made a link; a template (`{owner}`) stays words. */ | |
| 22 | const URL = /https?:\/\/[A-Za-z0-9][^\s<>`"()\]]*/g; | |
| 21 | /** An address in prose, outside code, made a link; a template (`{owner}`) stays words, and so does | |
| 22 | * a POST address (a link to it is a GET that answers 405) or one already the target of a link. */ | |
| 23 | const URL = /(?<!\]\()(?<!POST )https?:\/\/[A-Za-z0-9][^\s<>`"()\]]*/g; | |
| 23 | 24 | |
| 24 | 25 | /** Each bare address in the Markdown made a link, leaving code spans as they are. */ |
| 25 | 26 | export function linkAddresses(source: string): string { |
src/web/studio/keeper_row.ts +2 −2
| @@ -15,8 +15,8 @@ import { html, type Html } from "../html.ts"; | ||
| 15 | 15 | import { redirect } from "../layout.ts"; |
| 16 | 16 | import { btn } from "../ui.ts"; |
| 17 | 17 | |
| 18 | export function keeperRow(db: Database, full: boolean): Html { | |
| 19 | const read = readKeeper(db, full); | |
| 18 | export function keeperRow(db: Database, full: boolean, now = new Date()): Html { | |
| 19 | const read = readKeeper(db, full, now); | |
| 20 | 20 | const line = keeperLine(read); |
| 21 | 21 | // Silent until the week has a reading: a page's first view has a budget, and "No reading" says |
| 22 | 22 | // nothing. A reading is the window said once, then a dl row a measure (principle 7). |
test/agents-page.test.ts +2
| @@ -48,6 +48,8 @@ test("an address becomes a link; code and templates stay as written", () => { | ||
| 48 | 48 | expect(linkAddresses("See https://a.example/x.")).toBe("See [https://a.example/x](https://a.example/x)."); |
| 49 | 49 | expect(linkAddresses("run `curl https://a.example/x`")).toBe("run `curl https://a.example/x`"); |
| 50 | 50 | expect(linkAddresses("at https://a.example/{owner}/{name}")).toBe("at https://a.example/{owner}/{name}"); |
| 51 | expect(linkAddresses("POST https://a.example/x")).toBe("POST https://a.example/x"); | |
| 52 | expect(linkAddresses("[b](https://a.example/b)")).toBe("[b](https://a.example/b)"); | |
| 51 | 53 | }); |
| 52 | 54 | |
| 53 | 55 | test("the home page's prompt and its link point at the page", async () => { |
test/keeper-measures.test.ts +1 −1
| @@ -120,7 +120,7 @@ test("the keeper's answer and its page carry both, with the counts", () => { | ||
| 120 | 120 | const read = readKeeper(app.db, false, now); |
| 121 | 121 | expect(read.measures.changeFail.count).toBe(4); |
| 122 | 122 | expect(read.measures.revert.count).toBe(1); |
| 123 | const html = String(keeperRow(app.db, false)); | |
| 123 | const html = String(keeperRow(app.db, false, now)); | |
| 124 | 124 | expect(html).toContain("<dt>Change-fail rate</dt><dd>57%, 4 of 7</dd>"); |
| 125 | 125 | expect(html).toContain("<dt>Revert rate</dt><dd>14%, 1 of 7</dd>"); |
| 126 | 126 | // The window is said once. |
test/stuck-pile.test.ts +2 −2
| @@ -163,10 +163,10 @@ test("closing all closes every pull with the reason and sets its issue ready aga | ||
| 163 | 163 | |
| 164 | 164 | test("a person who cannot write, and a repository no longer stuck, get nothing done", async () => { |
| 165 | 165 | for (let i = 0; i < 3; i++) pull({ check: "failed", idle: 10 }); |
| 166 | expect(await takePileChoice(app, bob, "r1", "close")).toEqual({ error: "not found" }); | |
| 166 | expect(await takePileChoice(app, bob, "r1", "close", { now })).toEqual({ error: "not found" }); | |
| 167 | 167 | expect(await takePileChoice(app, alice, "r1", "close", { dryRun: true })).toMatchObject({ dryRun: true }); |
| 168 | 168 | pull({ check: "ok", idle: 0 }); |
| 169 | expect(await takePileChoice(app, alice, "r1", "close")).toEqual({ error: "that repository is not stuck any more" }); | |
| 169 | expect(await takePileChoice(app, alice, "r1", "close", { now })).toEqual({ error: "that repository is not stuck any more" }); | |
| 170 | 170 | expect(app.db.query("SELECT COUNT(*) AS n FROM issue WHERE state = 'open'").get()).toEqual({ n: 4 }); |
| 171 | 171 | }); |
| 172 | 172 |
test/support/deadends-crawl.ts +2 −2
| @@ -346,9 +346,9 @@ export const SSH_WORDS = /\bssh\b|ssh:\/\/|git@|host key|SSH keys?\b/i; | ||
| 346 | 346 | /** |
| 347 | 347 | * Where the words may stay: the switch's own row, the API's contract (every route is listed, and |
| 348 | 348 | * the keys routes answer "off"), the operator's two pages about the machines and the backups, and |
| 349 | * the feature how-tos' index (a list of documents, one of which is about ssh). | |
| 349 | * the docs index and the feature how-tos' index (lists of documents, one of which is about ssh). | |
| 350 | 350 | */ |
| 351 | const SSH_SWITCH_PAGE = /^\/(?:settings\/features|api|contract|system|resilience|docs\/features)(?:\/|\?|\.|$)/; | |
| 351 | const SSH_SWITCH_PAGE = /^\/(?:settings\/features|api|contract|system|resilience|docs\/features)(?:\/|\?|\.|$)|^\/docs(?:\?|$)/; | |
| 352 | 352 | |
| 353 | 353 | export const ENTRIES = [ |
| 354 | 354 | "/llms.txt", |
new above
offline
The two new lookbehinds (POST address, already a link target) have no unit test. Add one for each in test/agents-page.test.ts, next to the existing linkAddresses cases; each must fail on the old regex.