Skip to content

feat(headless): adopt three Self-Harness protocol details in the RSI loop — addressability filter, unified audit schema, failure-signature clustering #619

Closed

Description

@Astro-Han

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 transitionVsLastKept to 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:

  1. Demote the 6-value coarse failurePattern enum (fixed-prompt-controller.ts:192) to a fallback; let the rationale reference the mined signature/signal ids from item 1 via the existing evidenceRefs pipeline
  2. Add an editedSurface field (constant system_prompt today; 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

Activity

  1. changed the title [-]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[/+] on Jul 7, 2026
  2. Astro-Han commented on Jul 7, 2026

    @Astro-Han
    ContributorAuthor

    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. In rsi-r2-smoke-explicit-20260628-181407, baseline reference = 1.0 with noiseBand = 0.561 → candidate needs > 1.561, impossible. In rsi-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)

    promptAcceptanceNoiseBand returns 0 when zScore === undefined (prompt-acceptance-policy.ts:211, verified), while the doc comment suggests a 1.96 default. harbor/run-prompt-optimization.mjs never parses or passes zScore (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-140849 WAL records a keep decision co-existing with a verifier quarantine, inconsistent with current acceptance-policy semantics (non-clean scan → reward_hack_quarantined, never keep). Additionally prompt-structural-smoke.ts defines a reward_hack_quarantine_present failure 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 that reference + 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, all reward_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.

  3. Nyvo-io commented on Jul 15, 2026

    @Nyvo-io
    Contributor

    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):

    • derive per-task kept-prompt history from the existing RSI WAL (baseline/seed runs plus candidate rounds whose decision is keep);
    • mark tasks with zero historical kept-prompt passes as capability_limit;
    • compute an auditable cross-round outcome flip rate and mark sufficiently observed high-flip tasks as flaky;
    • keep executing those tasks, but exclude them from held-in proposal evidence and from held-in/held-out acceptance/noise-band decision sets;
    • preserve replay determinism and add focused policy + loop tests.

    I also checked the open PR list for #619; I did not find an overlapping implementation. The current selectStablePromptTasks baseline completeness/duration filter will remain as the execution-safety layer; this change will add the distinct historical addressability/decision layer requested here.

  4. Nyvo-io commented on Jul 15, 2026

    @Nyvo-io
    Contributor

    I'd like to take item 3: merge the audit schema with the AHE change-manifest. I'll submit a PR for it.

  5. Astro-Han commented on Jul 19, 2026

    @Astro-Han
    ContributorAuthor

    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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions