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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2tt6qpm3j9 was degraded 54 minutes today: trevato/forge: "flow panel cache > an agent never sees an admin's figures" failed on 3 pulls in the last hour — the lan… #7185

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/7159-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork 1 thread · 1 unresolved

  • Merged. scout/7159-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as fe1d4a8.

Review

Sign in to review this change.
1 file changed +6 −6
test/flow-panel-cache.test.ts +6 −6
@@ -18,7 +18,7 @@ beforeAll(async () => {
1818 alice = u.value.id;
1919 app.db.run("INSERT INTO repo (id, owner_id, name, visibility) VALUES ('pub', ?1, 'pub', 'public')", [alice]);
2020 app.db.run("INSERT INTO repo (id, owner_id, name, visibility) VALUES ('priv', ?1, 'priv', 'private')", [alice]);
21 });
21 }, 30_000);

A 30 s timeout hides slow hashing rather than removing it. Insert the admin directly here too, as the agent test now does.

2222 afterAll(() => app.close?.());
2323
2424 /** Statements run against the db, counted. */
@@ -59,13 +59,13 @@ describe("flow panel cache", () => {
5959 expect(panelFigures(app.db, "owner", new Date(t.getTime() + PANEL_TTL_MS))).not.toBe(first);
6060 });
6161
62 test("an agent never sees an admin's figures", async () => {
63 const b = await createUser(app.db, { origin: "seed", trusted: true, username: "scout", email: "[email protected]", password: "a-good-passphrase" });
64 if (!b.ok) throw new Error(b.error);
65 app.db.run("UPDATE user SET is_agent = 1 WHERE id = ?1", [b.value.id]);
62 test("an agent never sees an admin's figures", () => {
63 // no password hashing here: a loaded machine took it past the test's timeout
64 const agentId = "agent-scout";
65 app.db.run("INSERT INTO user (id, username, email, password_hash, is_agent) VALUES (?1, 'scout', '[email protected]', 'x', 1)", [agentId]);
6666 const ago = new Date(Date.now() - 1_800_000).toISOString();
6767 for (const [id, n, repo] of [["a1", 1, "pub"], ["a2", 2, "priv"]] as const) {
68 app.db.run("INSERT INTO issue (id, repo_id, number, kind, title, body, author_id, state, created_at) VALUES (?1, ?2, ?3, 'pull', 't', '', ?5, 'open', ?4)", [id, repo, n, ago, b.value.id]);
68 app.db.run("INSERT INTO issue (id, repo_id, number, kind, title, body, author_id, state, created_at) VALUES (?1, ?2, ?3, 'pull', 't', '', ?5, 'open', ?4)", [id, repo, n, ago, agentId]);
6969 app.db.run("INSERT INTO pull (issue_id, base_branch, head_branch, base_oid, head_oid) VALUES (?1, 'main', 'b', '', 'h')", [id]);
7070 }
7171 const t = new Date();

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs