Files
persona-steering-template-l…/scripts/corpus/sync_template_library.py
T
wassnameandClaudypoo b8e22f42fb refactor: sort scripts/ by who runs it
Top level is now only what the runbook or a re-run touches: validate_persona_axes,
bounded_thinking_judge, template_catalog, export_selections, parse_stage_a, run_axis,
export_steering_selection. Corpus ingestion and publishing moved to scripts/corpus/,
plotting and stats to scripts/report/.

Moved files needed parents[1] -> parents[2]; the two corpus scripts that import
template_catalog use the sys.path shim bounded_thinking_judge_liveproof already used.

Also completes the export_steering_selection rename: an earlier git reset had dropped
the staged deletion, leaving both filenames tracked.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
2026-07-25 10:23:22 +08:00

50 lines
1.4 KiB
Python

from __future__ import annotations
import argparse
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "scripts"))
from template_catalog import ( # noqa: E402
CATALOG_PATH,
CATALOG_JSONL_PATH,
TEMPLATES_TXT_PATH,
TEMPLATE_SOURCES_PATH,
load_template_catalog,
validate_template_catalog,
write_generated_runtime_files,
)
def main() -> None:
ap = argparse.ArgumentParser()
ap.add_argument("--check", action="store_true")
args = ap.parse_args()
rows = load_template_catalog(CATALOG_PATH)
errors = validate_template_catalog(rows)
if errors:
print("template catalog check failed:")
for err in errors:
print(f"- {err}")
raise SystemExit(1)
active = sum(row["status"] == "active" for row in rows)
catalog_only = sum(row["status"] == "catalog_only" for row in rows)
excluded = sum(row["status"] == "excluded" for row in rows)
print(f"catalog={CATALOG_PATH}")
print(f"active={active} catalog_only={catalog_only} excluded={excluded}")
if args.check:
return
write_generated_runtime_files(rows)
print(f"wrote {CATALOG_JSONL_PATH.relative_to(CATALOG_PATH.parents[1])}")
print(f"wrote {TEMPLATES_TXT_PATH.relative_to(CATALOG_PATH.parents[1])}")
print(f"wrote {TEMPLATE_SOURCES_PATH.relative_to(CATALOG_PATH.parents[1])}")
if __name__ == "__main__":
main()