Clear pub-types cleanup backlog (stacked on #117)#118
Open
saltyskip wants to merge 1 commit intoextend-architecture-testfrom
Open
Clear pub-types cleanup backlog (stacked on #117)#118saltyskip wants to merge 1 commit intoextend-architecture-testfrom
saltyskip wants to merge 1 commit intoextend-architecture-testfrom
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Stacks on PR #117. The backlog list introduced there held 10 files of pre-existing pub-data-type violations. This PR works through every entry so the backlog is empty. **Billing slice — moved to services/billing/models.rs:** - handoff.rs: BillingIntent, BillingTier (+ impl), BillingHandoffError, HandoffOutcome, BillingHandoffConfig - stripe_client.rs: StripeConfig (+ impl), StripeError (+ Display), CheckoutSession, HandoffCheckoutOpts, PortalSession, WebhookVerifyError (+ Display) - limits.rs: PlanLimits - repos/event_counters.rs: EventCounterDoc (EventCountersRepo marked impl_container) - repos/stripe_webhook_dedup.rs: StripeDedupDoc (StripeWebhookDedupRepo marked impl_container) Source files now `pub use` from models.rs to keep external import paths stable. BillingHandoffService also marked as impl_container. **Core slice — new core/models.rs:** - 4 webhook payloads (ClickEventPayload, AttributionEventPayload, ConversionEventPayload, WebhookPayload) extracted from webhook_dispatcher.rs. The trait stays. - core/config.rs::Config marked as impl_container (env-loaded settings with from_env constructor — same pattern as repo containers). **Single-struct top-level files — converted to directories:** - error.rs → error/{mod.rs (the IntoResponse impl), models.rs (ErrorResponse, AppError)}. mod.rs re-exports both, so `crate::error::ErrorResponse` keeps working everywhere. - app.rs → app/{mod.rs (re-export), models.rs (AppState)}. Same re-export pattern; `crate::app::AppState` unchanged. **MCP renamed:** - mcp/tools.rs → mcp/models.rs. The file already held DTO-shaped tool input types — name now matches the pattern. `mcp/server.rs` and `mcp/mod.rs` updated. **Architecture test:** PUB_TYPES_CLEANUP_BACKLOG drops to `&[]`. Every `.rs` under `src/` (except models.rs, lib.rs, main.rs, architecture_tests.rs, *_tests.rs) is now enforced and clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
52bb5c7 to
080641a
Compare
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
Stacked on #117. Works through every entry in the
PUB_TYPES_CLEANUP_BACKLOGlist that PR introduced, leaving the backlog empty and every.rsfile insrc/properly enforced by the architecture test.What moved
Billing slice →
services/billing/models.rshandoff.rsBillingIntent,BillingTier(+ impl),BillingHandoffError,HandoffOutcome,BillingHandoffConfigstripe_client.rsStripeConfig(+ impl),StripeError(+ Display),CheckoutSession,HandoffCheckoutOpts<'a>,PortalSession,WebhookVerifyError(+ Display)limits.rsPlanLimitsrepos/event_counters.rsEventCounterDocrepos/stripe_webhook_dedup.rsStripeDedupDocSource files use
pub use super::models::*;re-exports so external callers (crate::services::billing::stripe_client::StripeErroretc.) keep working.BillingHandoffService,EventCountersRepo,StripeWebhookDedupRepomarked withimpl_container!.Core slice → new
core/models.rscore/webhook_dispatcher.rsClickEventPayload,AttributionEventPayload,ConversionEventPayload,WebhookPayloadThe
WebhookDispatchertrait stays inwebhook_dispatcher.rs.core/config.rs::Configmarked asimpl_container!(same pattern as repo containers — type withfrom_env()constructor).Single-struct top-level files → directories with mod.rs + models.rs
error.rsandapp.rswere single-purpose files (one struct/enum each plus impls). Converted to mini-modules so the data lives inmodels.rsper the rule:error.rs→error/{mod.rs, models.rs}—ErrorResponse,AppErrorinmodels.rs;IntoResponse for AppErrorimpl inmod.rs.mod.rsre-exports socrate::error::ErrorResponseis unchanged everywhere.app.rs→app/{mod.rs, models.rs}—AppStateinmodels.rs;mod.rsre-exports.crate::app::AppStateunchanged.MCP renamed
mcp/tools.rs→mcp/models.rs. The file already held DTO-shaped tool input types; the rename makes it match the pattern.mcp/server.rsandmcp/mod.rsupdated.Architecture test
PUB_TYPES_CLEANUP_BACKLOGis now&[]. The const stays in place as a holding-pen pattern in case future migrations need a temporary entry, but the comment makes clear new entries shouldn't be added.Test plan
cargo fmt -- --checkcargo clippy --all-targets -- -D warningscargo test— 112 lib + 145 integration tests passpub usere-exports preserving every external import path.🤖 Generated with Claude Code