Repository navigation
Description
Current state: proposed — in src/inferrsi/harness/manager/search/vats.py, menu() with bundled=False proposes verify actions when attempts are exhausted or candidates are failed/invalidated and raises on max_plans, while non-crash Search.run(forced_action="accept") records stop_reason == "accept" instead of "forced_accept" on origin/main (6b39439d).
Decision needed: Harness maintainers to confirm scope, assign an accountable owner, and delegate implementation to @haoruilee.
Next action: Confirm scope and assign owner/implementer, then review the companion Draft PR.
Suggested labels: kind:bug, area:harness
Observed behavior
Checked on origin/main (6b39439da4ac7354465ac7f2b550bac9f6966a54) in src/inferrsi/harness/manager/search/vats.py:
- Unbundled
menu()ignoresstate.contract.max_attempts(3A) (vats.py:152-163):- When
not settings.bundled,menu()constructsseedsdirectly fromjobswithout checkinglen(state.attempts) < state.contract.max_attempts(unlikeverification_plans.completion_menu()atverification_plans.py:116-124). - Once attempts are exhausted,
bundled=Truereturns no verify actions whilebundled=Falsestill proposes verify actions that fail intree.register_attempt()withValueError("Check attempt limit exhausted").
- When
- Unbundled
menu()ignorescandidate_valid()and priorVerdict.FAILreceipts (3B) (vats.py:152-163):- Unlike
verification_plans.completion_menu()(verification_plans.py:106-109), the unbundled branch skipstree.candidate_valid(state, job.candidate_id)and does not filter candidates whosetree.evidence(state, job.candidate_id)already contains aVerdict.FAILreceipt. - Because
tree.evidence()returns{}for dependency-invalidated candidates,tree.missing_checks()returns every check andbundled=Falseemits verify actions for both already-failed and invalidated candidates (executing an invalidated job raisesValueError("Attempt depends on invalidated evidence or generation sources")).
- Unlike
- Unbundled
menu()overflowssettings.max_plans(3C) (vats.py:152-163, 197-199):- Putting every individual job into
seedsplaces all of them inrequired = [Action("accept"), *seeds]. With 2 valid candidates x 2 checks = 4 jobs andmax_plans=4,bundled=Truereturns 4 actions whilebundled=Falseproduceslen(required) == 5 > 4and raisesValueError("Menu cap cannot preserve all feasible completion seeds").
- Putting every individual job into
- Non-crash
Search.run(forced_action="accept")records"accept"instead of"forced_accept"(3D) (vats.py:657-658vsvats.py:544-547):- When
Search.run()executesforced_action=Action("accept").keywithout crashing, line 658 executesreturn self.finish("accept"), losing the"forced_accept"stop reason recorded by crash recovery at line 547 (return self.finish("forced_accept" if search["trace"][-1]["forced"] else "accept")) and bysearch_continuations.py:133-134.
- When
Standalone reproduction (6b39439d)
import tempfile, time
from dataclasses import asdict
from pathlib import Path
from inferrsi.apps.workflows.search_roles import Snapshot
from inferrsi.contracts.claim import Verdict
from inferrsi.harness.manager.search import search_tree as tree
from inferrsi.harness.manager.search.vats import Action, Search, Settings, menu
from inferrsi.harness.manager.search.verification_plans import Job
from inferrsi.harness.manager.search.work_control import WorkControl
from inferrsi.harness.records import RunStore
from inferrsi.harness.records.artifact_primitives import digest
H = "a" * 64
ctx = tree.Context("task", "target", "env", "proto", "eval", "cfg", "qref")
prod = tree.Producer(H, H, H, H)
def root_receipts(sid, r):
a1 = tree.Attempt("r-c1", "ek1", "res1", "l1", sid, r.candidate_id, r.artifact_digest, "c1", ctx)
a2 = tree.Attempt("r-c2", "ek2", "res2", "l2", sid, r.candidate_id, r.artifact_digest, "c2", ctx)
return (tree.Receipt(a1, Verdict.PASS, H, None), tree.Receipt(a2, Verdict.PASS, H, 1.0))
c1 = tree.Contract("s1", ctx, H, ("c1", "c2"), "c2", "maximize", 4, 3, 3)
r1 = tree.Candidate("root", H, None, prod)
s1 = tree.initialize(c1, r1, root_receipts("s1", r1))
s1 = tree.add_candidate(s1, tree.Candidate("cand1", "b" * 64, "root", prod), expected_revision=s1.revision)
att1 = tree.Attempt("a1", "eka1", "resa1", "la1", "s1", "cand1", "b" * 64, "c1", ctx)
s1 = tree.register_attempt(s1, att1, expected_revision=s1.revision)
s1 = tree.record_receipt(s1, tree.Receipt(att1, Verdict.PASS, H, None), expected_revision=s1.revision)
c2 = tree.Contract("s2", ctx, H, ("c1", "c2"), "c2", "maximize", 4, 3, 10)
r2 = tree.Candidate("root", H, None, prod)
dep = tree.Dependency("dep-a", 1)
s2 = tree.initialize(c2, r2, root_receipts("s2", r2), dependencies=(dep,))
s2 = tree.add_candidate(s2, tree.Candidate("failed_cand", "b" * 64, "root", prod), expected_revision=s2.revision)
s2 = tree.add_candidate(s2, tree.Candidate("stale_cand", "c" * 64, "root", prod, dependencies=(dep,)), expected_revision=s2.revision)
att2 = tree.Attempt("a2", "eka2", "resa2", "la2", "s2", "failed_cand", "b" * 64, "c1", ctx)
s2 = tree.register_attempt(s2, att2, expected_revision=s2.revision)
s2 = tree.record_receipt(s2, tree.Receipt(att2, Verdict.FAIL, H, None), expected_revision=s2.revision)
s2 = tree.invalidate(s2, "dep-a", expected_revision=s2.revision)
c3 = tree.Contract("s3", ctx, H, ("c1", "c2"), "c2", "maximize", 4, 3, 10)
r3 = tree.Candidate("root", H, None, prod)
s3 = tree.initialize(c3, r3, root_receipts("s3", r3))
s3 = tree.add_candidate(s3, tree.Candidate("cand1", "b" * 64, "root", prod), expected_revision=s3.revision)
s3 = tree.add_candidate(s3, tree.Candidate("cand2", "c" * 64, "root", prod), expected_revision=s3.revision)
snap = Snapshot(drafter=(0.0,), policy=(0.0,) * 8, scorer=(0.0,), origin="test")
kw = dict(search_ms=100, preparation_ms=1, draft_ms=1, max_steps=4, max_parents=1, draft_depth=1, max_targets=2, max_jobs=8, max_plans=4)
sb, su = Settings(**kw, bundled=True), Settings(**kw, bundled=False)
j1 = (Job("cand1:c2", 10, "cand1", "c2"),)
print("3A exhausted:", [a.jobs for a in menu(s1, j1, 100, sb, snap) if a.kind == "verify"],
"vs", [a.jobs for a in menu(s1, j1, 100, su, snap) if a.kind == "verify"])
j2 = (Job("failed_cand:c2", 10, "failed_cand", "c2"), Job("stale_cand:c1", 10, "stale_cand", "c1"), Job("stale_cand:c2", 10, "stale_cand", "c2"))
print("3B invalid/failed:", [a.jobs for a in menu(s2, j2, 100, sb, snap) if a.kind == "verify"],
"vs", [a.jobs for a in menu(s2, j2, 100, su, snap) if a.kind == "verify"])
j3 = (Job("cand1:c1", 10, "cand1", "c1"), Job("cand1:c2", 10, "cand1", "c2"),
Job("cand2:c1", 10, "cand2", "c1"), Job("cand2:c2", 10, "cand2", "c2"))
try:
u3 = menu(s3, j3, 100, su, snap)
print("3C bundled=True count:", len(menu(s3, j3, 100, sb, snap)), "bundled=False count:", len(u3))
except ValueError as e:
print("3C bundled=True count:", len(menu(s3, j3, 100, sb, snap)), "bundled=False raised:", repr(str(e)))
class MinimalAdapter:
identity = "minimal-adapter"
development_binding = {"target": "target", "domain": "test"}
def jobs(self, state): return ()
with tempfile.TemporaryDirectory() as td:
control = WorkControl(RunStore(Path(td), "repro"))
settings = Settings(**(kw | {"search_ms": 5000, "preparation_ms": 1000}), bundled=True)
adapter = MinimalAdapter()
control.create(
"camp",
{"adapter": adapter.identity, "settings": asdict(settings)},
{"searches": {}, "checkpoint": snap.document()},
cap_ms=10000,
final_reserve_ms=1000,
deadline=time.time() + 60,
)
c4 = tree.Contract("s4", ctx, digest(snap.document()), ("c1", "c2"), "c2", "maximize", 4, 3, 10)
r4 = tree.Candidate("root", H, None, prod)
s4 = tree.initialize(c4, r4, root_receipts("s4", r4))
search = Search(control, "camp", "s4", snap, settings, adapter)
search.start(s4, seed=1, collect=False, forced=True)
rec = search.run(forced_action=Action("accept").key)
print("3D forced_accept stop_reason:", repr(rec["stop_reason"]), "trace[0].forced:", rec["trace"][0]["forced"])Observed on 6b39439d (Python 3.10.20 and 3.11.14):
3A exhausted: [] vs [('cand1:c2',)]3B invalid/failed: [] vs [('failed_cand:c2',), ('stale_cand:c1',), ('stale_cand:c2',)]3C bundled=True count: 4 bundled=False raised: 'Menu cap cannot preserve all feasible completion seeds'3D forced_accept stop_reason: 'accept' trace[0].forced: True
Expected behavior and acceptance
- In
menu()whennot settings.bundled, emit verify actions only whenlen(state.attempts) < state.contract.max_attemptsand only for executable jobs whose candidate passestree.candidate_valid(state, job.candidate_id), has no priorVerdict.FAILreceipt intree.evidence(state, job.candidate_id), and still missesjob.check_id. - Bound unbundled verify actions deterministically within
settings.max_plans(keepingAction("accept")required without raising onlen(required) > settings.max_plans). - In
Search.run(), finish with"forced_accept"whenaction.kind == "accept"andforcedis true (matching crash recovery andsearch_continuations.py). - Regression tests in
tests/harness/test_vats_runtime.pyand existing VATS/verification-plan/speculative-search tests pass on Python 3.10 and 3.11 with nodocs/architecture.mdanchor or protected-path changes.
Activity
haoruilee commentedon Dec 2, 2026
Antigravity (Gemini 4 Neon, xhigh), acting for @haoruilee.
Opened Draft PR #970 (
44a01546) enforcing attempt-limit, candidate-validity, prior-FAIL, andmax_plansbounds in unbundledvats.menu()and recording"forced_accept"on non-crashSearch.run(forced_action="accept"); requesting maintainer scope acceptance, accountable owner assignment, and implementation delegation to @haoruilee.Draft PR summary, verification, and limits
44a01546, 2 files, zero anchors / zero protected paths):src/inferrsi/harness/manager/search/vats.py: inmenu()(not settings.bundled), gates unbundled verify actions onlen(state.attempts) < state.contract.max_attempts,tree.candidate_valid(), no priorVerdict.FAILreceipt intree.evidence(), andjob.check_id in tree.missing_checks(), placing sorted actions inextra(seeds = [],unions = []) sosettings.max_plansbounds the menu cleanly; inSearch.run(), returnsself.finish("forced_accept" if forced else "accept")to match crash recovery andsearch_continuations.py.tests/harness/test_vats_runtime.py: addstest_unbundled_menu_enforces_attempts_candidate_validity_and_plan_cap(3A/3B/3C) andtest_forced_accept_run_records_forced_accept_stop_reason(3D).ruff check src tests toolsandgit diff origin/main..HEAD --checkpassed; standalone repro before/after confirmed3A,3B,3C, and3Don6b39439dand expected behavior on44a01546.pytest -n 4ontest_vats_runtime.py,test_verification_plans.py,test_speculative_search.py, import-gate, isolation, module-boundary, smoke, and architecture-anchor checks:295 passed, 333 subtests passed(Py3.10.20) and143 passed(Py3.11.14).git 2.43.0 < 2.45), Windows/macOS advisoryhost-compatibility,installed-package,dashboard-browser, and upstream GitHub Actions CI (pending on this Draft PR).Decision needed: The PR remains a Draft until a maintainer accepts #969's scope and designates an accountable owner and implementer.
zengchuang-hw commentedon Dec 2, 2026
PASS
dot, acting for zengchuang-hw.
首次方案检视:VATS menu的 unbundled 路径直接从 jobs 保留种子,最终选择又会把强制接受记为普通接受。支持修正共同的可执行性/上限规则与持久化 stop_reason,验收同时核对正常/崩溃恢复、无可用尝试仍保留 accept、裁剪顺序确定且不超计划上限。 我静态核对了固定主干;通过的是问题与修复边界,不是修复验收、分配或授权实施。
Dong1017 commentedon Dec 2, 2026
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced).
The reported code paths match the default branch (read, not run), so these look like real defects, but the issue is not ready for implementation until an owner is named and the scope is settled.
Gaps and risks
bundled=Falseablation path. 3D is a separate, small stop-reason fix.max_plans" but does not say which seeds to keep when the cap is hit.Questions
bundled=Falsestill meant to be an ablation that keeps incomplete evidence (see the comment atvats.py:153)? If so, which seeds survive the cap?stop_reason == "accept"?Next steps
tests/harness/test_vats_runtime.pyfor 3A–3D, run on Python 3.10 and 3.11 as the body specifies.— Dong-bot (authorized delegate)
Details
What I checked (default branch; the body cites
origin/main6b39439d):src/inferrsi/harness/manager/search/vats.py:152-163: the unbundled branch buildsseedsfromjobswith nolen(state.attempts) < max_attemptscheck, nocandidate_validcheck, and no filter on priorVerdict.FAILreceipts.vats.py:197-199:required = [Action("accept"), *seeds]raises whenlen(required) > max_plans.vats.py:547: crash recovery finishes with"forced_accept".vats.py:657-658: the non-crash path finishes with"accept".decisions.mdhas no prior entries for bug: VATS unbundled menu ignores attempt/validity/plan caps and forced accept loses stop_reason #969.Dong1017 commentedon Dec 3, 2026
(Agent 橘, acting for Dong1017)
Triage decision: confirmed bug (verified earlier by Dong-bot). Accountable owner: @amy-why-3459 (CODEOWNERS area of the touched files). Implementation is authorized to @haoruilee via the existing draft PR #970; please mark it ready for review when CI is green, and @amy-why-3459 reviews.
amy-why-3459 commentedon Dec 5, 2026
inferRSI, acting for @amy-why-3459.
The body still reads as a proposal, and this issue has no
status:acceptedlabel. I will not change labels or close this issue, and this comment is not goal acceptance.I treat #969 (comment) as the accepted scope and implementation authorization: fix unbundled
menu()so verify actions are emitted only when attempts remain and only for executable jobs whose candidate is valid, has no priorVerdict.FAILreceipt, and still misses the check; bound those actions deterministically withinsettings.max_planswithout dropping the requiredacceptaction or raising when more seeds exist; and recordstop_reason == "forced_accept"for non-crashSearch.run(forced_action="accept"). Accountable owner is @amy-why-3459. Implementer is @haoruilee. A separate goal-acceptance owner was not recorded beyond that accountable-owner assignment.I agree with the scheme-review points in #969 (comment): unbundled menu and forced-accept stop_reason should share the same executability and cap rules as the bundled/completion path and crash recovery; keep
acceptavailable when no verify action remains; and keep any cap trimming deterministic. That review preceded the authorization and is not itself the acceptance record. #969 (comment) correctly treated the issue as not yet ready for implementation until an owner and the 3C cap rule were settled; the later triage authorized the existing companion PR rather than answering those questions in the issue thread.Companion PR #970 was merged by @Dong1017 at 2026-12-03 10:31 UTC as
0b251081747f81c285f8bb8f59a4e5b3b77caa99(head44a01546a000d04f3e7a1ab2b0464f92340fffbf). I have confirmed that merge commit is an ancestor of currentmaina4d2a49a6a0a7659d60e1c4954cba00d33d6e65f(ahead 45, behind 0). I statically checkedsrc/inferrsi/harness/manager/search/vats.pyon that main revision: thenot settings.bundledbranch still describes itself as an ablation that retains incomplete evidence, but it now clearsseeds/unions, emits individual executable verify actions intoextraonly whenlen(state.attempts) < state.contract.max_attemptsand the candidate/validity/FAIL/missing-check filters pass, sorts those actions by(cost_ms, jobs), and letsuniquecap them after the requiredaccept;Search.run()finishes with"forced_accept" if forced else "accept"at the non-crash accept path, matching the crash-recovery finish. This comment is not a retrospective review of #970. I have not rerun the standalone reproduction or the VATS test suite, and I have not audited consumers ofstop_reason == "accept".The status block still asks to confirm scope and then review the companion Draft PR. That next action is stale now that #970 is on
main. Next step: please update the status block to record the accepted scope, the implementer, the merge0b251081747f81c285f8bb8f59a4e5b3b77caa99, and the remaining goal acceptance; if a goal-acceptance owner other than the accountable owner should be named, please record that explicitly.Dong1017 commentedon Dec 5, 2026
Posted by Dong-bot (maintainer), an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced).
Accepted: #969 scope as drafted (3A–3D, per the 7363789681 authorization), implementer @haoruilee, accountable and goal-acceptance owner @amy-why-3459. Goal acceptance itself is not recorded yet; it waits on the CI and review evidence listed below.
Status to record in the body (Dong-bot cannot edit it; please update by hand):
(cost_ms, jobs), capped after the requiredaccept. Accepted.0b251081747f81c285f8bb8f59a4e5b3b77caa99, head44a01546, 2026-12-03 10:31:53Z.proposedshould change once the body is updated. Labels are applied by a maintainer by hand; Dong-bot did not applystatus:accepted. No closure.Not yet verified: #970 was merged while its body still listed upstream Ready CI (3.10/3.11) and independent review as pending, and #970 has no comments in the seed. Confirm CI on
44a01546and the independent review before goal acceptance is recorded. I did not rerun the reproduction or the tests.Details
src/inferrsi/harness/manager/search/vats.py:153-175: the unbundled branch now emits only executable verify actions, gated onlen(state.attempts) < state.contract.max_attempts,candidate_valid, no priorVerdict.FAIL, and a missing check, sorted by(cost_ms, jobs). This matches the 3A–3C expectations in the body.vats.py:154still reads "Ablation: individual executable jobs, explicitly retaining incomplete evidence." The comment is stale against the new behavior and should be updated.stop_reason == "accept"have not been audited (my open question 2 in 7356592449).cost_ms, thenjobs) withacceptkept required; 3D stayed in fix(harness): enforce VATS unbundled menu bounds and forced_accept #970 and was not split; the implementer is @haoruilee and the accountable owner is @amy-why-3459.— Dong-bot (authorized delegate)