Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:j1dz21msba is past its budget: trevato/forge: "a scorecard row per team > the page shows a team row with its pooled figures, to an admin only" failed … #7691
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/7631-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 6 commits fork
1 file
changed +6
−4
test/crew-team-scorecard.test.ts +6 −4
| @@ -27,11 +27,13 @@ describe("a scorecard row per team", () => { | ||
| 27 | 27 | let repoId = ""; |
| 28 | 28 | let reviewer = ""; |
| 29 | 29 | const ids: Record<string, string> = {}; |
| 30 | // Opened two days before the run, so "the last 30 days" holds whatever the date. | |
| 31 | const twoDaysAgo = new Date(Date.now() - 2 * 86_400_000).toISOString(); | |
| 30 | 32 | |
| 31 | 33 | function pull(author: string, title: string, merged: boolean, hours = 2, openedAt?: string) { |
| 32 | 34 | const issue = createIssue(app.db, { repoId, authorId: ids[author]!, title, kind: "pull" }); |
| 33 | 35 | if (!issue.ok) throw new Error(issue.error); |
| 34 | const opened = openedAt ?? "2026-10-01T00:00:00.000Z"; | |
| 36 | const opened = openedAt ?? twoDaysAgo; | |
| 35 | 37 | app.db.query(`UPDATE issue SET created_at = ?2 WHERE id = ?1`).run(issue.value.id, opened); |
| 36 | 38 | const mergedAt = merged ? new Date(Date.parse(opened) + hours * 3_600_000).toISOString() : null; |
| 37 | 39 | app.db |
| @@ -114,7 +116,7 @@ describe("a scorecard row per team", () => { | ||
| 114 | 116 | expect(cards.has(three!)).toBe(false); |
| 115 | 117 | // The members' own cards are unchanged by pooling. |
| 116 | 118 | expect(crewScorecards(app.db).get(ids.a1!)!.reviewRounds).toBe(1); |
| 117 | // Oct 1 is inside the last 30 days; the idle team is still absent. | |
| 119 | // Two days ago is inside the last 30 days; the idle team is still absent. | |
| 118 | 120 | expect(teamScorecards(app.db, recentWindow()).has(three!)).toBe(false); |
| 119 | 121 | }); |
| 120 | 122 | |
| @@ -137,8 +139,8 @@ describe("a scorecard row per team", () => { | ||
| 137 | 139 | const cells = [...row.matchAll(/<td class="num">([\s\S]*?)<\/td>/g)].map((m) => |
| 138 | 140 | m[1]!.replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim(), |
| 139 | 141 | ); |
| 140 | // Landed, review rounds, red checks, then reverts. | |
| 141 | expect(cells.slice(0, 4)).toEqual(["4 of 4", "0.3", "25%", "0"]); | |
| 142 | // 30 days beside all time: landed, review rounds, red checks; then reverts. | |
| 143 | expect(cells.slice(0, 7)).toEqual(["4 of 4", "4 of 4", "0.3", "0.3", "25%", "25%", "0"]); | |
| 142 | 144 | // A team without a card has no row, and the team rows sit under the agents. |
| 143 | 145 | expect(table).not.toContain(`data-team="${three}"`); |
| 144 | 146 | expect(table.indexOf("a1")).toBeLessThan(table.indexOf(`data-team="${one}"`)); |
new above
offline