refactor(fleet-data): extract scrape_activity into dedicated module#155
Merged
Conversation
Move PaneActivity + scrape_activity out of fleet.rs into a new src/scrape.rs and split the inline regex-style passes into focused helpers (extract_runtime, extract_model_label, extract_headline) so scrape_activity is a thin orchestrator. Adds unit tests covering each extractor against realistic scrollback samples plus empty / chrome-only input. Pure refactor — fleet.rs::join keeps the same call shape via a use crate::scrape::scrape_activity import.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scrape_activity()andPaneActivityout offleet-data/src/fleet.rsinto a newfleet-data/src/scrape.rsextract_runtime,extract_model_label,extract_headlinefleet.rs::join()body untouched; onlyusestatement changesBehavior
Pure mechanical extraction. Identical output for all inputs. The empty-runtime retry guard from the original loop is preserved (
extract_runtimereturnsNonefor empty spans rather thanSome("")).Test plan
cargo check -p fleet-data— cleancargo test -p fleet-data— 60 passed (17 new)cargo check -p fleet-state -p fleet-waves— clean (downstream callers compile)🤖 Generated with Claude Code