Skip to content

refactor(runtime): extract reset scopes and typed run phases - #271

Merged
lg2m merged 3 commits into
refactor/eng-1007-ac1-1-run-loop-modulefrom
refactor/eng-1007-ac1-state-and-steps
Oct 9, 2026
Merged

lg2m merged 3 commits into
refactor/eng-1007-ac1-1-run-loop-modulefrom
refactor/eng-1007-ac1-state-and-steps

Conversation

@lg2m

@lg2m lg2m commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

AC1.2 / AC1.3 — ENG-1007

Stack: main → #263 (AC1.1) → this PR. Spec: docs/plans/autonomous-core.md AC1.

Groups execution state by reset scope (RunScope, WindowScope, SliceScope, TurnScope) and adds typed TurnStep phases for preparation, compaction, provider streaming, settlement, candidate review, tools/checkpoints and result projection. Concrete borrowing streams keep pull-driven yields and drop-cancellation, with no producer tasks, event buffering or extra stream boxing. The outer driver is 143 lines. Zero test edits. No protocol, schema, prompt or AC2 lifetime changes.

Restack on main (2026-10-08)

Main changed execute under this stack, so those changes are ported into the new phases:

A line-set check confirms that every line main added to execute is present, apart from the TurnStep::Emit/run. wrapping.

The previous CI failure (wall_clock_budget_settles_a_hanging_provider_without_a_final_response, 0 vs 1 request) matches the known load flake recorded in the compaction and latest-models ledgers. It passed 4/4 locally.

Verification (stack top)

cargo fmt --all -- --check; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo test --workspace -- --test-threads=4: 2,218 passed, 0 failed; cargo build --workspace; git diff --check.

Performance — open item

The earlier 30-pair alternating A/B+A/A for context_assembly, tool_dispatch and turn_overhead (vs 88398d1) was run on a loaded host (IO pressure 21.85–67.18%). Context and turn tails could not be reproduced. The dispatch 20-iteration +41% did not reproduce at 10,000 iterations: A/B median +1.22%, A/A +2.48%. Host IO pressure was still ≈21% at restack, so quiet-host qualification has not been redone. No waiver is claimed; merging before qualification is a lead decision. Numbers are in docs/plans/progress/autonomous-core.md; raw evidence is in target/qq-perf/ac1-state-and-steps/qualification/.

@lg2m
lg2m added this pull request to stack #264 October 7, 2026 19:21
@lg2m
lg2m force-pushed the refactor/eng-1007-ac1-state-and-steps branch from 6c880ba to c4a0376 Compare October 9, 2026 22:43
@lg2m
lg2m marked this pull request as ready for review October 9, 2026 22:45
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@lg2m
lg2m merged commit 13d9c58 into main Oct 9, 2026
8 checks passed
@lg2m
lg2m deleted the refactor/eng-1007-ac1-state-and-steps branch October 9, 2026 23:47
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.

1 participant