99 uv run python -m se_theory_neutral_substrate validate --strict
1010 uv run python -m se_theory_neutral_substrate validate --require-tag
1111 uv run python -m se_theory_neutral_substrate sync
12+ uv run python -m se_theory_neutral_substrate scaffold
13+ uv run python -m se_theory_neutral_substrate scaffold --dry-run
14+ uv run python -m se_theory_neutral_substrate scaffold --overwrite
15+ uv run python -m se_theory_neutral_substrate ref-validate
16+ uv run python -m se_theory_neutral_substrate ref-validate --strict
1217
1318Call chain:
1419 __main__.py -> cli.main()
1520 -> orchestrate.run_validate() (sync_all called internally)
1621 -> sync.sync_all() (sync only, no validation)
22+ -> reference.run_scaffold() (scaffold + validate reference/)
23+ -> reference.run_ref_validate() (validate reference/ only)
1724"""
1825
1926import argparse
2027
2128from se_manifest_schema .sync import sync_all
2229
2330from se_theory_neutral_substrate .orchestrate import run_validate
31+ from se_theory_neutral_substrate .reference import run_ref_validate , run_scaffold
2432
2533
2634def build_parser () -> argparse .ArgumentParser :
@@ -51,6 +59,40 @@ def build_parser() -> argparse.ArgumentParser:
5159 help = "Sync pyproject.toml fallback-version from CITATION.cff version." ,
5260 )
5361
62+ # -- scaffold -------------------------------------------------------------
63+ scaffold_parser = subparsers .add_parser (
64+ "scaffold" ,
65+ help = (
66+ "Scaffold reference/ artifacts from Lean 4 source. "
67+ "Adds stub entries for symbols not yet in the registry. "
68+ "Existing descriptions, names, and cite_ids are preserved."
69+ ),
70+ )
71+ scaffold_parser .add_argument (
72+ "--dry-run" ,
73+ action = "store_true" ,
74+ help = "Report what would change without writing any files." ,
75+ )
76+ scaffold_parser .add_argument (
77+ "--overwrite" ,
78+ action = "store_true" ,
79+ help = "Overwrite existing descriptions, names, and cite_ids with re-derived values." ,
80+ )
81+
82+ # -- ref-validate ---------------------------------------------------------
83+ ref_validate_parser = subparsers .add_parser (
84+ "ref-validate" ,
85+ help = (
86+ "Validate reference/ artifacts against Lean 4 source. "
87+ "Reports orphaned symbols and missing entries. Writes nothing."
88+ ),
89+ )
90+ ref_validate_parser .add_argument (
91+ "--strict" ,
92+ action = "store_true" ,
93+ help = "Treat warnings (orphaned symbols, missing stubs) as errors." ,
94+ )
95+
5496 return parser
5597
5698
@@ -72,6 +114,15 @@ def main(argv: list[str] | None = None) -> int:
72114 if args .command == "sync" :
73115 sync_all ()
74116 return 0
117+ if args .command == "scaffold" :
118+ return run_scaffold (
119+ dry_run = args .dry_run ,
120+ overwrite = args .overwrite ,
121+ )
122+ if args .command == "ref-validate" :
123+ return run_ref_validate (
124+ strict = args .strict ,
125+ )
75126
76127 except (ValueError , FileNotFoundError , RuntimeError ) as e :
77128 print (f"Error: { e } " )
0 commit comments