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
2 changes: 1 addition & 1 deletion pm-stack/book/development/building-and-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ CI in this repository runs on `main` only; pull requests merge without CI and ve
1. **`.github/workflows/pm-stack-tests.yml`** — the stack suite. It runs on `workflow_dispatch` and on a nightly schedule (`17 7 * * *`), not on every push, per the repository's nightly-main-CI policy recorded in the workflow header. Its jobs: a provenance job (the aggregator provenance matrix, 5-minute timeout) and a test job (20-minute timeout) that installs and tests the aggregator, the projector, and pm-dispatch with Bun; installs the console edge's type-check tools with Node 24; runs the platform registry test; and then runs the named Python and shell suites above, each asserted to exist before it runs.
2. **`.github/workflows/pm-aggregator-tests.yml`** — a second aggregator workflow exists in the tree. Its trigger and job shape are UNVERIFIED from the sources read for this chapter.

Worker deployment has its own workflows outside these two: the console edge deploys from Actions per the platform registry, and the message-bridge Worker deploys by `message-bridge-deploy.yml`. The decision-events Worker is deployed by hand, per the registry. The per-Worker deploy triggers are UNVERIFIED beyond those registry statements.
Worker deployment has its own workflows outside these two: the console edge deploys from Actions per the platform registry, and the message-bridge Worker deploys by `message-bridge-deploy.yml`. The decision-events Worker is deployed from GitHub Actions, per the registry (`decision-events-worker-deploy.yml`). The per-Worker deploy triggers are UNVERIFIED beyond those registry statements.

## What a green run proves, and what it does not

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 @@ -44,7 +44,7 @@ Kaneo, its Postgres, Pad, and Grist are containers, defined in `pm-stack/compose
Three parts of the stack do not deploy by the laptop rebuild:

1. **The console edge Worker** (`pm-console-edge`) is deployed from GitHub Actions, per `pm-stack/platform/workers.json`. It serves the same console at `pm.security.cab` when the laptop is unreachable, and holds actions until the host returns.
2. **The decision-events Worker** is in service in `workers.json` and is recorded there as deployed by hand.
2. **The decision-events Worker** is in service in `workers.json` and is recorded there as deployed from GitHub Actions (`decision-events-worker-deploy.yml`).
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 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.
Expand Down
4 changes: 2 additions & 2 deletions pm-stack/book/reference/workers.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ The final arithmetic, stated once and plainly (D41): **the ledger's 24 rows are

## `cold-store-rehydrator`

- **What it is:** The cold store rehydrator Worker (`pkgs/cold-store-reaper/worker/wrangler.toml`): the read path of the Google Drive cold store. `platform/workers.json` (group "data") records its state as "in service", deployed by hand, at `https://cold-store-rehydrator.developing-today.workers.dev`.
- **What it is:** The cold store rehydrator Worker (`pkgs/cold-store-reaper/worker/wrangler.toml`): the read path of the Google Drive cold store. `platform/workers.json` (group "data") records its state as "in service", deployed from GitHub Actions (`cf-worker-versions-release.yml`), at `https://cold-store-rehydrator.developing-today.workers.dev`.
- **Inputs and shape:** Routes are `GET /health` (no auth) and `GET /fetch/<sha256>` (Bearer `REHYDRATOR_API_KEY`). Bindings are a D1 database, `cold-store-manifest` (binding `MANIFEST`), and a `BundleFlight` Durable Object that single-flights work per bundle. Secrets are set by the deploy app from Bitwarden by name: `REHYDRATOR_API_KEY`, `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`, and `GOOGLE_REFRESH_TOKEN` — the same Google grant the Python reaper in the same package uses.
- **Behaviour:** Given an object's sha256, the Worker looks the object up in the D1 manifest (objects → members → bundles), and the `BundleFlight` object pulls exactly that member's zstd frame out of its Drive bundle by byte range, decompresses it, verifies the sha256, and returns the original bytes. Successful fetches carry `X-Cold-Store-Sha256` and `X-Cold-Store-Bundle` headers. The manifest is kept current by the reaper's `cold-store sync-manifest`; the v1 slice serves the object on the same request — filling R2 first and flipping the manifest state back to `hot` belong to the caller's layer.
- **Failure shapes:** `401` without the API key; `404` for an unknown sha (and for every sha until `sync-manifest` has run against a manifest containing verified bundles); `502` on any Drive, decode, or hash failure — bytes are never returned unverified, so a sha256 mismatch after decompression is a 502, not a best-effort serve.

## `developing-today-backup`

- **What it is:** The GitHub backup webhook Worker (`infra/github-backup/worker/wrangler.toml`): the webhook half of the GitHub estate mirror system. `platform/workers.json` (group "data") records its state as "in service", deployed by hand, at `https://developing-today-backup.developing-today.workers.dev`. The rest of the system — the mirror scripts in `infra/github-backup/bin/` — is not a Worker: it runs on the laptop under systemd user timers (`nixos/home/github-backup.nix`).
- **What it is:** The GitHub backup webhook Worker (`infra/github-backup/worker/wrangler.toml`): the webhook half of the GitHub estate mirror system. `platform/workers.json` (group "data") records its state as "in service", deployed from GitHub Actions (`github-backup-worker-release.yml`), at `https://developing-today-backup.developing-today.workers.dev`. The rest of the system — the mirror scripts in `infra/github-backup/bin/` — is not a Worker: it runs on the laptop under systemd user timers (`nixos/home/github-backup.nix`).
- **Inputs and shape:** Routes are `POST /github` (GitHub webhook), `GET /queue` and `POST /queue/ack` (both Bearer-authenticated for the laptop drainer), and `GET /health`. Its one binding is a KV namespace, `GHB_EVENTS`, holding the queued webhook events with a seven-day TTL. Secrets are set by the deploy app from Bitwarden by name: `GITHUB_WEBHOOK_SECRET` (the same value as on the `developing-today-backup` GitHub App) and `DRAIN_BEARER`.
- **Behaviour:** The GitHub App (`developing-today-backup`, metadata and contents read, push and repository events) sends webhooks to this Worker; the Worker verifies the `X-Hub-Signature-256` HMAC and queues `{id, repo, event, action, ts}` in KV. The laptop drains the queue every five minutes and fetches just those mirrors (per-repo coalescing fifteen minutes), acking an event only when its fetch landed. Events are a freshness signal only: every mirror is also fetched daily regardless, and a weekly reconciliation sweep re-inventories GitHub against the mirror tree — webhooks may be missed; the sweep may not.
- **Failure shapes:** Fail-closed with no webhook secret configured (500, #6951); `401` on a bad webhook signature or a missing drain bearer; a webhook payload with no repository is answered 202 and queues nothing; a declared or streamed webhook body over 25 MB is refused (413) before it is buffered.
Expand Down