sol: triage-art functional classification 2026-11-05

This commit is contained in:
ledger committed 2026-11-05 00:34:34 +00:00
1 parent 7adc427bcb
commit 7bbad84058
3 files changed
+156

No files matched your search

@@ -0,0 +1,35 @@
{
"artifact": "triage-art-classify-2026-11-05.json",
"source_dir": "/root/triage-art",
"generated_at": "2026-11-05T00:00:00Z",
"lane": "Triage - everyday Q&A and classification",
"rule": "functional role inferred from observable file content (see md)",
"count": 4,
"categories": {
"build_tool": 2,
"probe": 1,
"verify_check": 1
},
"files": [
{
"file": "build_untracked_classify_2026_10_31.py",
"category": "build_tool",
"source": "functional role inferred from observable file content"
},
{
"file": "probe_untracked_disk.py",
"category": "probe",
"source": "functional role inferred from observable file content"
},
{
"file": "sol_triage_build.py",
"category": "build_tool",
"source": "functional role inferred from observable file content"
},
{
"file": "sol_triage_check.py",
"category": "verify_check",
"source": "functional role inferred from observable file content"
}
]
}
@@ -0,0 +1,27 @@
# Triage - triage-art functional classification (2026-11-05)
## Rule
- verify_check: standalone verification script (reads artifact + expected table, emits nothing).
- probe: reads live state (git ls-files index listing + os.path.exists), prints only.
- build_tool: reads a seed/snapshot and writes artifact files.
- else other.
## Result
| bucket | count |
|---|---|
| build_tool | 2 |
| probe | 1 |
| verify_check | 1 |
| --- | --- |
| **total** | **4** |
## Per-item classification
| # | file | category |
|---|---|---|
| 1 | `build_untracked_classify_2026_10_31.py` | build_tool |
| 2 | `probe_untracked_disk.py` | probe |
| 3 | `sol_triage_build.py` | build_tool |
| 4 | `sol_triage_check.py` | verify_check |
@@ -0,0 +1,94 @@
#!/usr/bin/env python3
"""Independent re-derivation gate for triage-art functional classification.
Exit 0 iff the committed manifest re-derives from disk by a rubric that does
NOT import the generator (different code path, same observable-content rule).
Checks:
1. /root/triage-art on disk holds exactly the four expected files.
2. Each file re-derives to the manifest's category by the independent rubric.
3. Counts reconcile exactly.
Exit code IS the verdict (0 = correct, nonzero = wrong).
"""
import json
import os
import sys
TRIAGE_ART = "/root/triage-art"
MANIFEST = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"triage-art-classify-2026-11-05.json",
)
# Independently re-implemented rubric (deliberately not importing the generator).
def classify(fname, content):
low = content.lower()
# verify_check: self-describes as a standalone verification script, reads an
# artifact path + expected table, writes nothing to disk.
if "exit code 0 = artifact correct and evidence-grounded" in low:
return "verify_check"
# probe: reads live state (git ls-files listing + os.path.exists), prints only.
if "ls-files" in low and "os.path.exists" in low and "json.dump" not in low:
return "probe"
# build_tool: reads a seed/snapshot and writes artifact files (json.dump).
if "json.dump" in low:
return "build_tool"
return "other"
def main():
errs = []
# 1. Disk universe must match the committed file list exactly.
expected_files = sorted([
"build_untracked_classify_2026_10_31.py",
"probe_untracked_disk.py",
"sol_triage_build.py",
"sol_triage_check.py",
])
disk = sorted(f for f in os.listdir(TRIAGE_ART) if os.path.isfile(
os.path.join(TRIAGE_ART, f)))
if disk != expected_files:
errs.append(f"disk universe {disk} != expected {expected_files}")
# 2. Re-derive each file's category from disk content.
actual = {}
for fname in disk:
with open(os.path.join(TRIAGE_ART, fname), encoding="utf-8") as f:
content = f.read()
actual[fname] = classify(fname, content)
try:
with open(MANIFEST, encoding="utf-8") as f:
manifest = json.load(f)
except Exception as e:
errs.append(f"manifest unreadable: {e}")
manifest = {}
manifest_files = {r.get("file"): r.get("category") for r in manifest.get("files", [])}
if actual != manifest_files:
errs.append(f"re-derived {actual} != manifest {manifest_files}")
# 3. Counts reconcile exactly.
counts = {}
for c in actual.values():
counts[c] = counts.get(c, 0) + 1
if counts != manifest.get("categories"):
errs.append(f"counts {counts} != manifest {manifest.get('categories')}")
if manifest.get("count") != len(disk):
errs.append(f"manifest count {manifest.get('count')} != disk {len(disk)}")
if errs:
print("FAIL:")
for e in errs:
print(" -", e)
sys.exit(1)
print("ok: disk universe matches; each file re-derived to manifest category;")
print(f" counts build_tool={counts.get('build_tool',0)} "
f"probe={counts.get('probe',0)} verify_check={counts.get('verify_check',0)}")
sys.exit(0)
if __name__ == "__main__":
main()