@bongos/core 1.19.657 → 1.19.658
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.bongos-core.json +24 -24
- package/docs/adr/0182-project-visibility-two-axes.md +9 -1
- package/docs/module-api-changelog.md +2 -0
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/scripts/gds/fitness-checks-vocabulary.js +75 -0
- package/scripts/gds/fitness.js +3 -3
- package/src/bongos/platform-visibility-gate.js +7 -4
- package/src/bongos/{stealth-gate.js → prelaunch-gate.js} +71 -12
- package/src/bongos/serve-internal.js +4 -4
- package/src/module-api.js +1 -1
- package/tests/{stealth_gate.mjs → prelaunch_gate.mjs} +139 -10
package/.bongos-core.json
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"artifact": "bongos-core",
|
|
3
3
|
"manifest_schema": 1,
|
|
4
4
|
"generator": "scripts/gds/package-core.js",
|
|
5
|
-
"core_version": "1.19.
|
|
6
|
-
"core_contract": "1.19.
|
|
7
|
-
"source_commit": "
|
|
5
|
+
"core_version": "1.19.658",
|
|
6
|
+
"core_contract": "1.19.658",
|
|
7
|
+
"source_commit": "116ba7cf659c5768b1e7ce2196e38becb98d2654",
|
|
8
8
|
"source_ref": "HEAD",
|
|
9
|
-
"built_at": "2026-09-11T00:
|
|
9
|
+
"built_at": "2026-09-11T00:39:52.368Z",
|
|
10
10
|
"redaction": {
|
|
11
11
|
"model": "docs-redacted+functional-verbatim",
|
|
12
12
|
"docs_redacted": 472,
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"gate": "passed"
|
|
18
18
|
},
|
|
19
19
|
"file_count": 2608,
|
|
20
|
-
"tree_sha256": "
|
|
20
|
+
"tree_sha256": "c480f8fa183ff4de3cbfefdfe804fe219ab875a0c873e4d9dc8ed1322652e3ae",
|
|
21
21
|
"files": [
|
|
22
22
|
{
|
|
23
23
|
"path": ".claude/skills/backlog-review/SKILL.md",
|
|
@@ -1407,7 +1407,7 @@
|
|
|
1407
1407
|
{
|
|
1408
1408
|
"path": "docs/adr/0182-project-visibility-two-axes.md",
|
|
1409
1409
|
"mode": "0000644",
|
|
1410
|
-
"sha256": "
|
|
1410
|
+
"sha256": "5c81ca2fe6d92058039999c0d5e38b67cfdaa795ba227e341b2339bbf20815d5"
|
|
1411
1411
|
},
|
|
1412
1412
|
{
|
|
1413
1413
|
"path": "docs/adr/0183-criteria-close-themselves.md",
|
|
@@ -2782,7 +2782,7 @@
|
|
|
2782
2782
|
{
|
|
2783
2783
|
"path": "docs/module-api-changelog.md",
|
|
2784
2784
|
"mode": "0000644",
|
|
2785
|
-
"sha256": "
|
|
2785
|
+
"sha256": "08320e0ddfd04ab34b258eb3c6e2c4700c5cc209d76efb8becf7c9f65149678b"
|
|
2786
2786
|
},
|
|
2787
2787
|
{
|
|
2788
2788
|
"path": "docs/modules-contract.md",
|
|
@@ -7747,12 +7747,12 @@
|
|
|
7747
7747
|
{
|
|
7748
7748
|
"path": "package-lock.json",
|
|
7749
7749
|
"mode": "0000644",
|
|
7750
|
-
"sha256": "
|
|
7750
|
+
"sha256": "b64a9a59bb6257652b417c5a8c52b901d02915ae5d565b728e29b01f73ee5b01"
|
|
7751
7751
|
},
|
|
7752
7752
|
{
|
|
7753
7753
|
"path": "package.json",
|
|
7754
7754
|
"mode": "0000644",
|
|
7755
|
-
"sha256": "
|
|
7755
|
+
"sha256": "0c28879af088fa3615bb534b1d545e909d712b2c5676e5f4a6140410c43b21e2"
|
|
7756
7756
|
},
|
|
7757
7757
|
{
|
|
7758
7758
|
"path": "public-docs/index.html",
|
|
@@ -8192,7 +8192,7 @@
|
|
|
8192
8192
|
{
|
|
8193
8193
|
"path": "scripts/gds/fitness-checks-vocabulary.js",
|
|
8194
8194
|
"mode": "0000644",
|
|
8195
|
-
"sha256": "
|
|
8195
|
+
"sha256": "ff21b52ecfe355ce19d7bf576880dfe1b561ffe33664a9a6ec06ccc704425f1d"
|
|
8196
8196
|
},
|
|
8197
8197
|
{
|
|
8198
8198
|
"path": "scripts/gds/fitness-checks-write-validation.js",
|
|
@@ -8212,7 +8212,7 @@
|
|
|
8212
8212
|
{
|
|
8213
8213
|
"path": "scripts/gds/fitness.js",
|
|
8214
8214
|
"mode": "0000644",
|
|
8215
|
-
"sha256": "
|
|
8215
|
+
"sha256": "d6120a5427f9053529639cf15a59bad0afae9602d5a1e8301017f3321493038b"
|
|
8216
8216
|
},
|
|
8217
8217
|
{
|
|
8218
8218
|
"path": "scripts/gds/gate-review.js",
|
|
@@ -9342,13 +9342,18 @@
|
|
|
9342
9342
|
{
|
|
9343
9343
|
"path": "src/bongos/platform-visibility-gate.js",
|
|
9344
9344
|
"mode": "0000644",
|
|
9345
|
-
"sha256": "
|
|
9345
|
+
"sha256": "eea15ebe44e9450f2d62040c239828008e8953ea5ee465085d5f0e8e63fe6233"
|
|
9346
9346
|
},
|
|
9347
9347
|
{
|
|
9348
9348
|
"path": "src/bongos/pool.js",
|
|
9349
9349
|
"mode": "0000644",
|
|
9350
9350
|
"sha256": "c9edcf9cb1f027ca122388beabae488d2b771b9e7aee2cd12fbdb48ea6f0ded8"
|
|
9351
9351
|
},
|
|
9352
|
+
{
|
|
9353
|
+
"path": "src/bongos/prelaunch-gate.js",
|
|
9354
|
+
"mode": "0000644",
|
|
9355
|
+
"sha256": "16da458f537d9eaf55675fab8aab71f537882c1630baa02d2795f32f6a52454e"
|
|
9356
|
+
},
|
|
9352
9357
|
{
|
|
9353
9358
|
"path": "src/bongos/project-door.js",
|
|
9354
9359
|
"mode": "0000644",
|
|
@@ -9472,12 +9477,7 @@
|
|
|
9472
9477
|
{
|
|
9473
9478
|
"path": "src/bongos/serve-internal.js",
|
|
9474
9479
|
"mode": "0000644",
|
|
9475
|
-
"sha256": "
|
|
9476
|
-
},
|
|
9477
|
-
{
|
|
9478
|
-
"path": "src/bongos/stealth-gate.js",
|
|
9479
|
-
"mode": "0000644",
|
|
9480
|
-
"sha256": "3f105bd9c578d320a5b88cf4cebb69c63c16f7b7f81dbeb554a78d00461ca97c"
|
|
9480
|
+
"sha256": "b388de4de8993892d26a1a456eda30deb87a95cf4f64e262cb6541e04495c43d"
|
|
9481
9481
|
},
|
|
9482
9482
|
{
|
|
9483
9483
|
"path": "src/bongos/uptime-poller.js",
|
|
@@ -9507,7 +9507,7 @@
|
|
|
9507
9507
|
{
|
|
9508
9508
|
"path": "src/module-api.js",
|
|
9509
9509
|
"mode": "0000644",
|
|
9510
|
-
"sha256": "
|
|
9510
|
+
"sha256": "25384d0eebd630303512971574f4bbdfa1aebc9680705bff64a34c6dc6e1b4d5"
|
|
9511
9511
|
},
|
|
9512
9512
|
{
|
|
9513
9513
|
"path": "src/module-loader/catalog.js",
|
|
@@ -11874,6 +11874,11 @@
|
|
|
11874
11874
|
"mode": "0000644",
|
|
11875
11875
|
"sha256": "9f16091a8feeaef9e4350104dbc9671fab6f2b53f99fd82f798c77800e780b61"
|
|
11876
11876
|
},
|
|
11877
|
+
{
|
|
11878
|
+
"path": "tests/prelaunch_gate.mjs",
|
|
11879
|
+
"mode": "0000644",
|
|
11880
|
+
"sha256": "53bdf7b9e0f09b4abab2c83ed77d48bd4ecd29f2b82afecc78dd694d5b36bc9f"
|
|
11881
|
+
},
|
|
11877
11882
|
{
|
|
11878
11883
|
"path": "tests/preview_server.mjs",
|
|
11879
11884
|
"mode": "0000644",
|
|
@@ -12734,11 +12739,6 @@
|
|
|
12734
12739
|
"mode": "0000644",
|
|
12735
12740
|
"sha256": "aa1d79bb3f900097a911c8c6b3055debe4bb20bfe2c3d6c8c64cfd8d7688824e"
|
|
12736
12741
|
},
|
|
12737
|
-
{
|
|
12738
|
-
"path": "tests/stealth_gate.mjs",
|
|
12739
|
-
"mode": "0000644",
|
|
12740
|
-
"sha256": "bb264253e2a9c233734cf9273928db203f8f441c4e7a53f5f9ae5ea0477e20e3"
|
|
12741
|
-
},
|
|
12742
12742
|
{
|
|
12743
12743
|
"path": "tests/stop_refcheck.mjs",
|
|
12744
12744
|
"mode": "0000644",
|
|
@@ -150,7 +150,15 @@ Stealth's distinction from private is **at the door, not in the queue**: a refus
|
|
|
150
150
|
|
|
151
151
|
**Decision:** the *product* meaning (the owner-facing state, whose orb metaphor is locked by the criterion) keeps the word. The infra gate is the one that should be renamed — to `prelaunch` — but that touches a protected path, an env var, and a live instance's configuration, so it is **not** decided here by an ADR about visibility. It is filed as its own task with the owner's call attached.
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
**RESOLVED — the rename was taken** (owner, 2026-09-09 backlog review of goal [#1000111](https://cloudbongos.com/builders#/goal/1000111); executed by task [#1003152](https://cloudbongos.com/builders#/task/1003152)). This paragraph is kept rather than rewritten, because the open question is part of the record: what follows is what the rename actually did, not what it promised.
|
|
154
|
+
|
|
155
|
+
- `src/bongos/stealth-gate.js` → **`src/bongos/prelaunch-gate.js`**; `stealthGate()` → `prelaunchGate()`. The ~16 files carrying the PRODUCT sense are untouched, exactly as this decision says they must be.
|
|
156
|
+
- **`PRELAUNCH_PASSWORD` is primary; `STEALTH_PASSWORD` is honoured as a deprecated alias**, with a one-time startup warning when only the old name is set. The env is read in exactly one place, so honouring both is a single expression — and it had to be: `STEALTH_PASSWORD` is set on live today, and a rename that did not read it would be an instant, total outage of the instance. Dropping the alias is a separate, later task, and must not run until the live instance has `PRELAUNCH_PASSWORD` set.
|
|
157
|
+
- The submit path is **`/__prelaunch`**, with `/__stealth` still accepted and still exempt, so a form already open when the rename deployed still works.
|
|
158
|
+
- **Three identifiers deliberately did NOT move** — the cookie `cb_stealth`, the HMAC label `stealth-v1`, and the legacy path above. The first two are keyed into live cookies: <redacted> either forces every holder to re-enter the password and buys nothing, because neither string is ever read by a human. One is wire format, the other an HMAC message; neither is vocabulary.
|
|
159
|
+
- A fitness check in the ADR 0174 family (**check 19d**, `checkPrelaunchVocabulary`) now keeps the word from drifting back into the infra surface, scoped so the product surface's legitimate `stealth` never trips it. Per ADR 0174's own lesson it carries mutation tests: plant a violation, prove the build reds.
|
|
160
|
+
|
|
161
|
+
The last sentence of this decision is therefore now spent — `stealth` unqualified means the project state, and the infra gate says `prelaunch` in its identifiers as well as in prose.
|
|
154
162
|
|
|
155
163
|
## Consequences
|
|
156
164
|
|
|
@@ -1763,5 +1763,7 @@ is load-bearing: the script throws rather than guess if it is missing, and
|
|
|
1763
1763
|
landed since 1.19.655 with no explicit bump. run 34546461767. (task 1002620)
|
|
1764
1764
|
1.19.657 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
|
|
1765
1765
|
landed since 1.19.656 with no explicit bump. run 34546894776. (task 1002620)
|
|
1766
|
+
1.19.658 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
|
|
1767
|
+
landed since 1.19.657 with no explicit bump. run 34547406494. (task 1002620)
|
|
1766
1768
|
---------------------------------------------------------------------------
|
|
1767
1769
|
```
|
package/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bongos/core",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.658",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@bongos/core",
|
|
9
|
-
"version": "1.19.
|
|
9
|
+
"version": "1.19.658",
|
|
10
10
|
"license": "AGPL-3.0-or-later",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"express": "^4.21.2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bongos/core",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.658",
|
|
4
4
|
"description": "Cloud Bongos — the AI-first build platform core (GDS + platform surfaces + module system), installed as a versioned dependency (ADR 0108).",
|
|
5
5
|
"license": "AGPL-3.0-or-later",
|
|
6
6
|
"main": "src/platform-server.js",
|
|
@@ -298,11 +298,85 @@ function checkGovernmentRenameIdentity() {
|
|
|
298
298
|
}
|
|
299
299
|
|
|
300
300
|
|
|
301
|
+
// ── Check 19d — "stealth" is the PRODUCT's word, not the gate's (task 1003152) ─
|
|
302
|
+
//
|
|
303
|
+
// The third vocabulary wall, and the same defect as ADR 0174's "role": one word,
|
|
304
|
+
// two live meanings, close to OPPOSITE. `platform_identity_projects.visibility =
|
|
305
|
+
// 'stealth'` is a project that IS on the public orbs map — anonymous, rendered as
|
|
306
|
+
// a black hole, refusing applications, but published and visible; only its
|
|
307
|
+
// identity is withheld. The pre-launch gate is the reverse: the whole instance is
|
|
308
|
+
// UNREADABLE without a password. ADR 0182 locks the product sense to the orb
|
|
309
|
+
// metaphor via goal 1000046's own criterion, so the PRODUCT keeps the word and
|
|
310
|
+
// the INFRA half renamed (owner decision, 2026-09-09).
|
|
311
|
+
//
|
|
312
|
+
// SCOPED TO THE INFRA SURFACE, for the same reason check 19 is scoped to the
|
|
313
|
+
// government surface: ~16 files carry the product sense legitimately, and a
|
|
314
|
+
// repo-wide ban would have to allowlist every one of them — an allowlist longer
|
|
315
|
+
// than the rule. The honest unit is a SURFACE.
|
|
316
|
+
//
|
|
317
|
+
// NO ALLOWLIST. Two exemptions, both properties of a line rather than a file:
|
|
318
|
+
// a line naming one of the four documented COMPATIBILITY identifiers (the live
|
|
319
|
+
// cookie, the HMAC label, the legacy submit path, the deprecated env var — see
|
|
320
|
+
// prelaunch-gate.js's header for why each stayed), and a line CITING the rename
|
|
321
|
+
// or the other meaning. Everything else is drift.
|
|
322
|
+
// tests/prelaunch_gate.mjs is deliberately NOT here, the same way check 19's
|
|
323
|
+
// mutation test sits outside the government surface: that file's job includes
|
|
324
|
+
// PLANTING the banned word to prove the rule can fail, and a wall that forbids
|
|
325
|
+
// its own negative test can only be satisfied by deleting the evidence.
|
|
326
|
+
const PRELAUNCH_SURFACE = [
|
|
327
|
+
'src/bongos/prelaunch-gate.js',
|
|
328
|
+
'src/bongos/platform-visibility-gate.js',
|
|
329
|
+
];
|
|
330
|
+
// serve-internal.js is 1,500+ lines and mounts every surface on the instance;
|
|
331
|
+
// scanning it whole would drag in prose about the product's visibility. The
|
|
332
|
+
// lines that name the GATE are the only ones that can regress here.
|
|
333
|
+
const PRELAUNCH_LINE_SCOPED = [
|
|
334
|
+
{ file: 'src/bongos/serve-internal.js', mustMention: /prelaunch|PRE-LAUNCH/i },
|
|
335
|
+
];
|
|
336
|
+
const PRELAUNCH_COMPAT = /cb_stealth|stealth-v1|__stealth|STEALTH_PASSWORD/;
|
|
337
|
+
const PRELAUNCH_CITATION = /task 1003152|ADR 0182|stealth-gate\.js|platform_identity_projects/;
|
|
338
|
+
|
|
339
|
+
function checkPrelaunchVocabulary() {
|
|
340
|
+
const violations = [];
|
|
341
|
+
let scanned = 0;
|
|
342
|
+
const scanFile = (rel, lineFilter = null) => {
|
|
343
|
+
const abs = path.join(CORE_ROOT, rel);
|
|
344
|
+
let src;
|
|
345
|
+
try { src = fs.readFileSync(abs, 'utf8'); } catch { return; }
|
|
346
|
+
scanned += 1;
|
|
347
|
+
src.split('\n').forEach((line, i) => {
|
|
348
|
+
if (lineFilter && !lineFilter.test(line)) return;
|
|
349
|
+
if (!/stealth/i.test(line)) return;
|
|
350
|
+
if (PRELAUNCH_COMPAT.test(line)) return;
|
|
351
|
+
if (PRELAUNCH_CITATION.test(line)) return;
|
|
352
|
+
violations.push(`${rel}:${i + 1}: "stealth" — on the pre-launch surface the word is PRELAUNCH. `
|
|
353
|
+
+ '"stealth" belongs to the PRODUCT\'s visibility axis (ADR 0182), which means almost the opposite.'
|
|
354
|
+
+ ` → ${line.trim().slice(0, 90)}`);
|
|
355
|
+
});
|
|
356
|
+
};
|
|
357
|
+
for (const rel of PRELAUNCH_SURFACE) scanFile(rel);
|
|
358
|
+
for (const { file, mustMention } of PRELAUNCH_LINE_SCOPED) scanFile(file, mustMention);
|
|
359
|
+
return {
|
|
360
|
+
name: 'the pre-launch gate is PRELAUNCH; "stealth" is the product\'s word (task 1003152)',
|
|
361
|
+
ok: violations.length === 0,
|
|
362
|
+
hardFail: violations.length > 0,
|
|
363
|
+
violations,
|
|
364
|
+
warnings: [],
|
|
365
|
+
note: `${scanned} pre-launch-surface file(s) scanned (${PRELAUNCH_SURFACE.length} whole plus `
|
|
366
|
+
+ `${PRELAUNCH_LINE_SCOPED.length} line-scoped to the lines naming the gate); no allowlist — `
|
|
367
|
+
+ 'a documented compatibility identifier or a line CITING the rename are the only exemptions.',
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
|
|
301
371
|
module.exports = {
|
|
302
372
|
GOAL_VOCAB_CITATION,
|
|
303
373
|
GOAL_VOCAB_LINE_SCOPED,
|
|
304
374
|
GOAL_VOCAB_SURFACE,
|
|
305
375
|
LIFECYCLE_DB_FILES,
|
|
376
|
+
PRELAUNCH_CITATION,
|
|
377
|
+
PRELAUNCH_COMPAT,
|
|
378
|
+
PRELAUNCH_LINE_SCOPED,
|
|
379
|
+
PRELAUNCH_SURFACE,
|
|
306
380
|
RENAME_IDENTITY_RE,
|
|
307
381
|
VOCAB_ALLOW,
|
|
308
382
|
VOCAB_BANNED,
|
|
@@ -312,6 +386,7 @@ module.exports = {
|
|
|
312
386
|
VOCAB_SURFACE,
|
|
313
387
|
checkGoalMembershipVocabulary,
|
|
314
388
|
checkGovernmentRenameIdentity,
|
|
389
|
+
checkPrelaunchVocabulary,
|
|
315
390
|
checkVocabularyWall,
|
|
316
391
|
vocabFilesToScan,
|
|
317
392
|
};
|
package/scripts/gds/fitness.js
CHANGED
|
@@ -36,7 +36,7 @@ const { resolveCoreRoot, resolveInstanceRoot } = require('../../src/instance-con
|
|
|
36
36
|
const { CORE_ROOT, INSTANCE_ROOT, MODULE_ROOTS, REPO_ROOT, rel, walkJs, walkJsAllRoots } = require('./fitness-lib.js');
|
|
37
37
|
const { IDENTITY_SCAN_ALLOWED, IDENTITY_SCAN_EXCLUDE, IDENTITY_SCAN_EXTRA_FILES, IDENTITY_SCAN_EXTS, IDENTITY_SCAN_ROOTS, IDENTITY_SCAN_SKIP_DIRS, PROMPT_IDENTITY_LITERALS, checkDesignContract, checkKernelPromptsNoHardcodedIdentity, checkNeutralConfigsNoHostIdentity, collectIdentityFiles, scanPromptIdentity, stripCommentsForIdentity } = require('./fitness-checks-identity.js');
|
|
38
38
|
const { WRITE_VALIDATION_BASELINE, WRITE_VALIDATION_EXEMPT, checkWriteRoutesValidated, scanUnvalidatedWriteRoutes } = require('./fitness-checks-write-validation.js');
|
|
39
|
-
const { GOAL_VOCAB_CITATION, GOAL_VOCAB_LINE_SCOPED, GOAL_VOCAB_SURFACE, LIFECYCLE_DB_FILES, RENAME_IDENTITY_RE, VOCAB_ALLOW, VOCAB_BANNED, VOCAB_CITATION, VOCAB_EXTS, VOCAB_HISTORICAL_REF, VOCAB_SURFACE, checkGoalMembershipVocabulary, checkGovernmentRenameIdentity, checkVocabularyWall, vocabFilesToScan } = require('./fitness-checks-vocabulary.js');
|
|
39
|
+
const { GOAL_VOCAB_CITATION, GOAL_VOCAB_LINE_SCOPED, GOAL_VOCAB_SURFACE, LIFECYCLE_DB_FILES, PRELAUNCH_SURFACE, RENAME_IDENTITY_RE, VOCAB_ALLOW, VOCAB_BANNED, VOCAB_CITATION, VOCAB_EXTS, VOCAB_HISTORICAL_REF, VOCAB_SURFACE, checkGoalMembershipVocabulary, checkGovernmentRenameIdentity, checkPrelaunchVocabulary, checkVocabularyWall, vocabFilesToScan } = require('./fitness-checks-vocabulary.js');
|
|
40
40
|
// ============================================================================
|
|
41
41
|
// Check 1 — core ↔ host/game import boundary (ADR 0062 §1 cut-line)
|
|
42
42
|
// ============================================================================
|
|
@@ -1374,7 +1374,7 @@ const CHECKS = [
|
|
|
1374
1374
|
checkErrorEnvelope, // Check 17 — BV1 R03 / task 1990: no route hand-rolls a flat error (ADR 0116)
|
|
1375
1375
|
checkVocabularyWall, // Check 19 — ADR 0174 / goal 1000068 R07: "role" is a craft, never a rank
|
|
1376
1376
|
checkGoalMembershipVocabulary, // Check 19b — ADR 0177 / task 1003013: the FOURTH "role" (goal membership)
|
|
1377
|
-
checkGovernmentRenameIdentity, //
|
|
1377
|
+
checkGovernmentRenameIdentity, checkPrelaunchVocabulary, // 19c task 1003120 (`X`→`X` rename arrow) + 19d task 1003152 ("stealth" is the product's word) — sharing a line: this file is AT the 1,500 budget (Check 23/24 precedent below; task 1003825 buys it back)
|
|
1378
1378
|
checkWriteRoutesValidated, // Check 18 — BV1 R12 / task 1999: every body-reading write route validates (ADR 0118)
|
|
1379
1379
|
require('./fitness-ratchets.js').checkQualityRatchets, // Check 20 — task 1003129: quality budgets only tighten (mechanics + knip CI step live in fitness-ratchets.js)
|
|
1380
1380
|
require('./doc-cli-guard.js').checkDocNamesRealCli, // Check 22 — task 1003165 / G01: a doc that names a CLI invocation must match the real CLI
|
|
@@ -1436,7 +1436,7 @@ if (require.main === module) main();
|
|
|
1436
1436
|
|
|
1437
1437
|
module.exports = {
|
|
1438
1438
|
checkVocabularyWall, VOCAB_ALLOW, VOCAB_CITATION, VOCAB_EXTS, vocabFilesToScan,
|
|
1439
|
-
checkGoalMembershipVocabulary, GOAL_VOCAB_SURFACE, checkGovernmentRenameIdentity, RENAME_IDENTITY_RE, // 19c
|
|
1439
|
+
checkGoalMembershipVocabulary, GOAL_VOCAB_SURFACE, checkGovernmentRenameIdentity, RENAME_IDENTITY_RE, checkPrelaunchVocabulary, PRELAUNCH_SURFACE, // 19c task 1003120, 19d task 1003152
|
|
1440
1440
|
runAll,
|
|
1441
1441
|
resolvesToHostGame,
|
|
1442
1442
|
checkCoreHostBoundary,
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
// - What a member is shown must not be cached for a stranger: a passed
|
|
25
25
|
// response leaves marked private, whatever the route behind it said.
|
|
26
26
|
//
|
|
27
|
-
// It is NOT the pre-launch gate (
|
|
28
|
-
// password for an unannounced instance, inert unless
|
|
27
|
+
// It is NOT the pre-launch gate (prelaunch-gate.js): that one is a shared
|
|
28
|
+
// password for an unannounced instance, inert unless PRELAUNCH_PASSWORD is set,
|
|
29
29
|
// and it mounts first. This one is a per-project policy with accounts behind it.
|
|
30
30
|
// Both can be on at once; each refuses on its own terms.
|
|
31
31
|
|
|
@@ -67,7 +67,9 @@ const API = `(?:${ALL_API_PREFIXES.map(escRe).join('|')})`;
|
|
|
67
67
|
// /downloads/* the installer script and the Dev Box updater — a
|
|
68
68
|
// cookie-less `curl … | sh`, and release redirects carry
|
|
69
69
|
// no project data.
|
|
70
|
-
// /
|
|
70
|
+
// /__prelaunch the pre-launch gate's own submit, when both gates are on.
|
|
71
|
+
// /__stealth is its pre-rename alias (task 1003152) and is
|
|
72
|
+
// exempt for as long as the gate still accepts it.
|
|
71
73
|
const EXEMPT = [
|
|
72
74
|
new RegExp(`^${API}/auth(/|$)`),
|
|
73
75
|
new RegExp(`^${API}/instance$`),
|
|
@@ -76,6 +78,7 @@ const EXEMPT = [
|
|
|
76
78
|
/^\/healthz$/,
|
|
77
79
|
/^\/version$/,
|
|
78
80
|
/^\/metrics$/,
|
|
81
|
+
/^\/__prelaunch$/,
|
|
79
82
|
/^\/__stealth$/,
|
|
80
83
|
/^\/downloads\//,
|
|
81
84
|
];
|
|
@@ -127,7 +130,7 @@ function signInHref(req) {
|
|
|
127
130
|
}
|
|
128
131
|
|
|
129
132
|
// One leading slash, no '//' (protocol-relative), no backslash, no control
|
|
130
|
-
// bytes — the
|
|
133
|
+
// bytes — the pre-launch gate's rule; anything else returns to '/'.
|
|
131
134
|
function relativeReturn(raw) {
|
|
132
135
|
if (typeof raw !== 'string' || !raw.length || raw.length > 512) return null;
|
|
133
136
|
if (!raw.startsWith('/') || raw.startsWith('//') || raw.includes('\\')) return null;
|
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
// src/bongos/
|
|
1
|
+
// src/bongos/prelaunch-gate.js — the instance PRE-LAUNCH gate (task 1002775).
|
|
2
|
+
//
|
|
3
|
+
// ── THE NAME (task 1003152, owner decision 2026-09-09; ADR 0182 Decision 7) ──
|
|
4
|
+
//
|
|
5
|
+
// This was `stealth-gate.js` and it collided head-on with the OTHER live meaning
|
|
6
|
+
// of the word. `platform_identity_projects.visibility = 'stealth'` is a project
|
|
7
|
+
// that IS on the public orbs map — rendered as a black hole, anonymous, refusing
|
|
8
|
+
// applications, but published and visible; only its identity is withheld. This
|
|
9
|
+
// gate is close to the opposite: the whole instance is UNREADABLE without the
|
|
10
|
+
// password. Same class of defect as ADR 0174's "role", which is why the rename
|
|
11
|
+
// lives in the government goal.
|
|
12
|
+
//
|
|
13
|
+
// The PRODUCT meaning keeps the word — ADR 0182 locks it to the orb metaphor via
|
|
14
|
+
// goal 1000046's own criterion, and the ~16 files carrying that sense are
|
|
15
|
+
// deliberately untouched. Renaming those would have been the actual mistake.
|
|
16
|
+
//
|
|
17
|
+
// THREE IDENTIFIERS DID NOT MOVE, and each one is a deliberate choice, not a
|
|
18
|
+
// missed occurrence (the vocabulary check below knows them by name):
|
|
19
|
+
//
|
|
20
|
+
// • the cookie `cb_stealth` and the HMAC label `stealth-v1` — both are keyed
|
|
21
|
+
// INTO live cookies. Renaming either invalidates every outstanding cookie on
|
|
22
|
+
// a running instance and forces every holder to re-enter the password, to
|
|
23
|
+
// buy nothing: neither string is ever read by a human. The cookie name is
|
|
24
|
+
// wire format and the label is an HMAC message, not vocabulary.
|
|
25
|
+
// • `/__stealth` — the submit path. `/__prelaunch` is what the form posts to
|
|
26
|
+
// now; the old path is still accepted and still exempt, so a form already
|
|
27
|
+
// open in somebody's tab when this deploys still works instead of 401ing
|
|
28
|
+
// them back to the start.
|
|
2
29
|
//
|
|
3
30
|
// An instance that is built but not announced needs a door that is shut without
|
|
4
31
|
// being broken. The proxy can do that with basic_auth, and task 1002774 did
|
|
@@ -11,8 +38,11 @@
|
|
|
11
38
|
// So the gate lives in the app, where it can set a cookie the browser will send
|
|
12
39
|
// to every subdomain:
|
|
13
40
|
//
|
|
14
|
-
// - It is INERT unless
|
|
15
|
-
// a vanilla instance has no gate and needs no config to not have
|
|
41
|
+
// - It is INERT unless PRELAUNCH_PASSWORD is set. That is the portable
|
|
42
|
+
// default: a vanilla instance has no gate and needs no config to not have
|
|
43
|
+
// one. STEALTH_PASSWORD is honoured as a deprecated alias — it is SET ON
|
|
44
|
+
// LIVE today, and a rename that did not read the old name would be an
|
|
45
|
+
// instant outage.
|
|
16
46
|
// - The cookie is a SESSION cookie — no Max-Age, no Expires — because the
|
|
17
47
|
// owner explicitly did not want it to outlive the browser. That is also the
|
|
18
48
|
// safer default: nothing is written to disk to be found later.
|
|
@@ -35,8 +65,15 @@
|
|
|
35
65
|
const crypto = require('node:crypto');
|
|
36
66
|
const { branding } = require('../branding');
|
|
37
67
|
|
|
68
|
+
// Wire format, deliberately unrenamed — see the header. Both are keyed into
|
|
69
|
+
// cookies that are live right now.
|
|
38
70
|
const COOKIE = 'cb_stealth';
|
|
39
|
-
const
|
|
71
|
+
const HMAC_LABEL = 'stealth-v1';
|
|
72
|
+
|
|
73
|
+
const SUBMIT_PATH = '/__prelaunch';
|
|
74
|
+
// Accepted for as long as a form served before the rename might still be open.
|
|
75
|
+
const LEGACY_SUBMIT_PATH = '/__stealth';
|
|
76
|
+
const SUBMIT_PATHS = [SUBMIT_PATH, LEGACY_SUBMIT_PATH];
|
|
40
77
|
|
|
41
78
|
// Paths that must answer even to a stranger, each for its own reason:
|
|
42
79
|
// /api/* the GitHub OAuth round trip has to complete, and a gated callback
|
|
@@ -45,19 +82,37 @@ const SUBMIT_PATH = '/__stealth';
|
|
|
45
82
|
// /metrics Prometheus, already access-gated on its own terms (loopback or
|
|
46
83
|
// bearer token) — double-gating it would break the scrape
|
|
47
84
|
// /version the deploy pin check, a public commit sha
|
|
48
|
-
const EXEMPT = [/^\/api\//, /^\/healthz$/, /^\/metrics$/, /^\/version$/, /^\/__stealth$/];
|
|
85
|
+
const EXEMPT = [/^\/api\//, /^\/healthz$/, /^\/metrics$/, /^\/version$/, /^\/__prelaunch$/, /^\/__stealth$/];
|
|
49
86
|
|
|
87
|
+
// PRELAUNCH_PASSWORD is primary; STEALTH_PASSWORD is the deprecated alias. This
|
|
88
|
+
// is the ONE read site for either, which is what makes honouring both a single
|
|
89
|
+
// expression rather than a migration — and why the rename could be taken at all
|
|
90
|
+
// without an outage window on a live instance already running the old name.
|
|
50
91
|
function password() {
|
|
51
|
-
const p = process.env.STEALTH_PASSWORD;
|
|
92
|
+
const p = process.env.PRELAUNCH_PASSWORD || process.env.STEALTH_PASSWORD;
|
|
52
93
|
return typeof p === 'string' && p.length ? p : null;
|
|
53
94
|
}
|
|
54
95
|
|
|
96
|
+
// Named once at mount, never per request: a warning on every gated request would
|
|
97
|
+
// be a log flood on exactly the instance that is hardest to look at. Dropping the
|
|
98
|
+
// alias is a separate, later task — this only makes the deprecation audible.
|
|
99
|
+
function warnIfLegacyEnv(log = console.warn) {
|
|
100
|
+
const hasNew = typeof process.env.PRELAUNCH_PASSWORD === 'string' && process.env.PRELAUNCH_PASSWORD.length;
|
|
101
|
+
const hasOld = typeof process.env.STEALTH_PASSWORD === 'string' && process.env.STEALTH_PASSWORD.length;
|
|
102
|
+
if (hasNew || !hasOld) return false;
|
|
103
|
+
log('[prelaunch-gate] STEALTH_PASSWORD is DEPRECATED and still the only password set. '
|
|
104
|
+
+ 'Set PRELAUNCH_PASSWORD to the same value (task 1003152); the old name is read for now '
|
|
105
|
+
+ 'and will be dropped in a later task.');
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
|
|
55
109
|
function enabled() { return password() !== null; }
|
|
56
110
|
|
|
57
111
|
// The token a valid cookie must carry. Keyed by the password, so the password
|
|
58
112
|
// itself never leaves the server and a rotation invalidates every cookie.
|
|
113
|
+
// HMAC_LABEL is deliberately still 'stealth-v1' — see the header.
|
|
59
114
|
function expectedToken() {
|
|
60
|
-
return crypto.createHmac('sha256', password()).update(
|
|
115
|
+
return crypto.createHmac('sha256', password()).update(HMAC_LABEL).digest('hex');
|
|
61
116
|
}
|
|
62
117
|
|
|
63
118
|
function tokenMatches(raw) {
|
|
@@ -118,7 +173,7 @@ function relativeReturn(raw) {
|
|
|
118
173
|
if (typeof raw !== 'string' || !raw.length || raw.length > 512) return null;
|
|
119
174
|
if (!raw.startsWith('/') || raw.startsWith('//') || raw.includes('\\')) return null;
|
|
120
175
|
if (/[\x00-\x1f\x7f]/.test(raw)) return null;
|
|
121
|
-
if (raw === '/' || raw.startsWith(
|
|
176
|
+
if (raw === '/' || SUBMIT_PATHS.some((p) => raw.startsWith(p))) return null;
|
|
122
177
|
return raw;
|
|
123
178
|
}
|
|
124
179
|
|
|
@@ -178,11 +233,12 @@ function productName() {
|
|
|
178
233
|
|
|
179
234
|
// Mounted FIRST, ahead of every other surface — a route registered earlier would
|
|
180
235
|
// answer before the gate ever ran.
|
|
181
|
-
function
|
|
182
|
-
|
|
236
|
+
function prelaunchGate() {
|
|
237
|
+
warnIfLegacyEnv();
|
|
238
|
+
return function prelaunch(req, res, next) {
|
|
183
239
|
if (!enabled()) return next();
|
|
184
240
|
|
|
185
|
-
if (req.method === 'POST' && req.path
|
|
241
|
+
if (req.method === 'POST' && SUBMIT_PATHS.includes(req.path)) {
|
|
186
242
|
// The form is urlencoded; body parsers mount later (and only on some
|
|
187
243
|
// routers), so read it here rather than depending on middleware order.
|
|
188
244
|
let body = '';
|
|
@@ -226,4 +282,7 @@ function stealthGate() {
|
|
|
226
282
|
};
|
|
227
283
|
}
|
|
228
284
|
|
|
229
|
-
module.exports = {
|
|
285
|
+
module.exports = {
|
|
286
|
+
prelaunchGate, enabled, isExempt, tokenMatches, expectedToken, warnIfLegacyEnv,
|
|
287
|
+
COOKIE, HMAC_LABEL, SUBMIT_PATH, LEGACY_SUBMIT_PATH, SUBMIT_PATHS,
|
|
288
|
+
};
|
|
@@ -47,7 +47,7 @@ const { buildInfo } = require('../build-info');
|
|
|
47
47
|
const { buildDevboxDownloads } = require('../devbox-downloads');
|
|
48
48
|
const { buildBongosDownloads } = require('../bongos-downloads');
|
|
49
49
|
const { clientBranding, branding } = require('../branding');
|
|
50
|
-
const {
|
|
50
|
+
const { prelaunchGate } = require('./prelaunch-gate');
|
|
51
51
|
const { platformVisibilityGate } = require('./platform-visibility-gate');
|
|
52
52
|
const { clientModules, isModuleEnabled } = require('../modules');
|
|
53
53
|
const { hallWidgetScripts, moduleWebSurfaces } = require('../module-loader/loader');
|
|
@@ -494,15 +494,15 @@ function mountInternalSurfaces(app) {
|
|
|
494
494
|
// game routes too) — it records on res 'finish' regardless of which handler
|
|
495
495
|
// answers. The /metrics scrape endpoint is access-gated (loopback Prometheus
|
|
496
496
|
// or Bearer METRICS_TOKEN; see metrics.authorizeScrape).
|
|
497
|
-
// THE
|
|
497
|
+
// THE PRE-LAUNCH GATE (task 1002775) mounts before anything it is meant to
|
|
498
498
|
// cover — a surface registered earlier would answer first and the gate would
|
|
499
|
-
// never run. Inert unless
|
|
499
|
+
// never run. Inert unless PRELAUNCH_PASSWORD is set, so a vanilla instance is
|
|
500
500
|
// unaffected and pays only a closure call per request.
|
|
501
501
|
//
|
|
502
502
|
// It sits ABOVE the metrics middleware deliberately: a refused knock is still
|
|
503
503
|
// a request this instance served, and hiding gate 401s would make the traffic
|
|
504
504
|
// graph lie about how much attention an unannounced instance is getting.
|
|
505
|
-
app.use(
|
|
505
|
+
app.use(prelaunchGate());
|
|
506
506
|
|
|
507
507
|
app.use(metrics.httpMiddleware());
|
|
508
508
|
app.get('/metrics', metrics.metricsHandler());
|
package/src/module-api.js
CHANGED
|
@@ -71,7 +71,7 @@ const { responsibilityFor, ROLE_RESPONSIBILITIES } = require('./role-responsibil
|
|
|
71
71
|
// there. scripts/gds/bump-version.js still rewrites the literal below; it appends
|
|
72
72
|
// the entry to that file. Look for a version's history there, not here.
|
|
73
73
|
// ---------------------------------------------------------------------------
|
|
74
|
-
const CORE_VERSION = '1.19.
|
|
74
|
+
const CORE_VERSION = '1.19.658'; // CI auto-patch carrier (ADR 0161); changelog: docs/module-api-changelog.md
|
|
75
75
|
|
|
76
76
|
// A namespaced logger so a module's log lines are attributable + consistent.
|
|
77
77
|
// Usage: const log = api.logger('dev-box'); log.info('mounted');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// tests/
|
|
1
|
+
// tests/prelaunch_gate.mjs — the instance pre-launch gate (task 1002775).
|
|
2
2
|
//
|
|
3
3
|
// A gate that is wrong in either direction is worse than no gate: too open and
|
|
4
4
|
// the unannounced instance is readable; too closed and it locks out sign-in,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// gate's whole job is to sit in front of surfaces registered elsewhere — a unit
|
|
7
7
|
// test of the middleware alone could not prove it was mounted early enough.
|
|
8
8
|
//
|
|
9
|
-
// Run: node --test tests/
|
|
9
|
+
// Run: node --test tests/prelaunch_gate.mjs
|
|
10
10
|
|
|
11
11
|
import assert from 'node:assert/strict';
|
|
12
12
|
import { test, before, after } from 'node:test';
|
|
@@ -16,9 +16,9 @@ import { createRequire } from 'node:module';
|
|
|
16
16
|
const require = createRequire(import.meta.url);
|
|
17
17
|
|
|
18
18
|
const PASSWORD = 'a-test-password';
|
|
19
|
-
process.env.
|
|
19
|
+
process.env.PRELAUNCH_PASSWORD = PASSWORD; // set BEFORE the app is built
|
|
20
20
|
|
|
21
|
-
const gate = require('../src/bongos/
|
|
21
|
+
const gate = require('../src/bongos/prelaunch-gate.js');
|
|
22
22
|
const platformMod = require('../src/platform-server.js');
|
|
23
23
|
|
|
24
24
|
let server, port;
|
|
@@ -74,7 +74,7 @@ test('the form leaks nothing about the product it is hiding', async () => {
|
|
|
74
74
|
|
|
75
75
|
test('every human surface is gated, not just the front page', async () => {
|
|
76
76
|
// the old proxy lock covered '/' but not '/projects', so the hub leaked for
|
|
77
|
-
// the whole
|
|
77
|
+
// the whole pre-launch period — that regression must be impossible here
|
|
78
78
|
for (const p of ['/', '/projects', '/create', '/builders', '/docs']) {
|
|
79
79
|
const res = await request(p);
|
|
80
80
|
assert.equal(res.status, 401, `${p} must be gated`);
|
|
@@ -209,9 +209,9 @@ test('a forged or stale cookie does not open it', async () => {
|
|
|
209
209
|
|
|
210
210
|
test('rotating the password invalidates outstanding cookies', async () => {
|
|
211
211
|
const old = validCookie();
|
|
212
|
-
process.env.
|
|
212
|
+
process.env.PRELAUNCH_PASSWORD = 'a-different-password';
|
|
213
213
|
const res = await request('/', { cookie: old });
|
|
214
|
-
process.env.
|
|
214
|
+
process.env.PRELAUNCH_PASSWORD = PASSWORD;
|
|
215
215
|
assert.equal(res.status, 401, 'the token is keyed by the password, so a rotation revokes');
|
|
216
216
|
});
|
|
217
217
|
|
|
@@ -219,16 +219,145 @@ test('an oversized POST body is dropped rather than buffered', async () => {
|
|
|
219
219
|
// a password is not a payload — the handler reads the body itself, so it must
|
|
220
220
|
// bound it or it is a trivial memory sink on an unauthenticated endpoint
|
|
221
221
|
const src = require('node:fs').readFileSync(
|
|
222
|
-
new URL('../src/bongos/
|
|
222
|
+
new URL('../src/bongos/prelaunch-gate.js', import.meta.url), 'utf8');
|
|
223
223
|
assert.match(src, /body\.length > \d+/, 'the body read must be bounded');
|
|
224
224
|
assert.match(src, /req\.destroy\(\)/);
|
|
225
225
|
});
|
|
226
226
|
|
|
227
227
|
test('the gate is inert when no password is configured', () => {
|
|
228
228
|
// the portable default: a vanilla instance has no gate and needs no config
|
|
229
|
-
// to not have one
|
|
229
|
+
// to not have one. BOTH names must be clear — an alias that kept the gate up
|
|
230
|
+
// after the primary was unset would be the same bug in reverse.
|
|
231
|
+
delete process.env.PRELAUNCH_PASSWORD;
|
|
230
232
|
delete process.env.STEALTH_PASSWORD;
|
|
231
233
|
assert.equal(gate.enabled(), false);
|
|
232
|
-
process.env.
|
|
234
|
+
process.env.PRELAUNCH_PASSWORD = PASSWORD;
|
|
233
235
|
assert.equal(gate.enabled(), true);
|
|
234
236
|
});
|
|
237
|
+
|
|
238
|
+
// ── the rename's compatibility surface (task 1003152) ───────────────────────
|
|
239
|
+
//
|
|
240
|
+
// STEALTH_PASSWORD is SET ON LIVE cloudbongos.com right now. A rename that did
|
|
241
|
+
// not read the old name would be an instant, total outage of the instance — so
|
|
242
|
+
// these are the tests that make the rename safe to deploy, not nice-to-haves.
|
|
243
|
+
|
|
244
|
+
test('the DEPRECATED STEALTH_PASSWORD alone still opens the gate', async () => {
|
|
245
|
+
delete process.env.PRELAUNCH_PASSWORD;
|
|
246
|
+
process.env.STEALTH_PASSWORD = PASSWORD;
|
|
247
|
+
try {
|
|
248
|
+
assert.equal(gate.enabled(), true, 'an instance running only the old name must not go dark');
|
|
249
|
+
// and the cookie it mints is the same one, because the HMAC label did not move
|
|
250
|
+
const res = await request('/', { cookie: `${gate.COOKIE}=${gate.expectedToken()}` });
|
|
251
|
+
assert.equal(res.status, 200, 'a cookie held across the rename must still be honoured');
|
|
252
|
+
} finally {
|
|
253
|
+
delete process.env.STEALTH_PASSWORD;
|
|
254
|
+
process.env.PRELAUNCH_PASSWORD = PASSWORD;
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
test('PRELAUNCH_PASSWORD wins when both are set', () => {
|
|
259
|
+
const fromNewNameAlone = gate.expectedToken(); // PRELAUNCH_PASSWORD only
|
|
260
|
+
process.env.STEALTH_PASSWORD = 'the-old-one';
|
|
261
|
+
try {
|
|
262
|
+
assert.equal(gate.expectedToken(), fromNewNameAlone,
|
|
263
|
+
'the primary name is primary — an operator who sets the new one and forgets '
|
|
264
|
+
+ 'to clear the old must get the value they just wrote, not the stale one');
|
|
265
|
+
} finally {
|
|
266
|
+
delete process.env.STEALTH_PASSWORD;
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
test('running on the old name alone warns once, at mount', () => {
|
|
271
|
+
const lines = [];
|
|
272
|
+
const log = (m) => lines.push(String(m));
|
|
273
|
+
delete process.env.PRELAUNCH_PASSWORD;
|
|
274
|
+
process.env.STEALTH_PASSWORD = PASSWORD;
|
|
275
|
+
try {
|
|
276
|
+
assert.equal(gate.warnIfLegacyEnv(log), true, 'the deprecation must be audible');
|
|
277
|
+
assert.match(lines.join('\n'), /PRELAUNCH_PASSWORD/, 'the warning must name the replacement');
|
|
278
|
+
} finally {
|
|
279
|
+
delete process.env.STEALTH_PASSWORD;
|
|
280
|
+
process.env.PRELAUNCH_PASSWORD = PASSWORD;
|
|
281
|
+
}
|
|
282
|
+
// silent once the new name is set — nobody needs a warning they have acted on
|
|
283
|
+
assert.equal(gate.warnIfLegacyEnv(log), false);
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
test('both submit paths are accepted, and both are exempt', async () => {
|
|
287
|
+
// A form served before the rename may still be open in somebody's tab. The old
|
|
288
|
+
// path keeps working so their password lands them in, not on a 401.
|
|
289
|
+
assert.equal(gate.SUBMIT_PATH, '/__prelaunch');
|
|
290
|
+
assert.equal(gate.LEGACY_SUBMIT_PATH, '/__stealth');
|
|
291
|
+
for (const p of gate.SUBMIT_PATHS) {
|
|
292
|
+
assert.equal(gate.isExempt(p), true, `${p} must be exempt or the submit is gated behind itself`);
|
|
293
|
+
const res = await request(p, { method: 'POST', body: `password=${encodeURIComponent(PASSWORD)}` });
|
|
294
|
+
assert.equal(res.status, 303, `POST ${p} must accept the password`);
|
|
295
|
+
assert.match(String(res.headers['set-cookie'] || ''), new RegExp(gate.COOKIE),
|
|
296
|
+
`POST ${p} must mint the cookie`);
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
test('the wire format did NOT move — renaming it would log everyone out', () => {
|
|
301
|
+
// Deliberate, and the reason it is pinned: the cookie name and the HMAC label
|
|
302
|
+
// are baked into cookies that are live right now. A later "finish the rename"
|
|
303
|
+
// pass that changes either forces every holder to re-enter the password, to
|
|
304
|
+
// buy nothing — neither string is ever read by a human.
|
|
305
|
+
assert.equal(gate.COOKIE, 'cb_stealth');
|
|
306
|
+
assert.equal(gate.HMAC_LABEL, 'stealth-v1');
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
// ── the vocabulary wall around the rename (check 19d, task 1003152) ─────────
|
|
310
|
+
//
|
|
311
|
+
// ADR 0174's lesson, applied: a naming rule is the easiest kind of check to ship
|
|
312
|
+
// broken — allowlist enough and it passes forever while proving nothing. So the
|
|
313
|
+
// load-bearing tests are the MUTATION tests. A rule that cannot be made to fail
|
|
314
|
+
// is not a rule.
|
|
315
|
+
|
|
316
|
+
const fitness = require('../scripts/gds/fitness.js');
|
|
317
|
+
|
|
318
|
+
test('the pre-launch surface is clean today', () => {
|
|
319
|
+
const r = fitness.checkPrelaunchVocabulary();
|
|
320
|
+
assert.equal(r.ok, true, `check 19d is failing on the real tree:\n${r.violations.join('\n')}`);
|
|
321
|
+
assert.ok(r.note.includes('file(s) scanned'), 'the check must report what it scanned');
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
test('a planted "stealth" on the pre-launch surface REDS the build', () => {
|
|
325
|
+
assert.ok(plantInGate('// the stealth gate mounts here').some((v) => /"stealth"/.test(v)),
|
|
326
|
+
'the retired word must be caught, or the rename un-does itself one comment at a time');
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
test('a documented COMPATIBILITY identifier is not a violation', () => {
|
|
330
|
+
// The four that deliberately stayed. Catching these would force an allowlist,
|
|
331
|
+
// which is what the citation/compat split exists to avoid.
|
|
332
|
+
for (const line of ["const c = 'cb_stealth';", "hmac('stealth-v1');",
|
|
333
|
+
"path === '/__stealth'", 'process.env.STEALTH_PASSWORD']) {
|
|
334
|
+
assert.equal(plantInGate(line).length, 0, `the compat identifier tripped the wall: ${line}`);
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
test('a line CITING the rename or the other meaning may say the word', () => {
|
|
339
|
+
for (const line of ['// renamed from stealth-gate.js (task 1003152)',
|
|
340
|
+
"// platform_identity_projects.visibility = 'stealth' is the OTHER meaning"]) {
|
|
341
|
+
assert.equal(plantInGate(line).length, 0, `a citation tripped the wall: ${line}`);
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
test('the citation does NOT excuse the rest of the file', () => {
|
|
346
|
+
// The header cites task 1003152 on its own line. If the exemption were
|
|
347
|
+
// file-scoped rather than line-scoped, every later line would ride it.
|
|
348
|
+
assert.ok(plantInGate('// bring back the stealth wording').length > 0,
|
|
349
|
+
'an uncited line must still red — a file-wide exemption is an allowlist wearing a regex');
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
// Plant a line into the real gate file, run the real check, restore.
|
|
353
|
+
function plantInGate(line) {
|
|
354
|
+
const fs = require('node:fs');
|
|
355
|
+
const target = new URL('../src/bongos/prelaunch-gate.js', import.meta.url);
|
|
356
|
+
const original = fs.readFileSync(target, 'utf8');
|
|
357
|
+
try {
|
|
358
|
+
fs.writeFileSync(target, `${original}\n${line}\n`);
|
|
359
|
+
return fitness.checkPrelaunchVocabulary().violations;
|
|
360
|
+
} finally {
|
|
361
|
+
fs.writeFileSync(target, original);
|
|
362
|
+
}
|
|
363
|
+
}
|