add ledger + vectors pages; archive.html gets deep-linkable filters

- build_ledger.py / site/ledger.html: the pre-registered exp41 protocol's
  hypotheses, verdicts, per-cell press stats, contrasts, and the
  betrayal-reveal result, straight from its own already-computed
  results.json/hypotheses.json — no new stats derived here.
- build_vectors.py / site/vectors.html: extraction-set sizes and
  before/after orthogonalization cosines (exp41), the layer-by-layer AUC
  curve (exp43), plus a live client-side fetch of the running server's own
  /vector endpoint so the "what's actually injected right now" number is
  never a stale snapshot.
- site/archive.html: added ?q=&valence=&exp=&tag= URL params so the new
  pages (and anyone) can deep-link straight to the matching transcripts
  instead of just naming a condition in prose.

Deliberately unstyled beyond the site's existing base tokens — same as
archive.html, left for a visual pass rather than guessing at the
in-progress grimoire direction.
This commit is contained in:
eve VT committed 2026-10-01 08:54:02 -04:00
1 parent 93d2308c3e
commit 2896bc962f
7 files changed
+1159

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/env python3
"""Build site/vectors_data.json: the recorded, static half of the vectors
page — extraction-set sizes, pairwise cosine similarities before/after
orthogonalization (exp41), and the layer-by-layer AUC curve used to pick
the faithful-extraction vector's layer (exp43). The page itself also does
one live fetch to the running server's own /vector endpoint for the
current production norms — that part can't be baked in here since it's
whatever's actually deployed, not a fixed historical number.
"""
import json
from pathlib import Path
ROOT = Path(__file__).resolve().parent
OUT = ROOT / "site" / "vectors_data.json"
res = json.load(open(ROOT / "runs/exp41/results.json"))
cfg = res["config"]
layer_curve_raw = json.load(open(ROOT / "runs/exp43/layer_curve.json"))
# one row per (dataset, layer) — keep as-is, the page groups by dataset
layer_curve = layer_curve_raw["layers"]
out = {
"extraction_set_sizes": cfg["extraction_set_sizes"],
"neutral_norm": cfg["neutral_norm"],
"cosines": cfg["cosines"],
"layer_curve": layer_curve,
}
OUT.write_text(json.dumps(out, indent=1))
print(f"wrote vectors data ({len(layer_curve)} layer-curve rows) to {OUT}")