/**
 * @specverse/engines/inference/scenario-contracts
 *
 * Spec-inferred behavioral scenario test generation. The realize pipeline
 * (Phase 1b) will call `generateScenarioTests(spec)` to run every registered
 * rule over the normalized spec and emit one API-level test file per rule.
 *
 * A scenario rule is a pure `(spec) => ScenarioCase[]`; cases render to
 * tests that drive the realized backend's CURVED endpoints via
 * `@specverse/engines/scenario-harness` (API-level, no frontend).
 *
 * Design: docs/proposals/in-progress/2026-05-21-USE-CASE-SCENARIO-CONTRACTS.md
 */
import { renderScenarioFile } from './translators/api.js';
import { lifecyclePathWalkable, RULE_ID as LIFECYCLE_PATH_WALKABLE_RULE_ID, } from './rules/lifecycle-path-walkable.js';
import { cascadeIntegrity, RULE_ID as CASCADE_INTEGRITY_RULE_ID, } from './rules/cascade-integrity.js';
import { crudRoundtrip, RULE_ID as CRUD_ROUNDTRIP_RULE_ID, } from './rules/crud-roundtrip.js';
export * from './scenario-types.js';
export { renderScenarioFile } from './translators/api.js';
export { renderScenarioHarness, HARNESS_FILENAME } from './harness-emitter.js';
// Spec normalization is shared with the UI-contract stage.
export { normalizeSpec } from '../ui-contracts/index.js';
/** Registered scenario rules. Adding coverage = adding an entry + a rule file. */
const RULES = [
    { id: CRUD_ROUNDTRIP_RULE_ID, rule: crudRoundtrip },
    { id: LIFECYCLE_PATH_WALKABLE_RULE_ID, rule: lifecyclePathWalkable },
    { id: CASCADE_INTEGRITY_RULE_ID, rule: cascadeIntegrity },
];
/**
 * Run every rule over the spec and render each rule's cases into one
 * test file. Rules producing zero cases are skipped.
 */
export function generateScenarioTests(spec) {
    const files = [];
    for (const { id, rule } of RULES) {
        const cases = rule(spec);
        if (cases.length === 0)
            continue;
        files.push({
            filename: `${id}.scenario.test.ts`,
            contents: renderScenarioFile(id, cases),
            testCount: cases.length,
        });
    }
    return files;
}
//# sourceMappingURL=index.js.map