Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 8 additions & 1 deletion devnet/rfc64-m1-selective-coverage/process-runtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ import {
createSelectiveCoverageCorpus,
type ExpectedSelectiveCoverageProvenanceV1,
} from './manifest.ts';
import { ProcessSelectiveCoverageRuntimeV1 } from './process-runtime.ts';
import {
DEFAULT_SELECTIVE_COVERAGE_ADAPTER_TIMEOUT_MS,
ProcessSelectiveCoverageRuntimeV1,
} from './process-runtime.ts';
import { SELECTIVE_COVERAGE_RUNTIME_PROTOCOL } from './runtime.ts';

test('default adapter timeout covers the shipped testnet operation window', () => {
assert.equal(DEFAULT_SELECTIVE_COVERAGE_ADAPTER_TIMEOUT_MS, 25 * 60_000);
Comment thread
branarakic marked this conversation as resolved.
Outdated
});

test('exchanges sequence-bound JSON without sending the trust anchor to the adapter', async () => {
const runtime = new ProcessSelectiveCoverageRuntimeV1({
command: process.execPath,
Expand Down
9 changes: 8 additions & 1 deletion devnet/rfc64-m1-selective-coverage/process-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ export const SELECTIVE_COVERAGE_RUNTIME_RESULT_SCHEMA =
export const SELECTIVE_COVERAGE_RUNTIME_RESULT_PREFIX = 'DKG_RFC64_M1_RESULT ';
const MAX_RESULT_LINE_BYTES = 1024 * 1024;
const CLOSE_GRACE_MS = 5_000;
// A real testnet command can include chain finality, five-peer durable/SWM
// catch-up, and an exact store observation. Keep the outer process boundary
// longer than the shipped operator adapter's 20-minute poll window; otherwise
// a valid late result can race the outer timer before the inner operation can
// produce its evidence. The extra five minutes covers the final exact store
// observation and response framing without making the live boundary unbounded.
export const DEFAULT_SELECTIVE_COVERAGE_ADAPTER_TIMEOUT_MS = 25 * 60_000;
Comment thread
branarakic marked this conversation as resolved.
Outdated

interface RuntimeSuccessResultEnvelopeV1 {
readonly schema: typeof SELECTIVE_COVERAGE_RUNTIME_RESULT_SCHEMA;
Expand Down Expand Up @@ -112,7 +119,7 @@ export class ProcessSelectiveCoverageRuntimeV1 implements SelectiveCoverageRunti
readonly timeoutMs?: number;
}) {
if (!input.command.trim()) throw new TypeError('M1 runtime adapter command is empty');
const timeoutMs = input.timeoutMs ?? 120_000;
const timeoutMs = input.timeoutMs ?? DEFAULT_SELECTIVE_COVERAGE_ADAPTER_TIMEOUT_MS;
if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 1_000 || timeoutMs > 3_600_000) {
throw new RangeError('M1 runtime adapter timeout is outside 1s..1h');
}
Expand Down
Loading