1- """cli.py - Command-line interface for se-manifest-schema .
1+ """cli.py - Command-line interface for se-theory-identity-regimes .
22
3- Parses arguments and dispatches to orchestrate.py or sync.py.
4- Owns nothing except argument parsing and error handling.
5- All logic lives in orchestrate.py and sync.py.
3+ Parses arguments and dispatches to repository validation, manifest-schema
4+ validation, version sync, and reference artifact tooling.
65
76Entry points:
8- uv run se-manifest-validate
9- uv run se-manifest-validate --strict
10- uv run se-manifest-validate --require-tag
7+ uv run se-validate
8+ uv run se-validate --strict
9+ uv run se-validate --require-tag
10+
11+ uv run se-manifest-schema-validate
12+ uv run se-manifest-schema-validate --strict
13+ uv run se-manifest-schema-validate --require-tag
1114
1215 uv run se-manifest-version-sync
1316
14- uv run se-ref-scaffold
1517 uv run se-ref-scaffold --dry-run
18+ uv run se-ref-scaffold
1619 uv run se-ref-scaffold --overwrite
1720
1821 uv run se-ref-validate
1922 uv run se-ref-validate --strict
20-
21- Call chain:
22- __main__.py -> cli.main()
23- -> orchestrate.run_validate() (sync_all called internally)
24- -> sync.sync_all() (sync only, no validation)
25- -> reference.run_scaffold() (scaffold + validate reference/)
26- -> reference.run_ref_validate() (validate reference/ only)
2723"""
2824
2925import argparse
3026import sys
3127
28+ from se_manifest_schema .orchestrate import run_validate as run_validate_manifest
3229from se_manifest_schema .sync import sync_all
3330
3431from se_theory_neutral_substrate .orchestrate import run_validate
@@ -43,9 +40,10 @@ def build_parser() -> argparse.ArgumentParser:
4340 )
4441 subparsers = parser .add_subparsers (dest = "command" )
4542
43+ # -- validate ------------------------------------------------------------
4644 validate_parser = subparsers .add_parser (
4745 "validate" ,
48- help = "Sync and validate manifest-schema.toml and SE_MANIFEST.toml ." ,
46+ help = "Run full repository validation ." ,
4947 )
5048 validate_parser .add_argument (
5149 "--strict" ,
@@ -58,12 +56,29 @@ def build_parser() -> argparse.ArgumentParser:
5856 help = "Require CITATION.cff version to match current git tag." ,
5957 )
6058
59+ # -- schema-validate -----------------------------------------------------
60+ schema_validate_parser = subparsers .add_parser (
61+ "schema-validate" ,
62+ help = "Validate only the manifest schema layer." ,
63+ )
64+ schema_validate_parser .add_argument (
65+ "--strict" ,
66+ action = "store_true" ,
67+ help = "Treat warnings as errors." ,
68+ )
69+ schema_validate_parser .add_argument (
70+ "--require-tag" ,
71+ action = "store_true" ,
72+ help = "Require CITATION.cff version to match current git tag." ,
73+ )
74+
75+ # -- sync ----------------------------------------------------------------
6176 subparsers .add_parser (
6277 "sync" ,
6378 help = "Sync pyproject.toml fallback-version from CITATION.cff version." ,
6479 )
6580
66- # -- ref-scaffold -------------------------------------------------------------
81+ # -- ref-scaffold --------------------------------------------------------
6782 ref_scaffold_parser = subparsers .add_parser (
6883 "ref-scaffold" ,
6984 help = (
@@ -83,7 +98,7 @@ def build_parser() -> argparse.ArgumentParser:
8398 help = "Overwrite existing descriptions, names, and cite_ids with re-derived values." ,
8499 )
85100
86- # -- ref-validate ---------------------------------------------------------
101+ # -- ref-validate --------------------------------------------------------
87102 ref_validate_parser = subparsers .add_parser (
88103 "ref-validate" ,
89104 help = (
@@ -94,19 +109,24 @@ def build_parser() -> argparse.ArgumentParser:
94109 ref_validate_parser .add_argument (
95110 "--strict" ,
96111 action = "store_true" ,
97- help = "Treat warnings (orphaned symbols, missing stubs) as errors." ,
112+ help = "Treat warnings as errors." ,
98113 )
99114
100115 return parser
101116
102117
103118def validate_main () -> int :
104- """Validate the manifest schema and sync if needed . Returns 0 on success, 1 on error."""
119+ """Run full repository validation . Returns 0 on success, 1 on error."""
105120 return main (["validate" ] + sys .argv [1 :])
106121
107122
123+ def schema_validate_main () -> int :
124+ """Validate only the manifest schema layer. Returns 0 on success, 1 on error."""
125+ return main (["schema-validate" ] + sys .argv [1 :])
126+
127+
108128def sync_main () -> int :
109- """Sync the manifest schema . Returns 0 on success, 1 on error."""
129+ """Sync version metadata . Returns 0 on success, 1 on error."""
110130 return main (["sync" ] + sys .argv [1 :])
111131
112132
@@ -124,7 +144,7 @@ def main(argv: list[str] | None = None) -> int:
124144 """Run the command-line interface.
125145
126146 Returns:
127- 0 on success, 1 on error, 2 if no command given.
147+ 0 on success, 1 on error, 2 if no command is given.
128148 """
129149 parser = build_parser ()
130150 args = parser .parse_args (argv )
@@ -135,14 +155,23 @@ def main(argv: list[str] | None = None) -> int:
135155 strict = args .strict ,
136156 require_tag = args .require_tag ,
137157 )
158+
159+ if args .command == "schema-validate" :
160+ return run_validate_manifest (
161+ strict = args .strict ,
162+ require_tag = args .require_tag ,
163+ )
164+
138165 if args .command == "sync" :
139166 sync_all ()
140167 return 0
168+
141169 if args .command == "ref-scaffold" :
142170 return run_scaffold (
143171 dry_run = args .dry_run ,
144172 overwrite = args .overwrite ,
145173 )
174+
146175 if args .command == "ref-validate" :
147176 return run_ref_validate (
148177 strict = args .strict ,
0 commit comments