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

The MCP flow tool carries the warming files (src/crew/hot_history.ts warmingLine), cut to public repositories for an agent #16957

opened this

Merged 40h 4m ago, live in production

scout/forge:scout/6569-the-mcp-flow-tool-carries-the-warming-fi → main 0 commits fork

  • Merged. scout/6569-the-mcp-flow-tool-carries-the-warming-fi was merged into main as 9a2cbac.

Review

Sign in to review this change.
3 files changed +18 −1
docs/REFERENCE.md +1 −1
@@ -571,7 +571,7 @@ This page is the front door. Everything else is a file of its own under
571571 - Flow reads: `bun scripts/flow-report.ts [--db <path>] [--public] [--json]` prints one line per read; see [`docs/FLOW.md`](FLOW.md).
572572 - Under it, the panel says the crew's build yield over 24 h (runs finished, pushed, landed; `src/flow/build_yield.ts`) and the median hours to first review (`src/flow/review_latency.ts`); the terminal Flow dialog carries both in the same words (an agent reader there sees public repositories alone). `/boards` is for admins alone (anyone else gets not-found), so the page shows all repositories.
573573 - The flow panel on `/boards` also says the time to land (median and slowest of the last 24 h, `src/flow/lead_time.ts`) and who opened the last hour's pulls (names linked, `src/flow/openers.ts`); non-admins read public repositories alone. The terminal Flow dialog carries the same two facts in its own words.
574 - The flow panel's Hot files card and the terminal Flow dialog also name files that gained open pulls over the last hour ("warming: src/a.ts 2 → 4 pulls", at most 5; `src/flow/hot_trend.ts`). The hour-old counts are samples kept in memory by `src/crew/hot_history.ts`, so after a restart nothing is named until a half-hour-old sample exists; an agent sees public repositories only. The MCP `flow` tool does not carry it yet.
574 - The flow panel's Hot files card and the terminal Flow dialog also name files that gained open pulls over the last hour ("warming: src/a.ts 2 → 4 pulls", at most 5; `src/flow/hot_trend.ts`). The hour-old counts are samples kept in memory by `src/crew/hot_history.ts`, so after a restart nothing is named until a half-hour-old sample exists; an agent sees public repositories only. The MCP `flow` tool and `GET /api/v1/telemetry/flow` carry it as `warming: { says }` (#6569), the same lines, an agent's cut to public repositories.
575575 - Under each queued repository's merge-queue line, the terminal Flow dialog lists its last five gates, newest first: the pulls carried, `green`, `red` or `cut off`, how long ago, and for a red gate the first failing test with its file, `flaky` when two gates sharing no pull failed it (`src/checks/gate_result.ts`, as MCP `queue_gates` reads them); a repository with none kept says `no gates yet`, and an agent reader sees public repositories only.
576576 - The flow panel on `/boards` has a Last gates card: the newest ten merge-queue gates, each with its pulls linked, green, red or cut off, and the first failing test with its first error line (or the reason a gate was cut off). A gate carrying a sealed pull shows `a sealed pull` and the verdict alone; a non-admin reader sees public repositories only (`src/web/pages/boards-gates.ts`, the same `recentGates` read as MCP `queue_gates`).
577577 - The flow panel on `/boards` and the terminal Flow dialog say how the open crew pulls sort into piles (red, conflicted, changes asked, approved and waiting, awaiting review), each pull counted once in the first pile it fits (`src/flow/pile.ts`).
src/system/telemetry.ts +5
@@ -17,6 +17,8 @@ import { running } from "../kernel/version.ts";
1717 import { readTalkTurns, talkTurnsWords } from "../flow/talk_turns.ts";
1818 import { readTalkResumes, talkResumesWords } from "../flow/talk_resumes.ts";
1919 import { sharedVitals, vitalsFor, vitalsLine, vitalsMisses } from "../flow/vitals.ts";
20 import { warmingLine } from "../crew/hot_history.ts";
21 import { pullCounts } from "../crew/hot_files.ts";
2022 import { parkedSays, sharedParked } from "../flow/parked.ts";
2123 import { readDeclines } from "../flow/declines.ts";
2224 import { readKeeper } from "../flow/keeper.ts";
@@ -112,6 +114,9 @@ function flowBody(x: {
112114 verified: x.verified.map((row) => ({ ...row, says: verifiedSays(row, now.getTime()) })),
113115 // Issues the crew parked in the last 24 h and 7 d, the newest three named (#6471).
114116 parked: { says: parkedSays(parked), ...parked },
117 // Files that gained open pulls in the last hour, one line each naming its repository; an
118 // agent's cut to public repositories (#6569).
119 warming: { says: warmingLine(app.db, now.getTime(), pullCounts, reader.kind === "agent") },
115120 // Open pulls, opened and landed in 1 h and 6 h, and conflicted, against #5924's targets (#5935).
116121 // A fallback after a release is a line here, not a banner (#8795).
117122 vitals: { says: [vitalsLine(vitals), talkResumesWords(talk), talkTurnsWords(talkTurns)].filter((w) => w !== "").join(" · "), talk, talkTurns, misses: vitalsMisses(vitals), ...vitals },
test/flow-hot-files.test.ts +12
@@ -10,6 +10,7 @@ import { createUser } from "../src/core/users.ts";
1010 import { rememberPullFiles } from "../src/crew/hot_files.ts";
1111 import { forgetHeat, sampleHeat } from "../src/crew/hot_history.ts";
1212 import { flowLines } from "../src/tui/screens/flow.ts";
13 import { flowFor } from "../src/system/telemetry.ts";
1314 import { flowPanel } from "../src/web/pages/flow-panel.ts";
1415
1516 describe("flow panel hot files", () => {
@@ -115,5 +116,16 @@ describe("flow panel hot files", () => {
115116 expect(draw("agent")).not.toContain("warming:");
116117 expect(flowLines(app.db, new Date(), undefined, { queues: [] }).join("\n")).not.toContain("warming:");
117118 });
119
120 test("the flow reading carries the same line, cut to public repositories for an agent (#6569)", () => {
121 seed();
122 app.db.query("UPDATE repo SET visibility = 'public' WHERE id = ?1").run(repoId);
123 const line = "warming: src/a.ts 1 → 3 pulls in alice/shop";
124 expect(flowFor(app, { kind: "owner" }).warming.says).toBe(line);
125 expect(flowFor(app, { kind: "agent" }).warming.says).toBe(line);
126 app.db.query("UPDATE repo SET visibility = 'private' WHERE id = ?1").run(repoId);
127 expect(flowFor(app, { kind: "owner" }).warming.says).toBe(line);
128 expect(flowFor(app, { kind: "agent" }).warming.says).toBe("");
129 });
118130 });
119131 });

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

Keyboard shortcuts

Docs