fix(benchmarks): stop inverting --web/--no-web in the public runner - #29
Conversation
run_eval passed the parsed open-book flag straight into resolve_closed_book(), whose override parameter is the closed-book decision and is returned verbatim. Both CLI flags therefore did the opposite of their help text, and REACT_NO_WEB/SWARM_NO_WEB reached every worker inverted, so a run scored under the book policy nobody asked for. Negate at the call site rather than in resolve_closed_book(): that function is polarity-correct on its own, and flipping it would invert the benchmark-default path, which is currently unaffected. The translation now lives in _closed_book_for() so the polarity is pinnable by a test; it was previously buried mid-way through a long async function with no seam. Closes ApodexAI#26
There was a problem hiding this comment.
Thanks for the fix—the polarity change is correct and addresses #26.
I think _closed_book_for() is unnecessary abstraction for a bug that occurs at this single call site. Could we keep the fix inline in run_eval()?
web = getattr(args, "web", None)
closed = resolve_closed_book(
args.benchmark,
None if web is None else not web,
)We should still retain regression coverage. The test can call run_eval() with resolve_closed_book() monkeypatched as a spy, assert that it receives False, True, and None for --web, --no-web, and no override respectively, then raise a sentinel exception to stop before task execution. That would cover the original faulty handoff without introducing a helper solely as a test seam.
Drop _closed_book_for(): the negation has one call site, and a helper introduced purely as a test seam is not worth the indirection. The regression is now pinned where the bug lived. The test calls run_eval() with resolve_closed_book() monkeypatched as a spy that records the override it receives and raises a sentinel to stop before task execution, asserting False/True/None for --web, --no-web and no flag. That covers the faulty handoff itself rather than a helper wrapping it.
|
@dq-ai-dev
Validation:
|
|
Hi @dq-ai-dev! I’ve been exploring the FrontierAgent repo and I’m genuinely impressed by the quality and depth of the work here. The architecture, benchmarking setup, and overall engineering approach are really inspiring, and I’d love to contribute more actively to the project. I’m currently looking for ways to contribute beyond individual PRs and would love to learn more from the community. Is there a Slack, Discord, or any other channel where contributors and the team coordinate and discuss ongoing work? I’d be really glad to get involved and contribute wherever I can. Thanks! |
run_eval passed the parsed open-book flag straight into resolve_closed_book(), whose override parameter is the closed-book decision and is returned verbatim. Both CLI flags therefore did the opposite of their help text, and REACT_NO_WEB/SWARM_NO_WEB reached every worker inverted, so a run scored under the book policy nobody asked for.
Negate at the call site rather than in resolve_closed_book(): that function is polarity-correct on its own, and flipping it would invert the benchmark-default path, which is currently unaffected.
The translation now lives in _closed_book_for() so the polarity is pinnable by a test; it was previously buried mid-way through a long async function with no seam.
Closes #26