affaan-m/ECC · error · KeyError

Missing 'scoring' section in compliance spec

Error message

Missing 'scoring' section in compliance spec

What it means

Structural guard in parse_spec: the YAML loaded successfully but has no top-level 'scoring' key, so there is no promotion threshold to read. Steps alone are not enough; the spec must also define scoring rules.

Solutions

  1. Add a scoring section to the spec YAML (it must include threshold_promote_to_hook)
  2. Regenerate the spec; the generator normally emits a complete scoring block
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at skills/skill-comply/scripts/parser.py:98 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/0975839f5635cf49. Report an issue: GitHub.

Appendix: source

Thrown at skills/skill-comply/scripts/parser.py:98

        raise FileNotFoundError(f"Spec file not found: {path}")
    raw = yaml.safe_load(path.read_text())

    steps: list[Step] = []
    for s in raw["steps"]:
        d = s["detector"]
        steps.append(Step(
            id=s["id"],
            description=s["description"],
            required=s["required"],
            detector=Detector(
                description=d["description"],
                after_step=d.get("after_step"),
                before_step=d.get("before_step"),
            ),
        ))

    if "scoring" not in raw:
        raise KeyError("Missing 'scoring' section in compliance spec")

    return ComplianceSpec(
        id=raw["id"],
        name=raw["name"],
        source_rule=raw["source_rule"],
        version=raw["version"],
        steps=tuple(steps),
        threshold_promote_to_hook=raw["scoring"]["threshold_promote_to_hook"],
    )

View on GitHub (pinned to 8321021c54)