Skip to main content

Module patch

Module patch 

Source
Expand description

Typed patch / override model.

A patch replaces a registry-resolved package candidate with a local source for the duration of one Cabin invocation. The patch is local development policy — it is never serialized into published package metadata, never affects the resolver for downstream consumers, and never triggers network access.

Public syntax lives in two places:

  • the workspace-root cabin.toml’s [patch] table (root/workspace policy);
  • any .cabin/config.toml’s [patch] table (user / workspace / package / explicit policy from the config layer).

Both forms produce the same typed model. The orchestration layer in cabin merges the two and the workspace loader stitches the patched packages into the package graph.

Structs§

DeclaredPatch
One patch entry as declared in a single source file. Carries the relative source value plus the absolute path of the file that declared it so the orchestration layer can resolve any relative paths against the right base directory.
PatchManifestSettings
Workspace-root manifest’s [patch] declarations. Member manifests cannot declare patches — the workspace loader rejects them — so reading off the root is sufficient.

Enums§

PatchProvenance
Provenance label for a patch entry. Mirrors the precedence ladder Cabin walks for patch resolution and is surfaced verbatim in cabin metadata so users can audit which file supplied each active patch.
PatchSource
What a patch redirects the patched package to. Each variant pairs the PatchSourceKind with its concrete data.
PatchSourceKind
Kind of source a patch points at. Today only local paths are supported. The enum is closed: adding new source kinds is a deliberate change that requires matching parser, validator, and resolver work.
PatchValidationError
Errors produced while validating patch declarations. Wording is intentionally stable so integration tests can match substrings.