{"record":{"id":"996c846d0ae0ab4f","repo":"astrid-runtime/astrid","slug":"offline-capsule-has-a-network-github-sourc","errorCode":null,"errorMessage":"--offline: capsule '{}' has a network/GitHub source '{}' — refusing to fetch. Use a .shuttle archive for a self-contained offline install.","messagePattern":"--offline: capsule '(.+?)' has a network/GitHub source '(.+?)' — refusing to fetch\\. Use a \\.shuttle archive for a self-contained offline install\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/init.rs","lineNumber":680,"sourceCode":"/// Whether a capsule `source` would have to touch the network to install.\n///\n/// Only GitHub-backed shapes (`@org/repo`, `github.com/…`,\n/// `https://github.com/…`) are network sources; everything else — including\n/// a relative local path like `capsules/cli.capsule` — installs straight\n/// from disk. This is the predicate the `--offline` guard rejects on, so it\n/// must NOT reject a bare relative path the way the old `starts_with('.')`\n/// /`starts_with('/')` check wrongly did.\nfn is_network_capsule_source(source: &str) -> bool {\n    astrid_capsule_install::github_source::parse_github_source(source.trim()).is_some()\n}\n\nfn refuse_offline_network_sources(selected: &[DistroCapsule], offline: bool) -> anyhow::Result<()> {\n    if !offline {\n        return Ok(());\n    }\n    for cap in selected {\n        if is_network_capsule_source(&cap.source) {\n            bail!(\n                \"--offline: capsule '{}' has a network/GitHub source '{}' — \\\n                 refusing to fetch. Use a .shuttle archive for a self-contained \\\n                 offline install.\",\n                cap.name,\n                cap.source\n            );\n        }\n    }\n    Ok(())\n}\n\n/// Install each selected capsule with a progress bar.\n///\n/// Under `offline`, a capsule whose source is GitHub-backed is a hard\n/// error — the `--offline` contract forbids any network, and a remote\n/// `@org/repo` capsule in a local `Distro.toml` would otherwise silently\n/// fetch from GitHub. A local path (relative or absolute) installs from\n/// disk and is allowed. (A fully self-contained offline install uses a","sourceCodeStart":662,"sourceCodeEnd":698,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/init.rs#L662-L698","documentation":"When --offline is passed, refuse_offline_network_sources pre-checks all selected capsules and refuses the install if any capsule's source is a network/GitHub source. Offline installs must come from self-contained .shuttle archives; the CLI refuses to fetch.","triggerScenarios":"install_capsules_with_resume called with offline=true and at least one selected DistroCapsule whose source passes is_network_capsule_source (a GitHub/network source).","commonSituations":"Running `astrid init --offline` against a GitHub-hosted distro during an outage or air-gapped environment; assuming --offline works with any distro.","solutions":["Use a .shuttle archive distro, which bundles all capsules for a self-contained offline install.","Drop --offline if network access is actually available and you want the GitHub-sourced distro.","Pre-download the capsules and repackage them into a local .shuttle archive."],"exampleFix":"// before\nastrid init @acme/distro --offline\n// after\nastrid init ./acme-distro.shuttle --offline","handlingStrategy":"validation","validationCode":"if offline && capsules.iter().any(|c| is_network_capsule_source(&c.source)) {\n    eprintln!(\"offline install requires a .shuttle archive\");\n    std::process::exit(2);\n}","typeGuard":null,"tryCatchPattern":"match refuse_offline_network_sources(&selected, offline) {\n    Ok(()) => install(),\n    Err(e) => eprintln!(\"{e:#}\"),\n}","preventionTips":["Only use --offline with .shuttle archive distros.","Pre-check capsule sources in the distro manifest before running offline.","In air-gapped environments, repackage distros as .shuttle archives ahead of time."],"tags":["offline","network","install","cli"],"backgroundTag":"network-unavailable-offline-mode","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}