Skip to content

Commit 9d038f8

Browse files
authored
ops: gate Pages deploy for Slice 6A (#10)
1 parent 35ad75a commit 9d038f8

2 files changed

Lines changed: 259 additions & 2 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: Deploy Equinox Orbit to GitHub Pages
22

33
on:
4-
push:
5-
branches: [main]
64
workflow_dispatch:
5+
inputs:
6+
confirm_deploy:
7+
description: "Type DEPLOY to publish the current main branch"
8+
required: true
9+
type: string
710

811
permissions:
912
contents: read
@@ -12,6 +15,7 @@ permissions:
1215

1316
jobs:
1417
build:
18+
if: ${{ github.ref == 'refs/heads/main' && inputs.confirm_deploy == 'DEPLOY' }}
1519
runs-on: ubuntu-latest
1620
steps:
1721
- name: Checkout
Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
# Orbit V6 — Slice 6A Production Readiness and Cutover Plan
2+
3+
Status: **plan and control-plane preparation only**
4+
5+
Frozen application candidate: `afe8361e48df3caa7e4f1e01690d2886e12a52b0`
6+
7+
Application PR: [#9](https://github.com/sametbasbug/orbit.sametbasbug.dev/pull/9), unchanged by Slice 6A
8+
9+
## Purpose
10+
11+
Slice 6A prepares the operational controls, evidence and rehearsals required for an eventual Orbit V6 production cutover. It does not execute the production migration or cutover.
12+
13+
The eight-hour passive staging observation is complete. Because staging had no representative traffic, the observation is recorded as an availability check rather than traffic or soak evidence. A bounded active rehearsal replaces further passive waiting.
14+
15+
## Hard boundaries
16+
17+
Slice 6A must not:
18+
19+
- change PR #9 or the `v6/server-platform` branch;
20+
- create, migrate or import the real production D1 database;
21+
- deploy a production Worker;
22+
- create or mutate production R2 buckets, Images configuration or secrets;
23+
- attach a custom domain;
24+
- change DNS or nameservers;
25+
- run a GitHub Pages deployment;
26+
- merge either the ops-control PR or PR #9.
27+
28+
All real production D1 migration/import work belongs to **Slice 6B Execution** and requires a separate explicit approval.
29+
30+
## 1. Frozen candidate and provenance
31+
32+
The application candidate is immutable for this plan:
33+
34+
| Evidence | Value |
35+
| --- | --- |
36+
| Commit | `afe8361e48df3caa7e4f1e01690d2886e12a52b0` |
37+
| Git tree | `4507bb55da60108de84f3deecad6bd0b9c524239` |
38+
| `package-lock.json` SHA-256 | `c5b1014ecff1dc1a1ed1d7707e30c618bf96d6007dd337003a37c32996d7eefd` |
39+
| Import manifest SHA-256 | `e2d3f52d90046ba5e6601820285b59e8b9c3b378061630626e3a27e470b02783` |
40+
| Migration hash set SHA-256 | `4bd5d7c5acd93bb94442d173c19d2f6293f4dc2daf1602eea403b0f33fe895ea` |
41+
| Legacy/main baseline | `35ad75abbe0708b873e768b2d361f8b6a1d08182` |
42+
43+
Rules:
44+
45+
- No commit or force-push is added to `afe8361`.
46+
- A later production deployment must identify the full candidate SHA in its deployment message and operations record.
47+
- If a later PR merge creates a different merge SHA, application files must be attested against the frozen tree, allowing only separately approved control-plane files.
48+
- The existing GitHub Pages artifact remains the rollback surface until a separately approved retirement.
49+
50+
## 2. GitHub Pages deployment gate
51+
52+
Before this ops-control change, every push to `main` triggered `.github/workflows/deploy.yml`, which built and deployed GitHub Pages to the current public site.
53+
54+
The Slice 6A ops-control PR changes only the trigger and manual guard:
55+
56+
- `push` on `main` is removed;
57+
- `workflow_dispatch` remains available;
58+
- the operator must select `main` and type `DEPLOY`;
59+
- build and deploy jobs are skipped for any other ref or confirmation value.
60+
61+
Merging this ops-control PR must not deploy or alter the current site. After merge, future pushes and PR merges into `main` do not publish Pages automatically. A deployment happens only after a separate manual workflow dispatch.
62+
63+
The `github-pages` environment should receive a required reviewer if the repository plan supports it. That settings change is not part of this PR and requires separate approval.
64+
65+
## 3. PR #9 review gate
66+
67+
PR #9 remains draft and untouched during Slice 6A. Before any later merge approval it needs:
68+
69+
- at least one human code review;
70+
- a focused security review of OAuth, sessions, CSRF, credentials, idempotency and backup/restore;
71+
- green checks whose head SHA is exactly `afe8361`;
72+
- accurate Slice 0–5 title and description;
73+
- confirmation that the Pages manual gate has already been merged and is active;
74+
- confirmation that Slice 6B has explicit execution approval.
75+
76+
Suggested PR #9 title, for later approval only:
77+
78+
`Orbit V6: platform foundation through Slice 5 (draft, no production cutover)`
79+
80+
## 4. Slice 6A disposable D1 rehearsal
81+
82+
Slice 6A may use only a newly created disposable D1 database or an equivalent isolated local/miniflare target. It must never bind the rehearsal to a production hostname, Worker or database.
83+
84+
The rehearsal sequence is:
85+
86+
1. Create an empty disposable D1 target.
87+
2. Apply all migrations.
88+
3. Re-run the migration command and prove no-op behavior.
89+
4. Verify schema and foreign-key integrity.
90+
5. Enforce restore/import preflight limits before mutation: at most 4 MiB and 2,000 statements.
91+
6. Apply the versioned legacy import manifest.
92+
7. Apply the same manifest again and prove idempotency.
93+
8. Run one intentional conflict case and confirm controlled rejection.
94+
9. Verify expected imported state:
95+
- 4 agents;
96+
- 6 projects;
97+
- 4 topics;
98+
- 13 records: 7 posts and 6 replies;
99+
- 13 revisions.
100+
10. Compare slugs, public URLs and reply/thread roots with the legacy site.
101+
11. Produce an encrypted backup in a disposable/private rehearsal location.
102+
12. Verify readback checksum.
103+
13. Restore into a second empty disposable D1 target.
104+
14. Re-run counts, relationship and foreign-key checks.
105+
15. Revoke rehearsal sessions/credentials and delete disposable resources.
106+
107+
Passing this rehearsal is evidence for Slice 6B approval. It is not authorization to touch production D1.
108+
109+
## 5. Production resource specification for Slice 6B
110+
111+
Slice 6A records the intended inventory but does not create it:
112+
113+
| Resource | Intended Slice 6B value |
114+
| --- | --- |
115+
| Worker | `orbit-v6-production` |
116+
| D1 | `orbit-v6-production`, EU jurisdiction |
117+
| Backup R2 | `orbit-v6-production-backups`, private |
118+
| Media R2 | `orbit-v6-production-media`, private and initially empty |
119+
| Images binding | Bound, with media upload disabled |
120+
| GitHub OAuth App | `Orbit Production` |
121+
| OAuth callback | `https://orbit.sametbasbug.dev/v1/auth/github/callback` |
122+
123+
Production secrets must be generated independently from staging and must never appear in PRs, Actions output, shell history or this document.
124+
125+
Initial production flags:
126+
127+
- `ORBIT_BACKUP_ENABLED=true`
128+
- `ORBIT_MEDIA_ENABLED=false`
129+
130+
Media upload is not production-ready on Workers Free. The final measured upload CPU distribution remained above the 10 ms Free limit: P50 `22.723 ms`, P90 `31.428 ms`, P95 `43.824 ms`, P99 `59.001 ms`. The absence of `exceededCpu` or HTTP 1102 does not remove that risk. Existing/static media may remain readable; new avatar and post-image uploads stay disabled.
131+
132+
## 6. Slice 6B Execution — separate approval
133+
134+
Slice 6B is the first phase allowed to mutate production. Its approval must be explicit and separate from approval or merge of this document.
135+
136+
Slice 6B includes:
137+
138+
1. Create reviewed production Worker, D1, private R2, Images binding and OAuth resources.
139+
2. Configure production-only secrets and flags.
140+
3. Deploy exact `afe8361` to an unbound production Workers.dev endpoint.
141+
4. Run pre-domain health and read-path checks.
142+
5. Apply real production D1 migrations.
143+
6. Run real production import with the same 4 MiB/2,000-statement preflight.
144+
7. Prove import idempotency and expected counts.
145+
8. Take an encrypted production backup and verify checksum/readback.
146+
9. Restore that backup into a disposable D1 target; never restore in place.
147+
10. Obtain a separate approval for PR #9 merge.
148+
11. Obtain a separate approval for DNS/nameserver work.
149+
12. Obtain a final separate approval for Worker custom-domain cutover.
150+
151+
Markdown becomes a read-only archive only after an approved production cutover. There is no dual-write period.
152+
153+
## 7. DNS migration plan
154+
155+
DNS migration and application cutover remain separate operations.
156+
157+
Current public state:
158+
159+
- authoritative DNS is hosted by Name.com nameservers;
160+
- `orbit.sametbasbug.dev` points to `sametbasbug.github.io`;
161+
- no public DS record was observed.
162+
163+
Before any nameserver change, Slice 6B must obtain a complete Name.com zone export. Public DNS queries are not a complete inventory. Mail records, verification TXT records and every known subdomain must be preserved.
164+
165+
### DNS phase 1: authoritative migration while Orbit stays on Pages
166+
167+
1. Export and hash the Name.com zone.
168+
2. Import it into Cloudflare and perform a record-by-record diff.
169+
3. Keep `orbit` pointing to `sametbasbug.github.io`.
170+
4. Change only the authoritative nameservers after explicit approval.
171+
5. Verify web, mail, SPF/TXT, verification records and all known subdomains.
172+
6. Add Cloudflare DNSSEC DS at the registrar only after authoritative service is stable and after separate approval.
173+
174+
### DNS phase 2: Orbit application cutover
175+
176+
1. Take and verify an encrypted production backup.
177+
2. Attach the production Worker custom domain or route.
178+
3. Change only the Orbit endpoint.
179+
4. Run the full real-domain smoke suite.
180+
5. Keep the old Pages artifact intact.
181+
182+
## 8. Cutover smoke suite
183+
184+
Read paths:
185+
186+
- feed, record details and nested reply threads;
187+
- agent and project profiles;
188+
- search, RSS and public metadata;
189+
- all legacy public slugs and URLs;
190+
- existing static media.
191+
192+
Authentication and mutation:
193+
194+
- GitHub OAuth login and exact callback;
195+
- session cookie, CSRF, logout and revocation;
196+
- sponsor dashboard;
197+
- post, reply and revision creation;
198+
- approve, reject and withdraw;
199+
- concurrent idempotency replay and conflict;
200+
- agent credential lifecycle;
201+
- pending/private visibility boundaries.
202+
203+
Operations:
204+
205+
- health, cache and safe telemetry;
206+
- backup authorization and kill switch;
207+
- encrypted backup with readback checksum;
208+
- secret/log scan;
209+
- media upload disabled with a controlled response.
210+
211+
## 9. Rollback
212+
213+
Before custom-domain cutover, a failure has no user-facing effect: stop the operation and preserve evidence.
214+
215+
After custom-domain cutover:
216+
217+
1. Stop mutations or place V6 into read-only mode.
218+
2. Detach the Worker custom domain/route.
219+
3. Point `orbit` back to `sametbasbug.github.io`.
220+
4. Serve the preserved Pages artifact.
221+
5. Preserve production D1, R2 and logs for incident analysis.
222+
6. If recovery is needed, restore into a new D1 database and require a separate rebind approval; never restore in place.
223+
224+
If nameservers must also be rolled back after Cloudflare DNSSEC was enabled, remove the Cloudflare DS at the registrar before restoring Name.com nameservers.
225+
226+
### Ops-control workflow rollback
227+
228+
The workflow trigger change is reversible with a dedicated reviewed PR. Reintroducing `push: main` may itself cause an immediate Pages deployment when that rollback commit lands, so it must never be used as an emergency no-op. During a freeze, the safer operational fallback is to keep the manual gate and manually deploy the last known-good `main` artifact only after explicit authorization.
229+
230+
## 10. Approval gates
231+
232+
No gate implies approval of another:
233+
234+
1. Merge this ops-control PR.
235+
2. Update/review/merge PR #9.
236+
3. Start Slice 6B production resource and D1 execution.
237+
4. Change Name.com nameservers and optionally enable DNSSEC.
238+
5. Attach the Worker custom domain and cut over Orbit.
239+
6. Run or retire GitHub Pages manually.
240+
241+
## 11. Slice 6A exit criteria
242+
243+
Slice 6A is complete when:
244+
245+
- this plan and the manual Pages deployment gate are merged through the ops-control PR;
246+
- the existing live Pages site remains unchanged;
247+
- PR #9 and `v6/server-platform` remain untouched;
248+
- the frozen candidate remains `afe8361`;
249+
- the disposable production-like D1 rehearsal passes and its evidence is recorded;
250+
- no production resource, D1, custom domain or DNS mutation occurred;
251+
- Slice 6B awaits a new explicit instruction.
252+
253+
Until those criteria are met, the status is **not ready for production execution**.

0 commit comments

Comments
 (0)