report_inventory_diagnostic.py

verification/proofs/toolchain/report_inventory_diagnostic.py

report_inventory_diagnostic.py61 lines← SDK documentation
1#!/usr/bin/env python32"""Solver-free omission controls for the 2026-11-04 report-admission review.34These are authored synthetic fixtures, not recorded solver results. Exit 1 means5an incomplete fixture was accepted. No verifier, installation or cache is used.6The original baseline a4548fc13f84ffecc8c75446d3dd89b211802659 accepted both7omissions. Current positive fixtures use the required source inventory; a schema8change must update the positive fixtures too.9"""10from pathlib import Path11import copy12import sys1314sys.path.insert(0, str(Path(__file__).resolve().parents[2] / 'tools'))15import creusot_report16import kani17import stable_capacity181920def kani_fixture():21    # Source-derived synthetic checks include the actual semantic postconditions;22    # this is not a recorded or trusted successful verifier result.23    from test_kani import report24    kani.EXPECTED_HARNESSES['stable-direct'] = stable_capacity.SUITES['direct'][1]25    return report('stable-direct')262728def main():29    accepted = []30    complete = kani_fixture()31    kani.validate_report(complete, 'stable-direct', 0)32    missing = copy.deepcopy(complete)33    for result in missing['verification_results']['results']:34        result['checks'] = [c for c in result['checks'] if c['category'] != 'cover']35    try:36        kani.validate_report(missing, 'stable-direct', 0)37        accepted.append('Kani: zero of seven declared direct-suite covers')38    except RuntimeError:39        pass4041    # The existing checker tests use the same synthetic imported-goal shape.42    leaf = {'prover': 'cvc5', 'time': 0.1}43    complete = {'profile': [], 'proofs': {'Coma': {44        'vc_example': leaf, 'vc_callee_precondition': leaf}}}45    creusot_report.validate_report(complete, 'vc_example', {'vc_example', 'vc_callee_precondition'})46    missing = copy.deepcopy(complete)47    del missing['proofs']['Coma']['vc_callee_precondition']48    try:49        creusot_report.validate_report(missing, 'vc_example', {'vc_example', 'vc_callee_precondition'})50        accepted.append('Creusot: omitted non-main verification goal')51    except RuntimeError:52        pass53    for gap in accepted:54        print('INCOMPLETE_REPORT_ACCEPTED: ' + gap)55    if not accepted:56        print('OMISSION_CONTROLS_REJECTED: Kani source covers and Creusot generated goal inventory')57    return bool(accepted)585960if __name__ == '__main__':61    sys.exit(main())