Skip to content

Commit 1786573

Browse files
sametbasbugclaude
andcommitted
Retire two staging rehearsals and close the door they left open
The slice2 script started by creating an agent as a sponsor. That endpoint went away on 22 July when agents took ownership of registration, so the script was aimed at an API we deleted, the same shape as the media rehearsal. The slice3 script is a harder case, because it was testing something we do still care about. It asserted the exact first two slugs in the feed, three replies on a record and thirteen imported rows. Those were true in July. Staging is a database that grows, so the script turned red on its own the moment anything else published. Worse, it produced its evidence by breaking live staging rows: marking a record pending and nyx retired, then undoing both in a finally block. A crash in the middle leaves a retired agent behind. A rehearsal that damages what it measures is not one I want running unattended, and there is no version of it that both keeps the assertions honest and stops touching shared state. Both subjects stay covered locally against a fixed manifest. What we give up is proof that they hold over the network, against the real Worker and remote D1 — the ETag/If-Match race most of all. That is written next to the tests that inherited the coverage, not in a commit message nobody will read again. The reason all three of these rotted unnoticed was that nothing ran them. So the config check now walks every staging: script in package.json and requires each one to be either in the nightly job or declared hand-run with the reason it cannot be. Writing a rehearsal and never running it is now a build failure rather than a habit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 1837e38 commit 1786573

7 files changed

Lines changed: 71 additions & 567 deletions

‎.github/workflows/full-regression.yml‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,19 @@ jobs:
9090
ORBIT_SESSION_PEPPER_V1: ${{ secrets.ORBIT_STAGING_SESSION_PEPPER_V1 }}
9191
ORBIT_CSRF_PEPPER_V1: ${{ secrets.ORBIT_STAGING_CSRF_PEPPER_V1 }}
9292
ORBIT_AGENT_CREDENTIAL_PEPPER_V1: ${{ secrets.ORBIT_STAGING_AGENT_CREDENTIAL_PEPPER_V1 }}
93-
# Buraya yalnız yeşil olduğu ölçülmüş provalar giriyor. slice2 ve
94-
# slice3 kasten dışarıda:
93+
# Buraya yalnız yeşil olduğu ölçülmüş provalar giriyor. Bir provayı
94+
# kırmızı hâlde bağlamak, gecelik işi görmezden gelinen bir işe
95+
# çevirir — düzeltmeye çalıştığımız sorunun ta kendisi.
9596
#
96-
# slice2 — sponsorun ajan yaratmasını sınıyor; o uç 22 Temmuz'da
97-
# "Open Orbit to guest agents" ile kaldırıldı, ajanlar artık
98-
# kendileri kaydoluyor. Betik silinmiş bir API'ye bakıyor.
97+
# Bu yüzden slice2 ve slice3 provaları buraya eklenmedi, silindi:
98+
# biri kaldırılmış bir API'ye bakıyordu, diğeri staging büyüdükçe
99+
# kendi kendine bozulan sayılara. Kapsamın nereye düştüğü
100+
# orbit-slice1-tests.ts ve orbit-slice3-tests.ts içinde,
101+
# devraldıkları testin başında yazılı.
99102
#
100-
# slice3 — akışın ilk iki kaydının tam olarak ne olduğunu iddia
101-
# ediyor. Başka bir provanın bıraktığı tek bir yayımlanmış kayıt
102-
# bunu bozuyor, yani her gece kendi kendine kırmızıya döner.
103-
#
104-
# İkisini de kırmızı hâlde bağlamak, gecelik işi görmezden
105-
# gelinen bir işe çevirirdi — düzeltmeye çalıştığımız sorunun ta
106-
# kendisi. Karar verilene kadar elle çalıştırılabilir durumdalar.
103+
# Yeni bir staging betiği eklenirse ya buraya girer ya da elle
104+
# çalışacağı orbit-production-config-tests.mjs'de açıkça beyan
105+
# edilir; kilit ikisini de yapmadan geçmiyor.
107106
run: |
108107
npm run staging:verify
109108
npm run staging:slice4:e2e

‎package.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
"d1:migrate:staging": "wrangler d1 migrations apply DB --remote --config wrangler.staging.jsonc",
2929
"staging:deploy": "ORBIT_SITE_URL=https://orbit-v6-staging.samett33710.workers.dev ORBIT_NOINDEX=true astro build --config astro.worker.config.mjs && node scripts/orbit-staging-assets.mjs && wrangler deploy --config wrangler.staging.jsonc --message 'Orbit V6 staging gate'",
3030
"staging:verify": "node scripts/orbit-staging-verify.mjs",
31-
"staging:slice2:e2e": "tsx scripts/orbit-slice2-staging-e2e.ts",
32-
"staging:slice3:e2e": "tsx scripts/orbit-slice3-staging-e2e.ts",
3331
"staging:slice3:cutover-rehearsal": "tsx scripts/orbit-slice3-cutover-rehearsal.ts",
3432
"staging:slice4:e2e": "tsx scripts/orbit-slice4-staging-e2e.ts",
3533
"staging:slice4:backup-rehearsal": "tsx scripts/orbit-slice4-backup-rehearsal.ts",

‎scripts/orbit-production-config-tests.mjs‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,23 @@ const files = {
77
staging: new URL('../wrangler.staging.jsonc', import.meta.url),
88
deployWorkflow: new URL('../.github/workflows/deploy-production.yml', import.meta.url),
99
fullRegressionWorkflow: new URL('../.github/workflows/full-regression.yml', import.meta.url),
10+
packageJson: new URL('../package.json', import.meta.url),
1011
};
1112

13+
/* Elle çalıştırılacağı bilerek kabul edilmiş staging betikleri. Buraya
14+
* girmek bir beyandır: "bu iş gecelik koşamaz, çünkü ya dağıtım yapar ya
15+
* da ücretli/yıkıcı bir kaynağa dokunur." Aşağıdaki kilit, listede de
16+
* gecelik işte de olmayan bir staging betiğini hata sayar — bir prova
17+
* yazılıp hiç çalıştırılmadan üç hafta bozuk kalmasının önündeki tek
18+
* engel bu. */
19+
const HAND_RUN_STAGING_SCRIPTS = new Set([
20+
'staging:deploy', // staging'e yeni kod basar; kapıyı Samet açar
21+
'staging:slice3:cutover-rehearsal', // veritabanı kopyalayıp geri yükler
22+
'staging:slice4:backup-rehearsal', // yedek alıp geri yükler
23+
'staging:slice5:r2-restore', // R2 kovasına yazar
24+
'staging:slice5:images-cpu', // Cloudflare Images kotası harcar
25+
]);
26+
1227
let assertions = 0;
1328

1429
function fail(message) {
@@ -339,6 +354,26 @@ for (const script of ['staging:verify', 'staging:slice4:e2e']) {
339354
`nightly staging rehearsal dropped ${script}`,
340355
);
341356
}
357+
/* Her staging betiği ya gecelik işte koşar ya da elle koşacağı yukarıda
358+
* beyan edilmiştir. Üçüncü bir hâl — yazılmış ama kimsenin çalıştırmadığı
359+
* betik — bize üç haftalık bir körlüğe mal oldu. */
360+
const stagingScripts = Object.keys(
361+
JSON.parse(await readFile(files.packageJson, 'utf8')).scripts,
362+
).filter((name) => name.startsWith('staging:'));
363+
assert(stagingScripts.length > 0, 'package.json declares no staging script at all');
364+
for (const script of stagingScripts) {
365+
assert(
366+
fullRegressionWorkflow.includes(`npm run ${script}`) || HAND_RUN_STAGING_SCRIPTS.has(script),
367+
`${script} runs nowhere: add it to the nightly rehearsal, `
368+
+ 'or declare it in HAND_RUN_STAGING_SCRIPTS with the reason it cannot',
369+
);
370+
}
371+
for (const script of HAND_RUN_STAGING_SCRIPTS) {
372+
assert(
373+
stagingScripts.includes(script),
374+
`HAND_RUN_STAGING_SCRIPTS still lists ${script}, which package.json no longer defines`,
375+
);
376+
}
342377
/* Eksik secret'ın hatası provanın hatasına benzemesin: ayırt edilemeyen
343378
* bir kırmızı, görmezden gelinen bir kırmızıya dönüşür. */
344379
assert(

‎scripts/orbit-slice1-tests.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,6 +1760,14 @@ let firstCredentialToken = '';
17601760
}
17611761
});
17621762

1763+
/* Kimlik bilgisi yaşam döngüsünün tek kapsamı bu ve altındaki iki test.
1764+
* Eskiden bir de staging provası vardı; sponsorun POST /v1/agents ile
1765+
* ajan yaratmasıyla başlıyordu ve o uç 22 Temmuz'da "Open Orbit to guest
1766+
* agents" ile kaldırıldı — ajanlar artık kendileri kaydoluyor. Prova
1767+
* silinmiş bir API'ye bakıyordu, kırık değildi; hedefi yoktu.
1768+
* Vazgeçtiğimiz şey: bunların gerçek Worker ve uzak D1 üzerinde de
1769+
* çalıştığının kanıtı. O boşluk açılırsa staging'de değil, canlıda
1770+
* görünür. */
17631771
test('credential issue, stale rotation, atomic replacement and immediate revoke preserve one-active invariant', async () => {
17641772
const stale = await postJson(`/v1/agents/${sponsoredAgentId}/credentials/registration-code`, {
17651773
expectedCredentialId: 'stale-credential',

0 commit comments

Comments
 (0)