Repository navigation
Description
Background
Self-Harness (arXiv 2606.09498, Shanghai AI Lab, 2026-06) is structurally isomorphic to our RSI loop (weakness mining → bounded proposal → held-in/held-out dual-gate validation). A side-by-side comparison surfaced three protocol details we can adopt directly. Our existing structures already cover most of the ground, so all three are incremental changes, not rebuilds. Lilian Weng's survey (lilianweng.github.io/posts/2026-07-04-harness/) lists "preserving negative results" and "evaluator outside the loop" as preconditions for a self-improvement loop to hold; all three items below serve those preconditions.
Ordered by "fixing this unlocks the most downstream": 2 → 3 → 1 (2 is the cheapest and directly attacks the keep=0 deadlock; 3 is pure schema work; 1 is the largest effort and its real-world benefit is capped by trace fidelity, i.e. #615).
1. Failure-signature triple clustering (depends on #615; suggest same milestone)
Status quo: the five signal kinds in RsiAnalysisSignal (rsi-round-analysis.ts:38) — transition / coverage_regression / error_class / tool_failure_cluster / trace_unavailable — all cluster essentially on the surface-level terminal cause (c). Two failures that are both tool_failed — one stuck in a retry loop, one that deleted its own artifact — land in the same cluster, so proposals cannot be on target.
Increment: adopt the Self-Harness failure signature φ = (c, q, m):
- c = terminal verifier/tool-level cause (already have)
- q = causal status of the agent behavior within the trace (did it actually cause the terminal failure)
- m = abstract mechanism (start with a controlled vocabulary: retry_loop / artifact_deleted / exploration_stall / env_not_persisted / …; the vocabulary may grow per round but every entry needs a definition)
Discipline constraint: per-trace attribution of q and m uses an LLM (invoked on the evaluation-system side, never inside the proposer context), while cluster merging is deterministic code with exact triple match. Same isolation discipline as the existing reward-hack scan.
Dependency: RsiTraceUnavailableReason already includes input_limit_exceeded; q/m must be mined from full traces, so the write-path truncation in #615 (F1/F3) directly caps attribution quality.
2. Addressability filtering (cheapest; directly attacks keep=0)
Status quo: RsiTaskOutcome (rsi-round-analysis.ts:13) already separates infra / budget / plumbing from fail — "infrastructure noise gets no patch" is already half a step ahead of the paper. Two filters are missing:
- capability_limit: tasks that never passed under any kept prompt in history should not enter proposal evidence (a scan over historical WAL events suffices)
- flaky tasks: add a cross-round flip-rate statistic on top of
transitionVsLastKeptto identify tasks that oscillate pass→fail→pass uncorrelated with prompt changes
Key payoff: the noise band is currently estimated over the full task set. If the band width is inflated by a few flaky tasks, removing them from the decision set (still run, just excluded from acceptance judgment) shrinks variance → narrower noise band → the keep=0 deadlock may loosen without touching the evaluator at all. This is a low-cost flanking move on the evaluator-noise problem; worth trying before introducing the deterministic token-cost objective.
Also: Self-Harness explicitly refuses to patch three failure-cluster types — task inherently too hard / unstable outcomes / model capability ceiling — which saves the evaluation budget of candidates doomed to rejection.
3. Merge the audit schema with the AHE change-manifest (pure schema work)
Status quo: PromptCandidateRationale (fixed-prompt-controller.ts:203) already has failurePattern / evidenceRefs / hypothesis / targetedFix / predictedFixes / riskTasks — a near field-by-field match with the Self-Harness proposal audit record a_j (targeted failure pattern, edited surface, expected behavioral effect, regression risks); PromptCandidateDecisionEvent already commits the rationale hash into the WAL. Roughly 80% done.
Increment:
- Demote the 6-value coarse
failurePatternenum (fixed-prompt-controller.ts:192) to a fallback; let the rationale reference the mined signature/signal ids from item 1 via the existingevidenceRefspipeline - Add an
editedSurfacefield (constantsystem_prompttoday; forward-compatible with mutation-surface expansion), and merge with the AHE change-manifest (feat(headless): add AHE target protocol #411) into a single schema, so RSI candidates and AHE changes speak the same audit language and evidence export (feat(headless): add AHE evidence export #413) does not need to adapt to two formats
Explicitly not adopted (recording the decision)
The Self-Harness acceptance rule (dual-split non-regression + rejecting trade-off candidates) does not replace our noise-band mechanism: it runs only 2 repeats per candidate, which handles evaluator noise more coarsely than we do. The direction is to take the best of both: keep the noise band, absorb the "reject robbing-Peter-to-pay-Paul candidates" idea, and run it as a comparison experiment later.
Related
- fix(runtime): RuntimeEvent ledger is recovery-grade (WAL), not source-of-truth — write-path truncation blocks counterfactual replay #615 (write-path truncation: fidelity dependency of item 1; trace-audit quality after item 2 filtering also benefits)
- feat(headless): add AHE target protocol #411 / feat(headless): add AHE evidence export #413 (AHE target protocol and evidence export: merge targets of item 3)
- References: arXiv 2606.09498 (Self-Harness); Weng, "Harness Engineering for Self-Improvement" (2026-07-04)
Activity
[-]feat(headless): RSI loop 采纳 Self-Harness 协议三项改进 — 可寻址过滤、审计 schema 合并、失败签名聚类[/-][+]feat(headless): adopt three Self-Harness protocol details in the RSI loop — addressability filter, unified audit schema, failure-signature clustering[/+]Astro-Han commentedon Jul 7, 2026
Addendum: infrastructure-vs-results gap audit (independently reviewed by Codex, key claims spot-verified)
We ran an independent comparison of the RSI machinery against the recorded artifacts under
maka-eval/. Conclusion: the gap is not "evaluator noise" in the abstract — the acceptance gate was mathematically impassable in the R2 smoke line, and the later keep=1 artifacts were produced under a different (weaker) standard. These findings reorder this issue's priorities: the defects below come before items 1–3 of the original plan.D1 (P0): acceptance gate mathematically impassable in R2 smoke/bounded runs
Rule is
candidate > reference + noiseBand. Inrsi-r2-smoke-explicit-20260628-181407, baseline reference = 1.0 with noiseBand = 0.561 → candidate needs > 1.561, impossible. Inrsi-r2-bounded-complete-20260628-212545, 0.5 + 0.573 = 1.073 > 1.0 max. keep=0 was not "candidates weren't good enough" — the door was locked. Root causes: 1–2 held-in tasks, baseline at/near ceiling, additive noise-band rule.D2 (P1): zScore never wired — noise band silently 0 in later runs (spot-verified)
promptAcceptanceNoiseBandreturns 0 whenzScore === undefined(prompt-acceptance-policy.ts:211, verified), while the doc comment suggests a 1.96 default.harbor/run-prompt-optimization.mjsnever parses or passeszScore(verified: no occurrence). Consequence: the repo mixes two artifact populations — early runs with 0.56/0.57 bands (keep impossible) and later keep=1 runs (rsi-meta-retry-pilot-light-20260701,rsi-kept-5round-20260701) with band = 0, where a single-task net change suffices to keep. The recorded "successes" reflect a standard change, not a prompt improvement.D3 (P1): keep recorded alongside reward-hack quarantine; smoke does not fail on quarantine
rsi-kept-5round-20260701-140849WAL records a keep decision co-existing with a verifier quarantine, inconsistent with current acceptance-policy semantics (non-clean scan →reward_hack_quarantined, never keep). Additionallyprompt-structural-smoke.tsdefines areward_hack_quarantine_presentfailure type but never pushes quarantines into failures. Accepted-candidate counts are currently not trustworthy as success evidence.D4 (P2): trace fidelity caps weakness mining
Round analysis reads bounded JSONL (1MB / 10k lines / 1k events per task; overflow →
trace_unavailable), so the meta-agent often sees summaries rather than diagnosable failure traces. Same root as #615 and item 1 above.Highest-leverage change: a "powered keep profile"
Before adding any mutation machinery: define and default to a profile that (a) explicitly passes
zScore, (b) selects a held-in task slice whose baseline is not at ceiling, (c) sizes held-in so thatreference + noiseBand ≤ 1.0, and (d) keeps the held-out sweep. Only after this can a keep=1 demonstrate that the loop genuinely found and retained a candidate — rather than benefiting from a zero noise band or the legacy quarantine inconsistency.Revised order for this issue
D2/D3 (defect fixes) → D1 (powered keep profile) → item 2 (addressability/flaky filter) → item 3 (schema merge) → item 1 (signature clustering, with #615).
Evidence anchors:
maka-eval/rsi-r2-smoke-explicit-20260628-181407/prompt-optimization-result.json,maka-eval/rsi-r2-bounded-complete-20260628-212545/prompt-optimization-result.json,maka-eval/rsi-runs/rsi-r1-full-20260629-234517/(10 rounds, allreward_hack_quarantined, smoke fail),maka-eval/rsi-runs/rsi-kept-5round-20260701-140849/controller/results.jsonl,packages/headless/src/prompt-acceptance-policy.ts:211,packages/headless/harbor/run-prompt-optimization.mjs.Nyvo-io commentedon Jul 15, 2026
I'd like to take the independent item 2: addressability filtering slice.
Proposed scope (kept intentionally separate from signature clustering and the audit-schema merge):
keep);capability_limit;flaky;I also checked the open PR list for
#619; I did not find an overlapping implementation. The currentselectStablePromptTasksbaseline completeness/duration filter will remain as the execution-safety layer; this change will add the distinct historical addressability/decision layer requested here.Nyvo-io commentedon Jul 15, 2026
I'd like to take item 3: merge the audit schema with the AHE change-manifest. I'll submit a PR for it.
Astro-Han commentedon Jul 19, 2026
External validation for the D2 finding and the powered-keep-profile direction: Rethinking the Evaluation of Harness Evolution (arXiv 2607.12227) shows that under matched feedback and inference budgets, harness evolution underperforms plain parallel sampling, and its gains concentrate in pass@k rather than pass@1. Our D2 (keep=1 under
noiseBand = 0) is the same failure mode seen from the inside.Two consequences:
capability_limitfilter is exactly the paper's "headroom" condition: tasks the model cannot solve under any kept prompt carry no signal about harness quality, so excluding them from the decision set is the right call.