OXYGENHUB

Of two runners holding a job's build cache, the fresher copy wins c2be148cfe83

Claims now say when each build cache slot last kept a disk
(oxygenflow#54). The hub keeps it with the slot, and ranking compares two
runners that both hold the job's cache by it: a copy kept at least a
minute later ranks higher, since it was built from later sources and
rebuilds less; closer than that, the image and speed decide as before.
An older runner's slot counts as held with no time. placed says how old
the copy was: "holds its build cache (kept 12 min ago)".

Tested: with both runners holding the cache, the job is held from the
one with a day-old copy and goes to the one kept a minute ago. Moves
deps/oxygenflow to the claim's cache_times.

refs andymccall/oxygenflow#54
Author
Andy McCall @andymccall <[email protected]>
When
· 2026-10-14 01:43 UTC
Signature
✔ signed by Andy McCall
Hash
c2be148cfe83dd38228a64d398fdc765983d2ec64eb741aac1ec50e83297201a
Depends on
20b8fe85888b 380996db84e5 42fa95540468 4fa0da126b70 501d8b268dd4 93501da2a162 93be9ce4653e a46d15e72101 cc19697f8871 f4d6ef418a96
Depended on by
d7050703d2f4 58cbf42447bc c65b0f0a196f
In bookmarks
api-unknown-fields cancel-landed-runs diffusion-pin-bookmark draft-ready main oh-comment-body-file proposal-list-fast
In tags
v0.5.0 v0.5.1 v0.5.2 v0.6.0 v0.6.1 v0.7.0 v0.8.0 v0.9.0 v0.9.1 v0.9.11 v0.9.15 v0.9.16 v0.9.19 v0.9.2 v0.9.20 v0.9.21 v0.9.22 v0.9.23 v0.9.24 v0.9.3 v0.9.4 v0.9.5 v0.9.6 v0.9.7 v0.9.8 v0.9.9
Edits
15 atoms, 0 tree operations, 4 files

Browse the tree at this change

modified crates/hub/src/flow.rs +63 −15
…
557 unchanged lines
558 558
        db::runners::set_facts(&app.db, me.id, f).await?;
559 559
    }
560 560
    app.swarm.claimed(me.id, req.swarm.as_ref());
561 -
    // The build caches it holds (oxygenflow#51), for placing jobs by.
561 +
    // The build caches it holds (oxygenflow#51), and when each last kept a
562 +
    // disk (oxygenflow#54; 0 from an older runner), for placing jobs by.
562 563
    if let Some(c) = &req.caches {
564 +
        let kept = |slot: &str| req.cache_times.as_ref().and_then(|t| t.get(slot)).map_or(0, |ms| *ms as i64);
563 565
        CACHES
564 566
            .lock()
565 567
            .unwrap_or_else(|p| p.into_inner())
566 568
            .get_or_insert_with(Default::default)
567 -
            .insert((app.repos.root().display().to_string(), me.id), c.iter().cloned().collect());
569 +
            .insert((app.repos.root().display().to_string(), me.id), c.iter().map(|s| (s.clone(), kept(s))).collect());
568 570
    }
569 571
    let room = fdb::Room {
570 572
        declined: fdb::declined_by(&app.db, me.id, &profile).await?,
…
40 unchanged lines
611 613
            return false;
612 614
        }
613 615
        let slot = slots.get(&j.id).map(String::as_str).unwrap_or("");
614 -
        let mine = rank(&hub_key, &me_now, &rootfs, slot);
616 +
        let mine = fit(&hub_key, &me_now, &rootfs, slot);
615 617
        let other = runners.iter().any(|r| {
616 618
            r.id != me.id
617 619
                && r.state == "active"
618 620
                && r.last_seen_ms.is_some_and(|t| now - t < POLLING_MS)
619 621
                && running.get(&r.id).copied().unwrap_or(0) < r.max_jobs.max(1)
620 -
                && rank(&hub_key, r, &rootfs, slot) > mine
622 +
                && fit(&hub_key, r, &rootfs, slot).beats(&mine)
621 623
                && runner_lacks(j, owner, *repo_id, r, &fleet, &[]).is_none()
622 624
        });
623 625
        if other {
…
15 unchanged lines
639 641
    } else {
640 642
        "fetches the image from the hub".to_string()
641 643
    }];
642 -
    if slots.get(&job.id).is_some_and(|slot| holds_cache(&hub_key, me.id, slot)) {
643 -
        why.insert(0, "holds its build cache".into());
644 +
    if let Some(kept) = slots.get(&job.id).and_then(|slot| cache_kept(&hub_key, me.id, slot)) {
645 +
        why.insert(
646 +
            0,
647 +
            if kept > 0 { format!("holds its build cache (kept {} ago)", ago(now - kept)) } else { "holds its build cache".into() },
648 +
        );
644 649
    }
645 650
    match running.get(&me.id).copied().unwrap_or(0) {
646 651
        0 => why.push("idle".into()),
…
289 unchanged lines
936 941
/// The build cache slots each runner said at its last claim it holds
937 942
/// (oxygenflow#51). Keyed by hub (tests run several in one process) and
938 943
/// runner; a restart forgets them until each runner's next claim.
939 -
type CacheSlots = std::collections::HashMap<(String, i64), std::collections::HashSet<String>>;
944 +
/// Each slot maps to when it last kept a disk (Unix ms, 0 unknown).
945 +
type CacheSlots = std::collections::HashMap<(String, i64), std::collections::HashMap<String, i64>>;
940 946
static CACHES: std::sync::Mutex<Option<CacheSlots>> = std::sync::Mutex::new(None);
941 947
942 -
fn holds_cache(hub: &str, runner: i64, slot: &str) -> bool {
948 +
/// When runner `runner` last kept a disk in build cache slot `slot` (0 when
949 +
/// it did not say); `None` when it holds none there.
950 +
fn cache_kept(hub: &str, runner: i64, slot: &str) -> Option<i64> {
943 951
    CACHES
944 952
        .lock()
945 953
        .unwrap_or_else(|p| p.into_inner())
946 954
        .as_ref()
947 955
        .and_then(|c| c.get(&(hub.to_string(), runner)))
948 -
        .is_some_and(|held| held.contains(slot))
956 +
        .and_then(|held| held.get(slot).copied())
957 +
}
958 +
959 +
/// A copy of a build cache kept at least this much later is the fresher
960 +
/// (oxygenflow#54): closer than that, the two are as good as each other.
961 +
const FRESHER_MS: i64 = 60_000;
962 +
963 +
/// How well a runner fits a job (oxygenflow#42, #51, #54).
964 +
struct Fit {
965 +
    /// When it last kept the job's build cache, if it holds it.
966 +
    cache: Option<i64>,
967 +
    image: bool,
968 +
    speed: i64,
969 +
}
970 +
971 +
impl Fit {
972 +
    /// Whether this fit is better than `other`: holding the job's build
973 +
    /// cache counts most (a warm build beats any image fetch), and of two
974 +
    /// that hold it the fresher copy; then holding the image, then speed.
975 +
    fn beats(&self, other: &Fit) -> bool {
976 +
        match (self.cache, other.cache) {
977 +
            (Some(_), None) => return true,
978 +
            (None, Some(_)) => return false,
979 +
            (Some(a), Some(b)) if a > 0 && b > 0 && (a - b).abs() >= FRESHER_MS => return a > b,
980 +
            _ => {}
981 +
        }
982 +
        (self.image, self.speed) > (other.image, other.speed)
983 +
    }
984 +
}
985 +
986 +
/// How runner `r` fits a job on image `rootfs` whose build cache slot is
987 +
/// `slot`.
988 +
fn fit(hub: &str, r: &db::runners::Runner, rootfs: &str, slot: &str) -> Fit {
989 +
    Fit {
990 +
        cache: cache_kept(hub, r.id, slot),
991 +
        image: r.image_list().is_some_and(|have| have.iter().any(|h| h == rootfs)),
992 +
        speed: r.speed_class.unwrap_or(0),
993 +
    }
949 994
}
950 995
951 -
/// How good runner `r` is for a job on image `rootfs` whose build cache
952 -
/// slot is `slot`: holding the job's build cache counts most (a warm build
953 -
/// beats any image fetch), then holding the image, then the speed class.
954 -
fn rank(hub: &str, r: &db::runners::Runner, rootfs: &str, slot: &str) -> i64 {
955 -
    let image = r.image_list().is_some_and(|have| have.iter().any(|h| h == rootfs));
956 -
    (holds_cache(hub, r.id, slot) as i64) * 100 + (image as i64) * 10 + r.speed_class.unwrap_or(0)
996 +
/// A span as people say it: 40 s, 12 min, 3 h, 2 days.
997 +
fn ago(ms: i64) -> String {
998 +
    let s = ms.max(0) / 1000;
999 +
    match s {
1000 +
        0..=59 => format!("{s} s"),
1001 +
        60..=3599 => format!("{} min", s / 60),
1002 +
        3600..=172_799 => format!("{} h", s / 3600),
1003 +
        _ => format!("{} days", s / 86_400),
1004 +
    }
957 1005
}
958 1006
959 1007
fn rootfs_of(job: &fdb::Job) -> String {
…
1018 unchanged lines
modified crates/hub/tests/flow.rs +41 −0
…
2908 unchanged lines
2909 2909
    assert!(placed.starts_with("holds its build cache, holds the image"), "{placed}");
2910 2910
}
2911 2911
2912 +
/// oxygenflow#54: when both runners hold a job's build cache, the job waits
2913 +
/// briefly for the one whose copy is fresher.
2914 +
#[tokio::test(flavor = "multi_thread")]
2915 +
async fn a_job_waits_briefly_for_the_fresher_build_cache() {
2916 +
    let h = hub().await;
2917 +
    db::accounts::create_account(&h.app.db, "andy", "[email protected]", "x", "salt", true).await.unwrap();
2918 +
    db::runners::configured(&h.app.db, &blake3::hash(b"other-secret").to_hex(), "earth-9").await.unwrap();
2919 +
    let slot = flow_core::api::cache_slot("andy/demo", "build");
2920 +
    let now = db::now_ms();
2921 +
    let ask = |kept: i64| {
2922 +
        format!(
2923 +
            r#"{{"runner":"r","runtimes":["microvm"],"images":["{ROOTFS}"],"fetches_images":true,"caches":["{slot}"],"cache_times":{{"{slot}":{kept}}},"facts":{{"speed":100,"speed_class":3,"free_disk_mib":50000}}}}"#
2924 +
        )
2925 +
    };
2926 +
    // earth-9 kept its copy a minute ago; the other runner's is a day old.
2927 +
    let fresh = ask(now - 60_000);
2928 +
    let (st, _) = call(&h.app, "POST", "/api/v1/flow/claim", Some("other-secret"), Some(fresh.clone())).await;
2929 +
    assert_eq!(st, StatusCode::NO_CONTENT);
2930 +
2931 +
    create(&h.app, "andy", "demo").await;
2932 +
    let url = format!("{}/andy/demo", h.base);
2933 +
    let work = tempfile::tempdir().unwrap();
2934 +
    let c = client(&url, work.path());
2935 +
    write(
2936 +
        work.path(),
2937 +
        ".flow/pipeline.kdl",
2938 +
        &format!("schema-version 1\nsandbox \"alpine\" {{\n    rootfs \"cas://blob/{ROOTFS}\"\n}}\njob \"build\" {{\n    sandbox \"alpine\"\n    exec \"make\"\n}}\n"),
2939 +
    );
2940 +
    c.commit("Build", &[]).unwrap();
2941 +
    assert!(c.push("origin", false).unwrap().iter().all(|r| r.ok));
2942 +
    runs_of(&h.app, "andy", "demo").await;
2943 +
2944 +
    let (st, _) = call(&h.app, "POST", "/api/v1/flow/claim", Some("runner-secret"), Some(ask(now - 86_400_000))).await;
2945 +
    assert_eq!(st, StatusCode::NO_CONTENT, "held for the fresher copy");
2946 +
    let (st, body) = call(&h.app, "POST", "/api/v1/flow/claim", Some("other-secret"), Some(fresh)).await;
2947 +
    assert_eq!(st, StatusCode::OK, "{body}");
2948 +
    let id = serde_json::from_str::<serde_json::Value>(&body).unwrap()["job_id"].as_i64().unwrap();
2949 +
    let placed = db::flow::job(&h.app.db, id).await.unwrap().unwrap().placed;
2950 +
    assert!(placed.starts_with("holds its build cache (kept 1 min ago), holds the image"), "{placed}");
2951 +
}
2952 +
2912 2953
/// oxygenhub#127 §3.3: report files expire beyond the newest 50 runs of a
2913 2954
/// report on a bookmark other than the default; the default keeps all,
2914 2955
/// and an expired report keeps its metrics.
…
1006 unchanged lines
replaced deps/oxygenflow +0 −0

No line changes.

modified docs/spec.md +1 −1
…
514 unchanged lines
515 515
  - its key is the one the runner's token first signed with. The first signed receipt under a token binds that token to its key in `flow_runner_keys`.
516 516
517 517
  Otherwise the job's result still stands, and the run page says why the receipt was not kept. The run page links each kept receipt, with its signer. The change page lists the receipts for the state whose only head is that change. `/{owner}/{name}/receipts/{attest}` downloads a signed receipt for `oxy receipt verify` or `import`.
518 -
- **Architecture** (OxygenFlow spec §11.2–§11.3, oxygenflow#36): a runner reports each image's architecture on its claims (`image_archs`), kept in `flow_images`; a job is offered only to a runner whose architecture matches its sandbox's `arch`, else its image's as known. The hub knows an image's architecture from its own files, read through its ext4 to its shell's ELF header (`jet::rootfs`) out of the kept chunks, when it is sent (the manifest's word is taken only when the image cannot be read) and, once at start, for every kept image that had none; an image nobody can read takes the architecture of the runner its first job passed on, and a runner's own report, read from the image it holds, wins over that (oxygenhub#173, Andy's "detect and learn"). Only an image nobody has read or run matches any runner. The queue says which architecture a waiting job asks for. **Images by hash** (oxygenflow#39, Jetstream): `flow rootfs push HASH` sends a rootfs image as the FastCDC chunks the hub lacks (`POST /flow/images/missing`, `PUT /flow/images/chunks/{hash}`, by a token that may write repositories) and then its manifest (`PUT /flow/images/{hash}`), which the hub accepts only when every chunk is held and they make an image with that hash; chunks are kept zstd-compressed under `<data>/images`, shared by every image, and `jet_images` lists what is held. Runners and accounts fetch with `GET /flow/images/{hash}` and `GET /flow/images/chunks/{hash}`. A runner whose claims say `fetches_images` is offered jobs whose image only the hub holds, and fetches it before its preflight. Each claim also carries the runner's `facts` (OxygenFlow spec §11.1, oxygenflow#40): free disk, load, speed score and class, kernel; the hub keeps the latest on the runner, shows them on Admin › Runners and in `GET /runners`. A job's finish carries the most disk and memory it took (`peak_disk_mib`, `peak_memory_mib`, oxygenflow#41); a new job's `need_disk_mib` is the most its last five runs of the same repository and name took, plus a quarter and 64 MiB, and it is offered only to a runner whose claim reports at least that much free disk; the waiting reason says so. **Ranking** (oxygenflow#42): a job that another free runner which polled in the last 10 s would do better (it holds the job's build cache, which counts most: claims list the caches a runner holds, `caches`, each `flow_core::api::cache_slot(repo, job)`, oxygenflow#51; or it holds the job's image while the claimant would fetch it; or it has a higher speed class) is held from the claimant for up to 15 s, then any runner that fits takes it; each job records why it ran where it did (`placed`: "holds its build cache, holds the image, idle, speed 100 (class 3)", with "after N s held for a better runner" when it was), shown on the run page, in the API and by `oh run view`. A run whose jobs pin an image held by neither the hub nor a runner sets a failing `pipeline/images` check on its state (#137), naming the images and how to send them (`flow rootfs push`), so a proposal pinning a new image shows it before it lands; a later run of the state turns it to passed once every image is held. A placement pass every 15 seconds works out why each ready queued job no runner can take waits, from what each online runner offered at its last claim (scope, tier, architecture, image held, labels, memory and CPUs, a recent decline), and shows it on the job (API `waiting`, `oh run view` and `oh run watch`, its panel open on the run page) and in its check's summary, so a proposal says why its check is stuck (#28). **Diffusion** (#148, `docs/diffusion.md`): a push that moves a repository's default bookmark, or the bookmark its work lands on (the most common target of its proposals landed in the last 90 days), records each Oxygen subrepo pin in the new state (`diffusion_pins`: consumer, bookmark, path, the upstream's Oxygen repository id, the pinned heads); a hub that had no index fills it at start. `GET /repos/{owner}/{name}/consumers` lists the consumers the caller may read, each with its pin and how many changes of this repository's default bookmark it lacks (`behind`, null when the pin names changes this repository does not hold), and the overview shows them under Diffuses to. `GET /repos/{owner}/{name}/diffusion` (#153) gives both directions, `takes_from` (each upstream the repository pins) and `diffuses_to` (each consumer the caller may read), every entry naming its `upstream` and `consumer`, its `path`, `bookmark`, `behind`, `follow`, open `bump`, the bump's newest `run` and `run_status`, and the pill's halves (`upstream_state`, `consumer_state`: `tone` green, amber, red, grey or off, `word`, `title`); hub-api's `Diffusion`. A repository that pins, or is pinned by, another on the hub has a **Diffusion tab** (#150): Diffuses to (each consumer's pin bookmark, how far behind, its status, its open bump and that bump's newest run, its last landed bump, how it follows) and Takes from (each upstream it pins, with the same); its overview shows both in brief, and Admin › Diffusion lists every upstream with its consumers. Each consumer's status is a two-half pill: the upstream on the left (checked when its newest default-bookmark run passed, untested when it has no checks, failing, or testing) and the consumer on the right (passes or fails for its run on the bump, testing, waiting, or up to date), each half coloured green, amber, red or grey; the API keeps one overall `colour` as well. Landing a proposal on the hub refreshes the pin index and propagates as a push does. A bump's run, started by the `diffusion` account, is given the upstream it bumps as a subrepo whatever that account may read (the consumer's own pin of it was committed by someone who may write the consumer); its other subrepos need read access as usual. A consumer follows a subrepo's upstream as its `.oxymodules` entry says (`follow = off | green | any`, `land = propose | auto`, `target` naming the bookmark to bump, `watch` listing paths whose upstream changes are flagged), else as its repository setting says (Settings › Diffusion, or `PUT /repos/{owner}/{name}/diffusion {"follow": ...}` by its owners and admins; migration 0058), else as `[diffusion] follow` in hub.toml says (default `off`). A **bump** moves a consumer's pin at a path to a newer upstream state: one change on the target bookmark's heads that replaces only the pin (oxy-core `build_pin_change`), signed with the hub's key, on the bookmark `diffusion/<path>`, which the hub owns and rebuilds on the target each time (a forced update). When the pin has changes the upstream's state lacks (say, from an upstream proposal not landed yet), the bump moves to both, so a consumer never loses changes it relies on; it is skipped when that combination would conflict, when the pin names changes the upstream does not hold, when the pin already holds the state, or when the bump bookmark already moves it there, and the hub logs why. A bump is **proposed** once per bump bookmark, by the hub's `diffusion` account (made on first use, never able to sign in), into the target, labelled `dependencies`, its body the upstream changes the pin lacks (newest first, linking to the upstream's change pages); a later bump edits the same open proposal. It is triggered when a push moves the upstream's default bookmark (for consumers following `any`) or when a run of that bookmark passes (for `green`). Diffusion lands a bump only where the consumer chose it (`land = auto` in the entry, else Settings › Diffusion › Landing or `PUT /repos/{owner}/{name}/diffusion {"land": "auto"}`, migration 0061; off by default, #174): once both halves are green (the upstream state it pins passed its own run, and the consumer's run on the bump as it is now passed), as the `diffusion` account through `land_as`, signed by the hub's key, so required checks, approvals and the trust policy decide; never for an unverified upstream; a refusal is noted once on the proposal's timeline. An upstream with no checks of its own (Flow off, or no run ever of its default bookmark) is **unverified**: it never turns green, so its moves also bump consumers following `green`, and those proposals are marked amber with the `upstream unverified` label and a note in the body; a later bump from a passing run removes the label. A bump already in place refreshes its proposal's text and labels. A consumer's `watch` patterns (`*` within a path segment, `**` across them, `?` one character; a plain path covers everything below it) flag the upstream changes touching a matching file: they are listed first under "Touches what you watch", with the files, and marked ⚑ in the changelog. Turning Diffusion on for a consumer (the setting or the API) catches it up at once: it is bumped to each upstream's newest state whose default-bookmark run passed, or to its newest state when it follows every move. **Images page** (#146): Admin › Runners › Images lists every rootfs image a runner holds, the hub keeps, or a job ran on in the last 90 days (from each job's sandbox), newest use first: its size and architecture, where it is (the hub, each runner holding it, each runner fetching it from the swarm now), the repositories whose jobs used it, and who sent it; an image held nowhere is marked. **The swarm** (#144, oxygenflow docs/jetstream.md §8.1): a runner in an image swarm reports its peer address, its site and the BLAKE3 of its TLS certificate with each claim (`swarm`; without a certificate it is not in the swarm), kept in memory and shown on Admin › Runners. `POST /flow/swarm/announce {image, state}` (by a runner; `fetching`, `done` or `stopped`) returns the online runners in its site that hold the image or announced fetching it in the last 45 seconds, each with its certificate's fingerprint, which the fetcher pins its TLS connection to, and a ticket signed with the hub key (JSON naming the runner, its site and an expiry 15 minutes on, hex, then the signature) that peers check against `/.well-known/oxyhub-key` before serving chunks; a runner that has not reported an address is told to add `[runner.swarm]` (409).
518 +
- **Architecture** (OxygenFlow spec §11.2–§11.3, oxygenflow#36): a runner reports each image's architecture on its claims (`image_archs`), kept in `flow_images`; a job is offered only to a runner whose architecture matches its sandbox's `arch`, else its image's as known. The hub knows an image's architecture from its own files, read through its ext4 to its shell's ELF header (`jet::rootfs`) out of the kept chunks, when it is sent (the manifest's word is taken only when the image cannot be read) and, once at start, for every kept image that had none; an image nobody can read takes the architecture of the runner its first job passed on, and a runner's own report, read from the image it holds, wins over that (oxygenhub#173, Andy's "detect and learn"). Only an image nobody has read or run matches any runner. The queue says which architecture a waiting job asks for. **Images by hash** (oxygenflow#39, Jetstream): `flow rootfs push HASH` sends a rootfs image as the FastCDC chunks the hub lacks (`POST /flow/images/missing`, `PUT /flow/images/chunks/{hash}`, by a token that may write repositories) and then its manifest (`PUT /flow/images/{hash}`), which the hub accepts only when every chunk is held and they make an image with that hash; chunks are kept zstd-compressed under `<data>/images`, shared by every image, and `jet_images` lists what is held. Runners and accounts fetch with `GET /flow/images/{hash}` and `GET /flow/images/chunks/{hash}`. A runner whose claims say `fetches_images` is offered jobs whose image only the hub holds, and fetches it before its preflight. Each claim also carries the runner's `facts` (OxygenFlow spec §11.1, oxygenflow#40): free disk, load, speed score and class, kernel; the hub keeps the latest on the runner, shows them on Admin › Runners and in `GET /runners`. A job's finish carries the most disk and memory it took (`peak_disk_mib`, `peak_memory_mib`, oxygenflow#41); a new job's `need_disk_mib` is the most its last five runs of the same repository and name took, plus a quarter and 64 MiB, and it is offered only to a runner whose claim reports at least that much free disk; the waiting reason says so. **Ranking** (oxygenflow#42): a job that another free runner which polled in the last 10 s would do better (it holds the job's build cache, which counts most: claims list the caches a runner holds, `caches`, each `flow_core::api::cache_slot(repo, job)`, oxygenflow#51, and when each last kept a disk, `cache_times`, so of two runners holding it the one whose copy was kept at least a minute later ranks higher, oxygenflow#54, and `placed` says "holds its build cache (kept 12 min ago)"; or it holds the job's image while the claimant would fetch it; or it has a higher speed class) is held from the claimant for up to 15 s, then any runner that fits takes it; each job records why it ran where it did (`placed`: "holds its build cache, holds the image, idle, speed 100 (class 3)", with "after N s held for a better runner" when it was), shown on the run page, in the API and by `oh run view`. A run whose jobs pin an image held by neither the hub nor a runner sets a failing `pipeline/images` check on its state (#137), naming the images and how to send them (`flow rootfs push`), so a proposal pinning a new image shows it before it lands; a later run of the state turns it to passed once every image is held. A placement pass every 15 seconds works out why each ready queued job no runner can take waits, from what each online runner offered at its last claim (scope, tier, architecture, image held, labels, memory and CPUs, a recent decline), and shows it on the job (API `waiting`, `oh run view` and `oh run watch`, its panel open on the run page) and in its check's summary, so a proposal says why its check is stuck (#28). **Diffusion** (#148, `docs/diffusion.md`): a push that moves a repository's default bookmark, or the bookmark its work lands on (the most common target of its proposals landed in the last 90 days), records each Oxygen subrepo pin in the new state (`diffusion_pins`: consumer, bookmark, path, the upstream's Oxygen repository id, the pinned heads); a hub that had no index fills it at start. `GET /repos/{owner}/{name}/consumers` lists the consumers the caller may read, each with its pin and how many changes of this repository's default bookmark it lacks (`behind`, null when the pin names changes this repository does not hold), and the overview shows them under Diffuses to. `GET /repos/{owner}/{name}/diffusion` (#153) gives both directions, `takes_from` (each upstream the repository pins) and `diffuses_to` (each consumer the caller may read), every entry naming its `upstream` and `consumer`, its `path`, `bookmark`, `behind`, `follow`, open `bump`, the bump's newest `run` and `run_status`, and the pill's halves (`upstream_state`, `consumer_state`: `tone` green, amber, red, grey or off, `word`, `title`); hub-api's `Diffusion`. A repository that pins, or is pinned by, another on the hub has a **Diffusion tab** (#150): Diffuses to (each consumer's pin bookmark, how far behind, its status, its open bump and that bump's newest run, its last landed bump, how it follows) and Takes from (each upstream it pins, with the same); its overview shows both in brief, and Admin › Diffusion lists every upstream with its consumers. Each consumer's status is a two-half pill: the upstream on the left (checked when its newest default-bookmark run passed, untested when it has no checks, failing, or testing) and the consumer on the right (passes or fails for its run on the bump, testing, waiting, or up to date), each half coloured green, amber, red or grey; the API keeps one overall `colour` as well. Landing a proposal on the hub refreshes the pin index and propagates as a push does. A bump's run, started by the `diffusion` account, is given the upstream it bumps as a subrepo whatever that account may read (the consumer's own pin of it was committed by someone who may write the consumer); its other subrepos need read access as usual. A consumer follows a subrepo's upstream as its `.oxymodules` entry says (`follow = off | green | any`, `land = propose | auto`, `target` naming the bookmark to bump, `watch` listing paths whose upstream changes are flagged), else as its repository setting says (Settings › Diffusion, or `PUT /repos/{owner}/{name}/diffusion {"follow": ...}` by its owners and admins; migration 0058), else as `[diffusion] follow` in hub.toml says (default `off`). A **bump** moves a consumer's pin at a path to a newer upstream state: one change on the target bookmark's heads that replaces only the pin (oxy-core `build_pin_change`), signed with the hub's key, on the bookmark `diffusion/<path>`, which the hub owns and rebuilds on the target each time (a forced update). When the pin has changes the upstream's state lacks (say, from an upstream proposal not landed yet), the bump moves to both, so a consumer never loses changes it relies on; it is skipped when that combination would conflict, when the pin names changes the upstream does not hold, when the pin already holds the state, or when the bump bookmark already moves it there, and the hub logs why. A bump is **proposed** once per bump bookmark, by the hub's `diffusion` account (made on first use, never able to sign in), into the target, labelled `dependencies`, its body the upstream changes the pin lacks (newest first, linking to the upstream's change pages); a later bump edits the same open proposal. It is triggered when a push moves the upstream's default bookmark (for consumers following `any`) or when a run of that bookmark passes (for `green`). Diffusion lands a bump only where the consumer chose it (`land = auto` in the entry, else Settings › Diffusion › Landing or `PUT /repos/{owner}/{name}/diffusion {"land": "auto"}`, migration 0061; off by default, #174): once both halves are green (the upstream state it pins passed its own run, and the consumer's run on the bump as it is now passed), as the `diffusion` account through `land_as`, signed by the hub's key, so required checks, approvals and the trust policy decide; never for an unverified upstream; a refusal is noted once on the proposal's timeline. An upstream with no checks of its own (Flow off, or no run ever of its default bookmark) is **unverified**: it never turns green, so its moves also bump consumers following `green`, and those proposals are marked amber with the `upstream unverified` label and a note in the body; a later bump from a passing run removes the label. A bump already in place refreshes its proposal's text and labels. A consumer's `watch` patterns (`*` within a path segment, `**` across them, `?` one character; a plain path covers everything below it) flag the upstream changes touching a matching file: they are listed first under "Touches what you watch", with the files, and marked ⚑ in the changelog. Turning Diffusion on for a consumer (the setting or the API) catches it up at once: it is bumped to each upstream's newest state whose default-bookmark run passed, or to its newest state when it follows every move. **Images page** (#146): Admin › Runners › Images lists every rootfs image a runner holds, the hub keeps, or a job ran on in the last 90 days (from each job's sandbox), newest use first: its size and architecture, where it is (the hub, each runner holding it, each runner fetching it from the swarm now), the repositories whose jobs used it, and who sent it; an image held nowhere is marked. **The swarm** (#144, oxygenflow docs/jetstream.md §8.1): a runner in an image swarm reports its peer address, its site and the BLAKE3 of its TLS certificate with each claim (`swarm`; without a certificate it is not in the swarm), kept in memory and shown on Admin › Runners. `POST /flow/swarm/announce {image, state}` (by a runner; `fetching`, `done` or `stopped`) returns the online runners in its site that hold the image or announced fetching it in the last 45 seconds, each with its certificate's fingerprint, which the fetcher pins its TLS connection to, and a ticket signed with the hub key (JSON naming the runner, its site and an expiry 15 minutes on, hex, then the signature) that peers check against `/.well-known/oxyhub-key` before serving chunks; a runner that has not reported an address is told to add `[runner.swarm]` (409).
519 519
- **Variables** (oxygenhub#102): Administration, an organisation's settings and a repository's settings each hold `NAME=value` pairs (a name is a letter or `_` then letters, digits and `_`, up to 64, never `FLOW_*`; a value up to 4096 characters; up to 100 per level) under **Variables**, each page showing what it inherits and which inherited names it overrides. A claim carries the repository's effective set as `env`, inner levels overriding outer; Flow puts them in the job's environment under `FLOW_*` and the pipeline's own `env`, so they are part of the receipt. They are not secrets and are shown in full to whoever sees the page; secrets are mounted by Flow (OxygenFlow spec §9), never put in the environment. Changes are audited (`flow.variable.set`, `flow.variable.deleted`); `flow run --var NAME=VALUE` gives a local run the same.
520 520
- **Secrets** (oxygenhub#107; OxygenFlow spec §9): the same three levels hold **Secrets**, named as a pipeline's `secret "name" { mount-path "/run/secrets/…" }` names them (1 to 64 of `A-Z a-z 0-9 . _ -`, a value up to 64 KiB, up to 100 per level), typed once and sealed under `keys/secrets.key`; pages show names, when each was set and where it comes from, never a value. A claim carries only the secrets its job declares, each with its path and value, from the innermost level that sets the name; one no level sets is noted at the top of the job's log and left out, so the job fails on the missing file rather than running with a stand-in. Flow writes each as a file (0400, the job's user's, on an in-memory mount) before the job starts and never puts it in the environment, the receipt or an artifact. Log intake replaces each value, and its base64, with `***` before a record is stored. Changes are audited (`flow.secret.set`, `flow.secret.deleted`), never with the value.
521 521
- **Artifacts** (OxygenFlow spec §5.2): a job may declare artifacts with `output`.
…
235 unchanged lines