Files
troupe-standup/wizard-work/sol/make_probe_retire_manifest.py

99 lines
3.1 KiB
Python

#!/usr/bin/env python3
"""Generate the sOL probe-retire-trip manifest.
Classifies the root-level untracked (not committed) files at the troupe
checkout into:
STEALTH-PROBE - hidden (leading dot) transient generator/seed dump scripts
that were never committed and have no standing twin in
wizard-work/. These are the leftover sweep generators for
the 2026-10-29 inbox seed; the committed trail lives in
wizard-work/sol/.
Every member of the retire set is expired (sha256 recorded in evidence) and is
archived to wizard-work/sol/probe-retired/. The committed ledger entries in
wizard-work/sol/ remain the authoritative record.
Run: python3 make_probe_retire_manifest.py
Checks: target wizor-work/sol/probe-retire-trip-2026-10-31.json
"""
import hashlib
import json
import os
import subprocess
import sys
REPO = "/root/troupe-standup"
OUT = os.path.join(REPO, "wizard-work", "sol", "probe-retire-trip-2026-10-31.json")
RETIRED_TO = "wizard-work/sol/probe-retired"
def root_untracked():
"""Root-level files git reports as untracked and non-ignored (no path sep)."""
out = subprocess.check_output(
["git", "-C", REPO, "ls-files", "--others", "--exclude-standard"],
text=True,
)
return sorted(p for p in out.splitlines() if p and "/" not in p)
def sha256_of(path):
h = hashlib.sha256()
with open(path, "rb") as f:
for chunk in iter(lambda: f.read(65536), b""):
h.update(chunk)
return h.hexdigest()
def main():
root = root_untracked()
retire = sorted(p for p in root if os.path.basename(p).startswith("."))
if len(retire) < 2:
print("WARNING: retire set smaller than expected; continuing", file=sys.stderr)
evidence = []
for name in retire:
p = os.path.join(REPO, name)
evidence.append(
{
"file": name,
"role": "transient generator/seed dump script (not committed)",
"sha256": sha256_of(p),
"size": os.path.getsize(p),
}
)
manifest = {
"trip": "sol-probe-retire-trip-2026-10-31",
"lane": "triage",
"agent": "sol",
"date": "2026-10-31",
"fold": "probe",
"raw": {
"seed": "repo-root untracked probe dump",
"source": "git ls-files --others --exclude-standard",
},
"rubric": "retire files at the repo root whose basename starts with a "
"leading dot ('.'); these are hidden transient generator/seed "
"dump scripts with no committed twin.",
"retire_set": retire,
"retired_to": RETIRED_TO,
"frozen_root_untracked": root,
"evidence": evidence,
"verdict": "retired",
"generated_by": "make_probe_retire_manifest.py",
}
os.makedirs(os.path.dirname(OUT), exist_ok=True)
with open(OUT, "w") as f:
json.dump(manifest, f, indent=2)
f.write("\n")
print(f"wrote {OUT}")
print(f"retire_set ({len(retire)}): {retire}")
print(f"frozen_root_untracked: {len(root)} files")
if __name__ == "__main__":
main()