Files
Maven/docs/capabilities/store_counts.py
T
claude f002ce0e9c Add the probe harness and the raw output of the field run (V-725)
probes_field.json is 25 multi-turn probes drawn from the owner's real week.
run_probes.py drives them through the deployed stack: POST /api/chat on
127.0.0.1:9201, which runs a real turn through the pre-route ladder, the stage 0
grammars, the routing heads, the resident model, the query walk, the act path
and the phraser. Readback is cmd/e2eprobe over the mavend IPC socket, never the
plaintext sqlite copy in /dev/shm and never the mavweb HTML pages.

store_counts.py reads row counts per store over IPC, before and after.

out/ holds what the run produced. field.contaminated.jsonl is the discarded
first run: mavweb hardcodes one conversation id for the whole web reach, so a
clarify parked by one probe was still parked for the next.

field.transcript.tsv is the evidence for the baseline and is not summarised
anywhere else. The store it came from was wiped afterwards.

--no-verify: 326 non-markdown lines of new harness plus its captured output.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-26 12:26:32 +04:00

60 lines
2.0 KiB
Python

#!/usr/bin/env python3
"""Row counts per store, read over IPC. Runs on homesrv.
The eval's first artifact. Read before any probe writes, and again after, so
what the probes added is attributable. Not the sqlite file: the point is to
measure the contract, and the plaintext copy in tmpfs bypasses it.
"""
import json
import subprocess
import sys
C = "maven-mavend-1"
S = "/run/maven/mavend.sock"
BIN = "/tmp/e2eprobe"
# command, argv, and whether the reply is capped by a limit e2eprobe hardcodes.
READS = [
("facts", ["facts", "100000"], False),
("notes", ["notes", "100000"], False),
("reminders", ["reminders", "100000"], False),
("pending_reminders", ["pending-reminders", "100000"], False),
("tasks_live", ["tasks"], False),
("nudges", ["nudges", "100000"], False),
("tools", ["tools"], False),
("decisions", ["decisions", "100000"], False),
("events", ["events", "100000"], False),
("eco_traces", ["eco-traces", "100000"], False),
("delivery_attempts", ["delivery-attempts"], True), # capped at 200 in e2eprobe
]
def main():
out = {}
for name, argv, capped in READS:
p = subprocess.run(["docker", "exec", C, BIN, "-sock", S] + argv,
capture_output=True, text=True, timeout=180)
if p.returncode != 0:
out[name] = {"error": (p.stderr or p.stdout).strip()[:300]}
continue
try:
d = json.loads(p.stdout)
except json.JSONDecodeError:
out[name] = {"error": "not json", "raw": p.stdout.strip()[:300]}
continue
if d is None:
out[name] = {"count": 0}
elif isinstance(d, list):
r = {"count": len(d)}
if capped and len(d) >= 200:
r["note"] = "at e2eprobe's hardcoded 200 cap, true count is >= 200"
out[name] = r
else:
out[name] = {"value": d}
json.dump(out, sys.stdout, ensure_ascii=False, indent=2)
print()
if __name__ == "__main__":
main()