maida assert#
Evaluates one already-completed trace through the legacy single-run assertion interface. New tier-aware and statistical gates should use maida run; maida assert remains for v1 compatibility and direct trace inspection.
Usage:
maida assert [TRACE_ID] [options]
Arguments / options:
Argument/Option |
Default |
Description |
|---|---|---|
|
(latest run) |
OTel trace ID or prefix to check |
|
- |
Baseline JSON file to compare against |
|
|
Policy file; v1 loads with a deprecation warning |
|
- |
Max total events allowed |
|
|
Fractional tolerance for step count |
|
- |
Max tool calls allowed |
|
|
Fractional tolerance for tool calls |
|
|
Fail if run uses tools not in baseline |
|
|
Fail if any LOOP_WARNING present |
|
|
Fail if any guardrail was triggered |
|
- |
Max total tokens allowed |
|
|
Fractional tolerance for token cost |
|
- |
Max run duration in ms |
|
|
Fractional tolerance for duration |
|
- |
Expected run status ( |
|
|
Output format: |
Precedence: CLI flags override the policy file, which overrides defaults. See the Policy YAML reference for the full override rules and threshold semantics.
Examples:
# Assert the latest run against a baseline with default tolerances
maida assert --baseline .maida/baselines/my_agent.json
# Assert a specific run with standalone thresholds (no baseline)
maida assert a1b2c3d4 --max-steps 80 --max-tool-calls 30 --no-loops
# Assert using a policy file
maida assert --baseline baseline.json --policy ci-policy.yaml
# Markdown output for GitHub PR comments / step summaries
maida assert --baseline baseline.json --format markdown
Exit codes: 0 all checks passed; 1 one or more checks failed; 2 run or baseline not found; 10 internal error.
Each assertion result includes a stable reason_code; JSON output also includes a top-level reason_codes array for failed checks. Markdown output starts with a pass/fail verdict, shows Top behavior changes when a baseline diff is available, groups failed checks by reason code, and includes concise next steps plus a local-repro snippet. The text report appends the structural diff on failure.