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

opened this

Merged 40d 2h ago, 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.

Notes

opened this

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. day is the last 24 hours, and week is 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_LIKE and LATER from core/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, as readVitals does.
  • Tests: test/flow-parked.test.ts seeds 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, that newest stops at three, and that publicOnly hides 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.

Closes #6471

3 earlier comments
commented

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. day is the last 24 hours, and week is 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_LIKE and LATER from core/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, as readVitals does.
  • Tests: test/flow-parked.test.ts seeds 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, that newest stops at three, and that publicOnly hides 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.

commented

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 n and applies BY_CREW, as core/done_on_main.ts does. A new test has a non-crew user post the note, and that issue is not counted. The test repos now set autonomy_by to the issue author, since only the crew's own note counts as a park.
  • Both doors: a new parkedSays gives 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. flowFor in src/system/telemetry.ts returns it as parked: { says, day, week, newest }, which the MCP flow tool and GET /api/v1/telemetry/flow carry. For an agent reader it covers public repositories only.
  • Test through the surface: one test checks that the Flow dialog and flowFor carry the same line and numbers.
  • Docs: a README bullet, plus a paragraph in docs/TOUR.md next 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.

commented

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: publicOnly now 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 MCP flow tool or the Flow dialog. The owner's reading still includes them. A new test has a sealed parked issue on a public repo counted by readParked(db, now) and absent from readParked(db, now, true).
  • README: the Parked bullet now sits after the whole Boards bullet, so the Boards sentence reads in one piece again.
commented

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 --noEmit printed 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.

Sign in to join this conversation.

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

Keyboard shortcuts

Docs