GeezerVison is showing github.com — PM stack: triage write path — dashboard actions store, UI, and fleet consumers (#1152, #1154, #1156) by dezren39 · Pull Request #1346 · developing-today/code
Conversation
dezren39
commented
Oct 27, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Epic #1184, Cluster 3 of the coherence design (~/workspace/pm-stack-coherence-design-2026-10-26.md). The dashboard's first real write actions; until now its only write was comments.
Aggregator (this PR)
src/actions.ts — the actions store, mirroring src/comments.ts point for point: one JSON file (PM_AGG_ACTIONS_FILE, new in src/config.ts), atomic temp+rename writes, in-memory authoritative, strict validateNewAction at the boundary, authorship via the shared validateAuthor.
- Envelope:
{id da-…, clientToken, kind: triage|status-request|session, verb, objectRef (gh:/session:/orch:), targetRef?, sessionId?, sessionSource?, payload, author, createdAt, state: new|applied|rejected|superseded, appliedAt?, appliedByRun?, resultNote?, supersedes?}.
- Verbs (aligned with the needs-user addendum §4.3 now, so design+impl(orchestrator/aggregator): needsDrew item contract - whyDrew class, structured options[], survey questions[], delegation state #1290–impl(aggregator/orchestrator): proposal review state handling - proposal identity, supersede/expiry races, cross-surface counts #1293 needs no rework): triage — acknowledge, snooze, escalate, de-escalate, answer (one verb carrying text/optionId/answers[]), delegate (mode first-pass|auto|drew), dismiss, approve-proposal, reject-proposal; status-request — request-status; session — poke, answer, stop. Boundary rules: dismiss/reject-proposal require a reason; snooze requires
until; delegate requires mode; session actions require sessionId + matching session: objectRef.
- Endpoints beside the comment writes, same conventions:
POST /api/actions (201, or 200 {deduped:true} on clientToken repost), GET /api/actions.json?object=&kind=&state= with pending {triage, statusRequests, session}, POST /api/actions/result (consume-once — only transitions out of new; unknown id 404).
- UI (server-rendered
.aform forms + one delegated ACTION_SCRIPT, the COMMENT_SCRIPT pattern; ≥44px targets; Title Case role-based copy):
- design+impl(aggregator): triage actions on /attention - acknowledge, snooze, escalate, answer - orchestrator-mediated #1152 — /attention tier cards: acknowledge / snooze (presets + custom) / escalate / de-escalate; pending ⏳ / applied ✓ / rejected ✗ badges from the store; an applied snooze renders in a visible Snoozed by you strip with an unsnooze (superseding) control. Section-derived items' controls disable with the reason when the tier source is not live (stale/absent/invalid); session-derived stay enabled.
- impl(aggregator): 'request status change' action on project/board cards - orchestrator applies it as single writer #1154 — board cards (when a linked ref is pooled), /projects pool cards, and /item gain Request status change (target from the Project Status values + reason), always rendered as a request + badge, never a direct write.
- impl(aggregator): session actions from /sessions and /attention - poke, answer, stop - keeper/orchestrator-mediated #1156 — /sessions rows (live records only) and attention session cards gain poke / answer / stop on the merged registry identity, with per-source honest support: OpenCode full set; Jules keeper-mediated (answer only, others disabled with the reason); Muse no live channel (all disabled with the reason). Stop is behind a two-step confirm.
- Docs: README gains the endpoints + a 'How dashboard actions flow' section (dashboard → store → fleet job applies → result posted back).
Consumer half (same slice, job definitions — not in this diff)
The orchestration-pass job gains a dashboard-actions step (polls pending triage + status-request + OpenCode session actions in the same segment where it polls message comments; applies as single writer; posts each result back; snoozed items omitted from the Needs User tier until expiry; status-request provenance in the run log). The jules-review keeper gains the Jules session-answer slice. Both edits follow the fleet cron discipline: asserted exact-match insertion from the captured live body, byte-diff of unchanged regions after. Evidence lands on #1152/#1154/#1156.
Trust note
Authorship is self-asserted, exactly like dashboard comments — #941 is the accepted-risk hardening tracker and is deliberately not in scope here (design decision: the consuming jobs still apply/reject every action).
Verification
bun test — 228 pass / 0 fail (203 baseline + 15 new in test/actions.test.ts + recent merges), bunx tsc --noEmit clean, biome 2.3.2 format applied.
- New tests: store dedupe / consume-once / supersede / persistence; boundary validation incl. per-verb required payloads and verb↔kind pairing; render wiring (disabled-when-stale with reason, Jules honesty, snoozed strip, status badges, live-only session rows); HTTP round-trip with a fixture consumer (post → poll
state=new → result applied → retried result is a no-op).
Fixes #1152, #1154, #1156 (aggregator half; consumer evidence on the issues).
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…1152, #1154, #1156)
New src/actions.ts store mirroring src/comments.ts 1:1 (one JSON file
at PM_AGG_ACTIONS_FILE, atomic writes, strict boundary validation,
shared validateAuthor): DashAction envelope {kind: triage |
status-request | session, verb, objectRef in the gh:/session:/orch:
space, payload, clientToken dedupe, state new -> applied | rejected
| superseded, consume-once results, undo = superseding action}.
Verb set aligned with the needs-user actions addendum from the start:
acknowledge, snooze, escalate/de-escalate, answer (text | optionId |
answers[]), delegate (mode first-pass|auto|drew), dismiss +
reject-proposal (reason required at the boundary), approve-proposal
reserved, request-status, poke, stop.
Endpoints beside the comment writes: POST /api/actions (201/200
deduped), GET /api/actions.json?object=&kind=&state= with pending
counts per kind, POST /api/actions/result (consume-once, 404 unknown).
UI (server-rendered .aform + ACTION_SCRIPT, the COMMENT_SCRIPT
pattern; >=44px targets): /attention tier cards gain acknowledge /
snooze (presets + custom) / tier-move controls with pending/applied/
rejected badges and a visible 'Snoozed by you' strip; section-item
controls disable with the reason when the tier source is not live,
session-derived stay enabled. Board + /projects + /item gain
'request status change' (a request, never a direct write). /sessions
rows + attention session cards gain poke/answer/stop on the merged
registry identity, per-source honest support (Jules keeper-mediated,
answer only; Muse: no live channel). Visible copy is
role-based Title Case ('Needs User'); no new Drew-named identifiers.
Author note: authorship stays self-asserted like comments — #941 is
the accepted-risk hardening tracker, deliberately not in scope; the
consuming jobs still apply/reject every action.
Tests: test/actions.test.ts (15) — store dedupe/consume-once/
supersede/persistence, boundary validation incl. per-verb required
payloads, render wiring (disabled-when-stale, Jules honesty, snoozed
strip, status badges), and an HTTP round-trip with a fixture consumer
(post -> poll state=new -> result applied -> consume-once retry).
Full suite 228 pass, tsc clean, biome 2.3.2 formatted.
The consumer half (orchestration-pass + keeper job definitions) ships
in the same slice as a follow-up commit.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 6 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
789718fb-5618-474f-b364-f2bda4838ea0
Commits
-
Reviewing files that changed from the base of the PR and between 3a32780 and 4f05391.
Files selected for processing: 6
-
pm-stack/aggregator/README.md
pm-stack/aggregator/src/actions.ts
pm-stack/aggregator/src/config.ts
pm-stack/aggregator/src/render.ts
pm-stack/aggregator/src/server.ts
pm-stack/aggregator/test/actions.test.ts
- 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
-
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-10-27T07:33:15.045723Z |
4f05391 |
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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: 4f0539158a
ℹ️ 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".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+356
to
+358
|
|
const tmp = `${this.file}.tmp-${process.pid}`;
|
|
|
await writeFile(tmp, JSON.stringify(data, null, 2));
|
|
|
await rename(tmp, this.file);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Serialize action-store writes before replacing the backing file
When action submissions or consumer result reports overlap, every persist() call writes and renames the same process-wide temporary path. One rename removes the file another call still expects, causing valid requests to return HTTP 400 even though their in-memory mutations have already occurred. I reproduced this with concurrent add() calls, which raised ENOENT during rename. Serialize persistence so concurrent requests cannot interfere with each other's writes.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+1490
to
1493
|
|
...view.drew.map((e) => sessionCard(e, children, 0, counts, act)),
|
|
|
...view.drewExtra.map((i) => tierItemCard(i, "Why you", counts, tierAct(i))),
|
|
|
].join("") ||
|
|
|
(ts.present
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exclude applied-snoozed sessions from the attention queues
For a current session with an applied snooze, these cards still render from the unfiltered attention view while the same session also appears under “Snoozed by you.” Omitting its published orchestration tier entry does not suppress it: buildAttention() in derive.ts classifies every current raw-feed session and assigns a fallback tier when no section entry matches. Consequently, the newly enabled session Snooze control cannot remove a waiting session from Needs User as promised. Apply active snoozes to queue membership and counts while retaining the session in All sessions.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
`<span class="badge act-applied">✓ delegated (${esc(delegation.payload.mode ?? "")}) · ${esc(relTime(delegation.appliedAt ?? delegation.createdAt, now))}</span>`,
|
|
|
);
|
|
|
}
|
|
|
return badges.length ? ` <span class="actbadges">${badges.join(" ")}</span>` : "";
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Render terminal outcomes for session actions
When a consumer applies or rejects a session poke, answer, or stop, this helper returns no badge for that action: only pending actions and selected triage/status outcomes are handled. For example, a rejected stop with a resultNote simply loses its pending badge on reload, leaving the user unaware that stopping failed or why. Both /sessions and attention session cards rely on this helper, so render applied/rejected session outcomes and their rejection notes before returning.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+597
to
+601
|
|
const tonight = new Date(now);
|
|
|
tonight.setHours(23, 59, 0, 0);
|
|
|
const tomorrow = new Date(now);
|
|
|
tomorrow.setDate(tomorrow.getDate() + 1);
|
|
|
tomorrow.setHours(9, 0, 0, 0);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calculate snooze presets in the user's timezone
When the aggregator's timezone differs from the user's, these server-side calendar calculations give “tonight” and “tomorrow 9:00” incorrect deadlines. The dashboard identifies America/Chicago as the user's timezone in derive.ts:457–469, but with a UTC server at 2026-10-27T01:00Z (October 26, 20:00 Chicago), “until tonight” becomes October 27, 18:59 Chicago and “until tomorrow 9:00” becomes October 28, 04:00 Chicago. This can suppress an attention item into the wrong day. Calculate these presets in the browser's timezone or the dashboard's explicit user timezone instead of the server default.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 27, 2026
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|