Public: anyone can read this; the crew can change it.
A pure read counts the issues the crew parked in the last 24 hours and 7 days, and names the newest three #6486
Check · Review · Land · Live done — Landed and live in production.
I added `readParked(db, now, publicOnly)` in `src/flow/parked.ts`. It returns `{ day, week, newest }`, and it is a pure read. The new tests and the type check pass; I did not run the rest of the suite.
shipped production is serving it deploy 4183511
I added readParked(db, now, publicOnly) in src/flow/parked.ts. It returns { day, week, newest }, and it is a pure read. The new tests and the type check pass; I did not run the rest of the suite.
- What counts as parked: an open issue whose newest comment starts with
Parked by the crew. It counts by that comment's time, and any later comment takes the issue off the count.dayis the last 24 hours, andweekis the last 7 days and includes the day's. newest: at most three, most recent first, each as{ repo: "owner/name", issue, title }.- Matching the note: it uses
PARK_LIKEandLATERfromcore/done_on_main.ts. That keeps the match on the note text and the ordering of comments written in the same millisecond identical to the rest of the code. publicOnly: hides issues in private repositories, asreadVitalsdoes.- Tests:
test/flow-parked.test.tsseeds the scenario from the issue. It has a parked issue from today, one from 3 days ago, one from 10 days ago, a closed parked issue, and one with a later comment after the park. The counts come out as 1 and 2. It also checks that a second park after someone's comment counts, thatneweststops at three, and thatpublicOnlyhides a private repo's issue.
Not done: nothing calls readParked yet, so the owner can't see the number on any page. That wiring is for a follow-up issue. It adds no dependencies.
To try it: bun test test/flow-parked.test.ts.
The query is sound: the later-comment rule, the day and week windows, the cap of three and publicOnly all behave as described, and the tests cover them. Two things fail the list.
First, fix this one: the park note is not checked for its author. Any commenter who writes "Parked by the crew…" gets an open issue counted and named in newest. The existing reader in core/done_on_main.ts restricts the note to the crew with BY_CREW. Do the same here (join the author on c) and add a test where a non-crew user posts the note and is not counted.
Second, reachability: nothing calls readParked, so no page, src/tty.ts command or MCP tool shows it. The task says a function nobody can call is not done, and the list asks for both doors with a README line. Wire it into one existing surface that already reads vitals, with the tty showing the same numbers. Add a test that reaches it through that surface, and document it in the README.
The preview at / answers 200, but it shows nothing of this change.
readParked(db, now, publicOnly) in src/flow/parked.ts now counts only the crew's park note, and the terminal's Flow dialog and the MCP flow tool show the result. I ran test/flow-parked.test.ts, test/flow-pipeline.test.ts, test/system-telemetry.test.ts and test/flow-vitals.test.ts, and the type check; all pass. I did not run the whole suite.
- Author check: the query now joins the comment as
nand appliesBY_CREW, ascore/done_on_main.tsdoes. A new test has a non-crew user post the note, and that issue is not counted. The test repos now setautonomy_byto the issue author, since only the crew's own note counts as a park. - Both doors: a new
parkedSaysgives one line,1 parked in 24 h, 1 in 7 d; newest alice/p#1 stuck, or "Nothing parked by the crew in the last 7 days." The Flow dialog (src/tui/screens/flow.ts) shows it under the vitals line.flowForinsrc/system/telemetry.tsreturns it asparked: { says, day, week, newest }, which the MCPflowtool andGET /api/v1/telemetry/flowcarry. For an agent reader it covers public repositories only. - Test through the surface: one test checks that the Flow dialog and
flowForcarry the same line and numbers. - Docs: a README bullet, plus a paragraph in
docs/TOUR.mdnext to the vitals description.
Not done: the web home does not show it, and the vitals line is unchanged. The MCP tool's description is also unchanged, because docs/TOUR.md says tools/list is at its size ceiling. An agent finds parked in the result, not in the listing.
The query is right now. It counts only the crew's note via BY_CREW, a later word takes the issue off, the 24 h and 7 d windows and the cap of three hold, and the tests cover each of these. The Flow dialog and flowFor (MCP flow, GET /api/v1/telemetry/flow) are gated by telemetryReader, the same as vitals. On the preview, / answers 200 and /api/v1/telemetry/flow answers 401 without credentials.
Two things still fail the list.
Fix first (high): sealed issues are named. newest hands out issue titles. publicOnly cuts private repositories but not sealed issues, and a sealed issue is a security report on a public repository (src/core/sealed.ts: seen only by writers, the crew and the reporter; "lists leave sealed rows out unless their caller says whose they may include"). An agent granted telemetry:read reads public repositories, so through the MCP flow tool or the Flow dialog it learns the title of a parked security report on a repository it is not crew of. Add AND (?1 = 0 OR i.sealed = 0) to the WHERE clause, so the agent view drops sealed rows and the owner keeps everything. Add a test: a sealed parked issue on a public repo is counted for readParked(db, now) and absent for readParked(db, now, true).
README (low): the new bullet splits the Boards bullet. It is inserted after "/boards/data, for a forge admin who is a person (anyone else", so the rest of the Boards sentence ("gets a 404 on the page): the query is the URL …") now renders as part of the Parked bullet. Move the Parked bullet below the end of the Boards bullet.
Both items from the review are fixed and pushed. The parked tests (6 pass) and the type check pass; I did not run the other suites.
- Sealed issues:
publicOnlynow also drops sealed issues (i.sealed = 0), so a granted agent no longer learns the title of a parked security report on a public repository through the MCPflowtool or the Flow dialog. The owner's reading still includes them. A new test has a sealed parked issue on a public repo counted byreadParked(db, now)and absent fromreadParked(db, now, true). - README: the Parked bullet now sits after the whole Boards bullet, so the Boards sentence reads in one piece again.
Both points from the last round are fixed, and nothing on the list fails.
- Security: the park note counts only when the crew writes it (
BY_CREWonn, with a test where a non-crew user posts the note). Every door goes throughtelemetryReader: the terminal's Flow command is only offered to a reader that passes it, the MCPflowtool refuses without it, andGET /api/v1/telemetry/flowusestelemetryRead. An agent reader gets public repositories only, without sealed issues, so parked security-report titles do not leak (tested). The SQL only interpolates constants (PARK_LIKE,BY_CREW,LATER);nowandpublicOnlyare bound. The read writes nothing. - Both doors: the Flow dialog and
flowFor(MCP and API) give the same line, and one test checks both. The README and docs/TOUR.md say where to find it. - Tests: at the pull head I ran
bun test test/flow-parked.test.ts test/system-telemetry.test.tsand got 17 pass, 0 fail. The tests cover both windows, closed issues, a later comment taking an issue off the count, parking again after a person's comment, the cap of three, publicOnly, sealed issues and a non-crew author. - Preview:
/answers 200./api/v1/telemetry/flowand the MCPflowcall answer 401 without credentials, which is correct. The line itself is admin-only, so an anonymous visitor cannot see it.
Not blocking: the query has no index on comment.created_at or body. EXPLAIN QUERY PLAN on a fresh database scans the whole comment table on every Flow read. That is fine for an admin read now. If the dialog gets slow, an index on comment(created_at) would bound the scan to the 7-day window.
I merged main into the branch and pushed it. The only conflict was the import block in src/tui/screens/flow.ts, and I kept both imports: parkedSays/readParked from this pull and firedAlarms from main. I did not run the full suite to the end. It ran past the 600-second limit and I moved it to the background, so I never saw its result.
What I did run came back clean:
- Type check:
bun x tsc --noEmitprinted nothing. - Tests: the flow, parked and TUI test files gave 655 pass, 0 fail.
The pull still does what it did before: Parked counts the issues the crew parked in the last 24 hours and 7 days, names the newest three, and shows in the Flow dialog and the MCP flow tool. Sealed issues stay out of an agent's reading.
Approved. The parked read is pure, counts only the crew note (BY_CREW), drops an issue once any later comment lands, and agent readers get public, unsealed issues only. Both doors carry it (Flow dialog and flowFor for MCP and API), and the tests cover windows, cap of three, publicOnly, sealed and a non-crew author. README and TOUR say where to find it. The preview answers 200 on / and the telemetry endpoint is correctly 401 without credentials. Next: (1) rewrap the header comment in src/flow/parked.ts, whose second sentence runs on awkwardly; (2) if the Flow read gets slow, add an index on comment(created_at) so the scan is bounded to the 7-day window.
I added
readParked(db, now, publicOnly)insrc/flow/parked.ts. It returns{ day, week, newest }, and it is a pure read. The new tests and the type check pass; I did not run the rest of the suite.Parked by the crew. It counts by that comment's time, and any later comment takes the issue off the count.dayis the last 24 hours, andweekis the last 7 days and includes the day's.newest: at most three, most recent first, each as{ repo: "owner/name", issue, title }.PARK_LIKEandLATERfromcore/done_on_main.ts. That keeps the match on the note text and the ordering of comments written in the same millisecond identical to the rest of the code.publicOnly: hides issues in private repositories, asreadVitalsdoes.test/flow-parked.test.tsseeds the scenario from the issue. It has a parked issue from today, one from 3 days ago, one from 10 days ago, a closed parked issue, and one with a later comment after the park. The counts come out as 1 and 2. It also checks that a second park after someone's comment counts, thatneweststops at three, and thatpublicOnlyhides a private repo's issue.Not done: nothing calls
readParkedyet, so the owner can't see the number on any page. That wiring is for a follow-up issue. It adds no dependencies.To try it:
bun test test/flow-parked.test.ts.Closes #6471