Skip to content

PM stack: migrate fully to Cloudflare hosting (fallbacks: CF Tunnel, then Tailscale DNS) #14107

Backlog

Description

@developing-today-fleet

Direction (Drew, 2026-11-23 23:51 CST)

"migrate fully into cloudflare fallback to cf tunnel then fallback to tailscale dns"

The PM stack's human-facing surfaces move fully onto Cloudflare hosting. The serving fallback chain, in order:

  1. Cloudflare hosting (Workers/Pages + the hosted data plane) — the normal path.
  2. Cloudflare Tunnel to the laptop — first fallback.
  3. Tailscale DNS (amd-6.raptor-pumpkinseed.ts.net) — final fallback.

Why

The PM stack review (record: PR #14068; summary on #13900, comment 7121679379) established that every page a human opens is still served 100% from the laptop today, and the deployed aggregator is a build from 2026-11-15, 4,687 commits behind main (#14059) — the root of several live symptoms (/chat 404s, /sessions cold-hangs). A stack whose purpose is working when a machine is gone cannot itself live on one machine. The data plane already has real hosted pieces; decision sets are the half-migrated model to copy (data hosted, pages still laptop-served).

Scope

Not this issue

The review's content defects keep their own issues — #14060 (search performance), #14061 (notification ledger timestamps), #14062 (health self-contradiction), #14063 (cross-surface count contradictions), #14064 (decision sets never age out), #14065 (fixture fallbacks fabricate data), #14066 (cost explorer duplicates). The migration changes where pages are served from; the design must state plainly which findings it does and does not affect, and must not be used to close any of them by association.

First step

A design record, before any slice is queued:

  • Target architecture per surface (hosted / tunnel-served / tailnet-only, with reasons).
  • Fallback mechanics: how a request actually moves down the chain (front-door routing vs DNS), which health signals trigger a fall, and how far the automation goes vs a human flipping a name.
  • Data-plane placement per surface, following the decision-sets model.
  • The deployment pipeline that keeps hosted == main.
  • A slice map, packetised after the design lands.
  • Open decisions named with their decider, not invented over.

Secrets and credentials are referenced by name only throughout.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-24T05:52:06Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Activity

  1. developing-today commented on Nov 24, 2026

    @developing-today
    Contributor
  2. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    ContributorAuthor

    Design of record landed — PR #14124

    Record: doc/2026-11-24T06-06-29Z_design_pm-cloudflare-migration/ (via PR #14124), indexed in doc/README.md. Design only — nothing queued; slices are packetised from the record now it exists.

    Shape in one paragraph. One front door at pm.security.cab (the console edge's pattern, generalised — it already fronts that name with a health-gated route flip, and the console origin already passes dashboard paths to the aggregator, so path-unity is the estate's existing shape). Tier 1 is hosted Workers (pm-service for the board family, per the #9079 edition already in flight; the decision-events side for decision surfaces; the #14084 registry surfaces). Tier 2 is a PM-owned Cloudflare Tunnel to the laptop editions. Tier 3 is the tailnet name — and the design says plainly what is true: tier 3 is a bookmark a human picks, not a failover, because no Cloudflare machinery can fail a request over to a different DNS name; it exists for the Cloudflare-down shape and the drills in M9 prove it by using it.

    Fallback mechanics, honestly. Tier 1→2 is mechanised at the front door with per-surface route state: human flip (the rollback/deliberate switch) plus automatic fall for reads only on hosted failure — falling to real laptop data or an honest unavailable page, never to fixtures (the #14065 rule is a hard acceptance rule for every slice). Writes never auto-fall: answers and submissions go to the edge intake/held queue and are applied exactly once by #14043's applier; board write authority follows the #9079 writer-of-record lease in every tier — a tier may serve a board it may not write.

    Deployment. Hosted == main by construction: every PM Worker gets the console edge's Actions build → health-gate (deployed commit == merge commit) → route-flip pipeline, and the by-hand deploys in workers.json are brought under it. The laptop tier gets the scheduled rebuild+flip plus a drift alarm, and every tier's /health renders deployed commit + age — #14059's asks, made structural so 4,687 silent commits cannot recur.

    Per-surface targets: all 38 reviewed surfaces are tabled in §3 of the record (37 captured + the projector). Kaneo/Pad/Grist/RFA get the tunnel tier as their target home in this migration — separate products whose store programmes (#6816/#3142) own anything more. #14060–#14066 each get a plain row in §9: none is fixed by the migration (#14063 loses only its serving half — one front door, one projection set; #14065 gains a hard requirement, not a fix), and none should be closed by association.

    Slice map (ordered, NOT queued):

    Open decisions (deciders named; recommendations in §12 of the record):

    • D1 — Drew: one canonical door at pm.security.cab vs a second name for the aggregator family. (Recommendation: one door.)
    • D2 — Drew: automatic read fall at the front door, or human-flipped route state only. (Recommendation: automatic for reads, always visible; writes never.)
    • D3 — Archer, at M4/M5: tenant plane vs fleet-platform store for each new projection family.
    • D4 — Archer: Access application granularity.
    • D5 — Drew, after M5: the laptop edition's long-term status — maintained dual edition or frozen fallback.
    • D6 — Archer with the queue programme, at M8: pm-dispatch hosted intake or tunnel-only.

    PM book: unchanged by this record — the book updates inside the slices that change serving facts (M1/M3/each wave/M9), per the book-live-update rule; a book edited at design time would describe a stack that doesn't exist yet.

    — Lane PM-CF-DESIGN, 2026-11-24.

  3. added a commit that references this issue on Nov 24, 2026
  4. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    ContributorAuthor

    Rulings recorded — 2026-11-24 (Drew)

    D1 — settled: one front door. The canonical name is pm.security.cab, the single door for the PM surfaces. Drew raised no objection to the design's recommendation, so it stands as decided.

    D2 — decided: automatic fallback. When a hosted surface fails, reads fall automatically to the next tier, and the fall is always visible in route state. Writes still never auto-fall (see the amendment below).

    Amendment to the design's fallback section — the client-fallback layer. Drew adds a mechanism the design did not have: client-side fallback. The hosted page's own JavaScript detects failure when it goes to fetch dynamic details and falls back to the next tier's endpoint itself, walking the chain from the user's side — including toward the tailnet address. Server-side failover to a different DNS name remains impossible, exactly as the design states; what changes is that the client walking the chain mechanises the fall, so the last tier is no longer only a bookmark a human picks. This layer applies to reads and dynamic details. Writes are unchanged: they never auto-fall — submissions ride the edge intake/held queue and are applied exactly once by the answer write-back applier (#14043, the push answer write-back build).

    Generalisation. Automatic fallback is the estate pattern, not a PM-only behaviour: fleet commands adopt it later too, and the Android app does the same fallback natively and directly, rather than through a browser page.

    Frontend direction for these surfaces. The reactive/dynamic layer is Datastar with server-sent events (SSE). The UI stack is Tailwind with DaisyUI, with all default DaisyUI themes available.

    What happens next. Slice M1 (front door + deployment pipeline) is packetised from this record; the shell it serves takes the client-fallback layer above as a design input. Slices M2–M9 remain unqueued.

    — Lane PM-CF-AMEND, 2026-11-24.

  5. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    ContributorAuthor

    Slice M1 packetised — task 21686

    Per the rulings recorded above (comment 7123885604), slice M1 — front door + deployment pipeline is now queued:

    • Task 21686 on queue repo-health-code-pilot, priority 40, kind feature_slice, dedupe key repo-health:v1:slice:developing-today/code:issue:14107:slice-1. Verified by read-back after enqueue: status queued.
    • Packet scope: the pm.security.cab front door generalising the console edge's health-gated route flip (per-surface route state, automatic read fall, human flip retained), plus the deployment pipeline for every PM Worker — Actions build, health gate (deployed commit == merge commit), route flip — including the by-hand deploys in pm-stack/platform/workers.json. Every tier's /health renders deployed commit + age.
    • Drew's client-fallback layer is carried in the packet as a design input for the shell the front door serves, with the Datastar + SSE and Tailwind + DaisyUI (all default themes) direction.
    • Hard rules carried in the packet: no tier renders invented/fixture data (pm-aggregator: fixture fallbacks render invented data when sources die — fail visibly instead #14065 rule as acceptance gate); writes never auto-fall (intake/held queue, applied by the pm-stack: push answer write-back to the queue broker — a phone tap applies broker-sourced decides (Actions-exec extensions first) #14043 applier); PM book updated in-slice for the serving facts M1 changes.

    Slices M2–M9 are not queued — M1 only, as directed.

    — Lane PM-CF-AMEND, 2026-11-24.

  6. added a commit that references this issue on Nov 24, 2026
  7. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    ContributorAuthor

    Amendment — offline mode and the durable client write queue (Drew, 2026-11-24 00:28 CST)

    Drew adds two requirements to this migration, recorded against the design of record (PR #14124) and the client-fallback amendment (comment 7123885604):

    1. Offline mode via a service worker. The hosted PM surfaces must work offline: a service worker caches the shell and the data it needs, so the surfaces open and read with no tier reachable. This is new — the design record has no offline or browser-service-worker provision today (the only "service workers" named in the record are the Cloudflare Workers edition, #9079, a different thing). It composes with the client-fallback layer rather than replacing it: fallback walks the tiers when some tier answers; offline mode is the floor when none does. The design already contemplates the read side of this in §5's failure table (a laptop-sourced view showing "last-known data with its age, or unavailable — never invented"). One existing rule binds the offline cache directly: §0 rule 2, the #14065 rule — an offline surface serves its last real cached data, marked with its age, and never fixture or fabricated data.

    2. Writes are saved client-side and reattempted until pushed. A write made while offline, or while the write path is down, goes into a durable client-side write queue — persisted on the device, surviving page close and app restart — and is reattempted until the server acknowledges it. It is never lost and never silently dropped.

    One point flagged against the design text, not papered over. §5.1 of the design record states the write rule:

    "Writes never auto-fall. An answer, a decision submission, a preference change: these go to the hosted write path — the ledger/intake at the edge (#13469's answer intake; the PmEdge held-items pattern: the edge holds what waits for a machine) — and are applied by their applier (#14043) exactly once. If the hosted write path itself is down, the surface says so and keeps the user's input in front of them; it does not silently re-route a write to a different authority."

    Drew's queue does not break the never-re-route rule: a queued write is reattempted against the same write path (the edge intake / held queue that feeds the #14043 applier), never re-routed to a different authority, and board-data writes still follow the writer-of-record lease in every tier. What changes is the last behaviour in that paragraph: input is no longer merely "kept in front of them" in the live page while the path is down — it is persisted in the client queue and retried automatically until it lands. Read the design as amended on that point.

    The join with #14043, stated explicitly: the client write queue is the client half of the write-back design. Client queue → edge intake / held queue (#13469) → the ledger's answer record → the applier (#14043). A client reattempt must reuse the same answer id, so the intake's existing dedupe (double-taps and retries deduped by answer id) and the applier's answer-id-keyed ledger keep application exactly-once no matter how many times the client retries.

    Implication for a queued slice (scope note only — the packet is not edited here): M1 (task 21686, front door + deployment pipeline) serves the shell the other slices hang off. The service worker belongs to that shell; carrying its registration and cache policy from M1 is far cheaper than retrofitting it onto a shell already shipped.

    — Lane PM-OFFLINE-PUSH-AMEND, 2026-11-24.

  8. dezren39 commented on Nov 24, 2026

    @dezren39
    Member

    M1 progress: PR #14155 adds the decision-events Worker build-version field to /health. The fixed-SHA contract test failed before the implementation and passes now (bun test: 17 passed). Typecheck remains unverified because the Workers types dependency could not be installed here; no Cloudflare deployment was run. This is a prerequisite slice only, not completion of M1; the issue stays open.

    Next slice: after the next PR, decision-events is deployed by Actions with VERSION=$GITHUB_SHA, and the deploy workflow refuses success unless /health reports that exact SHA.

  9. dezren39 commented on Nov 24, 2026

    @dezren39
    Member

    M1 progress: Actions deploy and exact-SHA health gate

    PR #14155 now also adds a decision-events Actions deploy workflow. It injects the full $GITHUB_SHA as VERSION and fails unless /health returns ok: true and that exact SHA. The worker registry and deploy documentation are updated. The focused gate test was first observed red against a false stub; bun test now passes (19 tests). git diff --check and workers.json JSON validation pass.

    Remote install/test/typecheck is running in Fleet Actions run. No Cloudflare deployment was run. This remains a prerequisite only; M1 is still open, including the console-style staged route flip/rollback, front door, and the other acceptance criteria.

    Next slice: after the next PR, a decision-events version is uploaded without serving traffic, health-checked at its exact SHA, then promoted; on health mismatch the prior serving version is restored.

  10. dezren39 commented on Nov 24, 2026

    @dezren39
    Member

    PR #14155 has a new decision-events Actions deploy path with full-SHA VERSION and an exact /health gate. Local suite: 19 passed; workers registry and diff checks passed. Remote install/test/typecheck is still running, no live Cloudflare deployment was attempted. Task 21686 is parked until CI run dezren39/fleet#45343716235 reaches a terminal result. Resume point: add staged upload, exact-SHA health gate, and route flip/rollback; M1 remains open.

  11. dezren39 commented on Nov 24, 2026

    @dezren39
    Member

    CI follow-up: remote verification run dezren39/fleet#45343716235 reached terminal success. This verifies the current PR head only; M1 acceptance remains incomplete (staged upload/health-gate/route-flip and live done-check remain). Task 21686 is re-parked with that status. Do not mark #14107 or M1 complete until the full acceptance checklist is verified.

  12. dezren39 commented on Nov 24, 2026

    @dezren39
    Member

    agent-note:v1 | oc-code-06 · scheduled run (2026-11-24). Picked up M1 (pm.security.cab front door and deployment pipeline) from queue task 21686. It changes production exposure and the deployment pipeline across the aggregator and console surfaces. Not started here: no deployment or DNS changes from a scheduled lane. Parked for a supervised feature-slice run.

  13. added
    queue/claimed
    work/assigned
    status/in-progress
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    queue/claimedstatus/in-progressstatus:in-reviewwork/assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions