Files
callstack__agent-device/scripts/fuzz/validation-arbitraries.test.ts
Michał Pierzchała 80b4769230 test(fuzz): structured CLI/Maestro generators that reach command validation and assert error codes (#1781 B2) (#1866)
* test(fuzz): structured CLI/Maestro generators that reach command validation and assert error codes (#1781 B2)

* test(fuzz): pin the rediscovered #1433 excess-positional case and keep numeric flag samples inside their range

* style: apply oxfmt to the new fuzz modules

* perf(fuzz): derive the CLI validation surface lazily so unrelated harness paths keep their startup

* test(fuzz): resolve validation generators in the run path so corpus replay keeps its small module graph

* test(fuzz): weight the CLI budget toward command validation, pin the finite classes as seeds, guard lazy surface derivation

* docs(testing): describe the validation lane's layer split, seed-pinned classes, and PR-time gates

* refactor(fuzz): split the validation generator into CLI and Maestro modules, mirrored in tests

* refactor(fuzz): collapse the flag-shaped mutation classes and seed literals, derive class coverage from declarations

* fix(fuzz): hash every case-generation module in configHash, guarded by an import-closure test

* test(fuzz): assert CLI command and flag-key coverage against the registry, and close the six gaps it found
2026-08-20 08:00:08 +02:00

19 lines
798 B
TypeScript

// The validation generator lookup (#1781 B2).
import { describe, expect, it } from 'vitest';
import { validationArbitraryFor } from './validation-arbitraries.ts';
describe('validationArbitraryFor', () => {
it('resolves a generator for each validation target', () => {
expect(validationArbitraryFor('cli-validation')).toBeDefined();
expect(validationArbitraryFor('maestro-validation')).toBeDefined();
});
// `undefined` is what routes a classic target back to the hazard-splicing mutator, so this is
// the difference between a corrupted-string case and an expectation-carrying one.
it('returns undefined for the classic targets', () => {
expect(validationArbitraryFor('selector')).toBeUndefined();
expect(validationArbitraryFor('cli-args')).toBeUndefined();
});
});