sol: untracked-file triage manifest 2026-11-04 (303 files)
This commit is contained in:
1 parent
d16a3e007f
commit
086423c2be
4 files changed
+1664
No files matched your search
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
# CHECK -- sol: untracked-file triage 2026-11-04.
|
||||
# Exit 0 iff the committed manifest re-derives from the extension rubric and
|
||||
# every frozen path exists as a real file in the repo.
|
||||
set -u
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR" && pwd)"
|
||||
cd "$REPO_ROOT" || exit 2
|
||||
|
||||
exec python3 wizard-work/sol/verify_untracked_triage_2026_11_04.py
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,34 @@
|
||||
# sol: untracked file triage, 2026-11-04
|
||||
|
||||
## Scope
|
||||
|
||||
Untracked, non-ignored files in /root/troupe-standup (`git ls-files --others --exclude-standard`), excluding directory entries. N = 303.
|
||||
|
||||
## Category rubric (deterministic, extension-only)
|
||||
|
||||
| category | extensions |
|
||||
|---|---|
|
||||
| **text** | html, md, txt, xml |
|
||||
| **data** | csv, db, json, jsonl, tsv |
|
||||
| **script** | py, sh |
|
||||
| **doc** | pdf |
|
||||
| **media** | jpg, png |
|
||||
| **other** | sx2gia |
|
||||
|
||||
## Counts by category
|
||||
|
||||
| category | count |
|
||||
|---|---|
|
||||
| data | 32 |
|
||||
| doc | 6 |
|
||||
| media | 33 |
|
||||
| other | 5 |
|
||||
| script | 111 |
|
||||
| text | 116 |
|
||||
|
||||
## Notes
|
||||
|
||||
- `script` includes the CHECK-* and pathbind/CHECK shell check scripts.
|
||||
- `other` holds files whose extension is not in the ruler or that have no extension (e.g. sx2gIa).
|
||||
- Classifier: extension-only; content is not sniffed, so the verdict is a pure function of extension.
|
||||
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Independent verifier for sol untracked-file triage manifest.
|
||||
|
||||
Exit 0 iff: manifest files == seed set (rel paths), every category
|
||||
re-derives from the recorded extension by the embedded rubric, every
|
||||
frozen path exists as a real file and is not ignored, and total/by_category
|
||||
are self-consistent.
|
||||
"""
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
REPO = Path(__file__).resolve().parent.parent.parent
|
||||
SRC = REPO / "wizard-work" / "sol"
|
||||
MANIFEST = SRC / "sol-lane-untracked-triage-2026-11-04.json"
|
||||
|
||||
RULER = {
|
||||
"md": "text", "txt": "text", "rst": "text", "adoc": "text", "org": "text", "log": "text",
|
||||
"html": "text", "xml": "text",
|
||||
"json": "data", "csv": "data", "tsv": "data", "yaml": "data", "yml": "data", "toml": "data",
|
||||
"sqlite": "data", "db": "data", "ipynb": "data", "jsonl": "data",
|
||||
"mp3": "media", "wav": "media", "mp4": "media", "webm": "media", "png": "media",
|
||||
"jpg": "media", "jpeg": "media", "gif": "media", "webp": "media", "svg": "media",
|
||||
"py": "script", "sh": "script", "bash": "script", "zsh": "script", "ps1": "script", "bat": "script",
|
||||
"CHECK": "script",
|
||||
"pdf": "doc", "doc": "doc", "docx": "doc", "ppt": "doc", "pptx": "doc", "xls": "doc", "xlsx": "doc",
|
||||
}
|
||||
|
||||
def ext_cat(rel):
|
||||
ext = Path(rel).suffix.lower().lstrip(".")
|
||||
return RULER.get(ext, "other")
|
||||
|
||||
def is_ignored(rel):
|
||||
return subprocess.run(
|
||||
["git", "-C", str(REPO), "check-ignore", "-q", "--", rel],
|
||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
|
||||
).returncode == 0
|
||||
|
||||
def main():
|
||||
probs = []
|
||||
if not MANIFEST.exists():
|
||||
print("PROBLEM: manifest missing: " + str(MANIFEST))
|
||||
return 1
|
||||
manifest = json.loads(MANIFEST.read_text())
|
||||
files = sorted(f["rel"] for f in manifest.get("files", []))
|
||||
|
||||
proc = subprocess.run(
|
||||
["git", "-C", str(REPO), "ls-files", "--others", "--exclude-standard"],
|
||||
capture_output=True, text=True, check=True)
|
||||
seed = sorted(p for p in proc.stdout.splitlines()
|
||||
if p.strip() and not p.strip().endswith("/"))
|
||||
|
||||
if seed != files:
|
||||
probs.append("manifest path set != seed: %d vs %d" % (len(files), len(seed)))
|
||||
|
||||
for f in manifest.get("files", []):
|
||||
rel, rec = f["rel"], f["category"]
|
||||
exp = ext_cat(rel)
|
||||
if exp != rec:
|
||||
probs.append("category mismatch %s: ruler %s, manifest %s" % (rel, exp, rec))
|
||||
|
||||
for f in manifest.get("files", []):
|
||||
p = REPO / f["rel"]
|
||||
if not p.is_file():
|
||||
probs.append("missing on disk: " + f["rel"])
|
||||
elif is_ignored(f["rel"]):
|
||||
probs.append("ignored: " + f["rel"])
|
||||
|
||||
counts = {}
|
||||
for f in manifest.get("files", []):
|
||||
counts[f["category"]] = counts.get(f["category"], 0) + 1
|
||||
if manifest.get("total_files") != len(files):
|
||||
probs.append("total_files mismatch")
|
||||
if counts != manifest.get("by_category"):
|
||||
probs.append("by_category mismatch")
|
||||
|
||||
if probs:
|
||||
print("VERIFY FAIL (%d problems)" % len(probs))
|
||||
for p in probs:
|
||||
print(" - " + p)
|
||||
return 1
|
||||
print("VERIFY OK (%d files, categories re-derived, all paths present)" % len(files))
|
||||
return 0
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Reference in new issue
Block a user