[refactor] hero_skills consumers (lib.nu + service_*.nu) should read secrets from hero_proc, not $env #222
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?
Context
Session 68 (2026-05-06, hero_office Bucket C item 4 of #212) surfaced an architectural mismatch in the install-side helpers.
hero_officeis the only private non-archived repo inlhumina_code/, so its release assets 404 anonymously. To unblockservice office install --download --reseton heroci, lhumina_code/hero_skills#225 (c28ba16) wiredsvc_forge_auth_argsinnutools/modules/services/lib.nuto read$env.FORGEJO_TOKENand forward it asAuthorization: token …on the metadata + asset-download curl calls. It works mechanically — heroci smoke green — but the read happens at the wrong layer.Why this is wrong
Per the
hero_proc_secretsandhero_proc_metaskills:hero_proc secret …, not via~/.bashrcor one-shot SSHexport FOO=….The
c28ba16fix pushes the token requirement onto the operator's shell env, which is exactly what the secret store exists to eliminate. Next operator on a fresh deploy will hitfailed to query latest releaseuntil someone tells them to export the token.Same defect shape exists across
service_*.nuenv forwarders — e.g.service_office.nureadsONLYOFFICE_JWT_SECRET,CONNECTOR_EXTERNAL_URL,DEFAULT_CONTEXT,OO_UPSTREAM_BASE,HERO_SOCKET_DIRfrom$env, then upserts them into the action env record passed toproc action set. That bridges OS env → hero_proc action env, but still treats OS env as the source of truth.Scope
lib.nuhelpers —svc_forge_auth_args(added c28ba16): replace the$env.FORGEJO_TOKENread withproc secret get FORGEJO_TOKEN(using the existingclients/proc.nuSDK already imported in everyservice_*.nu). Keep$env.FORGEJO_TOKENas a documented fallback during the transition, with a deprecation note in the error hint.service_*.nuenv-forwarder blocks — every place that does($env | get -o FOO | default "")and then upserts into the action env record. Audit list (non-exhaustive, sample from one pass):service_office.nu:ONLYOFFICE_JWT_SECRET,CONNECTOR_EXTERNAL_URL,DEFAULT_CONTEXT,OO_UPSTREAM_BASE,HERO_SOCKET_DIRhero_proc secret seton each host. Document the canonical secret list (FORGEJO_TOKEN,ONLYOFFICE_JWT_SECRET, …) somewhere stable — likelyhero_demo/docs/ops/DEPLOYMENT.mdand/or ahero_skillsREADME.proc secret set FORGEJO_TOKEN <value>should be the only operator step on a fresh host before any private-repo--downloadworks. No more inlineexport …SSH dances.Sequencing
After the home#212 binary rollout completes (currently 22/29 = 76% as of session 68 close). Explicitly: finish Bucket C (4 remaining repos: planner, logic, mail, after office) and Bucket D (compute, ledger, sync, tfspores). Then this becomes the next architectural arc.
Reason for the ordering: more private repos may surface in Bucket D, and the per-host
export FORGEJO_TOKEN=…workaround is acceptable as a one-line operator step for a small number of repos. Once binary-rollout is done, this refactor consolidates the env-source convention org-wide rather than fixing it piecewise per repo.Acceptance criteria
svc_*helper inlib.nureads config-shaped values viaproc secret get, not$env.service_*.nuenv-forwarder block reads fromproc secret get, with$envremoved (or kept as a documented transition fallback with a single-release deprecation window).hero_proc secret set; documented in the deployment runbook.service office install --download --resetworks on a fresh host with onlyhero_proc secret set FORGEJO_TOKEN <value>as the operator-side prep — no~/.bashrcedits, no inline SSH exports.project_hero_office_private_repo.mdupdated to reflect the secret-store-based contract.References
lhumina_code/hero_skills@c28ba16— squash-merged commit~/.claude/skills/hero_proc_secrets/SKILL.md— secret store API~/.claude/skills/hero_proc_meta/SKILL.md— canonical META env-from-secrets rulemik-tf referenced this issue from lhumina_code/hero_demo2026-05-06 21:42:24 +00:00