Repository navigation
Conversation
|
[P2] Restrict the test-file exemption to an actual file-level attribute (1ac909c) In core/source-hygiene/src/layer_discipline.rs the new lines().any(trim_start().starts_with("#![cfg(test)]")) returns no violations for the entire file whenever any nested module contains this inner attribute. For example a production inference file with Recognize only the source file's leading inner-attribute region (with comments handled), or use a shared parser that proves file scope. Add fixtures for a genuine file-level test module and for a production import plus nested test-only module; the latter must still report the production violation. No build run on a serving node. Full inference split review remains pending; this is not an approval of the PR. |
|
Completed the owned inference slice source review at 1ac909c: airc_remote/transport, handle_module and llamacpp_adapter. Compared old parent versus new parent plus children with a whitespace-normalized line multiset, excluding module/import/doc scaffolding and normalizing pub(super). Transport: 12 tests before/after, no body-line difference. Handle module:16/16, no body-line difference. Llama adapter:13/13; only additions are two explicit tracing targets preserving the original module target. Payload construction boundaries and parent imports inspected. This supports source-level equivalence for these three cuts; it is not compilation or runtime proof and does not cover the other directories. The layer_discipline exemption finding above remains unresolved at this head, so this is not whole-PR approval. CI was not reported when checked; no build run on a serving node. |
…t column zero production_half stopped at the first #[cfg(test)] anywhere, so an indented test-only helper inside an impl ended "production" for the rest of the file. In cognition/llm_deliberation_faculty.rs that hid ~9,000 production lines from every ratchet except derived_bounds, which already cut at column zero for this reason (it carried its own copy of the split). Found 2026-10-20 when deleting one such helper surfaced 4 hidden unwraps. One split for every rule, at column zero; derived_bounds' private copy is deleted. Baselines re-measured to what was always there (not new debt): unwraps 2,119 -> 2,274, serialization 234 -> 245, spawn sites 123 -> 128, hand-built homes 72 -> 79. source-hygiene 39/39. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
A cut that keeps the start of text drops what happened last (the newest message, result, outcome), so she acts as if time never moved and loops (Joel, 2026-10-20); and one source shrinking itself by its own number breaks the budget for everything else. The rule counts, on prompt paths (cognition, persona, rag, modules, airc, positron): head keepers (chars().take, head_to_tokens, truncate_chars, lines().next()), literal take/truncate/[..N], and literal .min/.clamp ceilings beside a size word (plain arithmetic such as backoff exponents is not flagged). A cut that never reaches a prompt says `head-cut-ok: <why>`. Measured 179 on this branch; the count may only fall. source-hygiene 41/41. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…cannot move it A per-file count read +7 on #5224, which only moves test modules into sibling files: the same `use crate::modules::x` counted once per file it now sits in. A line is the coupling site; a pure move leaves it unchanged. The baseline is re-measured under the new unit in the next commit, from this tree's CI run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…e per-line unit CI on canary a854548 + this branch: boundary serialization 246, spawn sites 127, unjustified unwraps 2,279 (the split now sees production code that an indented #[cfg(test)] helper hid), upward imports 674 lines across 73 pairs (the unit changed from files to lines). No code changed between the two counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
1ac909c to
598740c
Compare
…st of the file The cut stopped at the first column-zero #[cfg(test)], which is the end of production only when the test mod is the file's last item. It is not in many files: ipc/mod.rs has ~3,400 production lines (start_server) after its test mod; commands/benchmark.rs has production between three test mods; persona_tools.rs and positron_source.rs gate a helper fn near the top. Found on #5225, where llamacpp_adapter.rs declared 'mod tests;' at line 93 of 934 and the split read as 10 unwraps removed when none were. The gated item's extent is read as one character stream (string escapes and continuations, raw strings, char literals vs lifetimes, comments), because test fixtures carry braces in multi-line strings. Audited on canary: of 1,249 gates, 1,248 close where rustfmt closes them; the one other is a #[cfg(test)] inside the generator's raw-string template, where the new cut keeps more real code. Regression test: only_the_gated_item_is_test_code_never_the_rest_of_the_file. Baselines re-measured on canary a854548 + this change (no code changed): unwraps 2,279 -> 2,377, homes 79 -> 103, spawns 127 -> 132, head cuts 179 -> 188, serialization 246 -> 251, underived bounds 159 -> 164, unwired 60 -> 61. Each is code that was always production and was never scanned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
New rule (Joel, 2026-10-20): no one edits a file over 1,000 lines. 76 of the 145 Rust files over 1,000 lines were over only because their inline #[cfg(test)] mod tests sat inside them. This moves that module, byte for byte (no re-indent, so string literals are untouched), to `<stem>/tests.rs`; the parent keeps `#[cfg(test)] mod tests;`. A child module keeps `use super::*` access, so nothing else changes. Moved: 69 files (66 continuum-core, 3 continuum-cli-lifecycle). Skipped: 11 being split on other branches, crate roots (main/lib/mod/bin), and 1 file with items after its test mod. One include_str! path is one level deeper (prebuilt_artifact tests). Verified: #[test]/#[tokio::test] attributes 8,320 before and after; continuum-core lib tests compile; continuum-cli-lifecycle 79 pass with the same 1 failure canary has (card 250ce9c8). Still over 1,000 after this and left to the split work: modules/forge.rs (1,003), and the tests files of cognition/recall_faculty (1,245) and commands/training_trigger/submit (1,332). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Without the inner attribute the hygiene scanner read the 69 moved tests.rs files as production (the file_engine split showed unwraps rising 150). The repo's existing convention for a test module in its own file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…, owned by its module Two source-reading guards failed on #5224 because a test module moved into a sibling tests.rs read as production: experience/tests.rs became a second caller of record_lived_turn, service_module/tests.rs a registration of PersonaServiceModule. Each guard carried its own copy of the walk and the comment strip, so each would have needed its own fix. source_tree (cfg(test)) is the one reader: crate_sources(), and per file is_test_file(), production() and owner() (x/tests.rs belongs to x.rs). Migrated: the module-wiring audit (keys references by owner), the lived-turn caller count (production only), the loose-id scan, the GPU base check and the context-constant scan. Five private walks deleted. The swe env-root guard keeps its copy until the sweep splits swe_bench.rs (5,946 lines; no edits over 1,000). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…sures lib.rs declaring two cfg(test) modules counted as a second test mod (19 -> 20), so the source reader nests under test_env, the crate's test environment. CI on this branch: lines past the readable size 154,999 -> 136,485, unwired public machinery 60 -> 58. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… test Retracts the previous commit's reason for 60 -> 58. That drop was a miscount, not a win: the rule reads a type as wired when its name appears outside its own file, test code included, so moving a test module into a sibling tests.rs made two types constructed only in their own tests read as externally used, the exact AgentContext (#27) shape this rule exists to catch. SourceFile::owning_module() names the module a file's code belongs to (x for x.rs, x/mod.rs, and a #![cfg(test)] x/tests.rs or x/tests/part_N.rs); the rule's own-mentions now include the moved tests of the same module. Baseline back to 60; regression test a_type_constructed_only_in_its_moved_tests_is_still_reported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…4 -> 934) Pure move. construction.rs: inherent builders + ensure_loaded (+Default); payload.rs: sampling/media decode; tests.rs: tests mod. Tests 12 passed/1 ignored before and after. Two tracing::warn! gain an explicit target so log targets are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Pure move. sanitize.rs: think-block/leaked-markup stripping; tests.rs: tests mod. Tests 19 passed before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Pure move. progress.rs: watch cell/ledger/bus milestones; status.rs: genome/teach-status; tests.rs. Public paths kept via re-exports. Tests 15 passed before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Pure move. tools.rs: tool-call parsing and tool implementations. Tests 5 passed before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Pure move of the tests mod. Tests 44 passed before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Pure move of the tests mod. Tests 12 passed before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Pure move of the tests mod. Tests 23 passed before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Pure move of the tests mod. Tests 15 passed before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…d on this head) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
598740c to
b3ddc45
Compare
… zero new warnings The splitter gave every child a 'pub use child::*' in its parent. Where the child's items are crate- or module-scoped that re-export was too wide (56 'glob import doesn't reexport' warnings) or reached nothing (51 unused). Each glob now carries the visibility its items have (pub(crate), the module's own pub(in ...), or private), and the ones nothing resolves through are removed, compiler-checked after each pass. run_harness/Harness are crate-scoped (their only caller is grade.rs) instead of widening a chain of private types. Built on the M5 in a build window (serving down), cargo test --lib --no-run with --features metal,accelerate: 0 warnings that the base (#5225 head) does not have; 63 total vs the base's 72 (9 old unused imports went with them). The CI baseline is set to 66 on the inference that CI's Linux build carries the same 3 cfg-only warnings it did at the base (75 vs 72); CI prints the exact number. cargo test -p continuum-core --lib (metal, M5): 9,002 passed, 2 failed: - the lived-turn guard named settle.rs; the driver now sits in settle/, so the guard accepts the settle module (fixed here, passes). - config_env read_all_on_a_missing_file: a stale temp file from an earlier run on this machine (card 4c820b46); passes on fresh CI runners. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Scoped source PASS at b3ddc45 for the newly moved inference/handle_module and inference/airc_remote/transport tests. Compared original inline test bodies immediately before d9f0f8d and 8c63901 against current child files: exact match after four-space module dedentation and removing child cfg marker. Both parent cfg(test) module declarations and child #![cfg(test)] markers remain; module paths are unchanged. Counted16/12 ordinary test annotations in these files. Production portions of those commits are untouched. Current reported CI is green; no local build run. This is only the two-file extraction slice, not approval of inherited hygiene/other owners' work. |
Applies the source-approved replacement from #5227 comment 6304136412 (Astra independent review) against bcbab21, unchanged: - a #[cfg(test)] item that starts on the attribute's own line is blanked, with source line numbers preserved; - item termination stays correct for static initializers and method continuations; - one nested block-comment scanner is shared (duplicate removed); - pub(in ...) and other restricted const visibilities are recognized by derived_bounds. Measured on this tree: cargo test -p source-hygiene, 42 passed. Every ratchet sits exactly at its existing baseline, so no baseline was edited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…lit-eight-near-limit-files
|
Superseded for landing by #5228, which contains this PR's commits in full (merged down, not rebased) and passes the new oversized-edits gate. On its own, this PR now fails that gate: it creates or edits files over 1,000 lines that only #5228 splits (recall_faculty/tests.rs 1,245, training_trigger/submit/tests.rs 1,332, forge.rs 1,002). Landing order: #5227, then #5228. Converted to draft, not closed, so the scoped reviews stay readable. |
…ts ratchet (#5227) * Every ratchet scans the production code that exists: the split cuts at column zero production_half stopped at the first #[cfg(test)] anywhere, so an indented test-only helper inside an impl ended "production" for the rest of the file. In cognition/llm_deliberation_faculty.rs that hid ~9,000 production lines from every ratchet except derived_bounds, which already cut at column zero for this reason (it carried its own copy of the split). Found 2026-10-20 when deleting one such helper surfaced 4 hidden unwraps. One split for every rule, at column zero; derived_bounds' private copy is deleted. Baselines re-measured to what was always there (not new debt): unwraps 2,119 -> 2,274, serialization 234 -> 245, spawn sites 123 -> 128, hand-built homes 72 -> 79. source-hygiene 39/39. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * head_cuts: a ratchet on text cuts that drop the newest end of her prompt A cut that keeps the start of text drops what happened last (the newest message, result, outcome), so she acts as if time never moved and loops (Joel, 2026-10-20); and one source shrinking itself by its own number breaks the budget for everything else. The rule counts, on prompt paths (cognition, persona, rag, modules, airc, positron): head keepers (chars().take, head_to_tokens, truncate_chars, lines().next()), literal take/truncate/[..N], and literal .min/.clamp ceilings beside a size word (plain arithmetic such as backoff exponents is not flagged). A cut that never reaches a prompt says `head-cut-ok: <why>`. Measured 179 on this branch; the count may only fall. source-hygiene 41/41. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * layer_discipline counts coupling sites per line, so a split by owner cannot move it A per-file count read +7 on #5224, which only moves test modules into sibling files: the same `use crate::modules::x` counted once per file it now sits in. A line is the coupling site; a pure move leaves it unchanged. The baseline is re-measured under the new unit in the next commit, from this tree's CI run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Ratchet baselines measured on canary for the column-zero split and the per-line unit CI on canary a854548 + this branch: boundary serialization 246, spawn sites 127, unjustified unwraps 2,279 (the split now sees production code that an indented #[cfg(test)] helper hid), upward imports 674 lines across 73 pairs (the unit changed from files to lines). No code changed between the two counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * production_half blanks only the #[cfg(test)]-gated item, never the rest of the file The cut stopped at the first column-zero #[cfg(test)], which is the end of production only when the test mod is the file's last item. It is not in many files: ipc/mod.rs has ~3,400 production lines (start_server) after its test mod; commands/benchmark.rs has production between three test mods; persona_tools.rs and positron_source.rs gate a helper fn near the top. Found on #5225, where llamacpp_adapter.rs declared 'mod tests;' at line 93 of 934 and the split read as 10 unwraps removed when none were. The gated item's extent is read as one character stream (string escapes and continuations, raw strings, char literals vs lifetimes, comments), because test fixtures carry braces in multi-line strings. Audited on canary: of 1,249 gates, 1,248 close where rustfmt closes them; the one other is a #[cfg(test)] inside the generator's raw-string template, where the new cut keeps more real code. Regression test: only_the_gated_item_is_test_code_never_the_rest_of_the_file. Baselines re-measured on canary a854548 + this change (no code changed): unwraps 2,279 -> 2,377, homes 79 -> 103, spawns 127 -> 132, head cuts 179 -> 188, serialization 246 -> 251, underived bounds 159 -> 164, unwired 60 -> 61. Each is code that was always production and was never scanned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(source-hygiene): integrate Codex's reviewed scanner revision 5 Applies the source-approved replacement from #5227 comment 6304136412 (Astra independent review) against bcbab21, unchanged: - a #[cfg(test)] item that starts on the attribute's own line is blanked, with source line numbers preserved; - item termination stays correct for static initializers and method continuations; - one nested block-comment scanner is shared (duplicate removed); - pub(in ...) and other restricted const visibilities are recognized by derived_bounds. Measured on this tree: cargo test -p source-hygiene, 42 passed. Every ratchet sits exactly at its existing baseline, so no baseline was edited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…pure moves) (#5228) * Every ratchet scans the production code that exists: the split cuts at column zero production_half stopped at the first #[cfg(test)] anywhere, so an indented test-only helper inside an impl ended "production" for the rest of the file. In cognition/llm_deliberation_faculty.rs that hid ~9,000 production lines from every ratchet except derived_bounds, which already cut at column zero for this reason (it carried its own copy of the split). Found 2026-10-20 when deleting one such helper surfaced 4 hidden unwraps. One split for every rule, at column zero; derived_bounds' private copy is deleted. Baselines re-measured to what was always there (not new debt): unwraps 2,119 -> 2,274, serialization 234 -> 245, spawn sites 123 -> 128, hand-built homes 72 -> 79. source-hygiene 39/39. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * head_cuts: a ratchet on text cuts that drop the newest end of her prompt A cut that keeps the start of text drops what happened last (the newest message, result, outcome), so she acts as if time never moved and loops (Joel, 2026-10-20); and one source shrinking itself by its own number breaks the budget for everything else. The rule counts, on prompt paths (cognition, persona, rag, modules, airc, positron): head keepers (chars().take, head_to_tokens, truncate_chars, lines().next()), literal take/truncate/[..N], and literal .min/.clamp ceilings beside a size word (plain arithmetic such as backoff exponents is not flagged). A cut that never reaches a prompt says `head-cut-ok: <why>`. Measured 179 on this branch; the count may only fall. source-hygiene 41/41. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * layer_discipline counts coupling sites per line, so a split by owner cannot move it A per-file count read +7 on #5224, which only moves test modules into sibling files: the same `use crate::modules::x` counted once per file it now sits in. A line is the coupling site; a pure move leaves it unchanged. The baseline is re-measured under the new unit in the next commit, from this tree's CI run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Ratchet baselines measured on canary for the column-zero split and the per-line unit CI on canary a854548 + this branch: boundary serialization 246, spawn sites 127, unjustified unwraps 2,279 (the split now sees production code that an indented #[cfg(test)] helper hid), upward imports 674 lines across 73 pairs (the unit changed from files to lines). No code changed between the two counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * production_half blanks only the #[cfg(test)]-gated item, never the rest of the file The cut stopped at the first column-zero #[cfg(test)], which is the end of production only when the test mod is the file's last item. It is not in many files: ipc/mod.rs has ~3,400 production lines (start_server) after its test mod; commands/benchmark.rs has production between three test mods; persona_tools.rs and positron_source.rs gate a helper fn near the top. Found on #5225, where llamacpp_adapter.rs declared 'mod tests;' at line 93 of 934 and the split read as 10 unwraps removed when none were. The gated item's extent is read as one character stream (string escapes and continuations, raw strings, char literals vs lifetimes, comments), because test fixtures carry braces in multi-line strings. Audited on canary: of 1,249 gates, 1,248 close where rustfmt closes them; the one other is a #[cfg(test)] inside the generator's raw-string template, where the new cut keeps more real code. Regression test: only_the_gated_item_is_test_code_never_the_rest_of_the_file. Baselines re-measured on canary a854548 + this change (no code changed): unwraps 2,279 -> 2,377, homes 79 -> 103, spawns 127 -> 132, head cuts 179 -> 188, serialization 246 -> 251, underived bounds 159 -> 164, unwired 60 -> 61. Each is code that was always production and was never scanned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * 69 oversized files: each one's test module moves to a sibling tests.rs New rule (Joel, 2026-10-20): no one edits a file over 1,000 lines. 76 of the 145 Rust files over 1,000 lines were over only because their inline #[cfg(test)] mod tests sat inside them. This moves that module, byte for byte (no re-indent, so string literals are untouched), to `<stem>/tests.rs`; the parent keeps `#[cfg(test)] mod tests;`. A child module keeps `use super::*` access, so nothing else changes. Moved: 69 files (66 continuum-core, 3 continuum-cli-lifecycle). Skipped: 11 being split on other branches, crate roots (main/lib/mod/bin), and 1 file with items after its test mod. One include_str! path is one level deeper (prebuilt_artifact tests). Verified: #[test]/#[tokio::test] attributes 8,320 before and after; continuum-core lib tests compile; continuum-cli-lifecycle 79 pass with the same 1 failure canary has (card 250ce9c8). Still over 1,000 after this and left to the split work: modules/forge.rs (1,003), and the tests files of cognition/recall_faculty (1,245) and commands/training_trigger/submit (1,332). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Moved test modules declare themselves test code (#![cfg(test)]) Without the inner attribute the hygiene scanner read the 69 moved tests.rs files as production (the file_engine split showed unwraps rising 150). The repo's existing convention for a test module in its own file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * One reader for the crate's own source: a moved test file is test code, owned by its module Two source-reading guards failed on #5224 because a test module moved into a sibling tests.rs read as production: experience/tests.rs became a second caller of record_lived_turn, service_module/tests.rs a registration of PersonaServiceModule. Each guard carried its own copy of the walk and the comment strip, so each would have needed its own fix. source_tree (cfg(test)) is the one reader: crate_sources(), and per file is_test_file(), production() and owner() (x/tests.rs belongs to x.rs). Migrated: the module-wiring audit (keys references by owner), the lived-turn caller count (production only), the loose-id scan, the GPU base check and the context-constant scan. Five private walks deleted. The swe env-root guard keeps its copy until the sweep splits swe_bench.rs (5,946 lines; no edits over 1,000). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * source_tree lives under test_env; baselines lowered to what #5224 measures lib.rs declaring two cfg(test) modules counted as a second test mod (19 -> 20), so the source reader nests under test_env, the crate's test environment. CI on this branch: lines past the readable size 154,999 -> 136,485, unwired public machinery 60 -> 58. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * production_reachability: a moved test module is still its owner's own test Retracts the previous commit's reason for 60 -> 58. That drop was a miscount, not a win: the rule reads a type as wired when its name appears outside its own file, test code included, so moving a test module into a sibling tests.rs made two types constructed only in their own tests read as externally used, the exact AgentContext (#27) shape this rule exists to catch. SourceFile::owning_module() names the module a file's code belongs to (x for x.rs, x/mod.rs, and a #![cfg(test)] x/tests.rs or x/tests/part_N.rs); the rule's own-mentions now include the moved tests of the same module. Baseline back to 60; regression test a_type_constructed_only_in_its_moved_tests_is_still_reported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * production_reachability: own the joined text the counts borrow from Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Split llamacpp_adapter.rs by owner: construction, payload, tests (1794 -> 934) Pure move. construction.rs: inherent builders + ensure_loaded (+Default); payload.rs: sampling/media decode; tests.rs: tests mod. Tests 12 passed/1 ignored before and after. Two tracing::warn! gain an explicit target so log targets are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Split persona/response.rs: sanitize + tests (1504 -> 918) Pure move. sanitize.rs: think-block/leaked-markup stripping; tests.rs: tests mod. Tests 19 passed before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Split genome/teach.rs: progress, status, tests (1410 -> 944) Pure move. progress.rs: watch cell/ledger/bus milestones; status.rs: genome/teach-status; tests.rs. Public paths kept via re-exports. Tests 15 passed before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Split modules/agent.rs: tools (1393 -> 841) Pure move. tools.rs: tool-call parsing and tool implementations. Tests 5 passed before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Split cognition/generate_response.rs: tests (1367 -> 644) Pure move of the tests mod. Tests 44 passed before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Split airc_remote/transport.rs: tests (1161 -> 757) Pure move of the tests mod. Tests 12 passed before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Split inference/handle_module.rs: tests (1095 -> 663) Pure move of the tests mod. Tests 23 passed before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Split persona/rag_inspect.rs: tests (1035 -> 684) Pure move of the tests mod. Tests 15 passed before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * file_size baseline 136,485 -> 133,731 after the eight splits (measured on this head) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * WIP: split the 59 remaining oversized files by owner (scripted, pure moves) Lines past 1000: 153,027 -> 58,046 (files over 1000: ~140 -> 18). Test attributes 8,320 = base. Workspace tests vs base: 9,573/43 vs 9,568/48; the 8 sweep-only failures were source-reading tests (fixed: loose-id declarations moved with their fields, the guard sees widened fields, three include paths). Ratchets: at or below canary's true counts once the column-zero scanner fix lands; upward-imports (per-file count) and derived-bounds (+3) still to reconcile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The swe env-root guard reads the crate through test_env::source_tree The sixth private source walk, deferred in #5224 while swe_bench.rs was 5,946 lines; the sweep split it, so the guard now uses the shared reader. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Scanned constants keep any visibility; sweep baselines measured on this head The split widens a moved constant to pub(in crate::path), which neither derived_bounds' prefix list nor the context-constant guard recognized, so NARRATION_BUDGET left the scan the day it moved. Both now strip any visibility. Measured on this head: lines past the readable size 133,731 -> 57,268; excess test mods 19 -> 15 (multi-mod suites became nested themes in one test file); unwired 61 -> 57, which is NOT a win: four types read as wired only because their constructor moved to a sibling chunk (named at the baseline, card 7660e70f). Unjustified unwraps, upward imports, spawns, homes, serialization, head cuts and underived bounds are unchanged: the sweep moves code, it changes none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * The sweep's imports narrowed to what each module actually re-exports; zero new warnings The splitter gave every child a 'pub use child::*' in its parent. Where the child's items are crate- or module-scoped that re-export was too wide (56 'glob import doesn't reexport' warnings) or reached nothing (51 unused). Each glob now carries the visibility its items have (pub(crate), the module's own pub(in ...), or private), and the ones nothing resolves through are removed, compiler-checked after each pass. run_harness/Harness are crate-scoped (their only caller is grade.rs) instead of widening a chain of private types. Built on the M5 in a build window (serving down), cargo test --lib --no-run with --features metal,accelerate: 0 warnings that the base (#5225 head) does not have; 63 total vs the base's 72 (9 old unused imports went with them). The CI baseline is set to 66 on the inference that CI's Linux build carries the same 3 cfg-only warnings it did at the base (75 vs 72); CI prints the exact number. cargo test -p continuum-core --lib (metal, M5): 9,002 passed, 2 failed: - the lived-turn guard named settle.rs; the driver now sits in settle/, so the guard accepts the settle module (fixed here, passes). - config_env read_all_on_a_missing_file: a stale temp file from an earlier run on this machine (card 4c820b46); passes on fresh CI runners. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * kill9: the parent glob import is Windows-only, where its one caller lives Removed as unused on the macOS build; the Windows build needs it for parse_tasklist_image_name (CI: Windows core compilation, E0425). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * benchmark_dispatch: recipe path extracted to run_recipe (no behaviour change) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * voice_module: decompose handle_command into per-family files (no behaviour change) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * model catalog: models() split into per-provider-family row functions, original order kept (no behaviour change) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * launch_gate: windows module decomposed into startup gate, scheduler script, custody, recovery journal and tests (no behaviour change) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * serve_persona_loop_inner: decomposed by responsibility (no behaviour change) Wake selection, quiescence, self-tick, backlog resync + loop-filler gate, turn intake (admit/compose/burst), the WorkspaceCycle step and the spoken-turn settle each move to a sibling module; the loop reads as setup + named steps with Step enums for the continue/break exits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * start_server.rs: decomposed by boot phase (no behaviour change) start_server() was one 3,388-line function. It is now the ordered list of boot phases (259 lines); each phase lives in a child module under ipc/start_server/ that owns it (model registry, foundation modules, resource authority, serving, pressure broker, inference, cognition, live call, service modules, AIRC discovery, persona registry/hosting/ reconciler, re-home reconciler, AI+genome, closing modules, runtime start, command executor, listeners, TCP ingress, WS ingress, memory guard, accept loop). Code is moved verbatim; shared values travel as parameters or small structs (Foundation, CognitionHandles, LiveCall, CodeHandles, AircBoot, RuntimeStarted). Order of spawns, registrations and binds is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * start_server: keep the unwrap_or_else justification on its own line rustfmt moved the same-line `// unwrap_or_else: ...` comment to the next line, which the unwrap ratchet counts as unjustified (2377 -> 2378). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * persona loop: phase_timings is mutable where say_ms is recorded; baselines for the deduplicated trigger CI E0594 on turn_settle.rs. The loop built its trigger InboxMessage twice (the loop-filler gate and admission), each with a peer- id cut and an unwrap_or_else; trigger_inbox_message builds it once, so head cuts 188 -> 187 and unjustified unwraps 2,377 -> 2,376 (checked in the diff), lines past the readable size 57,268 -> 56,859. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * launch_gate: the PowerShell include is two directories deeper; file_size baseline 57,131 Windows CI: couldn't read windows-prepared.ps1 from launch_gate/windows/. The path now climbs seven levels (checked: the file resolves). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * file_size baseline 57,131 -> 54,053 with the six giant items decomposed (measured on this merge) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(source-hygiene): integrate Codex's reviewed scanner revision 5 Applies the source-approved replacement from #5227 comment 6304136412 (Astra independent review) against bcbab21, unchanged: - a #[cfg(test)] item that starts on the attribute's own line is blanked, with source line numbers preserved; - item termination stays correct for static initializers and method continuations; - one nested block-comment scanner is shared (duplicate removed); - pub(in ...) and other restricted const visibilities are recognized by derived_bounds. Measured on this tree: cargo test -p source-hygiene, 42 passed. Every ratchet sits exactly at its existing baseline, so no baseline was edited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * test_env/source_tree: production is source-hygiene's projection, not a cut at the first cfg(test) Codex on #5228 (REQUEST CHANGES, comment 6307538140): the shared test reader ended production at the first column-zero #[cfg(test)], so production below a mid-file test mod or gated helper was invisible to the lived-turn exactly-one- caller guard, which the old private scan did see. That is the same hole production_half already closed for the ratchets (#5227). - production() delegates to source_hygiene::production_half (existing dev-dependency); only the gated items are removed. - code_only delegates to source_hygiene::split_code_and_comment, the one string-aware comment rule, instead of a second cruder copy. - Regression test: a function below a mid-file test mod stays production, and the gated item does not. Uncompiled locally (serving node); CI runs the guard tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Restore the comments the split dropped; the moved Windows test file is #![cfg(test)] Independent whole-PR review of 7bcdb2b (REQUEST CHANGES, P2): the splitter carried code faithfully but dropped about 506 lines of free-standing `//` comments between items, plus trailing comments on const lines. Examples are the MAX_LANES history in serving_plan.rs, the evidence-ledger rules in benchmark.rs and the parser format examples. - 186 blocks (596 lines) restored by script. Each is placed before the line that followed it in canary, matched on the next three lines with visibility normalised; indentation follows the new nesting. - Three trailing const comments restored: `// 2 GiB`, `// 1 hour`, `// 0=Normal`. - Seven blocks placed by hand: section banners, the ipc handler pointer, the vector-params note, test-module banners and the model-family parser banner. - Not restored, on purpose: comments on test code that the shared source_tree reader replaced (experience.rs code_only, device_probe.rs). The persona-loop provenance and wake-engram notes were already carried, as rewrites, in turn_cycle.rs and turn_context.rs. - The diff adds comment lines only, apart from the three trailing comments on existing lines; no code changes. - launch_gate/windows/tests.rs now starts with #![cfg(test)] (review finding 3). source-hygiene 43/43, no count moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * Restore the benchmark/swe-setup rationale above SweSetupParams; trailing comments keep one space Review of ad6dc73: the last block the split dropped (canary benchmark.rs:3930-3940). The three restored trailing comments now use one space before //, as canary had. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Under the new rule (no one edits a file over 1,000 lines), these eight files are each broken apart by responsibility. Every file now ends at most 1,000 lines. The moves are pure: test counts are identical before and after for each module.
inference/llamacpp_adapter.rsconstruction.rs426,payload.rs70,tests.rs377persona/response.rssanitize.rs200,tests.rs392commands/genome/teach.rsprogress.rs200,status.rs95,tests.rs185modules/agent.rstools.rs558cognition/generate_response.rstests.rs723inference/airc_remote/transport.rstests.rs404inference/handle_module.rstests.rs432persona/rag_inspect.rstests.rs351Beyond pure moves, two changes:
teach.rsre-exportsTeachProgress,subscribe_teach_progressand the status types, so external paths are unchanged.tracing::warn!calls that moved got an explicittarget:, so their log target is unchanged.tests.rsfiles carry#![cfg(test)], the repo's existing convention. That madelayer_disciplineskip test-module files, which is a rule change: please review it.Baselines lowered to measured counts:
cargo check: 122 warnings before and after.Each module's
cargo testfilter has the same counts before and after. Run on the M5; the full suite is left to CI.🤖 Generated with Claude Code