11# Overnight Run Contract
22
33Status: active.
4- Date: 2026-07-02 .
4+ Date: 2026-07-03 .
55
66This file records the execution order for the long autonomous launch run.
77
8+ ## Operating Authority
9+
10+ This launch has no external customer compatibility constraint. If a database
11+ shape, migration history, URL, package name, CLI command, frontend route, or
12+ code organization choice is wrong for the launch product, change it instead of
13+ protecting it.
14+
15+ Use provider-owned concepts where they exist:
16+
17+ - WorkOS owns human identity, AuthKit sessions, and any WorkOS-backed machine
18+ credentials.
19+ - GitHub owns accounts, installations, repositories, branches, pull requests,
20+ commits, and webhook event shapes.
21+ - Supabase/Postgres owns CodeAlmanac product state, but not identity.
22+ - Vercel, Render, GitHub Actions, PyPI, Doppler, PostHog, Autumn, and provider
23+ CLIs/APIs should be used directly where they are the real control plane.
24+
25+ Do not invent parallel product-owned systems unless a provider gap forces a
26+ small named adapter.
27+
828## Priority Order
929
10- The first major objective is infrastructure and deployment, before deep product
11- implementation.
30+ The run has two large halves:
31+
32+ 1 . Build the product spine until CLI, API, frontend, backend, and deployables
33+ work together.
34+ 2 . Sharpen the codebase so it reads like it was designed after the product
35+ model became clear.
36+
37+ The first major objective remains infrastructure and deployment, before deep
38+ product implementation.
1239
1340Order:
1441
@@ -25,6 +52,78 @@ Order:
2552The intended wake-up state is: there is something deployed, not only a local
2653refactor.
2754
55+ ## Product Spine
56+
57+ Finish the concrete product path first:
58+
59+ - root ` codealmanac setup ` is cloud setup, not local automation setup
60+ - CLI setup/login use the final WorkOS-backed auth contract through
61+ CodeAlmanac API endpoints
62+ - API exposes the nouns the frontend and CLI actually need
63+ - hosted repo list, repo setup, repo settings, trigger policy, delivery policy,
64+ and runs surfaces work in production
65+ - GitHub App webhooks create or update parent records before child records
66+ - PR/merge events on maintained branches create runs
67+ - delivery defaults to commit and is configurable per maintained branch
68+ - run records and run events are stored with the same conceptual shape in cloud
69+ and local, even when persistence differs
70+ - CLI, frontend, backend, and migrations are deployed after coherent chunks
71+
72+ ## Codebase Sharpening
73+
74+ After the spine works, the run should spend serious time improving code quality.
75+ This is not cosmetic cleanup. The goal is that a new engineer or agent can read
76+ the names and infer the product.
77+
78+ Allowed and encouraged:
79+
80+ - reorganize packages and folders around stable product/provider domains
81+ - rename services, stores, DTOs, routes, and tables to match GitHub, WorkOS, and
82+ CodeAlmanac nouns
83+ - collapse, rewrite, or repair Supabase migrations because launch has no
84+ external users
85+ - remove stale local/cloud split-brain
86+ - remove compatibility husks once callers have moved
87+ - simplify DTOs and API names so frontend, CLI, API, and core use the same
88+ vocabulary
89+ - break large files by responsibility
90+ - introduce a consistent project-wide error/result approach if current error
91+ handling is scattered
92+ - add architecture tests when boundaries become important enough to protect
93+ - mirror cloud/local concepts only where the parallel is real
94+
95+ Do not refactor for motion. Every reorganization should make one of these true:
96+
97+ - a product noun has one obvious home
98+ - a provider boundary stops leaking raw provider details
99+ - a future SDK/API method becomes easier to name
100+ - a test can enforce an architectural rule
101+ - deleted code removes a real source of confusion
102+
103+ ## README And Install UX
104+
105+ Restore the old README's feel rather than replacing it with a new marketing
106+ document. Keep the original banner, cadence, and most of the language where it
107+ still describes the product correctly. Update only the launch facts and command
108+ surface.
109+
110+ Public install should prefer a product-grade one-liner:
111+
112+ ``` bash
113+ curl -fsSL https://codealmanac.com/install.sh | sh
114+ codealmanac setup
115+ ```
116+
117+ The install script can use ` uv tool install ` internally. Keep the manual path in
118+ docs for transparency:
119+
120+ ``` bash
121+ uv tool install --python 3.12 codealmanac
122+ codealmanac setup
123+ ```
124+
125+ Do not reintroduce npm/npx instructions for the Python CLI.
126+
28127## Provider CLI Check
29128
30129Initial local CLI availability:
@@ -113,6 +212,34 @@ local setup/update path works
113212Refactors are allowed inside these chunks when they make the chunk fit cleanly.
114213Refactors that do not affect the launch path should wait.
115214
215+ ## Testing And Evidence
216+
217+ Test as much as possible. Prefer real provider/browser verification at the end
218+ of coherent chunks, not only unit tests.
219+
220+ Maintain a running testing record in ` worklog.md ` or ` verification-matrix.md `
221+ with:
222+
223+ - what was tested
224+ - exact command or provider surface used
225+ - production or local URL when relevant
226+ - result
227+ - commit/deploy/run id when relevant
228+ - anything not testable without user action
229+
230+ At minimum, keep checking:
231+
232+ - full Python tests and lint for ` codealmanac `
233+ - hosted route/frontend/backend tests where touched
234+ - browser login/setup/repo/settings flows in production
235+ - backend health and relevant API endpoints
236+ - GitHub webhook behavior or replayed webhook payloads
237+ - PyPI install and ` codealmanac setup ` smoke after CLI releases
238+ - Vercel and Render deploy status after provider changes
239+
240+ If blocked, record the block instead of silently skipping the surface. The
241+ wake-up handoff should say exactly what remains human-testable.
242+
116243## Supabase
117244
118245No external customers are using the product yet. Supabase migrations can be
0 commit comments