GeezerVison is showing github.com — pkgs/web-gen-api-axum crate split · Issue #8965 · developing-today/code
pkgs/web-gen-api-axum crate split #8965Descriptionpkgs/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: AppError enum + ErrorTemplate component) and dark_mode (109 LOC: ToggleDarkMode server fn + DarkModeToggle component) are each referenced only by app and 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), fileserv stays in the facade with main.rs (axum server) rather than dragging app down or inverting the edge.
app.rs internally 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:
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 test passes, 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
*.nix outside 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.
Activitydeveloping-today commented on Nov 12, 2026 dezren39 commented on 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):
- Stable rustc 1.99,
cargo build --features ssr: fails with E0554 — server_fn_macro uses #![feature]; the crate's leptos stack (leptos 0.8 / leptos_axum 0.4 / leptos_meta 0.4) is nightly-era.
RUSTC_BOOTSTRAP=1 on stable: fails — leptos_macro calls proc_macro::Span::source_file, an API removed from current rustc.
- The pinned toolchain (
rust-toolchain = nightly-2023-07-20, installed for this check): cannot read the current graph at all — Cargo.lock is 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 the 2024 edition". 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 commented on Nov 17, 2026
🤖 Agent note · triaged + escalated to Drew — task 18785 (lane code-a)
- Work kind: crate-split umbrella gated on a revival decision (no fix packet — the gate is a decision, recorded below) · Priority: priority/normal · Effort: effort/s (the decision; the split steps are already issued as 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)
- Fresh state (2026-11-17): issue pkgs/web-gen-api-axum crate split #8965 OPEN, label epic/crate-splits only, no hard-stop labels. Step 0 (pkgs/web-gen-api-axum crate split — step 0: workspace conversion + baselines (no code motion) #8966) is CLOSED — closed 2026-11-13 with the baseline recorded, not completed. Steps 1–3 (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 2: extract start-axum-ui (dark_mode + app) #8968, pkgs/web-gen-api-axum crate split — step 3: facade slimming (fileserv + server stay in start-axum) #8969) are OPEN and import-scanned, ready to run mechanically the moment the crate compiles.
- Blocker re-verified this shift (the 2026-11-13 baseline is still true): on origin/main, in
pkgs/web-gen-api-axum with its pinned toolchain (nightly-2026-11-08, bumped by Renovate chore(deps): update rust #7205 — a pin bump, not a revival), cargo check --features ssr via the fleet build lock fails with E0554 (#![feature] may not be used on the stable release channel) in server_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.
- Can't-you gate, stated: the revival choice (port / pin / retire) was recorded on this umbrella in 2026-11-13 as Drew's decision, and it is genuinely his — it disposes of a starter project (retire is irreversible-ish and product-shaped; port vs pin sets toolchain policy for a template meant to be copied). No standing doctrine picks among the three. Everything else — re-verification, surfacing, ledgering — is done here.
- The decision, in substance: 731 LOC Leptos 0.8 SSR starter (
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 item web-gen-8958-revival (sibling starter pkgs/web-gen); one answer in the same terms can close both.
- Escalation record: pending-decisions ledger item
web-gen-api-axum-8965-revival (status pending, added this triage; the sibling item covers pkgs/web-gen only). Task 18785 blocks as escalated-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 commented on Nov 22, 2026
Decided: Keep pkgs/web-gen-api-axum and 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 commented on Nov 22, 2026 dezren39 commented on 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 under pkgs/web-gen-api-axum/crates/, and the graph is tied together by path dependencies from the facade, whose Cargo.lock covers all three crates (no separate [workspace] manifest was introduced).
| crate |
location |
contents |
depends on |
start-axum-error |
pkgs/start-axum-error |
src/lib.rs — AppError enum + ErrorTemplate component |
leaf (leptos, http, thiserror; no internal deps) |
start-axum-ui |
pkgs/start-axum-ui |
src/app.rs (App/HomePage/SimpleCounter components + visitor server fns + libsql static-db init), src/dark_mode.rs (ToggleDarkMode server fn + DarkModeToggle component), src/lib.rs (module declarations) |
start-axum-error |
start-axum (facade) |
pkgs/web-gen-api-axum |
src/lib.rs (hydrate()), src/fileserv.rs (file_and_error_handler; use crate::app::App via the facade re-export), src/main.rs (axum server wiring), one-line re-export shims src/app.rs / src/dark_mode.rs / src/error_template.rs, tests/facade_paths.rs (facade-contract test) |
start-axum-ui, start-axum-error |
Dependency 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 by tests/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. dezren39 commented on Nov 24, 2026 agent-note:v1
state: verified-closed
actor: oc-code-02 (openchamber scheduled Fleet lane)
task: 21944 (second-pass verify-and-route)
dezren39 commented on Nov 24, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|