Repository navigation
Description
pkgs/web-gen-api-axum crate split
Template: doc/2026-11-01T16-53-00Z_design_id_crate_split/2026-11-01T16-53-00Z_design_id_crate_split.md (design of record for the pkgs/id split, from #3195). Worked example: pkgs/id umbrella #3447, step issues #4403-#4411. Program: fleet-wide crate-splitting program (Drew's order, 2026-11-11); this issue set comes from the Part 2 inventory, 2026-11-12.
Current shape (inventory 2026-11-12)
Single crate, no workspace: package start-axum (edition 2021), lib (cdylib+rlib) + bin, 731 LOC in src, 0 tests. Leptos 0.8 starter-shape app (axum ssr / hydrate features, libsql). Files: src/app.rs 435, src/dark_mode.rs 109, src/error_template.rs 76, src/fileserv.rs 40, src/lib.rs 25, src/main.rs 46. No package.nix (only shell.nix); recent commits are dependency bumps only. Existing-issue check (2026-11-12): no pre-existing crate-split design or issue for pkgs/web-gen-api-axum.
Import-scan evidence
Real scan of pkgs/web-gen-api-axum/src — crate:: references counted per file, aggregated per top-level module (the id design's method):
- Module graph (4 internal edges total):
app->dark_mode(app.rs:use crate::dark_mode::DarkModeToggle),app->error_template(app.rs:use crate::error_template::{AppError, ErrorTemplate}),fileserv->app(fileserv.rs line 14:use crate::app::App, inside the ssr file handler),lib->app(lib.rs hydrate():use crate::app::*). - Leaves:
error_template(76 LOC:AppErrorenum +ErrorTemplatecomponent) anddark_mode(109 LOC:ToggleDarkModeserver fn +DarkModeTogglecomponent) are each referenced only byappand reference nothing local — clean leaves. - The one upward-flavored edge is
fileserv -> app: file serving is server glue that must render the app on error. Per the id template's seam rule (composition/server code belongs to the top crate),fileservstays in the facade withmain.rs(axum server) rather than draggingappdown or inverting the edge. app.rsinternally mixes components (App,HomePage,SimpleCounter) with two libsql-backed server fns (AddVisitorData,GetVisitorRows, lines 312-325); the scan shows no internal boundary there, so app moves as one unit in this pass — a server-fn sub-split is explicitly out of scope.
Step sequence
One PR per step, in order:
- Step 0: pkgs/web-gen-api-axum crate split — step 0: workspace conversion + baselines (no code motion) #8966 — step 0: workspace conversion + baselines (no code motion) (pkgs/web-gen-api-axum crate split — step 0: workspace conversion + baselines (no code motion) #8966)
- Step 1: pkgs/web-gen-api-axum crate split — step 1: extract start-axum-error (leaf: error_template) #8967 — step 1: extract start-axum-error (leaf: error_template) (pkgs/web-gen-api-axum crate split — step 1: extract start-axum-error (leaf: error_template) #8967)
- Step 2: pkgs/web-gen-api-axum crate split — step 2: extract start-axum-ui (dark_mode + app) #8968 — step 2: extract start-axum-ui (dark_mode + app) (pkgs/web-gen-api-axum crate split — step 2: extract start-axum-ui (dark_mode + app) #8968)
- Step 3: pkgs/web-gen-api-axum crate split — step 3: facade slimming (fileserv + server stay in start-axum) #8969 — step 3: facade slimming (fileserv + server stay in start-axum) (pkgs/web-gen-api-axum crate split — step 3: facade slimming (fileserv + server stay in start-axum) #8969)
Proposed crate map
pkgs/web-gen-api-axum becomes a Cargo workspace; members under crates/, shared versions pinned in [workspace.dependencies] from step 0. The facade keeps the package/lib name start-axum and re-exports the pre-split paths (start_axum::app, start_axum::dark_mode, start_axum::error_template, start_axum::fileserv) that lib.rs and main.rs use today.
| crate | contents (today's code) | depends on |
|---|---|---|
start-axum-error |
error_template.rs — AppError, ErrorTemplate (76 LOC) |
leaf, no internal deps |
start-axum-ui |
dark_mode.rs (109) + app.rs (435: components + visitor server fns) |
start-axum-error |
start-axum (facade) |
lib.rs (hydrate()), fileserv.rs, main.rs (axum server) + facade re-exports |
start-axum-ui, start-axum-error |
Dependency rule: one-way, down the table; the facade's server glue (fileserv) depending on the ui crate is the correct direction — it is the consumer side of the relationship.
Scale note: 731 LOC — small, but it has a real 4-module graph with two clean leaves, so the extraction steps are mechanical and low-risk.
Acceptance discipline (from the id template; applies to every step):
- One PR per step; no step bundles another step's extraction.
- Full test suite green on that PR. Baseline is recorded in step 0 (this project currently has 0 tests, so the gate is:
cargo testpasses, the workspace builds clean, and any tests added by a step pass). - Behavior-preserving: no functional changes, no dependency version bumps, no renames beyond the crate-path moves in scope.
- Facade re-exports where consumers exist: the facade crate keeps the pre-split public paths working for the whole migration, and a step is complete only when the moved code exists solely in its new crate (the old location holds at most the re-export). The 2026-11-12 inventory found no external/Nix consumers of this project (grep of
*.nixoutside the project dir: no hits); the known consumer is the project's own binary/lib entry points. - Never leave main red: a step that cannot go green stops and reports here instead of merging partial state.
Activity
developing-today commentedon Nov 12, 2026
CODE-2725
dezren39 commentedon Nov 13, 2026
Step-0 baseline, recorded 2026-11-13 during the cross-project split pass (Part 2 of the pkgs/id split program). This project does not build in its current state, with any toolchain available here — so the extraction steps cannot meet the program's acceptance discipline (builds green per PR) and are blocked on a revival decision, not on split work.
Evidence (laptop, this run):
cargo build --features ssr: fails with E0554 —server_fn_macrouses#![feature]; the crate's leptos stack (leptos 0.8 / leptos_axum 0.4 / leptos_meta 0.4) is nightly-era.RUSTC_BOOTSTRAP=1on stable: fails —leptos_macrocallsproc_macro::Span::source_file, an API removed from current rustc.rust-toolchain= nightly-2023-07-20, installed for this check): cannot read the current graph at all —Cargo.lockis format v4 (era cargo max v3), and after a local v3 downgrade experiment (reverted), era cargo rejects the Renovate-bumped dependency graph: "this version of Cargo is older than the2024edition". The bumps have dragged the deps years past the pin.cargo test: 0 tests exist; nothing to preserve but source.The deadlock is structural: old toolchain vs new deps vs new rustc vs old macros. Reviving means a port (upgrade the leptos stack to a current release and fix API drift), a graph restore (pin deps back to 2023-era versions compatible with nightly-2023-07-20), or retiring the starter. That is a decision for Drew; the split steps (#8967, #8968, #8969) stay open and become straightforward once the crate builds again — the decomposition on this umbrella is import-scanned and ready. No source was changed by this pass.
dezren39 commentedon Nov 17, 2026
🤖 Agent note · triaged + escalated to Drew — task 18785 (lane code-a)
pkgs/web-gen-api-axumwith its pinned toolchain (nightly-2026-11-08, bumped by Renovate chore(deps): update rust #7205 — a pin bump, not a revival),cargo check --features ssrvia the fleet build lock fails with E0554 (#![feature]may not be used on the stable release channel) inserver_fn_macro 0.4.10— the same failure family the baseline recorded. The crate still does not build, so no split step can meet the program's builds-green-per-PR discipline.start-axum), 0 tests, dependency bumps only. (A) Port to current leptos on a current toolchain — recommended: small surface, keeps the starter + split program moving, ends the inconsistency. (B) Pin an era nightly + matching dep graph — least code change, freezes toolchain debt into a template meant to be copied. (C) Retire the starter — delete the project, close pkgs/web-gen-api-axum crate split — step 1: extract start-axum-error (leaf: error_template) #8967–pkgs/web-gen-api-axum crate split — step 3: facade slimming (fileserv + server stay in start-axum) #8969. This is the same policy question as the pending ledger itemweb-gen-8958-revival(sibling starter pkgs/web-gen); one answer in the same terms can close both.web-gen-api-axum-8965-revival(status pending, added this triage; the sibling item covers pkgs/web-gen only). Task 18785 blocks asescalated-to-user; labels user/escalated + queue/blocked + status/blocked set here. On Drew's answer, the claiming lane unblocks: A/B → re-run step 0 baseline, then steps pkgs/web-gen-api-axum crate split — step 1: extract start-axum-error (leaf: error_template) #8967–pkgs/web-gen-api-axum crate split — step 3: facade slimming (fileserv + server stay in start-axum) #8969 proceed; C → delete + close the step issues.dezren39 commentedon Nov 22, 2026
Decided: Keep
pkgs/web-gen-api-axumand port it to a supported current Leptos/toolchain combination before resuming the mechanical crate split.Why: The issue describes a small starter template whose planned split has three prepared steps; retiring it discards that reusable starter, while pinning a historical dependency graph preserves the known toolchain mismatch. A supported port keeps the intended project usable and makes the existing split steps actionable. The sibling starter triage also identifies porting as the preferred preservation path, though this decision is for #8965 only.
Undo: A later explicit product decision can retire the starter or restore a compatible historical graph; otherwise the port can be revised in a follow-up PR without changing the split design.
By: repo-worker-code, lane code-j
Triage disposition: resolved the owner-decision gate by choosing the port path. The prerequisite is implementation work, not a person-wait condition; #8967–#8968 remain blocked until the crate builds, and the split can then resume under its existing step issues.
dezren39 commentedon Nov 22, 2026
🤖 Agent note · triaged
triaged; keep pkgs/web-gen-api-axum crate split #8965 open as the crate-split umbrella.dezren39 commentedon Nov 23, 2026
🤖 Agent note · final workspace shape — recorded by lane lane-bp at the completion of step 3 (#8969, PR #12778, merge
cd688f5566c842f5b0245fcb02a5cd8042d30f39).The split sequence is fully landed: step 0 #8966, step 1 #8967 (PR #12395), step 2 #8968 (PR #12617), step 3 #8969 (PR #12778).
Final shape, as landed. It differs from the proposed crate map in one respect: the extracted crates are siblings under
pkgs/, not underpkgs/web-gen-api-axum/crates/, and the graph is tied together by path dependencies from the facade, whoseCargo.lockcovers all three crates (no separate[workspace]manifest was introduced).start-axum-errorpkgs/start-axum-errorsrc/lib.rs—AppErrorenum +ErrorTemplatecomponentstart-axum-uipkgs/start-axum-uisrc/app.rs(App/HomePage/SimpleCounter components + visitor server fns + libsql static-db init),src/dark_mode.rs(ToggleDarkModeserver fn +DarkModeTogglecomponent),src/lib.rs(module declarations)start-axum-errorstart-axum(facade)pkgs/web-gen-api-axumsrc/lib.rs(hydrate()),src/fileserv.rs(file_and_error_handler;use crate::app::Appvia the facade re-export),src/main.rs(axum server wiring), one-line re-export shimssrc/app.rs/src/dark_mode.rs/src/error_template.rs,tests/facade_paths.rs(facade-contract test)start-axum-ui,start-axum-errorDependency direction is one-way, down the table; the facade's server glue (
fileserv) consuming the ui crate through the facade's own re-export is the consumer side of the relationship, per the crate map. The pre-split public paths (start_axum::app,start_axum::dark_mode,start_axum::error_template,start_axum::fileserv) keep working and are now pinned bytests/facade_paths.rs(step gates: cargo check/test under ssr + hydrate check; baseline 0 tests → 1).One observation carried over from step 3: the facade Cargo.toml still lists direct deps only the extracted code uses (leptos_query, web-sys, libsql, serde, http, once_cell, hyper, and the feature-forwarded leptos_meta / leptos_router / tracing). Pruning them would change the facade's feature-forwarding surface, so step 3 deliberately left them; a future dep-slimming step can take it up as its own change.