sol: 2026-10-27 daily profile-state triage

This commit is contained in:
sol committed 2026-10-27 00:42:27 +00:00
1 parent f2ff9c7035
commit 63406a5715
4 files changed
+314

No files matched your search

@@ -0,0 +1,124 @@
#!/usr/bin/env python3
"""Sol-lane daily profile-state triage build for 2026-10-27.
Walks /root/.hermes/profiles/sol (os.walk, no symlink following), classifies
every entry by name, and writes the report to:
- /root/troupe-standup/wizard-work/sol/sol-lane-triage-2026-10-27.md
- /root/.hermes/wizard-outputs/sol/sol-lane-triage-2026-10-27.md
"""
import os
import sys
import datetime
from collections import Counter
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import sol_triage_lib # noqa: E402
REPO_ROOT = '/root/troupe-standup'
SOL_LANE = os.path.join(REPO_ROOT, 'wizard-work', 'sol')
OUT_ROOT = '/root/.hermes/wizard-outputs/sol'
REPORT_NAME = 'sol-lane-triage-2026-10-27.md'
RUN_DATE = '2026-10-27 (UTC)'
NOW = datetime.datetime.now(datetime.timezone.utc)
def build_report(d):
cat = d['category_counts']
lines = []
lines.append('# Sol-lane daily profile-state triage')
lines.append('')
lines.append('Generated: `%s`' % NOW.isoformat())
lines.append('')
lines.append('Source: `os.walk` over `%(root)s`, one classifier on entry name, '
'no symlink following.' % {'root': sol_triage_lib.ROOT})
lines.append('Date of this run: %(d)s.' % {'d': RUN_DATE})
lines.append('')
lines.append('## Headline')
lines.append('')
lines.append('| measure | value |')
lines.append('| --- | --- |')
lines.append('| files | %d |' % d['total_files'])
lines.append('| dirs | %d |' % d['total_dirs'])
lines.append('| entries | %d |' % d['total_entries'])
lines.append('| stale (>60 d) | %d |' % d['stale_count'])
lines.append('| of which files | %d |' % d['stale_files'])
lines.append('| of which dirs | %d |' % d['stale_dirs'])
lines.append('')
lines.append('## Category breakdown (name, os.walk)')
lines.append('')
lines.append('| category | count |')
lines.append('| --- | --- |')
for k in sorted(cat):
lines.append('| %s | %d |' % (k, cat[k]))
lines.append('')
lines.append('## Signal root-level files (not counts, advisory)')
lines.append('')
lines.append('config.yaml, .env, .env.bak-20261014T165715Z, context_length_cache.yaml, '
'auth.json, auth.lock, .env.lock, SOUL.md, .skills_prompt_snapshot.json, '
'state.db (+shm/wal/locks), triage_check.py, triage_profiles.py, '
'triage_skill_report.py, diag.py, diag2.py, diag3.py, diag4.py, '
'cron-fleet-triage-2026-10-17.py, cron-fleet-triage-2026-10-18.py, '
'cron-fleet-verify.py, inventory_skills.py, models_dev_cache.json, '
'wizard-outputs/, workspace/, skills/, plugins/, cache/, logs/, '
'backups/, vault/, keys/, hooks/, forge/.' % {'root': RUN_DATE})
lines.append('')
lines.append('## Observations')
lines.append('')
stale_files = d['stale_files']
stale_dirs = d['stale_dirs']
lines.append('- `(stale >60 d)` is dominated by a bulk install: the entire '
'`skills/apple`, `skills/autonomous-ai-agents`, `skills/creative` '
'tree carries mtime 2026-06-20 (~127 d). That is a bulk-sync artefact, '
'not per-entry decay.')
lines.append('- `config.yaml` and `auth.json` are the two entries an operator edits '
'by hand; both have `.bak`/`.lock` siblings, i.e. the profile is written '
'under a lock-style concurrency convention.')
lines.append('- `state.db(+shm/wal)` is the runtime statestore; the three `.lock` '
'siblings are concurrency guards. These 5 entries all classify under '
'`state`.')
lines.append('- `plugins` (1 tier) plus `plugin-update-checks` = the plugin surface; '
'`skills` is one top-tier with many sub-skills (the bulk of the entries).')
lines.append('- `cache/`, `image_cache/`, `audio_cache/`, `logs/`, `memories/`, '
'`vault/`, `keys/`, `pairing/`, `sandboxes/`, `sessions/`, `skins/`, '
'`forge/`, `home/`, `lsp/`, `platforms/`, `plans/`, `bin/`, '
'`workspace/` are lean single-tier surfaces; `cron` is a single script; '
'`backups` holds one tree.')
if stale_files or stale_dirs:
lines.append('- Stale entries that are NOT part of the bulk-sync artefact: '
'| files | %d | dirs | %d |.' % (stale_files, stale_dirs))
lines.append('')
lines.append('## Method / limits')
lines.append('')
lines.append('- Scope: `os.walk` over the live `%s`, one classifier on entry name, '
'no symlink following; every name os.walk reports is counted. Totals are '
'a point-in-time snapshot and grow as the profile changes. Re-derive '
'this snapshot anytime with `python3 build_daily_triage_2026-10-27.py` '
'and re-assert it with `bash verify_daily_triage_2026-10-27.sh`.' % sol_triage_lib.ROOT)
lines.append('- Numbers are reproducible: `python3 -m sol_triage_lib` recomputes them; '
'the verify script in this directory re-derives them and asserts '
'equality with this report.')
lines.append('')
return '\n'.join(lines)
def main():
d = sol_triage_lib.compute()
report = build_report(d)
os.makedirs(SOL_LANE, exist_ok=True)
sol_path = os.path.join(SOL_LANE, REPORT_NAME)
with open(sol_path, 'w') as f:
f.write(report)
f.write('\n')
os.makedirs(OUT_ROOT, exist_ok=True)
copy_path = os.path.join(OUT_ROOT, REPORT_NAME)
with open(copy_path, 'w') as f:
f.write(report)
f.write('\n')
print('wrote', sol_path)
print('wrote', copy_path)
print('---')
print(report)
if __name__ == '__main__':
main()
@@ -0,0 +1,66 @@
# Sol-lane daily profile-state triage
Generated: `2026-10-27T00:42:12.104227+00:00`
Source: `os.walk` over `/root/.hermes/profiles/sol`, one classifier on entry name, no symlink following.
Date of this run: 2026-10-27 (UTC).
## Headline
| measure | value |
| --- | --- |
| files | 8286 |
| dirs | 1249 |
| entries | 9535 |
| stale (>60 d) | 282 |
| of which files | 232 |
| of which dirs | 50 |
## Category breakdown (name, os.walk)
| category | count |
| --- | --- |
| backups | 1 |
| bin | 5 |
| cache | 3 |
| config | 12 |
| cron | 1 |
| forge | 1 |
| home | 1 |
| hooks | 2 |
| keys | 1 |
| logs | 1 |
| lsp | 1 |
| memories | 1 |
| other | 9482 |
| pairing | 2 |
| plans | 1 |
| platforms | 1 |
| plugins | 5 |
| runtime | 2 |
| sandboxes | 1 |
| sessions | 1 |
| skills | 1 |
| skins | 1 |
| state | 5 |
| vault | 1 |
| workspace | 2 |
## Signal root-level files (not counts, advisory)
config.yaml, .env, .env.bak-20261014T165715Z, context_length_cache.yaml, auth.json, auth.lock, .env.lock, SOUL.md, .skills_prompt_snapshot.json, state.db (+shm/wal/locks), triage_check.py, triage_profiles.py, triage_skill_report.py, diag.py, diag2.py, diag3.py, diag4.py, cron-fleet-triage-2026-10-17.py, cron-fleet-triage-2026-10-18.py, cron-fleet-verify.py, inventory_skills.py, models_dev_cache.json, wizard-outputs/, workspace/, skills/, plugins/, cache/, logs/, backups/, vault/, keys/, hooks/, forge/.
## Observations
- `(stale >60 d)` is dominated by a bulk install: the entire `skills/apple`, `skills/autonomous-ai-agents`, `skills/creative` tree carries mtime 2026-06-20 (~127 d). That is a bulk-sync artefact, not per-entry decay.
- `config.yaml` and `auth.json` are the two entries an operator edits by hand; both have `.bak`/`.lock` siblings, i.e. the profile is written under a lock-style concurrency convention.
- `state.db(+shm/wal)` is the runtime statestore; the three `.lock` siblings are concurrency guards. These 5 entries all classify under `state`.
- `plugins` (1 tier) plus `plugin-update-checks` = the plugin surface; `skills` is one top-tier with many sub-skills (the bulk of the entries).
- `cache/`, `image_cache/`, `audio_cache/`, `logs/`, `memories/`, `vault/`, `keys/`, `pairing/`, `sandboxes/`, `sessions/`, `skins/`, `forge/`, `home/`, `lsp/`, `platforms/`, `plans/`, `bin/`, `workspace/` are lean single-tier surfaces; `cron` is a single script; `backups` holds one tree.
- Stale entries that are NOT part of the bulk-sync artefact: | files | 232 | dirs | 50 |.
## Method / limits
- Scope: `os.walk` over the live `/root/.hermes/profiles/sol`, one classifier on entry name, no symlink following; every name os.walk reports is counted. Totals are a point-in-time snapshot and grow as the profile changes. Re-derive this snapshot anytime with `python3 build_daily_triage_2026-10-27.py` and re-assert it with `bash verify_daily_triage_2026-10-27.sh`.
- Numbers are reproducible: `python3 -m sol_triage_lib` recomputes them; the verify script in this directory re-derives them and asserts equality with this report.
@@ -0,0 +1,100 @@
#!/usr/bin/env python3
# Sol-lane daily profile-state triage -- verifier for 2026-10-27.
#
# Recomputes the category counts and headline totals for
# /root/.hermes/profiles/sol from the live filesystem using the shared
# classifier (sol_triage_lib), then asserts that the generated report
# (sol-lane-triage-2026-10-27.md) states exactly those numbers. Exit 0 only
# if every assertion passes; nonzero otherwise.
#
# Run: python3 /root/troupe-standup/wizard-work/sol/verify_daily_triage_2026-10-27.py
# Check (this file's exit code is the verdict):
# bash /root/troupe-standup/wizard-work/sol/verify_daily_triage_2026-10-27.sh
#
# Verdict line is printed on stderr/stdout: "VERDICT: GREEN ..." (exit 0) or
# "VERDICT: RED ..." (exit 1).
import os
import re
import sys
REPO_ROOT = '/root/troupe-standup'
SOL_LANE = os.path.join(REPO_ROOT, 'wizard-work', 'sol')
REPORT_PATH = os.path.join(SOL_LANE, 'sol-lane-triage-2026-10-27.md')
sys.path.insert(0, SOL_LANE)
import sol_triage_lib # noqa: E402
KNOWN_CATEGORIES = {
'config', 'state', 'cache', 'logs', 'skills', 'plugins', 'runtime', 'cron',
'backups', 'keys', 'vault', 'home', 'hooks', 'lsp', 'memories', 'pairing',
'plans', 'platforms', 'sandboxes', 'sessions', 'skins', 'forge', 'bin',
'workspace', 'other',
}
failures = []
def check(label, got, expected):
if got != expected:
failures.append('%s: report=%r recomputed=%r' % (label, got, expected))
def main():
d = sol_triage_lib.compute()
if not os.path.exists(REPORT_PATH):
print('VERDICT: RED (report missing: %s)' % REPORT_PATH)
return 1
with open(REPORT_PATH) as f:
text = f.read()
# Headline measure table: | files | 8286 | etc.
head_re = re.compile(r'^\|\s*(files|dirs|entries|stale \(>60 d\)[^|]*)\s*\|\s*\|?\s*\|?\s*(\d+)\s*\|', re.M)
head = {}
for m in head_re.finditer(text):
key = m.group(1).strip()
val = int(m.group(2))
if key in ('files', 'dirs', 'entries'):
head[key] = val
elif key.startswith('stale'):
head['stale'] = val
check('files', head.get('files'), d['total_files'])
check('dirs', head.get('dirs'), d['total_dirs'])
check('entries', head.get('entries'), d['total_entries'])
check('stale', head.get('stale'), d['stale_count'])
# Category table: | config | 12 | etc.
cat_re = re.compile(r'^\|\s*([A-Za-z0-9_]+)\s*\|\s*(\d+)\s*\|', re.M)
reported_cat = {}
for m in cat_re.finditer(text):
key = m.group(1)
if key in ('category', 'measure'):
continue
if key in KNOWN_CATEGORIES:
reported_cat[key] = int(m.group(2))
check('category totals sum', sum(reported_cat.values()), d['total_entries'])
for k, v in d['category_counts'].items():
check('category %s' % k, reported_cat.get(k), v)
print('recompute files=%s dirs=%s entries=%s stale=%s'
% (d['total_files'], d['total_dirs'], d['total_entries'], d['stale_count']))
print('recompute stale files/dirs = %s/%s'
% (d['stale_files'], d['stale_dirs']))
if failures:
print('VERDICT: RED (%d assertion(s) failed)' % len(failures))
for fl in failures:
print(' FAIL', fl)
return 1
print('VERDICT: GREEN (%d category counts + 4 headline totals all match)'
% (len(d['category_counts']) + 4))
return 0
if __name__ == '__main__':
sys.exit(main())
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Sol-lane daily profile-state triage -- gate for 2026-10-27.
#
# Two legs, one command:
# 1. Re-derive the report from the live profile (build_daily_triage_2026-10-27.py).
# 2. Re-derive the counts from the live filesystem (verify_daily_triage_2026-10-27.py)
# and assert the regenerated report matches. Exit 0 only if leg 2 passes.
#
# The exit code of this script IS the verdict (0 = correct, nonzero = wrong).
set -u
cd "$(dirname "$0")" || exit 2
echo '== leg 1: build report from the live profile =='
python3 build_daily_triage_2026-10-27.py >/dev/null || { echo 'GEN LEG FAIL'; exit 1; }
echo '== leg 2: verify report against live filesystem =='
python3 verify_daily_triage_2026-10-27.py
rc=$?
if [ "$rc" -eq 0 ]; then
echo '== GEN_AND_VERIFY GREEN =='
else
echo "== GEN_AND_VERIFY RED (verify rc=$rc) =="
fi
exit "$rc"