Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pm-stack/book/concepts/aggregator.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ Reads become typed items in `pm-stack/aggregator/src/model.ts`. Subjects join th

## Publication: pages and twins

The page manifest in `pm-stack/aggregator/src/pages.ts` registers 23 pages in four nav groups — Overview, Work, Ops, System — with a primary-or-dropdown curation per page. Six sub-route and detail pages bring the aggregator total to 29 routes: item detail, discuss, one project page, one quota service page, alert preferences, and the decision-set page. Most pages declare a machine twin (`/api/overview.json`, `/api/board.json`, `/api/roadmap.json`, and so on) serving the same data; Datastar fragments under `/frag/` serve partial renders, and `/freshness/stream` is a server-sent-events stream.
The page manifest in `pm-stack/aggregator/src/pages.ts` registers 26 pages in four nav groups — Overview, Work, Ops, System — with a primary-or-dropdown curation per page. Seven sub-route and detail pages bring the aggregator total to 33 routes: item detail, discuss, one project page, one quota service page, alert preferences, the decision-set page, and the C6 incident pages. Most pages declare a machine twin (`/api/overview.json`, `/api/board.json`, `/api/roadmap.json`, and so on) serving the same data; Datastar fragments under `/frag/` serve partial renders, and `/freshness/stream` is a server-sent-events stream.

Two manifest gaps are part of the reconciled behaviour, not errors to smooth over:

- The decisions page declares no API twin in the manifest, one of only three pages without one — yet the server implements the full decisions write API (`/api/decisions/<setId>/submit`, `/defer`, `/request-info`, `/events`, and `/api/decision-sets`). A reader of the manifest alone would miss the entire write surface (D7).
- The decisions page declares no API twin in the manifest, one of only two pages without one (the other is the all-pages index) — yet the server implements the full decisions write API (`/api/decisions/<setId>/submit`, `/defer`, `/request-info`, `/events`, and `/api/decision-sets`). A reader of the manifest alone would miss the entire write surface (D7).
- The decision-set page `/decisions/<setId>` is missing from the manifest's sub-route parent map, so `manifestRouteFor` returns null for it and its renders sit outside the render registry that `/api/health` reports (D8). The page exists; the health accounting does not cover it.

In public, the dashboard is reached only behind the console gate at `pm.security.cab`: the console proxies non-`/console` requests to the dashboard for a signed-in owner.
Expand Down
2 changes: 1 addition & 1 deletion pm-stack/book/getting-started/shape.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The PM stack has six parts. One reads, one links, one launches, one set does the
| Projector | The link registry and projection service. It records which items in different sources are the same work, and serves links and latest comments per subject | Laptop, port 7801 |
| Dispatch | pm-dispatch, the intake service. An authenticated request launches a session now or enqueues it as a queue task with a tracking issue | Laptop, port 4879, public as `dispatch.security.cab` |
| Workers | The things that do and watch the work: OpenCode sessions claimed by the claimant, the fleet queue's lanes, Cloudflare Workers at the edge, and the guard and exporter jobs on timers | Laptop, GitHub Actions, and Cloudflare |
| Website | Two first-party web apps: the aggregator dashboard (29 routes) and the PM console (21 hash views) | Laptop, with the console also served at the edge |
| Website | Two first-party web apps: the aggregator dashboard (33 routes) and the PM console (21 hash views) | Laptop, with the console also served at the edge |
| Phone | The console as an Android app, plus Web Push to subscribed devices. The phone reads the same state and answers through the same action table | Drew's phone |

## How a piece of work moves through the shape
Expand Down
2 changes: 1 addition & 1 deletion pm-stack/book/library/aggregator-internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ For the surface the aggregator serves, page by page, the reference chapters carr

The survey counts ~180 modules in `src/`. The surveys name these families:

- **Pages and rendering** — `pages.ts` (the page manifest: 23 pages, their nav groups, and the sub-route parent map), `render.ts` (the renderers), `server.ts` (routing, the HTTP and WebSocket surface, and inline client code for the answer pages).
- **Pages and rendering** — `pages.ts` (the page manifest: 26 pages, their nav groups, and the sub-route parent map), `render.ts` (the renderers), `server.ts` (routing, the HTTP and WebSocket surface, and inline client code for the answer pages).
- **Health** — `health.ts`, `stack-health.ts`, `host-health.ts`, `build-health.ts`, the `watchdog*.ts` and `slo*.ts` families. One health assembly feeds both `/health` and `/api/health`.
- **Quota** — the `quota-*.ts` family: current state, forecast, anomaly, reweight, admission, and weekly review; with the charges family (`charges-{catalog,collect,match}.ts`), the spend family (`spend-{attribution,cards,dollars,rollups}.ts`), `saas-extract.ts`, and `cost-anomaly.ts` with its rollup-store evidence producer `cost-anomaly-producer.ts`.
- **Decisions and questions** — `decisions.ts` (decision sets and resolutions), `needs-drew.ts` (the needs-Drew census and the single-question store), `notifications.ts` (candidate builder and class registry), `alerts.ts` (the alert throat store and engine), `push.ts` (Web Push send).
Expand Down
2 changes: 1 addition & 1 deletion pm-stack/book/operations/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Symptom → cause → fix. Each entry names the check that confirms the cause be
## A decision set answers through an API its manifest page denies, or its page is missing from health

- **Symptom:** A reader of `pages.ts` concludes the decision sets have no API, or `/health` shows no render record for a decision-set detail page that plainly renders.
- **Cause:** Two manifest gaps (D7, D8). The `decisions` entry in `pages.ts` declares no `api:` twin — one of only three pages without one — while `server.ts` implements the full decisions API. And `SUBROUTE_PARENTS` omits `/decisions/<setId>`, so `manifestRouteFor` returns null for it and its renders sit outside the #1147 render registry `/api/health` reports.
- **Cause:** Two manifest gaps (D7, D8). The `decisions` entry in `pages.ts` declares no `api:` twin — one of only two pages without one — while `server.ts` implements the full decisions API. And `SUBROUTE_PARENTS` omits `/decisions/<setId>`, so `manifestRouteFor` returns null for it and its renders sit outside the #1147 render registry `/api/health` reports.
- **Confirm:** Read the routes in `aggregator/src/server.ts` for the API, and `SUBROUTE_PARENTS` in `pages.ts` for the missing sub-route.
- **Fix:** For the reader: use the server as the authority for the decisions API — submit, defer, request-info, and events per set, plus the decision-sets list and submit routes. For the registry gap: the fix is a manifest change (add the sub-route parent), not a health-check change. Until that change lands, a missing render record for `/decisions/<setId>` is the known gap, not an outage.

Expand Down
34 changes: 31 additions & 3 deletions pm-stack/book/reference/website-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The aggregator dashboard is a Bun application: routing in `pm-stack/aggregator/src/server.ts`, the page manifest in `pm-stack/aggregator/src/pages.ts`, renderers in `pm-stack/aggregator/src/render.ts`. It binds `127.0.0.1:4870` and the tailnet address. In public it sits behind the console gate at `pm.security.cab`: the console proxies non-`/console` GET and HEAD paths to the dashboard for a signed-in owner.

This chapter covers all 29 aggregator routes in the survey census: the 23 manifest pages in `PAGES` (`pages.ts`) and the 6 detail and sub-routes under them. Manifest entries carry a navigation group from `PAGE_GROUPS` in the same file — Overview, Work, Ops, System — and a curation flag, `nav: primary` or `nav: dropdown` (the #1497 curation). Every entry below follows the same shape: what the page is, its inputs, its defaults where the survey gives them, its behaviour, and its failure shapes where the survey records them. The HTTP and API surface behind these pages is in [Aggregator HTTP routes and API](aggregator-routes.md); the phone surface is in [The console, view by view](console-views.md).
This chapter covers all 33 aggregator routes: the 26 manifest pages in `PAGES` (`pages.ts`) and the 7 detail and sub-routes under them. (The original survey census of 2026-11-23 counted 23 pages and 29 routes; the census was re-verified against `pages.ts` on 2026-11-30, #17260.) Manifest entries carry a navigation group from `PAGE_GROUPS` in the same file — Overview, Work, Ops, System — and a curation flag, `nav: primary` or `nav: dropdown` (the #1497 curation). Every entry below follows the same shape: what the page is, its inputs, its defaults where the survey gives them, its behaviour, and its failure shapes where the survey records them. The HTTP and API surface behind these pages is in [Aggregator HTTP routes and API](aggregator-routes.md); the phone surface is in [The console, view by view](console-views.md).

## `/` — Overview

Expand Down Expand Up @@ -36,17 +36,38 @@ This chapter covers all 29 aggregator routes in the survey census: the 23 manife

- **What it is:** The index of every raised decision set (#8867): new today, this week, the rolling last 7 days, and all sets, with open-question counts per set. Manifest group Overview, `nav: primary` (promoted in #9354, per the comment in `pages.ts`).
- **Inputs:** Each row opens the set's own page, `/decisions/<setId>` (below).
- **Defaults:** `pages.ts` declares no `api:` twin for this page — one of only three manifest pages without one. The server implements a decisions API regardless; see D7 in the Sources note and [The question sets, enumerated](question-sets.md).
- **Defaults:** `pages.ts` declares no `api:` twin for this page — one of only two manifest pages without one (the other is `/pages`). The server implements a decisions API regardless; see D7 in the Sources note and [The question sets, enumerated](question-sets.md).
- **Behaviour:** The index is a navigation surface over the decision sets; answering happens on the per-set page or in the console. The index has four views, chosen with `?view=` (`handleDecisionsIndex` in `server-decision-routes.ts`; `decisionSetsForView` in `decisions.ts`): `today` (raised on the current America/Chicago calendar day), `week` (the current Chicago calendar week, Monday–Sunday), `recent` (raised in the rolling last 7 days), and `all` (everything). Since the decision-set aging policy landed (#14064, PR #14413), `recent` is the default view, so the landing view is the current workload, not the backlog; a set whose raise time cannot be parsed appears only in `all`. Every set also carries an aging status (`decisionSetAging` in `decisions.ts`): `settled` (nothing open — settled wins over idle), `abandoned` (still open but idle a full 7 days since its last activity — the latest resolution time, else its raise time; a set with no datable instant ages as `active`, never retired undated), else `active`. The `all` view renders the abandoned sets as a fold, with their set ids and a dismiss-all backed by `POST /api/decisions/dismiss` (see [Aggregator HTTP routes and API](aggregator-routes.md)).
- **Failure shapes:** None recorded in the survey.

## `/needs-user` — Needs user

- **What it is:** The open questions waiting on the user (#14084), in answering order. Manifest group Overview, `nav: dropdown`. (Added in the 2026-11-30 census re-verification, #17260; not in the 2026-11-23 survey.)
- **Inputs:** Machine twin: `/api/needs-user`. Each row carries a priority select (P1–P5 or none) that posts to `POST /api/needs-user/<ledgerId>/priority`.
- **Behaviour:** Rendered by `renderNeedsUserPage` in `server-pages.ts` (route in `server-decision-routes.ts`): each question shows when it was raised, its source, and how many issues wait on the answer; the order is the priority the user set, then how many issues wait on each answer, then age (the `pages.ts` blurb). When the stage store is unavailable the priority selects render disabled and the page says priorities can't be set right now.
- **Failure shapes:** An empty queue renders "Nothing is waiting on you."

## `/reports` — Reports

- **What it is:** Review report versions and resolve prose conflicts without overwriting stored text. Manifest group Work, `nav: dropdown`.
- **Inputs:** Machine twin: `/api/reports.json`. Writes: `POST /api/reports/resolve` and `POST /api/reports/late-update`.
- **Behaviour:** A conflict resolves by choosing a stored version; the stored text itself is not overwritten. This is the aggregator's `/reports` route, distinct from the console's on-demand prose reports at `#more/reports` (see [The console, view by view](console-views.md)).
- **Failure shapes:** None recorded in the survey.

## `/spaces` — Project spaces

- **What it is:** The four stable project landings — Fleet, PM stack, Atlas, ID (#12351). Manifest group Work, `nav: dropdown`. (Added in the 2026-11-30 census re-verification, #17260.)
- **Inputs:** Machine twin: `/api/spaces.json`.
- **Behaviour:** Served from `project-spaces-serving.ts` over the pure model in `project-spaces-timeline.ts`: one landing per space, its sections (exists, wanted, in-progress, designed, inspiration, end state, open research) carried as structural facts and sibling-space links. Space prose has no source feed yet, so every content section renders visibly unavailable rather than invented — the module never fills a missing section.
- **Failure shapes:** None recorded; a section the caller did not supply renders as "not available" by design.

## `/timeline` — Timeline

- **What it is:** The reports timeline over the stored C7 report records: quarter, then month, week, day — the current quarter first and always discoverable (#12351). Manifest group Work, `nav: dropdown`. (Added in the 2026-11-30 census re-verification, #17260.)
- **Inputs:** Machine twin: `/api/timeline.json`.
- **Behaviour:** Built at request time from the stored C7 records by `buildTimelineIndex` in `project-spaces-timeline.ts` (rendered by `renderTimeline` in `project-spaces-serving.ts`). Membership is by the records' stored period starts converted to America/Chicago wall dates; uncertain boundaries are never presented as exact. Nodes carry record ids, design refs, and special report references — the index owns no records itself.
- **Failure shapes:** None recorded in the survey.

## `/board` — Board

- **What it is:** The curated cross-repo work-in-progress board. Manifest group Work, `nav: dropdown`.
Expand Down Expand Up @@ -163,7 +184,7 @@ This chapter covers all 29 aggregator routes in the survey census: the 23 manife

- **What it is:** The `pages.ts` manifest rendered as a page: every registered view in one place. Manifest group System, `nav: dropdown`.
- **Inputs:** `pages.ts` declares no twin for this page.
- **Behaviour:** This page is the manifest's self-listing; this chapter's 23 manifest entries are its content.
- **Behaviour:** This page is the manifest's self-listing; this chapter's 26 manifest entries are its content.
- **Failure shapes:** None recorded in the survey.

## `/item/&lt;subject&gt;` — Item detail
Expand Down Expand Up @@ -209,6 +230,13 @@ This chapter covers all 29 aggregator routes in the survey census: the 23 manife
- **Behaviour:** The page is the answer surface for a set: one push covers the whole set and its tap opens this page. Parent by navigation is the `/decisions` manifest page. D8: `SUBROUTE_PARENTS` does not list this page, so `manifestRouteFor` returns null for it and its renders sit outside the #1147 render registry that `/api/health` reports.
- **Failure shapes:** None recorded in the survey.

## `/reports/incident/<id>` — C6 incident page

- **What it is:** One evidence-backed incident page per health-hook incident (#15019, C6). Recorded in `SUBROUTE_PARENTS` in `pages.ts` with parent `/alerts`; the incident cards on `/alerts` link here, and incident pages cross-link each other from Related incidents. (Added in the 2026-11-30 census re-verification, #17260.)
- **Inputs:** The incident id in the path. Assembled by `incident-page.ts` as a `c6.page-data/v1` page-data envelope, rendered phone-first.
- **Behaviour:** The facts come from the canonical C3 healthHook records stored on the alerts ledger's opened/closed event details (#12602) — never from the thin audit projection; identity joins on `healthHook.incidentId` / `healthHook.recoveryOf`. Sections, in render order: current-state, story, timeline-attempts, findings, related, root-cause, remediation, comments-questions. Anything the records do not show is labelled unknown or provisional, never filled in.
- **Failure shapes:** None recorded in the survey.

## `/projects` — Redirect, not a page

- **What it is:** Not a page. The route redirects to the projects-pool section of `/program` (manifest comment in `pages.ts`; route branch in `server.ts`).
Expand Down