Skip to content

feat(pm-stack): the console becomes the app: Now, Next, Needs me, Ask - #12452

Merged
dezren39 merged 4 commits into
mainfrom
claude/pm-app
Nov 22, 2026
Merged

dezren39 merged 4 commits into
mainfrom
claude/pm-app

Conversation

@dezren39

@dezren39 dezren39 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Why

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.
  • The console's own overview took 22 seconds: every page fanned out to GitHub and the queue store while he waited.
  • The laptop ran at a load average of 75 on 16 cores while the fleet compiled, so the services that answer him starved.
  • Navigation listed everything at one level.

What changes

Primary screens, up front: Now, Next, Needs me, Ask. Everything else is under More.

Screen What it shows What he can do
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; ranked issues Do first, Sooner, Later, Cancel; change a rank
Needs me Every open question from the decision sets (360 today) with the recommended option marked; the things only a person can do; reviews One tap to answer, with a few seconds to undo; accept all recommended in a set; "Decide for me"; a written answer; "I did it"
Ask His prompts and the fleet's replies, as threads Type or dictate what he wants: it becomes an issue and a top-band queue task in one pass; reply; mark done
More Queue, pull requests, ranked issues, agents, services, and the dashboard's pages grouped as the dashboard groups them Everything the console did before

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

  • The gate compresses the dashboard's pages and fragments on the way to the phone. / goes to the app; the dashboard's home is /?dashboard.
  • Moving a queued task is the one write this service makes to the queue store, because the queue has no verb for it: one column, one queued row.
  • A sign-in lasts 720 hours. A timer re-runs the exposure script every quarter hour, so Google sign-in turns on by itself once its two secrets exist (Google sign-in for pm.security.cab: create the OAuth client (hands: interactive login) #12417).
  • CPUWeight=900 for the console, and in the NixOS module for the dashboard, dispatch and tunnel.

Evidence

Check Result
cd pm-stack/console && bun test 49 pass (16 new)
python3 -m unittest discover -s pm-stack/console/scripts -p 'test_*.py' 7 pass
Faults planted in the new server code 30 of 30 caught
The interface in a headless phone-sized browser against scripts/demo.ts every screen renders, no script errors
This branch beside the live console, against the real fleet core document: 5.8 s cold, then 2 ms, 7.9 KB compressed; questions: 360 open, 92 KB compressed; ops: 44 PRs, 156 ranked issues, 30 agents, 54 units, 18 KB
fleet queue enqueue --dry-run with the prompt packet the first key (owner-prompt) was rejected by the queue's validator; fixed to the issue's triage key

Not 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


Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

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
@dezren39
dezren39 requested a review from a team as a code owner November 22, 2026 06:28
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T06:34:18.016953Z 42cbe0e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

…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
@dezren39
dezren39 merged commit 8c4edca into main Nov 22, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +5 to +7
OnBootSec=5min
OnUnitActiveSec=15min
RandomizedDelaySec=60

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +355 to +356
const port = Number(process.argv[2] ?? 4899);
Bun.serve({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +376 to +377
if (subs.length === 0) throw new OpError(409, "no open question in that set has a recommendation");
return this.submit(setId, subs);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +451 to +454
const comments = (await this.ops.gh([`repos/${this.repo}/issues/${i.number}/comments?per_page=100`])) as {
body: string | null;
created_at: string;
}[];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants