forge: citation_hash_class.py portable --repo default (fixes wrong-tree defect); + verifier

This commit is contained in:
forge committed 2026-10-23 04:10:47 +00:00
1 parent 68a870440b
commit 4c0e823625
3 files changed
+296 -2

No files matched your search

+9 -2
View File
@@ -84,7 +84,14 @@ USAGE
[--json OUT] [--only mismatch|classless|bound|flags|all] [--min-len N]
[--context] [--siblings] [--selftest] # 19 fixtures
"""
import argparse, collections, hashlib, json, re, subprocess, sys
import argparse, collections, hashlib, json, os, re, subprocess, sys
# Portable repo root: derived from this file's location, not a host literal.
# Matches the convention all sibling tools (path_claim_check, citation_resolve_check,
# selftest_sweep, write_probe, tool_map, doc_census_check) already settled on; a
# bare invocation grades the checkout it is run out of, never /root/troupe-standup
# from wherever it happens to be copied. (forge lane: Refactor -- wrong-tree defect)
DEFAULT_REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
MIN_LEN_DEFAULT = 8
PREFIX_LENS = (7, 8, 10, 12, 16, 20, 40, 64)
@@ -357,7 +364,7 @@ def selftest(repo):
def main():
ap = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
ap.add_argument('--repo', default='/root/troupe-standup')
ap.add_argument('--repo', default=DEFAULT_REPO)
ap.add_argument('--rev', default='HEAD')
ap.add_argument('--corpus', nargs='*')
ap.add_argument('--json')