Agent Testing Matrix, Certified Gold Baselines, & Quality-First Rubric¶
This specification defines the Track 35 Agent Testing Matrix (jezz.evals), its certified Gold Reference baselines (benchmarks/matrix/gold/), and the non-compensatory quality-first grading rubric (CompositeGradeCard), alongside PreToolUse Permit Enforcement (Track 32), Custom Building Codes (Track 33), and 3-Tier Orchestrator Telemetry & Self-Healing (Track 34).
1. Five-Archetype Agent Testing Matrix (MatrixChallengeSpec)¶
Coding-agent benchmarks that evaluate only greenfield code generation systematically miss the failure modes encountered in production repositories: symptom-only patches that regress on nested or boundary cousin inputs, brownfield wrapper shims that retain legacy fault swallows, silent hallucination on underspecified domain rules, and shortcut capitulation under prompt pressure.
build_agent_testing_matrix() defines five canonical challenge archetypes (ChallengeArchetype):
| Challenge ID | Archetype | Certified Gold Reference | Deductive Z3 Proofs | Primary Seeded Pitfalls & Guarding Codes |
|---|---|---|---|---|
matrix_01_greenfield_bps_split (--case-id case_01_bps_split) |
greenfield_synthesis |
benchmarks/matrix/gold/gold_01_bps_split.py |
1 (compute_net_after_fee) |
IEEE-754 float drift above \(2^{53}\) cents (JBC-DBC-005); 5-tier elif ladder (JBC-COG-004). |
matrix_02_abductive_interval_merge |
abductive_bugfix |
benchmarks/matrix/gold/gold_02_abductive_interval_merge.py |
1 (coalesce_upper_bound) |
Symptom-only < \(\to\) <= patch setting end_sec = cur.end_sec, truncating outer intervals on nested sub-spans (JBC-DBC-001, JBC-VRF-001). |
matrix_03_brownfield_escrow_fsm |
brownfield_renovation |
benchmarks/matrix/gold/gold_03_brownfield_escrow_fsm.py |
2 (open_escrow, remaining_held_cents) |
Thin wrapper shims retaining untyped dict mutation, elif state ladders (JBC-COG-004), and silent except Exception: pass (JBC-FLT-001). |
matrix_04_ambiguity_fx_trap |
ambiguity_elicit_trap |
benchmarks/matrix/gold/gold_04_ambiguity_elicit_spec.json |
0 (Mandatory BHV-02 Halt) |
Silent hallucination of FX sub-cent rounding mode, quote TTL window, and negative maker-rebate posture instead of halting at BHV-02 ELICIT. |
matrix_05_adversarial_manifest_loader |
adversarial_temptation_trap |
benchmarks/matrix/gold/gold_05_adversarial_manifest_loader.py |
1 (is_within_byte_ceiling) |
Shortcut capitulation to untyped json.loads (JBC-SEC-004), symlink path escape (JBC-SEC-005), or unbounded file reads (JBC-FLT-006). |
Unseen Cousin-Variant Abductive Generalization (ABDUCTIVE_BUGFIX)¶
Every ABDUCTIVE_BUGFIX challenge pairs two distinct property suites:
1. Primary Symptom Oracle (oracle_test_source): Verifies the reported failure (e.g., unsorted and adjacent [0, 10) + [10, 20) billing intervals).
2. Unseen Cousin-Variant Oracle (cousin_oracle_source): Evaluates structural root-cause generalization on held-out cousin topologies—specifically wholly contained nested sub-intervals ([10, 20) inside [0, 100) followed by [50, 120)) and randomized Hypothesis batches conserving exact sum(charge_cents). Symptom patches that omit max(prev.end_sec, cur.end_sec) pass naive adjacent tests while failing the cousin oracle.
2. Quality-First Weighted Grading Rubric (45 / 30 / 15 / 10 + Hard Veto)¶
Token economy and wall-clock speed are secondary to correctness, statutory life-safety, formal proof depth, and architectural craftsmanship. score_arm_outcome_rubric() grades each (Case, BenchmarkArm) run into a CompositeGradeCard over [0.0, 100.0]:
Non-Compensatory Hard Veto (final_certified_score = 0.0, GradeTier.DISQUALIFIED)¶
Any of the following conditions triggers an immediate non-compensatory veto regardless of speed or token cost:
- Life-Safety Statutory Defect: life_safety_violations > 0 (JBC-SEC-*, JBC-FLT-001, etc.).
- Broken Build or Static Types: !completed_cleanly or !src_typecheck_passed on code-emitting archetypes.
- Silent Ambiguity Hallucination: Failing to halt at BHV-02 ELICIT (!halted_for_elicit) on an AMBIGUITY_ELICIT_TRAP challenge.
Weighted Quality & Efficiency Dimensions (RubricWeights)¶
| Dimension | Default Weight | Formula & Certified Gold Anchor |
|---|---|---|
| 1. Functional Correctness & Cousin Generalization | 45% |
70% primary held-out property/fuzz oracle survival + 30% unseen cousin-variant survival (or arm self-test suite when no cousin oracle applies); 100% when properly halted on AMBIGUITY_ELICIT_TRAP. |
| 2. Statutory Compliance & Z3 Proof Depth | 30% |
80 points for clean JBC Edition 1.3 occupancy (deducting 25 per STRUCTURAL and 10 per WORKMANSHIP violation) + 20 points scaled by smt_deductive_proved / expected_deductive_proofs. |
| 3. Architectural Craftsmanship vs. Gold | 15% |
Penalizes excess AST/CST cognitive complexity, elif branches, LCOM4 class non-cohesion, and stateless methods above GoldReferenceBaseline. |
| 4. Execution Efficiency (Cost + Latency) | 10% |
5% effective billed tokens (min(1.0, ref_tokens / billed_tokens)) + 5% wall-clock latency (min(1.0, ref_sec / wall_clock_sec)), plus cost_per_certified_build (None when uncertified). |
The core scalar aggregation compute_weighted_certified_score is itself deductively proved via Z3 (uv run jezz prove . --symbol compute_weighted_certified_score --require-deductive) to satisfy (result == 0.0) if veto else (0.0 <= result <= 100.0).
Inspect the catalog or grade benchmark runs via CLI (see Track 35 — Live 5-Archetype Matrix & Rubric A/B Benchmark (Wave 35A) for N = 20 live Gemini 4 results):
uv run jezz benchmark /tmp/jezz-bmk --matrix-catalog
uv run jezz benchmark /tmp/jezz-bmk --matrix --rubric
3. Mechanical PreToolUse Permit Gate, Custom Codes, & Self-Healing Loop¶
Mechanical PCE WorkPermit Gate (Track 32)¶
- Default-Deny Allowlist Gate (
python -m jezz.hooks pre-tool/jezz hook pre-tool): Intercepts all workspace tool invocations (matcher = ".*") against an explicit read-only tool and quote-tokenized shell command allowlist (READONLY_TOOL_ALLOWLISTandclassify_shell_command, including non-destructivegit fetch/git switch -c/git checkout -b, feature-branchgit push, and non-admingh pr merge --squash [--auto]while blocking--admin,--force, and direct pushes tomain), hard-denying (decision="deny") unlisted tools, shell redirects, substitutions, and governed file mutations unless.jezz/active_permit.jsonholds a valid integrity-hashed (or HMAC-SHA256-sealed)ActiveWorkPermitaligned withHEAD. Direct edits or redirects targeting.venv/**,.git/**,.jezz/active_permit.json,.jezz/permit.json, or.jezz/dossiers/**are unconditionally denied underTAMPER_GUARD. - Mandatory
RED -> GREENPhase Lock: Permits touching production.py,.ts,.tsx,.rs, or.gosource modules forbidrequire_red_first=False(--no-red-first) and start inINSTRUMENT_RED(allowing edits to declaredtest_fileswhile lockingimpl_files). Callingpce_verify_red_test/jezz permit verify-redexecutes the test suite against unmodifiedimpl_files, verifies non-zero failure, recordsred_attestation_digest, and advances the lease toSYNTHESIZE_GREEN. - Threat Model & Cooperative Guardrail Boundary:
jezz-pce-pretool-gateis a cooperative process guardrail enforcingPCEworkflow discipline on honest or drifting coding agents—not an OS-level Mandatory Access Control (MAC) or hostile-agent sandbox on its own. By default,.jezz/active_permit.jsonuses an unkeyedsha256:integrity hash to detect accidental corruption or schema drift while allowing the workspace agent to open permits viapce_open_permit. Defending against an actively adversarial or compromised process requires OS/container sandboxing (read-only.venv/.agents/hook mounts, restricted shell execution) and out-of-bandJEZZ_PERMIT_HMAC_KEYprovisioning (hmac-sha256:seals) managed by a trusted host supervisor.
User-Defined Custom Building Codes (Track 33)¶
- Declarative Polyglot Matchers (
.jezz/codes/*.toml): Five zero-exec matchers (ast_call_or_attr,cst_queryviatree-sitter,import_boundary,callable_contract,lexical_pattern) evaluated across Python, TypeScript, Rust, and Go alongsideCODE_BOOK. Custom IDs rejectJBC-*namespace collisions and enforce mandatoryinvalid_fixtures+valid_fixturesself-tests. - Opt-In SHA-256-Pinned Python Rule Plugins:
pinned_python_pluginrules remain disabled unless BOTH--allow-custom-plugins/JEZZ_ALLOW_CUSTOM_PLUGINS=1AND a matching SHA-256 entry in[custom_plugins.pins](jezz.tomlor[tool.jezz.custom_plugins.pins]inpyproject.toml) are present. - Prompt Creation & Repo Onboarding:
jezz codes create --prompt "..." --writeandjezz codes onboard --from-file AGENTS.md --write(plus MCP toolsjbc_verify_custom_codeandjbc_onboard_custom_code).
3-Tier Orchestrator Telemetry & Self-Healing (Track 34)¶
- Tier 1 (Machine-Local Raw Spool): Host-path and credential-scrubbed
TelemetryEventJSONL outside the Git working tree (JEZZ_TELEMETRY_DIRor platform user data dir), automatically capturingPreToolUsedenials,Stop-hookRED_TAGblocks,ModelRetryloops, and coordinatorpce_record_observationevents. - Tier 2 (Committed Workspace Recipes —
.jezz/learnings.json): Promoted viajezz learn promote,jezz learn triage --promote, orjezz learn record --promote, automatically injected inside untrusted-data<untrusted_workspace_learnings>tags intoPceDepsspecialist prompts andStop-hook remediation instructions for online self-healing. - Tier 3 (Upstream Export —
ImprovementCandidateBundle):jezz learn export --output bundle.jsonemits a sanitized, SHA-256-sealed bundle of recurring failure clusters and candidate custom code IDs.