46 parser = argparse.ArgumentParser(description=
"Audit PETSc option ingress against manifest.")
49 default=
"scripts/audit_ingress_manifest.json",
50 help=
"Path to ingress manifest JSON.",
55 help=
"Print scanned option list before comparison.",
57 args = parser.parse_args()
59 repo_root = pathlib.Path(__file__).resolve().parents[1]
60 manifest_path = (repo_root / args.manifest).resolve()
61 scan_paths = [repo_root /
"src/setup.c", repo_root /
"src/io.c"]
63 if not manifest_path.exists():
64 print(f
"[ERROR] Manifest not found: {manifest_path}", file=sys.stderr)
70 missing_in_manifest = sorted(scanned - expected)
71 stale_in_manifest = sorted(expected - scanned)
74 print(
"[INFO] Scanned PETSc options:")
75 for flag
in sorted(scanned):
79 print(f
"[INFO] Scanned options: {len(scanned)}")
80 print(f
"[INFO] Manifest options: {len(expected)}")
82 if missing_in_manifest:
83 print(
"[ERROR] New PETSc ingress options missing in manifest:")
84 for flag
in missing_in_manifest:
88 print(
"[ERROR] Manifest options no longer present in setup/io scan:")
89 for flag
in stale_in_manifest:
92 if missing_in_manifest
or stale_in_manifest:
94 "[FAIL] Ingress drift detected. Update scripts/audit_ingress_manifest.json and docs mapping.",
99 print(
"[OK] Ingress manifest matches setup/io PETSc option scan.")