Skip to content

Support Google RRSI for regularized harness self-improvement #221

Open

Description

@Birfy

Request

Add opt-in support for Google's RRSI (Regularized Recursive Self-Improvement of Agent Harnesses) through AgentDescent's existing evolution/port interfaces.

A concrete use case: evolve a skill or agent harness against a development suite without accumulating task-specific shortcuts, unnecessary inference cost, or edits whose apparent improvement is evaluation noise. AgentDescent already supplies concurrent proposals, versioned diffs and verification; RRSI would supply a complementary regularized search/acceptance rule.

Primary sources and evidence boundary

The target is harness evolution around a frozen model, not weight training. Upstream reports transfer and token-efficiency improvements, but these have not been reproduced in AgentDescent. The current paper abstract, README and project page differ in headline numbers; do not copy those into this project's measured-results table. Follow the pinned implementation and explicitly document paper/code discrepancies.

Mechanisms the support should preserve

  1. Proposal regularization: a cosine-annealed budget counts independent edits, with component/hypothesis attribution, measured edit history and exploration of untried components when progress stalls. It is not a changed-line or file-count limit. See schedule.py and history.py.
  2. Pre-evaluation critic: deterministic leakage checks plus model review, with bounded repair; rejected candidates are logged without invented measurements. Include task-specific runtime memory leakage, grader access and undeclared edit bundling. See critic.py.
  3. Selection: preserve Algorithm 2's historical-best floor, cost rule, within-noise-band novelty/cost tradeoff and domain guards, then choose the highest-scoring admissible candidate or retain the incumbent. Specifically, the floor is S_candidate >= S_best - delta; it does not require every accepted edit to exceed the incumbent by delta. See selection.py.
  4. Pruning and accounting: use component-level recent yield to propose removal of unproductive accepted machinery; evaluate those removals normally. Preserve weighted trial rewards and missing-trial denominators. Track policy inference tokens separately from search/critic overhead. See history.py and evaluate.py.

Proposed integration and bounded first milestone

Start with examples/rrsi/, an offline mechanism fixture and one harness-directory domain. Expose it through evolve(); keep the default behavior unchanged.

  • Represent the editable harness through an existing directory/file strategy or a justified custom strategy. Keep evaluator, benchmark answers, credentials and governance configuration outside the editable artifact.
  • Reuse Policies(proposal=...) for proposal production where its one-proposal contract fits. Maintain an explicit, checkpointable RRSI record keyed by candidate/base version; ProposalContext.history and rejected cards alone are not the upstream measured per-edit ledger.
  • Prototype selection through the documented aggregator_factory extension when round-wide candidates, score/cost records and historical-best state exceed a single policy slot. Do not silently layer the default Beta gate over RRSI and call it faithful.
  • Run leakage screening before expensive evaluation. An acceptance-only wrapper is too late in the current pipeline.
  • First establish the upstream round semantics: candidates evaluated from the same incumbent, one winner. Upstream already evaluates candidates concurrently. Diff fusion or barrier-free admissions are separate AgentDescent variants; they must recheck budgets, leakage and measurements on the resulting artifact and declare the semantic change.
  • Preserve existing governance vetoes and transactional/CAS safeguards. If they conflict with an upstream acceptance case, document the restriction rather than weakening them.

This extends the port conventions in #74 and addresses the transfer/noise concerns discussed in #164. It is distinct from Genesis (#183). Repository-wide issue searches for RRSI/regularized and an all-state RRSI PR search found no existing implementation request.

Acceptance criteria

  • Pin upstream source/configuration and document each preserved mechanism, limitation and deviation in docs/algo-rrsi.md and the fidelity index.
  • Offline tests exercise edit-budget boundaries, leakage rejection before evaluation, history attribution, stall exploration and pruning.
  • Golden decision fixtures cover historical-best floor, both cost-rule branches, domain veto, ties, no admissible candidate, missing trials and unknown token counts.
  • Tests prove installed components actually run, defaults are unchanged, and resume does not duplicate evidence or lose S_best.
  • Keep evolve/development data separate from untouched final holdout/OOD data; tests ensure final evaluation evidence never enters proposals or selection.
  • Provide a zero-network, no-key --dry-run and offline end-to-end fixture using the shared CLI conventions.
  • Publish reproducible equal-budget baseline/regularized ablations and serial/synchronous/asynchronous semantics separately when measured. Report quality, cost, failures and variance; mark real-model results unmeasured until actually run.

Dependencies, risks and decisions

Upstream core requires Python 3.10+, while AgentDescent supports 3.9: prefer an optional adapter or compatible port rather than raising the package floor implicitly. Preserve Apache-2.0 notices for reused upstream code and inspect third-party licenses. Real benchmark runners need additional environments/data; paid model calls are outside this first milestone.

Questions to settle in the implementation design:

  • Start as a declared mechanism microport, then add the original coding benchmark adapter?
  • Reuse upstream pure selection functions or implement a compatibility-tested local policy?
  • Upstream treats absent token counts as zero relative cost change. Preserve that in fidelity mode, or offer a separately named strict mode that refuses cost-based admission without telemetry?

Critic approval is a heuristic, not proof against leakage. Final holdout isolation, sandbox boundaries and reproducible accounting remain necessary.

Activity

  1. self-assigned this
    on Oct 10, 2026
  2. Birfy commented on Oct 13, 2026

    @Birfy
    CollaboratorAuthor

    Progress note: the first increment landed in https://github.com/Birfy/agentdescent/pull/222 (merged).

    That PR ships the offline RRSI round-selection core under examples/rrsi/ with docs in docs/algo-rrsi.md. It deliberately does not yet cover proposal regularization/history, pre-evaluation leakage critique, trial aggregation/accounting, pruning, resumability, domain/evolve() integration, or a CLI — those remain in scope for follow-up increments on this issue.

  3. Birfy commented on Oct 13, 2026

    @Birfy
    CollaboratorAuthor

    Progress (first increment shipped). #222 merged the offline RRSI round-selection mechanism (examples/rrsi/selection.py, docs/algo-rrsi.md, tests/test_rrsi_selection.py).

    Still deferred for later increments (from docs/algo-rrsi.md):

    • Wire into evolve() / aggregator_factory / a proposal policy / resumable run record
    • RRSI CLI, harness-directory domain, leakage critic, edit-budget schedule, per-edit history
    • Trial aggregation, pruning loop, evaluation/accounting adapter
    • Pre-evaluation leakage screening and the full evolve()/CLI fixture described in this issue

    Leaving this issue open until that integration work is done.

  4. Birfy commented on Oct 17, 2026

    @Birfy
    CollaboratorAuthor

    Status on main and what remains

    Shipped: the round-selection core (#222), the schedule, per-edit history, and the evolve() integration (#254): build_rrsi_bundle() with RRsiCritic (pre-evaluation screen), RRsiProposalPolicy, RRsiAcceptance, the new Policies(screen=...) seam, critic-rejected / noise-floor / cost-rule outcomes, and a checkpointable RRsiState (resume keeps S*). 23 integration tests plus selection / schedule / history goldens. Defaults are unchanged.

    Against this issue's acceptance criteria, not yet done (from docs/algo-rrsi.md: "a full harness-directory domain adapter, multi-round select_round trial aggregation, and a RRSI CLI"):

    • Entrypoint + --dry-run: examples/rrsi/rrsi_*.py with the shared CLI conventions (zero network, no key), registered in tests/test_example_entrypoints.py PORTS.
    • Harness-directory domain: one editable harness through FileTree/skill_dir, with evaluator, answers and credentials outside the artifact; offline end-to-end fixture.
    • Trial aggregation and accounting: weighted trial rewards, missing-trial denominators, policy-inference tokens kept apart from search/critic overhead (the cost rule currently uses the proposing rollout's usage as a proxy; documented).
    • Final holdout isolation test at the evolve() level: the protected-strings test exists; add one proving final evaluation evidence never reaches proposals or selection.
    • Fidelity index: a port-fidelity.md row for the integration (the page currently documents the pre-port pieces) and the candidate_methods / self-evolution tables.
    • Ablations: equal-budget baseline vs. regularized, serial / sync / async reported separately, real-model results marked unmeasured until run.
    • Decision still open from the issue: strict mode that refuses cost-based admission without telemetry (fidelity mode keeps upstream's "absent counts = 0").

    Keep open until the entrypoint and domain land; slices above are independent, entrypoint first.

  5. added
    enhancement
    area:ports
    area:evolve
    needs-human
    on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:evolvearea:portsenhancementneeds-human

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions