Watch
0
0
Fork
You've already forked hyperhive
0

docs/integrations, hive-c0re nix: the agent config input is the local applied mirror

forge.md said the meta flake fetches agent-configs over git+http through a
credential helper. The input is git+file://<applied> (meta.rs), and
hive-c0re's own git reads use forge::reader_token(). Fix the same claim in
the comments above the hive-c0re gitconfig and the credential helper. No
code change.
This commit is contained in:
atlas 2026-10-09 22:38:53 +02:00 • committed by mara
commit 66c1a564a4
2 changed files with 17 additions and 15 deletions

View file

@ -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-<n>.url = git+http://<forge>/agent-configs/<n>.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-<n>.url = git+file://<applied>`; 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

View file

@ -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/<n>.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