Post-audit cleanup: stale src/, canonical CI, README, lints, version, inspector feature #43

Closed
opened 2026-05-20 05:56:41 +00:00 by timur · 1 comment
Owner

Context

Bundled cleanup items from the #41 §2 audit. Each is small + independent; bundled here so one agent can sweep them in one pass.

Reference snapshots: hero_proc@f0ba646, hero_service@518448c. Apply against main.

Tasks

B1 — Add canonical .forgejo/workflows/lab-publish.yaml

Copy from hero_proc/.forgejo/workflows/lab-publish.yaml verbatim. Keep existing build-linux.yaml for now per hero_proc's transition plan (it only fires on v* tags so it won't race with the push-to-main publish path).

B2 — Delete stale src/logic/ at repo root

/src/logic/{rpc.rs, rpc_generated.rs, types.rs, types_generated.rs, osis_server_generated.rs} exists at the repo root, not a workspace member, no Cargo.toml references it, and same files are duplicated under crates/hero_logic_server/src/logic/{core,server}/. Leftover from 4158f97 crate split.
git rm -r src/ from the repo root.

B4 — Update PURPOSE.md to use canonical hero_logic (not short alias logic)

PURPOSE.md says lab service logic --install etc. — change every lab service logic reference to lab service hero_logic. (Matches hero_proc/PURPOSE.md style.)

B5 — Add README.md

Minimal README pointing to PURPOSE.md + listing the lab service hero_logic lifecycle commands. Use hero_proc/README.md or hero_service/README.md as model.

B7 — Add [workspace.lints.clippy] block + clean dead code

Copy hero_proc's [workspace.lints.clippy] allow block into hero_logic/Cargo.toml. Then either remove dead code or #[allow] it: backend_online, play_detail_handler, pretty_json_or_string, rpc_call (and others — currently 8 unused-code warnings).

B8 — Set [workspace.package].version

Add version = "0.1.0" to [workspace.package]; change each crate's version = "0.1.0" to version.workspace = true.

B10 — Drop inspector feature on hero_rpc_server

crates/hero_logic_server/Cargo.toml: remove features = ["inspector"] from the hero_rpc_server dep. The admin already serves the admin UI on admin.sock with <hero-api-docs> embedded — the inspector HTML at GET / on rpc.sock is dead weight. Saves rust-embed + mime_guess deps. Verify nothing in admin proxies through it first.

Out of scope (separate issues)

  • B3 — lab SERVICE_MAP entry → hero_skills follow-up
  • B6 — hero_logic_examples crate → low priority, defer
  • §3 — OSchema upgrade → separate follow-up

Acceptance

  • cargo build --workspace clean
  • lab infocheck 0 findings
  • Single PR with all 7 cleanups, or one per item — your call (recommend bundled since they're all small)
## Context Bundled cleanup items from the [#41 §2 audit](https://forge.ourworld.tf/lhumina_code/hero_logic/issues/41#issuecomment-34474). Each is small + independent; bundled here so one agent can sweep them in one pass. Reference snapshots: `hero_proc@f0ba646`, `hero_service@518448c`. Apply against `main`. ## Tasks ### B1 — Add canonical `.forgejo/workflows/lab-publish.yaml` Copy from `hero_proc/.forgejo/workflows/lab-publish.yaml` verbatim. Keep existing `build-linux.yaml` for now per hero_proc's transition plan (it only fires on `v*` tags so it won't race with the push-to-main publish path). ### B2 — Delete stale `src/logic/` at repo root `/src/logic/{rpc.rs, rpc_generated.rs, types.rs, types_generated.rs, osis_server_generated.rs}` exists at the repo root, not a workspace member, no Cargo.toml references it, and same files are duplicated under `crates/hero_logic_server/src/logic/{core,server}/`. Leftover from `4158f97` crate split. `git rm -r src/` from the repo root. ### B4 — Update `PURPOSE.md` to use canonical `hero_logic` (not short alias `logic`) `PURPOSE.md` says `lab service logic --install` etc. — change every `lab service logic` reference to `lab service hero_logic`. (Matches `hero_proc/PURPOSE.md` style.) ### B5 — Add `README.md` Minimal README pointing to `PURPOSE.md` + listing the `lab service hero_logic` lifecycle commands. Use `hero_proc/README.md` or `hero_service/README.md` as model. ### B7 — Add `[workspace.lints.clippy]` block + clean dead code Copy `hero_proc`'s `[workspace.lints.clippy]` allow block into `hero_logic/Cargo.toml`. Then either remove dead code or `#[allow]` it: `backend_online`, `play_detail_handler`, `pretty_json_or_string`, `rpc_call` (and others — currently 8 unused-code warnings). ### B8 — Set `[workspace.package].version` Add `version = "0.1.0"` to `[workspace.package]`; change each crate's `version = "0.1.0"` to `version.workspace = true`. ### B10 — Drop `inspector` feature on `hero_rpc_server` `crates/hero_logic_server/Cargo.toml`: remove `features = ["inspector"]` from the `hero_rpc_server` dep. The admin already serves the admin UI on `admin.sock` with `<hero-api-docs>` embedded — the inspector HTML at `GET /` on rpc.sock is dead weight. Saves `rust-embed` + `mime_guess` deps. Verify nothing in admin proxies through it first. ## Out of scope (separate issues) - B3 — `lab SERVICE_MAP` entry → hero_skills follow-up - B6 — `hero_logic_examples` crate → low priority, defer - §3 — OSchema upgrade → separate follow-up ## Acceptance - `cargo build --workspace` clean - `lab infocheck` 0 findings - Single PR with all 7 cleanups, or one per item — your call (recommend bundled since they're all small)
Author
Owner

Bundled all 7 cleanups into PR #45 — branch issue-43-audit-cleanup, one commit (2f79912).

Acceptance met:

  • cargo build --workspace clean, 0 warnings
  • lab infocheck — 3 crates clean, 0 findings

Notes per item:

  • B1 — workflow copied verbatim from hero_proc.
  • B2 — git rm -r src/ removed 5 stale duplicate files (-1456 lines).
  • B4 — every lab service logiclab service hero_logic in PURPOSE.md.
  • B5 — added minimal README pointing to PURPOSE + lifecycle commands.
  • B7 — added the [workspace.lints.clippy] allow block (verbatim from hero_proc) and #[allow(dead_code)]'d the 8 staged-but-not-yet-wired symbols (instead of deleting them; they look like in-progress UI scaffolding). One extra IndexTemplate.backend_online field surfaced after silencing the cascade — also allowed.
  • B8 — [workspace.package].version = "0.1.0"; 4 crates switched to version.workspace = true.
  • B10 — features = ["inspector"] dropped. Verified nothing else in the repo references the inspector path; admin lives on admin.sock independently. rust-embed + mime_guess fall out of the server's dep tree (Cargo.lock diff).

Review + merge whenever — bundle is small (+162/-1467) and all items are independent if you'd rather cherry-pick.

Bundled all 7 cleanups into PR #45 — branch `issue-43-audit-cleanup`, one commit (`2f79912`). **Acceptance met:** - `cargo build --workspace` clean, 0 warnings - `lab infocheck` — 3 crates clean, 0 findings **Notes per item:** - B1 — workflow copied verbatim from hero_proc. - B2 — `git rm -r src/` removed 5 stale duplicate files (-1456 lines). - B4 — every `lab service logic` → `lab service hero_logic` in PURPOSE.md. - B5 — added minimal README pointing to PURPOSE + lifecycle commands. - B7 — added the `[workspace.lints.clippy]` allow block (verbatim from hero_proc) and `#[allow(dead_code)]`'d the 8 staged-but-not-yet-wired symbols (instead of deleting them; they look like in-progress UI scaffolding). One extra `IndexTemplate.backend_online` field surfaced after silencing the cascade — also allowed. - B8 — `[workspace.package].version = "0.1.0"`; 4 crates switched to `version.workspace = true`. - B10 — `features = ["inspector"]` dropped. Verified nothing else in the repo references the inspector path; admin lives on `admin.sock` independently. `rust-embed` + `mime_guess` fall out of the server's dep tree (Cargo.lock diff). Review + merge whenever — bundle is small (+162/-1467) and all items are independent if you'd rather cherry-pick.
timur closed this issue 2026-05-20 06:58:52 +00:00
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_logic#43
No description provided.