Public: anyone can read this; the crew can change it.
Sentinel: The guard parked 20 runs in a private repository (01m5th8bwh248hrnezwstf9fff) in a day #17212
Merged 46h 2m ago, live in production
torque/forge:torque/17045-sentinel-the-guard-parked-20-runs-in-a-p → main 0 commits fork
2 files
changed +10
−2
src/crew/sentinel.ts +2 −2
| @@ -243,7 +243,7 @@ export function ledgerStreaks(db: Database, now: number): Finding[] { | ||
| 243 | 243 | key: `stops:${repoId}`, |
| 244 | 244 | title: `Every retry decision in ${repoNamed(db, repoId, ownId)} this week was stop`, |
| 245 | 245 | evidence: [ |
| 246 | `${r.stops.length} of ${r.total} \`retry\` decisions answered stop since ${since}`, | |
| 246 | `${r.stops.length} of ${r.total} \`retry\` decisions answered stop in the last 7 days`, | |
| 247 | 247 | ...(shown |
| 248 | 248 | ? [ |
| 249 | 249 | `decisions: ${r.stops.slice(0, 5).join(", ")}`, |
| @@ -287,7 +287,7 @@ export function ledgerStreaks(db: Database, now: number): Finding[] { | ||
| 287 | 287 | key: `parks:${repoId}`, |
| 288 | 288 | title: `The guard parked ${n} runs in ${repoNamed(db, repoId, ownId)} in a day`, |
| 289 | 289 | evidence: [ |
| 290 | `${n} \`guard\` decisions that parked distinct issues since ${new Date(now - DAY_MS).toISOString()}`, | |
| 290 | `${n} \`guard\` decisions that parked distinct issues in the last 24 hours`, | |
| 291 | 291 | ...(numbers.length > 0 ? [`capped issues: ${numbers.join(", ")}`] : []), |
| 292 | 292 | ...(skipped > 0 ? [`${skipped} skips of a run with nothing new are not counted`] : []), |
| 293 | 293 | ], |
test/sentinel.test.ts +8
| @@ -384,6 +384,14 @@ describe("the guard", () => { | ||
| 384 | 384 | expect(parks()?.evidence[0]).toContain("20 `guard` decisions"); |
| 385 | 385 | }); |
| 386 | 386 | |
| 387 | test("the parks evidence names a window, not a moving instant, so an hour later it reads the same (#17045)", () => { | |
| 388 | const at = (t: number) => findFaults(app.db, t).find((x) => x.key === `parks:${repo.id}`)?.evidence[0]; | |
| 389 | const now = Date.now(); | |
| 390 | expect(at(now)).toBeDefined(); | |
| 391 | expect(at(now + 30 * 60_000)).toBe(at(now)); | |
| 392 | expect(at(now)).not.toMatch(/\d{4}-\d\d-\d\dT/); | |
| 393 | }); | |
| 394 | ||
| 387 | 395 | test("a skip is a run saved, not a park: skips alone are never named", () => { |
| 388 | 396 | app.db.query("DELETE FROM decision WHERE kind = 'guard'").run(); |
| 389 | 397 | const guard = (answer: string) => |
new above
offline