Generate Regression Cases
Convert $source (one or more incident reports or audit failures) into candidate regression cases.
Inputs
$source(required) — path to one or more incident reports or audit failure files. Accepts a direct file path or a glob (e.g.,foundry/audits/incidents/*.yml). Every matched file must contain at least one observable failure symptom.
Required reading
foundry/failure-taxonomy.yml— classify each failure by F-codefoundry/constitution.yml— invariants that constrain what counts as a valid regression caseschemas/incident.schema.yml— validate structured YAML incident files against this schemaschemas/regression-case.schema.yml— the schema for the output regression case files
Stop conditions
Halt and report before generating cases if:
$sourceresolves to no readable files.- No observable failure symptom can be extracted from any source file — labels and conclusions without at least one observable symptom (error message, wrong output, missing artifact, schema mismatch) are not accepted as source input.
schemas/regression-case.schema.ymldoes not exist — cannot validate output structure.
Procedure
- Load
$source. If it is a glob, read all matching files. - For each incident or audit failure, extract the observable failure symptom.
- Classify the failure using
foundry/failure-taxonomy.yml(F1–F12). - Derive the regression case: the minimal input that reproducibly triggers the failure.
- Construct the fixture path:
foundry/self-evolution/regression/fixtures/{case_id}/. - Check
foundry/self-evolution/regression/cases/for existing cases that cover this failure — skip if a duplicate exists; record the duplicate case ID instead. - For each new case, write the regression case file with all required fields.
- Set
activation_status: candidateon all generated cases — neveractive.
Required fields per case (per schemas/regression-case.schema.yml)
id: # regression-{eou_id}-{failure_class}-{YYYYMMDD}
source_incident_id: # incident or audit ID this case was derived from
failure_class: # F1-F12 code
eou_id: # EOU that exhibited the failure
fixture_path: # foundry/self-evolution/regression/fixtures/{case_id}/
failure_shape_assertion: # observable output that indicates the failure is occurring (non-empty)
activation_status: # candidate — never active without human approval
Output
Write each case to foundry/self-evolution/regression/cases/{case_id}.regression.yml.
Create the fixture directory at foundry/self-evolution/regression/fixtures/{case_id}/.
Record the run in foundry/runs/{eou_id}/{run_id}.yml.
Constraints
- Do not set
activation_status: active. Cases are candidates until the human owner promotes them. - Do not generate cases without a concrete source incident or audit failure.
- Each case must include at least one
failure_shape_assertion— what observable output signals the failure is occurring. Cases asserting only pass are invalid. - If a duplicate case exists for this failure, record the duplicate ID and skip generation.
Scope Note
Upstream: receives incidents (foundry/incidents/) or audit findings (foundry/audits/eou-audits/).
Downstream: produces regression cases at foundry/self-evolution/regression/cases/ at activation_status candidate. Cases enter the regression suite only after human owner approval — this skill never sets activation_status to active.
Related: $eou-diagnose (sibling — F-code classification of the same incident); $ecp-propose (sibling — proposes change; regression cases pin the failure so the change can be verified).
Pipeline: incident | audit failure → generate-regression-cases → human approval → activation_status: active