Repository navigation
Orchestration: run 495 fixes, turn ledger, sources by name, one turn across attempts (0.261.500-503) - #1992
Merged
Paul Lizer (paullizer) merged 9 commits intoNov 30, 2026
Conversation
… rule Calculation dates, partial answers and the other failures read from the run's logs, and one rule for asking a model to correct a finding: a finding is told once, a repeat ends the exchange, and the reply budget grows only when the reply was cut short. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… a turn Behind enable_chat_orchestration_turn_ledger (off by default). The resolver, planner, calculation author and answer check record their calls and the findings they were told through one Exchange; attempts, step outcomes and recoveries are entered as codes and counts. The owner can read a turn's ledger, and one summary is logged per turn. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Behind enable_chat_orchestration_sources_by_name (off by default). The resolver, planner and calculation author see doc:1, doc:2 in place of document IDs; the server maps them both ways. A selected source a plan leaves unread is told to the planner once, then stated on the plan and after the answer instead of refusing the plan. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Behind enable_chat_orchestration_one_turn (off by default; needs the reactive loop). The failed attempt's last frame and saved run say the turn continues, its message is marked as replaced when the next attempt is admitted, every reader honours the mark, and the V2 page holds the failure and follows the next attempt. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Development took 0.261.498. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
| # A turn opened again continues the same record. | ||
| resumed = TurnLedger.open(CONVERSATION, USER, TURN, container=store) | ||
| assert resumed.entries() == ledger.entries() | ||
| assert resumed.append("attempt", "server", "ended", run_id="run-1", outcome="completed")["seq"] == 3 |
| assert ledger.summary()["ledger_saved"] is True | ||
|
|
||
| # An entry outside the vocabulary is logged and left out. Nothing is raised. | ||
| assert ledger.append("plan", "planner", "note") is None |
| broken = container() | ||
| broken.read_item = unavailable | ||
| in_memory = TurnLedger.open(CONVERSATION, USER, TURN, container=broken) | ||
| assert in_memory.append("plan", "planner", "call")["seq"] == 1 and broken.items == {} |
| assert in_memory.append("plan", "planner", "call")["seq"] == 1 and broken.items == {} | ||
| assert in_memory.saved is False | ||
| # A ledger with no turn at all records in memory too. | ||
| assert TurnLedger().append("plan", "planner", "call")["seq"] == 1 |
| store = container() | ||
| ledger = TurnLedger.open(CONVERSATION, USER, TURN, container=store) | ||
| for _call in range(3): | ||
| assert ledger.append("plan", "planner", "call") is not None |
| unreadable = container() | ||
| unreadable.read_item = malformed | ||
| fallback = open_turn_ledger(on, unreadable, CONVERSATION, USER, TURN) | ||
| assert fallback.saved is False and fallback.append("plan", "planner", "call")["seq"] == 1 |
| }) | ||
| assert route._last_started_attempt(runs["a"], "owner", "conversation-1")["id"] in ("a", "b") | ||
| # The row follows only while the setting is on. | ||
| source = open(route.__file__, encoding="utf-8").read() |
| ledger = TurnLedger() | ||
| try: | ||
| holder.turn_ledger = ledger | ||
| except (AttributeError, TypeError): |
|
|
||
| from test_orchestration_document_planning_recovery import planning, proposal, run_plan # noqa: E402 | ||
| from test_orchestration_harness_routes import modules, real_http_harness # noqa: E402 | ||
| from test_orchestration_source_kind_planning import LEFT, RIGHT, source_runtime # noqa: E402 |
|
|
||
| sys.path.insert(0, str(APP_ROOT)) | ||
|
|
||
| import functions_orchestration_turn_ledger as ledger_module # noqa: E402 |
Development took 0.261.499. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Three workflow planner test files expected one planner call per allowed correction for an unchanged reply. With the correction rule an unchanged reply ends the exchange at its second call, so they now expect two. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…turn files Tests no longer call TurnLedger.append or TurnLedger.open inside an assert, the ledger module is imported one way, an unused import is removed, a file is closed after reading, and the one empty except says why it is empty. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Paul Lizer (paullizer)
merged commit Nov 30, 2026
bea87b4
into
microsoft:Development
24 of 25 checks passed
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
Four changes to the orchestration harness, one commit each, versions 0.261.500 to 0.261.503. The three new behaviours are each behind their own admin setting and are off by default.
date_diff,date_add, date measures), partial answers, and one shared correction rule: a finding is told to a model once, a repeat ends the exchange, and the reply budget grows only when a reply was cut at its limit.enable_chat_orchestration_turn_ledgerGET /api/v2/orchestration/turns/<turn_id>/ledger; one summary is logged per turn.enable_chat_orchestration_sources_by_namedoc:1,doc:2in place of document IDs; the server maps them both ways. A selected source a plan leaves unread is told to the planner once, then stated on the plan and after the answer instead of refusing the plan.enable_chat_orchestration_one_turn(needs the reactive loop)The design and an "as built" table for each are in section 7 of
docs/explanation/features/ORCHESTRATION_REACTIVE_LOOP_PROPOSAL.md. Feature documents:ORCHESTRATION_TURN_LEDGER.md,ORCHESTRATION_SOURCES_BY_NAME.md,ORCHESTRATION_ONE_TURN.md. Fix document:CALCULATION_DATES_AND_RUN_495_FINDINGS_FIX.md.Not in this change
Testing
test_orchestration_correction_rule.py,test_orchestration_turn_ledger.py,test_orchestration_turn_ledger_recording.py,test_orchestration_source_names.py,test_orchestration_sources_by_name.py,test_orchestration_one_turn.py,test_v2_orchestration_one_turn.mjs.🤖 Generated with Claude Code