Skip to content

feat(headless): add budget-matched sampling baseline to prompt RSI - #1264

Merged
Astro-Han merged 2 commits into
apache:mainfrom
Nyvo-io:codex/feat-1245-sampling-baseline
Jul 20, 2026
Merged

Astro-Han merged 2 commits into
apache:mainfrom
Nyvo-io:codex/feat-1245-sampling-baseline

Conversation

@Nyvo-io

@Nyvo-io Nyvo-io commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #1245

This adds a budget-matched parallel-sampling baseline to the headless prompt RSI loop. Each candidate round now evaluates the currently kept prompt on the stable held-in set before creating the candidate, and the candidate must strictly beat that sampling Pass@1 after clearing the existing reference/noise gate.

Design

  • The sampling arm is an evaluation baseline, not a calibration baseline. Existing repeated baseline sweeps still define the noise bands.
  • Sampling uses the stable held-in task set, the candidate-held-in budget, and the configured maxConcurrency.
  • Sampling runs with Pass@1 protection and fails closed on incomplete or orphaned evidence.
  • Sampling evidence is recorded in the same Fixed Prompt WAL and in decision metrics; it is not exposed through the agent-visible held-in TSV.
  • The manifest records the immutable sampling contract: sampling-baseline, stable-held-in, candidate-held-in, parallel execution, and Pass@1.
  • Replay validates prompt identity, resume identity, evidence ordering, and the kept prompt commit. It rejects sampling evidence after the candidate commit or after the decision.
  • Legacy v1 prompt optimization manifests migrate to the sampling contract while preserving their existing WAL fingerprint, so interrupted runs remain resumable. Cost ceilings retain their mutable guardrail semantics.
  • The implementation remains compatible with the powered keep profile from feat(headless): adopt three Self-Harness protocol details in the RSI loop — addressability filter, unified audit schema, failure-signature clustering #619.

Verification

  • npm --workspace @maka/headless run build
  • npm --workspace @maka/headless run typecheck
  • Focused prompt optimization suite: 60 passed, 0 failed
  • Biome lint and format checks on all touched files
  • git diff --check

The complete headless suite was not runnable in this sandbox because its temporary-directory setup and cleanup require filesystem permissions unavailable here; the focused suite and typecheck passed.

Out of scope

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two P2 comments on sampling resume and replay ordering. Neither rises to P1, so I am approving with comments.

@Astro-Han
Astro-Han merged commit 9a91182 into apache:main Jul 20, 2026
3 checks passed
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.

feat(headless): evaluation discipline for prompt/harness evolution — rationale and the budget-matched sampling-baseline slice

2 participants