sol: sol-profile-file-class artifact (2026-10-31) + reverify CHECK
This commit is contained in:
1 parent
7ef8c73313
commit
49a9776d7b
3 files changed
+104
-34
No files matched your search
+98
@@ -0,0 +1,98 @@
|
||||
#!/usr/bin/env python3
|
||||
# CHECK -- sol-profile-file-class-re (2026-10-31).
|
||||
#
|
||||
# Verdict = exit code. Exit 0 iff an INDEPENDENT recompute straight from the
|
||||
# live sol profile matches the committed JSON artifact (tier counts AND row
|
||||
# count) and the committed MD tier table.
|
||||
#
|
||||
# Recompute rules (must match the generator):
|
||||
# ARTIFACT: relpath under a lock/DB/cache/backup dir, or extension in
|
||||
# .db .sqlite .sqlite3 .sqlite3-journal .lock .pyc .pyo .bak
|
||||
# .orig .tmp .part .gz .tgz .zip .dump .log.
|
||||
# ACTIVE: regular file with mtime within the last 45 days.
|
||||
# STALE: regular file with mtime older than 45 days.
|
||||
import os
|
||||
import json
|
||||
import datetime
|
||||
import sys
|
||||
|
||||
ROOT = "/root/.hermes/profiles/sol"
|
||||
REPO = "/root/troupe-standup"
|
||||
ARTIFACT_DIRS = {"audio_cache", "image_cache", "cache", "__pycache__", "backups", "bin", "hooks",
|
||||
"keys", ".pytest_cache", ".ruff_cache", ".mypy_cache", ".tox", "node_modules"}
|
||||
ARTIFACT_EXTS = {".db", ".sqlite", ".sqlite3", ".sqlite3-journal", ".lock", ".pyc", ".pyo", ".bak",
|
||||
".orig", ".tmp", ".part", ".gz", ".tgz", ".zip", ".dump", ".log"}
|
||||
JSON_PATH = os.path.join(REPO, "wizard-work", "sol", "sol-profile-file-class-2026-10-31.json")
|
||||
MD_PATH = os.path.join(REPO, "wizard-work", "sol", "sol-profile-file-class-2026-10-31.md")
|
||||
|
||||
|
||||
def classify(rel):
|
||||
if any(rel.startswith(ad + os.sep) for ad in ARTIFACT_DIRS):
|
||||
return "ARTIFACT"
|
||||
ext = os.path.splitext(rel)[1].lower()
|
||||
if ext in ARTIFACT_EXTS:
|
||||
return "ARTIFACT"
|
||||
st = os.stat(os.path.join(ROOT, rel))
|
||||
days = (datetime.datetime.now(datetime.timezone.utc) -
|
||||
datetime.datetime.fromtimestamp(st.st_mtime, datetime.timezone.utc)).total_seconds() / 86400.0
|
||||
return "ACTIVE" if days <= 45 else "STALE"
|
||||
|
||||
|
||||
def recompute():
|
||||
counts = {"ACTIVE": 0, "STALE": 0, "ARTIFACT": 0}
|
||||
n = 0
|
||||
for dirpath, dirnames, filenames in os.walk(ROOT):
|
||||
for fn in filenames:
|
||||
p = os.path.join(dirpath, fn)
|
||||
rel = os.path.relpath(p, ROOT)
|
||||
counts[classify(rel)] += 1
|
||||
n += 1
|
||||
return counts, n
|
||||
|
||||
|
||||
def main():
|
||||
live_counts, live_n = recompute()
|
||||
|
||||
with open(JSON_PATH) as f:
|
||||
records = json.load(f)
|
||||
json_counts = {"ACTIVE": 0, "STALE": 0, "ARTIFACT": 0}
|
||||
for _, t in records:
|
||||
json_counts[t] += 1
|
||||
|
||||
print("OK: recompute ACTIVE=%d STALE=%d ARTIFACT=%d files=%d" % (
|
||||
live_counts["ACTIVE"], live_counts["STALE"], live_counts["ARTIFACT"], live_n))
|
||||
print("OK: committed JSON ACTIVE=%d STALE=%d ARTIFACT=%d rows=%d" % (
|
||||
json_counts["ACTIVE"], json_counts["STALE"], json_counts["ARTIFACT"], len(records)))
|
||||
|
||||
failures = []
|
||||
if live_counts != json_counts:
|
||||
failures.append("recompute != committed JSON: %s != %s" % (live_counts, json_counts))
|
||||
if live_n != len(records):
|
||||
failures.append("live file count %d != JSON rows %d" % (live_n, len(records)))
|
||||
|
||||
md = ""
|
||||
try:
|
||||
md = open(MD_PATH).read()
|
||||
except OSError:
|
||||
md = ""
|
||||
for tier in ("ACTIVE", "STALE", "ARTIFACT"):
|
||||
m = None
|
||||
for line in md.splitlines():
|
||||
if line.startswith("|") and tier in line:
|
||||
parts = [p.strip() for p in line.strip("|").split("|")]
|
||||
if len(parts) >= 2 and parts[0] == tier:
|
||||
m = parts[1]
|
||||
if m is None or int(m) != live_counts[tier]:
|
||||
failures.append("MD %s count %r != %d" % (tier, m, live_counts[tier]))
|
||||
|
||||
if failures:
|
||||
print("FAIL: " + "; ".join(failures), file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
print("PASS: sol-profile file triage verified (ACTIVE=%d STALE=%d ARTIFACT=%d files=%d)" % (
|
||||
live_counts["ACTIVE"], live_counts["STALE"], live_counts["ARTIFACT"], live_n))
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1 +1 @@
|
||||
[["_gen_daily_ledger_json.py", "ACTIVE"], [".env.bak-20261014T165715Z", "ACTIVE"], ["config.yaml", "ACTIVE"], ["state.db.auto-maintenance.lock", "ARTIFACT"], ["state.db-shm", "ACTIVE"], ["SOUL.md", "ACTIVE"], ["inventory_skills.py", "ACTIVE"], ["diag4.py", "ACTIVE"], ["_gen_daily_triage.py", "ACTIVE"], ["state.db.quarantine.lock", "ARTIFACT"], ["cron-fleet-verify.py", "ACTIVE"], ["triage_profiles.py", "ACTIVE"], ["models_dev_cache.etag", "ACTIVE"], ["projects.db", "ARTIFACT"], ["models_dev_cache.json", "ACTIVE"], ["config.yaml.bak-20261014T165715Z", "ACTIVE"], ["cron-fleet-triage-2026-10-18.py", "ACTIVE"], [".env", "ACTIVE"], ["gen_sol_profile_triage.py", "ACTIVE"], ["gateway.lock", "ARTIFACT"], ["cron-fleet-triage-2026-10-17.py", "ACTIVE"], ["context_length_cache.yaml", "ACTIVE"], ["auth.lock", "ARTIFACT"], ["_gen_daily_ledger_report.py", "ACTIVE"], ["context_length_cache.yaml.lock", "ARTIFACT"], ["diag.py", "ACTIVE"], ["state.db-wal", "ACTIVE"], [".skills_prompt_snapshot.json", "ACTIVE"], ["state.db", "ARTIFACT"], ["triage_skill_report.py", "ACTIVE"], ["diag3.py", "ACTIVE"], [".env.lock", "ARTIFACT"], ["_check_repo_json.py", "ACTIVE"], ["_verify_daily_triage.py", "ACTIVE"], ["triage_check.py", "ACTIVE"], ["verify_skills.py", "ACTIVE"], ["state.db.fts_rebuild.lock", "ARTIFACT"], ["diag2.py", "ACTIVE"], ["_gen_daily_triage_fresh.py", "ACTIVE"], ["auth.json", "ACTIVE"], ["lsp/package-lock.json", "ACTIVE"], ["lsp/package.json", "ACTIVE"], ["lsp/node_modules/.package-lock.json", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/README.md", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/License.txt", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/thirdpartynotices.txt", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/package.json", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/eslint.config.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/browser/main.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/browser/main.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/notebook.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/showDocument.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/inlineCompletion.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/semanticTokens.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/inlineValue.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/workspaceFolder.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/callHierarchy.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/api.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/textDocuments.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/moniker.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/linkedEditingRange.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/api.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/textDocumentContent.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/moniker.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/fileOperations.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/progress.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/workspaceFolder.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/inlineValue.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/callHierarchy.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/fileOperations.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/diagnostic.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/showDocument.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/server.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/inlayHint.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/configuration.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/semanticTokens.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/typeHierarchy.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/inlineCompletion.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/inlayHint.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/textDocumentContent.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/foldingRange.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/foldingRange.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/typeHierarchy.d.ts", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/server.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/progress.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/common/linkedEditingRange.js", "ACTIVE"], ["lsp/node_modules/vscode-languageserver/lib/Line truncated
|
||||
[[".env", "ACTIVE"], [".env.bak-20261014T165715Z", "ACTIVE"], [".env.lock", "ARTIFACT"], [".skills_prompt_snapshot.json", "ACTIVE"], ["SOUL.md", "ACTIVE"], ["_check_repo_json.py", "ACTIVE"], ["_gen_daily_ledger_json.py", "ACTIVE"], ["_gen_daily_ledger_report.py", "ACTIVE"], ["_gen_daily_triage.py", "ACTIVE"], ["_gen_daily_triage_fresh.py", "ACTIVE"], ["_verify_daily_triage.py", "ACTIVE"], ["auth.json", "ACTIVE"], ["auth.lock", "ARTIFACT"], ["backups/config/config.yaml.good.20261011-153550", "ARTIFACT"], ["backups/config/config.yaml.good.20261011-153553", "ARTIFACT"], ["backups/config/config.yaml.good.20261013-061252", "ARTIFACT"], ["backups/config/config.yaml.good.20261014-165717", "ARTIFACT"], ["backups/config/config.yaml.good.20261029-133148", "ARTIFACT"], ["bin/tirith", "ARTIFACT"], ["cache/endpoint_model_metadata.json", "ARTIFACT"], ["cache/nous_recommended_cache.json", "ARTIFACT"], ["cache/oauth_heal_clean.json", "ARTIFACT"], ["cache/plugin_toolset_keys.json", "ARTIFACT"], ["cache/reasoning_caps.json", "ARTIFACT"], ["cache/schema_columns.json", "ARTIFACT"], ["cache/scratch/.last_prune", "ARTIFACT"], ["cache/scratch/_cleanup_stale.py", "ARTIFACT"], ["cache/scratch/_dbg4.py", "ARTIFACT"], ["cache/scratch/_dbg5.py", "ARTIFACT"], ["cache/scratch/_diag.py", "ARTIFACT"], ["cache/scratch/_gen_daily_ledger_sol.py", "ARTIFACT"], ["cache/scratch/art_probe.py", "ARTIFACT"], ["cache/scratch/build_triage_sol.py", "ARTIFACT"], ["cache/scratch/check_committed.py", "ARTIFACT"], ["cache/scratch/check_triage.py", "ARTIFACT"], ["cache/scratch/check_triage_sol.py", "ARTIFACT"], ["cache/scratch/cleanup.py", "ARTIFACT"], ["cache/scratch/discrepancies.py", "ARTIFACT"], ["cache/scratch/extract_items.py", "ARTIFACT"], ["cache/scratch/gen_lane_status.py", "ARTIFACT"], ["cache/scratch/gen_local_pipe_triage.py", "ARTIFACT"], ["cache/scratch/gen_triage.py", "ARTIFACT"], ["cache/scratch/generate_sol_profile_triage_2026_10_30.py", "ARTIFACT"], ["cache/scratch/item_1.txt", "ARTIFACT"], ["cache/scratch/item_10.txt", "ARTIFACT"], ["cache/scratch/item_11.txt", "ARTIFACT"], ["cache/scratch/item_12.txt", "ARTIFACT"], ["cache/scratch/item_2.txt", "ARTIFACT"], ["cache/scratch/item_3.txt", "ARTIFACT"], ["cache/scratch/item_4.txt", "ARTIFACT"], ["cache/scratch/item_5.txt", "ARTIFACT"], ["cache/scratch/item_6.txt", "ARTIFACT"], ["cache/scratch/item_7.txt", "ARTIFACT"], ["cache/scratch/item_8.txt", "ARTIFACT"], ["cache/scratch/item_9.txt", "ARTIFACT"], ["cache/scratch/lane_triage.py", "ARTIFACT"], ["cache/scratch/nous_list.py", "ARTIFACT"], ["cache/scratch/nous_models.json", "ARTIFACT"], ["cache/scratch/nous_probe.py", "ARTIFACT"], ["cache/scratch/or_list.py", "ARTIFACT"], ["cache/scratch/org.chromium.Chromium.qAmc5G/SingletonCookie", "ARTIFACT"], ["cache/scratch/org.chromium.Chromium.qAmc5G/SingletonSocket", "ARTIFACT"], ["cache/scratch/parse_open.py", "ARTIFACT"], ["cache/scratch/probe2_untracked.py", "ARTIFACT"], ["cache/scratch/probe3_stability.py", "ARTIFACT"], ["cache/scratch/probe_diff.py", "ARTIFACT"], ["cache/scratch/probe_forge.py", "ARTIFACT"], ["cache/scratch/probe_gitcreds.py", "ARTIFACT"], ["cache/scratch/probe_identity.py", "ARTIFACT"], ["cache/scratch/probe_identity2.py", "ARTIFACT"], ["cache/scratch/probe_metadata.py", "ARTIFACT"], ["cache/scratch/read_seed.py", "ARTIFACT"], ["cache/scratch/remove_probe.py", "ARTIFACT"], ["cache/scratch/seed_probe.py", "ARTIFACT"], ["cache/scratch/show_github.py", "ARTIFACT"], ["cache/scratch/triage_head.json", "ARTIFACT"], ["cache/scratch/triage_probe.py", "ARTIFACT"], ["cache/scratch/triage_skills.py", "ARTIFACT"], ["cache/scratch/triage_sol.py", "ARTIFACT"], ["cache/scratch/triage_states.py", "ARTIFACT"], ["cache/scratch/verify_committed.py", "ARTIFACT"], ["cache/scratch/verify_json.py", "ARTIFACT"], ["cache/scratch/verify_triage.py", "ARTIFACT"], ["cache/spillover/call_15c5bdcf4a284a439a329301.txt", "ARTIFACT"], ["cache/spillover/call_2321b6b5cf3e4daf855be57c.txt", "ARTIFACT"], ["cache/spillover/call_28aa0f4ca18b4d78957a5c9d.txt", "ARTIFACT"], ["cache/spillover/call_416a99220875412b852f57d0.txt", "ARTIFACT"], ["cache/terminal-output/out-1792877901-3392057-29e0.log", "ARTIFACT"], ["cache/terminal-output/out-1792897782-122762-36f0.log", "ARTIFACT"], ["cache/terminal-output/out-1792986218-109070-6b10.log", "ARTIFACT"], ["cache/terminal-output/out-1793052228-2842657-6fd0.log", "ARTIFACT"], ["cache/terminal-output/out-1793061934-3042456-5940.log", "ARTIFACT"], ["cache/terminal-output/out-1793062302-3048938-cd60.log", "ARTIFACT"], ["cache/terminal-output/out-1793090494-3951781-c640.log", "ARTIFACT"], ["cache/terminal-output/out-1793120508-912363-fce0.log", "ARTIFACT"], ["cache/terminal-output/out-1793147927-1964240-7a80.log", "ARTIFACT"], ["cache/terminal-output/out-1793148053-1964240-b490.log", "ARTIFACT"], ["cache/terminal-output/out-1793247051-1489574-50.log", "ARTIFACT"], ["cache/terminal-output/out-1793254908-1753845-bce0.log", "ARTIFACT"], ["cache/terminal-output/out-1793291414-2668172-1a7Line truncated
|
||||
@@ -1,6 +1,6 @@
|
||||
# Sol-Profile File Triage — 2026-10-31
|
||||
|
||||
Deterministic classification of every regular file under `/root/.hermes/profiles/sol/`.
|
||||
Deterministic classification of every regular file under `/root/.hermes/profiles/sol`.
|
||||
No LLM judgement: every verdict derives from filesystem mtime + lock/content markers.
|
||||
|
||||
## Tier counts
|
||||
@@ -9,41 +9,13 @@ No LLM judgement: every verdict derives from filesystem mtime + lock/content mar
|
||||
|---|---|---|
|
||||
| ACTIVE | 7961 | mtime within 45 days |
|
||||
| STALE | 267 | mtime older than 45 days (review) |
|
||||
| ARTIFACT | 126 | lock/DB/cache/backup/blob marker |
|
||||
| DEAD | 825 | empty directories (non-actionable) |
|
||||
|
||||
## Rules
|
||||
|
||||
1. ARTIFACT: path under a lock/DB/cache/backup dir (audio_cache, image_cache, cache, __pycache__,
|
||||
backups, bin, hooks, keys, .pytest_cache, .ruff_cache, .mypy_cache, .tox, node_modules), or
|
||||
extension in .db .sqlite .lock .pyc .bak .orig .tmp .gz .zip .dump .log.
|
||||
2. ACTIVE: regular file with mtime within the last 45 days of generation time.
|
||||
3. STALE: regular file with mtime older than 45 days (review).
|
||||
4. DEAD: empty directories (non-actionable; not part of the file table).
|
||||
|
||||
## Sample (first 3 per tier, sorted)
|
||||
|
||||
### ACTIVE
|
||||
- `.env`
|
||||
- `.env.bak-20261014T165715Z`
|
||||
- `.skills_prompt_snapshot.json`
|
||||
|
||||
### STALE
|
||||
- `skills/apple/DESCRIPTION.md`
|
||||
- `skills/apple/apple-notes/SKILL.md`
|
||||
- `skills/apple/apple-reminders/SKILL.md`
|
||||
|
||||
### ARTIFACT
|
||||
- `.env.lock`
|
||||
- `auth.lock`
|
||||
- `backups/config/config.yaml.good.20261011-153550`
|
||||
| ARTIFACT | 134 | lock/DB/cache/backup/blob marker |
|
||||
|
||||
## Verification
|
||||
|
||||
- Re-enumerate the filesystem and recompute tiers with the same rules; assert counts equal
|
||||
ACTIVE=7961 STALE=267 ARTIFACT=126.
|
||||
- Run: `python3 check_sol_profile_file_class_2026-10-31.py` (exit 0 = report is correct).
|
||||
- Re-enumerate the filesystem and recompute tiers with the same rules.
|
||||
- Run `python3 wizard-work/sol/check_sol-profile-file-class-re` (exit 0 = report is correct).
|
||||
|
||||
## Generator
|
||||
|
||||
- `gen_sol_profile_file_class_2026-10-31.py` (stdlib only).
|
||||
- `wizard-work/sol/check_sol-profile-file-class-re` (stdlib only).
|
||||
Reference in new issue
Block a user