47 lines
2.0 KiB
Python
47 lines
2.0 KiB
Python
"""Inspect run output quality."""
|
|
import json, re
|
|
PATH = "/mnt/d/Resonance_Engine/traj/regime_20260608T133638/fractonaut_observations.jsonl"
|
|
ents = [json.loads(l) for l in open(PATH)]
|
|
print(f"total entries: {len(ents)}")
|
|
|
|
# gemma was active until ~15:09 (PID 6820 killed during ts 15:08:xx)
|
|
import time
|
|
SWAP_TS = time.mktime(time.strptime("2026-06-08 15:09:00", "%Y-%m-%d %H:%M:%S"))
|
|
qwen = [e for e in ents if (e.get("response_wall") or 0) > SWAP_TS]
|
|
print(f"post-swap (qwen) entries: {len(qwen)}")
|
|
|
|
lens = sorted(len(e.get("response") or "") for e in qwen)
|
|
print(f"length min/med/max: {lens[0]} / {lens[len(lens)//2]} / {lens[-1]}")
|
|
|
|
no_anchor = sum(1 for e in qwen if "cycle 11943500" not in (e.get("response") or ""))
|
|
phys = sum(1 for e in qwen if re.search(r"\b(buy|sell|injection|skew|shear|laminar|turbulent|vortic|stress|isotropic|decoupl)\b",
|
|
(e.get("response") or ""), re.I))
|
|
print(f"no '11943500' anchor: {no_anchor}/{len(qwen)}")
|
|
print(f"mentions physics/market words: {phys}/{len(qwen)}")
|
|
|
|
# Counter on bigrams to find templating
|
|
from collections import Counter
|
|
starts = Counter()
|
|
for e in qwen:
|
|
r = (e.get("response") or "").strip()
|
|
if r:
|
|
starts[" ".join(r.split()[:4])] += 1
|
|
print("\n--- 8 most common opening 4-grams ---")
|
|
for s, c in starts.most_common(8):
|
|
print(f" {c:4d} {s}")
|
|
|
|
print("\n--- 4 sample transition responses ---")
|
|
trans = [e for e in qwen if e.get("context", {}).get("event") == "regime_transition"]
|
|
for e in trans[:4]:
|
|
ctx = e["context"]
|
|
print(f"[{ctx.get('from')}->{ctx.get('to')} min={ctx.get('minute')} "
|
|
f"asym={ctx.get('asym',0):.1f} coh={ctx.get('coh',0):.4f} "
|
|
f"tcz={ctx.get('trade_count_z')} bz={ctx.get('buy_z')} sz={ctx.get('sell_z')}]")
|
|
print(f" {(e.get('response') or '')[:600]}")
|
|
print()
|
|
|
|
print("--- arm_T_end response ---")
|
|
end = [e for e in qwen if e.get("context", {}).get("event") == "arm_T_end"]
|
|
if end:
|
|
print((end[0].get("response") or "")[:1200])
|