[META] Standardize Hero service architecture — template, hero_rpc alignment, framework hoist, skills #262
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#262
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?
TL;DR
The Hero ecosystem has too much divergence across service repos: different layouts, different lifecycle paths, hand-written SDKs, duplicated admin UIs, inconsistent socket conventions. This umbrella tracks the work to fix that — landing a canonical service template, aligning hero_rpc to current standards (incl. vendoring hero_rpc2 for transport+Rust client), hoisting reusable admin components into hero_website_framework, and writing the skills that let AI agents reproduce the pattern reliably.
Agents picking up any child issue: read this issue first, including the child's full comment thread. Decisions iterate in comments, not in issue bodies. The locked-decisions list below is canonical. Pull
developmenton every relevant repo before reading code — many are mid-refactor.Why this work
From team meeting (2026-05-13):
Already in
development(don't redo)Avoid reinventing — these have landed and are referenced by child issues:
<hero-api-docs>OpenRPC explorer web component (commit 630f702) — lives inhero_website_framework/crates/hero_admin_lib/static/js/api-docs.js. The meeting's #1 hoist target is already there.WorkspaceScaffolderinhero_rpc/crates/generator/src/build/scaffold.rs(1208 lines). Today's output naming is wrong (_ui,_client) and incomplete (no_admincrate, noservice.toml, ships aMakefilethat shouldn't exist). #54 is now "fix and extend" this, not "build from scratch."unix_serversurface partly cleaned —hero_rpc/crates/osis/src/rpc/server.rswas reduced by 755 lines. Some legacy file (unix_server.rs) still exists; verify its role before final cleanup.hero_admin_libalready provides standard admin routes (/health,/.well-known/heroservice.json), socket helpers, middleware, embedded assets — athero_website_framework/crates/hero_admin_lib/src/{routes,socket,middleware,assets}.rs. Build new admin features on this, not from scratch.hero_skills/skills/hero/{service,proc,ui,config,networkprotocol}/. Service skills atskills/hero/service/(file paths unchanged).The plan
Four workstreams, 9 issues (one closed):
WorkspaceScaffolderto align with current standards. Update codegen to readservice.toml(single source of truth), vendorhero_rpc2for transport + Rust-client codegen, add Python SDK target, renamecrates/service/tocrates/hero_lifecycle/to free thehero_servicename, modularize the 2653-line generator, upgradeexample/recipe_serveras the end-to-end demo.hero_admin_lib. (Alias-drop issue #5 was closed as wrong premise — see below.)hero_servicetemplate repo.Architectural decisions — locked
Settled in child-issue comment threads. Do not violate without flagging back here.
Source of truth
service.tomlis the single source of truth for a service's identity (name, binaries, sockets, deps, env). Written at scaffold time, read by codegen (OschemaBuildConfig::from_service_toml()). Codegen NEVER overwrites it..oschemafiles). OSchema is the input to codegen for types, OSIS storage, OpenRPC spec, and all SDK targets.Runtime + RPC
#[rpc(server, client)]macros.hero_rpc/crates/hero_rpc2/(copy-over, no fork relationship, no upstream PR).OsisObject,DBTyped<T>, SmartID), OpenRPC spec, JS/TS + Rhai + Python SDK targets. Python is new.X-Hero-ContextHTTP header. No per-context socket dirs anywhere — legacy mentions must be removed.X-Hero-Context,X-Hero-Claims) into a typedHeroRequestContext. Trait methods takectx: Option<HeroRequestContext>as the first arg so they work over both line and HTTP transports.Lifecycle + service identity
herolib_core::base+service_base!()macro +labtool. Thelabcrate (inhero_skills/crates/lab/) is the single tool for install/start/stop/status across all services.hero_rpc/crates/service/→hero_rpc/crates/hero_lifecycle/(package namehero_service→hero_lifecycle). Recent commits show this crate is actively developed, so rename rather than delete. Frees thehero_servicename for the template repo. (Earlier "delete" decision flipped — see #55 latest comment.)--infoflag is NOT deprecated — it prints the embeddedservice.toml(TOML or JSON). Mandatory on every binary, served byherolib_core::base::handle_info_flag.lab infocheckvalidates it.Makefile, noscripts/*.sh, noservice_<name>.nu—labhandles all lifecycle (ADR-0001). The current scaffolder generates aMakefile; that has to go.Naming (no exceptions, per
hero_service_check_fix.md)hero_<name>_serverhero_<name>_admin(never_ui; current scaffolder emits_uiand must be fixed)hero_<name>_sdk(lib crate; current scaffolder emits_clientand must be fixed)hero_<name>— only if non-trivial; bareselfstartCLIs must be removedhero_<name>_webhero_<name>_apphero_<name>_examples(currently not generated; must be added)Templating
hero_website_libuses Tera (full website framework).hero_admin_libis Axum + rust-embed, Askama-friendly. New admin components go intohero_admin_libwith Askama.Framework structure (corrected)
hero_website_framework:hero_admin_lib— admin-dashboard shared assets, middleware, routes, socket helpers. Axum + rust-embed, no Tera, no SQLite. Consumed by every service's_admincrate (hero_proc_admin,hero_osis_admin, …).hero_website_lib— full public-facing website framework with Tera, SQLite, auth, blog, docs. Only used by the framework's owndemo_websiteexample today.hero_web_template, referenced by both framework crates.Reference services
hero_proc— canonical wiring reference.hero_proc_server/src/main.rsusesservice_base!(),validate_service_toml,handle_info_flagexactly as required. Itshero_proc_adminis the model admin binary.hero_compute— workspace layout + hero_rpc OSchema dep set. (Its_servermain.rs uses an older subcommand pattern — do NOT mimic that.)hero_inspectoris out-of-date and explicitly NOT a reference.Open decisions — waiting on Timur
lab service new <subcommand>— exposinghero_rpc scaffoldas alabsubcommand. Out of scope for this batch; should be its own follow-up issue.hero_website_libmigrate its existing Tera templates to Askama, or stay hybrid? Separate follow-up issue if migration is desired.hero_<name>_sdkis the Rust crate. JS/TS, Rhai, Python: separate crates? subdirs ofsdk/? Single mono-SDK with feature flags? Needs a design comment on hero_rpc#55.Child issues
hero_rpc (4)
WorkspaceScaffolderto current standards (naming fixes, service.toml, admin crate, Python SDK, drop Makefile, examples crate).crates/service/tohero_lifecycle.generator/src/build/build.rs(refactor; public API stable).example/recipe_serverto the new end-to-end pattern.hero_website_framework (1 active + 1 closed)
hero_admin_lib(connection-status, live logs, jobs viewer, markdown viewer). OpenRPC explorer already landed.#5— CLOSED as wrong premise (two crates are intentionally separate, no alias).hero_web_template (1)
hero_skills (2)
hero_servicetemplate repo (decision B locked).Suggested execution order
Reference materials
When working on a child issue, start here:
hero_skills/skills/hero/service/:hero_service.md— startup banner,--info,--help.hero_service_toml_info.md— service.toml schema,service_base!()macro.hero_service_check_fix.md—lab infocheckcontract, naming, socket rules.herolib_baseskill —print_startup_banner,prepare_socketsAPI.hero_socketsskill —HERO_SOCKET_DIRlayout and router homepage card naming rule.hero_proc(wiring +hero_proc_adminadmin model),hero_compute(workspace layout).hero_admin_lib(admin shared),hero_website_lib(full website).hero_rpc/crates/generator/src/build/scaffold.rs.hero_skills/crates/lab/.delandtj/hero_rpc2— to be vendored.For agents picking up a child issue
git fetch && git pull --rebase origin developmenton every repo you'll touch. Don't trust prior-session memory of file sizes / structure / crate inventories.hero_skills/skills/hero/service/> reference services (hero_proc,hero_compute) > anything else.Status board
crates/service/hero_website_framework#5 — drop alias(closed, wrong premise)hero_rpc scaffold) #54generator/src/build/build.rs#56example/recipe_serverto end-to-end demo of new pattern #57hero_website_lib#4hero_admin_libalias — standardize onhero_website_lib#5hero_website_lib#4hero_servicetemplate repo (toy domain: managing Hero services) #261hero_rpc scaffold) #54Tier-1 progress (2026-05-19)
Done & pushed
generator/src/build/build.rs8a8d66df6af8ab,9d80616,8df3330<hero-logs-viewer>,<hero-jobs-viewer>,<hero-markdown-viewer>). Total 5 components inhero_admin_lib. Skill docs in progress (separate agent, hero_skills commit pending).Done locally, not yet pushed
2a05555(local)Not started
Deviations & follow-ups flagged by agents
rust_types,rust_rpc,openrpc,js,rhai,python) intobuild/emit/." In reality those emitters live incrate::generate::Generator, notbuild.rs. Agent split whatbuild.rsactually owns (bins, server-crate mods, SDK scaffolding, docs index). Per-target emission refactor needs a separate, larger follow-up issue againstGenerator— out of scope for #56's "no behaviour change" rule. To file.hero_proc_adminstill hand-rolls its API tab; should migrate to the now-canonical<hero-api-docs>component. Belongs in ahero_procissue. To file.hero_website_framework#4acceptance asks for skills athero_skills/skills/web/. The existing precedent (hero_ui_connection_status.md) lives atskills/hero/ui/. Going with the existing on-disk convention — 4 new skills (hero_ui_api_docs,hero_ui_logs_viewer,hero_ui_jobs_viewer,hero_ui_markdown_viewer) being added there. Acceptance reading: aspirational path, real convention wins.Tier-1 status board
Next steps
hero_skills2a05555.crates/service/→hero_lifecycle/, vendor hero_rpc2, Python SDK, OschemaBuildConfig reads service.toml).crate::generate::Generatorper-target emission into modules #59hero_proc_adminto<hero-api-docs>web component #108Follow-up issues filed
crate::generate::Generatorper-target emission into modules (continuation of #56; behaviour-preserving).hero_proc_admin's hand-rolled API tab to the new<hero-api-docs>component.Both are agent-ready, no decision risk, no dependency on tier-2.
Status board update
crates/service/(tier-2 in flight)<hero-api-docs>migration (new, ready to assign)hero_servicetemplate repo (tier-4; blocked on #54)#55 landed on
issue-55-codegen-alignment(review-ready)All 6 sections covered, 141 tests green, workspace clean.
from_service_tomlrecipe_server/build.rs41 → 5 lines_adminscaffold useshero_admin_libHeroUiServerhero_service→hero_lifecyclemain.rsboilerplatehero_proc_serverpattern_admin/_sdkeverywhereCross-repo branches awaiting hero_rpc PR merge
Branches
issue-55-hero-lifecycle-renamepushed on:hero_proxy,hero_osis,hero_index_ui_old,hero_compute,hero_os,hero_router,hero_voice. After the hero_rpc PR merges, a one-line sweep per repo flips the pin frombranch = "issue-55-codegen-alignment"back tobranch = "development".development_wipside-branches archived dirty state onhero_os,hero_voice,hero_foundry.Follow-up filed
hero_rpc#60 — OSchema → Rust trait methods + Python dataclass methods translators (clean rails-on, no architectural decisions left).
Updated status board
Open Timur actions
hero_skillscleanup commit2a05555(from #260 tier-1).Timur actions — done
hero_skills cleanup pushed
Commit
2a05555was sitting local since the #260 tier-1 pass. Cherry-picked onto currentorigin/development(which had since gained the 4 UI component skills from707e7a7— direct push would have nuked them) and pushed as0634d4d. Diff: 2 files changed, 9 insertions, 4 deletions.hero_rpc#55 PR merged
PR #61 — squash-merged as
cbc2821b.7 downstream
hero_lifecyclerename PRs mergedEach got a one-line pin flip (
branch = "issue-55-codegen-alignment"→branch = "development") on top of the rename branch, then a squash merge todevelopment:hero_proxy6e340c8hero_osisf66afd9hero_index_ui_old49549e9hero_computebd9684bhero_os297e4020hero_router3a22affhero_voicef0c53c5All merges HTTP 200; all branches
mergeable: Truebefore merge. No conflicts encountered.Status board
Agents dispatched in parallel against
development(now containing the merged #55 work) — they no longer need to coordinate against the feature branch.Tier-3 #54 landed on
issue-54-scaffold-extend(review-ready)Full writeup on hero_rpc#54. Single commit, ~760 LOC in
crates/generator/src/build/scaffold.rs.What landed
All six items in the META's #54 scope:
_examplescrate generationMakefile+buildenv.sh(ADR-0001)PURPOSE.mdmodelled onhero_proc/PURPOSE.md(Binary/Crate tables + Key Features + lab-only Service Management)README.mdwithlab service ...lifecycle only — nomake, no bash, no nu.gitignore.forgejo/workflows/build-linux.yamlperforge-release-workflowskill (self-contained Rust variant, ADR-0001-compatible — nobuild_lib.sh)Plus one bonus: pre-#54 the core +
_sdkcrates had nosrc/lib.rs, socargo metadataerrored beforelab infocheckcould validate anything. Added 2-line stubs that the OSchema generator enriches on first build.lab infocheckclean, zero manual editsTest impact
cargo test -p hero_rpc_generator→ 110 → 121 passed. 10 new tests against on-disk scaffold artefacts.cargo fmt --checkclean.Branch / merge order
issue-54-scaffold-extend, branched offissue-55-codegen-alignmentper the META's authority order. Merge sequence is #55 → development first, then #54 → development (or rebase #54 once #55 lands).Updated status board
Open Timur actions
hero_skillscleanup commit2a05555from #260 tier-1.3-agent round merged + cleanup
Just landed on
development0a5236d_examplescrate, drops Makefile, generates PURPOSE.md/README/CI workflow.lab infocheckclean on fresh scaffold; 121 tests pass.13dde8f#[method]async trait withHeroRequestContext. OSchema → Python@dataclass+ async SDK via UDS transport. Pythonsystem.pinground-trips e2e.3b04435hero_service_scaffold.md,hero_service_check.md,hero_service_refactor.md— full coverage for new + audit + migrate flows.Each was cherry-picked from the agent's working branch onto a clean head of
origin/development, then squash-merged (the original branches had the #55 history riding along since they branched fromissue-55-codegen-alignmentbefore its merge).Tidied up
Four issues whose work had already landed but didn't auto-close were closed with explanatory comments: hero_rpc#56, hero_proc#108, hero_website_framework#4, hero_skills#260.
Updated status board
example/recipe_server(now unblocked)hero_servicetemplate repo (now unblocked)Three of the four remaining are now ready to assign — only
hero_web_template#4needs a (re-)assignment.