CIGAR artifact installation and release
CIGAR artifact management gives Guard a safe way to identify, acquire, prepare, install, update, and recover the CIGAR SDK and its private CPython runtime. It keeps release metadata, exact bytes, runtime selection, and activation state separate so a catalog refresh or failed update cannot silently change the running system. The dashboard presents this work as a read-only version view plus explicit preparation and switch actions.
Artifact lifecycle
The lifecycle has two related artifact families: a platform CIGAR build and a private CPython build. Guard first resolves trusted metadata, then verifies the exact local files, places them in immutable installation slots, and changes the selected runtime only through a journaled switch.
flowchart LR
A[Trusted catalog] --> B[Resolve platform build and Python build]
B --> C[Verify wheels and Python archive]
C --> D[Prepare private bundles]
D --> E[Install immutable slots]
E --> F[Bind SDK to interpreter]
F --> G[Select and commit runtime]
G --> H[Health check]
H -->|failure| I[Restore last-good selection]
The selected runtime is not the same as an installed runtime. Installation prepares bytes while selection controls which verified slot CIGAR may use. This separation lets Guard install or prepare an update while CIGAR remains off. The dashboard follows the same boundary: opening Updates reads metadata, while preparation, selection, and activation need separate explicit actions.
Artifact identity
CIGAR build identity
The CIGAR build identity names one exact release build, not only an SDK version. It binds a build ID to the SDK version, core version, source revision, and release-manifest digest. A rebuild with the same version must receive a new build identity, so it cannot replace an existing installation by version alone. The platform record adds the worker digest, package-tree digest, exact SDK wheel, locked dependencies, and supported features. The dashboard shows the build ID and source facts so an engineer can distinguish builds that share a version label.
The shipped adapter profile is a separate compatibility boundary. It fixes the Guard contract, SDK API revision, worker and broker protocols, evidence schema, broker storage, and CPython major and minor version. Catalog data can describe a profile, but it cannot add a new adapter or widen that boundary.
References: rust/…/types.rs• L11-20 rust/…/types.rs• L46-60 rust/…/types.rs• L92-122 dashboard/…/versions-builds-panel.tsx• L50-65
Installation identity
An installation slot represents the complete verified byte set used by Guard. Its identity includes the release binding, exact wheel and dependency locks, package tree, native worker, and private Python identity. Changes to approval, catalog revision, feature qualification, or source wording can reuse a slot. Changes to any protected artifact bytes require a different slot.
This rule prevents an existing path from changing meaning under a stable name. It also makes an installed receipt useful across catalog refreshes without allowing that receipt to authorize a different build. The dashboard marks a matching slot as installed or in use instead of treating a version label as the runtime identity.
References: rust/…/slot.rs• L1-52 rust/…/artifact_identity.rs• L20-51 rust/…/installation.rs• L37-75 dashboard/…/versions-builds-panel.tsx• L39-70
Catalog acquisition and qualification
Catalog trust
Guard can use the catalog bundled with the signed Guard distribution or accept a signed catalog envelope from an authorized source. For an imported catalog, Guard checks the catalog schema, trusted key, signature, validity window, and monotonic checkpoint. Trusted keys come from Guard configuration rather than from the catalog itself.
Catalog trust only proves that the release metadata is authorized. It does not prove that a downloaded wheel, worker, or interpreter on the local machine matches that metadata. The dashboard can refresh a trusted feed or import signed metadata, but these actions do not install, select, or start a runtime.
References: rust/…/catalog.rs• L15-28 rust/…/catalog.rs• L38-45 rust/…/catalog.rs• L71-128 dashboard/…/versions-panel.tsx• L34-39 dashboard/…/versions-panel.tsx• L69-77
Release resolution
Release resolution selects a build ID, platform, and compatible adapter profile. It rejects withdrawn builds, unavailable platforms, missing dependency locks, unsupported profiles, and preview builds when preview use is disabled. Local candidates need explicit enrollment and cannot enter the ordinary release path.
The catalog records release features such as graph, sharing, persistence, and execution context. Activation qualification is granted only when local installation checks verify the requested features. On Windows, the resolved feature set excludes the storage features that Guard cannot safely keep open there. The dashboard presents the reason when a build is unavailable, including stale metadata, a withdrawal, a host mismatch, or an update pin.
References: rust/…/catalog.rs• L157-244 rust/…/types.rs• L23-44 integrations/…/release-catalog.v1.json• L6-20 dashboard/…/versions-builds-panel.tsx• L50-65 dashboard/…/one-click.ts• L62-83
Release preparation
Maintainer tools create draft entries from approved upstream material. The CIGAR entry process checks the upstream manifest, exact SDK wheel, dependency closure, worker metadata, and package-tree digest. The interpreter entry process checks the final CPython 3.14 archive, release metadata, archive digest, tree shape, and executable. These tools produce data for review; neither tool qualifies a release or installs code.
The catalog therefore separates upstream provenance from Guard qualification. A release may be listed as upstream-only until local checks establish that the complete feature set works on the target computer. The dashboard exposes this distinction by showing qualification and unavailable reasons rather than treating every catalog row as ready.
References: scripts/cigar_catalog_entry.py• L1-7 scripts/cigar_catalog_entry.py• L188-276 scripts/cigar_interpreter_entry.py• L1-6 scripts/cigar_interpreter_entry.py• L151-216 dashboard/…/versions-builds-panel.tsx• L53-65
Private Python bundle preparation
Locked package bundle
Guard prepares the CIGAR package bundle from the exact SDK wheel and dependency files named by the resolved platform record. It does not run a package resolver, install into system Python, build from source, or import the SDK during preparation. The result is a private file tree that matches the catalog package-tree digest.
Preparation checks each input's size and SHA-256 digest, validates wheel metadata and namespace safety, checks the dependency closure, and confirms the complete expanded tree. It writes only to a new private staging directory after all checks pass. A dashboard preparation runs beside the current installation and does not select it.
References: rust/…/lib.rs• L37-43 rust/…/lib.rs• L134-197 rust/…/wheel.rs• L47-160 dashboard/…/versions-builds-panel.tsx• L63-65 dashboard/…/one-click.ts• L200-209
Private interpreter bundle
The private interpreter bundle uses the catalog's exact CPython archive. Guard checks the compressed archive digest and size, accepts only the supported archive layout, materializes safe internal aliases, and compares the expanded tree and executable digest with the interpreter record.
The interpreter is private to the CIGAR installation. Preparation does not alter the system interpreter or start Python. A failed write leaves only staging data for the native owner to clean; it does not create an installation record. The dashboard can prepare this private Python first, or reuse a compatible registered interpreter on the host.
References: rust/…/python_bundle.rs• L9-77 rust/…/python_tar.rs• L7-135 rust/…/lib.rs• L55-130 dashboard/…/versions-builds-panel.tsx• L73-96 dashboard/…/one-click.ts• L75-83
Interpreter binding and installation slots
Interpreter binding
An interpreter binding records the immutable properties that CIGAR needs to run: build ID, Python version, platform, source revision, archive and tree digests, file and expanded-byte counts, and executable digest. The binding also identifies the platform-specific interpreter path.
Guard uses the binding when it computes the managed SDK slot. This means a change to the private standard-library tree creates a new managed slot even when the Python executable digest stays the same. The dashboard lets an operator choose a compatible registered interpreter for a build, while keeping that choice inside the preparation action rather than the normal settings draft.
References: rust/…/interpreter_binding.rs• L9-37 rust/…/interpreter_binding.rs• L40-74 rust/…/slot.rs• L39-52 dashboard/…/versions-builds-panel.tsx• L84-96
Installation receipt
After local verification, Guard records the release, profile, platform, catalog checkpoint, Guard binary digest, context digest, and verified features in an installation receipt. A local key seals the receipt for one Guard home. The seal proves that the native owner created the record and that its context is still the expected one.
The receipt is a local continuity record, not a remote catalog or activation grant. Guard still resolves the recorded identity and checks current withdrawal and artifact identity rules before using it.
References: rust/…/installation.rs• L16-27 rust/…/installation.rs• L77-127 rust/…/installation.rs• L141-184
Update preferences and runtime selection
Update preferences
Update preferences control optional update work without granting permission to activate a runtime. The modes are manual, notify, and prepare. Users can allow preview builds, pin one exact build, and retain the last-good installation for recovery. The default mode is manual with previews disabled and last-good retention enabled.
Machine policy acts as a ceiling. It can reduce update work, disallow previews, require last-good retention, or require an exact build. A missing managed pin does not clear a user's existing pin. The dashboard keeps these controls in an advanced area and labels unavailable automatic modes instead of implying that they are active.
References: rust/…/update_preferences.rs• L5-30 rust/…/update_preferences.rs• L32-87 dashboard/…/versions-panel.tsx• L51-68
Runtime selection
Runtime selection is a native commit, not a draft value in the ordinary settings form. Settings shows the current runtime and routes a change to Updates; if a draft differs from the live selection, the form offers to restore the current value rather than silently selecting an installed slot.
This separation keeps installation identity and activation state under the native versions owner. It also makes the switch boundary visible: a live switch needs reconnect acknowledgement, while an initial selection can commit with CIGAR still off.
References: dashboard/…/runtime-selection.tsx• L18-38 dashboard/…/versions-routing.test.tsx• L16-30 dashboard/…/versions-panel.tsx• L31-47
Update operations
The update interface keeps discovery, preparation, selection, and activation as separate operations. A typical update moves through these stages:
- Refresh or inspect trusted catalog metadata.
- Choose an exact build and private interpreter.
- Install or reverify both immutable slots while CIGAR remains off.
- Prepare a switch against the current service generation and settings.
- Commit the ready selection, with reconnect acknowledgement when a running runtime will be interrupted.
- Verify health before marking the target complete.
The switch record binds the operation to the generation, settings digest, source installation, target installation, and data transition. A stale page or changed preference cannot commit a preparation result for a different selection. The dashboard follows a submitted job by its stable ID, does not resend an action after an unknown result, and keeps a later Stop action from being undone by a delayed reply.
One-click setup uses the shortest safe path from native metadata. It may prepare private Python, prepare the SDK, check the selection, and start CIGAR. It reuses a compatible registered interpreter or installed slot when possible. It asks for approval when the saved preference does not already allow the start, and it finishes only after live status reports readiness.
References: src/…/context_assistance_versions_commands.py• L12-48 src/…/context_assistance_versions_commands.py• L63-84 rust/…/lifecycle.rs• L27-46 rust/…/lifecycle.rs• L122-165 dashboard/…/one-click.ts• L134-177 dashboard/…/one-click.ts• L190-257 dashboard/…/versions-panel.tsx• L31-47
Integrity checks
Artifact checks
Integrity checks cover both the declared artifact and the bytes that reach the local slot. They include:
- catalog signature, expiry, checkpoint, and schema checks;
- release identity and adapter-profile compatibility;
- exact wheel and dependency size and SHA-256 checks;
- wheel metadata, dependency closure, and package-tree checks;
- native worker digest checks;
- Python archive, expanded-tree, file-count, size, and executable checks; and
- local receipt authentication and context matching.
These checks are cumulative. A trusted catalog does not bypass local byte checks, and a valid local receipt does not bypass current identity and withdrawal checks. The dashboard describes a build as ready only from Guard-reported qualification and keeps the preparation action disabled when the native checks report a blocking reason.
References: rust/…/catalog.rs• L78-128 rust/…/lib.rs• L156-190 rust/…/python_bundle.rs• L16-71 rust/…/installation.rs• L100-127 dashboard/…/versions-builds-panel.tsx• L50-65
Identity refresh
Catalog metadata may be refreshed without replacing an installation when the protected identity remains the same. An omitted build is not treated as withdrawn, but an explicit withdrawal or a conflicting identity refuses activation. This distinction supports catalog updates while keeping immutable bytes tied to their original identity.
The dashboard can show refreshed metadata and installed receipts together. It does not turn a catalog refresh into a selection or activation.
References: rust/…/installation.rs• L47-75 rust/…/artifact_identity.rs• L43-51 dashboard/…/versions-panel.tsx• L34-39
Rollback and recovery
Switch journal
A switch journal records the source and target installations, prior enablement, data transition, reconnect state, and phase. The allowed phases move from preparation through stopping, selection, health, and completion. A failed or interrupted switch can instead enter rollback or recovery-required state.
The journal describes effects that were intended or observed. It never grants permission to start CIGAR, restore access, or reuse a stale selection. The dashboard exposes cancellation without settings proof, shows the stable job ID after an uncertain response, and keeps recovery as a separate explicit action.
References: rust/…/lifecycle.rs• L14-26 rust/…/lifecycle.rs• L75-165 dashboard/…/versions-panel.tsx• L44-50 dashboard/…/cigar-versions-browser.mjs• L191-243
Last-good selection
When a switch completes, the previous runtime becomes the last-good selection. Recovery checks current eligibility for both the target and the previous runtime before it restores either one. If the target is unhealthy or no longer eligible, Guard can restore the previous verified pair; if the facts do not identify a safe choice, it requires operator recovery.
Recovery preserves a later opt-out and does not restore enabled settings or start a process from progress records. Data generations remain tied to their selected installation so a runtime cannot use data from an unrelated slot. In Updates, rollback first prepares the last-good build and then offers a separate explicit switch; recovery keeps CIGAR off and does not restore context access.
References: rust/…/lifecycle_selection.rs• L181-218 rust/…/lifecycle_selection.rs• L245-305 rust/…/lifecycle_selection_recovery.rs• L15-65 dashboard/…/versions-builds-panel.tsx• L100-105 dashboard/…/versions-tutorial.ts• L32-35
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the release catalog, wheel locks, worker digest, and package-tree digest aligned for every supported platform.
- Keep the catalog profile contract aligned with the shipped Guard adapter and both broker and worker protocols.
- Keep the interpreter archive facts aligned with its tree and executable checks. A new Python patch build needs a new immutable identity.
- Preserve the slot identity rule when adding metadata. Do not include mutable approval or catalog fields in the physical-byte identity.
- Keep installation receipts bound to the current Guard binary and native context so catalog refreshes cannot become cross-context authority.
- Keep switch preconditions aligned with selection generation, settings digest, reconnect acknowledgement, and retained last-good data.
- Keep dashboard build actions read-only on page load. Preparation, selection, start, rollback, cancel, and recovery must remain distinct native jobs.
- Keep one-click planning aligned with registered interpreter reuse, fresh catalog requirements, managed policy, saved preferences, and the four visible setup stages.
- Keep the dashboard's stable job tracking and unknown-outcome handling aligned with the native job ID. Never turn an uncertain submit into an automatic duplicate action.
- Keep runtime changes out of the ordinary settings draft. A pending draft must not overwrite a native selection or enable a stale selection job.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Catalog signature is unknown, expired, revoked, replayed, or equivocal | Catalog import or refresh is refused | Trusted-key, time-window, and checkpoint validation |
| Build is withdrawn, preview use is disabled, or a local candidate lacks enrollment | Build cannot be prepared for normal activation | Release resolution policy |
| Wheel, dependency, worker, or package-tree bytes differ from the catalog | Bundle preparation stops before installation | Exact locks and tree digest checks |
| Python archive, tree, file count, size, or executable differs from the interpreter record | Private interpreter is not prepared | Archive and expanded-tree verification |
| Installation receipt MAC or context digest does not match | Existing installation cannot be reused | Local receipt authentication and context binding |
| Selection generation or settings changed after preparation | Commit is rejected as stale | Journal precondition checks |
| Dashboard receives an uncertain submit result | The action is not safely repeatable from the page | Stable native job ID and job refresh |
| Target fails health checks or loses eligibility during a switch | Target is not finalized | Fresh target and previous eligibility checks |
| Recovery facts identify neither a safe target nor a safe previous runtime | Automatic recovery stops | Explicit operator recovery state |
| One-click setup has unsaved settings, a busy job, or an unfinished recovery | The start action is blocked with a route to Updates | Native metadata planning and visible blocking reason |
Key files
| File | Why to read it |
|---|---|
| integrations/…/release-catalog.v1.json | Current catalog shape, platform artifact records, feature declarations, and private interpreter records |
| rust/…/catalog.rs | Catalog trust, release resolution, platform qualification, and activation boundaries |
| rust/…/types.rs | Release identity, adapter profile, wheel locks, platforms, channels, and features |
| rust/…/artifact_identity.rs | Rules for preserving or rejecting an existing artifact identity |
| scripts/cigar_catalog_entry.py | Maintainer-side CIGAR wheel and dependency provenance checks |
| scripts/cigar_interpreter_entry.py | Maintainer-side private CPython archive checks |
| rust/…/lib.rs | Locked package preparation and safe private staging |
| rust/…/python_bundle.rs | Private Python archive verification and bundle planning |
| rust/…/slot.rs | Physical installation slot identity |
| rust/…/interpreter_binding.rs | Immutable interpreter binding and slot identity |
| rust/…/installation.rs | Sealed installation receipts and catalog-refresh behavior |
| rust/…/update_preferences.rs | User update modes, preview consent, pins, and managed restrictions |
| rust/…/lifecycle.rs | Journaled switch phases, preconditions, and recovery decisions |
| rust/…/lifecycle_selection.rs | Selected and last-good runtime pairs and data generations |
| src/…/context_assistance_versions_commands.py | Operator-facing catalog, install, switch, commit, rollback, cancel, and recovery actions |
| dashboard/…/one-click.ts | Safe one-click planning, staged setup, job following, approval, and live readiness |
| dashboard/…/versions-panel.tsx | Explicit catalog refresh, preparation, selection, import, and update controls |
| dashboard/…/versions-builds-panel.tsx | Build identity, qualification reasons, interpreter choice, installation state, and rollback entry point |
| dashboard/…/runtime-selection.tsx | Separation between the current native runtime and ordinary settings drafts |
| dashboard/…/versions-tutorial.ts | User-facing update, reconnect, rollback, and recovery flow |
| dashboard/…/cigar-versions-browser.mjs | Isolated browser checks for explicit actions, stale jobs, recovery, and one-click boundaries |
Related context flows continue in Context assistance and CIGAR integration and Context assistance broker and workspace workflows.