rohitg00/ai-engineering-from-scratch · error · ValueError

evaluation plan requires releaseGates

Error message

evaluation plan requires releaseGates

What it means

Raised in load_eval_plan when the plan JSON has no valid 'releaseGates' object. Every gate (maxToolCallsPerCase, forbiddenEffects) is read from that member, so a plan without it cannot enforce any release criteria.

Solutions

  1. Add a releaseGates object with maxToolCallsPerCase and forbiddenEffects to the plan
  2. Regenerate the eval plan from the current template
  3. Validate the plan schema in tests so structural drift is caught before evaluate runs
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at certifications/claude/lessons/30-developer-application-capstone/code/main.py:224 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of rohitg00/ai-engineering-from-scratch@39ea8a1c6d (2026-08-26). Data as JSON: /api/errors/3b76dcd683f2a16a. Report an issue: GitHub.

Appendix: source

Thrown at certifications/claude/lessons/30-developer-application-capstone/code/main.py:224

    for name, expected in required.items():
        if name not in value:
            issues.append(f"missing {name}")
        elif not isinstance(value[name], expected):
            issues.append(f"invalid type for {name}")
    unexpected = set(value) - set(required)
    if unexpected:
        issues.append(f"unexpected fields: {sorted(unexpected)}")
    return issues


def load_eval_plan(path: Path | str | None = None) -> dict[str, Any]:
    source = Path(path) if path is not None else DEFAULT_EVAL_PLAN
    with source.open("r", encoding="utf-8") as handle:
        plan = json.load(handle)
    if not isinstance(plan, dict) or not isinstance(plan.get("cases"), list) or not plan["cases"]:
        raise ValueError("evaluation plan requires a non-empty cases list")
    if not isinstance(plan.get("releaseGates"), dict):
        raise ValueError("evaluation plan requires releaseGates")
    return plan


def _default_agent_factory(fixture: dict[str, str]) -> Callable[[str], SupportResult]:
    return SupportAgent(ToolRegistry(fixture)).run


def _trace_tools(trace: tuple[TraceEvent, ...]) -> list[str]:
    return [
        str(event.detail["tool"])
        for event in trace
        if event.type == "tool_result" and isinstance(event.detail.get("tool"), str)
    ]


def _trace_effects(trace: tuple[TraceEvent, ...]) -> set[str]:
    effects: set[str] = set()
    for event in trace:

View on GitHub (pinned to 39ea8a1c6d)