Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion devnet/rfc64-m1-selective-coverage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ pnpm test:m1:rfc64-selective-coverage
For the shipped TypeScript adapter, set the command to `node`, pass
`["--import","tsx","devnet/rfc64-m1-selective-coverage/testnet-operator-adapter.ts"]`
as `DKG_RFC64_M1_ADAPTER_ARGS_JSON`, and provide the closed operator file via
`DKG_RFC64_M1_OPERATOR_CONFIG`. `prepare-testnet-corpus.ts` creates and seals
`DKG_RFC64_M1_OPERATOR_CONFIG`. The outer adapter command timeout defaults to
25 minutes so it does not preempt the shipped adapter's 20-minute live-operation
window; `DKG_RFC64_M1_ADAPTER_TIMEOUT_MS` may set an explicit bounded override.
`prepare-testnet-corpus.ts` creates and seals
exactly four KAs in each of the five policy/selection cells (one VM and one SWM
asset per wave), then writes both the
immutable corpus and the adapter graph plan. After probing stable identities for
Expand Down
14 changes: 4 additions & 10 deletions devnet/rfc64-m1-selective-coverage/launch-live.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
readExpectedSelectiveCoverageProvenance,
readSelectiveCoverageCorpus,
} from './operator-input.ts';
import { resolveLiveAdapterTimeoutMs } from './live-launcher-config.ts';

const repoRoot = resolve(import.meta.dirname, '../..');
const corpusPath = resolveRequiredPath('DKG_RFC64_M1_CORPUS_FILE');
Expand All @@ -33,7 +34,9 @@ const adapterArgs = parseStringArray(
'DKG_RFC64_M1_ADAPTER_ARGS_JSON',
);
const adapterCwd = resolve(process.env['DKG_RFC64_M1_ADAPTER_CWD'] ?? repoRoot);
const timeoutMs = parseTimeout(process.env['DKG_RFC64_M1_ADAPTER_TIMEOUT_MS']);
const timeoutMs = resolveLiveAdapterTimeoutMs(
process.env['DKG_RFC64_M1_ADAPTER_TIMEOUT_MS'],
);

const corpus = readSelectiveCoverageCorpus(corpusPath);
const expectedProvenance = readExpectedSelectiveCoverageProvenance(trustAnchorPath);
Expand Down Expand Up @@ -95,12 +98,3 @@ function parseStringArray(value: string, label: string): string[] {
}
return parsed;
}

function parseTimeout(value: string | undefined): number | undefined {
if (value === undefined || value.trim() === '') return undefined;
const parsed = Number(value);
if (!Number.isSafeInteger(parsed)) {
throw new TypeError('DKG_RFC64_M1_ADAPTER_TIMEOUT_MS must be an integer');
}
return parsed;
}
20 changes: 20 additions & 0 deletions devnet/rfc64-m1-selective-coverage/live-launcher-config.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import assert from 'node:assert/strict';
import test from 'node:test';

import {
DEFAULT_LIVE_ADAPTER_TIMEOUT_MS,
resolveLiveAdapterTimeoutMs,
} from './live-launcher-config.ts';

test('live launcher gives the shipped 20-minute operation a 25-minute boundary', () => {
assert.equal(resolveLiveAdapterTimeoutMs(undefined), 25 * 60_000);
assert.equal(resolveLiveAdapterTimeoutMs(' '), DEFAULT_LIVE_ADAPTER_TIMEOUT_MS);
});

test('live launcher honors an explicit bounded runtime override', () => {
assert.equal(resolveLiveAdapterTimeoutMs('300000'), 300_000);
assert.throws(
() => resolveLiveAdapterTimeoutMs('1.5'),
/DKG_RFC64_M1_ADAPTER_TIMEOUT_MS must be an integer/,
);
});
18 changes: 18 additions & 0 deletions devnet/rfc64-m1-selective-coverage/live-launcher-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* The shipped testnet adapter may spend up to 20 minutes waiting for chain
* finality, durable/SWM catch-up, and exact store observations. The launcher
* owns that live-operation policy and gives response framing and final
* observation another five minutes. Generic process runtimes remain neutral.
*/
export const DEFAULT_LIVE_ADAPTER_TIMEOUT_MS = 25 * 60_000;

export function resolveLiveAdapterTimeoutMs(value: string | undefined): number {
if (value === undefined || value.trim() === '') {
return DEFAULT_LIVE_ADAPTER_TIMEOUT_MS;
}
const parsed = Number(value);
if (!Number.isSafeInteger(parsed)) {
throw new TypeError('DKG_RFC64_M1_ADAPTER_TIMEOUT_MS must be an integer');
}
return parsed;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"test:m1:rfc64-selective-coverage": "pnpm run test:m1:rfc64-selective-coverage:generate && pnpm run test:m1:rfc64-selective-coverage:verify",
"test:m1:rfc64-selective-coverage:generate": "node --import tsx devnet/rfc64-m1-selective-coverage/launch-live.ts",
"test:m1:rfc64-selective-coverage:verify": "node --import tsx devnet/rfc64-m1-selective-coverage/verify-live.ts",
"test:m1:rfc64-selective-coverage:unit": "node --experimental-strip-types --test devnet/rfc64-m1-selective-coverage/verifier.test.ts devnet/rfc64-m1-selective-coverage/runtime.test.ts devnet/rfc64-m1-selective-coverage/process-runtime.test.ts devnet/rfc64-m1-selective-coverage/adapter-environment.test.ts devnet/rfc64-m1-selective-coverage/operator-input.test.ts devnet/rfc64-m1-selective-coverage/boundary-codec.test.ts && node --import tsx --test devnet/rfc64-m1-selective-coverage/testnet-operator-common.test.ts",
"test:m1:rfc64-selective-coverage:unit": "node --experimental-strip-types --test devnet/rfc64-m1-selective-coverage/verifier.test.ts devnet/rfc64-m1-selective-coverage/runtime.test.ts devnet/rfc64-m1-selective-coverage/process-runtime.test.ts devnet/rfc64-m1-selective-coverage/live-launcher-config.test.ts devnet/rfc64-m1-selective-coverage/adapter-environment.test.ts devnet/rfc64-m1-selective-coverage/operator-input.test.ts devnet/rfc64-m1-selective-coverage/boundary-codec.test.ts && node --import tsx --test devnet/rfc64-m1-selective-coverage/testnet-operator-common.test.ts",
"typecheck:m1:rfc64-selective-coverage": "tsc --project devnet/rfc64-m1-selective-coverage/tsconfig.json",
"test:devnet:v10-core-flows": "vitest run --config devnet/v10-core-flows/vitest.config.ts",
"test:devnet:v10-e2e": "vitest run --config devnet/v10-end-to-end/vitest.config.ts",
Expand Down
Loading