Repository navigation
feat(pm-stack): the console becomes the app: Now, Next, Needs me, Ask - #12452
Conversation
The owner could not see what was in progress or answer the questions
waiting on him: the dashboard's Needs-you page streams fragments of
up to 914 KB each, uncompressed, over the laptop's uplink, and the
console's own overview took 22 seconds because each page fanned out to
GitHub and the queue store while he waited.
State kept ready
- Each source (queue board, agent sessions, the needs-you census, open
questions, owner prompts, pull requests, ranked issues, agents,
units) is a section read in the background and served from memory
with the time it was read and the error if the last read failed. A
page never waits on a live fan-out. Three documents are built from
the sections (core, questions, ops), each with an ETag, compressed.
- Nothing is read while nobody is looking.
Primary screens
- Now: claimed tasks with the worker, how long, and the next step the
worker recorded; agent sessions that are moving; why tasks are
blocked.
- Next: the queue in the order it will be picked up, with Do first,
Sooner, Later and Cancel; ranked issues.
- Needs me: every open question from the decision sets with the
recommended option marked, one tap to answer with a few seconds to
undo, "Accept all recommended" per set, "Decide for me", a written
answer; the things only a person can do, with "I did it"; reviews.
Answers go through the dashboard's own endpoint; the per-set tokens
never leave the host.
- Ask: what he wants, typed or dictated, becomes an issue labelled
owner/prompt and a top-band queue task in the same pass; replies
show as a thread, and his reply wakes the fleet again.
- More: queue, pull requests, ranked issues, agents, services, and the
dashboard's pages grouped as the dashboard groups them.
Also
- One endpoint, POST /console/api/act {kind, args}: sixteen named
actions, each audited before it runs, without the text he typed.
- Moving a queued task is the one write this service makes to the queue
store (the queue has no verb for it): one column, one queued row.
- The gate compresses the dashboard's pages and fragments on the way to
the phone, and / goes to the app (the dashboard's home is /?dashboard).
- scripts/demo.ts runs the interface against canned state.
Tests: 49 bun tests (16 new).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
…nd on demand The questions document was 201 KB compressed for 360 questions. The list now carries one line of background per question and the rest is read when a question is opened; an answer no longer refetches the list. Tests: 49 bun tests; 30 planted faults in the new screens' server code are caught (questions, tokens, prompts, task moves, the state documents, compression, the action log). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
… sign-in; the stack keeps its processor share - The queue's validator accepts a fixed set of dedupe-key patterns, and an owner-prompt key was not one of them, so a prompt would have been filed and never queued. Found by a dry run against the real queue. A prompt's task now takes the issue's triage key at the top band, so an issue never has two tasks and a reply joins or follows the first. - A sign-in lasts 720 hours instead of 24. - pm-console-expose.timer re-runs the exposure script every quarter hour: when the Google sign-in secrets exist, Google turns on by itself. - CPUWeight=900 for the console, and in the NixOS module for the dashboard, dispatch and tunnel: the laptop ran at a load average of 75 on 16 cores while the fleet compiled, and the management plane starved. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…n install manifest - Web Push with the platform's own cryptography (RFC 8291 aes128gcm, RFC 8292 VAPID): no dependency. The server's key pair is made on first use and kept in the state directory; nobody handles it. A subscription must name a known push service, since the server posts to it. - A notifier compares the state with what the owner has already been told and sends the difference, once each: the fleet replied to a prompt, something new needs his hands, new questions, a unit failed. The first pass only takes stock. Nothing is read while no device is subscribed. - A service worker at /console/sw.js shows the notification and opens the right screen when it is tapped. - More, Notifications: turn on or off for this device, send a test, and choose which of the four kinds reach him. - /manifest.webmanifest is now the app's: the home-screen icon opens the app, not the old Needs-you page, and a long press offers Ask, Needs me, Now and Next. Tests: 57 bun tests (8 new). The test plays the browser: it decrypts what the server sends with the receiving half of RFC 8291 written from the RFC, and verifies the VAPID signature. Outside the suite, the http_ece library (what the web-push package uses) opens the same bytes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42cbe0e551
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| OnBootSec=5min | ||
| OnUnitActiveSec=15min | ||
| RandomizedDelaySec=60 |
There was a problem hiding this comment.
Register the new console exposure timer
The installer now enables this recurring timer, but doc/fleet-schedule-registry.md has no entry for pm-console-expose.timer (verified by searching the registry for console and expose). This leaves a job that repeatedly reconciles public exposure and sign-in configuration invisible to the fleet's schedule audit. Add its cadence, service, and execution surface to the registry in the same change, as required by the root schedule rule.
AGENTS.md reference: AGENTS.md:L56-L61
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Real. Fixed in the follow-up PR #12454: the registry lists the timer under laptop systemd user timers and the console's two process loops under PM-stack process intervals.
Generated by Claude Code
| const port = Number(process.argv[2] ?? 4899); | ||
| Bun.serve({ |
There was a problem hiding this comment.
Validate demo arguments before opening the listener
Running bun run scripts/demo.ts 4899 --dry-run silently ignores the extra flag and starts the server: only process.argv[2] is inspected before Bun.serve. The repository's operator-script contract explicitly covers pm-stack scripts and requires every unaccounted argument to produce a nonzero usage error before network activity. Parse the complete argument list, reject extra positionals and unknown flags, and document the accepted contract in the header.
AGENTS.md reference: AGENTS.md:L44-L48
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Real. Fixed in #12454: the demo takes an optional port and exits 2 with a usage line on anything else.
Generated by Claude Code
| const key = `${q.set}|${q.ledger}|${q.qid}`; | ||
| if (pending.has(key)) return null; | ||
| const id = { set: q.set, ledger: q.ledger, qid: q.qid }; | ||
| const picked = new Set(); |
There was a problem hiding this comment.
Preserve multi-select answers across background redraws
If the owner selects options on a multi-answer question and a polling refresh detects any document change before submission, draw() rebuilds the card and resets this local Set, losing the selections. The refresh guard only treats textareas, inputs, selects, dialogs, and pending submissions as busy; these option buttons satisfy none of those conditions. Persist selections by question key outside the renderer, or suppress background redraws while an unsubmitted multi-select answer exists.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Real. Fixed in #12454: ticked choices live in a map keyed by question, so a redraw draws them as they were, and they are dropped once the answer is sent.
Generated by Claude Code
| if (subs.length === 0) throw new OpError(409, "no open question in that set has a recommendation"); | ||
| return this.submit(setId, subs); |
There was a problem hiding this comment.
Split bulk recommendations into supported submission batches
For a decision set with more than 256 open recommended questions, this sends every answer in one request, but the dashboard's parseDecisionSubmissions in pm-stack/aggregator/src/server.ts rejects arrays longer than 256. Such sets are valid: validateDecisionSetInput permits 64 items with 16 questions each. Consequently, “Accept all” fails with HTTP 400 without recording any answers for these larger sets. Submit batches of at most 256 and aggregate their outcomes.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Real. Fixed in #12454: recommendations go in parts of 200, under the dashboard's limit of 256; a 450-question set is tested to send 200, 200 and 50.
Generated by Claude Code
| const comments = (await this.ops.gh([`repos/${this.repo}/issues/${i.number}/comments?per_page=100`])) as { | ||
| body: string | null; | ||
| created_at: string; | ||
| }[]; |
There was a problem hiding this comment.
Read the latest comment page for long prompt threads
Once an owner-prompt issue has more than 100 comments, this request still reads only the first page, so comments.slice(-6) displays comments 95–100 rather than the latest replies. Subsequent owner replies and fleet reports never appear, and the answered status is derived from an old comment even though the cache records the newest issue timestamp. Checked fleet's gh wrapper, which passes arguments through unchanged, and local gh api --help, which describes --paginate as “Make additional HTTP requests to fetch all pages of results”; this call supplies neither pagination nor an explicit later page. Fetch the final page(s), or paginate and flatten the results before taking the last six comments.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Real. Fixed in #12454: the thread is read from its last page, computed from the issue's comment count; tested with a 250-comment thread.
Generated by Claude Code
Why
The owner could not see what was in progress or answer the questions waiting on him.
What changes
Primary screens, up front: Now, Next, Needs me, Ask. Everything else is under More.
State kept ready. Each source is read in the background and served from memory with the time it was read and the error if the last read failed. A page never waits on a live fan-out. Three documents (core, questions, ops), each with an ETag, compressed. Nothing is read while nobody is looking.
One action endpoint,
POST /console/api/act {kind, args}: sixteen named actions, each recorded before it runs, without the text he typed. Answers to questions go through the dashboard's own endpoint; the per-set tokens never leave the host.Also
/goes to the app; the dashboard's home is/?dashboard.CPUWeight=900for the console, and in the NixOS module for the dashboard, dispatch and tunnel.Evidence
cd pm-stack/console && bun testpython3 -m unittest discover -s pm-stack/console/scripts -p 'test_*.py'scripts/demo.tsfleet queue enqueue --dry-runwith the prompt packetowner-prompt) was rejected by the queue's validator; fixed to the issue's triage keyNot exercised before merge: the actions against the real fleet. They are exercised on the host right after deployment and recorded on this PR.
Undo
Revert this PR; the previous console pages return.
Refs #12360, #12412, #12417.
Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.