OXYGENHUB

feat(api): GET /repos/{o}/{n}/diffusion, both directions with their pills (closes #153) eb2a3502601d

What a repository takes from and what it diffuses to, each pin naming its
upstream and consumer, path, bookmark, how far behind, how it follows, the
open bump and its newest run, and the pill's two halves (tone, word,
title). Typed in hub-api (Diffusion, DiffusionPin, DiffusionHalf), so the
VS Code extension's types are generated.
Author
Andy McCall @andymccall <[email protected]>
When
· 2026-10-13 13:42 UTC
Signature
✔ signed by Andy McCall
Hash
eb2a3502601df383321d8ff35397c4b0debbd2672863f1b722fdb6a617b044c7
Depends on
3f4b0ea6eabf 42fa95540468 73ef9f767132 757195ad7a5d 8620925e5c53 93be9ce4653e b5668108487f b64e2537d702 c9aacc0e7dc1 cc19697f8871 d23464c0ac60 e71583501b1d f677d6270298
Depended on by
d3b048b27277 61ecbd299f22 33bd0bd45f8a f8cf54e99879 4fa0da126b70 08e221b77658
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
14 atoms, 0 tree operations, 8 files

Browse the tree at this change

modified CHANGELOG.md +1 −0
…
4 unchanged lines
5 5
## Unreleased
6 6
7 7
- **Diffusion (#148, docs/diffusion.md).** When a repository that others pin as a subrepo moves on, each consumer that follows it gets a proposal moving the pin, signed by the hub, tested by the consumer's own pipeline, with the upstream's changes listed. One proposal per consumer and subrepo, kept up to date; never landed by itself. Turned on per repository (Settings › Diffusion, `PUT /repos/{owner}/{name}/diffusion`, or `follow` in `.oxymodules`), off by default; `green` waits for the upstream's run to pass. A repository's page shows who uses it and how far behind each is (Diffusion › Diffuses to, `GET /repos/{owner}/{name}/consumers`). Consumers are bumped on the bookmark their work lands on, learned from where their proposals land.
8 +
- **Diffusion in the API (#153):** `GET /repos/{owner}/{name}/diffusion` gives what a repository takes from and what it diffuses to, each with its pill, for the VS Code extension.
8 9
- **Tidier pages (#152).** The repository sidebar is a column of cards with shaded headings: Diffusion in one card (Takes from and Diffuses to, each with its pill), the ten most recently moved bookmarks with a link to the rest, and the hub's delegate key shown with the OxygenHub mark. The code tree has a shaded head with the latest change and the history, and folder and file icons; the site bar has icons; the Diffusion tables share one column grid; Help › Coming from GitHub covers submodules and Renovate.
9 10
- **Admin › Runners › Images (#146):** every runner image, where it is and what uses it.
10 11
- **Faster pages after a restart (#145):** bookmark summaries are kept on disk; slow requests are logged.
…
163 unchanged lines
modified crates/hub-api/src/lib.rs +50 −0
…
965 unchanged lines
966 966
    pub prerelease: bool,
967 967
}
968 968
969 +
/// `GET /repos/{o}/{n}/diffusion` (oxygenhub#153): what a repository
970 +
/// takes from (the subrepos it pins) and what it diffuses to (the
971 +
/// repositories that pin it), each as the Diffusion pages show it.
972 +
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
973 +
pub struct Diffusion {
974 +
    pub takes_from: Vec<DiffusionPin>,
975 +
    pub diffuses_to: Vec<DiffusionPin>,
976 +
}
977 +
978 +
/// One pin of an upstream by a consumer, both named `owner/name`.
979 +
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
980 +
pub struct DiffusionPin {
981 +
    pub upstream: String,
982 +
    pub consumer: String,
983 +
    /// Where the consumer pins it.
984 +
    pub path: String,
985 +
    /// The consumer's bookmark its bumps land on.
986 +
    pub bookmark: String,
987 +
    /// Upstream changes the pin lacks; absent when the hub cannot tell.
988 +
    #[serde(default)]
989 +
    pub behind: Option<u64>,
990 +
    /// `off`, `green` or `any`.
991 +
    pub follow: String,
992 +
    /// The open bump proposal's number, on the consumer.
993 +
    #[serde(default)]
994 +
    pub bump: Option<i64>,
995 +
    /// The newest run of the bump: number and status.
996 +
    #[serde(default)]
997 +
    pub run: Option<i64>,
998 +
    #[serde(default)]
999 +
    pub run_status: Option<String>,
1000 +
    /// The pill: the upstream's half, then the consumer's.
1001 +
    pub upstream_state: DiffusionHalf,
1002 +
    pub consumer_state: DiffusionHalf,
1003 +
}
1004 +
1005 +
/// One half of the Diffusion pill.
1006 +
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
1007 +
pub struct DiffusionHalf {
1008 +
    /// `green`, `amber`, `red`, `grey` or `off`.
1009 +
    pub tone: String,
1010 +
    /// What the pill says: `checked`, `untested`, `passes`, `up to date`…
1011 +
    pub word: String,
1012 +
    /// The sentence behind it.
1013 +
    pub title: String,
1014 +
}
1015 +
969 1016
/// Every type of the API, for schema generation.
970 1017
pub fn schemas() -> Vec<(&'static str, schemars::Schema)> {
971 1018
    vec![
972 1019
        ("Repository", schemars::schema_for!(Repository)),
1020 +
        ("Diffusion", schemars::schema_for!(Diffusion)),
1021 +
        ("DiffusionPin", schemars::schema_for!(DiffusionPin)),
1022 +
        ("DiffusionHalf", schemars::schema_for!(DiffusionHalf)),
973 1023
        ("Visibility", schemars::schema_for!(Visibility)),
974 1024
        ("Bookmark", schemars::schema_for!(Bookmark)),
975 1025
        ("Tag", schemars::schema_for!(Tag)),
…
283 unchanged lines
modified crates/hub-api/ts/index.d.ts +25 −0
…
13 unchanged lines
14 14
  visibility: Visibility;
15 15
};
16 16
17 +
export type DiffusionHalf = {
18 +
  title: string;
19 +
  tone: string;
20 +
  word: string;
21 +
};
22 +
23 +
export type DiffusionPin = {
24 +
  behind?: number | null;
25 +
  bookmark: string;
26 +
  bump?: number | null;
27 +
  consumer: string;
28 +
  consumer_state: DiffusionHalf;
29 +
  follow: string;
30 +
  path: string;
31 +
  run?: number | null;
32 +
  run_status?: string | null;
33 +
  upstream: string;
34 +
  upstream_state: DiffusionHalf;
35 +
};
36 +
37 +
export type Diffusion = {
38 +
  diffuses_to: DiffusionPin[];
39 +
  takes_from: DiffusionPin[];
40 +
};
41 +
17 42
export type Bookmark = {
18 43
  changes: number;
19 44
  default: boolean;
…
558 unchanged lines
modified crates/hub/src/api/mod.rs +20 −1
…
84 unchanged lines
85 85
        .route("/repos/{owner}/{name}/bookmarks", get(bookmarks))
86 86
        .route("/repos/{owner}/{name}/tags", get(tags))
87 87
        .route("/repos/{owner}/{name}/consumers", get(consumers))
88 -
        .route("/repos/{owner}/{name}/diffusion", axum::routing::put(set_diffusion))
88 +
        .route("/repos/{owner}/{name}/diffusion", get(diffusion).put(set_diffusion))
89 89
        .route("/repos/{owner}/{name}/history/{r}", get(history))
90 90
        .route("/repos/{owner}/{name}/changes/{hash}", get(change))
91 91
        .route("/repos/{owner}/{name}/tree/{r}", get(tree_root))
…
531 unchanged lines
623 623
    Ok(Json(crate::diffusion::consumers(&app, &row, c.account.as_ref()).await?))
624 624
}
625 625
626 +
/// `GET /repos/{owner}/{name}/diffusion`: what this repository takes from
627 +
/// and what it diffuses to, as its Diffusion tab shows them (#153).
628 +
async fn diffusion(
629 +
    State(app): State<Shared>,
630 +
    headers: HeaderMap,
631 +
    Path((owner, name)): Path<(String, String)>,
632 +
) -> Result<Json<hub_api::Diffusion>, ApiError> {
633 +
    let c = caller(&app, &headers).await?;
634 +
    let (_, row, _) = reach(&app, &c, &owner, &name, Access::Read).await?;
635 +
    let slug = format!("{owner}/{name}");
636 +
    let takes_from = crate::diffusion::follows(&app, &row, c.account.as_ref())
637 +
        .await
638 +
        .iter()
639 +
        .map(|(up, p)| p.api(&format!("{}/{}", up.owner, up.name)))
640 +
        .collect();
641 +
    let diffuses_to = crate::diffusion::consumers(&app, &row, c.account.as_ref()).await?.iter().map(|p| p.api(&slug)).collect();
642 +
    Ok(Json(hub_api::Diffusion { takes_from, diffuses_to }))
643 +
}
644 +
626 645
async fn tags(
627 646
    State(app): State<Shared>,
628 647
    headers: HeaderMap,
…
1835 unchanged lines
modified crates/hub/src/diffusion.rs +32 −0
…
162 unchanged lines
163 163
    pub downstream: Half,
164 164
}
165 165
166 +
impl Consumer {
167 +
    /// As the API gives it (oxygenhub#153), with its upstream's name.
168 +
    pub fn api(&self, upstream: &str) -> hub_api::DiffusionPin {
169 +
        let half = |h: &Half| hub_api::DiffusionHalf {
170 +
            tone: h.class.trim_start_matches("df-").to_string(),
171 +
            word: h.word.to_string(),
172 +
            title: h.title.clone(),
173 +
        };
174 +
        hub_api::DiffusionPin {
175 +
            upstream: upstream.to_string(),
176 +
            consumer: format!("{}/{}", self.owner, self.name),
177 +
            path: self.path.clone(),
178 +
            bookmark: self.bookmark.clone(),
179 +
            behind: self.behind.map(|n| n as u64),
180 +
            follow: self.follow.as_str().to_string(),
181 +
            bump: self.bump,
182 +
            run: self.run.as_ref().map(|r| r.0),
183 +
            run_status: self.run.as_ref().map(|r| r.1.clone()),
184 +
            upstream_state: half(&self.upstream),
185 +
            consumer_state: half(&self.downstream),
186 +
        }
187 +
    }
188 +
}
189 +
166 190
/// One half of a Diffusion pill: a colour class and a word (#150).
167 191
#[derive(Clone, Debug, PartialEq, Eq, Serialize)]
168 192
pub struct Half {
…
784 unchanged lines
953 977
            "green" => Some(Follow::Green),
954 978
            "any" => Some(Follow::Any),
955 979
            _ => None,
980 +
        }
981 +
    }
982 +
983 +
    pub fn as_str(self) -> &'static str {
984 +
        match self {
985 +
            Follow::Off => "off",
986 +
            Follow::Green => "green",
987 +
            Follow::Any => "any",
956 988
        }
957 989
    }
958 990
}
…
136 unchanged lines
modified crates/hub/tests/flow.rs +12 −0
…
3390 unchanged lines
3391 3391
    assert!(page.contains("Takes from") && page.contains("andy/api"));
3392 3392
    let (_, overview) = call(&h.app, "GET", "/andy/game", None, None).await;
3393 3393
    assert!(overview.contains("Takes from") && overview.contains(">Diffusion</a>"), "the tab and the panel");
3394 +
    // Both directions through the API (#153), as the extension reads them.
3395 +
    let (st, body) = call(&h.app, "GET", "/api/v1/repos/andy/game/diffusion", Some("site"), None).await;
3396 +
    assert_eq!(st, StatusCode::OK, "{body}");
3397 +
    let d: hub_api::Diffusion = serde_json::from_str(&body).unwrap();
3398 +
    assert!(d.diffuses_to.is_empty(), "nothing pins the game");
3399 +
    let pin = d.takes_from.first().expect("the game takes from the api");
3400 +
    assert_eq!((pin.upstream.as_str(), pin.consumer.as_str()), ("andy/api", "andy/game"));
3401 +
    assert_eq!(pin.bump, Some(p2.number));
3402 +
    assert_eq!(pin.upstream_state.tone, "green", "{body}");
3403 +
    let (_, body) = call(&h.app, "GET", "/api/v1/repos/andy/api/diffusion", Some("site"), None).await;
3404 +
    let d: hub_api::Diffusion = serde_json::from_str(&body).unwrap();
3405 +
    assert!(d.takes_from.is_empty() && d.diffuses_to.iter().any(|p| p.consumer == "andy/game"), "{body}");
3394 3406
    let (st, _) = call(&h.app, "GET", "/admin/diffusion", None, None).await;
3395 3407
    assert_eq!(st, StatusCode::NOT_FOUND, "administrators only");
3396 3408
…
148 unchanged lines
modified docs/diffusion.md +3 −2
…
47 unchanged lines
48 48
Oxygen pin in the new state: consumer, path, the upstream repository id
49 49
and the pinned heads (`diffusion_pins`). That answers "who consumes R*
50 50
API, at which state" at once. An upstream repository's page shows its
51 -
consumers on this hub ("Used by"); the API gives
52 -
`GET /repos/{owner}/{name}/consumers`.
51 +
consumers on this hub ("Diffuses to"); the API gives
52 +
`GET /repos/{owner}/{name}/consumers`, and `GET /repos/{owner}/{name}/diffusion`
53 +
gives both directions with their pills (#153).
53 54
54 55
### 4.2 Turning it on
55 56
…
174 unchanged lines
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; unknown matches, as before. 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 image while the claimant would fetch it, or 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 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 as Used by. A repository that pins, or is pinned by, another on the hub has a **Diffusion tab** (#150): Used by (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 Follows (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 never lands a proposal. 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; unknown matches, as before. 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 image while the claimant would fetch it, or 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 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 never lands a proposal. 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`.
…
231 unchanged lines