Private
Public Access
feat(chronology): regenerate chronology.md with v2 git-history classifier (closes 5-day desync gap)
This commit is contained in:
@@ -26,6 +26,7 @@ _METADATA_FIELD_PREFIXES = (
|
||||
"**Parent umbrella:**",
|
||||
"**Status:**",
|
||||
"**Confidence:**",
|
||||
"**Ancestors:**",
|
||||
)
|
||||
|
||||
|
||||
@@ -86,16 +87,26 @@ def run_quality_gate(rows: list[dict]) -> QualityGateResult:
|
||||
|
||||
def _load_rows_from_chronology(chronology_path: Path) -> list[dict]:
|
||||
from scripts.audit.generate_chronology import walk_track_folders, _repo_root
|
||||
root: Path = _repo_root(chronology_path.parent)
|
||||
return walk_track_folders(root)
|
||||
# chronology_path is conductor/chronology.md; walk_track_folders expects the conductor dir
|
||||
conductor_dir: Path = chronology_path.parent.resolve()
|
||||
if not (conductor_dir / "tracks").is_dir():
|
||||
# Fallback: resolve from repo root
|
||||
repo_root: Path = _repo_root(conductor_dir)
|
||||
conductor_dir = repo_root / "conductor"
|
||||
return walk_track_folders(conductor_dir)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(description="Quality gate for conductor/chronology.md")
|
||||
parser.add_argument("--chronology", type=Path, default=Path("conductor/chronology.md"))
|
||||
parser.add_argument("--rows-json", type=Path, default=None, help="Load rows from JSON file instead of re-walking")
|
||||
parser.add_argument("--strict", action="store_true", help="Exit 1 on any violation")
|
||||
args = parser.parse_args()
|
||||
rows = _load_rows_from_chronology(args.chronology)
|
||||
if args.rows_json and args.rows_json.is_file():
|
||||
import json
|
||||
rows = json.loads(args.rows_json.read_text(encoding="utf-8"))
|
||||
else:
|
||||
rows = _load_rows_from_chronology(args.chronology)
|
||||
result = run_quality_gate(rows)
|
||||
print(f"Quality gate: {'PASS' if result.passed else 'FAIL'}")
|
||||
print(f" Total rows: {result.total_rows}")
|
||||
|
||||
Reference in New Issue
Block a user