[META] Align hero_assistance with the canonical Hero service template #15

Closed
opened 2026-05-22 13:52:24 +00:00 by mik-tf · 1 comment
Owner

Why

hero_assistance is engineering-complete since s37 and parked since s49, but it's an outlier in the workspace — the only service still on Dioxus + dioxus-bootstrap-css when every other Hero service has converged on the canonical pattern (hero_service reference shape: Axum + Askama + Bootstrap + Unpoly + hero_admin_lib + hero_theme).

This issue tracks bringing hero_assistance 100% in line with the canonical template per the hero_service_refactor playbook. Goal: any Hero contributor can pick up hero_assistance using only the skills they already know from hero_proc, hero_cockpit, hero_service.

Workspace critical path remains home#235 — this work is the right cleanup for the right moment (no active deployments, no end-user blast radius), but does not pre-empt Track D.

Status (updated 2026-05-23 at s2-020 close)

Phases A / B / C / D / E done. Meta-issue closed.

Phase Session Commit Outcome
A — Drop 5 Dioxus crates s2-016 5330a0f lab infocheck 4 ok / 4 fail / 20 findings → 4 / 0 / 0. D-26 minted retiring D-09/D-17/D-22/D-25 atomically. CI walls 1+2 fixed (rusqlite 0.31→0.39, reqwest workspace dep with rustls-tls).
B — _admin rebuild on hero_admin_lib + Askama s2-017 4f5362c templates/base.html 178 LOC + templates/index.html 474 LOC, 8 tab panes (4 domain via window.rpc() + 4 utility via <hero-*> web components). openrpc_proxy + rpc_proxy byte-passthrough preserved verbatim.
C — _ui rebuild on Askama + Unpoly + SSE s2-018 8bb3c6b 6 new templates (base.html, index.html, ticket.html, new_ticket.html, _messages.html, _message_item.html). D-27 minted locking the GET /tickets/{id}/_messages SSE wire shape + inheritance of D-20 per-recipient privacy via the existing per-user broadcast::Sender<SeqEvent>. rpc_proxy + attachment_proxy + user_ws_handler preserved verbatim.
D — ADR-0001 cleanup + s2-016 leftovers + doc polish s2-019 51a3989 Dropped _ui/{static,scripts,Makefile,BROWSER_SUPPORT.md} + workspace-root Makefile + 5 SPA-era / lifecycle scripts. Fixed .gitignore codegen-rename pattern. Polished D-26 frontmatter (session: "s2-016"). Folded in lab build --policy-mode apply dep-bump drift (askama 0.14→0.16, thiserror 1→2, serde_json 1→1.0). Rewrote repo-local CLAUDE.md (Current state / v1 architecture / patterns / Build / Open issues).
E — workspace fmt + clippy sweep + README rewrite s2-020 6b592cb cargo fmt --all across 42 files (1 cli + 33 server + 4 sdk + 4 examples; _ui + _admin had zero fmt debt, absorbed in Phase B/C respectively). cargo clippy --release --workspace --all-targets -- -D warnings clean — auto-fix absorbed the bulk (collapsible_if x9, collapsible_match, single_match, manual_split_once, io_other_error, bool_assert_comparison) plus 13 hand-fixes for residuals (vec_init_then_push, doc_lazy_continuation x6, unnecessary_sort_by x2, type_complexity, field_reassign_with_default, collapsible_if, redundant_guards, dead_code x3, zombie_processes). README.md rewritten 458 → 205 lines, dropping Dioxus-era sections. 5 follow-up Forge issues filed for the post-Phase-D real-deploy gaps.

Test posture (preserved through Phase E): workspace cargo test --release --workspace --no-fail-fast = 254 pass / 1 fail / 14 ignored (1 remaining failure is the documented pre-existing host-env flake phase24b_ui_add_access_fails_when_hero_proc_unreachable).

Follow-up issues filed at Phase E close

Real-deploy gaps surfaced during the s2-018 router-fronted smoke, filed as fresh Forge issues at s2-020 close (NOT Phase B/C regressions; all inherited from hero_admin_lib or hero_router):

Target state — 6 crates (canonical shape)

Crate Role Status
hero_assistance CLI: lifecycle owner (--start / --stop + selfstart) canonical
hero_assistance_server JSON-RPC daemon (mycelium-bound TCP + SSE) canonical
hero_assistance_admin Admin panel on hero_admin_lib + Askama Phase B (s2-017)
hero_assistance_ui Customer-facing UI on Askama + Unpoly + SSE Phase C (s2-018)
hero_assistance_sdk Typed JSON-RPC client (already generated) canonical
hero_assistance_examples Runnable SDK usage examples canonical

Crates dropped (5): hero_assistance_app, hero_assistance_ui_wasm, hero_assistance_admin_ui_wasm, hero_assistance_ui_wasm_components, embed_smoke — all dropped in Phase A (s2-016).

Acceptance criteria

Per hero_service_refactor §Acceptance:

  • lab infocheck exits 0 with 4 crate(s) clean, 0 crate(s) with issues, 0 finding(s) total (4 binary crates; 2 lib crates not scanned by infocheck)
  • No crates/hero_assistance_app/ / _ui_wasm/ / _admin_ui_wasm/ / _ui_wasm_components/ / embed_smoke/ directories
  • No workspace Makefile, no scripts/service_assistance.nu, no scripts/*.sh build/install helpers (kept: scripts/backup.sh, scripts/kickstart.sh, scripts/handoff.sh — AI methodology infrastructure)
  • No dioxus* dependency in any Cargo.toml (workspace or per-crate)
  • _admin consumes hero_admin_lib for routes / middleware / socket helpers / web components
  • _ui serves templates from Askama + Unpoly + SSE; no --dist flag
  • README.md references only lab service ... lifecycle (PURPOSE.md absent in repo; README alone carries the canonical incantation — completed in Phase E s2-020)
  • lab service hero_assistance --install && lab service hero_assistance --start runs cleanly (with the 5 real-deploy caveats now filed as fresh Forge issues — see Follow-up section above)
  • Post-start smoke: /health, /openrpc.json, /.well-known/heroservice.json, JSON-RPC system.ping all green on _server socket; /health green on _admin + _ui sockets
  • Router homepage at /hero_assistance/admin/ shows the admin card
  • 254-test baseline holds: 254 pass / 1 fail / 14 ignored (1 fail is pre-existing host-env flake, not a Phase A-E regression)
  • Decision D-26 filed retiring D-09 / D-17 / D-22 / D-25 atomically
  • Decision D-27 filed locking the SSE wire shape
  • Workspace cargo fmt --check + cargo clippy --release --workspace --all-targets -- -D warnings both exit 0 (Phase E)

Out of scope

  • Customer SPA UX parity with the Dioxus version. The Askama+Unpoly customer UI will feel different (server-rendered partials vs client-side signal reactivity). We accept this — the canonical pattern is the goal, not pixel-equivalent UX. D-26 §Why "UX cost is bounded".
  • Mycelium-bound transport changes. D-04 / D-05 / D-08 / D-20 invariants stay; this is purely a UI-rendering refactor.
  • Cross-repo Phase 27 integration. Tracked as Phase F (optional follow-up). Scoped + decoupled from the in-repo work in Phase A-E. Gated on resolution of hero_skills#268 (linux-musl-x86_64 vs linux-amd64 org-wide naming-suffix).

References

  • hero_service_refactor — the canonical migration playbook
  • hero_service — target shape reference
  • hero_proc — admin model reference
  • hero_cockpit — Askama+Unpoly customer UI reference
  • hero_skills — skill bundle (hero_ui_dashboard, hero_ui_dashboard_admin, hero_ui_whitelists, hero_ui_openrpc_proxy, hero_ui_routes, web_embed, hero_web)
  • home#235 — workspace critical path (this alignment is parallel/cleanup, not a Track D blocker)
  • Decisions: D-26 (retires Dioxus deviation atomically), D-27 (SSE wire shape on _ui)

Effort summary

5 sessions for Phase A-E (s2-016 / s2-017 / s2-018 / s2-019 / s2-020 — all closed). Phase F (cross-repo hero_skills + hero_demo integration) remains an optional follow-up; scope unchanged from the original phased plan.

Signed-by: mik-tf mik-tf@noreply.invalid

## Why hero_assistance is engineering-complete since s37 and parked since s49, but it's an outlier in the workspace — the only service still on Dioxus + dioxus-bootstrap-css when every other Hero service has converged on the canonical pattern (`hero_service` reference shape: Axum + Askama + Bootstrap + Unpoly + `hero_admin_lib` + `hero_theme`). This issue tracks bringing hero_assistance 100% in line with the canonical template per the [`hero_service_refactor`](https://forge.ourworld.tf/lhumina_code/hero_skills/src/branch/development/skills/hero/service/hero_service_refactor.md) playbook. Goal: any Hero contributor can pick up hero_assistance using only the skills they already know from hero_proc, hero_cockpit, hero_service. Workspace critical path remains [home#235](https://forge.ourworld.tf/lhumina_code/home/issues/235) — this work is the right cleanup for the right moment (no active deployments, no end-user blast radius), but does not pre-empt Track D. ## Status (updated 2026-05-23 at s2-020 close) **Phases A / B / C / D / E done. Meta-issue closed.** | Phase | Session | Commit | Outcome | |---|---|---|---| | **A — Drop 5 Dioxus crates** | s2-016 | [`5330a0f`](https://forge.ourworld.tf/lhumina_code/hero_assistance/commit/5330a0f) | ✅ `lab infocheck` 4 ok / 4 fail / 20 findings → 4 / 0 / 0. D-26 minted retiring D-09/D-17/D-22/D-25 atomically. CI walls 1+2 fixed (rusqlite 0.31→0.39, reqwest workspace dep with rustls-tls). | | **B — `_admin` rebuild on hero_admin_lib + Askama** | s2-017 | [`4f5362c`](https://forge.ourworld.tf/lhumina_code/hero_assistance/commit/4f5362c) | ✅ `templates/base.html` 178 LOC + `templates/index.html` 474 LOC, 8 tab panes (4 domain via `window.rpc()` + 4 utility via `<hero-*>` web components). `openrpc_proxy` + `rpc_proxy` byte-passthrough preserved verbatim. | | **C — `_ui` rebuild on Askama + Unpoly + SSE** | s2-018 | [`8bb3c6b`](https://forge.ourworld.tf/lhumina_code/hero_assistance/commit/8bb3c6b) | ✅ 6 new templates (`base.html`, `index.html`, `ticket.html`, `new_ticket.html`, `_messages.html`, `_message_item.html`). D-27 minted locking the `GET /tickets/{id}/_messages` SSE wire shape + inheritance of D-20 per-recipient privacy via the existing per-user `broadcast::Sender<SeqEvent>`. `rpc_proxy` + `attachment_proxy` + `user_ws_handler` preserved verbatim. | | **D — ADR-0001 cleanup + s2-016 leftovers + doc polish** | s2-019 | [`51a3989`](https://forge.ourworld.tf/lhumina_code/hero_assistance/commit/51a3989) | ✅ Dropped `_ui/{static,scripts,Makefile,BROWSER_SUPPORT.md}` + workspace-root `Makefile` + 5 SPA-era / lifecycle scripts. Fixed `.gitignore` codegen-rename pattern. Polished D-26 frontmatter (`session: "s2-016"`). Folded in `lab build --policy-mode apply` dep-bump drift (askama 0.14→0.16, thiserror 1→2, serde_json 1→1.0). Rewrote repo-local CLAUDE.md (Current state / v1 architecture / patterns / Build / Open issues). | | **E — workspace fmt + clippy sweep + README rewrite** | s2-020 | [`6b592cb`](https://forge.ourworld.tf/lhumina_code/hero_assistance/commit/6b592cb) | ✅ `cargo fmt --all` across 42 files (1 cli + 33 server + 4 sdk + 4 examples; `_ui` + `_admin` had zero fmt debt, absorbed in Phase B/C respectively). `cargo clippy --release --workspace --all-targets -- -D warnings` clean — auto-fix absorbed the bulk (collapsible_if x9, collapsible_match, single_match, manual_split_once, io_other_error, bool_assert_comparison) plus 13 hand-fixes for residuals (vec_init_then_push, doc_lazy_continuation x6, unnecessary_sort_by x2, type_complexity, field_reassign_with_default, collapsible_if, redundant_guards, dead_code x3, zombie_processes). README.md rewritten 458 → 205 lines, dropping Dioxus-era sections. 5 follow-up Forge issues filed for the post-Phase-D real-deploy gaps. | **Test posture (preserved through Phase E):** workspace `cargo test --release --workspace --no-fail-fast` = **254 pass / 1 fail / 14 ignored** (1 remaining failure is the documented pre-existing host-env flake `phase24b_ui_add_access_fails_when_hero_proc_unreachable`). ## Follow-up issues filed at Phase E close Real-deploy gaps surfaced during the s2-018 router-fronted smoke, filed as fresh Forge issues at s2-020 close (NOT Phase B/C regressions; all inherited from hero_admin_lib or hero_router): - [hero_router#109](https://forge.ourworld.tf/lhumina_code/hero_router/issues/109) — /admin/rpc routing bypasses ui.* on hero_assistance_admin - [hero_website_framework#7](https://forge.ourworld.tf/lhumina_code/hero_website_framework/issues/7) — <hero-logs-viewer> targets _server instead of hero_proc - [hero_website_framework#8](https://forge.ourworld.tf/lhumina_code/hero_website_framework/issues/8) — <hero-api-docs> header gradient ignores theme switches - [hero_assistance#16](https://forge.ourworld.tf/lhumina_code/hero_assistance/issues/16) — hero_assistance --start does not spawn _admin / _ui children - [hero_router#110](https://forge.ourworld.tf/lhumina_code/hero_router/issues/110) — hero_router service.toml missing PATH_ROOT [[env]] block ## Target state — 6 crates (canonical shape) | Crate | Role | Status | |---|---|---| | `hero_assistance` | CLI: lifecycle owner (`--start` / `--stop` + selfstart) | ✅ canonical | | `hero_assistance_server` | JSON-RPC daemon (mycelium-bound TCP + SSE) | ✅ canonical | | `hero_assistance_admin` | Admin panel on `hero_admin_lib` + Askama | ✅ Phase B (s2-017) | | `hero_assistance_ui` | Customer-facing UI on Askama + Unpoly + SSE | ✅ Phase C (s2-018) | | `hero_assistance_sdk` | Typed JSON-RPC client (already generated) | ✅ canonical | | `hero_assistance_examples` | Runnable SDK usage examples | ✅ canonical | **Crates dropped (5):** `hero_assistance_app`, `hero_assistance_ui_wasm`, `hero_assistance_admin_ui_wasm`, `hero_assistance_ui_wasm_components`, `embed_smoke` — all dropped in Phase A (s2-016). ## Acceptance criteria Per `hero_service_refactor` §Acceptance: - [x] `lab infocheck` exits 0 with `4 crate(s) clean, 0 crate(s) with issues, 0 finding(s) total` (4 binary crates; 2 lib crates not scanned by infocheck) - [x] No `crates/hero_assistance_app/` / `_ui_wasm/` / `_admin_ui_wasm/` / `_ui_wasm_components/` / `embed_smoke/` directories - [x] No workspace `Makefile`, no `scripts/service_assistance.nu`, no `scripts/*.sh` build/install helpers (kept: `scripts/backup.sh`, `scripts/kickstart.sh`, `scripts/handoff.sh` — AI methodology infrastructure) - [x] No `dioxus*` dependency in any `Cargo.toml` (workspace or per-crate) - [x] `_admin` consumes `hero_admin_lib` for routes / middleware / socket helpers / web components - [x] `_ui` serves templates from Askama + Unpoly + SSE; no `--dist` flag - [x] `README.md` references only `lab service ...` lifecycle (PURPOSE.md absent in repo; README alone carries the canonical incantation — completed in Phase E s2-020) - [x] `lab service hero_assistance --install && lab service hero_assistance --start` runs cleanly (with the 5 real-deploy caveats now filed as fresh Forge issues — see Follow-up section above) - [x] Post-start smoke: `/health`, `/openrpc.json`, `/.well-known/heroservice.json`, JSON-RPC `system.ping` all green on `_server` socket; `/health` green on `_admin` + `_ui` sockets - [x] Router homepage at `/hero_assistance/admin/` shows the admin card - [x] 254-test baseline holds: 254 pass / 1 fail / 14 ignored (1 fail is pre-existing host-env flake, not a Phase A-E regression) - [x] Decision `D-26` filed retiring D-09 / D-17 / D-22 / D-25 atomically - [x] Decision `D-27` filed locking the SSE wire shape - [x] Workspace `cargo fmt --check` + `cargo clippy --release --workspace --all-targets -- -D warnings` both exit 0 (Phase E) ## Out of scope - **Customer SPA UX parity with the Dioxus version.** The Askama+Unpoly customer UI will *feel* different (server-rendered partials vs client-side signal reactivity). We accept this — the canonical pattern is the goal, not pixel-equivalent UX. D-26 §Why "UX cost is bounded". - **Mycelium-bound transport changes.** D-04 / D-05 / D-08 / D-20 invariants stay; this is purely a UI-rendering refactor. - **Cross-repo Phase 27 integration.** Tracked as Phase F (optional follow-up). Scoped + decoupled from the in-repo work in Phase A-E. Gated on resolution of [hero_skills#268](https://forge.ourworld.tf/lhumina_code/hero_skills/issues/268) (linux-musl-x86_64 vs linux-amd64 org-wide naming-suffix). ## References - [`hero_service_refactor`](https://forge.ourworld.tf/lhumina_code/hero_skills/src/branch/development/skills/hero/service/hero_service_refactor.md) — the canonical migration playbook - [`hero_service`](https://forge.ourworld.tf/lhumina_code/hero_service) — target shape reference - [`hero_proc`](https://forge.ourworld.tf/lhumina_code/hero_proc) — admin model reference - [`hero_cockpit`](https://forge.ourworld.tf/lhumina_code/hero_cockpit) — Askama+Unpoly customer UI reference - [`hero_skills`](https://forge.ourworld.tf/lhumina_code/hero_skills) — skill bundle (`hero_ui_dashboard`, `hero_ui_dashboard_admin`, `hero_ui_whitelists`, `hero_ui_openrpc_proxy`, `hero_ui_routes`, `web_embed`, `hero_web`) - [`home#235`](https://forge.ourworld.tf/lhumina_code/home/issues/235) — workspace critical path (this alignment is parallel/cleanup, not a Track D blocker) - Decisions: [D-26](decisions/D-26-retire-dioxus-deviation.md) (retires Dioxus deviation atomically), [D-27](decisions/D-27-sse-wire-shape-and-d20-inheritance.md) (SSE wire shape on `_ui`) ## Effort summary 5 sessions for Phase A-E (s2-016 / s2-017 / s2-018 / s2-019 / s2-020 — ✅ all closed). Phase F (cross-repo hero_skills + hero_demo integration) remains an optional follow-up; scope unchanged from the original phased plan. Signed-by: mik-tf <mik-tf@noreply.invalid>
Author
Owner

Closing — Phase E landed on development as 6b592cb (43 files +2353/-1676). Workspace pre-merge gate green: cargo fmt --check, cargo clippy --release --workspace --all-targets -- -D warnings, cargo build --workspace --release, cargo test --release --workspace --no-fail-fast (254 / 1 / 14 byte-stable with Phase D baseline), lab infocheck 4 clean / 0 findings. Every acceptance box is now ticked.

The 5 real-deploy gaps that surfaced during the s2-018 router-fronted smoke have been filed as fresh Forge issues against their owning repos (see Follow-up section in the body). None are Phase B/C regressions — all are inherited from hero_admin_lib or hero_router and were latent in the canonical-template adoption.

Phase F (cross-repo hero_skills install module + hero_demo source-repo entry + profile) remains an optional follow-up, gated on lhumina_code/hero_skills#268.

Signed-by: mik-tf mik-tf@noreply.invalid

Closing — Phase E landed on `development` as `6b592cb` (43 files +2353/-1676). Workspace pre-merge gate green: `cargo fmt --check`, `cargo clippy --release --workspace --all-targets -- -D warnings`, `cargo build --workspace --release`, `cargo test --release --workspace --no-fail-fast` (254 / 1 / 14 byte-stable with Phase D baseline), `lab infocheck` 4 clean / 0 findings. Every acceptance box is now ticked. The 5 real-deploy gaps that surfaced during the s2-018 router-fronted smoke have been filed as fresh Forge issues against their owning repos (see Follow-up section in the body). None are Phase B/C regressions — all are inherited from hero_admin_lib or hero_router and were latent in the canonical-template adoption. Phase F (cross-repo hero_skills install module + hero_demo source-repo entry + profile) remains an optional follow-up, gated on https://forge.ourworld.tf/lhumina_code/hero_skills/issues/268. Signed-by: mik-tf <mik-tf@noreply.invalid>
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_assistance#15
No description provided.