build agents only from internal/meta; delete the hive's local meta flake
The hive no longer renders, locks or commits a meta flake. A rebuild's MetaSync node picks the internal/meta commit and records it with the hyperhive and config pins it holds; Prebuild, Swap and Create build from it, and a head that does not pin the agent's current config fails the build naming the agent. hive-priv's meta_rev is required. Removed: meta.rs sync/lock/render, the manual-rebuild relock, the boot sweep's hyperhive bump (MetaLock), the update-meta-inputs form and its panel, MetaWindow, the hive's hyperhive_rev setting. Kept: agent_set::refresh holds what sync_agents also did (topology.json, the gateway's agent-socket map and nginx include), called from spawn, destroy, rebuild and the migration. The boot reconcile and the stale-start upgrade compare the agent's marker with the hyperhive pin of internal/meta; the dashboard's deployed chip reads the config marker a successful build writes.
This commit is contained in:
parent
cea4827918
commit
4aa11b3a94
1 changed files with 1042 additions and 3793 deletions
|
|
@ -187,44 +187,6 @@ pub async fn git_rev_parse(dir: &Path, refname: &str) -> Result<String> {
|
|||
Ok(String::from_utf8_lossy(&out.stdout).trim().to_owned())
|
||||
}
|
||||
|
||||
/// The contents of `path` at commit `rev` in `dir`, `None` when `rev` has no
|
||||
/// such file. Reads the object database, not the working tree.
|
||||
pub async fn git_show_file(dir: &Path, rev: &str, path: &str) -> Result<Option<String>> {
|
||||
let spec = format!("{rev}:{path}");
|
||||
let listed = run_with_deadline(
|
||||
git_command()
|
||||
.current_dir(dir)
|
||||
.args(["ls-tree", "--name-only", rev, "--", path]),
|
||||
GIT_LOCAL_DEADLINE,
|
||||
&format!("git ls-tree {spec} in {}", dir.display()),
|
||||
)
|
||||
.await?;
|
||||
if !listed.status.success() {
|
||||
bail!(
|
||||
"git ls-tree {spec} failed ({}): {}",
|
||||
listed.status,
|
||||
String::from_utf8_lossy(&listed.stderr).trim()
|
||||
);
|
||||
}
|
||||
if listed.stdout.iter().all(u8::is_ascii_whitespace) {
|
||||
return Ok(None);
|
||||
}
|
||||
let shown = run_with_deadline(
|
||||
git_command().current_dir(dir).args(["show", &spec]),
|
||||
GIT_LOCAL_DEADLINE,
|
||||
&format!("git show {spec} in {}", dir.display()),
|
||||
)
|
||||
.await?;
|
||||
if !shown.status.success() {
|
||||
bail!(
|
||||
"git show {spec} failed ({}): {}",
|
||||
shown.status,
|
||||
String::from_utf8_lossy(&shown.stderr).trim()
|
||||
);
|
||||
}
|
||||
Ok(Some(String::from_utf8_lossy(&shown.stdout).into_owned()))
|
||||
}
|
||||
|
||||
/// Plant a lightweight tag at `target`. Errors if the tag already
|
||||
/// exists — we want loud failures on id reuse, not silent
|
||||
/// overwrites.
|
||||
|
|
@ -241,9 +203,10 @@ pub async fn git_read_tree_reset(dir: &Path, target: &str) -> Result<()> {
|
|||
git(dir, &["read-tree", "--reset", "-u", target]).await
|
||||
}
|
||||
|
||||
/// Hard-set a ref to `target`. Used to fast-forward `refs/heads/main`
|
||||
/// to the just-deployed proposal commit. Uses `update-ref`, not
|
||||
/// `branch -f`, so it works regardless of where HEAD currently sits.
|
||||
/// Hard-set a ref to `target` with `update-ref`, so it works regardless of
|
||||
/// where HEAD currently sits. Test fixtures only: production moves refs with
|
||||
/// [`git_update_ref_cas`].
|
||||
#[cfg(test)]
|
||||
pub async fn git_update_ref(dir: &Path, refname: &str, target: &str) -> Result<()> {
|
||||
git(dir, &["update-ref", refname, target]).await
|
||||
}
|
||||
|
|
@ -253,7 +216,7 @@ pub async fn git_update_ref(dir: &Path, refname: &str, target: &str) -> Result<(
|
|||
/// untouched — when the current value differs. That refusal is the whole
|
||||
/// difference between "advance this branch" and "overwrite whatever is there".
|
||||
///
|
||||
/// Prefer this over [`git_update_ref`] whenever the caller already knows the
|
||||
/// Prefer this over a plain `update-ref` whenever the caller already knows the
|
||||
/// value it believes the ref holds: a plain `update-ref` that raced another
|
||||
/// writer discards the other writer's commits without a word.
|
||||
///
|
||||
|
|
|
|||
Loading…
Reference in a new issue