From 0fd7cfa2f459a3db7036e363091312d2056e0f26 Mon Sep 17 00:00:00 2001 From: MSCodeBase Agent Date: Tue, 29 Sep 2026 08:24:34 +0300 Subject: [PATCH 1/5] docs(experiments): persist reranker P3 probe artifacts + prereg --- experiments/reranker_p3/PREREG.md | 37 +++++ experiments/reranker_p3/README.md | 46 ++++++ experiments/reranker_p3/SHA256SUMS | 6 + experiments/reranker_p3/probe_rerank.py | 71 ++++++++ experiments/reranker_p3/probe_rerank2.py | 50 ++++++ .../reranker_p3/rerank_probe_run1.json | 155 ++++++++++++++++++ .../reranker_p3/rerank_probe_run2.json | 18 ++ 7 files changed, 383 insertions(+) create mode 100644 experiments/reranker_p3/PREREG.md create mode 100644 experiments/reranker_p3/README.md create mode 100644 experiments/reranker_p3/SHA256SUMS create mode 100644 experiments/reranker_p3/probe_rerank.py create mode 100644 experiments/reranker_p3/probe_rerank2.py create mode 100644 experiments/reranker_p3/rerank_probe_run1.json create mode 100644 experiments/reranker_p3/rerank_probe_run2.json diff --git a/experiments/reranker_p3/PREREG.md b/experiments/reranker_p3/PREREG.md new file mode 100644 index 00000000..9ee67f15 --- /dev/null +++ b/experiments/reranker_p3/PREREG.md @@ -0,0 +1,37 @@ +# P3 module-head anchor — preregistration (2026-09-29) + +Status: PREREGISTERED — written BEFORE implementing the anchor. No numbers +invented here; thresholds/caps referenced are the existing ones +(`_O1_ANCHOR_TOTAL`, `MAX_RERANKER_INPUT=30`, `MIN_RERANK_SCORE=0.3` untouched). + +## Hypothesis + +P3 (`src/core/artifact_gc.py` gold file below threshold) is a pool-entry / +ranking problem of the same family as P2: the chunk the reranker scores +highest (module-head/docstring) never reaches the reranker, while the code +chunk that does reach it scores a negative logit and dies at the threshold. + +## Decision rule (verbatim) + +"anchor a file's module-head/docstring chunk into the pre-rerank pool iff it +scores above threshold on holdout queries; falsified if (i) docstring chunks +do not outscore code chunks on holdout, (ii) anchoring regresses holdout H-set, +(iii) pool cost exceeds caps". + +## Reading of the three clauses + +- (i) is checked by the persisted probes + (`rerank_probe_run1.json`: gold_doc #1 on 6/6 holdout-style queries; + `rerank_probe_run2.json`: module_head top on P3/R2, code chunks negative). +- (ii) is checked by the no-regression holdout H1–H12 + P/R + doc-control + gate (fresh-process discipline — reranker-cache trap). +- (iii) is checked structurally: anchors bounded by the existing caps + (`_O1_ANCHOR_TOTAL`, `MAX_RERANKER_INPUT=30`). + +## Scope + +- Validate on holdout only — NEVER the frozen eval-16. +- `MIN_RERANK_SCORE=0.3` untouched (threshold sweep on the eval set was + explicitly refuted in `EXPERIMENTS_LOG.md:2815-2816`). +- Minimal diff extending the P2 `_anchor_identifier_chunks_async` precedent + (`engine.py:772-805`), same style. diff --git a/experiments/reranker_p3/README.md b/experiments/reranker_p3/README.md new file mode 100644 index 00000000..2bbd2d4c --- /dev/null +++ b/experiments/reranker_p3/README.md @@ -0,0 +1,46 @@ +# reranker_p3 probes — module-head / docstring anchor evidence + +Persisted 2026-09-29 from `%TEMP%\opencode\` (byte-identical copies, hashes in SHA256SUMS). + +## What + +Two fresh-process direct-reranker probes that bypass retrieval and POST +straight to the reranker. Finding: the gold module-head/docstring chunk of +`src/core/artifact_gc.py` outscores every code chunk on holdout-style queries, +while the `_prune`-body code chunk scores a negative logit (P3 -0.99, R2 -2.60 +in the eval path). Motivation for the P3 module-head anchor: guarantee the +docstring chunk a place in the pre-rerank pool. + +## When / how run + +- Both scripts stdlib-only (`urllib`), run as `python