Skip to content

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 into
microsoft:Developmentfrom
paullizer:claude/run-495-findings
Nov 30, 2026
Merged

Paul Lizer (paullizer) merged 9 commits into
microsoft:Developmentfrom
paullizer:claude/run-495-findings

Conversation

@paullizer

@paullizer Paul Lizer (paullizer) commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

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.

Version Commit Setting What it does
0.261.500 Fix the findings from the 0.261.495 run none Calculation dates (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.
0.261.501 Turn ledger enable_chat_orchestration_turn_ledger One record per turn of every model call, every finding a model was told, each attempt, each step outcome and each recovery, as codes and counts. The owner can read it at GET /api/v2/orchestration/turns/<turn_id>/ledger; one summary is logged per turn.
0.261.502 Sources by short names enable_chat_orchestration_sources_by_name 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.
0.261.503 One turn across attempts enable_chat_orchestration_one_turn (needs the reactive loop) A failed attempt the server goes on from says so on its last frame and saved run, 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.

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

  • The planner revising a plan after a failure (section 7.5, items 5 to 7).
  • A call budget for a whole turn.
  • Storing refused replies or the text of findings. The ledger holds codes, counts and digests only.

Testing

  • Full functional suite before the merge with Development: 2,019 of 2,028 Python test files pass. The 9 that do not are failures of the local environment (packages not installed there), not of this change.
  • After the merge and the move to these version numbers: the 51 test files this branch or the merges touched pass. Three workflow planner test files that Development changed to expect one planner call per allowed correction now expect two, because an unchanged reply ends the exchange under the correction rule, and the Cosmos boundary review reports 0 gaps.
  • JavaScript suite: 115 of 131 files pass, 16 are listed known failures, 0 fail.
  • New tests: 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.
  • Not yet run through a deployed application or seen in a browser.

🤖 Generated with Claude Code

… 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>
@paullizer Paul Lizer (paullizer) changed the title Orchestration: run 495 fixes, turn ledger, sources by name, one turn across attempts (0.261.499-502) Orchestration: run 495 fixes, turn ledger, sources by name, one turn across attempts (0.261.500-503) Nov 30, 2026
…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>
@paullizer
Paul Lizer (paullizer) merged commit bea87b4 into microsoft:Development Nov 30, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants