Batch 13 of the ad hoc timeout literal migration (epic #4445). Replaces every bare numeric timeoutMs object-literal property in tests/task-content-resolution.test.cjs, tests/task-command-router-resolve-content.test.cjs, and tests/task-content-resolver-grammar-parity.test.cjs with a named constant, per eslint-rules/no-adhoc-timeout-literal.cjs. Removes these 3 files from the rule's allowlist. Every one of the 13 sites describes the same field -- a task-content- resolver manifest's invoke.timeoutMs -- as fixture/validation data; none is a real subprocess spawn timeout, verified by tracing each site to a pure function, a garbage-shape rejection path, or a fully-injected fake exec function. Adds one new shared constant, TASK_RESOLVER_INVOKE_TIMEOUT_MS, used by 2 files in this batch (crossing the promotion bar). Adds file-local constants for a value used by only 1 file, plus three deliberately-invalid values (zero, negative, non-integer) inside one findResolver garbage-shapes test proving the validator rejects a malformed manifest regardless of which way its timeout is invalid. Also fixes a review-caught defect outside the mechanical rule's own scope: a bare-literal duplicate of the new shared constant inside a ResolverTimeoutError assertion (a call argument, not an object-literal property, so the lint rule never flagged it) -- renamed in this same PR per the no-deferrals rule. No src/bin file touched, no numeric value changed anywhere. Co-authored-by: sim <sim@local> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,13 @@ const {
|
||||
ResolverFailedError,
|
||||
} = require('../gsd-core/bin/lib/task-content-resolution.cjs');
|
||||
|
||||
/**
|
||||
* NOT a subprocess spawn timeout. Fixture DATA inside a fakeCapabilities
|
||||
* manifest consumed by a fully-injected resolveTaskContentFn -- neither
|
||||
* test using this constant ever reaches a real child process.
|
||||
*/
|
||||
const FAKE_RESOLVER_INVOKE_TIMEOUT_MS = 5000;
|
||||
|
||||
function writePlan(dir, taskXml) {
|
||||
const planPath = path.join(dir, '01-PLAN.md');
|
||||
fs.writeFileSync(planPath, `# Plan\n\n${taskXml}\n`, 'utf8');
|
||||
@@ -123,7 +130,7 @@ describe('task resolve-content (rows 17-19)', () => {
|
||||
id: 'fake-tracker',
|
||||
taskContentResolver: {
|
||||
trackerPrefix: 'test',
|
||||
invoke: { binary: 'fake-cli', args: ['show', '{{id}}'], timeoutMs: 5000 },
|
||||
invoke: { binary: 'fake-cli', args: ['show', '{{id}}'], timeoutMs: FAKE_RESOLVER_INVOKE_TIMEOUT_MS },
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -176,7 +183,7 @@ describe('task resolve-content (rows 17-19)', () => {
|
||||
id: 'fake-tracker',
|
||||
taskContentResolver: {
|
||||
trackerPrefix: 'test',
|
||||
invoke: { binary: 'fake-cli', args: ['show', '{{id}}'], timeoutMs: 5000 },
|
||||
invoke: { binary: 'fake-cli', args: ['show', '{{id}}'], timeoutMs: FAKE_RESOLVER_INVOKE_TIMEOUT_MS },
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user