feat(core-loop): scheduler decision drives harness/weight/both branch (#90) - #161
Merged
Merged
Conversation
The adaptive scheduler (#65) + weight-update path (#19) were wired into run_generation_with only observationally (#84): the orchestrator recorded a per-generation scheduler_decision.json but always ran the meta/feedback harness update and never acted on the recommendation. Close the loop so the decision drives real control flow: - closed_loop: add ActedDecision { Harness, Weight, Both } + action_for_decision (defaults unknown/empty -> Harness) and record_acted_decision, which annotates scheduler_decision.json with acted / harness_ran / weight_ran / weight_update (read by web::runs / SIA Studio). Build on #139's StubWeightUpdater. - orchestrator: branch the per-generation action on the decision — harness -> run the meta/feedback harness update (today's behavior), weight -> run the weight update and SKIP the feedback step, both -> run both. The acted decision + weight outcome are recorded and threaded into the feedback context for the next generation (appended only when a decision exists, so build_feedback_context's parity-checked output is untouched). Backward-compat: when no decision is produced (no results.json -> the default in existing tests) the action defaults to harness and the feedback agent runs exactly as before. The injectable target/feedback seams are unchanged. Tests: offline integration tests drive run_generation_with with a forced weight vs harness decision (asserting feedback skipped/called and the acted decision recorded), plus closed_loop unit tests for the action mapping and record_acted_decision. Full gate green (fmt, clippy default+llm, test default+llm, parity byte-identical). https://claude.ai/code/session_01WX3ZN9azxr1fyWuZAaRJ7Y
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #90.
The scheduler decision was recorded-only; the loop always ran the harness update. Now
run_generation_withacts on it:src/closed_loop.rs:ActedDecision {Harness, Weight, Both}+action_for_decision(&str)+record_acted_decision(...)(annotatesscheduler_decision.jsonwith the acted decision + weight-update summary).src/orchestrator.rs: derive the acted decision from the recorded scheduler decision and branch:StubWeightUpdaterviamaybe_run_weight_update) and short-circuit the feedback step,The acted decision is written back to
scheduler_decision.json(SIA Studio reads it) and an**ADAPTIVE SCHEDULER DECISION**addendum is threaded into the next generation's feedback context.tests/generation_loop.rs; closed_loop unit tests.Backward-compat: with no scheduler decision (the default in existing tests, no
results.json), action defaults to harness, the feedback agent runs as before, and nothing is appended to the parity-checked feedback text — so the default path is byte-identical and existing assertions pass unmodified.Gate green: fmt/clippy/test (default +
--features llm) + parity OK.https://claude.ai/code/session_01WX3ZN9azxr1fyWuZAaRJ7Y
Generated by Claude Code