From b5a74b22722196b6cdfb129cfdb5e1faa4bed6b5 Mon Sep 17 00:00:00 2001 From: Mac Anderson Date: Thu, 6 Aug 2026 20:05:09 -0700 Subject: [PATCH 1/3] =?UTF-8?q?fix(stella-pipeline,stella-protocol,repo):?= =?UTF-8?q?=20unbreak=20main=20=E2=80=94=20seven=20breaks=20the=20#1964=20?= =?UTF-8?q?merge=20and=20its=20neighbours=20left?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `main` fails `fmt`, `clippy -D warnings` and the file-size ratchet at 6c345532. Four parallel sessions fixed the same red base at once (#1964, #1970, #1971 and this branch's earlier push); the merge that closed #1964 resolved every overlap by keeping BOTH sides, which produces code that compiles and lints red rather than a conflict anyone had to look at. Clippy (`-D warnings`), all merge artefacts: - `management_system_block` lists `ModelCallRole::Research` twice in one `|` chain — both sides appended it at different positions, so git took both. `unreachable_patterns`. One copy removed. - `scope_stage::plan_with_review` both hoists `let mut spend` before the loop AND builds an inline `Spend` per iteration. The hoisted binding is dead (`unused_variables` + `unused_mut`). The inline form is kept: it is the one the loop actually needs, and #1971's comment beside it says why. - `SHELL_TOOL`/`shell_call_result`/`PassingShell` exist in both `verification_hardening` and its `flip_halt_arming` child. The child's are the used ones, so the parent's three are `dead_code`. Deleted, and the `mod` doc now says where the doubles live. Formatting: `crates/stella-protocol/src/event/tests.rs` is missing the trailing newline `rustfmt` wants after `mod tag_table;` — unrelated to any of the above and failing `cargo fmt --check` on its own. File-size ratchet: `driver.rs` and `pipeline/tests.rs` each sit one line over a stale ceiling. Regenerated with `make file-size-update` rather than hand-edited, which is also why the diff mostly TIGHTENS: `pipeline.rs` drops 3451 -> 3181 and `bus.rs` 2126 -> 1891, both already true before this change and neither recorded. Verified on this tree, not inferred: `make guards-fast` (all 25 guards plus fmt), workspace clippy, workspace rustdoc, and `cargo test -p stella-pipeline`. Refs #1986 Refs #1972 --- crates/stella-cli/src/daemon/boot.rs | 3 +- .../src/management_prompt/tests.rs | 3 +- .../src/pipeline/scope_stage.rs | 1 - .../pipeline/tests/verification_hardening.rs | 52 +------------------ crates/stella-protocol/src/event/tests.rs | 2 +- scripts/file-size-baseline.txt | 8 +-- 6 files changed, 9 insertions(+), 60 deletions(-) diff --git a/crates/stella-cli/src/daemon/boot.rs b/crates/stella-cli/src/daemon/boot.rs index c13fc9ca..1b1201fc 100644 --- a/crates/stella-cli/src/daemon/boot.rs +++ b/crates/stella-cli/src/daemon/boot.rs @@ -57,8 +57,7 @@ //! retracts its resume point on the way out. A row written by a build that //! predates #1653 — where a policy stop really did store `Error` — is //! therefore filtered by [`crate::daemon::boot::SkipReason::NoResumePoint`] -//! anyway, without this -//! module having to trust its status. +//! anyway, without this module having to trust its status. //! - **The attempt bound still applies.** An `Error` that resumes into //! another `Error` is counted like any other continuation and retired //! after `MAX_BOOT_ATTEMPTS`. diff --git a/crates/stella-pipeline/src/management_prompt/tests.rs b/crates/stella-pipeline/src/management_prompt/tests.rs index 4af33f99..dc6513c7 100644 --- a/crates/stella-pipeline/src/management_prompt/tests.rs +++ b/crates/stella-pipeline/src/management_prompt/tests.rs @@ -94,8 +94,7 @@ fn management_system_block(role: ModelCallRole) -> Option { | ModelCallRole::SkillAuthor | ModelCallRole::DomainInference | ModelCallRole::Reflection - | ModelCallRole::Summarization - | ModelCallRole::Research => None, + | ModelCallRole::Summarization => None, } } diff --git a/crates/stella-pipeline/src/pipeline/scope_stage.rs b/crates/stella-pipeline/src/pipeline/scope_stage.rs index 77fc84ab..6e97ab9c 100644 --- a/crates/stella-pipeline/src/pipeline/scope_stage.rs +++ b/crates/stella-pipeline/src/pipeline/scope_stage.rs @@ -31,7 +31,6 @@ impl Pipeline<'_> { let repo_structure = self.repo.structure_summary().await; let mut revision: Option = None; let mut spent_revisions = 0usize; - let mut spend = Spend { budget, total }; loop { let plan = match self diff --git a/crates/stella-pipeline/src/pipeline/tests/verification_hardening.rs b/crates/stella-pipeline/src/pipeline/tests/verification_hardening.rs index aaf9990a..431f9836 100644 --- a/crates/stella-pipeline/src/pipeline/tests/verification_hardening.rs +++ b/crates/stella-pipeline/src/pipeline/tests/verification_hardening.rs @@ -7,59 +7,11 @@ use super::*; use crate::LineMutation; -/// The shell tool `flip_halt_arming` scripts its revision against. -/// -/// A distinct name from [`WRITING_TOOL`] because the two fakes answer -/// differently and a flip must be attributable: only this one emits the exit -/// marker [`crate::flip_halt::exit_status`] reads. -const SHELL_TOOL: &str = "bash"; - -/// One model turn that runs `command` through the shell tool. -/// -/// The `command` key is what [`crate::flip_halt::command_of`] looks for, so a -/// call built any other way would be invisible to the halt and the test would -/// pass for the wrong reason. -fn shell_call_result(command: &str) -> CompletionResult { - CompletionResult { - tool_calls: vec![ToolCall { - call_id: "call-shell".into(), - name: SHELL_TOOL.into(), - input: serde_json::json!({ "command": command }), - }], - ..text_result("") - } -} - -/// A shell whose every command succeeds, reported the way the real bash tool -/// reports it — the trailing `[exit code: 0]` marker. -/// -/// That marker is the whole point: [`crate::flip_halt::FlipHalt::observe`] -/// latches only on a tracked command that exited zero, and output without a -/// marker can never stop a turn. A fake returning bare prose would leave the -/// halt unlatched and the arming test green for no reason. -struct PassingShell; -#[async_trait] -impl ToolExecutor for PassingShell { - fn schemas(&self) -> Vec { - vec![ToolSchema { - name: SHELL_TOOL.into(), - description: "run a shell command".into(), - input_schema: serde_json::json!({ "type": "object" }), - read_only: false, - speculation_safe: false, - }] - } - async fn execute(&self, _name: &str, _input: &Value) -> ToolOutput { - ToolOutput::Ok { - content: "ok\n[exit code: 0]".into(), - } - } -} - /// The authored-witness arming of the mid-turn flip halt (#1793) — a child /// rather than a sibling module so it reaches the shared fakes through this /// file's own `use super::*`, and so the already-oversized `tests.rs` does -/// not grow another module declaration. +/// not grow another module declaration. The shell doubles the halt needs live +/// in that module, beside the only tests that script them. mod flip_halt_arming; /// #860 acceptance: a baseline that TIMES OUT observed no failing assertion, diff --git a/crates/stella-protocol/src/event/tests.rs b/crates/stella-protocol/src/event/tests.rs index 30d80d2d..72cfda5e 100644 --- a/crates/stella-protocol/src/event/tests.rs +++ b/crates/stella-protocol/src/event/tests.rs @@ -1486,4 +1486,4 @@ fn a_known_event_wire_format_is_unchanged_by_the_fallback() { assert!(matches!(back, AgentEvent::Text { text } if text == "hello")); } -mod tag_table; \ No newline at end of file +mod tag_table; diff --git a/scripts/file-size-baseline.txt b/scripts/file-size-baseline.txt index 960881fe..dcf81315 100644 --- a/scripts/file-size-baseline.txt +++ b/scripts/file-size-baseline.txt @@ -19,15 +19,15 @@ 1752 crates/stella-cli/src/agent/tests.rs 4621 crates/stella-cli/src/command_deck.rs 1507 crates/stella-cli/src/fleet_cmd.rs -2126 crates/stella-core/src/bus.rs -2571 crates/stella-core/src/driver.rs +1891 crates/stella-core/src/bus.rs +2572 crates/stella-core/src/driver.rs 3681 crates/stella-core/src/driver/tests.rs 1781 crates/stella-model/src/anthropic/tests.rs 2093 crates/stella-model/src/openai.rs 1565 crates/stella-model/src/zai.rs 1895 crates/stella-model/src/zai/tests.rs -3451 crates/stella-pipeline/src/pipeline.rs -2536 crates/stella-pipeline/src/pipeline/tests.rs +3181 crates/stella-pipeline/src/pipeline.rs +2537 crates/stella-pipeline/src/pipeline/tests.rs 1996 crates/stella-store/src/lib.rs 2266 crates/stella-store/src/tests.rs 1916 crates/stella-store/src/usage.rs From 84e46a8b9817c548a6ed94b92ecfbdc3c6db7cd3 Mon Sep 17 00:00:00 2001 From: Mac Anderson Date: Thu, 6 Aug 2026 20:29:14 -0700 Subject: [PATCH 2/3] fix(stella-protocol): resolve the CompactionRewrite intra-doc link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An eighth break on the same red base, and one the previous commit's workspace rustdoc run could not see: `cargo doc` stops at the first crate that fails, and `stella-protocol` sits under everything, so this only surfaced once the `stella-cli` link above it was resolved — the layered masking that has now bitten this repo three times in a row. `StepUsage`'s doc links a bare [`CompactionRewrite`], which is re-exported at the crate root but never imported into `event`'s scope; the very next line already spells the field's type `crate::CompactionRewrite`. The link now uses the same path the field does. Refs #1986 --- crates/stella-protocol/src/event.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/stella-protocol/src/event.rs b/crates/stella-protocol/src/event.rs index 13deb1aa..d91b0bda 100644 --- a/crates/stella-protocol/src/event.rs +++ b/crates/stella-protocol/src/event.rs @@ -542,7 +542,7 @@ pub enum AgentEvent { /// The replacement bytes each in-place rewrite left behind, one entry /// per digest — what lets reconstruction resolve a compacted block to /// the bytes the model received rather than the pre-compaction output - /// under the same `call_id` (#1667); see [`CompactionRewrite`]. + /// under the same `call_id` (#1667); see [`crate::CompactionRewrite`]. /// `serde(default)` — absent on journals written before rewrites were /// journaled, whose compacted blocks surface as digest mismatches. #[serde(default, skip_serializing_if = "Vec::is_empty")] From 3ccb5b1539a7f1fe2aad1fe8407ee6fa5e28ef61 Mon Sep 17 00:00:00 2001 From: Mac Anderson Date: Thu, 6 Aug 2026 20:35:34 -0700 Subject: [PATCH 3/3] fix(stella-protocol): name CompactionRewrite in prose and regenerate docs/wire MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `StepUsage::rewrites`' doc comment is not only rustdoc — `docs/wire/` is generated from these types and the comment ships as the field's `description` in `agentevent.schema.json`, `serveframe.schema.json` and both `.d.ts` files. So the previous commit's `crate::CompactionRewrite` fixed the rustdoc link by writing Rust-internal pathing into a language-agnostic contract a TypeScript consumer reads, and left the committed schema stale, which `wire-schema` caught. Plain backticks instead: no link for rustdoc to resolve, and a description that still names the type for every consumer. A JSON Schema reader loses nothing — the field's `items` already carries `"$ref": "#/$defs/CompactionRewrite"` on the next line. `docs/wire/` regenerated with `make wire-schema-update`; the diff is the four description lines and nothing else. Refs #1986 --- crates/stella-protocol/src/event.rs | 2 +- docs/wire/agentevent.d.ts | 2 +- docs/wire/agentevent.schema.json | 2 +- docs/wire/serveframe.d.ts | 2 +- docs/wire/serveframe.schema.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/stella-protocol/src/event.rs b/crates/stella-protocol/src/event.rs index d91b0bda..b9eaef05 100644 --- a/crates/stella-protocol/src/event.rs +++ b/crates/stella-protocol/src/event.rs @@ -542,7 +542,7 @@ pub enum AgentEvent { /// The replacement bytes each in-place rewrite left behind, one entry /// per digest — what lets reconstruction resolve a compacted block to /// the bytes the model received rather than the pre-compaction output - /// under the same `call_id` (#1667); see [`crate::CompactionRewrite`]. + /// under the same `call_id` (#1667); see `CompactionRewrite`. /// `serde(default)` — absent on journals written before rewrites were /// journaled, whose compacted blocks surface as digest mismatches. #[serde(default, skip_serializing_if = "Vec::is_empty")] diff --git a/docs/wire/agentevent.d.ts b/docs/wire/agentevent.d.ts index 15318784..bca2ac82 100644 --- a/docs/wire/agentevent.d.ts +++ b/docs/wire/agentevent.d.ts @@ -1285,7 +1285,7 @@ export type AgentEvent = { * The replacement bytes each in-place rewrite left behind, one entry * per digest — what lets reconstruction resolve a compacted block to * the bytes the model received rather than the pre-compaction output - * under the same `call_id` (#1667); see [`CompactionRewrite`]. + * under the same `call_id` (#1667); see `CompactionRewrite`. * `serde(default)` — absent on journals written before rewrites were * journaled, whose compacted blocks surface as digest mismatches. */ diff --git a/docs/wire/agentevent.schema.json b/docs/wire/agentevent.schema.json index 4d5544a4..f4dbd2f1 100644 --- a/docs/wire/agentevent.schema.json +++ b/docs/wire/agentevent.schema.json @@ -2152,7 +2152,7 @@ "type": "array" }, "rewrites": { - "description": "The replacement bytes each in-place rewrite left behind, one entry\nper digest — what lets reconstruction resolve a compacted block to\nthe bytes the model received rather than the pre-compaction output\nunder the same `call_id` (#1667); see [`CompactionRewrite`].\n`serde(default)` — absent on journals written before rewrites were\njournaled, whose compacted blocks surface as digest mismatches.", + "description": "The replacement bytes each in-place rewrite left behind, one entry\nper digest — what lets reconstruction resolve a compacted block to\nthe bytes the model received rather than the pre-compaction output\nunder the same `call_id` (#1667); see `CompactionRewrite`.\n`serde(default)` — absent on journals written before rewrites were\njournaled, whose compacted blocks surface as digest mismatches.", "items": { "$ref": "#/$defs/CompactionRewrite" }, diff --git a/docs/wire/serveframe.d.ts b/docs/wire/serveframe.d.ts index e85a0cde..3de9a86f 100644 --- a/docs/wire/serveframe.d.ts +++ b/docs/wire/serveframe.d.ts @@ -217,7 +217,7 @@ export type AgentEvent = { * The replacement bytes each in-place rewrite left behind, one entry * per digest — what lets reconstruction resolve a compacted block to * the bytes the model received rather than the pre-compaction output - * under the same `call_id` (#1667); see [`CompactionRewrite`]. + * under the same `call_id` (#1667); see `CompactionRewrite`. * `serde(default)` — absent on journals written before rewrites were * journaled, whose compacted blocks surface as digest mismatches. */ diff --git a/docs/wire/serveframe.schema.json b/docs/wire/serveframe.schema.json index f8dd7198..ed0003ad 100644 --- a/docs/wire/serveframe.schema.json +++ b/docs/wire/serveframe.schema.json @@ -453,7 +453,7 @@ "type": "array" }, "rewrites": { - "description": "The replacement bytes each in-place rewrite left behind, one entry\nper digest — what lets reconstruction resolve a compacted block to\nthe bytes the model received rather than the pre-compaction output\nunder the same `call_id` (#1667); see [`CompactionRewrite`].\n`serde(default)` — absent on journals written before rewrites were\njournaled, whose compacted blocks surface as digest mismatches.", + "description": "The replacement bytes each in-place rewrite left behind, one entry\nper digest — what lets reconstruction resolve a compacted block to\nthe bytes the model received rather than the pre-compaction output\nunder the same `call_id` (#1667); see `CompactionRewrite`.\n`serde(default)` — absent on journals written before rewrites were\njournaled, whose compacted blocks surface as digest mismatches.", "items": { "$ref": "#/$defs/CompactionRewrite" },