Skip to content

Eval-protocol-v2 staged runner and worker slot keep-alive - #186

Draft
sdntsng wants to merge 6 commits into
devfrom
pr/qualified-memory-measurement-1e9e
Draft

sdntsng wants to merge 6 commits into
devfrom
pr/qualified-memory-measurement-1e9e

Conversation

@sdntsng

@sdntsng sdntsng commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This is the first implementation slice of the qualified-memory goal: trustworthy measurement plus the worker-pool bug that made LoCoMo extract look single-digit parallel.

  • Start point remains verified bbe55f7, plus the n=1540 handoff helpers from PR docs: n=1540 product-recall handoff for next-cycle planning #185 (not leftover-covering).
  • Product /recall scoring for qualification is versioned as eval-protocol-v2: always mode: "answer", transport failures stay transport failures, malformed judge JSON is UNRESOLVED and blocks final JSON.
  • run_smoke.py still defaults to v1 so a restarted old scorer stays v1 if --eval-protocol is unset.
  • Extraction workers keep idle slots alive while a sibling holds a job (per-subject FIFO and lease fencing unchanged).

The previous live n=1540 skip-ingest run died on VM reset with no result JSON. The extract dump survived at /opt/cursor/artifacts/n1540-live/brainy_n1540_20260911T080043Z.dump (1571/1571 jobs, 22,757 128-d hash embeddings). This PR restores a durable remasure path: local API on :18200 against that dump, incremental JSONL under /opt/cursor/artifacts/eval-runs/locomo-full-n1540-bbe55f7-protocol-v2.

This PR does not claim a LoCoMo 90% pin, replace README 11.4%, or merge leftover-covering branches.

Changes

  • internal/jobs/processor.go — ProcessAvailable waits while inFlight > 0 instead of exiting after five empty claims.
  • internal/store/postgres/runtime.go — include current_database() in /runtime for store identity.
  • evals/public/protocol.py, client.py, staged_runner.py, locomo/run_staged.py — resumable stages preflight → enqueue → drain → verify_store → answer → judge → diagnose → finalize.
  • evals/public/judge.py — v2 product recall and judge behavior; v1 substring CORRECT fallback retained behind the protocol flag.
  • evals/public/locomo/run_smoke.py — restore the public.schema import that protocol-v2 accidentally overwrote (IndentationError blocked skip-ingest).
  • evals/tools/n1540_run_staged_recall.sh — local-only skip-ingest scorer; refuses non-loopback BRAINY_BASE_URL and /tmp artifacts.
  • verify_store probes the / I / conversation so hash+trigram miss on a single token does not abort skip-ingest.
  • Publish-mode job wait now fails if expected job IDs are not accounted (empty queue is not success).
  • Tests: worker overlap, identity mismatch resume, missing/failed jobs, provider fallback, transport/UNRESOLVED finalize gates, mode=answer, high-recall presence probe, run_smoke/run_staged import.

Test plan

  • gofmt clean on touched Go files
  • go vet ./...
  • go test ./...
  • cd evals && python3 -m unittest public.test_staged_runner public.test_public_framework (49 tests)
  • Restore dump brainy_n1540 (1571 jobs, 22757 128-d embeddings) → local API :18200 hash embedder, BRAINY_RECALL_LLM=1 → GET /healthz ok, POST /recall 200 on loopback
  • Skip-ingest protocol v2 in progress: evals/tools/n1540_run_staged_recall.sh, run id locomo-full-n1540-bbe55f7-protocol-v2, 1540 questions, incremental answers.jsonl (hash embeddings; not qualification-profile)

Do not score leftover-covering pr/locomo-180-p29-1e9e.

Linear / tracking

Qualified-memory goal (no Linear id in the request). Follow-on work: S1 live-provider audit, S5 RRF/pgvector, S2/S3 planner budgets, S4 rebuild, staging + reference clients.

Risk / follow-ups

  • Qualification gates (1386/1540, 400/500 LME, 90/100 suites) are not met; this PR only makes measurement honest and extract parallelism correct.
  • Protocol v2 on the recovered hash-embedding tenant is a remeasure, not a product win. Qualification still requires pgvector + pinned text-embedding-3-small 768 and no hash fallback.
  • run_smoke default remains v1; callers must pass --eval-protocol eval-protocol-v2 or use run_staged.
  • Identity SHA for the live remasure is this branch tip (harness). Product /recall code is still bbe55f7. Do not commit further harness changes until result.json lands, or resume will reject the identity.
  • Kill list unchanged: no leftover-covering, no SOTA, no README 11.4% replacement until a completed full-product JSON exists.
Open in Web Open in Cursor 

sdntsng and others added 6 commits September 11, 2026 07:15
WIP note plus local enqueue/score helpers. No product behavior change.

Co-authored-by: aria <aria@engramhq.com>
ProcessAvailable used to drop idle goroutines after five empty claims,
so newly enqueued subjects waited on a shrunken pool during slow extract.
Idle slots now wait while another slot holds a job; per-subject FIFO and
lease fencing stay in ClaimNext.

Co-authored-by: aria <aria@engramhq.com>
Product scoring sends mode=answer, keeps transport failures out of
not-in-memory, and treats malformed judge JSON as UNRESOLVED so
final JSON cannot be written with a substring CORRECT fallback.
The runner persists identity and per-question traces, rejects resume
when the API or store changed, and refuses an empty queue as success.

Co-authored-by: aria <aria@engramhq.com>
The previous full-product run wrote JSON only at the end, so a VM reset
lost every judgment. This wrapper pins loopback, refuses /tmp artifacts,
and scores the restored hash-embedding tenant with eval-protocol-v2.

Co-authored-by: aria <aria@engramhq.com>
Hash+trigram search misses the single token "conversation" on some
restored LoCoMo tenants, which aborted skip-ingest verify_store before
any /recall scoring.

Co-authored-by: aria <aria@engramhq.com>
run_staged imports ingest_conversation from run_smoke, so skip-ingest
n=1540 scoring crashed on IndentationError before preflight.

Co-authored-by: aria <aria@engramhq.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants