diff --git a/docs/integrations/forge.md b/docs/integrations/forge.md index faafa863..9acc6779 100644 --- a/docs/integrations/forge.md +++ b/docs/integrations/forge.md @@ -117,11 +117,13 @@ Two things live in the `agent-configs` Forgejo organization: hive-c0re pushes nothing to this org; it only reads from it. Repos stay private, so an agent can't read another agent's config. (Agents remain read-only collaborators on `core/meta`.) - hive-c0re also references this repo as the agent's **persistent meta - flake input** (`agent-.url = git+http:///agent-configs/.git`; - see [config-changes.md § Meta flake](../agent-lifecycle/config-changes.md#meta-flake)), fetching it as the `core` - user via a git credential helper that reads the live forge-core token — - so the config lives on the forge, not a hand-synced local checkout. + The agent's **persistent meta flake input** is the hive's local `applied` + mirror of this repo (`agent-.url = git+file://`; see + [config-changes.md § Meta flake](../agent-lifecycle/config-changes.md#meta-flake)), + so building never depends on the forge being reachable. hive-c0re's own git + reads of this repo, which fill the mirror, authenticate with the hive's read + token through `forge::reader_token()` (see + [How a hive reads the forge](#how-a-hive-reads-the-forge)). - The dashboard links each container's deployed config commit to this config repo on the swarm's forge (`swarm.forge.publicUrl`; `null` means no link), so operators can go straight from the SW4RM tab into diff --git a/nix/host-modules/hive-c0re/default.nix b/nix/host-modules/hive-c0re/default.nix index 9d030f95..67d0128a 100644 --- a/nix/host-modules/hive-c0re/default.nix +++ b/nix/host-modules/hive-c0re/default.nix @@ -43,12 +43,11 @@ let # (mid-path globs aren't supported, so per-agent repos can't be listed); # in practice these processes only ever touch hyperhive's own repos. # - # The agent config inputs now live on the forge - # (`git+http://${forge.domain}/agent-configs/.git`, see meta.rs render), - # so hive-core's `nix flake update` of those inputs is an authenticated - # `git+http` fetch. The `[credential]` stanza points git at the `hive-forge` - # helper below (scoped to the forge host) so the fetch authenticates as the - # forge `core` user with no token in any URL or lock. + # The agent config inputs are local `git+file` mirrors of the applied repos + # (meta.rs render), so the meta flake fetches nothing from the forge. The + # `[credential]` stanza points git at the `hive-forge` helper below, scoped + # to the forge host, for any `git+http` fetch from it as the forge `core` + # user. hive-c0re's own forge reads use `forge::reader_token()` instead. safeDirGitconfig = pkgs.writeText "hyperhive-safe-gitconfig" '' [safe] directory = * @@ -66,12 +65,13 @@ let lowSpeedTime = 30 ''; - # git credential helper for hive-core's authenticated fetches of the - # agent-config repos on the forge. Reads the live forge-core admin token + # git credential helper answering for the forge host as `core`. Reads the + # live forge-core admin token # (`/var/lib/hyperhive/forge-core-token` — paths.rs `FORGE_CORE_TOKEN`) on # every invocation, so it never holds a stale copy and survives token - # rotation. Scoped to the forge host by the `[credential]` stanza above; - # implements the git credential-helper protocol (only `get` answers). + # rotation; prints nothing where that file is absent. Scoped to the forge + # host by the `[credential]` stanza above; implements the git + # credential-helper protocol (only `get` answers). forgeCredHelper = pkgs.writeShellScriptBin "git-credential-hive-forge" '' [ "''${1:-}" = "get" ] || exit 0 if [ -r /var/lib/hyperhive/forge-core-token ]; then