Conversation
.#tui has been red on main since NousResearch#51639 landed /topup: ui-tui/src/app/slash/commands/topup.ts imports @hermes/shared/charge-settlement, but nix/tui.nix scoped its source to `dirs = [ "ui-tui" ]`, so esbuild could not resolve apps/shared in the build sandbox: ui-tui/src/app/slash/commands/topup.ts:1:62: ERROR: Could not resolve "@hermes/shared/charge-settlement" Root cause is structural: mkNpmPassthru's `dirs` is a hand-maintained allowlist that must mirror each package's file: deps, with nothing enforcing it. web.nix and desktop.nix had already hit this and hardcoded apps/shared; tui.nix never did. Add workspaceClosure to nix/lib.nix: it derives a member's transitive file:-dep dir closure from package.json (gathered across every dependency map), matching this file's existing single-source-of-truth topology, and point tui/web/desktop at it. The derived closure is identical to the current explicit lists for web ([web, apps/shared]) and desktop ([apps/desktop, apps/shared]); tui gains apps/shared, fixing the build. Verified: nix build .#tui .#web .#desktop. Supersedes NousResearch#67082 / NousResearch#67090, which patch only this one instance.
Related to open #67082: both repair the Nix TUI source-closure failure. This PR generalizes the dependency closure for TUI, Web, and Desktop, so it is a broader competing implementation rather than a duplicate. |
|
Thanks — the current-main premise is verified. Commit Automated hermes-sweeper review. |
Problem
.#tuihas been red onmainsince #51639 landed/topup.ui-tui/src/app/slash/commands/topup.tsimports@hermes/shared/charge-settlement, butnix/tui.nixscoped its source todirs = [ "ui-tui" ], so esbuild can't resolveapps/sharedin the build sandbox:Root cause
mkNpmPassthru'sdirsis a hand-maintained allowlist that must mirror each package'sfile:deps, with nothing enforcing it.web.nixanddesktop.nixhad already hit this and hardcodedapps/shared;tui.nixnever did — so the momenttopup.tspulled in@hermes/shared, the build broke.Fix
Add
workspaceClosuretonix/lib.nix: it derives a member's transitivefile:-dependency dir closure frompackage.json(gathered across every dependency map, so afile:dep can't slip through viaoptionalDependenciesetc.). This matches the single-source-of-truth topology the rest of the file already uses (workspaceMemberDirs,jsWorkspaceTopDirs). Pointtui/web/desktopat it.The derived closure is identical to the current explicit lists for the two packages that already worked:
dirs[web, apps/shared][web, apps/shared]✅[apps/desktop, apps/shared][apps/desktop, apps/shared]✅[ui-tui, ui-tui/packages/hermes-ink, apps/shared][ui-tui]← was brokenSo this is a no-op for
web/desktopand the fix fortui. Newfile:deps can no longer silently break the source scope.Verification
nix build .#tui .#web .#desktopall succeed; the builthermes-tuibundle now contains thecharge-settlementcode that previously failed to resolve.Supersedes #67082 / #67090, which patch only this one instance.