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/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ Four applications the stack did not write provide its boards, tables, planning s
| Worker | State in `workers.json` | Job |
| -------------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pm-console-edge` | Deployed from Actions | Serves the console when the laptop is away; holds actions and answers for replay |
| `decision-events` | In service, deployed by hand | Decision-set activity events to Turso, to its own D1, and to a per-set Durable Object that fans out live to WebSocket subscribers |
| `decision-events` | In service, deployed from Actions | Decision-set activity events to Turso, to its own D1, and to a per-set Durable Object that fans out live to WebSocket subscribers |
| `voice-line` | In service | Push-to-talk over a WebSocket in a Durable Object; Workers AI speech-to-text and text-to-speech; answers are template-built from intent and a Turso queue snapshot, with no LLM |
| `pm-notify` (notify relay) | Not deployed, address null | The dead-man's switch design: heartbeat in, one silence push out. Step 1 only in code; the event-mirror and edge answer-intake routes are not routed (D5) |
| `pm-notify` (notify relay) | In service, deployed by hand | The dead-man's switch design: heartbeat in, one silence push out. The event-mirror and edge answer-intake routes are routed in code (D5 resolved); what remains is the laptop-side relay wiring |

The other 19 Workers in the registry belong to the wider estate and are covered by their own books; the registry is the shared list, not a claim that this stack operates them.

Expand Down
10 changes: 5 additions & 5 deletions pm-stack/book/concepts/push-notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## The shape

The aggregator on the laptop is the only detector and decider for ordinary notification classes. It sends Web Push (VAPID) directly to subscribed browsers and phones. A Cloudflare relay exists in code as a dead-man's switch for the case where the laptop itself is silent; the relay is not deployed (§5, D5). The phone-side receivers are two service workers: the aggregator PWA worker (`aggregator/src/sw-source.ts`, served as `/sw.js`) and the console Android app's worker (`console/public/sw.js`, inside a TWA). Which of the two workers owns a given phone's subscription in production is UNVERIFIED from code alone.
The aggregator on the laptop is the only detector and decider for ordinary notification classes. It sends Web Push (VAPID) directly to subscribed browsers and phones. A Cloudflare relay exists as a dead-man's switch for the case where the laptop itself is silent; the relay Worker is deployed (by hand, 2026-11-26, #14950) and its routes are routed in code, but its aggregator leg is inert without a configured relay URL (§5, D5). The phone-side receivers are two service workers: the aggregator PWA worker (`aggregator/src/sw-source.ts`, served as `/sw.js`) and the console Android app's worker (`console/public/sw.js`, inside a TWA). Which of the two workers owns a given phone's subscription in production is UNVERIFIED from code alone.

## Detect

Expand Down Expand Up @@ -55,16 +55,16 @@ Implementation, in `aggregator/src/notifications.ts` with the join in `server.ts
- One candidate is raised per section per state, with object reference `section:\<name\>`. The body is the compact form from the issue: walled pools with soonest resets first, then pending pools with percent and reset, soonest first. The landing URL is `/quota`. Recovery uses the engine's disappearance and recovery semantics; no second mechanism exists.
- The issue records a subscription flip for Drew's phone: `section-risk` on, `quota-wall` and `quota-near-wall` off. Whether that flip was applied to the live subscription is UNVERIFIED: subscription state lives in the Turso alerts store, not in the repo.

## Send: the laptop path, and the relay that is not deployed
## Send: the laptop path, and the deployed-but-unrouted relay

The normal send path is `aggregator/src/push.ts` `sendPush`: Web Push with VAPID, direct from the laptop aggregator to the subscription endpoint. The VAPID public key is a constant in code; the private key is resolved by secret name; the subject is a `mailto:` value in code.

The relay path does not exist in production (D5). The facts, in order:
The relay is deployed and routed, but the relay path is not live end-to-end in production (D5): the aggregator leg is inert without a configured relay URL. The facts, in order:

- `pm-stack/notify-relay/` holds a Cloudflare Worker (`pm-notify`) built as a dead-man's switch. The aggregator client (`aggregator/src/notify-relay.ts`) posts a heartbeat every 60 seconds (`NOTIFY_RELAY_HEARTBEAT_MS`) and mirrors push subscriptions to the relay. The relay re-arms an alarm at last-beat plus 150 seconds; on silence it sends one `stack.silent` push, and on recovery one recovered push.
- `pm-stack/platform/workers.json` records `pm-notify` as "not deployed", with a null address. The relay README's deploy section is the step-1 remainder, not done by the build PR.
- `pm-stack/platform/workers.json` records `pm-notify` as in service, deployed by hand on 2026-11-26 (#14950) at `https://pm-notify.developing-today.workers.dev` (D5 resolved as to deployment; the pre-deployment record — not deployed, null address — is superseded).
- With no relay URL configured, the aggregator side is inert. With no heartbeats arriving, the relay side is inert.
- The relay's event-mirror route (`POST /mirror/event`) and its answer routes (`GET /answer/:ledgerId`, `POST /api/needs-drew/:ledgerId/answer`) are **not routed**. The relay source header states it directly: those routes arrive with steps 2 and 3 and "are not routed yet"; every other path returns 404. The relay README's route table lists them alongside the live routes, separated only by a "Lands in" column. The code wins (D5): today the edge answer-intake and the dead-man's switch do not exist in production, and phone answers go to the laptop aggregator (§6).
- The relay's event-mirror route (`POST /mirror/event`) and its answer routes (`GET /answer/:ledgerId`, `POST /api/needs-drew/:ledgerId/answer`) **are routed**: the relay source header lists them in its closed route list, and every other path returns 404. The code wins (D5, resolved as to deployment and routing): what does not exist in production today is the live end-to-end path — with no relay URL configured the aggregator posts no heartbeats, so phone answers go to the laptop aggregator (§6) until the laptop-side wiring lands.

One consequence is stated plainly: if the laptop dies, the heartbeat leg sends nothing today. Whether any other watchdog covers total laptop silence is UNVERIFIED.

Expand Down
2 changes: 1 addition & 1 deletion pm-stack/book/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Three parts of the stack do not deploy by the laptop rebuild:
2. **The decision-events Worker** is in service in `workers.json` and is recorded there as deployed by hand.
3. **The Android app** is a trusted web activity wrapper around the console. The `pm-console-android-release` service and timer build and release it; the APK is served by the console itself to a signed-in owner.

The notify relay Worker, `pm-notify`, is recorded in `workers.json` as not deployed, with a null address (D5). Do not treat the relay as part of a working installation: the dead-man's switch and the edge answer routes do not exist in production.
The notify relay Worker, `pm-notify`, is recorded in `workers.json` as in service, deployed by hand on 2026-11-26 (#14950) at `https://pm-notify.developing-today.workers.dev` (D5 resolved as to deployment). The relay's edge answer routes are routed in its code, but the path is not live end-to-end in a working installation until the laptop-side relay wiring (`PM_AGG_NOTIFY_RELAY_URL`) lands.

The Workers registry itself is `pm-stack/platform/workers.json`, which lists 23 Workers. The platform README now states the same figure (its earlier count of eighteen was stale, D6, corrected 2026-11-30); the JSON is the live list, held to the repository's wrangler files by `workers.test.ts` (D6).

Expand Down
4 changes: 2 additions & 2 deletions pm-stack/book/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Work in this estate is spread across four repositories in the core set — `deve
1. **One state to read.** The aggregator polls and reads its sources and publishes pages and machine twins of the same data: an overview, a needs-you queue, a board, a roadmap, a program view, a queue view, quota and health views, and the rest of the 33 aggregator routes counted in the survey. The console presents 27 further views built for a phone. The full census is a reference chapter; the mental model is in [The shape of the system](getting-started/shape.md).
2. **Questions that wait in one place.** When work needs a decision, the question is raised as a decision set, a needs-Drew item, a prompt, or a console ask — eight question sets in total (F1–F8 in the survey). Each set has a defined answer route and a defined write-back. See [Question sets and the answer-back flow](concepts/questions-and-answers.md).
3. **Answers that reach the work.** An answer is not a note beside the work. A decision resolution is recorded and applied to the decisions ledger; a dashboard action is consumed by the orchestration pass, which is the single writer of Project fields; a console action is audit-logged before it is taken and then performed. The flows differ by surface, and this book keeps them separate.
4. **Push that reaches a phone.** Waiting questions and incidents are pushed to subscribed devices, and the phone is an answering surface, not only an alert surface. The relay that would answer at the edge is built but not deployed, and its answer routes are not routed (D5); today answers go to the laptop aggregator. See [Push notifications: detection to phone to answer](concepts/push-notifications.md).
4. **Push that reaches a phone.** Waiting questions and incidents are pushed to subscribed devices, and the phone is an answering surface, not only an alert surface. The relay that would answer at the edge is built, deployed (by hand, 2026-11-26, #14950), and its answer routes are routed in code (D5 resolved as to deployment and routing); today answers still go to the laptop aggregator, pending the laptop-side relay wiring. See [Push notifications: detection to phone to answer](concepts/push-notifications.md).

## Who it serves

Expand All @@ -28,7 +28,7 @@ The survey counted 36 components under `pm-stack/` and its Nix packages. Grouped
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Core services | The aggregator (port 4870), the console (port 4872), the projector (port 7801), and pm-dispatch (port 4879) |
| External apps, integrated | Kaneo (execution board, port 5173), Grist (roadmap tables, port 8484), Pad (planning layer, port 7777), ready-for-agent (dispatch UI, port 6056) |
| Edge Workers | The console edge Worker, the decision-events Worker, the voice-line Worker, and the notify relay — the relay is recorded as not deployed in `pm-stack/platform/workers.json` (D5) |
| Edge Workers | The console edge Worker, the decision-events Worker, the voice-line Worker, and the notify relay — the relay is recorded as in service in `pm-stack/platform/workers.json`, deployed by hand 2026-11-26 (#14950; D5 resolved as to deployment) |
| Execution | pm-dispatch, the OpenCode claimant, scheduled jobs, and the dispatch UI layer |
| Guards and safety nets | The Kaneo sync guard, the closure watchdog, the invariant sweeper, lane-guard, and the health hooks |
| Quota and usage | The quota gatherers and exporters, provider-usage, quota-check, and the usage surfaces behind the quota page |
Expand Down
2 changes: 1 addition & 1 deletion pm-stack/book/operations/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Questions a new operator asks, answered from the surveys. Each answer names its

## Is the notify relay live?

No (D5). The `pm-notify` Worker is recorded in `pm-stack/platform/workers.json` as "not deployed", with a null address. Its event-mirror route and its edge answer-intake routes are not routed in its code; they arrive with steps 2 and 3 of the relay build. The dead-man's switch — one `stack.silent` push when the laptop falls silent — does not exist in production. Phone answers go to the laptop aggregator. See [Tutorial: trace a push notification from event to answer](../tutorials/trace-a-push.md).
The Worker is deployed and its routes are routed, but the full relay path is not live end-to-end (D5, resolved as to deployment and routing). The `pm-notify` Worker is recorded in `pm-stack/platform/workers.json` as in service, deployed by hand on 2026-11-26 (#14950) at `https://pm-notify.developing-today.workers.dev`. Its event-mirror route and its edge answer-intake routes are routed in its code — the source header lists them in the closed route list. What remains is the laptop side: with no `PM_AGG_NOTIFY_RELAY_URL` configured, the aggregator posts no heartbeats, and phone answers go to the laptop aggregator. See [Tutorial: trace a push notification from event to answer](../tutorials/trace-a-push.md).

## Is Kaneo our fork?

Expand Down
2 changes: 1 addition & 1 deletion pm-stack/book/operations/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The PM vocabulary, defined as the surveys and the code use the terms. Where a te

**Needs-Drew / needs-you tier.** The attention tier of items waiting on the owner, built by the census in `aggregator/src/needs-drew.ts` and split into hands, review, and agent-decides sets by `needsDrewWait`. The console renames the buckets for the phone: Questions, Only you can do, Reviews, Escalated (D13).

**Notify relay.** The Cloudflare Worker in `pm-stack/notify-relay/` (`pm-notify`): a dead-man's switch that sends one `stack.silent` push after laptop silence, built at step 1 of its plan and not deployed (D5).
**Notify relay.** The Cloudflare Worker in `pm-stack/notify-relay/` (`pm-notify`): a dead-man's switch that sends one `stack.silent` push after laptop silence, built at step 1 of its plan and deployed by hand on 2026-11-26 (#14950; D5 resolved as to deployment).

**Orchestration pass.** The consumer pass that applies dashboard actions and performs Project field writes as the Project's single writer, reporting outcomes back through the actions result path. Its shared-store writes follow the one-transaction-per-pass shape in [The shared schema as a library](../library/shared-schema-package.md).

Expand Down
2 changes: 1 addition & 1 deletion pm-stack/book/operations/health-and-healing.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ One pilot scheduled job runs an OpenCode session on a systemd timer: `pm-stack/o
- No hook remediates. Diagnosis and reporting are the hook contract.
- No monitor in `fleet-monitor/` changes state.
- The sweeper's third invariant class is report-only in every mode.
- The notify relay's dead-man's switch is not part of the running layer: the `pm-notify` Worker is not deployed (D5), so total laptop silence has no relay leg. Whether any other watchdog covers total laptop silence is UNVERIFIED in the surveys.
- The notify relay's dead-man's switch is not part of the running layer as surveyed: the `pm-notify` Worker was recorded as not deployed at survey time (D5; it has since been deployed by hand on 2026-11-26, #14950), so total laptop silence had no relay leg in the surveyed layer. Whether any other watchdog covers total laptop silence is UNVERIFIED in the surveys.

Sources. survey/website-pages.md §C; survey/apps.md §12, §15, §17–§18, §20, §24, §26, §29–§32; survey/push.md §1, §5; survey/disagreements.md D5, D8. Ground truth: laptop clone at 4d937b3, 2026-11-23.
4 changes: 2 additions & 2 deletions pm-stack/book/operations/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Symptom → cause → fix. Each entry names the check that confirms the cause be
## A phone answer goes nowhere: the relay routes return 404

- **Symptom:** An answer sent to the notify relay's edge routes — `POST /mirror/event`, `GET /answer/&lt;ledgerId&gt;`, `POST /api/needs-drew/&lt;ledgerId&gt;/answer` on the relay — returns 404, or the relay sends nothing when the laptop is silent.
- **Cause:** Those routes are not routed, and the relay is not deployed (D5). `pm-stack/notify-relay/src/index.ts` states it in its header: the mirror route arrives with step 2 of the relay build and the answer routes with step 3; everything else 404s. `pm-stack/platform/workers.json` records `pm-notify` as "not deployed" with a null address. The relay README's route table lists the unrouted routes beside the live ones, separated only by a "Lands in" column — the table reads as availability and is not.
- **Cause:** In the current code those routes ARE routed (D5, resolved as to deployment and routing): `pm-stack/notify-relay/src/index.ts` lists the mirror route and the answer routes in its closed route list in its header; everything else 404s. The relay Worker is deployed — `pm-stack/platform/workers.json` records `pm-notify` as in service, deployed by hand on 2026-11-26 (#14950). A 404 on a listed route therefore means the answering deployment predates the route landing, or the request path is outside the closed list; and with no `PM_AGG_NOTIFY_RELAY_URL` configured on the laptop, no heartbeats arrive, so the relay sends nothing when the laptop is silent. The relay README's route table lists the unrouted routes beside the live ones, separated only by a "Lands in" column — the table reads as availability and is not.
- **Confirm:** Read the registry entry for `pm-notify` in `workers.json`, and the header of `notify-relay/src/index.ts`. Both say the same thing; the README table is the outlier.
- **Fix:** Route the answer to the laptop aggregator. Phone answers land through the aggregator's own `POST /api/needs-drew/&lt;ledgerId&gt;/answer` and the decision-set pages, as in [Tutorial: answer a waiting question end to end](../tutorials/answer-a-question.md). There is no operator fix that makes the relay live; deploying it is build work (relay steps 2–3 and the deploy step), not a setting.
- **Fix:** Route the answer to the laptop aggregator. Phone answers land through the aggregator's own `POST /api/needs-drew/&lt;ledgerId&gt;/answer` and the decision-set pages, as in [Tutorial: answer a waiting question end to end](../tutorials/answer-a-question.md). There is no operator fix for a stale deployment or the missing laptop wiring; both are build/deploy work, not a setting.

## The quota view disagrees with the provider

Expand Down
2 changes: 1 addition & 1 deletion pm-stack/book/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ The original survey verifies these environment names in detail. The full verifie

- **What it is:** The aggregator's notify-relay URL (`aggregator/src/notify-relay.ts`).
- **Default:** Unset.
- **Behaviour:** With no `PM_AGG_NOTIFY_RELAY_URL`, the aggregator side of the dead-man's switch is inert: no heartbeats are posted. D5 — the relay itself is not deployed.
- **Behaviour:** With no `PM_AGG_NOTIFY_RELAY_URL`, the aggregator side of the dead-man's switch is inert: no heartbeats are posted. D5 — the relay itself is deployed (in service, by hand, 2026-11-26, #14950); the inertness here is the unset URL, not the deployment.

### `ATLAS_SEARCH_MODEL` and `ATLAS_VEC_TABLE`

Expand Down
Loading