Skip to content

fix(overseer): machine-checkable done-gate for the local COIN benchmark goal - #4332

Open
rysweet wants to merge 1 commit into
mainfrom
fix/coin-benchmark-goal-machine-checkable-done-gate
Open

fix(overseer): machine-checkable done-gate for the local COIN benchmark goal#4332
rysweet wants to merge 1 commit into
mainfrom
fix/coin-benchmark-goal-machine-checkable-done-gate

Conversation

@rysweet

@rysweet rysweet commented Jul 18, 2026

Copy link
Copy Markdown
Owner

What & why

The Overseer goal build a local COIN benchmark harness and a self-improvement loop (id build-a-local-coin-benchmark-harness-and-a-self-09e65e35) was repeatedly parked by the no-progress safeguard: its finish condition could not be checked automatically, so the daemon kept re-investigating it without ever certifying "done" (root cause: an unmeasurable done-gate with no tracked PR/issue on a non-perpetual goal).

The work the goal describes has already shipped on mainsrc/coin_gym/ (executor, target loader, scorer, leaderboard, agent runner, self-improvement loop), delivered via merged PRs #2740, #2763, #4171, #4208.

This adds a single machine-checkable done-gate so completion can be certified automatically instead of re-parked every cycle.

What the gate verifies (offline, no network)

  1. Harness source present and wired into the crate (src/coin_gym/, pub mod coin_gym;).
  2. Self-improvement loop present (run_self_improvement in improve_loop.rs).
  3. Acceptance self-check green: cargo run --bin coin-gym -- verify.
  4. Test suite green: cargo test --lib coin_gym.

It also prints (non-gating) the merged state of the delivering PRs.

Verified locally

[done-gate] [PASS] harness source present and wired (src/coin_gym/).
[done-gate] [PASS] self-improvement loop present (run_self_improvement).
[done-gate] [PASS] acceptance self-check green: result 7/7 criteria passed
[done-gate] [PASS] coin_gym test suite green (122 passed).
[done-gate] (info) delivering PR #2740/#2763/#4171/#4208: MERGED
[done-gate] CERTIFIED

Gate exits 0. Additive, non-breaking, shell-only change.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

…rk goal

The goal 'build a local COIN benchmark harness and a self-improvement loop'
(id build-a-local-coin-benchmark-harness-and-a-self-09e65e35) was repeatedly
parked by the no-progress safeguard: its finish condition could not be checked
automatically, so the daemon kept re-investigating it without ever certifying
'done'. The work it describes has already shipped on main (src/coin_gym/,
delivered via merged PRs #2740, #2763, #4171, #4208).

Add a single machine-checkable done-gate so completion can be certified
automatically instead of re-parked. The gate verifies, offline:
  1. the harness source is present and wired into the crate (src/coin_gym/),
  2. the self-improvement loop (run_self_improvement) is present,
  3. the acceptance self-check is green (cargo run --bin coin-gym -- verify),
  4. the coin_gym test suite is green (cargo test --lib coin_gym).
It also prints (non-gating) the merged state of the delivering PRs.

Verified locally: gate exits 0 — verify 7/7 criteria, 122 tests pass, all four
delivering PRs MERGED.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rysweet added a commit that referenced this pull request Jul 18, 2026
…4189)

The OODA/overseer done-gate opened a fresh done-gate PR every cycle for a
goal whose engineer had exited leaving an open, unmerged PR — flooding the
repo (3x coin-benchmark #4326/#4329/#4332, 4x kgpacks-parity
#4324/#4328/#4330/#4333). Dispatch lacked any dedup keyed on durable goal
identity.

Make goal->engineer done-gate emission idempotent on stable goal identity:

- Durable primary guard: new `goal_pr_emissions` ledger (schema v1->v2,
  forward-only, additive) with `record_goal_pr_emission` upsert
  (ON CONFLICT(goal_key) DO UPDATE) and an indexed `find_open_goal_pr_emission`
  open-lookup. UNIQUE(repo, pr_number) turns a second goal claiming the same
  PR into a visible conflict, not a silent duplicate. Rows are never deleted —
  a completed PR transitions `state`, so an emission outlives its engineer.
- Advisory secondary seam: pure, total, no-panic dedup bricks
  (`goal_dedup_key`, `parse_goal_key_trailer`, `find_open_pr_for_goal`) plus a
  `GoalPrRef` DTO and a `PrGhClient::list_open_goal_prs` default so `gh`
  open-PR reconciliation can adopt a pre-existing PR by the `Simard-Goal-Key:`
  body trailer (primary) or `engineer/{key}-` branch convention (fallback).
  The goal key is a one-way, boundary-safe sha256 of goal identity, never the
  goal title, so distinct goals are unaffected.

Additive and non-breaking (default `list_open_goal_prs` returns empty; existing
fakes compile unchanged); structured tracing + OTel only, no stray print!, no
Bridge naming. Regression coverage: 6 ledger contract tests, 27 dedup unit
tests, and a 3-case integration test proving same-goal cycles emit exactly one
PR while distinct goals each dispatch. Docs: concept, how-to runbook, and
ledger API reference, all linked from the index and mkdocs nav.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rysweet added a commit that referenced this pull request Jul 21, 2026
… selection (#4389)

Fix the delivery stall where build_merge_judge() falls back to
RefusingMergeJudge (always NotReady) whenever no LLM/recipe provider is
wired, refusing every green PR and re-escalating them each tick.

P1 (wired, #4389):
- Add opt-in ObjectiveMergeJudge tier: passes a green PR iff its
  AUTHENTICATED author.login is on the trusted-author allowlist and is not
  the overseer bot (no self-merge loop). Off by default
  (SIMARD_MERGE_OBJECTIVE_FALLBACK); RefusingMergeJudge stays the
  fail-closed default. Objective gates (CI-green, MERGEABLE, base/repo
  allowlists) still run downstream and are never bypassed.
- resolve_merge_judge_kind(): Recipe > LLM > Objective(opt-in) > Refusing.
- Hydrate PrSnapshot.author_login from `gh pr view --json author`.
- project_ready_prs(): admit trusted-author green PRs at gate #3 (opt-in
  only); anti-recursion author guard and fail-closed draft gate #5
  (is_draft == Some(false)) preserved.
- Hardened env parsing for the fallback flag and trusted-author allowlist
  (reject whitespace/`/` entries); replace stray eprintln! with tracing.

P2 decision layer (partially implemented, #4305/#4387/#4390):
- Add pure, unit-tested self_deploy::head_advance: DeployHeadState (per-SHA
  dedupe), needs_head_advance, is_valid_deploy_sha (argv-injection guard),
  and systemd unit-load classification. Effectful wiring into the deploy
  loop is a tracked follow-up (docs flagged "partially implemented").

P3 decision layer (partially implemented, #4326/#4329/#4332):
- Add pure, unit-tested goal_curation done-gate slug convergence
  (converge_done_gate_prs, sanitize_goal_slug): keep the oldest CLEAN
  done-gate PR, supersede the rest scoped to bot-author AND exact slug.
  Runtime wiring into advance_goal is a tracked follow-up.

Docs: add concept/reference/howto pages; P2/P3 pages accurately marked
"partially implemented" (decision layer landed + tested; wiring pending).

Verification: cargo build clean; cargo clippy --lib clean; cargo test --lib
9090 passed, 0 failed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rysweet added a commit that referenced this pull request Jul 21, 2026
…stray gym_history.db

Quality-audit fixes over PR #4402 changed files:
- head_advance.rs docstring falsely asserted the orchestrator/restart callers
  already consume the head-advance decisions; they do not. Reworded to state
  the helpers are decision-only and the live wiring is pending follow-up
  (#4305/#4387/#4390), removing the false present-tense delivery claim.
- Mirror the same honesty note on the P3 done-gate convergence helper
  (#4326/#4329/#4332): pure decision, not yet wired into the stewardship loop.
- Remove accidentally git-added gym_history.db (16KB SQLite worktree artifact)
  and gitignore it so it can never be committed.

No runtime behavior change (P1 objective merge-judge remains fully wired).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant