mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
chore(railway): wire seed-sovereign-wealth into resilience-recovery bundle (#3319)
* chore(railway): add seed-sovereign-wealth to resilience-recovery bundle Wires the seeder landed in #3305 into the existing Railway cron service `seed-bundle-resilience-recovery`. One-line bundle entry; no new Railway service (the bundle pattern amortizes cron cost across the recovery-domain seeders). Config matches the rest of the bundle: - intervalMs: 30 * DAY (parity with CACHE_TTL_SECONDS=35d in the seeder + the quarterly manifest revision cadence) - timeoutMs: 600_000 (longer than peers because Tier 3b does N per-fund Wikipedia article fetches for any fund missing from the list article; today Temasek is the only miss but leaving headroom) After deploy, the next cron tick populates `resilience:recovery:sovereign-wealth:v1`, which then unblocks the follow-up PR that adds the scorer + dimension wiring. * fix(tests): update resilience-recovery bundle test for 6th entry Static-analysis test in tests/seed-bundle-resilience-recovery.test.mjs was hardcoded to `5 entries` / `all 5 entries use 30 * DAY`. Adding Sovereign-Wealth to the bundle (previous commit) made the count 6, breaking both assertions. Replaced hardcoded `5` with `EXPECTED_ENTRIES.length` so the next addition only requires appending to the allow-list at the top of the file (and the assertion message prompts the author to do that if the count drifts). Also appended the Sovereign-Wealth entry to the EXPECTED_ENTRIES list. 6566/6566 data-tier tests pass locally.
This commit is contained in:
@@ -7,4 +7,10 @@ await runBundle('resilience-recovery', [
|
||||
{ label: 'External-Debt', script: 'seed-recovery-external-debt.mjs', seedMetaKey: 'resilience:recovery:external-debt', canonicalKey: 'resilience:recovery:external-debt:v1', intervalMs: 30 * DAY, timeoutMs: 300_000 },
|
||||
{ label: 'Import-HHI', script: 'seed-recovery-import-hhi.mjs', seedMetaKey: 'resilience:recovery:import-hhi', canonicalKey: 'resilience:recovery:import-hhi:v1', intervalMs: 30 * DAY, timeoutMs: 1_800_000 },
|
||||
{ label: 'Fuel-Stocks', script: 'seed-recovery-fuel-stocks.mjs', seedMetaKey: 'resilience:recovery:fuel-stocks', canonicalKey: 'resilience:recovery:fuel-stocks:v1', intervalMs: 30 * DAY, timeoutMs: 300_000 },
|
||||
// PR 2 §3.4 — feeds the forthcoming `sovereignFiscalBuffer` dimension.
|
||||
// 30-day interval matches the CACHE_TTL_SECONDS (35 days) in the seeder
|
||||
// and the quarterly revision cadence documented in the manifest. Longer
|
||||
// timeout than peers because Tier 3b (per-fund Wikipedia infobox) is N
|
||||
// network round-trips per manifest fund the list article misses.
|
||||
{ label: 'Sovereign-Wealth', script: 'seed-sovereign-wealth.mjs', seedMetaKey: 'resilience:recovery:sovereign-wealth', canonicalKey: 'resilience:recovery:sovereign-wealth:v1', intervalMs: 30 * DAY, timeoutMs: 600_000 },
|
||||
]);
|
||||
|
||||
@@ -15,12 +15,15 @@ const EXPECTED_ENTRIES = [
|
||||
{ label: 'External-Debt', script: 'seed-recovery-external-debt.mjs', seedMetaKey: 'resilience:recovery:external-debt' },
|
||||
{ label: 'Import-HHI', script: 'seed-recovery-import-hhi.mjs', seedMetaKey: 'resilience:recovery:import-hhi' },
|
||||
{ label: 'Fuel-Stocks', script: 'seed-recovery-fuel-stocks.mjs', seedMetaKey: 'resilience:recovery:fuel-stocks' },
|
||||
{ label: 'Sovereign-Wealth', script: 'seed-sovereign-wealth.mjs', seedMetaKey: 'resilience:recovery:sovereign-wealth' },
|
||||
];
|
||||
|
||||
describe('seed-bundle-resilience-recovery', () => {
|
||||
it('has exactly 5 entries', () => {
|
||||
it(`has exactly ${EXPECTED_ENTRIES.length} entries`, () => {
|
||||
const labelMatches = bundleSource.match(/label:\s*'[^']+'/g) ?? [];
|
||||
assert.equal(labelMatches.length, 5, `Expected 5 entries, found ${labelMatches.length}`);
|
||||
assert.equal(labelMatches.length, EXPECTED_ENTRIES.length,
|
||||
`Expected ${EXPECTED_ENTRIES.length} entries, found ${labelMatches.length}. ` +
|
||||
`If you added a new seeder, update EXPECTED_ENTRIES above.`);
|
||||
});
|
||||
|
||||
for (const entry of EXPECTED_ENTRIES) {
|
||||
@@ -38,7 +41,8 @@ describe('seed-bundle-resilience-recovery', () => {
|
||||
|
||||
it('all entries use 30 * DAY interval', () => {
|
||||
const intervalMatches = bundleSource.match(/intervalMs:\s*30\s*\*\s*DAY/g) ?? [];
|
||||
assert.equal(intervalMatches.length, 5, `Expected all 5 entries to use 30 * DAY interval`);
|
||||
assert.equal(intervalMatches.length, EXPECTED_ENTRIES.length,
|
||||
`Expected all ${EXPECTED_ENTRIES.length} entries to use 30 * DAY interval`);
|
||||
});
|
||||
|
||||
it('imports runBundle and DAY from _bundle-runner.mjs', () => {
|
||||
|
||||
Reference in New Issue
Block a user