Skip to content

Commit f2af98a

Browse files
committed
test(publish-smoke): add a registry-mode healthy boot to the firing control
The pack-mode healthy fixture could not catch the mistake the predicate exists to avoid. Measured, not foreseen: under a deliberately wrong `WARN|warn` predicate the firing control stayed GREEN, because that fixture's only warn-shaped line carries the glyph and never the word. Registry mode installs the last published release, so a protocol-floor conversion warning is normal there and arrives as a full `<ISO>Z WARN ...` line. Asserting a healthy boot that spells WARN in full is what turns "do not widen the severity set wholesale" into something this file can redden on. The fixture is reconstructed rather than verbatim - the specimen's own boot window with the four lines attributable to the defect removed - and its docblock says so. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012GKcPZbMoGq7WPzKLfRBTU
1 parent 64a42b9 commit f2af98a

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

packages/spec/scripts/publish-smoke-boot-failure.test.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,44 @@ const HEALTHY_BOOT = [
150150
'',
151151
].join('\n');
152152

153+
/**
154+
* A healthy REGISTRY-mode boot window.
155+
*
156+
* ⚠ Unlike `HEALTHY_BOOT` this one is RECONSTRUCTED, not verbatim, and the
157+
* distinction is load-bearing so it is stated rather than glossed: it is the
158+
* specimen's own boot window (job `101626009369`) with the four lines
159+
* attributable to the defect removed — the `AuthPlugin failed to load` line,
160+
* both kernel degraded-capability lines, and `SharingServicePlugin: could not
161+
* enumerate organizations`, which only failed because the plugin that creates
162+
* `sys_organization` never loaded. What is KEPT is the one boot warning that is
163+
* normal for registry mode: the canary installs the LAST PUBLISHED release, so
164+
* an artifact whose protocol floor predates the runtime's spec is expected, and
165+
* the ADR-0087 forward conversion says so at WARN.
166+
*
167+
* ⭐ This fixture exists because the pack-mode one could not do this job, and
168+
* that was MEASURED rather than foreseen: under a deliberately wrong
169+
* `WARN|warn` predicate the firing control below stayed GREEN, because
170+
* `HEALTHY_BOOT`'s only warn-shaped line carries the `⚠` glyph and never the
171+
* word. A healthy boot that spells `WARN` in full is what makes "⛔ do not
172+
* widen the severity set wholesale" a thing this file can actually catch.
173+
*/
174+
const HEALTHY_REGISTRY_BOOT = [
175+
'',
176+
'◆ Development Mode',
177+
' Loading objectstack.config.ts...',
178+
'[LocalCryptoProvider] No OS_SECRET_KEY/OS_DEV_CRYPTO_KEY set — generated a new AES-256-GCM key and persisted it to /tmp/y/dev-crypto-key (mode 0600).',
179+
' ↪ secret fields: LocalCryptoProvider wired (dev) — set OS_SECRET_KEY and swap for KMS/Vault in production',
180+
'',
181+
' ✓ Server is ready',
182+
'',
183+
' Plugins: 31 loaded',
184+
'',
185+
' ⚠ Boot diagnostics — 1 warning logged during startup:',
186+
" 2026-09-07T04:51:11.594Z WARN [MetadataPlugin] artifact '/tmp/y/dist/objectstack.json' predates this runtime's spec (authored engines.protocol floor 17.0.0, runtime spec 17.3.0) — converted 1 site(s) forward via ADR-0087 conversion 'field-required-notnull-explicit'.",
187+
' run with --log-level debug to watch the boot stream live',
188+
'',
189+
].join('\n');
190+
153191
/**
154192
* Every benign `failed to load` in the tree, plus the two near-misses that make
155193
* the legs' boundaries real rather than asserted.
@@ -233,6 +271,7 @@ function runHarness(): Record<string, string> {
233271
OTHER: write('other.log', OTHER_SITES),
234272
NONSENSE: write('nonsense.log', NONSENSE),
235273
DECORATED: write('decorated.log', DECORATED_BOOT),
274+
REGISTRY: write('registry.log', HEALTHY_REGISTRY_BOOT),
236275
};
237276

238277
const harness = path.join(dir, 'harness.sh');
@@ -274,6 +313,7 @@ function runHarness(): Record<string, string> {
274313
`echo "DECOR_UNSCRUBBED_NAMES_PLUGIN=$(grep -cE "$SMOKE_BOOT_FAILURE_PATTERN" ${JSON.stringify(fixtures.DECORATED)} )"`,
275314
// Vacuity guard: the healthy fixture really does carry warn-shaped lines.
276315
`echo "HEALTHY_WARN_LINES=$(grep -c '⚠' ${JSON.stringify(fixtures.HEALTHY)})"`,
316+
`echo "REGISTRY_WARN_WORDS=$(grep -c 'WARN' ${JSON.stringify(fixtures.REGISTRY)})"`,
277317
'exit 0',
278318
].join('\n'),
279319
{ mode: 0o755 },
@@ -332,6 +372,18 @@ describe.skipIf(!RUNNABLE)('[#16793] publish-smoke.sh judges the BOOT before it
332372
expect(Number(r.HEALTHY_WARN_LINES)).toBeGreaterThan(0);
333373
});
334374

375+
it('FIRING CONTROL 2: a healthy REGISTRY boot passes even though it spells WARN', () => {
376+
// The half `HEALTHY_BOOT` cannot test. Registry mode installs the last
377+
// PUBLISHED release, so a protocol-floor conversion warning is normal there
378+
// — and it arrives as a full `<ISO>Z WARN …` line. This is the assertion
379+
// that turns "⛔ do not widen the severity set to WARN" from advice in a
380+
// comment into something that reddens.
381+
expect(r.REGISTRY_STATUS).toBe('1');
382+
expect(r.REGISTRY_HITS).toBe('0');
383+
// Vacuity guard: the fixture really does contain the literal word.
384+
expect(Number(r.REGISTRY_WARN_WORDS)).toBeGreaterThan(0);
385+
});
386+
335387
it('the benign `failed to load` family is NOT a boot failure', () => {
336388
expect(r.BENIGN_STATUS).toBe('1');
337389
expect(r.BENIGN_HITS).toBe('0');

0 commit comments

Comments
 (0)