Repository navigation
Drop size limits and consolidate workshop modules - #42
Merged
Merged
Conversation
This change removes function and type size limits from the workspace and consolidates split modules into single domain files across 13 crates under `crates/workshop/`. `AGENTS.md` drops the size-limit rule, `Cargo.toml` allows `too_many_lines` and `too_many_arguments`, `clippy.toml` removes both thresholds, and `crates/build-xtask/src/tidy.rs` drops `type_size_violations` along with `crates/build-xtask/src/type_size.rs`. Across the touched workshop crates, child modules and single-use helpers merge into their owning files, repeated test fixtures move into shared support modules, and repeated unit tests collapse into table-driven cases. - Internal module trees collapse while crate `lib.rs` re-exports stay intact: `frames.rs` in `crates/workshop/protocol/src/`, `log.rs` in `crates/workshop/run-log/src/`, `http.rs` in `crates/workshop/support/src/`, `gateway.rs` and `quit.rs` in `crates/workshop/desktop/src/`, `app.rs`, `agents.rs`, `assets.rs`, `cross_site.rs`, and `workshop_socket.rs` in `crates/workshop/server/src/`, and `workspace.rs`, `workspace_file.rs`, and `handlers.rs` in `crates/workshop/workspace/src/` absorb their split siblings. In `crates/workshop/desktop/src/gateway.rs`, `SidecarIdentity` replaces both `GatewayAttachment` and `RecoveryOwnership`; in `crates/workshop/server/src/app.rs`, `AppState` wraps `Registrations` in one `Arc` instead of wrapping each `Registration`. - Several internal projections avoid cloning: `AgentEvent` in `crates/workshop/server/src/agents/wire.rs` and `ContractResponse`, `PackDto`, and `ModelDto` in `crates/workshop/server/src/routes/prompts.rs` borrow their string and JSON fields, and `normalize_dropped_path` in `crates/workshop/desktop/src/drops.rs` returns `Cow<'_, str>`. Shared test helpers move into new `test_support.rs` modules in `crates/workshop/desktop/src/`, `crates/workshop/gateway/src/`, and `crates/workshop/gateway-discovery/src/`, `crates/workshop/run-log/tests/it/support.rs`, and `recv_frames_until` in `crates/workshop/server/tests/common/mod.rs`. - In `crates/workshop/agents/src/conversation.rs` and `crates/workshop/agents/src/transcript.rs`, `push` on `Transcript` serializes the `Event` payload before taking the lock and runs an `on_push` callback under the lock so `ConversationRecorder` broadcasts only when `channels.events.receiver_count() > 0` without cloning `Channels`. - Inlining `stop_supervisor_then_request_shutdown` into `quit_everything` drops `quit_stops_the_supervisor_before_requesting_the_gateway_shutdown` from `crates/workshop/desktop/src/quit-tests.rs`, and removing `continue_teardown` in `crates/workshop/desktop/src/main.rs` narrows `every_supervisor_outcome_reports_without_stopping_teardown` to calling `report_supervisor_shutdown` without verifying continuation.
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
Removes numeric function/type size limits (
type_size.rs,too-many-lines-threshold,too-many-arguments-threshold) while keeping all binary architectural guards intact, recombines split production files, types, and single-caller helpers across 13 shipping crates undercrates/workshop/, removes borrow-evading clones and avoidable allocations, and consolidates duplicated test fixtures and unrolled unit tests into shared#![cfg(test)]support modules and labeledconsttables.All 17 shipping crate facades (
lib.rs/main.rs), public exports, wire formats (agent-frames.json,workshop-frames.json), and desktop CLI contracts remain unchanged.Measured Before-and-After (17 Shipping Crates)
.rsfilesfn/ methodsstruct/enumKey Changes
crates/build-xtask/src/type_size.rsand unwired it fromcrates/build-xtask/src/{main,tidy}.rs; droppedtoo-many-lines-thresholdandtoo-many-arguments-thresholdfromclippy.toml; addedtoo_many_lines = "allow"andtoo_many_arguments = "allow"to[workspace.lints.clippy]in rootCargo.toml; updatedAGENTS.mdto1 file holds 1 domain concept with no length limit.conversation-run.rs,workshop_socket-menu.rs,realtime-origin.rs,backing-ui-state-memory.rs,catalog-chat.rs,progress-wire.rs,desktop/src/gateway/,gateway/src/client/,protocolframes,serverroutes/agents,workspacebacking/pointer/handlers/workspace_file,run-logread/schema) into single concept files; dissolved single-use wrapper/state/latch types (SessionsState,EmbeddedAssets,AssetManifest,OpenRequest,Settled,SwitchFailure,RefreshState,BindingState,LastWorkspacePointer,StopSignal, duplicate sidecar ownership enums) and inlined single-caller helpers.Serialize-only wire DTOs (AgentEvent,ContractResponse,PackDto,ModelDto), avoidedChannelscloning and unsubscribedSessionEventclones inworkshop-agents, avoided 1 MiB text andValue/PathBufclones inworkshop-workspace, switchednormalize_dropped_pathtoCow<'_, str>, and trimmed SSE/HTTP/config allocations.#![cfg(test)]test_support.rsmodules (gateway-discovery,gateway,workspace,desktop,run-log/tests/it/support.rs), unified mock servers/recorders, and collapsed repetitive single-case tests into labeledconsttables with expanded symmetric edge-case coverage.Verification
All workspace gates passed:
cargo fmt --all --checkCARGO_BUILD_WARNINGS=deny cargo clippy --workspace --all-targets --all-features -- -D warningscargo nextest run --locked --workspace --all-features(844 passed, 10 skipped)RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --all-features --document-private-itemscargo test -p build-xtask(75 passed),cargo xtask tidy(no violations),cargo dylint --all,cargo deny check,cargo audit, andnode --test crates/workshop/ui/test/docs-claims.mjs