yarn install
yarn test # the validator's own tests
yarn validate # every example in examples/
node scripts/validate-examples.js my.json # one contract
node scripts/validate-examples.js --chain rounds/ # contract revisions and the AGC rounds judged against them
The validator checks the JSON Schema and the rules a schema cannot express. Those rules are marked [V] in the spec:
- the fingerprint matches the criteria, and revisions are consecutive with a changed fingerprint;
- ids and classes are unique, and each kind carries the checks and the list, domain or construction it needs;
- a blocking finding against a non-judgment criterion carries a
commandcheck on a case the contract holds; - an extension is never dispatched to the builder, and at the extension budget the gate escalates with grow, close and narrow;
- each round names the revision it judged against.
validateContract(contract) returns errors and warnings. validateAgainst(contract, agcResponse) classifies each finding as against a criterion or an extension and enforces the probe rule. validateChain(contracts, responses) checks revisions, fingerprints and the extension budget. The AGC response itself is validated by AGC’s validator; this one reads only the fields AAC links to.