Files
troupe-standup/wizard-work/sol/triage_review.py
T

81 lines
3.2 KiB
Python

#!/usr/bin/env python3
"""Build the sol-profile triage-review queue artifact (CSV).
Golden source of truth: the ITEMS + GOLDEN tables below. The written CSV is
the literal golden table flattened. The verifier (verify_triage_review.py)
re-reads the CSV from disk and asserts it equals GOLDEN.
"""
import csv
import pathlib
from collections import Counter
OUT = pathlib.Path("/root/.hermes/wizard-outputs/sol")
OUT.mkdir(parents=True, exist_ok=True)
HEADERS = ["id", "text", "category", "priority", "reason"]
# id -> (category, priority, reason)
GOLDEN = {
"T-01": ("C", 1, "blocking: gate must pass before re-run"),
"T-02": ("B", 2, "batch drain of a stale triage file"),
"T-03": ("B", 2, "merge checklist file into master"),
"T-04": ("C", 1, "blocking: token must be set before push"),
"T-05": ("B", 2, "rebuild index after churn"),
"T-06": ("B", 2, "cleanup stale bytecode caches"),
"T-07": ("A", 2, "draft verification script for review"),
"T-08": ("C", 1, "blocking: trio reachability gate"),
"T-09": ("B", 2, "prune merge-conflict markers"),
"T-10": ("A", 2, "audit repository for stray files"),
"T-11": ("L", 3, "note only; no action"),
"T-12": ("A", 2, "reclassification write"),
"T-13": ("B", 2, "archive/compress bit-stream blobs"),
"T-14": ("B", 2, "repoint reference in image pipeline"),
"T-15": ("C", 1, "blocking: verdict must land"),
"T-16": ("A", 2, "confirm census tally against file"),
}
ITEMS = [
("T-01", "wiring of the sol-profile-file-class verify"),
("T-02", "drain the sol-profile-triage-2026-11-01.json backlog"),
("T-03", "merge wizard-work/CHECK-q146 into master"),
("T-04", "confirm FORGE_TOKEN is set before the push"),
("T-05", "rebuild the wizard-outputs index"),
("T-06", "clear the stale __pycache__ under wizard-outputs"),
("T-07", "draft the CHECK for the untracked-triad review"),
("T-08", "verify the trio of sol-profile files are reachable"),
("T-09", "prune WORK-QUEUE.md merge-conflict lines"),
("T-10", "audit the untracked files in troupe-standup"),
("T-11", "remember the tuareg manifest checksum for vol"),
("T-12", "reclassify the hobbit docs into decisions/"),
("T-13", "compress the 7 lorem bit-stream blobs"),
("T-14", "repoint the spectro image pipeline to the mirror"),
("T-15", "final verdict + CHECK for the ledger census"),
("T-16", "confirm the ledger census tally matches the file"),
]
def main():
rows = []
for tid, text in ITEMS:
category, priority, reason = GOLDEN[tid]
rows.append([tid, text, category, priority, reason])
# Guards: exact shape, no blank fields.
assert len(rows) == 16, f"expected 16 rows, got {len(rows)}"
for r in rows:
assert all(r), f"blank field in row {r!r}"
csv_path = OUT / "triage_review_queue.csv"
with csv_path.open("w", newline="") as f:
writer = csv.writer(f)
writer.writerow(HEADERS)
writer.writerows(rows)
print(f"wrote {csv_path} ({len(rows)} rows)")
print("category counts:", dict(Counter(r[2] for r in rows)))
print("priority counts:", dict(Counter(r[3] for r in rows)))
if __name__ == "__main__":
main()