lab infocheck: canonical pattern for non-service binaries in lib workspaces (hero_lib, hero_rpc)? #258
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_skills#258
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Situation
Running
lab infocheckacross the 35 demo-set repos: 11 clean, 24 with findings (~300 total). Two of the foundational libraries fail for the same surprising reason — they contain helper/demo binaries that aren't real services.ai_archive,clients,web). These ship amain.rsbut are internal helpers, not services. Same situation as the cleanup we filed at hero_lib#139.generator,service,petstore_client,petstore_server,recipe_server). Codegen tooling + OpenRPC examples, not services.Each binary triggers the same 4 findings: missing
service.toml,service_base!(),validate_service_toml,handle_info_flag. Combined that's 39 of the ~300 findings — but it's one underlying problem, not 39.Question
What's the canonical pattern for helper / demo / codegen binaries that live in a lib workspace but aren't services?
Cargo.toml→ pure library crates. Cleanest, but loses ergonomiccargo run --bin <demo>usage.service_base!()withkind = "cmdline"+ trivialservice.toml. Satisfies the contract.[package.metadata.lab_builder] skip_info_check = true— solab infocheckandlab build's--infogate both skip non-service binaries.Related clarification
Should
lab build --repairbootstrap canonical-base wiring on wholesale-shape repos (0/Nservice_base!()coverage)? A pilot onhero_editorshowed--repairdoesn't engage on--info-gate failures, only on cargo compile errors. If by design, the path for those repos is manual orlab agent-driven sweep — just confirming.lab build+lab infocheckdriven workflow #105mik-tf referenced this issue from lhumina_research/hero_demo2026-05-18 00:10:28 +00:00
mik-tf referenced this issue from lhumina_research/hero_demo2026-05-19 14:39:37 +00:00
Decision: Option 2 (canonical
service_base!()triad +kind = "cmdline"service.toml)Applying the same canonical wiring as service binaries to non-service helper / demo / codegen bins. Locked as D-11 (workspace decision file at
decisions/D-11-non-service-bin-canonical-pattern.md).Pattern for the affected crates:
service.tomlat the crate root withkind = "cmdline",category = "tool"(orai/ui/coreas fits), no[[binaries.sockets]]/[[binaries.tcp]]blocks, optional[[env]] PATH_ROOTif the bin pulls in anyherolib_core::basepath helpers.main.rs(orsrc/bin/<name>.rs):use herolib_core::service_base;+service_base!();at module scope (canonical case), OR inlineconst SERVICE_TOML: &str = include_str!("../../service.toml");+const BUILD_NR: u64 = { ... option_env!("HERO_BUILD_NR") ... };forsrc/bin/<name>.rsshape (Lesson #20 workaround).herolib_core::base::validate_service_toml(SERVICE_TOML);as first line offn main().herolib_core::base::handle_info_flag(SERVICE_TOML);next.print_startup_banner/prepare_socketscalls —cmdlinebins don't bind sockets and shouldn't emit a startup banner.Reasoning:
hero_docs), hero_os (hero_os_app,hero_os_web), hero_voice, hero_lib_rhai (hero_do), and others. Applying the same pattern to hero_lib + hero_rpc keeps the workspace coherent.cargo run --bin <demo>keeps working for codegen (hero_rpc generator), test runners (ai_direct_test, herolib_clients opencode demo/tester), and helper CLIs (hero_lifecycle).lab infochecklib+bin false-positives are documented at #265 as cosmetic. Runtime--info --jsonroundtrip is the operational gate (per s123 hero_osis_server precedent — that closure also accepted the same false-positive class).Why not Option 1 (delete bins). Loses useful demo/codegen ergonomics. Some bins are actively used (e.g.
hero_rpc::generator::scaffoldruns codegen during build.rs in downstream repos).Why not Option 3 (opt-out metadata). Requires a lab tooling change; weakens the "every binary has
--info" contract; adds a per-crate exception surface that needs maintenance. Option 2 piggybacks on the existing canonical pattern with zero new tooling.lab build --repairclarification (from the bottom of the issue). Confirmed working as designed —--repairengages on cargo compile errors only, not on--info-gate or source-side wiring failures. For wholesale-shape (0/Nservice_base!()coverage) repos the path is manual sweep orlab agent-driven, which is what the D-10 arc has been doing.Applied in s124 to hero_lib (3 crates:
ai_archive,clients,web) and hero_rpc (5 crates:generator,hero_lifecycle,petstore_client,petstore_server,recipe_server) — see s124 squash commits + tracker update at #102#33220.Closing as decided.
s124 close
Both blocked repos are now D-11 compliant and squashed to
development:hero_lib—33b5a3fb— 3 crates / 4 bins wired (ai_archive,clients,web).hero_rpc—b1c8621— 5 crates / 5 bins wired (generator,hero_lifecycle,petstore_server,petstore_client,recipe_server).D-10 effective state: 34/35 (~97%). Only
mycelium_networkremains (manual pass, outside lab infocheck purview).Lab infocheck source-side false-positives remain on the 4 lib+bin crates (ai_archive + clients in hero_lib, generator + hero_lifecycle in hero_rpc) — accepted as cosmetic per s123 hero_osis_server precedent; runtime
--info --jsonroundtrip is the operational gate. Tracked at hero_skills#265.Closing — pattern locked at D-11, applied across both repos. Tracker #102#33220 updated with the s124 section.