Fold the genesis Decision link into Run state, not just the event - #732
Merged
Merged
Conversation
RunStarted.decided_by_decision_id was fully wired through start_run's command, decider, route, and MCP tool, but the evolver's genesis arm never destructured it, so it silently dropped on every run, on every replay, including the D6 fidelity tool's own refold. Verified by running evolve() directly before touching anything: the value went in and never came back out. Adds Run.started_by_decision_id (named started_by_, not decided_by_, because eight sibling Run events already use decided_by_decision_id for a different, per-transition sense; Run's own last_adjusted_by already sets the precedent for renaming on fold-scope change). Threaded through all 12 evolve() match arms, surfaced in record_fidelity_check's _render_run_state, and closes the test_2bm_energy_change scenario's own long-standing "linkage is not first-class" watch item by actually wiring and asserting it. Adds an AST fitness test that checks both failure shapes: a non-genesis arm dropping prior.<field>, and the genesis arm never setting a field at all (the shape this bug actually was, which the existing Procedure-evolver precedent's genesis exemption would not have caught). Verified by mutation: reintroducing the original bug fails the new test with a clear message. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||
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.
Summary
RunStarted.decided_by_decision_idwas fully wired end-to-end (command, decider, REST route, MCP tool) but the evolver's genesis arm never destructured it, so it silently dropped on every run, on every replay, including the D6 fidelity tool's own refold. Verified directly withevolve()before touching anything: the value went in and never came back out.Run.started_by_decision_id(deliberately notdecided_by_decision_id: eight sibling Run events already use that name for a different, per-transition sense;Run.last_adjusted_byalready sets the precedent inside this same aggregate for renaming a field when the folded scope changes).evolve()match arms; surfaced inrecord_fidelity_check's_render_run_state; closestest_2bm_energy_change's own long-standing "linkage is not first-class" watch item by actually wiring and asserting it.prior.<field>, and the genesis arm never setting the field at all (the shape this bug actually was — the existingtest_procedure_evolver_carry_forward.pyprecedent's genesis exemption would not have caught it).Test plan
None, survives every parametrized transition path (tests/unit/run/test_run_evolver.py)test_2bm_energy_change.pyintegration scenario updated to actually passdecided_by_decision_idand assert it survives onto the folded Runpyright,ruff check,ruff formatcleannaming-r3-reviewer) on both the original name and the rename, both passed🤖 Generated with Claude Code