diff --git a/doc/living/account-connection-campaign.md b/doc/living/account-connection-campaign.md new file mode 100644 index 0000000000..799a0f0a91 --- /dev/null +++ b/doc/living/account-connection-campaign.md @@ -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). diff --git a/doc/living/ai-gateway-opencode-gateway.md b/doc/living/ai-gateway-opencode-gateway.md new file mode 100644 index 0000000000..5a6c406d15 --- /dev/null +++ b/doc/living/ai-gateway-opencode-gateway.md @@ -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) diff --git a/doc/living/cloudflare-credential-architecture.md b/doc/living/cloudflare-credential-architecture.md new file mode 100644 index 0000000000..d8c8013045 --- /dev/null +++ b/doc/living/cloudflare-credential-architecture.md @@ -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` diff --git a/doc/living/cold-store-backup.md b/doc/living/cold-store-backup.md new file mode 100644 index 0000000000..770a75dec4 --- /dev/null +++ b/doc/living/cold-store-backup.md @@ -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 diff --git a/doc/living/cold-store-r2-layout-design-2026-10-25.md b/doc/living/cold-store-r2-layout-design-2026-10-25.md new file mode 100644 index 0000000000..20e38dd9e7 --- /dev/null +++ b/doc/living/cold-store-r2-layout-design-2026-10-25.md @@ -0,0 +1,362 @@ +# Drive cold-store / Cloudflare R2 layout design + +**Date:** 2026-10-25 +**Status:** Design only. This pass moved nothing, created no bucket or folder, changed no lifecycle rule, and spent nothing. +**Scope:** Drew's Google Drive capacity under Google AI Pro, the existing Cloudflare R2 tenants, and the future path for data that may later be tiered from R2 or the lab cluster. + +## Executive decision + +Use the two stores for different jobs: + +- **Google Drive is the cold, immutable archive vault.** It is already paid for through Google AI Pro, has 5 TiB of account capacity, and is best suited to large, sealed, rarely restored objects. It is not a CDN, query store, or high-churn file system. This is also the settled framing in `~/workspace/google-drive-cold-store/DESIGN.md`. +- **Cloudflare R2 is the hot and operational tier.** R2 is the place for current backups, served media, build/cache objects, payloads still being processed, and objects whose restore may be needed quickly. At the supplied planning rate of **$0.015/GB-month** and with free egress, R2 is inexpensive for working sets, but it should not become the default permanent home for multi-terabyte cold data when the Drive capacity is already paid for. +- **Keep the existing tenants and bucket boundaries.** Do not consolidate the R2 buckets merely for neatness. In particular, `supabase-backups` already has a bucket-scoped credential and a working content-addressed layout; the avatar backup already has its own Drive folder, manifest document, tags, and daily process. +- **Bundle cold Drive objects.** Drive's practical constraints are a 750 GB upload/copy limit per user per 24 hours and roughly three sustained writes/second. Those limits, recorded in `~/memory/2026-10-25.md`, make many-small-files the wrong shape. Cold data should be packed into immutable 4–16 GB bundles, with the searchable index held outside Drive. + +## 1. Inventory — what is actually known + +### 1.1 Google account storage: the “~732 GiB” number + +A live Drive `about.get` check on 2026-10-25, recorded in `~/memory/2026-10-25.md`, reported: + +| Measure | Bytes | GiB | Decimal GB | Interpretation | +|---|---:|---:|---:|---| +| Account quota | 5,499,705,622,528 | 5,120.00 GiB (5 TiB) | 5,499.71 GB | Google AI Pro storage tier | +| Total account usage | 785,960,403,110 | 731.98 GiB | 785.96 GB | The verified “~732 GiB used” figure | +| Usage in Drive files | 191,252,342,752 | 178.12 GiB | 191.25 GB | Only this portion is Drive-resident | +| Derived non-Drive remainder | 594,708,060,358 | 553.87 GiB | 594.71 GB | Gmail and Photos combined; the split is not established | +| Remaining quota | 4,713,745,219,418 | 4,388.02 GiB (4.29 TiB) | 4,713.75 GB | Available before other account growth | + +Two consequences matter: + +1. **The 732 GiB is not a Drive inventory.** Only 178.12 GiB is Drive files. The other 553.87 GiB is the combined Gmail/Photos remainder; no source read for this design establishes how much is Gmail versus Photos. +2. **A 3 TiB project budget remains reasonable.** The prior design reserves no more than 3 TiB for project cold storage, leaving about 1.29 TiB for personal/family growth and other uses. The budget and the 700 GB daily upload hard stop are also encoded in `~/workspace/google-drive-cold-store/schema.sql`. + +### 1.2 Drive tenants that sources establish + +| Tenant | Verified size / state | Evidence | Confidence | +|---|---:|---|---| +| **Muse Avatar Backup** | 46 recorded files; 67,013,227 bytes total (63.9 MiB); last successful backup recorded 2026-10-25 09:15:39 UTC | `~/workspace/goals/avatar-backup-to-google-drive/GOAL.md`; `~/workspace/.jarvis/idea-executions/bc7ea377-2b10-4e9a-b966-f417c6cb64c2/scratch/state.json` | High for the recorded backup set | +| **Cloud/cold-store folder tree** | The prior design records the root, `bundles/`, `manifests/`, `db-backups/` (with `supabase/`, `turso/`, and `d1/`), and `media-cold/` as created; no payload-byte inventory is given there | `~/workspace/google-drive-cold-store/DESIGN.md`, “Build status” | Layout recorded; payload size unverified | +| **All other Drive files** | At most about 191,185,329,525 bytes (178.06 GiB) after subtracting the recorded avatar set from total Drive usage | Derived from `~/memory/2026-10-25.md` and the avatar state file | **Unattributed.** Personal files, family files, project files, shared files, and any other app folders cannot be separated from the sources read | + +That last row is the main inventory gap. No migration should assume the unattributed 178 GiB is project data, disposable data, or in scope for the cold-store. A folder-level inventory is a prerequisite to moving any existing Drive content. + +### 1.3 R2 tenants are separate from the Google total + +The latest bucket inventory cited in `~/workspace/goals/stand-up-lab-cluster-talm-talos-cozystack-postgres-rustfs/hidden_files/cloud-ideas-log.md` lists five R2 buckets: + +- `agent-inbox-mail` +- `labops-files` +- `nix-cache-nars` +- `supabase-backups` +- `webhook-gateway-payloads` + +The sources read for this design do **not** establish current byte totals for those buckets. Do not add an invented R2 total to the Google account total. + +The one concrete database size is small: `~/workspace/supabase/muse-dev/backup/README.md` describes the `muse-dev` database as about 13 MB when that backup design was written and states that full copies were a rounding error against R2's storage scale at that size. The current total size and snapshot count of `supabase-backups` remain unverified in the sources read here. + +### 1.4 Metadata planes are not bulk storage + +D1, Turso, Postgres, and any future manifest database hold indexes, state, and pointers. They are operationally critical but are not where the bulk bytes should live. The cold-store manifest design in `~/workspace/google-drive-cold-store/schema.sql` models `objects`, `bundles`, `members`, a transfer ledger, and project-budget metadata. That index—not folder browsing in Drive—is the system of record for bundled data. + +## 2. Target layout + +### 2.1 Google Drive layout + +Keep the existing avatar tenant outside the cold-store tree. Do not rename or reorganize it as part of this design. + +```text +My Drive/ +├── Muse Avatar Backup/ # existing tenant; unchanged +└── Cloud/ + └── cold-store/ + ├── bundles/ + │ └── / # sealed 4–16 GB immutable bundles + ├── manifests/ # immutable manifest snapshots + ├── db-backups/ + │ ├── supabase/ + │ ├── turso/ + │ ├── d1/ + │ └── postgres/ # proposed for non-Supabase Postgres + ├── media-cold/ # large originals not kept hot + ├── snapshots/ # proposed subdivision + │ ├── cluster/ + │ ├── services/ + │ └── vms/ + └── inventory/ # proposed: dated inventory exports + └── / +``` + +The first four cold-store branches and the three named database subfolders are the layout recorded in `~/workspace/google-drive-cold-store/DESIGN.md`. `postgres/`, `snapshots/`, and `inventory/` are proposed additions in this layout, not claims that they already exist. + +#### Drive rules + +- Drive folders are a coarse physical layout only. Retrieval must go through the manifest; people and jobs should not need to browse thousands of objects. +- A bundle, database archive, or snapshot placed in Drive is **immutable**. Corrections create a new object and a new manifest record; they do not overwrite the verified object. +- Human-readable material that is intentionally browsed—especially avatar versions—may remain as individual files in its existing tenant. Bundling is for machine-managed archives. +- Drive trash is a grace state, not a lifecycle strategy. A monthly process may permanently remove only trash that has passed the class retention rule and the 30-day grace described below. +- No public Drive links are part of this design. Cold-store access is owner-authenticated backup/restore traffic. + +### 2.2 R2 layout + +Keep the existing five buckets. Add discipline through prefixes rather than creating a new bucket for every data class. + +| Bucket | Target prefixes / role | +|---|---| +| `supabase-backups` | Keep the established database-backup layout: `pg////.sql.zst`, plus `pg//manifest.json` as the mutable pointer. Add immutable manifest snapshots under `pg//manifests/.json` if the backup tooling later supports them. | +| `labops-files` | General operational bucket. Use `artifacts//…`, `media//…`, `snapshots//…`, `rehydrated//…`, and `staging//…`. Keep staging explicitly temporary. | +| `nix-cache-nars` | Build/cache data only. No archive role; objects here must be regenerable or re-downloadable. | +| `agent-inbox-mail` | Existing mail-payload tenant. Keep its current application layout; apply the retention decision in §4 rather than silently converting it into a permanent archive. | +| `webhook-gateway-payloads` | Existing webhook-payload tenant. Keep payloads hot only for the processing/debugging window, then delete or archive according to §4. | +| Any existing application bucket not listed above | Its application owner decides the prefix; this design only sets the rule that long-cold, sealed payloads are candidates for Drive bundles and hot/served payloads stay in R2. | + +A manifest read replica may live at a reserved system prefix such as: + +```text +labops-files/_system/cold-store/manifest/current.json +labops-files/_system/cold-store/manifest/snapshots/.json.zst +``` + +That is a replica for the rehydration path, not the canonical database. The canonical manifest remains the database described by `~/workspace/google-drive-cold-store/schema.sql`, with immutable snapshots also stored in Drive. + +### 2.3 Assignment by data class + +| Data class | Primary home | R2 role | Drive role | Why | +|---|---|---|---|---| +| **Database backups** | **Both, by age** | Latest restore points and the active backup stream | Independent cold copies of selected daily/weekly/monthly restore points | R2 gives fast, scriptable restore and already contains the `supabase-backups` system. Drive adds an independent failure domain without paying again for every frequent snapshot. | +| **Avatar renders and versions** | **Drive, existing folder** | None by default | Permanent version archive with the existing manifest document and tags | Tiny (63.9 MiB recorded), human-browsed, tag-driven, and already protected by a working daily process described in `~/workspace/goals/avatar-backup-to-google-drive/GOAL.md`. Moving it would add risk for no material saving. | +| **Media originals** | **Drive when cold; R2 when served or recent** | Current/served media, thumbnails, proxies, and rehydrated originals | Sealed bundles of originals that have left the hot set | Drive is the economical permanent home; R2's free egress and CDN adjacency are wasted on originals nobody is requesting. | +| **Cluster / VM / service snapshots** | **Both, by criticality and age** | Latest boot-critical snapshots and recent operational restore points | Monthly or milestone archives in sealed bundles | A rebuild should start from a fast source. Old snapshots are insurance, not working data. | +| **Project archives and exports** | **Drive** | Manifest replica, recent exports still being shared or processed | Sealed bundles with a manifest record for every member | Archives are large, immutable, and rarely read—the exact workload Drive is reserved for. | +| **Build artifacts and caches** | **R2 only** | Current cache/artifacts | None | Churny and regenerable. Sending caches to Drive spends upload/write budget and creates archive clutter. | +| **Mail and webhook payloads** | **R2 during their useful window** | Processing, replay, debugging, and dispute handling | Only payloads explicitly marked for long retention; otherwise no Drive copy | Payloads can contain sensitive or low-value data. Indefinite retention should be a decision, not an accident of storage layout. | +| **Manifests and indexes** | **Database first; replicas in both stores** | Read replica for restore/rehydration | Immutable snapshots as disaster recovery for the index itself | If the manifest is lost, Drive becomes opaque bundles. The index must be easier to restore than the data it describes. | + +## 3. Naming and object conventions + +### 3.1 General rules + +- Use lowercase kebab-case tenant and system names: `supabase`, `turso`, `d1`, `lab-cluster`, `media`, `snapshots`. +- Use UTC timestamps in names that represent a point in time: `YYYYMMDDTHHMMSSZ` (for example, `20261025T221500Z`). +- Use `/` partitions for date-ordered series. Do not create a folder or prefix per day unless the expected object count requires it. +- Never encode a secret, personal name, email address, or opaque database row ID in a public-facing key when a tenant/system/date/hash path will do. +- A mutable name is allowed only for a pointer such as `manifest.json`, `current.json`, or `latest.json`. Everything a pointer references must be immutable and independently addressable. + +### 3.2 Bundles and members + +Retain the bundle model from `~/workspace/google-drive-cold-store/DESIGN.md`: + +- Physical bundle name: `b_.tar.zst`. +- Target bundle size: 4–16 GB; seal at the size threshold or after 24 hours, whichever comes first. +- A bundle contains individually framed members so one member can be range-fetched without downloading or scanning the whole bundle. Offsets and lengths are manifest data, not filename data. +- The manifest records, for every object: full SHA-256, byte size, content type, source bucket/key when it came from R2, state, bundle ID, member offset, and member length. This follows `~/workspace/google-drive-cold-store/schema.sql`. +- The bundle filename is only a checksum claim. It becomes trusted after the manifest records the full bundle SHA-256 and the upload verification in §5 passes. + +### 3.3 Database backups + +Retain the established `supabase-backups` key shape from `~/workspace/supabase/muse-dev/backup/README.md`: + +```text +pg////.sql.zst +pg//manifest.json +``` + +For other databases, use the same pattern with a system-specific first segment: + +```text +db/////-.dump.zst +``` + +The manifest—not the filename—is authoritative for the full hash, source host/project, schema or migration version, row/object counts when available, transport, and restore instructions. + +### 3.4 Snapshots and media + +Recommended logical names before bundling: + +```text +snapshots////--.zst +media////. +artifacts////-.zst +``` + +For media, the manifest should also preserve the original filename/path as metadata. The physical archive identity remains the hash; user-friendly names belong in the index and any human-facing manifest. + +## 4. Lifecycle and retention rules + +These are **recommended defaults for a future implementation**, not rules changed by this design pass. + +| Class | Hot / R2 rule | Cold / Drive rule | Deletion rule | +|---|---|---|---| +| Database backups | Keep the latest successful backup plus the last 30 days in R2. | Copy one sealed restore point per day; retain daily × 30, weekly × 12, monthly × 12. | A source snapshot may leave R2 only after the Drive copy is verified. Permanent deletion follows the retention schedule, with trash grace where the store supports it. | +| Avatar versions | No routine R2 copy. | Keep all recorded versions indefinitely. “Favorite” versions are never auto-deleted or overwritten. | Manual decision only. This preserves the tag model in `~/workspace/goals/avatar-backup-to-google-drive/GOAL.md`. | +| Media originals | Keep served/recent originals and derivatives in R2. A rehydrated original may be evicted after 30 days without access. | Keep originals indefinitely unless Drew sets a collection-specific rule. | Do not delete the Drive original merely because a proxy or thumbnail exists. | +| Cluster/service snapshots | Keep daily snapshots 14 days and weekly snapshots 8 weeks. | Keep monthly snapshots 12 months; keep named milestone snapshots until Drew retires them. | Expire by manifest state, not by filename guesswork. | +| Project archives | Keep an R2 copy only while actively shared or processed, default 90 days. | Keep according to the project’s own retention; review annually. | Tombstone in the manifest first; remove the physical bundle only when no live members remain or a verified successor bundle exists. | +| Build/cache objects | Lifecycle-expire after 30–90 days, by cache type and last use. | None. | Safe to expire without Drive verification because the class is regenerable. | +| Mail/webhook payloads | Default 180 days for processing/debug history. | Archive only items explicitly flagged for legal, financial, or project-history reasons. | Delete unflagged payloads at expiry; do not bundle everything “just in case.” | +| Manifest snapshots | Keep the current replica and the last 90 days of snapshots in R2. | Keep monthly snapshots indefinitely and daily snapshots for 90 days. | Never delete the last verified manifest snapshot for a bundle that still exists. | +| Staging / rehydration temp objects | Delete after 7 days unless tied to an active verified restore. | Not applicable. | A failed or abandoned staging object must not be mistaken for an archive copy. | + +### Bundle compaction + +- When a bundle's live bytes fall below 30% of its total bytes, it becomes a compaction candidate (the threshold is from `~/workspace/google-drive-cold-store/DESIGN.md`). +- Re-pack live members into a new bundle, verify the new bundle, update the manifest, and only then trash the old bundle. +- Compaction uploads count against the same daily Drive budget as new ingest. New backups take precedence over compaction. +- Permanent deletion of trashed bundles waits 30 days. + +## 5. Restore and verification story + +An archive copy is not “done” when an upload reports success. It is done when a restore path has been proven for that class. + +### 5.1 Verification at ingest + +For every object or bundle: + +1. Compute SHA-256 before or while streaming the source. +2. Record the expected size and hash in the manifest in a non-final state (`staging`, `sealed`, or `uploading`, following the states in `~/workspace/google-drive-cold-store/schema.sql`). +3. Upload with a resumable mechanism where the platform supports it. +4. Compare the stored byte count with the expected count. +5. For Drive bundles, cross-check the Drive-reported MD5 recorded in the manifest. MD5 is a useful provider-side cross-check; it does not replace the SHA-256 verification. +6. Download or range-read the object/member back, decompress it if framed, and verify its SHA-256 before marking it verified/cold. +7. Only after that verification may the manifest state change to cold and any R2 source become eligible for lifecycle removal. + +Failure at any step leaves the source in place. A failed Drive copy is staging debris, not a backup. + +### 5.2 Ordinary cold-object restore + +1. Look up the object hash in the manifest. +2. Identify the verified bundle and the member's offset/length. +3. Range-pull only that member's bytes from Drive. +4. Decompress the member frame and verify the object SHA-256. +5. Put the verified object into its original R2 bucket or the appropriate `rehydrated/` prefix. +6. Mark it hot in the manifest and restart its hot-retention clock. +7. Serve from R2, not directly from Drive. + +For a small object, the restore may complete within the triggering request. For a large object, return a “warming” state and let the client retry into the R2 copy. The important invariant is **fill and verify R2 first, then serve**. + +### 5.3 Database restore + +1. Select the backup from the manifest, not by choosing the newest filename by eye. +2. Download the backup and verify that its SHA-256 matches the manifest and, for the established Supabase layout, its content-addressed filename. +3. Restore into a scratch database or isolated target—never directly over production as the first test. +4. Verify the migration/schema version and application-level counts or smoke queries. +5. Record the restore target, elapsed time, backup hash, and checks performed. +6. Only a separately approved production restore may replace a live database. + +The Supabase backup README at `~/workspace/supabase/muse-dev/backup/README.md` already documents the shape of this flow and a 2026-10-21 verification in which 13 tables / 4,362 rows restored to 4,362 insert statements plus migrations. That is the standard to repeat: content hash plus a real restore, not merely a downloadable file. + +### 5.4 Avatar restore + +1. Choose the version by its friendly label and tags in the avatar manifest. +2. Download the Drive file. +3. Compare its SHA-256 and size with the avatar backup state. +4. Confirm the image decodes and, for an animation, that the animation opens/plays. +5. Record the restore in the avatar state; a restored older version becomes current by tag/state, not by overwriting its historical file. + +### 5.5 Drills and scrubbing + +Recommended defaults: + +- **Monthly:** verify one randomly selected bundle or at least 1% of cold bytes, whichever is smaller, plus verify that the current manifest snapshot can be opened and queried. +- **Quarterly restore drill:** restore three random cold objects and one database backup into scratch targets; verify hashes and application-level checks. +- **After any migration stage:** verify 100% of the objects moved in that stage before the source is eligible for deletion. +- **Annually:** run a broader bundle-verification campaign within the 750 GB/day Drive limit and reconcile the manifest against both stores. +- **Restore log:** keep a dated record with class, object/bundle ID, hashes checked, destination, elapsed time, and result. A failed drill blocks further source deletion for that class until resolved. + +## 6. Migration order if Drew later approves movement + +Each stage is independently reversible. No stage deletes a source merely because a copy was attempted. + +| Stage | Work | Verification gate | Rollback | +|---:|---|---|---| +| 0 | **Inventory only.** Produce a folder-level Drive inventory and a byte-accurate R2 bucket/prefix inventory; classify the unattributed Drive data as in scope, out of scope, or unknown. | Drew reviews the classes; unknowns default to out of scope. | Nothing moved. | +| 1 | **Manifest first.** Stand up or confirm the manifest, restore the manifest from a snapshot in a test, and register existing tenants without moving their payloads. | Manifest opens from backup; avatar and Supabase backup records reconcile to their existing manifests/state. | Remove the test index; original tenants unchanged. | +| 2 | **Database cold copies.** Copy one selected daily restore point per database from R2 to Drive on the chosen cadence; leave every R2 backup in place. | Hash verification plus one scratch restore per database. | Stop copying; trash the unverified or unwanted Drive copies after review. R2 remains authoritative. | +| 3 | **Already-cold R2 archives.** Bundle a small pilot set of project archives, verify them in Drive, and keep the R2 originals through a grace period. | 100% member hash verification; one pilot restore from Drive to R2. | Point the manifest back to R2 and stop; no source has been deleted yet. | +| 4 | **Media originals.** Seed cold originals to Drive in campaigns below the 700 GB/day hard stop recorded in `~/workspace/google-drive-cold-store/schema.sql`; keep hot/served media in R2. | Bundle and member verification; sample playback/restore per collection. | Keep serving from the existing source; Drive bundles remain an extra copy or are trashed after review. | +| 5 | **Snapshots.** Add monthly/milestone Drive copies while retaining the current R2 restore window. | One cluster/service restore test from the Drive copy into a scratch target. | Continue restoring from R2; Drive copies are additive. | +| 6 | **Lifecycle automation.** Only after stages 2–5 pass, let verified cold objects age out of R2 under §4. Introduce compaction after lifecycle removal is stable. | At least one quarterly drill passes with the automation enabled. | Disable lifecycle rules; rehydrate or retain objects in R2. Drive archives remain intact. | +| 7 | **Optional account graduation.** Revisit a dedicated archive-owner Google account only if the triggers in the prior design occur: seeding needs exceed a day’s window, daily deltas routinely exceed roughly 300 GB, or Drew wants the main account credential separated from always-on workers. | A new design decision, not an automatic consequence of this layout. | Stay on the main account layout. | + +## 7. Monthly cost model + +### 7.1 Assumptions + +- R2 storage is modeled at **$0.015 per GB-month**, using decimal GB for billing-style calculations. +- The table is **storage-only**. It does not invent a request/operation total because the sources read do not establish current R2 operation counts or a byte-accurate R2 inventory. +- Google AI Pro is an existing bundle, not a cold-store-only purchase. Its price is recorded in `~/memory/2026-10-25.md` as $19.99/month or $199.99/year. If Drew keeps AI Pro for its other benefits, the incremental cost of using otherwise-free Drive capacity is $0. If the plan were bought solely for storage, allocate the full plan price instead. +- “2×” means twice the stated payload, not a forecast. + +### 7.2 Storage scenarios + +| Scenario | Current payload | If stored in R2 at $0.015/GB-mo | 2× payload | If 2× stored in R2 | Recommended-home cost | +|---|---:|---:|---:|---:|---| +| Current Drive-resident files | 191.25 GB | **$2.87/mo** | 382.50 GB | **$5.74/mo** | Incremental **$0** in Drive under the existing AI Pro plan | +| Entire current Google account usage (counterfactual; Gmail/Photos are not a simple R2 migration) | 785.96 GB | **$11.79/mo** | 1,571.92 GB | **$23.58/mo** | Not applicable as a single class; classify first | +| Proposed project cold-store budget | 3 TiB = 3,298.53 GB | **$49.48/mo** | 6 TiB = 6,597.07 GB | **$98.96/mo** | Drive incremental **$0** until the cap; **2× exceeds the current free headroom and is not valid without a new quota/plan decision** | +| Recorded avatar backup set | 0.067 GB | **<$0.01/mo** | 0.134 GB | **<$0.01/mo** | Incremental **$0** in its existing Drive folder | + +The economic conclusion is not that R2 is expensive for today's small operational sets—it is not. The conclusion is that **Drive wins decisively at the multi-terabyte cold tier**, while R2's cost remains acceptable for hot data, caches, current backups, and rehydrated objects. + +### 7.3 Budget guardrails for a future build + +- Project cold-store soft alert at **2.7 TiB** and hard design cap at **3 TiB** in Drive. +- Daily Drive upload hard stop at **700 GB**, preserving margin below the official 750 GB/day limit. +- Track R2 bytes by bucket/prefix monthly. Any R2 class that is cold, sealed, and larger than 100 GB should either have a Drive migration stage or a written reason to stay hot. +- Review the unattributed Drive inventory before raising the 3 TiB cap. The cap is a project-allocation rule, not a claim that the whole account belongs to projects. + +## 8. Open decisions for Drew + +All of these can wait for a future build decision. The recommended defaults are chosen so that “no answer” means “keep the safe layout.” + +1. **Archive-owner account** + *Decision:* Keep the main Google account as archive owner, or eventually graduate to a dedicated family account? + *Recommended default:* **Main account for now.** Revisit only on the stage-7 triggers. This matches `~/workspace/google-drive-cold-store/DESIGN.md`. + +2. **Project storage cap** + *Decision:* Confirm the project cold-store allocation. + *Recommended default:* **3 TiB cap, alert at 2.7 TiB, 700 GB/day upload hard stop.** + +3. **Existing Drive inventory scope** + *Decision:* Which existing Drive folders are project data, personal data, or out of scope? + *Recommended default:* **Inventory first; unknown means out of scope.** No existing Drive payload moves based on this design alone. + +4. **Database retention split** + *Decision:* Confirm how long database restore points stay hot and cold. + *Recommended default:* **R2 latest + 30 days; Drive daily × 30, weekly × 12, monthly × 12.** + +5. **Payload retention** + *Decision:* How long should mail and webhook payloads remain available for replay/debugging? + *Recommended default:* **180 days in R2, then delete unless explicitly flagged.** Do not archive payloads by default. + +6. **Media retention** + *Decision:* Should media originals be permanent, or should collections get individual expiry rules? + *Recommended default:* **Originals permanent in Drive; R2 derivatives/rehydrated copies expire after 30 days without access.** + +7. **R2 bucket structure** + *Decision:* Create a new general cold-store bucket, or keep the existing application buckets? + *Recommended default:* **Keep the existing five buckets and use prefixes.** Create a new bucket only for a distinct credential, public-access, or lifecycle boundary. + +8. **Avatar tenant** + *Decision:* Fold avatar backups into the cold-store tree, or leave the current tenant alone? + *Recommended default:* **Leave `Muse Avatar Backup` unchanged.** Register it in inventories; do not reorganize a working, tag-based backup. + +9. **Restore service level** + *Decision:* How fast must cold restores be? + *Recommended default:* **Database scratch restore tested quarterly; ordinary cold objects restored to R2 the same day; no minute-level RTO for archives.** Pay for faster recovery only for classes Drew names as operational. + +10. **Permanent deletion authority** + *Decision:* Which classes may a future lifecycle job permanently delete without a fresh prompt? + *Recommended default:* **Only regenerable caches and expired unflagged payloads.** Backups, media originals, snapshots, and archives require manifest tombstoning plus the stated grace period; avatar favorites are manual-only. + +## Source map + +- `~/memory/2026-10-25.md` — live Drive `about.get` figures; official Drive limits summarized there; Google AI Pro price; framing that Drive is cold/immutable and R2 stays hot. +- `~/workspace/google-drive-cold-store/DESIGN.md` — prior Drive/R2 design v0.1: identity layout, bundle model, manifest role, reaper/rehydrator flow, compaction, restore drill, and recorded build status. +- `~/workspace/google-drive-cold-store/schema.sql` — manifest tables, bundle/member addressing, 3 TiB budget, and 700 GB daily upload hard stop. +- `~/workspace/goals/avatar-backup-to-google-drive/GOAL.md` — avatar Drive folder, manifest document, tag/favorite model, and rollback purpose. +- `~/workspace/.jarvis/idea-executions/bc7ea377-2b10-4e9a-b966-f417c6cb64c2/scratch/state.json` — recorded avatar file count, sizes, hashes/state, and last successful backup timestamp. +- `~/workspace/supabase/muse-dev/backup/README.md` — `supabase-backups` bucket, content-addressed key, manifest, bucket-scoped credential location by name, restore flow, and historical restore verification. +- `~/workspace/goals/supabase-muse-dev-platform-backups/GOAL.md` — ownership of the muse-dev platform and the R2 backup system. +- `~/workspace/goals/stand-up-lab-cluster-talm-talos-cozystack-postgres-rustfs/hidden_files/cloud-ideas-log.md` — Cloudflare account inventory, including the five R2 bucket names. diff --git a/doc/living/fleet-roles-minder-catcher-advocate.md b/doc/living/fleet-roles-minder-catcher-advocate.md new file mode 100644 index 0000000000..cb82fa538f --- /dev/null +++ b/doc/living/fleet-roles-minder-catcher-advocate.md @@ -0,0 +1,95 @@ +# Fleet roles — ONE fleet minder, dropped-thread catcher, Builder's Advocate + +Living document · Status: shipped (2026-11-08) · Register entry F4.7 · Tracking epic: developing-today/code#8805 + +## Purpose + +- Restructure fleet tending roles so coverage does not depend on many + overlapping minder / watcher jobs. +- Replace many Muse jobs with a small, named set of roles, each with a + clear duty. +- Source: Drew's structural rulings, 2026-11-08 ~18:19 CST. + +Drew's rulings as recorded: +1. Exactly ONE Muse minder job survives — checks ALL sessions and tasks, + and must actively KICK, not just watch. +2. Issue-making / priority / design functions: build ONE Muse version and + ONE OpenChamber version, completely separate, rewritten from scratch + per Drew's actual wants. +3. NEW HOURLY Muse task — dropped-thread catcher (see below). +4. Blocked-claim validator duty in the same task (see below). + +## What landed (features, and how each works) + +- Fleet minder: + - One Muse minder job: `fleet-minder`, every 15m. + - Checks all sessions and tasks; actively kicks, not just watches. +- Dropped-thread catcher: + - Hourly Muse task: `dropped-thread-catcher`. + - Reviews ALL chats from the past 2 hours, plus older open issues. + - Catches problems mentioned then dropped. + - Action: create an issue, or create an issue AND solve it. + - Authority: full authority to approve and handle whatever it believes + it can. + - Includes the blocked-claim validator duty: every "blocked, nothing + can be done" claim is assumed WRONG until validated. +- Builder's Advocate: + - Muse job: `builders-advocate`, every 4h. + - This is the Muse side of ruling (2) — the issue-making / priority / + design function, rewritten from scratch. + - The register records the cron bodies themselves as the design artifact + for all three roles. +- Creation and cleanup: + - Cron bodies created 2026-11-08 18:29–18:31 CST + (fleet-minder 15m, dropped-thread-catcher hourly, builders-advocate 4h). + - Absorption deletions of 11 absorbed Muse crons completed + 2026-11-08 22:30–22:42 CST, after the first clean advocate run. + +## Rough architecture + +- Three Muse cron jobs, no overlapping minders: + - `fleet-minder` — 15m — watch + kick across all sessions/tasks. + - `dropped-thread-catcher` — hourly — dropped threads + blocked-claim + validation, with issue-create and solve authority. + - `builders-advocate` — 4h — issue-making / priority / design (Muse side). +- A separate OpenChamber version of the advocate function was ruled to be + built completely separately (ruling 2) — see open follow-ups. +- Role map: developing-today/code#2131 and #2152, both CLOSED, titled + "Fleet roles: Make / Do / Tend". + +## Status + +- Design status in register: built-into-running-system. +- Implementation status in register: shipped (Muse side) — 2026-11-08. +- Tracking: no single issue; role map code#2131 CLOSED and #2152 CLOSED. + +## Next steps — immediate / near-term / long-term + +- Immediate: complete the OpenChamber-side recreations (below). +- Near-term: not recorded. +- Long-term: not recorded. + +## Open follow-ups + +- OpenChamber-side recreations were still RUNNING at the 18:30 flush + (2026-11-08): + - Handled by Lane A. + - The OpenChamber builder's advocate text was delivered to Lane A, + pending its handoff. + - No completion for the OpenChamber side is recorded in this entry. + +## Future ideas not yet specced + +- Not recorded in the register entry. + +## Links + +- Register entry: F4.7 in `~/workspace/design-audit-60d/REGISTER.md` +- Role map: developing-today/code#2131 (CLOSED), developing-today/code#2152 (CLOSED) +- Related register entries: F4 (fleet orchestration & dispatch, parent), + P1.5 (a flow-back failure later addressed structurally by the + dropped-thread catcher, per that entry), P2.2 (decisions-page flow-back + runs through the dropped-thread catcher) +- Tracking epic: developing-today/code#8805 +- Design artifact: the cron bodies themselves (fleet-minder, + dropped-thread-catcher, builders-advocate) diff --git a/doc/living/fleet-sweep-review-job-family.md b/doc/living/fleet-sweep-review-job-family.md new file mode 100644 index 0000000000..bab67c6703 --- /dev/null +++ b/doc/living/fleet-sweep-review-job-family.md @@ -0,0 +1,95 @@ +# Fleet sweep / review job family + +Living document · Status: shipped (2026-10-17) · Register entry F4.1 · Tracking epic: developing-today/code#8805 + +## Purpose + +- Keep the four fleet repos healthy by continuously sweeping issues and + reviewing PR diffs on a schedule, instead of waiting for manual triage. +- Repos in scope (as named in the original ask): developing-today/code, + developing-today/opencode, dt openchamber, dezren39/nix. +- Owning goal: keep-the-four-repos-healthy (goal_a243772844c3). + +Original ask (2026-10-17): +- "make a scheduled task to check and fix one issue in developing today + code or developing today opencode or dt openchamber or dezren39/nix + each execution... make 4 tasks that handle this and each runs every + 2 hours, divided evenly 30 minutes apart... Think thoroughly and act + autonomously... always do something." + +## What landed (features, and how each works) + +- Issue-sweep rotation (2026-10-17): + - Four scheduled tasks, one per repo, each every 2 hours, staggered + 30 minutes apart. + - Each execution checks and fixes one issue in its repo. +- Standing merge authority (2026-10-17, same day): + - Rule: "go ahead and merge if a pr seems good you can always fix it + later if it's not." + - This replaced "Drew reviews / never merge own PRs" for the sweeps. + - Applied via cron.update + GOAL.md + MEMORY.md. + - Exercised the same morning: opencode PR #22, openchamber PR #37, + and dezren39/nix PR #379 merged under it. +- PR diff review job (2026-10-18): + - Drew: "also regularly review pr commits and diffs open or closed and + make issues from useful findings there." +- Restructure (2026-10-19, recorded directive ~21:38 CDT): + - Three per-repo sweeps removed. + - ONE `issue-sweep-rotating` job every 40m, picking a repo at random. + - Cadence changes: new-issue-creator 15m → 20m, pr-diff-review + 30m → 20m, boot-init-todo-check 20m → 30m. +- Reporting split + escalation (2026-10-19): + - Side-chat reporting split approved. + - Escalation rule approved: "escalate secrets, broken main, and + blocked-on-me items to the main chat". + - An ESCALATION paragraph was appended to all six job bodies. +- Audits: + - 2026-10-19 (same evening): job cadence / duration + billing audit. + - 2026-10-20 06:03 CDT: fleet usefulness audit — issue ledger + Oct 17–19: opened 129, closed 161, net −32. + +## Rough architecture + +- Implementation is cron jobs under goal keep-the-four-repos-healthy. +- Design artifact in the register: the goal's GOAL.md, plus per-repo + backlogs in the goal's `hidden_files/`, plus the ESCALATION paragraph + in the six job bodies under the goal's `crons/`. +- No single GitHub issue tracks the family as a whole. + +## Status + +- Design status in register: built-into-running-system. +- Implementation status in register: shipped (and repeatedly restructured + in place). +- Tracking: NEVER-ISSUED as a family — searched "issue sweep rotation"; + only Nov-era conversion tasks code#2156 / #2138 exist, not the original asks. +- Triage: (b) DONE-WITHOUT-ISSUE — implemented directly as cron jobs + under goal keep-the-four-repos-healthy. + +## Next steps — immediate / near-term / long-term + +- Immediate: fix the stale wording noted below. +- Near-term: not recorded. +- Long-term: not recorded. + +## Open follow-ups + +- GOAL.md did not yet reflect the 2026-10-19 restructure at record time. +- Stale wording pending rewrite in the code-sweep, new-issue-creator, and + pr-diff-review bodies: "mcpx lives in BOTH code and nix". + - That wording was overtaken by F2.2 (mcpx dedup) and F2.4 (mcpx + consolidation). + +## Future ideas not yet specced + +- Not recorded in the register entry. + +## Links + +- Register entry: F4.1 in `~/workspace/design-audit-60d/REGISTER.md` +- Related register entries: F2.2, F2.4 (mcpx canonical source), + F4 (fleet orchestration & dispatch, parent) +- Later conversion tasks named in the entry: developing-today/code#2156, + developing-today/code#2138 +- Tracking epic: developing-today/code#8805 +- Owning goal: keep-the-four-repos-healthy (goal_a243772844c3) diff --git a/doc/living/globalping-outside-in-watch.md b/doc/living/globalping-outside-in-watch.md new file mode 100644 index 0000000000..e27de1a3dd --- /dev/null +++ b/doc/living/globalping-outside-in-watch.md @@ -0,0 +1,70 @@ +# Globalping outside-in availability watch + +Living document · Status: shipped (2026-10-23) · Register entry X10 · Tracking epic: developing-today/code#8805 + +## Purpose + +- Watch the fleet's public pages from the outside in. +- Detect a public page being down without relying on inside-only + checks. +- Stay silent unless something is down. +- First asked: 2026-10-23 ~18:32 CDT, when Drew ordered the + Globalping account and a routine-ping watch. + +## What landed (features, and how each works) + +- A Globalping account was created. +- Sign-in route recorded: GitHub SSO. +- An API token was filed (location/value not recorded here). +- A routine watch runs hourly probes: + - HTTP probes of the fleet's public pages + - ping probes of the fleet's public pages +- Probe network: Globalping. +- Alerting behaviour: silent unless something is down. +- Implemented directly as the `globalping-watch` cron. +- The register notes this is effectively cloud idea #19 + (outside-in watchdog) with Globalping as the probe network; + see Appendix A, 2026-10-23. + +## Rough architecture + +- Account: Globalping, via GitHub SSO, with a filed API token. +- Scheduler: the `globalping-watch` cron. +- Cadence: hourly. +- Targets: the fleet's public pages (specific target list not + recorded in the register entry). +- Output: no output when probes pass; a signal only on a down + result, per the "silent unless down" rule. +- Tracking in the register: NEVER-ISSUED — no issue cited in + the record; implemented directly as the cron. + +## Status + +- design_status in the register: built-into-running-system. +- implementation_status in the register: shipped. +- Account done and hourly watch live 2026-10-23 ~18:41 CDT. +- Still running at window end (2026-11-11). +- Triage in the register: (b) DONE-WITHOUT-ISSUE. + +## Next steps — immediate / near-term / long-term + +- Immediate: not recorded. +- Near-term: not recorded. +- Long-term: not recorded. + +## Open follow-ups + +- None recorded in the register 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: X10, in the design register (REGISTER.md). +- Register Appendix A, 2026-10-23: cloud idea #19 (outside-in + watchdog), which this watch implements with Globalping. +- Cron: `globalping-watch`. +- Tracking epic: developing-today/code#8805. +- Tracking in the register: NEVER-ISSUED (no GitHub issue). diff --git a/doc/living/lane-naming-law.md b/doc/living/lane-naming-law.md new file mode 100644 index 0000000000..94704f2035 --- /dev/null +++ b/doc/living/lane-naming-law.md @@ -0,0 +1,70 @@ +# Lane naming law + +Living document · Status: shipped (2026-11-10) · Register entry F4.9 · Tracking epic: developing-today/code#8805 + +## Purpose + +- Give every fleet lane a short name that is coherent on its own. +- Separate what a lane does (its scope) from where it surfaced. +- End ad-hoc lane names that carried platform or tool labels. +- First asked: 2026-11-10 21:29–21:35 CST, in Drew's rulings that evening. + +## What landed (features, and how each works) + +- The law: a lane name is ONE scope word plus ONE shard letter. +- Scope words recorded in the register: `code`, `not-code`, `any`. +- The amendment at 21:35 CST set `not-code` instead of `other`. +- The shard letter is fresh and unique within its scope group. +- Multiple letters are allowed for separating lanes, provided the name + still makes sense besides the shard. +- Platform is metadata, never in the name: + - surface origin is passed separately as platform metadata. +- Lanes are never labelled "claude": + - Drew's ruling: "what does claude have to do with anything". +- The scheme was accepted at 21:33 CST: "well that's at least sort of + coherent", then amended as above. +- The law applies to both surfaces. +- It applies including OpenChamber's 12 identically-named tasks. +- Execution was via the lane registry; there was no dedicated issue. +- The rename was recorded complete: "Lane rename + trims: COMPLETE" + per the 2026-11-11 record. + +## Rough architecture + +- The broker lane registry is the design artifact and the store. +- Registry state at final state: 36 rows, 17 enabled. +- Each row carries the lane name built from scope word + shard letter. +- Surface origin travels separately as platform metadata. +- Naming is enforced at registry level, not in lane names themselves. +- Not recorded: any separate naming service or validator beyond the + registry. + +## Status + +- design_status in the register: built-into-running-system. +- implementation_status in the register: shipped. +- Final on 2026-11-10; rename and trims complete by 2026-11-11. + +## Next steps — immediate / near-term / long-term + +- Immediate: resolve the registry anomaly in Open follow-ups below. +- Near-term: not recorded. +- Long-term: not recorded. + +## Open follow-ups + +- Anomaly at record time: broker rows `openchamber-a` / + `openchamber-b` reappeared with enabled=1 after deletion. +- That reappearance was being investigated at record time. +- 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: F4.9, in the design register (REGISTER.md). +- Recorded on: developing-today/code#8097. +- Tracking epic: developing-today/code#8805. +- Executed via: the broker lane registry (no dedicated issue). diff --git a/doc/living/late-night-shift-silence-rule.md b/doc/living/late-night-shift-silence-rule.md new file mode 100644 index 0000000000..12881e57db --- /dev/null +++ b/doc/living/late-night-shift-silence-rule.md @@ -0,0 +1,68 @@ +# Late-night shift silence rule + +Living document · Status: shipped (2026-10-25) · Register entry X13 · Tracking epic: developing-today/code#8805 + +## Purpose + +- Stop overnight work stalling when Drew does not reply. +- Drew's words on 2026-10-25 17:39 CDT: "you should just build + something as long as it's reversible". +- Silence on the nightly priorities list no longer means no work. + +## What landed (features, and how each works) + +- A standing rule for the late-night shift: + - No reply to the nightly priorities list does not block work. + - Muse starts the top-ranked fully-reversible candidates. + - Those candidates proceed within the $0 cap. + - Irreversible items wait for morning. + - Spending items wait for morning. + - Drew-reserved items wait for morning. +- The rule is encoded in the late-night-shift-priorities job + body, step 6. +- It is not tracked as a GitHub issue — by design, per the + register. + +## Rough architecture + +- Home: the `late-night-shift-priorities` cron job definition, + step 6 of its body. +- Also recorded in: + `~/memory/topics/memory-full-text-2026-10-29.md` +- Decision inputs at run time, per the rule itself: + - the ranked nightly priorities list + - whether a candidate is fully reversible + - whether a candidate stays within the $0 cap + - whether a candidate is Drew-reserved +- Tracking in the register: NEVER-ISSUED. + +## Status + +- design_status in the register: built-into-running-system. +- implementation_status in the register: shipped. +- Adopted 2026-10-25 and operating. +- Invoked by later overnight runs, for example the 2026-11-05 + run in the wider record. +- Triage in the register: (b) DONE-WITHOUT-ISSUE. + +## Next steps — immediate / near-term / long-term + +- Immediate: not recorded. +- Near-term: not recorded. +- Long-term: not recorded. + +## Open follow-ups + +- None recorded in the register 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: X13, in the design register (REGISTER.md). +- Job: late-night-shift-priorities (rule at step 6 of its body). +- Also recorded in: `~/memory/topics/memory-full-text-2026-10-29.md` +- Tracking epic: developing-today/code#8805. +- Tracking in the register: NEVER-ISSUED (no GitHub issue). diff --git a/doc/living/mcpx-dedup-canonical-source.md b/doc/living/mcpx-dedup-canonical-source.md new file mode 100644 index 0000000000..9a52785154 --- /dev/null +++ b/doc/living/mcpx-dedup-canonical-source.md @@ -0,0 +1,79 @@ +# mcpx dedup — one canonical mcpx source in developing-today/code + +Living document · Status: shipped (2026-10-19) · Register entry F2.2 · Tracking epic: developing-today/code#8805 + +## Purpose + +- Remove the duplicate mcpx copy from `dezren39/nix`. +- Make `developing-today/code` the one canonical mcpx source. +- Do not lose anything the nix copy implemented that code lacked. + +Origin (2026-10-19): +- Drew asked whether there were "two full source apps in 2 places?" — + confirmed yes. +- Recorded directive: "remove the duplicate mcpx copy from dezren39/nix; + first determine everything the nix copy implements that + developing-today/code lacks and migrate each thing; file a GitHub issue + BEFORE each thing; merge PRs whenever ready." + +## What landed (features, and how each works) + +- Audit / migration run: + - A coordinator ran the audit and migration the same day (2026-10-19). + - Per-item tracking was by design: a GitHub issue was filed BEFORE each + migrated item, rather than one tracking issue for the whole dedup. +- Vendored copy removed: + - Same-day follow-up record: "mcpx dedup — vendored copy in dezren39/nix + removed (Drew's directive, ~11:51 CDT)". +- Nix packaging rewired: + - Nix now consumes mcpx via a pinned flake input on the code repo, + instead of the vendored copy in nix. + +## Rough architecture + +- Canonical source: `developing-today/code` (mcpx lives there). +- Consumer: `dezren39/nix` packaging, via a pinned flake input pointing + at the code repo. +- No second full mcpx source tree in nix. + +Related consolidation (register F2.4, 2026-11-03, separate entry): +- CheckPhase adaptations were later moved into code's `pkgs/mcpx/package.nix`. +- Daemon modules originate with mcpx in code, are re-exported by opencode, + passed through by openchamber, and consumed by nix via the single + openchamber input. That layering is F2.4, not part of this entry's scope. + +## Status + +- Design status in register: built-into-running-system. +- Implementation status in register: shipped (2026-10-19). +- Tracking: NEVER-ISSUED as one tracking issue — searched "mcpx dedup + single source". By the directive's own design, per-item issues were the + tracking mechanism. +- Triage: (b) DONE-WITHOUT-ISSUE. + +## Next steps — immediate / near-term / long-term + +- Immediate: none recorded. +- Near-term: none recorded beyond the open follow-up below. +- Long-term: not recorded. + +## Open follow-ups + +- Drew had not yet said whether he also wants a submodule at the old mcpx + path for local editing, on top of the flake-input rewiring. + - That question is recorded as open in the register entry. + - No decision is recorded. + +## Future ideas not yet specced + +- Not recorded in the register entry, apart from the submodule question + above, which is an open follow-up rather than a specced idea. + +## Links + +- Register entry: F2.2 in `~/workspace/design-audit-60d/REGISTER.md` +- Related register entries: F2 (mcpx platform program, parent), + F2.1 (mcpx + opencode platform program), F2.4 (mcpx consolidation — + modules originate with mcpx in code) +- Tracking epic: developing-today/code#8805 +- Design artifact: none named in the entry; tracking was per-item issues diff --git a/doc/living/one-queue-model.md b/doc/living/one-queue-model.md new file mode 100644 index 0000000000..4ed8b2d98d --- /dev/null +++ b/doc/living/one-queue-model.md @@ -0,0 +1,75 @@ +# One-queue model — gap analysis and designation (2026-11-10) + +> Living document — committed 2026-11-11 from ~/workspace/goals/keep-the-four-repos-healthy/hidden_files/one-queue-gap-analysis-and-designation-2026-11-10.md as the tracking home for a completed design (60-day design register entry F4.8; register committed as pm-stack/design-register-2026-11-11.md in developing-today/code, tracking epic developing-today/code#8805). Status: shipped. Update this doc as the design shifts; the register is the frozen audit snapshot. + +--- + +# One-queue lane model — gap analysis, designation, deploy record + +Drew's spec: 2026-11-10 20:01–20:06 CST (three statements, quoted verbatim on code issue #8097). +Implementation: PR #8438 (merged 2026-11-11T02:28:30Z, merge commit 2efbeb292fb3658af10bc5db3df2f7e74567d017). +Registry before-image: `lanes-table-before-one-queue-2026-11-10.md` (same folder; 44 rows, 35 enabled). + +## Gap analysis (wire-verified against broker source on main + live registry + claim path) + +- **G1 — Claim was stream-scoped end to end (the central gap).** `tasks.queue` is a stored per-task stream label (22 distinct values live). The pick SELECT filtered `WHERE queue = ?`; the claim UPDATE re-checked the same predicate. `claim_preamble` REJECTED a lane whose registered `queue` ≠ the claim's queue ("lane X is for queue A, not B") — registry-side scoping of what a lane may see: exactly the binding the spec forbids by default. Priority ordering was global in form (`ORDER BY (priority IS NULL), priority ASC, created_at ASC`) but only ever applied WITHIN one stream. +- **G2 — `--queue` was effectively mandatory in the CLI.** `client.rs` `cmd_claim` always sent a queue: `--queue` flag, else env `REPO_QUEUE_DEFAULT_QUEUE`, else the built-in `DEFAULT_QUEUE = "repo-health-code-shadow"` (and `DEFAULT_WORKER = "repo-worker-code"`). Broker `verb_claim` read `queue` with no default. The ONLY claim filter was the exact stream match. No boolean expressions, no repo/priority-crossing claim existed. +- **G3 — The one-task-one-stream binding was created at enqueue** (`verb_enqueue` writes the packet's `queue`; client resolves queue = flag > packet > default). Per the spec the stored stream stays as descriptive metadata (it is the task's stream label / pool name in event marks), but it stopped being the routing mechanism: repo identity for filtering is the payload's `repo` (repo-task/v1 packets carry `"repo": "owner/name"`, a required field of `~/tools/repo-task-v1.schema.json`), falling back to the stream-derived repo (`repo-health-code-pilot` → `code`). +- **G4 — Claimer identity filtering (refinement 2 audit).** Places identity shaped what was offered beyond a task's own requirement: (a) the preamble lane↔queue registry check (identity scoping via registry); (b) the ledger platform limitation (legitimate — it is a TASK-side requirement, kept). The pick itself did NOT filter by platform/lane/worker (`family` stamped, never matched, #8187 by design). `lane_decision` (#8187) already implements "direct by default; routing only with a recorded reason" at assignment time — aligned, untouched. +- **G5 — Requirement machinery that already fit (kept, generalized).** `repo_task_lane_ledger.platform_limit` + `platform_limit_reason`: a task-scoped claimer-kind requirement enforced in the pick clause, claim-by-id, and transfer (#8217 semantics; a reason-less limit is invalid and cleared, never enforced). It was the ONLY per-task requirement dimension (platform family only). The PR generalizes the same shape to payload `requires` (`platform` / `lane` / `pool` / `model`), enforced in pick + by-id + transfer. +- **G6 — `lanes.queue` is `NOT NULL`.** Unbinding a registration needs a sentinel: the PR defines `"*"` (also `"all"`, `""`) as the recorded unbound state (`lane_queue_binds`); the preamble enforces a registration's binding only for stream-scoped claims against a bound registration. +- **G7 — FOUND DEFECT (pre-existing, not fixed by #8438): dead platform-limit enforcement in `claim_by_id`.** On current main the #8217 platform-limit block inside `claim_by_id` sits after a `return Ok(None)` inside the claim-guard block and is unreachable (rustc emits an `unreachable expression` warning at that block). The pick and transfer paths enforce the limitation live; the by-id path does not, despite the source-shape test `claim_by_id_enforces_platform_limit_like_the_pick_8217` asserting the code is present. The PR's new `task_requirements_unmet` check in `claim_by_id` was placed in reachable code (after `by_id_claimable`). The dead block itself was left untouched by #8438 to keep the change surgical; it needs its own fix (move the ledger block out of the guard block) and its own issue. + +## What PR #8438 changed + +- Broker: `queue` optional on claim (absent/empty/`*`/`all` = the whole queue, global priority order); new `filter` request field — composable boolean expressions (AND/OR/NOT/IN, parentheses) over repo, queue, pool, platform, label, kind, priority, lane, model — compiled into BOTH the pick SELECT and the claim UPDATE re-check; payload `requires` enforced on pick + by-id + transfer; new `pool` claim field (claimer pool identity, for `requires.pool` + stamps); preamble binding only for scoped claims against bound registrations; all-streams payload-guard sweep for unscoped claims. Claim stamps, pick predicate branches, batch ≤5, by-id/transfer special cases, #8097 rules: preserved (full existing suite green). +- Client: `--filter` and `--pool` flags; claim sends no queue when neither `--queue` nor the env names one (other commands keep the built-in default; scoped callers unchanged — additive). +- AGENTS.md (code repo): new "The one queue: claiming work" section. +- Tests: `cargo test -p fleet-queue --locked --all-features` = 187 passed, 0 failed (5 new one-queue tests). Plus a live-SQLite semantics check of the compiled scope SQL (8 scenarios: cross-stream priority, repo filters both identity forms, label membership, requires gating, ledger interplay, scoped compatibility) — all passed. + +## Designated filtered sets (chosen from ENABLED registrations; disabled rows untouched) + +### Muse surface (named lanes; designation = the filter expression in the lane's shift-job instructions) +- Code-only (5) — claim `--filter 'repo = code'`: **code-b, code-d, code-e, code-f, code-g** +- Not-code (3) — claim `--filter 'repo != code'`: **nix-a, opencode-a, code-h** +- Unfiltered (13 enabled): code-j, code-k, code-l, code-m, code-n, code-o, code-p, code-t, code-u, code-v, code-w, code-x, code-y +- Disabled, unchanged: code-a, code-c, code-i, code-q, code-r, code-s, code-z, nix-b, opencode-b + +### OpenChamber surface (UUID registrations; designation = the filter expression in the OC scheduled-task definitions) +- Code-only (5) — `repo = code`: 02cafe76-eafd-4d0b-aaa6-2b7a737d68dc, 1a180ae5-384f-4e71-8d77-08f7b1652c75, 262eb403-3347-4a7c-ba6b-e7bc263ca853, 335a5d1f-bfc1-4831-99ea-850c8939a727, 7b47536b-c162-444c-be8a-3a9538cc4cb5 +- Not-code (3) — `repo != code`: 46984602-51a3-438c-b3a5-f2857811adb1 (repo-worker-openchamber), 3fe37e8a-c61b-419c-9e97-769ecd264d5d (repo-worker-opencode), 8ac61616-3815-4e7b-b33d-840a3829154a (repo-worker-code UUID) +- Unfiltered (6 enabled): 9aca43b4-5439-4939-9f71-323f5d32521b, aea12c82-c5af-4e5a-9b66-f8e360f87177, bf419306-c4ef-470f-a553-beabf93239de, c29174f1-48e0-4b13-b4ff-9b73ab67e9ab, c8b9355e-319a-4640-8096-7ad19480d151, ec118cad-0fd3-4652-91c4-27432f2f2efd + +## Registry reconciliation — state and the deploy-gated remainder + +Registry values are UNCHANGED tonight (44 rows, 35 enabled, identical to the before-image). Reason: the live broker is still the pre-#8438 build, whose preamble rejects any claim whose queue ≠ the lane's registered queue. Rewriting registrations to the unbound `*` state before the broker deploy would break every live scoped claim those lanes make. Under the merged broker the registration is never consulted for unscoped claims, so no registry edit is needed for the model to work; the `*` rewrite is the recorded end-state formality, prepared here and executed in the deploy step: + +```sql +-- DEPLOY STEP (run only after the #8438 broker build is live): +UPDATE lanes SET queue = '*'; +-- Reversal: restore each row's queue from lanes-table-before-one-queue-2026-11-10.md. +``` + +## Pending (deploy step, separate) + +1. Rebuild the queue-broker + repo-queue binaries from main (with #8438) and restart the queue broker (the switch-spec rules apply: changed code → explicit takeover). +2. Run the registry SQL above; read back the lanes table (44 rows, queue = `*`). +3. Flip the Muse shift jobs' claim lines from the interim scoped form to the one-queue form (designated lanes add their `--filter`; all others drop `--queue`), and rebuild/redistribute the client binary the shifts call. +4. Apply the OpenChamber designations in OC's scheduled-task definitions (filed as a queue task + recorded on #8097, since OC's task store is not editable from the Muse side). +5. Fix G7 (dead by-id platform-limit block) under its own issue. + +## Completion addendum (2026-11-10 ~21:0x CST) + +- Muse shift jobs: all 21 enabled claiming jobs updated with the ONE-QUEUE MODEL paragraph and read back (b, d, e, f, g code-only; h, nix, opencode not-code; j, k, l, m, n, o, p, t, u, v, w, x, y unfiltered). +- Shared runbooks: one-queue section added at the top of both `repo-queue-worker-instruction.md` and `lane-shift-instruction.md` (this folder). +- G7 filed as its own issue: https://github.com/developing-today/code/issues/8456 (the dead by-id platform-limit block). +- OpenChamber designation filed: queue task **14835** (openchamber stream, priority 30, queued 2026-11-11T02:45:49Z, packet for openchamber#2081) + issue https://github.com/developing-today-forks/openchamber/issues/2081. +- Record posted on #8097: comment 6785478676 (+ pointer comment 6785478985). Note: #8097 itself is CLOSED (its four rules were implemented 2026-11-09); the record comment stands as the one-queue addendum. +- Registry after: unchanged (44 rows, 35 enabled) — deploy-gated, per the section above. + +## Completion addendum 2 (2026-11-10 ~21:36–21:47 CST) — OpenChamber designations applied directly + +- Deploy step 4 is DONE, by direct application (Drew's 21:25 CST correction: Muse edits OC's task files on the laptop itself; the task-14835/#2081 filing is the record, not the mechanism — #2081 c.6786350684, #8097 c.6786356190). +- Edited: the 14 designated lane tasks in ~/.config/openchamber/projects/path_L2hvbWUvdXNlcg.json (2 of 3) + path_L2hvbWUvdXNlci9naXQvY29kZQ.json (12 of 24). Each gained adapter item 9 (ONE-QUEUE DESIGNATION) + an unscoped §1 claim command (`--filter 'repo = code'` / `'repo != code'` / none); gate + lane-identity wording aligned. Backups: *.bak-onequeue-20261111T033637Z. Deep-diff verified: only those 14 prompts changed. +- Landed POST-deploy (broker restarted 21:25:16 CST on the #8438 build; registry all `*`), so no interim inconsistency. Pickup proven at the 21:40 CST fire, no OC restart. +- Task 14835 left parked as the record. Open item for Drew: OC's "Queue lane (scheduled) - nix" task (8d133595) still exists/enabled/firing against the deleted broker registration — left untouched, disposition his call. diff --git a/doc/living/opencode-2-fleet-migration.md b/doc/living/opencode-2-fleet-migration.md new file mode 100644 index 0000000000..73a91ba65e --- /dev/null +++ b/doc/living/opencode-2-fleet-migration.md @@ -0,0 +1,80 @@ +# OpenCode 2 fleet migration + +Living document · Status: shipped (2026-10-24) · Register entry F3.1 · Tracking epic: developing-today/code#8805 + +## Purpose + +- Move the fleet exclusively to OpenCode 2. +- Directive (2026-10-24): "my fleet should be exclusively using opencode2. + please immediately fix anywhere that isn't" +- Scope in the directive: every fleet surface — sandbox server, laptop + standalone, repo configs, plugins — from OpenCode v1 to v2. + +## What landed (features, and how each works) + +- Migration core shipped: + - The fleet demonstrably runs OpenCode 2.x everywhere in the November + records (register triage wording). + - That is the basis for the (b) DONE-WITHOUT-ISSUE classification of + the migration core. +- Launch (same night, 2026-10-24): + - Three coordinators launched: + - sandbox server → 2.1.4 + - laptop standalone → 2.1.4, with OpenChamber's embedded v1 as a + named exception + - repo workstreams +- Recon facts recorded (2026-10-24 day-file): + - Three breaking changes identified: plugin API, /api/* contracts, + and `tui.json` → `cli.json`. + +## Rough architecture + +- Not recorded as a design artifact in the register entry. +- Surfaces in scope, per the directive and launch record: + - sandbox OpenCode server + - laptop standalone OpenCode + - repo configs + - plugins (see open follow-ups — ports were left unstarted) +- Named exception at launch: OpenChamber's embedded v1. + +## Status + +- Design status in register: decided (directive). +- Implementation status in register: partial — core shipped, with one + still-live follow-up (below). +- Tracking: NEVER-ISSUED — searched "opencode 2 migration fleet" and + "v2 migration" in the opencode fork. The record says an origin tracking + issue was part of coordinator 3's launch, but no such issue is findable. +- Triage: (b) DONE-WITHOUT-ISSUE for the migration core, with one + (a) STILL-LIVE follow-up. + +## Next steps — immediate / near-term / long-term + +- Immediate: complete the still-live follow-up below (plugin ports + + fork rebase) — tracked separately, see Links. +- Near-term: not recorded beyond that follow-up. +- Long-term: not recorded. + +## Open follow-ups + +- STILL-LIVE follow-up: + - v1 plugin ports: mcpx bridge, mcpx-session, subtask2. + - The fork rebase. + - The register states these were "explicitly left unstarted in the + record" and that no later slice records them done. + - Tracked separately in: developing-today-forks/opencode#2290 + (named in the tasking for this document; the register entry itself + places this follow-up in its filing manifest, §7). + +## Future ideas not yet specced + +- Not recorded in the register entry. + +## Links + +- Register entry: F3.1 in `~/workspace/design-audit-60d/REGISTER.md` +- Still-live follow-up: developing-today-forks/opencode#2290 +- Related register entries: F3 (OpenCode platform, parent), + F3.2 (one shared OpenCode serve), F2 (mcpx platform program) +- Tracking epic: developing-today/code#8805 +- Design artifact: none found; recon facts in the 2026-10-24 day-file diff --git a/doc/living/quota-full-utilization-burn-plan.md b/doc/living/quota-full-utilization-burn-plan.md new file mode 100644 index 0000000000..d3b4aff765 --- /dev/null +++ b/doc/living/quota-full-utilization-burn-plan.md @@ -0,0 +1,322 @@ +# Quota full-utilization program + burn plan + +> Living document — committed 2026-11-11 from ~/workspace/research_notes/quota-burn-plan-20261029/plan.md as the tracking home for a completed design (60-day design register entry F4.5; register committed as pm-stack/design-register-2026-11-11.md in developing-today/code, tracking epic developing-today/code#8805). Status: shipped. Update this doc as the design shifts; the register is the frozen audit snapshot. + +--- + +# Full-quota utilization plan — first edition (code#2173) + +Built: 2026-10-29 ~07:35Z (02:35 CDT). Read-only analysis — no jobs, weights, or queues changed. +Sources, each figure timestamped where used: laptop PM quota-gatherer series +(`~/.local/state/pm-aggregator/snapshots/usage-2026-10.jsonl`, 599 rows, 2026-10-25T12:00Z → +2026-10-29T07:15Z) and `quota-current.json` (generated 2026-10-29T07:30:13Z, source +openchamber-quota); Supabase `agent.quota_records` (assistant subscription, 1-min cadence); +Supabase `agent.mirror_token_usage_daily` (fleet token totals); provider-quota-registry.md +(pool map, reset calendar, route-pool structure); dated console reads recorded in the +registry / stewardship log where the feeds have no series (named as such). + +Fleet context (mirror_token_usage_daily, dimension=agent, input tokens/day): Oct 20 0.40B → +Oct 24 1.42B → Oct 26 1.90B → Oct 27 2.84B → Oct 28 5.07B → Oct 29 partial (to ~07:30Z) 2.12B. +Demand is not the constraint — the fleet burns more every day. The constraint is *which pool* +each token lands on, and several pools will end their periods far from 100% in opposite +directions at once. + +Conventions: "pts" = percentage points of the pool's largest window. Rates are measured +Δpts/day over the stated window. Projections assume the measured rate holds; where the rate +is unstable I give the scenario range instead of a fake single number. + +--- + +## 1. Per-pool state, rates, projections (largest window each) + +### OpenCode Go — Lab workspace (the active one) — MONTHLY per-model caps +- **Now: 87.17%** (gatherer series, 2026-10-29T05:30Z; the quota module's combined Go row read + lower, 77.28% at 01:30Z — the two computations disagree; the continuous series is used as + primary). Weekly sub-window 49.37% (resets Nov 2 00:00Z), 5h sub-window ~49%. +- **Reset: 2026-11-07T05:55:15Z** (Nov 6 23:55 CT). Plan is CANCELLED — this is the last period. +- **Burn rate:** +12.5 pts/day (72h), +18.6 pts/day (24h). +- **Projection:** 12.8 pts left ÷ ≥12.5/day → **monthly caps exhaust ~Oct 30–31, about 7 days + before reset.** Projected % at reset: 100% (long before). This is the fleet's main + DeepSeek-Flash engine right now, and it is nearly spent. +- Note: Go's windows are nested limits on the same per-model caps (5h = 20% of cap, weekly = + 50%, monthly = cap). The Nov 2 weekly reset does **not** reopen a monthly-exhausted model. + +### OpenCode Go — Personal workspace — MONTHLY +- **Now: ~84%** (console read, 2026-10-28 19:33 CDT — single read, no series; registry series + last showed 80% @ Oct 27 12:00Z). Plan CANCELLED, **plan ends 2026-11-02 21:02 CT** + (Nov 3 03:02Z) — after that the quota does not reset, it *disappears*. +- **Burn rate: ~0/day** — Personal is not the active workspace on the laptop (Lab is), so it + is not being burned at all. +- **Projection: ~16 pts (≈$9.60 of $60 list) stranded forever** unless the active workspace is + rotated to Personal and the remainder burned before Nov 2 21:02 CT. **#1 under-use flag.** + +### OpenAI plan (openai.main) — WEEKLY +- **Now: 27%** (gatherer, 2026-10-29T07:15Z). **Reset: 2026-11-04T06:35:38Z** (Nov 4 00:35 CT). + 73 pts left, 5.96 days → needs **12.2 pts/day** to land at 100%. +- **Burn rate:** +5.9 pts/day (72h average) but +6 pts in the last 5.75h alone (21% @ 01:30Z → + 27% @ 07:15Z) — burn is bursty (sessions on this pool, Aster TASK work, and the OpenAI connector routes all draw + this pool). +- **Projection (scenarios):** at the 72h average → lands **~62%** at reset (UNDER by ~38 pts); + at the recent active-hours rate (~25/day) → **exhausts ~Nov 1** (OVER). Verdict: **base case + UNDER**, with a live over-pace scenario — exactly what the 4–6h check exists to resolve. + Next reset after Nov 4: Nov 11 06:35Z. + +### Meta — Muse API High Usage (via `meta` provider only) — WEEKLY +- **Now: 23.2%** (file-export series, 2026-10-29T04:00Z; the 07:30Z gatherer tick errored on + this provider — "file-export status: unparseable" — so the freshest read is ~3.5h old). + **Reset: 2026-11-02T00:00:00Z** (Sun Nov 1 18:00 CT). 76.8 pts left, 3.70 days → needs + **20.8 pts/day**. +- **Burn rate:** +6.6 pts/day measured post-reset (console 8.83% @ Oct 27 00:03 CDT → + 23.2% @ Oct 29 04:00Z). (The raw 72h series slope is meaningless — the Oct 26 window + boundary sits inside it.) +- **Projection: lands ~48% at reset — ~52 pts stranded.** **Under-use flag.** Meta seats + (spark-contributor workhorse/specialist, wonder-contributor summit) are the natural absorber + for the Nov 2–5 DeepSeek trough (see cascade). Next reset: Nov 9 00:00Z. + +### ClinePass — MONTHLY (largest window) +- **Now: 91%** (quota-current, 2026-10-29T07:30Z, corroborated by series 91% @ 00:15Z). + **Reset: 2026-11-06T01:22Z** (Nov 5 19:22 CT). Weekly sub-window 69%, resets Oct 31 09:20Z. +- **Burn rate (monthly):** +6.1 pts/day (3.6d), +11.4 (72h), +25 (24h) — accelerating; the pool + is in deliberate finishing-only mode. +- **Projection: monthly exhausts ~Oct 29–30, ~6–7 days before reset. OVER-pace** — deliberate, + but its cascade consequence is real (§2). Weekly window: at +11.9 to +22.7/day it reaches + ~100% right around its Oct 31 reset — on-track for the weekly, moot against the monthly cap. + +### Command Code — Go $1 plan — MONTHLY +- **Now: 69%** (console read, 2026-10-27 10:05 CDT — **stale, 2 days**; gatherer auth is + currently failing for this provider, and the console sign-in is a known pending item). + Period ends **Nov 2** (series reset 2026-11-02T23:04Z). Weekly 14% (series, resets Oct 31 + 15:16Z), recent burn ~+0.3–0.5 pts/day. +- **Projection at measured rate: lands ~71% — ~28 pts stranded.** Under-use flag, but small + ($10 credit pool) and note the plan has **no API access** — burn happens only through the + resident CLI-proxy route, so the work class is small CLI-shaped jobs. Data too stale for a + firm projection; flagged in §4. + +### OpenRouter — MONTHLY +- **100% — CLOSED until Oct 31 19:00 CDT** (known state, current). Reopens at the monthly + reset ~Nov 1. Small free-tier pool; its reopening is a minor cascade event (scout seats). + +### Open Design (opendesign) — 7-DAY (largest window) +- **Last read 2026-10-28 06:40 CDT: 7-day 97% LEFT (3% used)**, 5h 100% left. No live feed + (not in quota-current). ~301 usage records/7d. **Under-used but tiny**; data ~1 day stale. + +### Antigravity — WEEKLY buckets (per model family) +- **Last reads 2026-10-27T06:00Z: Gemini family 2% used (reset Oct 31 13:11Z), Claude/GPT + family 50% used (reset Nov 1 09:23Z). The gatherer has emitted no antigravity rows since + Oct 27.** These buckets matter — sonnet-plan and opus-plan route through antigravity-ls, so + specialist/summit capacity depends on them. **Too stale to project (§4).** + +### Claude (claude-code provider) — NOT CURRENTLY A BURNABLE POOL +- Plan is on the **free tier** since 2026-10-27 and the provider is **disabled in the fleet + config**. Gatherer reads error ("Rate limited"). The old anthropic:claude-pro series (68% @ + Oct 27 12:00Z, window reset Oct 28 14:00 CT) predates the free-tier state. Drew's "eventually + Claude again" is a future cascade position, not a current one. **Not projectable.** + +### Assistant's own subscription (Maximum) — tracked, NOT a session pool +- Weekly **24%** @ 2026-10-29T07:33Z (quota_records; 20% @ 02:30Z the same night). Reset + **Nov 3 00:59 CST**. Slope Oct 27 15:31 (8%) → Oct 29 07:33 (24%) ≈ +9.6 pts/day; 76 pts + left over 5.97 days needs 12.7/day → **projects to land ~81–85%** — modestly under, and the + heavy-night rate (+19/day) would exhaust it ~Nov 2. On-track-ish; watch only. Included + because the recorder series exists; per the pool map this is never a routing input. + +### Excluded by policy +- DeepSeek direct API and openai.alternate: PAYG/reserve and a stale-read second credential + (weekly 0% @ Oct 27, resets Nov 3 06:15Z) respectively — not plan pools to schedule against. + +--- + +## 2. The cascade — who absorbs what, in order, across two resets + +Route pools fall through cheapest-sufficient-first; a known-100% pool is CLOSED and work +rotates laterally (registry ladder). Projected sequence at current rates: + +1. **~Oct 29–30 — ClinePass monthly exhausts.** Its DeepSeek/GLM/Kimi seats stop. Load shifts + to Go Lab Flash seats (already the main engine) and Meta spark seats. Minor: ClinePass + weekly resets Oct 31 09:20Z but the monthly cap binds — no real capacity returns until the + **Nov 5 19:22 CT monthly reset**. +2. **~Oct 30–31 — Go Lab monthly exhausts.** The fleet's DeepSeek capacity drops to opendesign's + small plan only. **This is the moment for Audible 1** (rotate to Personal, below): Personal's + ~16 pts become the only Go capacity and must burn before Nov 2 21:02 CT. +3. **Nov 1 ~01:00Z — OpenRouter monthly reopens** (small scout capacity returns). + **Nov 2 00:00Z — Meta weekly resets** (~77 fresh pts at current projection) and Go weekly + sub-windows reset (no effect while monthly caps bind). +4. **Nov 2 21:02 CT — Go Personal plan ENDS.** Any unburned Personal quota is gone permanently. + From here to Nov 7 the only Go workspace is Lab, monthly-exhausted. +5. **Nov 2–5 — THE TROUGH.** DeepSeek-family plan capacity ≈ opendesign (tiny) only. Work must + ride Meta (fresh Nov 2), OpenAI plan (until its Nov 4 reset), and Antigravity Claude seats + (unmeasured — §4). Queue classes that only fit DeepSeek seats should be *held*, not forced + onto PAYG (NEVER FUNDS). +6. **Nov 4 06:35Z — OpenAI plan weekly resets** (fresh ~100 pts; the Nov 4–11 week then needs + ~14 pts/day sustained — queue Luna/Sol-fit work accordingly). +7. **Nov 5 19:22 CT — ClinePass monthly resets** → DeepSeek seats return via ClinePass. + **Nov 7 05:55Z — Go Lab monthly resets** → full DeepSeek capacity returns. Second-cycle + anchors after that: Meta weekly Nov 9 00:00Z, OpenAI plan weekly Nov 11 06:35Z, ClinePass weekly + Nov 7 09:20Z / monthly Dec 5, Go Lab monthly Dec 7. + Second-cycle warning: if the Nov 2–5 trough just *defers* the DeepSeek backlog, Nov 5–7 will + spike ClinePass/Go burn the same way this week did — the plan for the second cycle is to + pre-spread that backlog across Nov 5–14 (~10 pts/day each) instead of another 3-day binge. + +Over-pace scenario branch: if the OpenAI plan's recent ~25 pts/day persists, it exhausts ~Nov 1, *before* +the trough — the trough then leans entirely on Meta (post-Nov 2) and Antigravity. The 4–6h +check (§5) is what detects which branch we're on. + +--- + +## 3. Standing theoretical plan per pool — target trajectory + dated audibles + +Target trajectory = the constant daily rate from now that lands the pool at ~100% exactly at +reset (for windows already nearly spent, the trajectory is "finish cleanly, subsessions only +near the wall" per the registry caveat). + +| Pool (largest window) | Now → reset | Needed rate | Measured rate | Verdict | +|---|---|---|---|---| +| Go Lab monthly | 87.2% → Nov 7 05:55Z | 1.4/day | +12.5 to +18.6/day | Exhausts ~Oct 30–31 (over) | +| Go Personal monthly | ~84% → plan ends Nov 2 21:02 CT | 3.3/day | ~0/day | ~16 pts stranded (under) | +| OpenAI plan weekly | 27% → Nov 4 06:35Z | 12.2/day | +5.9 (72h) / ~25 (active) | Base ~62% land (under); over scenario | +| Meta weekly | 23.2% → Nov 2 00:00Z | 20.8/day | +6.6/day | Lands ~48% (under) | +| ClinePass monthly | 91% → Nov 6 01:22Z | 1.2/day | +6.1 to +25/day | Exhausts ~Oct 29–30 (over, deliberate) | +| Command Code monthly | 69% → Nov 2 | ~9/day | ~+0.4/day | Lands ~71% (under, stale data) | +| Open Design 7-day | 3% used → ~Nov 3–4 | ~14/day | ~0.4/day | Lands ~5% (under, tiny) | +| Assistant subscription (not a pool) | 24% → Nov 3 06:59Z | 12.7/day | +9.6/day | Lands ~81–85% (watch) | + +**Dated audibles (planned now, executed by the check in §5 or escalated per its rules):** + +- **A1 — Oct 30 (or the first check where Go Lab monthly ≥ 95%): rotate the laptop's active Go + workspace Lab → Personal** (existing runtime operation: activate the Personal *oauth* + credential row) and pre-queue Flash-fit work against it, so Personal's remaining ~16 pts burn + before the plan ends Nov 2 21:02 CT. If Lab monthly exhausts before Oct 30, rotate + immediately at that check instead. +- **A2 — Oct 31 → Nov 1: Meta burn-up.** Shift workhorse overflow and subsession work onto + `meta` spark-contributor seats and raise Meta's effective share (route-pool weight/priority) + for Nov 1–2, targeting Meta weekly ≈ 95–100% at its Nov 2 00:00Z reset instead of the + projected ~48%. Includes stepping subsessions up effort tiers on Meta in the final 24h + (burn-by-expiry; plan quota only, never PAYG). +- **A3 — Nov 2 (at the resets): trough posture.** Hold DeepSeek-only queue classes; point the + workhorse default at Meta (fresh weekly) and schedule the backlog's Luna/Sol-fit design and + implementation work into Nov 2–4 to pull the OpenAI plan from its projected ~62% landing toward ~100% + by Nov 4 06:35Z. Re-point scout seats to the reopened OpenRouter pool. +- **A4 — Nov 4–5: pre-spread the returning DeepSeek backlog** across Nov 5–14 (~10 pts/day per + pool) ahead of the ClinePass (Nov 5) and Go Lab (Nov 7) monthly resets, so cycle 2 doesn't + repeat cycle 1's binge-and-starve shape. +- **A5 — standing, from the first check: Command Code + Open Design micro-burn.** Route the + small CLI-shaped job class (one-shot probes, small fixes) through the Command Code resident + proxy and opendesign seats at a steady trickle (~9 pts/day Command Code) — worth ~28 pts + before Nov 2 — *after* a fresh Command Code read exists (§4); do not burn blind. + +## 4. Flags + +**Projected to finish UNDER-used (queue work against these):** +- **Go Personal (~16 pts, expires Nov 2 21:02 CT)** — work class: the Flash task queue + (repo-queue worker shifts and issue-creator lanes are Flash-shaped). Rescued by A1. +- **Meta weekly (~52 pts stranded at Nov 2 reset)** — work class: workhorse/specialist sessions + on spark-contributor, plus subsessions near the wall. Rescued by A2. +- **OpenAI plan weekly (base case ~38 pts stranded at Nov 4)** — work class: Luna Max + sessions (design + implementation backlog), Sol for genuinely complicated items. A3. +- **Command Code (~28 pts, Nov 2)** — small CLI jobs via the resident proxy. A5. +- **Open Design 7-day (~95 pts)** — tiny; opendesign-seat scout/light work; low value, listed + for completeness. + +**Projected OVER-pace (the Drew flag: slow down or keep progressing?):** +- **Go Lab monthly** — exhausts ~Oct 30–31, ~7 days early. Not really slow-down-able (the work + is useful and Personal rotation + the trough plan absorb the consequence), but the *trough + itself* is the cost to flag. +- **ClinePass monthly** — exhausts ~Oct 29–30, ~6–7 days early; deliberate finishing mode. +- **OpenAI plan weekly (scenario)** — if the ~25 pts/day active rate persists across two + consecutive checks, it exhausts ~Nov 1. This is the one genuine slow-down-or-push question: + pushing is Drew's stated bias, but it deepens the Nov 2–5 trough. +- **The Nov 2–5 trough is the composite flag**: three DeepSeek doors closed at once. The plan + above treats it as survivable (Meta + OpenAI plan + Antigravity carry it); if Drew wants zero + trough, the only lever is slowing Go/ClinePass burn *now* — at the cost of stranding quota + if the slowdown overshoots. Recommendation in-plan: keep progressing, execute A1–A3. + +**Too stale / missing to project (named, not guessed):** +- **Antigravity weekly buckets** — no gatherer rows since 2026-10-27T06:00Z; last values + (Gemini 2%, Claude/GPT 50%) are 2 days old and their resets (Oct 31 / Nov 1) are imminent. + Blocks trough planning for sonnet/opus seats. Fix: restore the antigravity feed or a daily + console read. +- **Go Personal burn rate** — % known from one console read (Oct 28 19:33 CDT); no series + exists because the gatherer only reads the *active* workspace (openchamber#736's + per-workspace gap). A1 is sized on the % alone. +- **Command Code** — freshest good read Oct 27 10:05 CDT; gatherer auth failing Oct 29; + console sign-in pending (standing item). Projection is provisional. +- **Meta freshness** — series stale since Oct 29 04:00Z and the 07:30Z tick errored + (file-export unparseable). Projectable from the Oct 27 console + export points, but the + exporter needs a look. +- **Claude** — free tier + provider disabled + reads erroring: no pool to project. +- **Open Design** — last read Oct 28 06:40 CDT, no feed; low stakes. +- **openai.alternate** — one read (Oct 27, 0%); cannot be projected separately from the main + OpenAI plan pool. + +## 5. Proposal: the 4–6h check (build, don't duplicate) + +**Vehicle: evolve `go-plan-expiry-watch`** (already every 6h — inside Drew's 4–6h direction; +already reads the Go console and projects in its daily report) **into a full-quota check**, +rather than a sibling job that would double-read the same sources. `pool-quota-steward` keeps +its hourly staleness/flagging role; the watch owns projections + the standing plan. (Job-body +edits follow the standing cron-edit procedure; the 6h cadence itself is unchanged, so no rate +decision is needed beyond what #2173 already carries.) + +**Inputs per run:** (1) fresh quota reads — aggregator `quota-current.json` + snapshot-series +tail (must be ≤60 min old per the measurement gate; console reads only for pools the feed +lacks: Go Personal, Command Code); (2) `agent.quota_records` for the subscription line; +(3) the previous standing plan (this document's successor, kept as a versioned file the job +rewrites); (4) `agent.mirror_token_usage_daily` for demand trend. + +**Computation per run:** per pool (largest window): current %, reset instant, two measured +rates (24h and 72h, with a post-reset segment rate when a window boundary sits inside the +72h), required rate to land at 100%, projected % at reset, projected exhaustion date; +then the cascade pass — order pools by projected exhaustion, apply fall-through per the route +ladder, recompute the absorber pools' projections, across the next two resets per pool; +diff every figure against the previous plan and name what moved and why. + +**Outputs:** the regenerated standing plan (per-pool trajectory + dated audibles, same shape +as this document); a one-line-per-pool status in the watch's report; and only three things +ever escalate to Drew: (a) an **over-pace flag** naming the pool, its projected exhaustion, +and the slow-down-or-keep-progressing question; (b) a pool that goes **unmeasurable** (stale > +24h) — like Antigravity today; (c) an audible that needs a route-config change beyond the +watch's authority. + +**Audible execution split:** the check *executes directly* the audibles that are pure +operations with standing authorization — queueing more work from the named backlogs against +an under-paced pool, Go workspace rotation at the A1 trigger (oauth row activation is a +documented runtime operation), holding a queue class at a pool wall. It *escalates* anything +that changes route-pool weights/priorities in the deployed config (a code change via PR, +per the fleet's config rules) — A2/A3's weight components are therefore pre-filed as dated +PRs by the check's first runs, ready to merge on the audible date, rather than improvised at +the trigger. Every executed audible is recorded in the plan diff and the watch's state file. + +**First two runs** (per #2173 acceptance): the next scheduled watch run produces plan v2 from +fresh reads and either confirms A1's Oct 30 trigger or fires it early; the run after that is +the second consecutive check. If A1 fires, it is also the acceptance criterion's "one real +under-pace pool caught by the check" (Go Personal), with the rotation + queued work as the +receipt. + + +--- + +## Addendum 2026-10-29 ~03:10 CDT — Command Code quota reads RESTORED + +**Root cause:** every stored Command Code API key had been invalidated server-side. Three distinct key copies existed — the CLI login key in `~/.commandcode/auth.json` (minted 2026-10-23, == the Bitwarden `commandcode.api-key` copy), a second, different key in OpenCode's credential store (`commandcode` integration), and the 1Password copy (same value as the CLI key) — and ALL of them return HTTP 401 `Invalid 'Authorization' header or token` from `api.commandcode.ai/alpha/whoami`. The account itself is healthy: a fresh sign-in minted a working key immediately. The last steady reads were 2026-10-27, with intermittent successes into 2026-10-28 ~14:30Z before the failure became total (aggregator entry: `state: error`, "Command Code authentication failed", via the OpenChamber quota provider reading OpenCode's credential store). This is also the 401 that hit the OpenClaw `commandcode/...` route. The server-side trigger for the invalidation is not visible from here; no local config had changed. + +**Fix (per Drew's OAuth rule — agents click through themselves, laptop desktop, no waiting on the pending sign-in card):** +1. `commandcode logout` + fresh `commandcode login` in a tmux TTY on the laptop (the login TUI needs a real terminal; it prints a `commandcode.ai/studio/auth/cli` link with a localhost callback listener). +2. Opened the link in the laptop's headed Helium (staged profile copy, CDP-driven) → Command Code sign-in via GitHub → GitHub demanded Vertex Incorporated org SSO (Microsoft SAML); used the authorize URL's `skip_sso=true` continuation instead (the OAuth app only requests `read:user user:email`, no org data) → signed in → clicked **Authorize** on Command Code's "Authorize CLI Access" page → callback landed, CLI wrote a fresh `auth.json` (2026-10-29T08:01:52Z). +3. New key verified directly: `whoami` 200, `billing/credits` 200. Replaced the OpenCode credential-store row for `commandcode` via the OpenCode server API (create new active row, delete the dead row; verified by hash match). +4. Synced the vaults to the new key, each verified by read-back hash: Bitwarden Secrets Manager `commandcode.api-key` ✅ · 1Password `commandcode.api-key` (Dev) ✅. +5. Verified end to end: `commandcode -p` probe answers; a manual `quota-gatherer` run put `command-code` back to `state: ok` in quota-current.json and appended fresh records to the snapshot series (2026-10-29T08:03:35Z). + +**Fresh read (2026-10-29T08:03:35Z, source openchamber-quota):** weekly **13.996% used** (0.84 / 6 credits), resets **2026-10-31T15:16:57Z** (Sat Oct 31, 10:16 AM CT) · 5h **0%** (0 / 3) · monthly credits balance remaining **3.12** (purchased 0, free 0). Shape note for the plan: the API exposes no monthly-percent window — the Oct 27 "monthly 69%" figure does not come from this endpoint; the burn-relevant windows are weekly % + the credit balance. Plan A5 (Command Code micro-burn) is unblocked, sized by the weekly window: ~86% of the weekly cap remains, resetting Oct 31 10:16 AM CT — not Nov 2. + +--- + +## Addendum — 2026-10-29 ~03:14 CDT: Antigravity quota feed REPAIRED (root cause + fix) + +**Root cause (three layers).** (1) The OpenChamber quota module's Antigravity provider resolved auth ONLY from the `opencode-antigravity-auth` plugin's legacy accounts file (`~/.config/opencode/antigravity-accounts.json`, fallback the data-dir path). (2) That file was wiped in the 2026-10-27 ~13:45 CDT redeploy of the git-managed `~/.config/opencode` directory — the file is gitignored by design (the plugin adds it to `.gitignore` itself), and nothing recreates it, because the current plugin signs in through OpenCode's credential store instead: the live login sits in `opencode.db` as the `google` integration's active OAuth credential (method `antigravity`), which the interactive paths (plugin, agy) use — that's why interactive Antigravity worked all along. (3) With no file, `isConfigured()` returned false and `listConfiguredQuotaProviders` silently omitted the provider — no error row — so the gatherer produced no Antigravity rows after the 2026-10-27 13:30 CDT tick (snapshot series' last value change: 06:15Z). Dead ends ruled out by direct test: the `~/.gemini/oauth_creds.json` refresh token is bound to the Gemini CLI OAuth client (Antigravity-client exchange → 401 `unauthorized_client`) and its access token gets 403 PERMISSION_DENIED from the Cloud Code quota endpoints — Google gates those endpoints by issuing client, so only the credential-store Antigravity-method login can feed the quota read. + +**Fix.** developing-today/openchamber PR #764 (`fix/quota-antigravity-store-auth`, commit 52c74cc19): the provider gains a second auth source mirroring the google provider's store resolution — `resolveAntigravityStoreAuth(auth)` reads the `google`/`google.oauth` OAuth entry from OpenCode's credential store (pipe-packed refresh parsing shared with the google provider); `fetchQuota` tries accounts-file then store candidates, deduplicated by refresh token; `isConfigured(auth)` accepts either source. Plus new `auth.test.js` (7 tests) and a DOCUMENTATION.md decision entry. Validation: antigravity + google vitest suites 63/63, `bun run check:changed` pass, live smoke test through the gatherer's call path. **Activation:** merge #764 (CI checks were still queued in the fleet-wide Actions runner stall at write time) → pull the laptop's `~/git/openchamber-fork` checkout → the gatherer's next 15-min tick runs it permanently. No NixOS switch or other deploy needed. + +**Verified end-to-end (2026-10-29T08:13:38Z):** a manual gatherer tick against the patched module (via `OPENCHAMBER_LIB_DIR`) reported `antigravity ok`, providers back to 10, and appended 45 records; `quota-current.json`, the snapshot series, and gatherer state all carry fresh Antigravity rows. + +**Fresh read (2026-10-29T08:13:38Z, source openchamber-quota) — replaces the stale Oct 27 values everywhere in this plan:** Gemini pool weekly **5% used** (resets **2026-10-31T13:11Z**, Sat Oct 31 08:11 CDT) · Claude/GPT pool weekly **57% used** (resets **2026-11-01T09:23Z**, Sun Nov 1 03:23 CST) · 5h windows ~0–1%. Plan impact: the trough-cover picture changes materially — the Claude/GPT pool is NOT sitting at half with most of its capacity free; it is 57% spent with 43% left until Nov 1, and the Gemini pool is nearly untouched (95% left) but resets Oct 31, before the Nov 2–5 trough. Recompute audible A3's cover math on these numbers. + +**Correction to the addendum above (2026-10-29 ~03:20 CDT):** the first `check:changed` run on PR #764's original commit actually FAILED the anti-slop ratchet (`no-runtime-typeof` — a `typeof` guard I had used in the new store resolver); an early status read masked the failure and the addendum's "check:changed pass" was premature. Fixed in commit `d274ae591` (guard rewritten with the utils' `asObject`, the codebase idiom): gate re-run verified **exit 0, "No new findings / All checks passed"**, focused suites still 63/63, and a second live gatherer tick against the corrected code again landed fresh Antigravity rows (2026-10-29T08:19:23Z, +5 records). Everything else in the addendum stands. diff --git a/doc/living/routine-task-architecture.md b/doc/living/routine-task-architecture.md new file mode 100644 index 0000000000..f92fbdd9f1 --- /dev/null +++ b/doc/living/routine-task-architecture.md @@ -0,0 +1,85 @@ +# Routine-task architecture redesign — one merged job, time-based sections + +Living document · Status: shipped (2026-10-04/05) · Register entry F4.2 · Tracking epic: developing-today/code#8805 + +## Purpose + +- Merge two routine jobs into one, without losing their separate schedules + or their separate todo sources. +- Jobs merged: sandbox-boot-init (5m) and nix-mcpx-15min-check (15m). +- Directives ran 2026-10-03 → 2026-10-04, with a simplification pass on + 2026-10-05. + +Drew's rulings in the redesign: +- Time-based per-section scheduling instead of a run counter — + "a counter breaks if the job interval changes". +- Per-section `todo_sources` allowlists. +- mcpx rebuilds ONLY on a new upstream tag. + +## What landed (features, and how each works) + +- One merged job: + - Cron job: `boot-init-todo-check`. + - Sections run on their own time-based intervals inside the one job. +- Time-based sections: + - State file records, per section, `interval_minutes` and `todo_sources`. + - Sections named in the register: boot-init / todo-sweep / deal-hunt. +- Per-section todo allowlists: + - Each section carries its own `todo_sources` allowlist in the state file, + so a section only draws todos from its approved sources. +- Simplifications applied 2026-10-05 ("yes all these look good. apply 1 to 4"): + 1. Timeout 900s → 1800s. + 2. Tiered upstream check. + 3. Codified push pattern. + 4. Less log noise. + - Plus: sweep cadence dynamic 30 / 90 / 120m. + - Applied 2026-10-05 11:45–11:50, verified with cron.view read-back. +- Related cadence directive (2026-10-07): + - "cut the scheduled jobs to run half as often" — applied the same day: + boot-init-todo-check 10m → 20m, airthings-alerts 6h → 12h, + heartbeat 30m → 1h. + +## Rough architecture + +- Single cron job: `boot-init-todo-check`. +- State file: + `~/workspace/goals/nix-real-store-mcpx-opencode-setup/hidden_files/schedule-state.json` + - Holds the sections (boot-init / todo-sweep / deal-hunt), each with + `interval_minutes` + `todo_sources`. +- Append-only events log alongside the state file (named in the register + as `events.log` in the same design artifact description). +- The predecessor 15-minute mcpx check cron from the F2 program was + absorbed into this redesign (see F2 parent entry). + +## Status + +- Design status in register: built-into-running-system. +- Implementation status in register: shipped — verified working from + 2026-10-04 00:24 onward; simplifications applied 2026-10-05. +- Tracking: NEVER-ISSUED — searched "boot-init todo-check". +- Triage: (b) DONE-WITHOUT-ISSUE. + +## Next steps — immediate / near-term / long-term + +- Immediate: none recorded. +- Near-term: none recorded. +- Long-term: none recorded. + +## Open follow-ups + +- None recorded in the register entry. + +## Future ideas not yet specced + +- Not recorded in the register entry. + +## Links + +- Register entry: F4.2 in `~/workspace/design-audit-60d/REGISTER.md` +- Related register entries: F2 (mcpx platform program — its 15-min check + cron was absorbed here), F4.1 (fleet sweep/review job family — the + boot-init-todo-check cadence was later changed there, 20m → 30m on + 2026-10-19) +- Tracking epic: developing-today/code#8805 +- Design artifact: cron job `boot-init-todo-check` + schedule-state.json + (path above) diff --git a/doc/living/turso-cloudflare-idea-engine.md b/doc/living/turso-cloudflare-idea-engine.md new file mode 100644 index 0000000000..9081df9bc8 --- /dev/null +++ b/doc/living/turso-cloudflare-idea-engine.md @@ -0,0 +1,81 @@ +# Turso + Cloudflare idea engine + +Living document · Status: shipped (2026-10-20) · Register entry T3 · Tracking epic: developing-today/code#8805 + +## Purpose + +- Produce a steady supply of concrete, buildable ideas that use + the Turso $5 plan and/or Cloudflare $5-tier features. +- Keep each idea inside Drew's budget rules. +- Advance a standing ledger by one small rotating step per run. +- This document covers the engine only, not its individual ideas. + +## What landed (features, and how each works) + +- A standing cron named `turso-cloudflare-idea-engine`. +- Each run produces ONE concrete buildable idea. +- Each run also advances a standing ledger by one rotating step: + - (a) check one service's usage / limits / spend, or + - (b) find one new free/cheap compute/storage/egress offer, or + - (c) note hits/geo/latency for a property. +- Budget rules recorded for the engine: + - free tiers first + - $5 plans in play + - $25–30 "maybe later" + - $75 out +- First asked: 2026-10-20, recorded in the cluster-goal setup. +- The first idea was delivered 15:01 CDT the same day. +- Interval change: Drew instructed the cron be doubled the same + day, from every 8 hours to every 4 hours. +- Output volume at window end: 131 dated idea entries + (2026-10-20 → 2026-11-11), plus 131 rotating ledger-step entries. +- All 131 idea titles are preserved in the design register's + Appendix A; they are not documented individually here. + +## Rough architecture + +- Vehicle: the `turso-cloudflare-idea-engine` cron. +- Home: under the lab-cluster goal; no GitHub issue. +- Artifacts named in the register: + - the cron task body + - `~/workspace/goals/stand-up-lab-cluster-talm-talos-cozystack-postgres-rustfs/files/idea-register-2026-10-20.md` + - `hidden_files/cloud-ideas-log.md` in that goal +- Triage in the register: (b) DONE-WITHOUT-ISSUE for the engine + itself — it exists and runs. + +## Status + +- design_status in the register: built-into-running-system. +- implementation_status in the register: shipped. +- Still running at window end; the 131st idea is dated 2026-11-11. +- Finding, stated plainly: the logs record no pickups. + - The register contains zero `issues/` links for the ideas. + - The ideas log contains no pickup/implemented markers. + - Every idea is therefore pickup-unverified in the record, and + parked, unless Drew approves a build. + +## Next steps — immediate / near-term / long-term + +- Immediate: none recorded; ideas wait for Drew's approval. +- Near-term: not recorded. +- Long-term: not recorded. + +## Open follow-ups + +- Every idea's recorded "first step" remains unstarted unless + Drew approves a build — by the engine's design, ideas are + parked unless Drew approves. +- No pickup tracking is recorded in either log. + +## Future ideas not yet specced + +- The engine's own output is the future-ideas stream; individual + ideas are registered in Appendix A and not specced here. + +## Links (register entry, related issues/PRs named in the register entry) + +- Register entry: T3, in the design register (REGISTER.md). +- Register Appendix A: all 131 idea titles, grouped by theme. +- Cron: `turso-cloudflare-idea-engine` (under the lab-cluster goal). +- Tracking epic: developing-today/code#8805. +- Tracking in the register: NEVER-ISSUED (no GitHub issue). diff --git a/pm-stack/decisions-ledger-system.md b/pm-stack/decisions-ledger-system.md new file mode 100644 index 0000000000..d2e696d8c6 --- /dev/null +++ b/pm-stack/decisions-ledger-system.md @@ -0,0 +1,78 @@ +# Decisions ledger system — pending-questions ledger / Outstanding Questions + +Living document · Status: shipped (2026-11-04) · Register entry P2.1 · Tracking epic: developing-today/code#8805 + +## Purpose + +- Hold, in one ledger, everything waiting on Drew, with evidence. +- Ensure nothing Drew is asked gets lost. +- First asked: 2026-11-04 23:47 CST. +- Drew requested the Outstanding Questions side chat as the + mirror / working surface for the hourly pending-questions job. + +## What landed (features, and how each works) + +- A single pending-questions ledger is the central artifact. +- Ledger location: + `~/workspace/goals/pending-decisions-hourly-questions-for-drew/hidden_files/pending-questions.json` +- Items accumulate in the ledger instead of living only in chat. +- The Outstanding Questions side chat mirrors the ledger as a + working surface. +- The hourly pending-questions job is the associated job named + in the register entry. +- Ledger state at the records-pass read on 2026-11-11: + - 150 items total + - 84 answered + - 34 asked + - 20 pending + - 12 dropped +- The ledger is the substrate for downstream surfaces: + - the decisions page (register entry P2.2) + - the answerable pushes in developing-today/code#8568 + +## Rough architecture + +- Store: the JSON ledger file at the path above. +- Owning goal: pending-decisions-hourly-questions-for-drew. +- Working surface: the Outstanding Questions side chat. +- Producer / upkeep: the hourly pending-questions job. +- Consumers recorded in the register: the decisions page (P2.2) + and #8568's answerable pushes, both building on this ledger. +- Tracking: no single GitHub issue; the artifact is the ledger + itself. + +## Status + +- design_status in the register: built-into-running-system. +- implementation_status in the register: shipped + running. +- Counts above are a snapshot from 2026-11-11, not a live count. + +## Next steps — immediate / near-term / long-term + +- Immediate: work through the pending items the ledger carries; + the pending design rulings are listed in register entry P2.3. +- Near-term: not recorded as a separate step in this entry. +- Long-term: not recorded. + +## Open follow-ups + +- The pending design rulings the ledger carries are listed in + register entry P2.3. +- No other follow-ups are recorded for this entry itself. + +## Future ideas not yet specced + +- None recorded in the register entry. +- Related built work (decisions page, P2.2) is documented under + its own register entry, not here. + +## Links (register entry, related issues/PRs named in the register entry) + +- Register entry: P2.1, in pm-stack/design-register-2026-11-11.md. +- Ledger: `~/workspace/goals/pending-decisions-hourly-questions-for-drew/hidden_files/pending-questions.json` +- Owning goal: pending-decisions-hourly-questions-for-drew. +- Related: register entry P2.2 (decisions page). +- Related: developing-today/code#8568 (answerable pushes). +- Tracking epic: developing-today/code#8805. +- Note: this document is filed in the repo at + pm-stack/decisions-ledger-system.md. diff --git a/pm-stack/needs-user-actions-design-2026-10-26.md b/pm-stack/needs-user-actions-design-2026-10-26.md new file mode 100644 index 0000000000..ebfc299407 --- /dev/null +++ b/pm-stack/needs-user-actions-design-2026-10-26.md @@ -0,0 +1,295 @@ +# PM stack needs-user action model — design (2026-10-26) + +> Living document — committed 2026-11-11 from ~/workspace/pm-stack-needs-user-actions-design-2026-10-26.md as the tracking home for a completed design (60-day design register entry P1.4; register committed as pm-stack/design-register-2026-11-11.md in developing-today/code, tracking epic developing-today/code#8805). Status: shipped. Update this doc as the design shifts; the register is the frozen audit snapshot. + +--- + +# PM stack — needs-Drew actions, custom options, surveys, and delegation modes + +**Date:** 2026-10-26 (America/Chicago) · **Track:** design only — no code changed by this document. +**Parent design:** [pm-stack-coherence-design-2026-10-26.md](sandbox://workspace/pm-stack-coherence-design-2026-10-26.md) (epic [developing-today/code#1184](https://github.com/developing-today/code/issues/1184), Cluster 3). This addendum refines that cluster per Drew's requirement of 2026-10-26 ~23:36 CDT and is the design input for the issues filed with it (listed at the end). +**Explicitly out of scope:** #1110 (the orchestration section being rejected — a separate agent is fixing it; everything here assumes the section flows again), the generic triage verbs of #1152 (acknowledge/snooze/escalate/answer on tier items), #1154 (status requests), #1156 (session actions). This addendum designs what those do not: **structured per-item options and survey questions, and orchestrator delegation modes with proposal and inability returns.** + +## Grounding — what was actually read tonight + +- **Current published item shape** (`~/workspace/goals/keep-the-four-repos-healthy/hidden_files/orchestration.json`, run `orch-2026-10-27T04:13:53Z`, read directly): `tiers.needsDrew` = **11 items**, `tiers.needsOrchestrator` = 9. Every needsDrew item carries exactly: `id`, `kind` (`task` | `decision` | `session` | `gap`), `title`, `source`, `reason`, `since`, `lastSeenAt`, and optionally `ref` (4/11), `horizon` (6/11), `blockedBy` (1/11). **No** needsDrew item tonight carries `question`, `recommendedAction`, `options`, or any delegation state (needsOrchestrator items do carry `recommendedAction`, 6/9). Examples that motivate this design: "Account connection campaign: Plaid (Citi) sign-in" (reason: only Drew can do it in his browser — an *access* item), "code #812: public directory feed and presence counting design" (reason: owner design decision — a *decision* item with real alternatives the item itself could enumerate). +- **Aggregator model** (`pm-stack/aggregator/src/model.ts` on origin/main): `TierItem` (id, kind, title, source, state?, reason, since, lastSeenAt, ref?, sessionId?, question?, horizon?, blockedBy?, recommendedAction?) and `OrchestrationSection` — every field this addendum adds is optional and additive on `TierItem`; nothing existing changes type. +- **Validator** (`src/feed.ts`): `isOrchestrationSection` checks section-level shape only; the per-goal gate comment documents the #949 lesson — strictness below the top level rejects whole sections. #1158's design already established the pattern this addendum follows: *optional new members are validated per-item in the live source, never in the section gate.* +- **/attention rendering** (`src/render.ts`): `tierItemCard` renders badge(source) + badge(kind) + title + comment badge, then `Why you:` + reason, then optional question / blockedBy / recommendedAction / ref. There is no what-happens-if-nothing line, no action controls, no options, no survey. Session-derived needs-Drew entries (`TieredEntry` with `drewReason`, from `src/derive.ts` `buildAttention`) are a separate card type (`sessionCard`) — they get standard actions only (§4.4). +- **Write path** (coherence design, Cluster 3): `src/actions.ts` store mirroring `src/comments.ts` — `DashAction` envelope, `POST /api/actions`, `GET /api/actions.json`, `POST /api/actions/result`, clientToken dedupe, consume-once result transition, superseding actions for undo, orchestrator/keeper as the only consumers and the only writers of GitHub/Project/session state. **This addendum extends that envelope; it does not design a second one.** +- **Orchestration pass** (cron `orchestration-pass`, read-only tonight): hourly; publishes the whole section every run; keeps per-item bookkeeping in `orchestrator-state.json` (items by id: tier, reason, since, lastSeenAt, escalatedAt, actions[]); its publish step already asserts contract shape before writing (the provenance assertion added for #1110) — §3.3 extends that same assertion block. Its standing classification rule — "if you cannot state in one line why only Drew can resolve it, it is NOT needs-drew" — is what `whyDrew` (§1.1) makes structural. + +--- + +## 1. Item model extension (publisher → section → aggregator) + +All new fields are **optional** on `TierItem`. An item with none of them renders and behaves exactly as tonight (plus the §4 fallbacks). Field names are camelCase like the existing contract. + +### 1.1 `whyDrew` — the blocker class + +```ts +export type WhyDrew = "decision" | "missing-info" | "approval" | "access" | "policy"; +whyDrew?: WhyDrew; +``` + +| Class | Meaning | Canonical example tonight | +|---|---|---| +| `decision` | A product/design/scope choice no recorded context settles | code #812 directory-feed design | +| `missing-info` | The fleet lacks a fact only Drew holds; pairs with `questions[]` (§1.3) | a session's pending `question` | +| `approval` | A drafted/proposed thing exists (or will, via first-pass) and needs Drew's yes | a first-pass proposal (§2) | +| `access` | A credential, sign-in, device tap, or physical step only Drew can perform | Plaid/Citi sign-in | +| `policy` | Spend beyond standing authorizations, account-level installs, anything a standing rule reserves to Drew | dezren39/nix GitHub App decision | + +The pass MUST set `whyDrew` on every needsDrew item it publishes (self-check, §3.3). The aggregator derives a fallback when absent (older runs): `kind === "decision"` → `decision`; item has `question` → `missing-info`; otherwise `decision`. The class drives three things: the card's class badge (§4), which standard actions are offered (§1.2), and the auto-delegation hard exclusions (§2.3). + +### 1.2 Standard actions — the canonical set (every needsDrew item, always) + +These are Drew's words made canonical. They render on every needsDrew card regardless of what else the item carries: + +| Action | Verb (§4.3) | Payload | Notes | +|---|---|---|---| +| **Answer** | `answer` | `text` (and/or survey/option payloads, §1.4) | Free-text reply; the pass delivers it like its own classifications | +| **Delegate — first pass** | `delegate` | `mode: "first-pass"` | §2.2 | +| **Delegate — auto** | `delegate` | `mode: "auto"` | §2.3; not offered when `whyDrew` is `access` or `policy` (the control renders disabled with the reason — the #1152/#1156 honesty pattern) | +| **Snooze until** | `snooze` | `until` (ISO) | From #1152; item leaves NEEDS DREW until the horizon, renders in the "snoozed by you" strip meanwhile | +| **Dismiss with reason** | `dismiss` | `reason` (**required**) | §1.5 | +| **Escalate** | `escalate` | `reason?` | On a needsDrew item: pin to top of tier, horizon forced to `today`, and flag in the pass's next delivery report | + +(#1152's **acknowledge** remains as a non-resolving standard control beside these — it records "seen", it does not resolve, snooze, or delegate, and the card keeps rendering until one of the six above fires.) + +`ifIgnored?: string` — one line, publisher-written: what happens if Drew does nothing ("Citi stays unlinked; the campaign goal stays at 15/17"). When absent, the card computes an honest fallback from `since`: "Stays in your queue and is re-published every run until it resolves or expires — in your queue since ." Never invented consequences. + +`summary?: string` — optional one-line plain-language "what this is" for jargon-heavy titles; the card falls back to `title` alone when absent. + +### 1.3 Custom `options[]` — the item's own suggested choices + +```ts +export interface TierItemOption { + id: string; // stable within the item, slug form: /^[a-z0-9][a-z0-9-]{0,39}$/ + label: string; // button text, ≤ 80 chars + description?: string; // one line: what this choice means + effect?: string; // one line: predicted effect if chosen ("closes #812 as option B; fleet implements") +} +options?: TierItemOption[]; // ≤ 6 +``` + +The item knows its own alternatives; the pass writes them when it classifies (a `decision` item without options is a classification smell — the pass should usually be able to name at least the two real branches, even if one is "defer"). Choosing one is an action (§4.3), not a page-local state. + +### 1.4 Survey `questions[]` — cover what is missing + +```ts +export interface TierItemQuestion { + id: string; // stable within the item, same slug rule + prompt: string; // the question, ≤ 200 chars + type: "single" | "multi" | "text" | "yesno"; + options?: { id: string; label: string }[]; // required for single/multi (≥ 2), ignored otherwise + required?: boolean; // default true + covers: string; // the missing information this answer supplies, one line +} +questions?: TierItemQuestion[]; // ≤ 5 +``` + +`covers` is mandatory in the contract (an unlabelled question is a quiz, not a survey): it renders beside the prompt as "Needed: ", so Drew sees what each answer unblocks. A `missing-info` item SHOULD carry at least one question; the pass may also attach questions to other classes (e.g. a `decision` item asking one scoping question alongside its options). + +### 1.5 Dismiss semantics + +Dismissal is recorded by the consuming pass into `orchestrator-state.json` with the reason and the item's signal fingerprint (ref + reason + blockedBy set). **Resurface rule:** a dismissed item stays out of the tier unless a *new material fact* appears (blocker changed, new comment/activity on `ref`, horizon passed); when it resurfaces, its `reason` must cite the new fact ("resurfaced: …"). A dismiss with no reason is rejected at the actions boundary (`validateNewAction`, §4.3) — "dismiss-with-reason" is the requirement, not a label. + +--- + +## 2. Delegation modes — first-class per-item state + +### 2.1 The state, and where it lives + +```ts +export interface TierItemDelegation { + mode: "drew" | "first-pass" | "auto"; + status: "idle" | "working" | "proposal-ready" | "unable" | "done"; + updatedAt: string; // ISO, last transition + runId?: string; // run that last transitioned it + proposal?: { + summary: string; // what the first pass produced, one paragraph max + detail?: string; // the draft itself (answer text, plan, proposed wording) + proposedChanges?: string[]; // concrete changes approval would apply + at: string; + }; + unable?: { + reason: string; // why the orchestrator cannot do this + whatItTried: string[]; // ≥ 1 concrete attempt/route considered + whatItNeeds: string; // the specific thing that would unblock it + at: string; + }; +} +delegation?: TierItemDelegation; +``` + +**DECISION — one item, one identity.** Delegation state is a field on the same tier item (same `id`, same card, same `tierItemObjectRef` for comments/actions). A proposal is *not* a new item; an inability return is *not* a new item. The pass is the publisher of `delegation` (it mirrors into the section the mode Drew set via actions, which it reads from the actions store each run and records in `orchestrator-state.json`). Before Drew has ever delegated an item, `delegation` is absent — equivalent to `{mode: "drew", status: "idle"}`. + +### 2.2 `first-pass` — draft, return, approve + +``` +drew ──delegate{mode:"first-pass"}──▶ first-pass/working +first-pass/working ──pass completes a bounded first pass──▶ first-pass/proposal-ready (+ proposal{}) +first-pass/proposal-ready ──approve-proposal──▶ (pass applies the proposal next run) ──▶ item expires out, actions[] logs it +first-pass/proposal-ready ──reject-proposal{reason}──▶ drew/idle (proposal cleared; reason kept in orchestrator-state) +first-pass/working ──pass cannot draft──▶ first-pass/unable (+ unable{}) +any state ──delegate{mode:"drew"} or dismiss/snooze──▶ back under Drew's direct control +``` + +Rules: the first pass is **bounded and non-applying** — it may read everything the item touches, draft an answer/plan/proposed change set, and stage nothing. It must not perform the Drew-reserved effect itself (no Project write of the decision, no session answer delivered, no spend). Approval is what converts the draft into the effect, applied by the pass on its next run as the single writer, with the run's `actions[]` entry naming the approving action id (`da-…`) — the same provenance pattern as #1154. Rejection requires a reason (same boundary rule as dismiss); the reason is recorded so the pass does not re-propose the same draft — if it re-delegates later, the new proposal must differ materially or say why it doesn't. + +### 2.3 `auto` — proceed unless unable + +``` +drew ──delegate{mode:"auto"}──▶ auto/working +auto/working ──pass resolves end-to-end──▶ item expires out; actions[] logs what was done +auto/working ──pass hits a wall──▶ auto/unable (+ unable{}) → item re-surfaces to Drew WITH the context +auto/unable ──Drew answers/dismisses/switches mode──▶ per that action +``` + +Rules: + +- Auto means the pass treats the item as its own queue item with full standing authority (its normal ladder, caps, and measurement gate apply unchanged) — it is a *mode on this item*, not a new power. +- **The only return path is `unable{}`.** Silence, partial progress notes in a log Drew never sees, or quietly re-classifying the item to NEEDS ORCHESTRATOR are all contract violations: if the pass cannot finish it, the item stays in NEEDS DREW with `status: "unable"` and the structured reason/tried/needs triple. `whatItTried` must name at least one concrete route (a doc read, a recorded decision checked, a dispatch considered and why it failed) — "couldn't do it" without a tried-list fails the self-check (§3.3). +- **Hard exclusions:** items with `whyDrew: "access"` or `"policy"` can never enter auto — by definition the orchestrator lacks what they need (Drew's browser, Drew's authority). A `delegate{mode:"auto"}` action on such an item is `rejected` via `/api/actions/result` with the note naming the class. The dashboard control is disabled for them up front (§1.2), so this is defense in depth, not the primary UX. +- **DECISION — RESOLVED BY DREW (2026-10-27 00:31 CDT, via the options widget in the dashboard-status chat): the standing toggle is ON.** Drew's selection: "Standing auto toggle ON for decision/info/approval items (access & policy always stay mine)". Effect, effective when #1290/#1292 land: new needsDrew items whose `whyDrew` is `decision`, `missing-info`, or `approval` default to `mode: "auto"` — the orchestrator proceeds unless it returns a structured inability (§2.3). `access` and `policy` items NEVER enter auto under any setting; they always stay Drew's. Drew can still switch any individual item to first-pass or manual on its card (per-item override beats the standing default), and can turn the standing toggle off the same way he turned it on — the toggle state is a dashboard preference action record (auditable, supersede-to-change, never a config file edit). The pass MAY still surface `recommendedAction` on items, but for eligible classes the default is now auto rather than a suggestion. This supersedes the earlier per-item-opt-in-only proposal in this section and in §6. + +### 2.4 No silent rot while delegated + +A delegated item remains published in NEEDS DREW every run (badge: mode + status + age), so it can never vanish into the fleet's internals. Stall rule, pass-side: **a delegated item must reach a terminal outcome — `proposal-ready`, `done` (expired out), or `unable` — within 2 runs (2 h) of entering `working`.** On the second run without an outcome, the pass MUST publish `unable{reason: "no terminal outcome within 2 runs", whatItTried: […], whatItNeeds: "a decision on scope or inputs"}` rather than re-publish `working` again; the publish self-check (§3.3) fails the run's own section if a `working` item older than 2 runs has no outcome, so the violation is caught by the publisher, not by Drew noticing. This is the delegation-specific instance of #1148's principle (dead inputs surface, never decay silently); #1148's watchdog items remain the mechanism for dead *inputs* (feed, services), and no separate watchdog item is created for a stalled delegation — the item itself carries the signal, in the tier Drew already watches. + +--- + +## 3. Publisher contract + +### 3.1 Exact additions to the section + +`OrchestrationSection` itself is unchanged (version stays 1 — all additions are optional per-item fields, the #1158 precedent). On `TierItem`, all optional: `whyDrew`, `summary`, `ifIgnored`, `options[]`, `questions[]`, `delegation`. Caps: ≤ 6 options, ≤ 5 questions, string caps as in §1 (label ≤ 80, prompt ≤ 200, covers/effect/description one line each). The pass publishes them on needsOrchestrator items too when useful (an item Drew later escalates keeps its structure), but the contract requirement (§3.3) binds needsDrew. + +### 3.2 Validation — per-item, always + +`isOrchestrationSection` does **not** change and does **not** look at any new field. In the live source, where tier items are consumed (`src/sources/live.ts` `orchestration()`, the same seam #1158 designs for `nextUp`), each item passes a per-item sanitizer `sanitizeTierItemExtensions(item)`: + +- `whyDrew` not in the enum → field dropped (fallback derivation applies). +- `options`: non-array → dropped. Each option kept only if `id` matches the slug rule and `label` is a non-empty string; duplicate ids within the item → later ones dropped. Result capped at 6. +- `questions`: non-array → dropped. Each question kept only if `id` slug-valid, `prompt` non-empty, `type` in the enum, `covers` non-empty; `single`/`multi` additionally require ≥ 2 valid options. Capped at 5. +- `delegation`: validated **as a unit** — `mode`/`status` in enums and `updatedAt` a string, plus `proposal` present iff status is `proposal-ready` and `unable` present iff status is `unable` (each with its required string fields) — any failure drops the *whole* `delegation` field (item renders as plain `drew` mode), never the item. +- A malformed item extension can therefore degrade that item's card to tonight's rendering. It can never reject the item, the tier, or the section. (The #949 lesson, and the exact failure #1110/#1140 exist to never repeat at section level.) + +### 3.3 Orchestration-pass self-check additions + +Extending the publish step's existing assertion block (the same place the provenance-shape assertion lives — assertions run against the exact object about to be written, and a failed assertion stops the publish, it does not publish-and-hope): + +1. Every needsDrew item has `whyDrew` in the enum. +2. Every `options[]`: ids unique within the item, count ≤ 6, every option has a label. +3. Every `questions[]`: count ≤ 5, every question has non-empty `covers`; `single`/`multi` questions have ≥ 2 options. +4. No item with `whyDrew` `access` or `policy` has `delegation.mode === "auto"`. +5. Every item with `delegation.status === "working"` has `updatedAt` within the last 2 runs, **or** is transitioned to `unable` in this publish (§2.4). +6. Every `proposal-ready` item has a `proposal` with non-empty `summary`; every `unable` item has `unable.reason`, ≥ 1 `whatItTried` entry, and non-empty `whatItNeeds`. +7. Dismissed items (per `orchestrator-state.json`) are absent from the tiers unless the resurface rule (§1.5) fired, in which case `reason` starts "resurfaced:". + +--- + +## 4. Dashboard rendering & the actions mapping + +### 4.1 The legible needs-Drew card (`tierItemCard`, extended) + +Top to bottom, single column, mobile-first (the aggregator's existing card CSS; action controls ≥ 44 px touch targets, wrapping rows, no hover-only affordances): + +1. **Header row:** source badge · kind badge · **whyDrew class badge** (labelled in words: "Decision", "Missing info", "Approval", "Only you can", "Policy") · age ("in your queue since " from `since`) · comment badge · `ref` link. +2. **What:** `title`, then `summary` when present. +3. **Why you:** `reason` (existing). +4. **If nothing:** `ifIgnored`, or the §1.2 computed fallback. +5. **Question strip:** existing `question` rendering, when present. +6. **Your options (from the item):** one button per `options[]` entry — label on the button, `description` under it, `effect` as the muted "→ " line. Each button is its own form (§4.3). +7. **Survey:** when `questions[]` present, one inline form for the whole set: prompt, "Needed: " muted line, control per type (`single` → radios, `multi` → checkboxes, `yesno` → two radios, `text` → textarea). Required questions marked; one submit: **Send answers**. +8. **Proposal box** (only when `delegation.status === "proposal-ready"`): "First pass by the orchestrator — , ", `proposal.summary`, `proposedChanges` as a list, `detail` in a `
`, and **Approve** / **Reject** (reject reveals a required reason field). +9. **Unable box** (only when `status === "unable"`): "The orchestrator can't do this — ", "Tried:" list, "Needs:" line. The standard action row below it is the way out. +10. **Standard action row (§1.2):** Answer (reveals a free-text field — always available, survey or not), Delegate ▾ (two buttons: "First pass — I'll approve" / "Auto — unless it can't"), Snooze (horizon select: tonight / tomorrow / next week / pick date), Dismiss (reveals required reason field), Escalate. Controls the item's class forbids (auto on access/policy) render **disabled with the reason beside them**, never hidden. +11. **Delegation strip** (whenever `delegation` exists and status ≠ idle): mode + status badge, "delegated · last update ", and the pending-action badges the coherence design already specifies ("⏳ first pass requested 12m ago") until the pass's result lands. + +Pending and applied states for every control come from the actions store exactly as the coherence design specifies (badges from `GET /api/actions.json`, loaded like `commentsStore.counts()`); the card joins section item ↔ actions by `tierItemObjectRef`. + +### 4.2 Forms and script + +One new form class `.aform` beside the comment form's `.cform`, handled by an `ACTION_SCRIPT` that follows `COMMENT_SCRIPT`'s exact pattern (delegated submit handler, `fetch` POST to `/api/actions`, `location.reload()` on success, inline `.err` text on failure, hidden `clientToken` per rendered form). No framework, no new client dependency — consistent with the app's rules. + +### 4.3 Verb mapping into the DashAction envelope + +The coherence design's `DashAction.kind` for tier items is `"triage"`. This addendum adds these verbs to `DashActionVerb` (kind `"triage"` unless noted) and their payloads: + +| Verb | Payload | Boundary validation (`validateNewAction`) | Consumer behavior (orchestration pass) | +|---|---|---|---| +| `answer` | `text?`, `optionId?`, `answers?: {questionId, value}[]` — at least one of the three | `optionId` must name an option on the item as published; `answers` ids must be among the item's published question ids (checked against the current section at POST time — the aggregator holds it) | Delivers the content: option choice recorded as the decision + its `effect` executed/routed; answers fill the item's missing info (recorded in state, cited in the next publish); plain `text` delivered like #1152's answer | +| `delegate` | `mode: "first-pass" \| "auto" \| "drew"` (`drew` = take it back) | mode in enum | Sets the item's delegation mode in state; executes per §2 on this and later runs | +| `approve-proposal` | — | item must be `proposal-ready` in the current section | Applies `proposal.proposedChanges` as single writer; logs with the action id | +| `reject-proposal` | `reason` (**required**) | non-empty | Clears proposal, mode → `drew`, reason recorded (§2.2) | +| `snooze` | `until` | valid ISO, future | Per #1152 | +| `dismiss` | `reason` (**required**) | non-empty | Per §1.5 (state record + resurface rule) | +| `escalate` | `reason?` | — | Per §1.2 | + +Idempotency, consume-once results, supersede-to-undo, and the three-layer audit trail are inherited from the coherence design unchanged — a `delegate` followed by a second `delegate` supersedes the first; an `approve-proposal` result POSTed twice applies once. + +### 4.4 Session-derived items + +Cards from `sessionCard` (live sessions tiered needs-Drew) get the standard action row and Answer (which routes through #1156's session answer) — but no `options[]`/`questions[]`/delegation, because those are publisher-authored on section items. If the pass wants a session item to carry a survey, it publishes it as a section tier item (the mechanism `buildAttention` already uses to consume section items into session entries by `sessionId`). + +--- + +## 5. Acceptance tests (per piece) + +**Publisher contract (pass-side harness + aggregator fixtures):** +- A section whose needsDrew items carry every new field round-trips `isOrchestrationSection` unchanged (fields are invisible to the gate). +- Self-check: a fixture item with `whyDrew: "access"` and `delegation.mode: "auto"` fails the publish assertions; a `working` item 3 runs old without outcome fails; an `unable` with empty `whatItTried` fails. + +**Aggregator sanitizer (`test/orchestration.test.ts` style):** +- Item with a duplicate option id → duplicate dropped, item and section intact; question with 1 option → question dropped, item intact; `delegation` missing `unable` while `status: "unable"` → whole `delegation` dropped, item renders as drew-mode; counts: a section containing one fully-malformed-extension item still serves all 11-style items. +- Fallback: item without `whyDrew`, `kind: "decision"` → class badge renders "Decision". + +**Actions boundary (`test/actions.test.ts`, with #1152's store tests):** +- `dismiss` without `reason` → 400; `reject-proposal` without `reason` → 400; `answer` with an `optionId` not on the published item → 400; `delegate{mode:"auto"}` on an `access`-class item → accepted at the store (authorship is honest), then **rejected by the consumer** with the class named in `/api/actions/result` — and a render test asserts the dashboard disables that control up front so the rejection path is defense-in-depth only. +- Double-submit of one `clientToken` → one record; double result POST → one application. + +**Rendering (`test/render.test.ts` / `test/slice2.test.ts` style):** +- Fixture needsDrew item with options + questions renders: class badge, If-nothing line, one button per option with its effect line, survey form with "Needed:" per question, standard row with all six actions. +- `proposal-ready` fixture renders the proposal box with Approve/Reject; `unable` fixture renders reason/tried/needs; a delegated item renders exactly **once** in the tier (no duplicate card) across two consecutive fixture sections. +- Access-class fixture renders Delegate-auto disabled with its reason text. + +**Pass behavior (orchestration-pass run evidence, per its own run-log discipline):** +- First real first-pass cycle: an item delegated from the dashboard returns `proposal-ready` with a proposal; approval applies it and the item expires out with the action id in `actions[]`. +- First real auto cycle: an item resolves and expires out, **or** returns `unable` with a tried-list — a run that leaves it `working` past the 2-run bound fails §3.3 assertion 5. + +## 6. Sequencing (within coherence Cluster 3 / slice E) + +1. **Publisher contract** (fields + self-check) — independent; fields are optional, so the dashboard ignores them until step 3. Can land before the actions store. +2. **Verbs in the actions store** — with #1152's slice (same store, same PR family); `dismiss`/`delegate`/`approve-proposal`/`reject-proposal` join the verb enum from the start so #1152 doesn't ship a store that needs re-shaping. +3. **/attention UI** — card extension + `.aform` script; renders options/questions/delegation the moment the publisher emits them. +4. **Delegation execution in the pass** — mode consumption, first-pass drafting, auto execution, inability returns, stall rule. +5. **Proposal review handling** — the proposal-ready state join (actions ↔ section) and its edge cases (proposal for an item that expired, approval racing a new publish) — separable because steps 3–4 work with proposals produced *and* consumed in the simple path; this step hardens the seams. + +## 7. Filed with this design + +- (a) Publisher contract: [#1290](https://github.com/developing-today/code/issues/1290) — needsDrew item contract: whyDrew class, structured options[], survey questions[], delegation state. +- (b) /attention action UI: [#1291](https://github.com/developing-today/code/issues/1291) — standard actions, item-suggested options, inline survey, delegation controls. +- (c) Delegation execution: [#1292](https://github.com/developing-today/code/issues/1292) — first-pass proposals and auto-unless-unable with structured inability returns. +- (d) Proposal review state handling: [#1293](https://github.com/developing-today/code/issues/1293) — proposal identity, supersede/expiry races, cross-surface counts. + +Each references #1152 and #1184 and this doc. + +## 8. Decisions index + +1. **One item, one identity** — proposal and inability are fields on the tier item, never new items (§2.1). +2. **Auto opt-in (PROPOSED, wants Drew's confirmation)** — per-item explicit opt-in; pass may suggest, never set; a standing default toggle is designed but off until Drew turns it on; `access`/`policy` classes are hard-excluded under any setting (§2.3). +3. **Chosen options ride the `answer` verb** (`payload.optionId`) — one content verb for text, choices, and survey answers keeps consumer dispatch simple (§4.3). +4. **Dismiss requires a reason and carries a resurface rule** — new material fact or it stays out (§1.5). +5. **Delegation stall = `unable` within 2 runs, enforced by the publisher's own self-check** — no separate watchdog item for delegations (§2.4). +6. **All new fields optional, validated per-item** — the section gate never learns about them (§3.2). + + +## Decision update — 2026-10-27 01:05 CDT (naming + escalation semantics) + +Drew: "please continue and handle all updates, Needs User user/escalated and so on." Resolved: + +- Visible wording is **Needs user** (the intake tier), never "Needs Drew". The honesty/freshness slice is applying this across the aggregator's user-visible copy; internal published fields (`needsDrew`) are legacy until a versioned contract change, which must be fail-soft on both shapes (the #1110 pattern). +- The tier's semantics mirror the fleet's 2026-10-25 label family: **user/review = intake** — the orchestrator/Muse reviews and handles what it can first; only a genuinely-user item becomes **user/escalated**, surfaced to Drew with Muse's read attached. "Needs user" therefore names a queue the system works, not a pile waiting on Drew personally. +- New contract identifiers in this program are role-based user naming; no new Drew-named fields/verbs. The standing auto-toggle decision in §2.3 is unchanged: decision/missing-info/approval default to auto; access/policy never auto. diff --git a/pm-stack/project-tracking-evaluation-2026-10-23.md b/pm-stack/project-tracking-evaluation-2026-10-23.md new file mode 100644 index 0000000000..9d3cbce0c2 --- /dev/null +++ b/pm-stack/project-tracking-evaluation-2026-10-23.md @@ -0,0 +1,137 @@ +# Project-tracking tooling evaluation — GitHub Projects vs Linear vs self-hosted (2026-10-23) + +> Living document — committed 2026-11-11 from ~/workspace/your_files/github-projects-vs-linear-2026-10-23.md as the tracking home for a completed design (60-day design register entry P1.1; register committed as pm-stack/design-register-2026-11-11.md in developing-today/code, tracking epic developing-today/code#8805). Status: shipped. Update this doc as the design shifts; the register is the frozen audit snapshot. + +--- + +# GitHub Projects vs Linear — for running work across the fleet's repos + +Written 2026-10-23 for Drew. Question: one place to see "what's next" across many +GitHub repos, at two levels — (1) work in progress / planned upcoming, granular +but curated, features and fixes; (2) a higher-level roadmap for planning and +prioritization. Neither level should list every GitHub issue. + +Your terrain, so the comparison is honest: the work lives in GitHub issues and +PRs across developing-today/{code, opencode, openchamber} plus your personal +dezren39/nix; volume is high (hundreds of issues, ~740 PRs merged in the last +week alone); and a fleet of agents already creates, triages, and closes GitHub +issues around the clock. Any tool we pick has to survive that volume and be +maintainable by agents, not just by you clicking. + +## Bottom line + +**Start with GitHub Projects.** It's built out of the issues and PRs that +already exist, costs nothing extra, has both levels you asked for (board + +roadmap views over one item pool), and your agents can run it with the `gh` +tooling they already use. **Linear is the better *product*** — faster, more +opinionated, stronger cycle and roadmap mechanics — but it introduces a second +system of record next to GitHub and a per-seat bill, and its advantages matter +most to human teams, less to a solo operator whose workforce is agents. +Choose Linear instead if the deciding factors below flip for you. + +## How each maps to your two levels + +### Level 1 — work in progress / upcoming (the "what's next" board) + +- **GitHub Projects:** a Board view on Status (Todo / In Progress / In Review / + Done). Issues *and* PRs are items, so "PR awaiting merge" sits next to the + issue it closes. An Iteration field gives you sprint-style buckets + (`sprint:@current` filtering), and board columns support soft WIP limits + (a warning signal, not enforcement). Curation is the auto-add workflow: per + repo, a filter (e.g. `is:issue is:open label:now`, `label:next`, assignee) + decides what ever reaches the board; everything else stays in the repo + backlogs. Built-in workflows move status on close/merge and auto-archive + stale done items (caps: 50,000 active items, 10,000 archived — no longer a + constraint at your scale). +- **Linear:** Cycles are first-class — recurring 1–2 week buckets with + auto-rollover of unfinished work, scope history, and a triage inbox as the + front door. PRs link automatically (branch name / issue ID), and statuses + follow the code: branch created → In Progress, PR merged → Done. Filtering + to "what's next" is saved custom views. This is genuinely smoother than + GitHub's — Linear was designed around exactly this loop. The seam: work + either lives in Linear (with GitHub linked) or syncs from GitHub issues; + your fleet produces GitHub issues natively and constantly, so you'd run the + GitHub sync and accept a mapping layer between the two. + +### Level 2 — roadmap / planning & prioritization + +- **GitHub Projects:** a Roadmap view (timeline bars from Start/Target date + fields, zoom by month or quarter, milestone markers) over feature-sized + items. Feature issues with sub-issues show rollup progress; Priority and + Size fields drive ordering. Practical pattern: a second, coarser project + ("Roadmap") whose items are only features/initiatives, kept separate from + the work board so planning isn't drowned by fixes. Insights charts + (status distribution, burn-up style) exist for a quick health read. +- **Linear:** this is Linear's home turf. Projects carry target dates, + milestones, and written status updates; **Initiatives** group projects into + a true top level with their own timeline and health — the closest thing to + a planning surface designed for prioritization rather than a view over + tickets. If you end up doing quarterly planning with other humans, this is + the feature GitHub can't match today. + +## The deciding differences, for your setup specifically + +1. **Source of truth.** Projects adds fields *onto* your GitHub issues; the + repos stay canonical and nothing can drift. Linear duplicates the tracker: + even with GitHub sync, statuses and comments live in two places and the + sync rules become one more thing to debug. With an agent fleet writing to + GitHub all day, no-sync is a structural win. +2. **The personal-repo seam.** A GitHub project belongs to one owner. An org + project covers developing-today's three repos cleanly; dezren39/nix sits + under your personal account and can't sit in the same org board (it would + need its own small personal project, or a link). Linear's workspace + connects multiple GitHub orgs/accounts at once, so this seam doesn't exist + there. This is Linear's single strongest point for you. +3. **Agent maintainability.** Projects: full GraphQL API + `gh project` + commands; the sweeps already authenticate as you and can promote items + from their backlog files onto the board, set fields, and archive — no new + credentials, no new tool to teach them. Linear: also a good GraphQL API, + but it needs its own API key, workspace conventions, and prompt changes + across the fleet before agents can curate it reliably. +4. **Cost.** Projects: $0 incremental — included with the GitHub plans you + already hold. Linear: Free tier is a trial for you (250 non-archived + issues — you'd blow past it in weeks at fleet volume); Basic is + **$10/user/month billed yearly** (5 teams, unlimited issues), Business + $16 (unlimited/private teams, Insights). Solo, that's $120/year for the + tier you'd actually run — small, but it's a new recurring line, and it + only pays off if *you* live in the UI enough to feel the UX win. +5. **Feel.** GitHub Projects is a spreadsheet that learned boards: flexible, + occasionally clunky, filters are powerful but fiddly. Linear is famously + fast and keyboard-driven and decides your process for you (cycles, + triage, standard states) — delightful if you accept its opinions, + constraining if you don't. + +## If you pick GitHub Projects (recommended setup) + +- One org project, "Fleet — Now & Next": fields Status, Priority (P0–P3), + Size (S/M/L), Iteration (2-week), Start/Target dates. +- Views: **Board** (Status columns, filtered to current iteration + In + Progress), **Up Next** (table, next iteration, sorted by Priority), + **Roadmap** (timeline grouped by repo, quarter zoom). +- Auto-add per org repo with label gates (`now`, `next`); sweeps manage the + labels during triage, so the board stays curated without you touching it. +- A second org project, "Roadmap", feature-sized items only, for the + planning level; nix gets a small personal project mirroring the same + fields until/unless it moves under the org. + +## If you pick Linear instead + +- One workspace, one team per repo area (Basic caps at 5 teams — you'd fit: + code, opencode, openchamber, nix, meta), GitHub integration on all four + repos + issue sync from the org repos, cycles at 2 weeks, one Initiative + per roadmap theme. Budget $120/year (Basic, solo seat, yearly billing). + +## What would change the recommendation + +- You start planning regularly *with other people* (Linear's initiatives and + updates are built for an audience). +- The personal/org repo seam starts hiding real work (Linear removes it). +- The Projects UI friction measurably slows your morning readout — the thing + this is for. (Worth a two-week trial of Projects first, since it's free and + the setup is an afternoon of agent work; Linear's trial can run after, with + the label hygiene already in place.) + +Sources: GitHub Docs (projects automations, auto-add/auto-archive filters, +50,000-item limit); Linear pricing page as recorded Sept–Oct 2026 by multiple +pricing trackers (Free 2 teams/250 issues; Basic $10/user/mo yearly; Business +$16). Prices verified 2026-10-23; re-check Linear's page before purchase.