docs: the agent config meta-flake input is the local applied mirror, not forge git+http
config-changes.md § Meta flake, hive-c0re nix comments and the meta.rs/exec.rs doc comments still described the declared agent-<n> input as a forge-hosted git+http repo; meta.rs renders git+file://<applied>.
This commit is contained in:
parent
66c1a564a4
commit
295e8af43a
5 changed files with 33 additions and 36 deletions
|
|
@ -235,9 +235,8 @@ pub async fn lock_update_for_rebuild(name: &str) -> Result<()> {
|
|||
let _guard = META_LOCK.lock().await;
|
||||
let dir = crate::paths::meta_root();
|
||||
let input = format!("agent-{name}");
|
||||
// Re-lock from the local applied mirror, not the persistent forge URL:
|
||||
// build exactly `applied/<n>/main` and stay reproducible when the forge
|
||||
// is unreachable.
|
||||
// Re-lock against `applied/<n>/main` explicitly, so the lock is the
|
||||
// exact applied head whatever the declared input url says.
|
||||
let applied = applied_override_url(&crate::paths::applied_dir(name));
|
||||
nix(
|
||||
&dir,
|
||||
|
|
@ -264,12 +263,12 @@ pub async fn lock_update_for_rebuild(name: &str) -> Result<()> {
|
|||
}
|
||||
|
||||
/// `--override-input` URL re-locking an agent's config input against its
|
||||
/// LOCAL applied mirror (`git+file://<applied_dir>`, current `main` head)
|
||||
/// instead of the persistent forge URL declared in the meta flake. The
|
||||
/// deploy + rebuild paths re-lock from here: the applied tree was already
|
||||
/// fast-forwarded to the reviewed head, so this builds exactly that config
|
||||
/// and stays reproducible when the forge is unreachable. No `?rev` — `main`
|
||||
/// head is the reviewed head at deploy time. Pure so it's unit-testable.
|
||||
/// LOCAL applied mirror (`git+file://<applied_dir>`, current `main` head),
|
||||
/// the same url the meta flake declares. The deploy + rebuild paths re-lock
|
||||
/// from here: the applied tree was already fast-forwarded to the reviewed
|
||||
/// head, so this builds exactly that config with no forge access. No
|
||||
/// `?rev` — `main` head is the reviewed head at deploy time. Pure so it's
|
||||
/// unit-testable.
|
||||
fn applied_override_url(applied_dir: &Path) -> String {
|
||||
format!("git+file://{}", applied_dir.display())
|
||||
}
|
||||
|
|
@ -1456,8 +1455,8 @@ mod tests {
|
|||
#[test]
|
||||
fn applied_override_url_targets_local_mirror_main_head() {
|
||||
// Deploy + rebuild re-lock against the local applied mirror's `main`
|
||||
// head (no `?rev`), never the persistent forge URL — so a rebuild
|
||||
// survives forge unreachability and builds the fast-forwarded config.
|
||||
// head (no `?rev`) — so a rebuild survives forge unreachability and
|
||||
// builds the fast-forwarded config.
|
||||
let p = Path::new("/var/lib/hyperhive/agents/iris/applied");
|
||||
let url = applied_override_url(p);
|
||||
assert_eq!(url, "git+file:///var/lib/hyperhive/agents/iris/applied");
|
||||
|
|
|
|||
Loading…
Reference in a new issue