Repository navigation
Conversation
…R5-L1, MR6-L1/L2) - Route files: a route file's own inner #![cfg(..)] gates its routes on the slow path (cfg_routes, not an ungated route), and an inner #![cfg(test)] makes a stored route file test-only. A declarer's inner cfg gates the modules it declares (module tree). - Module tree vs test-scope: rustc resolves an inline #[path = "d"] mod h at the top of a non-mod-rs file against the declaring file's directory (src/routes.rs -> src/d/x.rs, checked with a scratch crate: the src/routes/d/x.rs child-dir candidate does not compile). path_tree now follows that rule. - $ref rewrite: the fragment is percent-decoded before the name is taken (Pet%2Fx names Pet, suffix kept raw), via a new vespera_core split_schema_ref helper. - Generic handlers: only a type parameter can head a path, so a lifetime or const named like a module (a::NotFound under <'a>) is no longer rejected as a dangling reference. - Cron scan: jobs spelled through a local alias of vespera::cron (use vespera::cron as job) or of the vespera crate (use vespera as v) are discovered; a file's own inner #![cfg] gates its jobs. - export_app! cache hits validate the content-addressed include copy against its sidecar instead of only checking that it exists. - Test hygiene: the harness-build test probes prune_superseded_older_than with zero grace. Refuted: R41-MR3-L1 (a generic-argument responses type silently dropped). args.rs already rejects it at the #[route] attribute, before response_type_path runs, so no compiled route can reach the drop; only the doc was corrected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Round-41 fixes for the
vespera_macroscope (plus one smallvespera_corehelper).Findings
#![cfg(..)]now gates its routes on the slow path (cfg_routes, not an ungated route). An inner#![cfg(test)]makes a stored route file test-only. The module tree also applies a declarer's inner cfg to the modules it declares. Cron discovery applies a file's inner cfg to its jobs (same class).path_treenow resolves an inline top-level#[path]block against the declaring file's directory. See the rustc result below.a::NotFounda dangling reference. A type parameter head (T::Assoc) is still rejected.$reffragments are percent-decoded before the name is taken, via the newvespera_core::schema::split_schema_ref(its raw suffix is kept).schema_name_of_refnow delegates to it.use vespera::cron as job;(also grouped) anduse vespera as v;+#[v::cron]are recognised per module. A foreigncronalias and deeper paths are not claimed.export_app!cache hit compares the content-addressed include copy with its validated sidecar (the sidecar minus its catch-all key). A truncated or edited copy regenerates.prune_superseded_older_than(Duration::ZERO)and asserts the library copy survives.rustc
#[path]probe (R41-M1-L1)Scratch crate,
cargo run(rustc in this toolchain):src/routes.rscontaining#[path = "d"] mod h { pub mod x; }, withsrc/d/x.rspresent: the build loadssrc/d/x.rs.src/routes/d/x.rspresent (src/d/x.rsremoved): E0583, file not found. The child-directory candidate is never loaded.So an inline top-level
#[path]in a non-mod-rs file is relative to the declaring file's directory. Inside an inline block, amod x;resolves under the block's directory as before. Themodule_treeresolver already followed this rule.path_treedid not, and is fixed. Tests were added to both resolvers' test sets.R41-MR3-L1 refutation
responses = [(400, Page::<User>)]is already rejected by the#[route]argument parser (args.rs, "responsestype must not have generic arguments"), which runs beforeresponse_type_path. No compiled route can reach the dropped-arguments path. I first added a second check intyped_response_entry, but it was unreachable from any test, so I reverted it to keep the line-coverage gate at 100%. Only theresponse_type_pathdoc was corrected to say the argument parser rejects such paths.Verification
cargo test -j 2 -p vespera_macro --tests: 6530 unit tests and the trybuild UI suite pass.cargo test -j 2 -p vespera_core --lib: 337 pass.cargo clippy -p vespera_core -p vespera_macro --all-targets -- -D warningsclean;-p vespera_macro --no-default-features --all-targetsclean.cargo fmt -p vespera_macro -p vespera_core -- --checkclean.router_codegen/export.rs967,vespera_impl/cron_discovery.rs961).route_impl.rsmoved its ROUTE_STORAGE test block to a new sidecarroute_impl/tests_storage.rsfor the cap.Changepack
.changepacks/changepack_log_macrorest_round41.json: all seven packages at Patch.🤖 Generated with Claude Code