fold hive-c0re module tree into the daemon binary + drop dead pub items surfaced by bin-only (#2513)

This commit is contained in:
damocles 2026-07-15 23:54:43 +02:00 committed by mara
commit 673aea4e50
15 changed files with 95 additions and 250 deletions

View file

@ -99,13 +99,6 @@ const AGENTS_ORG: &str = "agents";
/// references this team by name for the merge/approval whitelist, so the
/// rule never hardcodes a specific reviewer agent (which may not exist).
const OPERATORS_TEAM: &str = "operators";
/// Hive-managed Forgejo namespaces that agent-initiated repo creation must
/// never target. `internal` is operator-curated shared content;
/// `agent-configs` + `core` are hive-c0re-internal mirror/meta namespaces.
/// (`hyperhive` is NOT managed — it's just a repo that happens to be built
/// by this hive.) hive-c0re's create path forces [`AGENTS_ORG`], so this is
/// a defensive guard against any future caller passing an explicit owner.
const HIVE_MANAGED_NAMESPACES: &[&str] = &[SHARED_ORG, CONFIG_ORG, "core"];
/// Forgejo orgs hive-c0re ensures on startup. The meta repo lives at
/// `core/meta` (the `core` user's own namespace — no org needed).
const SEEDED_ORGS: &[&str] = &[CONFIG_ORG, SHARED_ORG, AGENTS_ORG];
@ -152,16 +145,6 @@ pub(crate) fn api(token: &str) -> Result<Forgejo> {
Forgejo::new(Auth::Token(token), url).context("build forgejo api client")
}
/// Whether `ns` is a hive-managed Forgejo namespace that agent-initiated
/// repo creation must never target — `internal` (operator-curated
/// shared content) + `agent-configs` / `core` (hive-c0re-internal). The
/// create path forces [`AGENTS_ORG`], so this guards a future surface that
/// might accept an explicit owner.
#[must_use]
pub fn is_hive_managed_namespace(ns: &str) -> bool {
HIVE_MANAGED_NAMESPACES.contains(&ns)
}
/// Per-agent forge sync: ensure the agent has a forgejo user + token,
/// a mirrored config repo, read access to `core/meta`, and the `meta`
/// remote in its proposed repo. All operations are idempotent; failures