Skip to content

fix: repair the #1331 merge — one generation of #1295, one engine, one bus - #1337

Merged
macanderson merged 1 commit into
mainfrom
claude/stella-main-ci-green-y1cc48
Aug 4, 2026
Merged

fix: repair the #1331 merge — one generation of #1295, one engine, one bus#1337
macanderson merged 1 commit into
mainfrom
claude/stella-main-ci-green-y1cc48

Conversation

@macanderson

@macanderson macanderson commented Aug 4, 2026

Copy link
Copy Markdown
Owner

What & why

main has not compiled since #1331. That branch merged main in and resolved three conflicts by keeping both sides, which left two crates unparseable, docker-serve red, and a shipped knob unreachable. Every fix below takes the side main already had.

#1295 had two generations, and both landed. #1328 shipped the refined design to mainjudge_evidence_demand, gated on a tracked command so the ask is only raised where it can be answered (#1211 §1). The #1331 branch still carried its own earlier draft, require_evidence_for_lone_judge_pass. The merge kept both config fields, both CLI knobs, and spliced both bodies into verify_candidate, leaving a revise_candidate( call unterminated. The older draft is removed — its const, field, CLI plumbing, and its two tests, whose four cases tests/judge_evidence_demand.rs already covers, plus the no-tracked-command case they never had.

That draft's TOML plumbing had displaced the shipped knob's, so pipeline_judge_evidence_demand parsed as an unknown key, never reached PipelineConfig, and was dropped by AgentEngineConfig::overlay — the same silently-lower-scope-wins bug the headless_scope_bypass comment describes. Renaming that plumbing restores it. This one is a silent behavior regression, not a compile error, so it would have survived a green build.

ServeConfig lost a field initializer. extensions (#1298) was spliced into the body of with_sub_agents (#1297), which then returned nothing.

run_session built two engines. One over &tools carrying the hook bus and calibration map (#1298); one over the delegating tool_view that makes sub-agents reachable (#1297), carrying neither. They are now one engine over tool_view with both attachments. The duplicated drive_turn after the goal-run match is gone, and the bus now reaches every round of a goal run and every sub-agent's tool executor — an operator policy that can refuse a tool call must not be escapable by delegating it.

Also: the SessionSpec literals in both serve suites carry the other side's fields; api_sources() counts the two files it gained; judge_evidence_demand is switched off in the OOM scenario the way its siblings already do; and routes.rs — 1521 lines once both sides' routes landed — moves /v1/sessions into a submodule, with the two now-obsolete size-baseline entries retired.

Refs #1331

The witness

  • No witness needed (merge repair / CI) — because the witness already exists on both sides and was not running: stella-pipeline and stella-serve did not compile, so cargo test, clippy, doc, fmt and the container build all failed before reaching an assertion. The restored suites are the proof, including tests/judge_evidence_demand.rs, which pins the surviving generation's four behaviours and never ran on main.

Verified that no shipped feature was dropped: every file added by #1330 is present and byte-identical to main, and the key symbols of #1290, #1291, #1293, #1294, #1295, #1297, #1298 and #1301 all resolve.

The gate

  • cargo fmt --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace — 108 binaries, 0 failures
  • Docs updated where behavior/flags changed (doc comments on the removed knob's references now name judge_evidence_demand)
  • CLA signed
  • Also run locally: check-file-size.sh, check-wire-schema.sh, RUSTDOCFLAGS="-D warnings" cargo doc, make cache-correctness, stella context validate

Refs, not Closes: this repairs a merge rather than finishing an issue.

Ground-rule check

  • No I/O added to stella-core; no new deps
  • No new outbound network calls

Anything reviewers should know?

The one judgement call is which generation of #1295 survives. Both compile in isolation, so this could not be settled by the build. The evidence: git log -S shows evidence_demand_is_worth_a_turn entered main with #1328 (9a509cc), and require_evidence_for_lone_judge_pass has no history on main at all — it existed only on the #1331 branch. The surviving generation is also the stricter one (bounded to one demand per candidate, and only raised when a tracked command could answer it) and is the one whose default is on. If that reading is wrong, the revert is contained to stella-pipeline/src/pipeline.rs and the CLI settings plumbing.

Second call: routes.rs needed to lose ~21 lines to clear the 1500-line ratchet. Splitting out its #[cfg(test)] mod tests would have cleared it by 33 lines; extracting the four /v1/sessions handlers instead leaves ~330 lines of headroom, which matters because both merge parents were actively adding routes to this file. The handlers are re-exported, so server.rs's dispatch is unchanged — the move is mechanical, with no logic edits.

The size baseline's obsolete entries were retired with make file-size-update, which also retightened several stale ceilings. I confirmed against both merge parents that those files genuinely are that size and no content was lost in the merge.


Generated by Claude Code

Summary by Sourcery

Repair post-#1331 merge regressions by removing the obsolete pipeline evidence knob generation, fixing serve/session engine wiring and configuration initialization, and splitting /v1/sessions routes into a dedicated module while keeping APIs and tests in sync.

Bug Fixes:

  • Restore ServeConfig extensions initialization and keep with_sub_agents returning a complete config
  • Ensure run_session builds a single engine over the delegating tool view and propagates the hook bus and calibration into goal runs and sub-agent executors
  • Fix CLI/TOML plumbing so the pipeline judge evidence demand knob is parsed correctly and reaches PipelineConfig
  • Disable judge evidence demand in the OOM verification-hardening scenario to match other OOM behaviours

Enhancements:

  • Extract /v1/sessions handlers and wire types from routes.rs into a sessions submodule, re-exporting handlers to keep call sites stable
  • Propagate the operator hook bus through goal runs so every round is fully observable
  • Align calibration reporting and inspection text with the judge evidence demand knob name

Build:

  • Update file-size baseline and add routes/sessions.rs to keep routes.rs under the configured line-count limit
  • Expand parity test API sources to include new serve routes and suites

Documentation:

  • Update inline documentation and comments to reflect the surviving judge evidence demand generation and new naming

Tests:

  • Adjust serve SessionSpec literals in goal and hooks tests to carry extensions and calibration consistently
  • Update pipeline judge evidence demand tests to explicitly disable coverage tooling

…e bus

`main` has not compiled since #1331. Its branch merged `main` in and resolved
three conflicts by keeping both sides, which left two crates unparseable and a
shipped knob unreachable. Each fix takes the side `main` already had.

**#1295 had two generations, and both landed.** #1328 shipped the refined
design to `main` — `judge_evidence_demand`, gated on a tracked command so the
ask is only raised where it can be answered (#1211 §1). The #1331 branch still
carried its own earlier draft, `require_evidence_for_lone_judge_pass`. The
merge kept both config fields, both CLI knobs, and spliced both bodies into
`verify_candidate`, leaving a `revise_candidate(` call unterminated. The older
draft is removed: its const, its field, its CLI plumbing, and the two tests
that exercised it — `tests/judge_evidence_demand.rs` covers all four of their
cases plus the no-tracked-command one they never had.

The draft's TOML plumbing had *displaced* the shipped knob's, so
`pipeline_judge_evidence_demand` parsed as an unknown key, never reached
`PipelineConfig`, and was dropped by `AgentEngineConfig::overlay` — the same
silently-lower-scope-wins bug the `headless_scope_bypass` comment describes.
Renaming that plumbing restores it.

**`ServeConfig` lost a field initializer.** `extensions` (#1298) was spliced
into the body of `with_sub_agents` (#1297), which then returned nothing.

**`run_session` built two engines.** One over `&tools` with the hook bus and
the calibration map (#1298), one over the delegating `tool_view` that makes
sub-agents reachable (#1297) — with neither attachment. They are now one
engine over `tool_view`, carrying both. The duplicated `drive_turn` that
followed the goal-run `match` is gone, and the bus reaches every round of a
goal run and every sub-agent's tool executor: an operator policy that can
refuse a tool call must not be escapable by delegating it.

Also: the `SessionSpec` literals in both serve suites carry the other side's
fields, `api_sources()` counts the two files it gained, `judge_evidence_demand`
is switched off in the OOM scenario the way its siblings already do it, and
`routes.rs` — 1521 lines once both sides' routes landed — moves `/v1/sessions`
into a submodule, with the two now-obsolete baseline entries retired.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C6NdL7mDUZZGk3FD44EgY8
@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
stella-cli-docs Ignored Ignored Aug 4, 2026 4:17am

@sourcery-ai

sourcery-ai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Merge repair that restores compilation and intended behaviour after #1331 by removing the earlier #1295 evidence knob implementation, wiring the shipped judge_evidence_demand knob correctly through CLI/TOML/pipeline, fixing ServeConfig initialization and session engine construction, ensuring the hook bus/calibration reach goal runs and sub-agents, and extracting the /v1/sessions handlers from routes.rs into a new submodule to satisfy file-size constraints.

Sequence diagram for goal runs and sub-agents sharing one engine and hook bus

sequenceDiagram
    actor Host
    participant routes_handle_session_turn
    participant Session
    participant run_session
    participant Engine
    participant HookBus
    participant drive_goal
    participant drive_turn
    participant RemoteToolExecutor

    Host->>routes_handle_session_turn: POST /v1/sessions/{id}/turns
    routes_handle_session_turn->>Session: Session::start(SessionSpec{extensions,sub_agents,calibration})
    Session->>run_session: run_session(spec,bus)

    run_session->>RemoteToolExecutor: RemoteToolExecutor::new(advertised,frame_tx,pending,spec.reverse_request_timeout,bus.clone)
    run_session->>Engine: Engine::with_sleeper(provider,tool_view,spec.config,sleeper)
    run_session->>Engine: Engine::with_gate(gate)
    run_session->>Engine: Engine::with_steering(steering)
    run_session->>Engine: Engine::with_bus(bus)
    run_session->>Engine: Engine::with_calibration(spec.calibration)

    alt spec.goal is Some
        run_session->>drive_goal: drive_goal(engine,spec.messages,run,spec.budget,event_tx,cancel,bus.as_ref)
        loop each_round
            drive_goal->>Engine: Engine::with_turn_instance(base_turn_offset)
            drive_goal->>drive_turn: drive_turn(round_engine,messages,budget,events,round_cancel,bus)
        end
    else no goal
        run_session->>drive_turn: drive_turn(engine,spec.messages,spec.budget,event_tx,cancel,bus.as_ref)
    end
Loading

Flow diagram for wiring the judge_evidence_demand knob from CLI/TOML into PipelineConfig

flowchart LR
    CLI[AgentEngineConfig.pipeline_judge_evidence_demand]
    TOML[AgentsSection.pipeline_judge_evidence_demand]
    Overlay[AgentEngineConfig::overlay]
    Pipeline[PipelineConfig.judge_evidence_demand]

    CLI --> Overlay
    TOML --> Overlay
    Overlay --> Pipeline
Loading

File-Level Changes

Change Details Files
Consolidate #1295 to the shipped judge_evidence_demand implementation and remove the older require_evidence_for_lone_judge_pass generation.
  • Delete the lone-judge evidence request constant and its pipeline config field/default.
  • Remove the CLI and settings plumbing, TOML fields, and helper accessors for the old knob.
  • Update calibration and ground-truth comments to reference judge_evidence_demand instead of the removed knob.
  • Drop the dedicated tests for require_evidence_for_lone_judge_pass, relying on the existing judge_evidence_demand suite.
stella-pipeline/src/pipeline.rs
stella-pipeline/src/pipeline/tests/verification_hardening.rs
stella-cli/src/settings.rs
stella-cli/src/settings/toml_config.rs
stella-cli/src/agent/engine.rs
stella-pipeline/src/replay.rs
stella-pipeline/src/replay/ground_truth.rs
stella-serve/src/goal.rs
stella-cli/src/inspect.rs
stella-cli/src/settings/unknown.rs
stella-pipeline/src/pipeline/tests/judge_evidence_demand.rs
Restore correct wiring for the pipeline_judge_evidence_demand knob through CLI settings and TOML so it reaches the pipeline config.
  • Rename the TOML and unknown-field entries to pipeline_judge_evidence_demand.
  • Ensure AgentsSection raise/lower functions and AgentEngineConfig overlay use the pipeline_judge_evidence_demand field.
  • Update comments and unknown-field whitelists to match the new field name.
stella-cli/src/settings.rs
stella-cli/src/settings/toml_config.rs
stella-cli/src/settings/unknown.rs
Fix ServeConfig initialization and run_session engine construction so extensions are preserved and a single engine over the delegating tool view carries gate, steering, hook bus, and calibration.
  • Restore the extensions field initialization in ServeConfig::default and make with_sub_agents return self without clobbering extensions.
  • Change run_session to build one Engine over tool_view instead of two different engines.
  • Attach the hook bus and calibration map to that single engine and pass the bus into drive_turn and drive_goal so hooks see all turns and goal rounds.
  • Update tests to set SessionSpec.extensions and calibration explicitly in relevant suites.
stella-serve/src/server.rs
stella-serve/src/session.rs
stella-serve/src/goal.rs
stella-serve/tests/goal_and_subagents.rs
stella-serve/tests/hooks.rs
Extract /v1/sessions route handlers and wire types from routes.rs into a new routes::sessions submodule to reduce file size while preserving API behaviour.
  • Create stella-serve/src/routes/sessions.rs containing the four session handlers and their request/response structs, reusing the parent module imports via use super::*.
  • Remove the duplicated handler and type definitions from routes.rs and add a mod sessions; plus pub(crate) use re-exports for all four handlers.
  • Update file-size baseline and parity tests to account for the new file and additional API source files.
stella-serve/src/routes.rs
stella-serve/src/routes/sessions.rs
scripts/file-size-baseline.txt
stella-parity/src/lib.rs
Tighten test configuration and wiring around OOM and judgment evidence demand scenarios.
  • Explicitly disable judge_evidence_demand in the persistent memory kill OOM scenario PipelineConfig used in verification_hardening tests.
  • Ensure judge_evidence_demand tests run with no coverage tooling to keep axes independent.
  • Update SessionSpec literals in serve tests to carry extensions/goal/sub_agents/calibration fields consistently.
stella-pipeline/src/pipeline/tests/verification_hardening.rs
stella-pipeline/src/pipeline/tests/judge_evidence_demand.rs
stella-serve/tests/goal_and_subagents.rs
stella-serve/tests/hooks.rs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@macanderson
macanderson marked this pull request as ready for review August 4, 2026 07:37

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @macanderson, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@macanderson
macanderson merged commit 30befff into main Aug 4, 2026
12 checks passed
@macanderson
macanderson deleted the claude/stella-main-ci-green-y1cc48 branch August 4, 2026 07:37
macanderson pushed a commit that referenced this pull request Aug 4, 2026
Brings in #1337's repair of the #1331 merge, which took
stella-serve/src/routes.rs from 1521 lines back to 1177 and restored the
file-size gate. The branch's own contribution is unchanged: one new file,
docs/design/backlog-2026-08.fleet.toml.
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