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
80 changes: 80 additions & 0 deletions doc/living/account-connection-campaign.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Account connection campaign

Living document · Status: shipped (2026-10-20) · Register entry X11 · Tracking epic: developing-today/code#8805

## Purpose

- Get every service signed in / connected on Muse's machine.
- Then repeat the same set on Drew's laptop.
- First asked: 2026-10-20.

## What landed (features, and how each works)

- A standing campaign, tracked as a goal, not as an issue.
- Goal: account-connection-campaign
(goal_6f48d745f802 in the register).
- Campaign rules, as recorded:
- Hunt down every account.
- API keys where possible.
- OAuth wherever possible.
- No new MFA unless a service forces it.
- Every token Muse creates gets filed in Bitwarden under a
clear name.
- Campaign opened 2026-10-20 at 07:51 CDT.
- A 6-hour nudge cron surfaces one Drew-needed item at a time.
- Progress is tracked in a checklist that lives in the goal's
hidden_files:
`~/workspace/goals/account-connection-campaign-every-service-signed-in-on-muse-s-machine/hidden_files/accounts-checklist.md`
- The register records the checklist as covering 17 accounts,
each with an auth route and a status.
- Checklist contents and any credential information are not
reproduced in this document.

## Rough architecture

- Vehicle: the account-connection-campaign goal.
- Record of truth for progress: the checklist in the goal's
hidden_files (path above).
- Cadence mechanism: a 6-hour nudge cron, one Drew-needed item
at a time.
- Credential storage rule: tokens filed in Bitwarden under a
clear name (see rules above).
- Tracking in the register: NEVER-ISSUED — no GitHub issue;
goal-tracked by design.

## Status

- design_status in the register: built-into-running-system
(standing campaign).
- implementation_status in the register: partial / standing.
- Triage in the register: (b) DONE-WITHOUT-ISSUE as a vehicle;
per-account completions are the checklist's job.
- One completion named in the register: Plaid — at record time
Plaid beyond Royal Credit Union stayed Drew-only in his own
browser; the November record shows Plaid verified fully
linked on 2026-11-08, 4 institutions / 13 accounts.

## Next steps — immediate / near-term / long-term

- Immediate: continue per-account completions in the checklist.
- Near-term: repeat the connected set on Drew's laptop, per the
original campaign ask.
- Long-term: not recorded.

## Open follow-ups

- Per-account completions tracked in the checklist (see above).
- No other follow-ups are recorded for this entry.

## Future ideas not yet specced

- None recorded in the register entry.

## Links (register entry, related issues/PRs named in the register entry)

- Register entry: X11, in the design register (REGISTER.md).
- Goal: account-connection-campaign (goal_6f48d745f802).
- Checklist: the goal's hidden_files accounts checklist (path
above; contents not reproduced here).
- Tracking epic: developing-today/code#8805.
- Tracking in the register: NEVER-ISSUED (no GitHub issue).
81 changes: 81 additions & 0 deletions doc/living/ai-gateway-opencode-gateway.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# AI Gateway "opencode-gateway"

Living document · Status: shipped (2026-10-07) · Register entry C4 · Tracking epic: developing-today/code#8805

## Purpose

- Provide a named Cloudflare AI Gateway for the fleet's inference traffic.
- Name recorded in the register: `opencode-gateway`.
- Created by Drew himself in the Cloudflare dashboard on 2026-10-07.

Context from the register entry:
- Drew created the gateway, then asked Muse: "what's the ai gateway name BTW?"
- He stood it up for the fleet's inference traffic and confirmed the setup
with Muse the same morning.

## What landed (features, and how each works)

- Gateway object:
- AI Gateway named `opencode-gateway`.
- Created 2026-10-07 04:25 CDT by Drew in the Cloudflare dashboard.
- Credential pairing:
- The inference-scoped token from C2 serves it.
- Token name in Bitwarden: `cloudflare.api-token-ai-inference`.
- Permissions on that token: AI Gateway Read+Run, Workers AI Read+Write.
- Verified the same morning (2026-10-07) that the inference token works
with the gateway as-is.
- The token was live-tested separately in C2 — embeddings returned.

## Rough architecture

- Cloudflare dashboard object: AI Gateway `opencode-gateway`.
- Caller credential: the purpose-scoped inference token (C2), not the
account-wide admin token.
- No design artifact was found in the register — this is a dashboard
object, not a code artifact.

## Status

- Design status in register: built-into-running-system.
- Implementation status in register: shipped — created by Drew 2026-10-07.
- Tracking: NEVER-ISSUED — searched "AI Gateway opencode", no matching issue.
- Triage: (b) DONE-WITHOUT-ISSUE — dashboard object, exists by Drew's own act.

## Standing rule context (from C5)

- AI Gateway is NOT a general inference path for the fleet.
- The standing rule is recorded in register entry C5
(Grounded search plane + narrow AI Gateway exception, 2026-11-06):
- Drew granted a NARROW exception only: AI Gateway allowed ONLY as
transport for the grounded search plane's Web Search API traffic.
- No inference, no other traffic under that exception.
- Expansion needs a new ruling.
- That exception does not change this gateway's recorded purpose; it limits
how AI Gateway may be used elsewhere in the fleet.
- Related: Ask-the-ledger (A1.14) was built retrieval-only — the register
explicitly notes "AI Gateway never used" there.

## Next steps — immediate / near-term / long-term

- Immediate: none recorded.
- Near-term: none recorded.
- Long-term: none recorded.

## Open follow-ups

- None recorded in-slice for C4 itself.
- For the C5 exception: the grounded-search build is blocked on a billing
choice (load ~$10 credits vs BYOK vs hold) — that follow-up belongs to C5,
not to this gateway. See register entry C5.

## Future ideas not yet specced

- Not recorded in the register entry.

## Links

- Register entries: C4 and C5 in `~/workspace/design-audit-60d/REGISTER.md`
- Related register entries: C2 (credential architecture — the inference token),
A1.14 (Ask-the-ledger, retrieval-only, AI Gateway never used)
- Tracking epic: developing-today/code#8805
- Design artifact: none found (dashboard object)
94 changes: 94 additions & 0 deletions doc/living/cloudflare-credential-architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Cloudflare credential architecture — scoped tokens by purpose + Bitwarden backup

Living document · Status: shipped (2026-10-07) · Register entry C2 · Tracking epic: developing-today/code#8805

## Purpose

- Replace one broad Cloudflare credential with purpose-scoped credentials.
- Back up all on-disk secrets into Bitwarden so no secret lives only on disk.
- Keep the most privileged credential out of Worker secrets and runtime env.

First asked 2026-10-07:
- "put all secrets on the disk in there"
- "generate creds for a different purpose that just have access to cf Ai gateway
and workers Ai for inference, read, etc"

## What landed (features, and how each works)

- Account-wide admin token:
- Stored in Bitwarden.
- Never placed in Worker secrets or environment.
- Day-to-day token:
- Minted 2026-10-07.
- Account-scoped.
- Permissions: Workers Scripts / KV / R2 / D1 / Queues read-write, plus Tail read.
- Intended for routine Cloudflare work instead of the admin token.
- Dedicated R2 token for nix-cache:
- Bucket-scoped to the `nix-cache-nars` bucket only.
- Object read-write on that bucket only.
- Swapped into the nix-cache Worker and re-verified after the swap.
- Inference-only token:
- Minted 2026-10-07.
- Permissions: AI Gateway Read+Run, Workers AI Read+Write.
- Live-tested — embeddings returned.
- Serves the AI Gateway `opencode-gateway` (see C4).
- Bitwarden backup:
- 5 on-disk secrets backed up to Bitwarden.
- Each backup round-trip sha256-verified.
- Project: Bitwarden project "developing today".
- Items named in the register include:
`cloudflare.api-token-account-wide`, `cloudflare.api-token-day-to-day`,
`cloudflare.r2-worker-*`, `cloudflare.api-token-ai-inference`,
`nix-cache.*`, `cachix.*`, and others not itemised in the entry.
- `UPLOAD_SECRET` rotation:
- Rotated consistently across Worker, local file, and Bitwarden.
- Backup tooling:
- Idempotent script: `~/tools/bws-backup-secrets.sh`.

## Rough architecture

- Bitwarden (project "developing today") is the backup / source store.
- Cloudflare tokens are split by purpose:
- admin (stored only, not deployed)
- day-to-day (broad routine account work, still scoped)
- R2 bucket-scoped (single Worker, single bucket)
- inference-only (AI Gateway + Workers AI)
- Workers receive only the token their purpose requires.

## Status

- Design status in register: built-into-running-system.
- Implementation status in register: shipped.
- Tracking: NEVER-ISSUED — searched "bitwarden secrets backup" in
developing-today/code, no matching issue.
- Triage: (b) DONE-WITHOUT-ISSUE.

## Next steps — immediate / near-term / long-term

- Immediate: none recorded as a build step.
- Near-term: resolve the open plugin question below if it recurs.
- Long-term: not recorded.

## Open follow-ups

- Plugin question left unanswered in the record (2026-10-07 04:45):
Drew asked "is that cfat key cloudfare workers Ai? I had a plugin but
it's not accepting that token".
- Answered at the time: the cfat key is full-admin; the inference key is
the one to use.
- Still unknown: which plugin, and what error it showed.
- Broader Bitwarden sharing question (2026-10-06) — Organizations /
Collections, Secrets Manager machine accounts — was answered, but no
decision is recorded.

## Future ideas not yet specced

- Not recorded in the register entry.

## Links

- Register entry: C2 in `~/workspace/design-audit-60d/REGISTER.md`
- Related register entries: C1 (nix-cache), C3 (credential receiver), C4 (AI Gateway)
- Tracking epic: developing-today/code#8805
- Design artifact: Bitwarden project "developing today" items listed above;
script `~/tools/bws-backup-secrets.sh`
61 changes: 61 additions & 0 deletions doc/living/cold-store-backup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Cold-store backup system

- Living document · Status: shipped / operating (nightly) · Register entry X6 · Tracking epic: developing-today/code#8805

## Purpose

One nightly cold-store backup across the fleet's data stores — Turso databases,
Supabase, and D1 — with content-addressed artifacts filed to Google Drive, so a
lost laptop or a dead cloud database is a restore, not a loss.

## What landed

- The nightly cold-store run itself: exports each source store, packages the
artifacts, and files them per the R2 layout design committed beside this doc
(`cold-store-r2-layout-design-2026-10-25.md`, the original 2026-10-25 design,
previously only in the lab-cluster goal's files).
- The 2026-10-27 failure fix chain (PRs #1373/#1383 in developing-today/code):
the Turso step failed when the ~1.13 GB atlas DB dump hit caps; the fix is a
compressed streaming rebuild plus a repair filter for libsql's malformed
`/dump` schema rows. The run went "Turso full-house" clean on 2026-10-28,
and a Supabase S3 gap found that night was closed.

## Rough architecture

Nightly job → per-source export (Turso `.dump`, Supabase, D1) → streaming
compression → content-addressed cold-store layout (see the R2 layout design
doc) → Google Drive filing. The repair filter sits in the Turso export path
(`export-turso.sh`) and rewrites malformed schema rows emitted by libsql's
`/dump` so the dump stays loadable.

## Status

Shipped and operating nightly. Designed 2026-10-25; first recorded failure
2026-10-27, fixed in place; clean full-house run 2026-10-28.

## Next steps

- Immediate: none recorded.
- Near-term: confirm the permanent streaming repair filter in
`export-turso.sh` is the landed form (it was "in flight" in the
2026-10-27 record).
- Long-term: read with the wider backups family (register X19): cold-store
nightly, Supabase DIY backups (X7), fleet-backups provisioning (#8584),
hash-tree scoping, Backblaze — the register notes backups is the most
fragmented domain, with no single owning epic.

## Open follow-ups

- The libsql `/dump` malformed-schema-rows quirk owed an upstream filing
since 2026-10-27 — now filed as developing-today/code#8811.

## Future ideas not yet specced

- A single owning epic for the whole backups family (register X19 note).

## Links

- Register entry X6 (pm-stack/design-register-2026-11-11.md, developing-today/code)
- Design: `cold-store-r2-layout-design-2026-10-25.md` (this directory)
- Fix PRs: developing-today/code#1373, #1383
- Upstream-quirk filing: developing-today/code#8811
Loading
Loading