Validate Foundry
Validate the structural integrity of the EOU Foundry at foundry/.
Required reading (load in order)
schemas/eou.schema.yml— the authoritative EOU spec schemaschemas/ecp.schema.yml— the authoritative ECP schemafoundry/constitution.ymlfoundry/registry.yml
Stop conditions
Stop and record a critical finding if:
- Any schema file in
schemas/*.schema.ymlis absent — validation cannot proceed without schemas. foundry/directory does not exist in the working directory.
Validation checks
Run each check in order. Record every violation — do not stop at first failure.
1. Schema presence
Verify all schema files in schemas/*.schema.yml exist. If any are absent, record a "schema file absent" critical finding and stop (cannot validate specs without schemas).
2. EOU spec completeness
For each spec in foundry/eous/ and foundry/meta-eous/:
- Every field listed in
schemas/eou.schema.ymlrequired_top_levelmust be present. classificationmust include all six facets:function,target_object,automation_mode,authority_level,risk_level,lifecycle_stage.- All enum values must match schema allowed values (see
valid_*lists inschemas/eou.schema.yml). - No placeholder strings: reject "target artifact", "What this EOU is meant to do", "Perform bounded operation".
3. Registry consistency
- Every spec with
lifecycle_stage: activeorpilotmust have a registry entry infoundry/registry.yml. - Every registry entry must have a matching spec file in
foundry/eous/orfoundry/meta-eous/. - Flag orphan specs (no registry entry at active/pilot) and unregistered active EOUs.
4. Recursive governance constraints
- For each spec:
responsibility.executormust not equalresponsibility.approver(self-approval violation). - For each spec with
function: generate:generation_envelope.forbidden_outputsmust includeactive_eou,approved_eou, andconstitution_change.
5. Generation safety
For each spec with function: generate:
generation_envelope.allowed_outputsmust not includeactive_eou,approved_eou, or any variant ofconstitution_change.generation_envelope.default_statusmust becandidate.
Run deterministic validator
python3 scripts/validate_foundry.py
Include the output in the validation report.
Output
Write the validation report to foundry/audits/validation/{YYYYMMDD}.validation.yml:
validation_date:
checks_run:
- check_name:
status: # pass | fail | skipped
findings:
- severity: # critical | high | medium | low
eou_id: # or "foundry-wide"
description:
required_fix:
summary:
total_findings:
by_severity: {critical: N, high: N, medium: N, low: N}
verdict: # PASS | FAIL | CONDITIONAL_PASS
Constraints
- This skill validates the entire Foundry at
foundry/, not a single EOU. Use$eou-auditto audit a specific EOU spec. - Do not modify any spec, schema, registry, or governance file — produce the validation report only.
- Treat missing required fields as failures, not warnings.
- Zero findings for a Foundry with more than 5 specs is statistically improbable — record it as a
low-severity finding: "No violations found; verify checks ran against all specs."
Scope Note
Upstream: no specific input — runs against the whole foundry/ tree. Typically invoked before opening a PR or release.
Downstream: produces a validation report under foundry/audits/validation/. Failures may seed $eou-diagnose (if a structural failure traces to an EOU) or $eou-refactor.
Related: $eou-audit (sibling — judgment-heavy audit; this skill is mechanical/structural); $foundry-audit (sibling — system-wide, includes vocabulary and governance drift).
Pipeline: pre-release | pre-PR → eou-validate → (failures) eou-diagnose | eou-refactor