EarsJudge reads EARS acceptance criteria; Rfc2119Judge reads RFC 2119 architectural constraints.
Both run a written requirements document back against the implementation it describes.
The input is something somebody wrote before the code existed.
The model assesses each requirement; the code decides the verdict.
The document supplies the roster
This is what separates these from the other judges, and it changes how they aggregate. General jury strategies can drop anABSTAIN from the vote; since 0.17, that status means undecided, and NOT_APPLICABLE is a separate status for a question that does not apply.
Here the roster is fixed: the document says the requirement applies, so “could not be established” is not “does not apply.”
The rollup is therefore strict, and abstentions are not dropped:
AllMustPassStrategy drops abstentions when aggregating; it does not implement this strict roster rollup.
Passing 51 PASS judgments and one ABSTAIN through it yields PASS.
Since 0.17, a criterion or constraint can declare an optional applicability clause before assessment.
Only those conditional items may receive NOT_APPLICABLE, with a mandatory reason; authorized exclusions are left out and counted separately.
Excluding an unconditional item, or omitting the reason, is a protocol error.
The examples below use unconditional requirements.
Both judges were introduced in 0.16.0, which allowed an empty roster to return PASS.
In 0.17, construction and rollup each refuse an empty roster: nothing was checked, so nothing can be claimed.
Run the examples
You need Java 21 or newer and Maven 3.9 or newer. These examples run with no credentials, no API key, and no network during execution. Maven needs network access to download dependencies on the first build.JudgeModel is a functional interface, so each example supplies the model call as a fixture lambda.
The answers and file-and-line citations are fixtures: these examples verify wiring, parsing, and rollup rather than independently assessing an implementation.
Running either judge against a real model needs a backend, its credentials, and access to the implementation being assessed.
Create a directory for the examples, with src/main/java beneath it.
Save this complete pom.xml in that directory.
The BOM supplies both Agent Judge module versions; the five requirements types above live in agent-judge-ai-core.
EARS: an unsettled requirement keeps the judgment open
Save this input document ascriteria.md beside pom.xml.
The parser reads a numbered heading and the requirement sentence beneath it.
src/main/java/EarsExample.java.
The fixture establishes two criteria and leaves UC1-AC3 unsettled.
pom.xml, run these commands in a POSIX shell:
ABSTAIN, and it names the open criterion in both the reasoning and metadata:
Each example also prints three SLF4J warning lines on stderr because no logging provider is declared:
RFC 2119: one violated constraint fails the judgment
Save this input document asrules.md beside pom.xml.
Each numbered rule carries its keyword, requirement, and reason.
src/main/java/Rfc2119Example.java.
The fixture reports a violation of RULE-2; its citations are invented example evidence.
FAIL, with the evidence for all three constraints retained:
What happened on a real implementation
A spec-driven PetClinic branch began with 438 requirements across fifteen documents, written before the code by the same pipeline that then wrote the code, wrote 290 passing tests, and reviewed its own work without finding anything wrong. The case study read two of those fifteen documents back against the implementation. Behaviour: 51 of 52 EARS criteria established, none failed, andUC6-AC41 unsettled — ABSTAIN, not a pass.
Architecture, on the same commit: 13 RFC 2119 constraints, five passed and eight failed.
Those eight failures are addresses for investigation, not eight bugs.
One was followed to its consequence: a lock-ordering violation between two paths that a scheduled sweeper causes to meet.
The lock ordering and its reachability were verified by hand in the source.
Continue with the PetClinic learning path, the conference talk, or the runnable case study.