bayesmith.artifacts
Source-derived signatures and contracts. See the reference index for coverage and conventions.
Module contract
The public inventory of the artifact protocol, and nothing heavier. :mod:`bayesmith.artifacts` is the leaf layer: nothing here imports :mod:`bayesmith.graph`, :mod:`bayesmith.dispatch`, JAX, Equinox or NumPyro at module scope, and nothing here holds a runtime object. An artifact is data -- a Graph, a callable, a compiled executable or a backend handle is represented by a reference, a fingerprint or a runtime attachment, never pickled into the artifact itself. This module is the one public surface for that protocol. Every name below is re-exported from the submodule that owns it, and each submodule's own __all__ is the single statement of what it defines -- so the identity test in tests/test_public_api.py can require that an attribute IS the owning module's object rather than settling for hasattr. The canonical codec itself (:mod:`bayesmith.artifacts._codec`) stays private: the wire format is this package's own business, and the two public entry points are dump_artifact and load_artifact. The runtime bridge is NOT here. :mod:`bayesmith.dispatch.task` is the only module that meets a Graph and a plan, and its compile_task/execute_task are the root-level entry points -- kept there rather than here because importing them pulls in JAX and NumPyro, which this layer must not.
DiagnosticPolicy
Defined in bayesmith.artifacts.policies, line 110.
class DiagnosticPolicy
enabled: bool = True
max_parameters: int = 64
max_matrix_elements: int = 200000
max_prior_parameters: int = 12
required: tuple[str, ...] = ()Bound dense preflight work; an unperformed check is never a pass. Bounds count matrix entries and parameter coordinates, not sites. Required finding codes block execution unless passed. A resolved Jeffreys assessment (flat or nonflat) also satisfies that check without changing priors.
InitializationPolicy
Defined in bayesmith.artifacts.policies, line 136.
class InitializationPolicy
values: tuple[NamedArray, ...] = ()
masks: tuple[NamedArray, ...] = ()
max_attempts: int = 32
radius: float = 2.0Complete constrained values independently per chain, before warmup. A leading ``chain`` dimension means per-chain values; otherwise values are shared. Boolean masks mark supplied entries. Missing entries are starting points, not draws claimed to follow a conditional posterior.
StoppingPolicy
Defined in bayesmith.artifacts.policies, line 190.
class StoppingPolicy
mode: str = 'fixed'
min_draws: int = 200
batch_size: int = 200
consecutive: int = 2
ess_min: float | None = None
rhat_max: float | None = None
mcse_mean: float | None = None
max_divergences: int = 0Fixed budget, or consecutive checks on a continuing warmed chain. Existing chain diagnostic thresholds always apply. Optional ESS/R-hat limits may make the criterion stricter. MCSE is an absolute standard error bound on every scalar posterior mean. Time is a soft batch cap.
ProposalBlockPolicy
Defined in bayesmith.artifacts.policies, line 30.
class ProposalBlockPolicy
names: tuple[str, ...]
method: str
steps: int = 1
iterations: int = 5
scale: float = 1.0
damping: float = 1e-06
max_parameters: int = 64
max_matrix_elements: int = 200000
mh_correction: bool = TrueAn explicit proposal block with original-target MH enabled by default. Dense proposal work has an independent budget. The automatic compiler may also instantiate policies to enlarge small moving-noise linear blocks; fixed-covariance GCR retains priority and failed enlargement keeps its plan. Disabling ``mh_correction`` applies finite, supported proposals without an MH test. Such state-dependent updates are approximate and need not correspond to any known approximate joint target.
ProposalBlockPolicy.as_options
as_options(self)Canonical scalar/tuple representation for existing task storage.
proposal_options
Defined in bayesmith.artifacts.policies, line 79.
proposal_options(*blocks: ProposalBlockPolicy)Return backend options while preserving the existing task schema. Use ``PosteriorTask(..., backend_options=proposal_options(block1, block2))``. Other backend options may be concatenated to the returned tuple.
ArtifactCodecError
Defined in bayesmith.artifacts._codec, line 67.
class ArtifactCodecError(ValueError)A value cannot be encoded, or a payload cannot be decoded, canonically.
ArtifactFile
Defined in bayesmith.artifacts._codec, line 577.
class ArtifactFile
format: Literal['bayesmith-artifact']
codec_version: Literal[1]
payload_sha256: str
payload_base64: strThe canonical JSON transport envelope (§8.2). Not the artifact, and not a second copy of its digest the artifact computes for itself: ``payload_sha256`` is the SHA-256 of the DECODED payload bytes -- exactly what ``canonical_dumps`` produced -- and ``payload_base64`` is those bytes under base64. ``load_artifact`` checks the digest before it decodes, so a corrupted payload cannot hand back a corrupted object with a freshly matching digest.
UnsupportedSchemaVersion
Defined in bayesmith.artifacts._codec, line 567.
class UnsupportedSchemaVersion(ArtifactCodecError)A stored artifact was written in a codec version this package cannot read. Raised when the envelope names a version NEWER than the one this package writes. The caller is expected to upgrade the package rather than guess at a migration, so no attempt is made to read the payload.
dump_artifact
Defined in bayesmith.artifacts._codec, line 611.
dump_artifact(artifact: object, path: str | os.PathLike[str]) -> NoneWrite ``artifact`` to ``path`` as a canonical transport envelope. The write is atomic at the filesystem level: the bytes are written to a temporary file in the same directory and moved into place with ``os.replace``, so a reader -- including one racing this write -- sees either the previous complete file or the new complete file, never a half-written one. A failure to serialise the artifact raises before any file is touched, because ``canonical_dumps`` runs first.
load_artifact
Defined in bayesmith.artifacts._codec, line 639.
load_artifact(path: str | os.PathLike[str], *, expected: type[T] | None=None) -> T | objectRead an artifact written by :func:`dump_artifact`, verifying it first. Three checks, in the order that closes the most holes first: the envelope is what it claims to be and a version this package can read; the decoded payload hashes to the digest the envelope states; and the payload decodes to the ``expected`` type. A payload byte flipped anywhere, a digest byte flipped, or a type name the registry does not know all fail here before any object is handed back.
FINGERPRINT_ALGORITHM
Defined in bayesmith.artifacts.identity, line 79.
FINGERPRINT_ALGORITHM = 'sha256-v1'FingerprintKind
Defined in bayesmith.artifacts.identity, line 86.
class FingerprintKind(StrEnum)The seven slots of plan §0.3, one per independently changeable input. Named after the slots of :class:``FingerprintBundle`` and checked against them, so a slot cannot come to hold a digest of some other kind -- a ``data`` slot holding a task digest would answer "the data changed" for a renamed solver, and answer it consistently enough to be believed.
MODEL_SOURCE = 'model_source'
GRAPH_STRUCTURE = 'graph_structure'
DATA = 'data'
TASK = 'task'
COMPILATION = 'compilation'
EVALUATION = 'evaluation'
ENVIRONMENT = 'environment'ArtifactKind
Defined in bayesmith.artifacts.identity, line 105.
class ArtifactKind(StrEnum)The rows of the §0.3 invalidation matrix: what invalidation reasons about. Four members, because the matrix has four columns and each is a distinct sensitivity: a Plan is made before compilation, a Result is made by it, an EvaluationReport is a judgement about a Result, and an Estimator is the fitted weights a heuristic posterior was trained on (§0.7). This is the INVALIDATION taxonomy and not a catalogue of artifacts -- which of the five Results a reference points at is ``ResultKind``'s business (Task 3), and asking this enum to carry that too would put five identical rows in the matrix.
PLAN = 'plan'
RESULT = 'result'
EVALUATION_REPORT = 'evaluation_report'
ESTIMATOR = 'estimator'Fingerprint
Defined in bayesmith.artifacts.identity, line 126.
class Fingerprint
kind: FingerprintKind
algorithm: str
digest: strOne slot's digest, with the kind it belongs to and the algorithm used.
FingerprintBundle
Defined in bayesmith.artifacts.identity, line 175.
class FingerprintBundle
model_source: Fingerprint
graph_structure: Fingerprint
data: Fingerprint
task: Fingerprint
compilation: Fingerprint | None = None
evaluation: Fingerprint | None = None
environment: Fingerprint | None = NoneThe seven slots of §0.3, in the order the plan lists them. The first four always exist: every artifact was made from a model, a graph, data and a task. The last three are ``None`` when they do not apply -- a Plan has no compilation digest before it is compiled, and nothing but a report has an evaluation one. ``None`` and a digest are different values, so a slot appearing or vanishing is itself a change.
FingerprintBundle.slots
slots(self) -> tuple[tuple[FingerprintKind, Fingerprint | None], ...]The bundle as (kind, fingerprint-or-None) pairs, in slot order.
ModelRef
Defined in bayesmith.artifacts.identity, line 220.
class ModelRef
identifier: str
source_digest: str | None = None
package: str | None = None
package_version: str | None = None
build_arguments: tuple[tuple[str, object], ...] = ()A stable reference to the model a graph was built from. Never the callable itself: §0 ruling 4. ``identifier`` is what a human calls the model, ``source_digest`` pins its text, and ``package``/``package_version`` pin a released model whose source is not at hand. At least one of those two pins is required, because a reference with only a name is a reference to whatever that name means today. ``build_arguments`` carries the state that would otherwise hide in a closure -- §0.3 does not promise to discover it, so a builder's arguments are part of the reference or they are lost. They are canonical values (arrays included, since a knot vector is an argument), key-unique, and sorted, so two callers who passed the same arguments in different order hold the same reference.
fingerprint
Defined in bayesmith.artifacts.identity, line 157.
fingerprint(kind: FingerprintKind, payload: object) -> FingerprintThe fingerprint of ``payload`` in slot ``kind``. What goes into ``payload`` is the §0.3 boundary for that slot, and it is the caller's to decide: this function hashes what it is handed. A payload the codec cannot encode -- a callable, an object array, an unregistered class -- raises :class:``ArtifactCodecError`` here rather than being rendered best-effort, because a best-effort digest of a callable is its address.
model_ref_from_callable
Defined in bayesmith.artifacts.identity, line 303.
model_ref_from_callable(fn: Callable[..., object], *, identifier: str, source_digest: str | None=None, package: str | None=None, package_version: str | None=None, build_arguments: tuple[tuple[str, object], ...]=()) -> ModelRefA :class:``ModelRef`` for ``fn``, digesting its source or refusing. §0.3: an automatic source digest exists only when ``inspect.getsource`` returns stable text. When it does not -- a function built by ``exec``, a builtin, a callable defined in a REPL -- the caller must supply ``source_digest``. There is no fallback, and the missing fallback is the feature: ``repr(fn)`` carries a memory address, so a digest that degraded to it would report a changed model on every restart and an unchanged one for a genuine edit that happened to reuse an address. ``package`` defaults to the top-level package of ``fn.__module__``, which is read off the function object rather than imported.
changed_fingerprints
Defined in bayesmith.artifacts.identity, line 355.
changed_fingerprints(before: FingerprintBundle, after: FingerprintBundle) -> frozenset[FingerprintKind]The slots whose fingerprint differs between two bundles. Slot by slot, including the optional ones: a compilation digest that appears where there was ``None`` is a change, and so is one that vanishes. The result is a frozenset because invalidation is a question about a SET of changed inputs -- the order they were discovered in is not part of it.
InvalidationPolicy
Defined in bayesmith.artifacts.identity, line 376.
class InvalidationPolicy
sensitivities: tuple[tuple[ArtifactKind, tuple[FingerprintKind, ...]], ...]The §0.3 matrix: which fingerprint kinds each artifact kind depends on. A table, and a table for a reason. The rule set is small enough to write as branches and exactly the kind of thing that grows an unwritten case when it is: "compilation invalidates a Result but not a Plan" and "an evaluation threshold invalidates the report but not the Result" are not related statements, and nothing but a table keeps them from being merged by somebody simplifying. Not registered with the codec: a policy is code that reads artifacts, not an artifact. What an invalidated artifact records is which inputs changed (``LifecycleRecord.changed_inputs``), which stays true whoever judged it.
InvalidationPolicy.default
default(cls) -> InvalidationPolicyThe §0.3 matrix as shipped.
InvalidationPolicy.affected
affected(self, artifact_type: ArtifactKind, changed: Iterable[FingerprintKind]) -> boolDoes an artifact of this kind stop being current, given ``changed``? ``changed`` is any iterable of :class:``FingerprintKind`` -- normally the frozenset :func:``changed_fingerprints`` returned. An empty one answers ``False`` for every artifact kind, which is the matrix's display-option row: a display option is in no slot, so nothing moved and everything is reusable.
SCHEMA_VERSION
Defined in bayesmith.artifacts.base, line 102.
SCHEMA_VERSION = 1CanonicalScalar
Defined in bayesmith.artifacts.base, line 107.
CanonicalScalar = bool | int | float | str | NoneCanonicalValue
Defined in bayesmith.artifacts.base, line 108.
CanonicalValue = CanonicalScalar | tuple['CanonicalValue', ...]canonical_scalar_options
Defined in bayesmith.artifacts.base, line 281.
canonical_scalar_options(label: str, pairs: object) -> tuple[tuple[str, CanonicalScalar], ...]Sorted, key-unique options whose values are :data:``CanonicalScalar``.
canonical_value_options
Defined in bayesmith.artifacts.base, line 288.
canonical_value_options(label: str, pairs: object) -> tuple[tuple[str, CanonicalValue], ...]Sorted, key-unique options whose values are :data:``CanonicalValue``.
utc_timestamp
Defined in bayesmith.artifacts.base, line 197.
utc_timestamp(moment: _dt.datetime | None=None) -> str``moment`` (default: now) as an RFC 3339 UTC string in the ``Z`` spelling.
NamedArray
Defined in bayesmith.artifacts.base, line 300.
class NamedArray
name: str
value: np.ndarray
dims: tuple[str, ...]The one public container for an array in an artifact (§0.5). The value is copied in and handed back read-only, and ``dims`` names one axis each. A repeated dim name is allowed on purpose: a covariance matrix is indexed by the same parameter axis twice, and refusing that would push every covariance into an unnamed array. Equality is over NAME, DIMS and BYTES rather than by ``==`` on the arrays. Element-wise comparison would make ``artifact == artifact`` raise for any array of more than one element, and byte equality is what a fingerprint already means -- which is also why two NaNs with one bit pattern compare equal here, while ``np.array_equal`` would call them different.
RunWarning
Defined in bayesmith.artifacts.base, line 375.
class RunWarning
code: str
message: str
scope: str | None = NoneSomething a run noticed and did not fail over. ``scope`` is a plain string here. Task 4 introduces the structured ``ScopeRef`` that the Refusal family uses, and borrowing it before it exists would make this module depend on a type nobody has designed yet.
ErrorRecord
Defined in bayesmith.artifacts.base, line 395.
class ErrorRecord
code: str
message: str
exception_type: str
traceback_ref: str | None = NoneA serialisable summary of a failure -- never the exception object. ``traceback_ref`` is an opaque external reference (§0.6): a traceback is not one of the three :class:``ArtifactKind`` the invalidation matrix reasons about, so it is stored beside the artifacts rather than as one.
ComputeBudget
Defined in bayesmith.artifacts.base, line 417.
class ComputeBudget
draws: int | None = None
warmup: int | None = None
chains: int | None = None
max_iterations: int | None = None
max_wall_clock_seconds: float | None = NoneWhat a run was allowed to spend. ``None`` where a count does not apply. ``None`` and ``0`` are different answers -- "this task has no such knob" against "you may take none" -- so the field is kept and left empty rather than filled with a stand-in.
SeedRecord
Defined in bayesmith.artifacts.base, line 443.
class SeedRecord
seed: int
key_algorithm: strThe entropy a run started from, and the key algorithm it was fed to.
DeviceRecord
Defined in bayesmith.artifacts.base, line 456.
class DeviceRecord
platform: str
device_kind: str
device_id: intOne device a run used, described the way a backend describes it.
BackendRef
Defined in bayesmith.artifacts.base, line 471.
class BackendRef
name: str
version: str | None = NoneThe backend that RAN, which is never the policy value ``"auto"``. A task may ask for ``"auto"`` (§0.4); a run record answering ``"auto"`` would be provenance that forgot which backend produced the numbers.
TerminationReason
Defined in bayesmith.artifacts.base, line 492.
class TerminationReason(StrEnum)Why a run stopped, which is not the same question as whether it worked.
COMPLETED = 'completed'
CONVERGED = 'converged'
BUDGET_EXHAUSTED = 'budget_exhausted'
TOLERANCE_UNMET = 'tolerance_unmet'
DIVERGED = 'diverged'
INTERRUPTED = 'interrupted'TerminationRecord
Defined in bayesmith.artifacts.base, line 505.
class TerminationRecord
reason: TerminationReason
iterations: int | None = None
message: str = ''No additional source docstring. Read the signature and owning module contract above.
TimingRecord
Defined in bayesmith.artifacts.base, line 519.
class TimingRecord
started_at: str
finished_at: str
wall_clock_seconds: float
compile_seconds: float | None = NoneWhen a run ran and how long it took. Wall clock only -- §0.3 keeps timing out of every fingerprint, so nothing here can change an identity.
ApproximationClass
Defined in bayesmith.artifacts.base, line 550.
class ApproximationClass(StrEnum)How the representation was PRODUCED (§0.2).
EXACT = 'exact'
CERTIFIED_DETERMINISTIC = 'certified_deterministic'
MONTE_CARLO = 'monte_carlo'
HEURISTIC = 'heuristic'TargetFidelity
Defined in bayesmith.artifacts.base, line 560.
class TargetFidelity(StrEnum)Whether the TARGET is the intended one, or an approximation of it.
EXACT = 'exact'
APPROXIMATE = 'approximate'ApproximationRecord
Defined in bayesmith.artifacts.base, line 569.
class ApproximationRecord
representation_class: ApproximationClass
target_fidelity: TargetFidelity
details: tuple[tuple[str, CanonicalScalar], ...] = ()Two orthogonal answers, kept apart (§0.2). iid exact-linear draws are ``MONTE_CARLO`` and ``EXACT``: sampled, but from the posterior itself. NUTS is ``MONTE_CARLO`` and, with no target approximation, also ``EXACT``; an amortized posterior is ``HEURISTIC``/``APPROXIMATE``. One enum would have to call the first case something, and every available something is a lie about one of the two axes.
ProducerRef
Defined in bayesmith.artifacts.base, line 593.
class ProducerRef
package: str
version: strThe package and version that wrote an artifact.
ArtifactStatus
Defined in bayesmith.artifacts.base, line 605.
class ArtifactStatus(StrEnum)No additional source docstring. Read the signature and owning module contract above.
CURRENT = 'current'
INVALIDATED = 'invalidated'ArtifactRef
Defined in bayesmith.artifacts.base, line 612.
class ArtifactRef
artifact_id: str
revision: int
artifact_type: ArtifactKindA reference to one VERSION of one artifact. The revision and the kind travel with the id because ``(artifact_id, revision)`` is the version identity: a reference carrying only an id would be silently satisfied by a later, invalidated revision of the same artifact, which is exactly the impersonation §0.2 rules out.
LifecycleRecord
Defined in bayesmith.artifacts.base, line 633.
class LifecycleRecord
status: ArtifactStatus
invalidated_at: str | None = None
changed_inputs: tuple[FingerprintKind, ...] = ()Current, or invalidated with the reason and the time recorded.
ArtifactMeta
Defined in bayesmith.artifacts.base, line 681.
class ArtifactMeta
artifact_type: ArtifactKind
schema_version: int
artifact_id: str
revision: int
created_at: str
producer: ProducerRef
parent_refs: tuple[ArtifactRef, ...]
fingerprints: FingerprintBundle
lifecycle: LifecycleRecord
warnings: tuple[RunWarning, ...]
summary: strThe §0.2 envelope every artifact carries.
RunRecord
Defined in bayesmith.artifacts.base, line 732.
class RunRecord
run_id: str
plan_ref: ArtifactRef
fingerprints: FingerprintBundle
seed: SeedRecord | None
dtype: str
devices: tuple[DeviceRecord, ...]
jax_config: tuple[tuple[str, CanonicalScalar], ...]
backend: BackendRef
budget: ComputeBudget
termination: TerminationRecord
timing: TimingRecord
approximation: ApproximationRecord
warnings: tuple[RunWarning, ...]
initial_values: tuple[NamedArray, ...] = ()
sampling_details: tuple[tuple[str, CanonicalValue], ...] = ()What one execution of a plan actually did (§0.2).
new_artifact_meta
Defined in bayesmith.artifacts.base, line 783.
new_artifact_meta(*, artifact_type: ArtifactKind, fingerprints: FingerprintBundle, producer: ProducerRef, summary: str='', parent_refs: tuple[ArtifactRef, ...]=(), warnings: tuple[RunWarning, ...]=(), schema_version: int=SCHEMA_VERSION, artifact_id: str | None=None, created_at: str | None=None) -> ArtifactMetaA CURRENT envelope at revision 0, with a freshly minted UUID4. ``artifact_id`` and ``created_at`` are arguments so that a caller restoring an artifact keeps its identity; left out, they are minted here. They are not derived from the content: two artifacts with identical fingerprints are still two artifacts, with separate lineage and separate verdicts.
invalidate_meta
Defined in bayesmith.artifacts.base, line 817.
invalidate_meta(meta: ArtifactMeta, *, before: FingerprintBundle, after: FingerprintBundle, policy: InvalidationPolicy, at: str | None=None) -> ArtifactMetaThe INVALIDATED copy of ``meta`` at ``revision + 1`` (§0.2, §0.3). Same ``artifact_id``, same fingerprints -- the retired revision records what it was MADE from, not what replaced it -- with the changed input kinds and the time written into its lifecycle. ``meta`` itself is untouched, because the point of a revision is that the earlier one survives. Refused, loudly, in four cases: ``before`` is not this artifact's own bundle (so the comparison would be about some other artifact), nothing changed, the policy says this artifact kind does not depend on what changed, and the artifact was already invalidated. Each of these is a caller error that would otherwise produce a plausible-looking revision recording a judgement nobody made.
TaskKind
Defined in bayesmith.artifacts.tasks, line 90.
class TaskKind(StrEnum)The five questions of §0 ruling 1, and no sixth. The kind is a member of the tagged union rather than a free string because it is what every dispatch, every gate and every result pairing branches on.
POSTERIOR = 'posterior'
EVIDENCE = 'evidence'
PREDICTIVE = 'predictive'
POINT_ESTIMATE = 'point_estimate'
SIMULATION = 'simulation'TaskMeta
Defined in bayesmith.artifacts.tasks, line 267.
class TaskMeta
task_id: str
schema_version: int
created_at: str
label: str = ''Who asked, and when. None of it is part of the task's fingerprint.
new_task_meta
Defined in bayesmith.artifacts.tasks, line 290.
new_task_meta(*, label: str='', task_id: str | None=None, created_at: str | None=None, schema_version: int=SCHEMA_VERSION) -> TaskMetaA fresh task envelope, minting the id and the time unless given them.
Estimand
Defined in bayesmith.artifacts.tasks, line 105.
class Estimand(StrEnum)Which point of the posterior a point estimate is of (§0.4). Two members, and they are not interchangeable: a posterior mean is an integral, a MAP is an argmax, and they coincide only for a symmetric unimodal posterior. A single "point estimate" with a free-text method would let the difference be lost in a string.
POSTERIOR_MEAN = 'posterior_mean'
MAP = 'map'ParameterSourceKind
Defined in bayesmith.artifacts.tasks, line 119.
class ParameterSourceKind(StrEnum)Where a simulation's parameters come from (§0.4).
PRIOR = 'prior'
FIXED = 'fixed'
POSTERIOR_RESULT = 'posterior_result'ParameterSource
Defined in bayesmith.artifacts.tasks, line 308.
class ParameterSource
kind: ParameterSourceKind
values: tuple[NamedArray, ...] = ()
posterior_ref: ArtifactRef | None = NoneWhere a simulation's parameters come from: a three-armed tagged value. Exactly one arm carries a payload, and the other two must be empty. A single class with an unconstrained pair of optional fields would admit "fixed values AND a posterior reference", which is two answers to one question -- and whichever one the executor read first would become the silent rule.
ParameterSource.prior
prior(cls) -> ParameterSourceParameterSource.fixed
fixed(cls, values: tuple[NamedArray, ...]) -> ParameterSourceParameterSource.from_posterior_result
from_posterior_result(cls, ref: ArtifactRef) -> ParameterSourcePosteriorTask
Defined in bayesmith.artifacts.tasks, line 370.
class PosteriorTask
meta: TaskMeta
backend: str = 'auto'
budget: ComputeBudget = _NO_BUDGET
chain_method: str | None = None
solver_tolerance: float | None = None
solver_maxiter: int | None = None
require_convergence: bool = True
ess_floor: float | None = None
nuts_on_collapse: bool = True
backend_options: tuple[tuple[str, CanonicalValue], ...] = ()
quality_gate: str | None = None
diagnostics: DiagnosticPolicy = dataclasses.field(default_factory=DiagnosticPolicy)
initialization: InitializationPolicy | None = dataclasses.field(default_factory=InitializationPolicy)
stopping: StoppingPolicy = dataclasses.field(default_factory=StoppingPolicy)
block_order: tuple[tuple[str, ...], ...] | None = NoneDraw, or represent, the posterior over the model's latents. ``nuts_on_collapse`` is a fallback POLICY rather than a fallback: the task says whether the caller consents to being moved onto NUTS when an exact route collapses, and the run record says whether it happened.
PosteriorTask.proposals
proposals(self) -> tuple[ProposalBlockPolicy, ...]Explicit proposal blocks encoded in the existing backend options.
EvidenceTask
Defined in bayesmith.artifacts.tasks, line 436.
class EvidenceTask
meta: TaskMeta
backend: str = 'auto'
budget: ComputeBudget = _NO_BUDGET
reconstruct_posterior: bool = False
repeat_count: int | None = None
backend_options: tuple[tuple[str, CanonicalValue], ...] = ()
quality_gate: str | None = NoneThe marginal likelihood, and whether a posterior falls out of it. ``repeat_count`` is how many independent runs the caller wants for a consistency check. ``None`` is a single run; zero is refused, because repeating a run no times is not a second spelling of running it once.
PredictiveTask
Defined in bayesmith.artifacts.tasks, line 474.
class PredictiveTask
meta: TaskMeta
source_posterior_ref: ArtifactRef
conditioning_data: Fingerprint | None = None
prediction_design: Fingerprint | None = None
conditioned_sites: tuple[str, ...] = ()
replicated_sites: tuple[str, ...] = ()
latent_sites: tuple[str, ...] = ()
budget: ComputeBudget = _NO_BUDGET
backend: str = 'auto'
backend_options: tuple[tuple[str, CanonicalValue], ...] = ()
quality_gate: str | None = NonePush an existing posterior forward onto new or replicated observations. What separates this from :class:``SimulationTask`` is stated in the fields rather than in prose (§0.4): a predictive task conditions on data, names the posterior it came from, and distinguishes the sites it replicates from the latents it carries forward. A simulation has none of those.
PointEstimateTask
Defined in bayesmith.artifacts.tasks, line 520.
class PointEstimateTask
meta: TaskMeta
estimand: Estimand
names: tuple[str, ...] | None = None
backend: str = 'auto'
budget: ComputeBudget = _NO_BUDGET
optimizer_options: tuple[tuple[str, CanonicalValue], ...] = ()
quality_gate: str | None = NoneOne point of the posterior, for named latents or for all of them. ``names=None`` is "every latent" and an empty tuple is refused: an empty request and an unrestricted one are different questions, and a field that could mean either would make the answer depend on how the caller spelled "I do not care".
SimulationTask
Defined in bayesmith.artifacts.tasks, line 553.
class SimulationTask
meta: TaskMeta
parameter_source: ParameterSource
prediction_design: Fingerprint | None = None
latent_sites: tuple[str, ...] = ()
observed_sites: tuple[str, ...] = ()
budget: ComputeBudget = _NO_BUDGET
backend: str = 'auto'
backend_options: tuple[tuple[str, CanonicalValue], ...] = ()Generate forward from a parameter source. No conditioning, no gate. §0.4 gives the other four tasks a ``quality_gate`` and this one none, and the omission is deliberate rather than an oversight to be tidied up: a simulation makes no statistical claim to check -- it produced what the model says, and whether that is a good model is what the OTHER four ask.
Task
Defined in bayesmith.artifacts.tasks, line 591.
Task = PosteriorTask | EvidenceTask | PredictiveTask | PointEstimateTask | SimulationTaskTASK_CLASSES
Defined in bayesmith.artifacts.tasks, line 596.
TASK_CLASSES: dict[TaskKind, type] = {TaskKind.POSTERIOR: PosteriorTask, TaskKind.EVIDENCE: EvidenceTask, TaskKind.PREDICTIVE: PredictiveTask, TaskKind.POINT_ESTIMATE: PointEstimateTask, TaskKind.SIMULATION: SimulationTask}task_kind
Defined in bayesmith.artifacts.tasks, line 607.
task_kind(task: Task) -> TaskKindWhich of the five ``task`` is. By exact type, not ``isinstance``: a subclass of one task carrying extra state would be reported as the base kind and executed as it, which is the quiet half of §0 ruling 4.
task_fingerprint
Defined in bayesmith.artifacts.tasks, line 623.
task_fingerprint(task: Task) -> FingerprintThe §0.3 task-slot digest of ``task``. The kind is IN the payload, so two tasks that agree field for field but ask different questions are different. ``meta`` is not: its id is minted, its time is a clock and its label is for a human, and §0.3 keeps all three out of the task slot so that renaming a task cannot invalidate a cached result.
site_names
Defined in bayesmith.artifacts.tasks, line 171.
site_names(label: str, value: object) -> tuple[str, ...]Unique, non-empty site names IN THE ORDER THEY WERE DECLARED. Not sorted: a caller reads these back and the order they wrote is the order they mean. Duplicates are refused rather than collapsed -- a repeated site would silently shorten a collection whose length a caller may be checking.
ResultKind
Defined in bayesmith.artifacts.results, line 92.
class ResultKind(StrEnum)The five answers of §0 ruling 1, one per task kind.
POSTERIOR = 'posterior'
EVIDENCE = 'evidence'
PREDICTIVE = 'predictive'
POINT_ESTIMATE = 'point_estimate'
SIMULATION = 'simulation'LogDensityAvailability
Defined in bayesmith.artifacts.results, line 103.
class LogDensityAvailability(StrEnum)How much of the log density this result can answer for (§0.5). Three levels rather than a bool, because "I can score the joint" and "I can score each observation" are different capabilities and only the second supports pointwise cross-validation.
NONE = 'none'
JOINT = 'joint'
POINTWISE = 'pointwise'UncertaintyKind
Defined in bayesmith.artifacts.results, line 117.
class UncertaintyKind(StrEnum)Which of the three an uncertainty record holds (§0.5). A covariance and a precision are inverses of one another and a standard error is neither; a single unlabelled matrix would be read as whichever the consumer expected, and would be wrong silently rather than loudly.
COVARIANCE = 'covariance'
PRECISION = 'precision'
STANDARD_ERROR = 'standard_error'UncertaintyRecord
Defined in bayesmith.artifacts.results, line 424.
class UncertaintyRecord
kind: UncertaintyKind
arrays: tuple[NamedArray, ...]A point estimate's uncertainty, labelled with what it actually is.
DrawsPosterior
Defined in bayesmith.artifacts.results, line 236.
class DrawsPosterior
draws: tuple[NamedArray, ...]
chain_shape: tuple[int, int] | None = None
method: str = ''Equally weighted draws, with the chain structure that produced them. ``chain_shape`` is ``None`` for iid draws and ``(chains, per_chain)`` for a sampler that ran chains. ``None`` is not ``(1, n)``: the first says the draws have no chain structure to diagnose, the second says a diagnostic over one chain is possible, and R-hat means different things to each.
WeightedDrawsPosterior
Defined in bayesmith.artifacts.results, line 277.
class WeightedDrawsPosterior
draws: tuple[NamedArray, ...]
log_weights: NamedArray
ess: float | None = None
khat: float | None = None
unreliable: bool = False
method: str = ''Importance-weighted draws, with the diagnostics that say whether to believe them. ``unreliable`` is a stored verdict rather than something a reader recomputes from ``khat``: the threshold that produced it belongs to the run that took it, and a consumer applying today's threshold to yesterday's khat would silently re-judge a result nobody re-ran.
AnalyticPosterior
Defined in bayesmith.artifacts.results, line 319.
class AnalyticPosterior
family: str
parameters: tuple[NamedArray, ...]
moments: tuple[NamedArray, ...] = ()A closed-form posterior: the family and its parameters, not a sample. The protocol keeps this arm for a genuinely analytic posterior and refuses the temptation to fill it from draws (§0.5). Sample moments in the ``parameters`` of a "gaussian" would be a claim of exactness that nothing took.
FittedConditionalPosterior
Defined in bayesmith.artifacts.results, line 344.
class FittedConditionalPosterior
estimator_ref: ArtifactRef
simulation_bank_ref: ArtifactRef | None = None
training_run_id: str | None = None
validation_report_refs: tuple[ArtifactRef, ...] = ()An amortized posterior, as REFERENCES to what was fitted (§0 ruling 4). No estimator object, no callable, no weights blob: the estimator and the simulation bank it was trained on are artifacts of their own, and this arm records which ones plus the run that fitted them. R1 freezes the schema and fits nothing.
PosteriorRepresentation
Defined in bayesmith.artifacts.results, line 367.
PosteriorRepresentation = DrawsPosterior | WeightedDrawsPosterior | AnalyticPosterior | FittedConditionalPosteriorPOSTERIOR_REPRESENTATIONS
Defined in bayesmith.artifacts.results, line 373.
POSTERIOR_REPRESENTATIONS: tuple[type, ...] = (DrawsPosterior, WeightedDrawsPosterior, AnalyticPosterior, FittedConditionalPosterior)EvidenceComponent
Defined in bayesmith.artifacts.results, line 395.
class EvidenceComponent
name: str
log_value: float
standard_error: float | None = None
method: str = ''
artifact_refs: tuple[ArtifactRef, ...] = ()One additive term of a log evidence, and how it was obtained (§0.5). The split between exact and residual components is what makes a hybrid evidence auditable: a number that is closed-form and a number that was sampled carry different warrants, and a single total would hide which part the error bar belongs to.
PosteriorResult
Defined in bayesmith.artifacts.results, line 442.
class PosteriorResult
meta: ArtifactMeta
run: RunRecord
representation: PosteriorRepresentation
latent_names: tuple[str, ...]
eliminated_latents: tuple[str, ...] = ()
reconstruction_ref: ArtifactRef | None = None
log_density_availability: LogDensityAvailability = LogDensityAvailability.NONE
pointwise_log_likelihood: NamedArray | None = None
predictive_ready: bool = False
report_refs: tuple[ArtifactRef, ...] = ()A posterior over the model's latents, in one of four representations. ``latent_names`` and ``eliminated_latents`` are disjoint by construction: an eliminated latent is one the plan integrated out, so it is exactly the set that has no draws here. ``reconstruction_ref`` points at what can put them back, and may only be present when something was eliminated.
EvidenceResult
Defined in bayesmith.artifacts.results, line 526.
class EvidenceResult
meta: ArtifactMeta
run: RunRecord
log_evidence: float
standard_error: float | None = None
posterior_representation: PosteriorRepresentation | None = None
normalization_audit_refs: tuple[ArtifactRef, ...] = ()
exact_components: tuple[EvidenceComponent, ...] = ()
residual_component: EvidenceComponent | None = None
repeat_result_refs: tuple[ArtifactRef, ...] = ()
consistency_report_ref: ArtifactRef | None = NoneA log marginal likelihood, its error bar, and its decomposition.
PredictiveResult
Defined in bayesmith.artifacts.results, line 575.
class PredictiveResult
meta: ArtifactMeta
run: RunRecord
source_posterior_ref: ArtifactRef
conditioning_data: Fingerprint | None = None
prediction_design: Fingerprint | None = None
conditioned_sites: tuple[str, ...] = ()
latent_draws: tuple[NamedArray, ...] = ()
replicated_draws: tuple[NamedArray, ...] = ()
pointwise_log_density: NamedArray | None = None
observation_unit: str | None = None
grouping: str | None = None
report_refs: tuple[ArtifactRef, ...] = ()Draws pushed through the model onto observations, held-out or replicated. Latent and replicated draws share ONE draw axis, because they are two views of the same posterior sample; a result whose halves disagreed about how many draws there were could not be zipped back together.
PointEstimateResult
Defined in bayesmith.artifacts.results, line 635.
class PointEstimateResult
meta: ArtifactMeta
run: RunRecord
estimand: Estimand
values: tuple[NamedArray, ...]
objective: float | None = None
uncertainty: UncertaintyRecord | None = None
gradient_norm: float | None = None
residual: float | None = None
iterations: int | None = None
local_only: bool = False
report_refs: tuple[ArtifactRef, ...] = ()One point of the posterior, with what the optimiser or solver knows. ``local_only`` is the honest field: an optimiser reports a stationary point, and calling it THE MAP would be a global claim nothing verified.
SimulationResult
Defined in bayesmith.artifacts.results, line 678.
class SimulationResult
meta: ArtifactMeta
run: RunRecord
parameter_source: ParameterSource
parameters: tuple[NamedArray, ...] = ()
latent_draws: tuple[NamedArray, ...] = ()
observation_draws: tuple[NamedArray, ...] = ()
prediction_design: Fingerprint | None = None
report_refs: tuple[ArtifactRef, ...] = ()Forward draws from a parameter source. No conditioning, no verdict.
Result
Defined in bayesmith.artifacts.results, line 716.
Result = PosteriorResult | EvidenceResult | PredictiveResult | PointEstimateResult | SimulationResultRESULT_CLASSES
Defined in bayesmith.artifacts.results, line 725.
RESULT_CLASSES: dict[ResultKind, type] = {ResultKind.POSTERIOR: PosteriorResult, ResultKind.EVIDENCE: EvidenceResult, ResultKind.PREDICTIVE: PredictiveResult, ResultKind.POINT_ESTIMATE: PointEstimateResult, ResultKind.SIMULATION: SimulationResult}result_kind
Defined in bayesmith.artifacts.results, line 738.
result_kind(result: Result) -> ResultKindWhich of the five ``result`` is, by exact type.
PRIMARY_RESULT_BY_TASK
Defined in bayesmith.artifacts.results, line 752.
PRIMARY_RESULT_BY_TASK = MappingProxyType({TaskKind.POSTERIOR: ResultKind.POSTERIOR, TaskKind.EVIDENCE: ResultKind.EVIDENCE, TaskKind.PREDICTIVE: ResultKind.PREDICTIVE, TaskKind.POINT_ESTIMATE: ResultKind.POINT_ESTIMATE, TaskKind.SIMULATION: ResultKind.SIMULATION})ScopeKind
Defined in bayesmith.artifacts.refusal, line 174.
class ScopeKind(StrEnum)What a finding or a refusal is ABOUT. Kept small and structural: these are the things this package can name and a consumer can look up. A free-text scope would be a second message field.
MODEL = 'model'
NODE = 'node'
PARAMETER = 'parameter'
PLATE = 'plate'
BLOCK = 'block'
DATA = 'data'
TASK = 'task'
BACKEND = 'backend'ScopeRef
Defined in bayesmith.artifacts.refusal, line 193.
class ScopeRef
kind: ScopeKind
name: strOne thing, named by kind and by name.
Finding
Defined in bayesmith.artifacts.refusal, line 206.
class Finding
code: str
message: str
observed: object = None
expected: object = None
artifact_refs: tuple[ArtifactRef, ...] = ()One measured reason, with the numbers that produced it. ``observed`` and ``expected`` are the pair a consumer compares: what was measured, and what the premise required. They are canonical values -- a scalar or a tuple of them -- so they survive the codec and cannot become a runtime handle. G11's lesson is exactly this class: the failing path must return what the passing path measured, because a number rendered into a sentence is a number nobody downstream can use.
Remedy
Defined in bayesmith.artifacts.refusal, line 233.
class Remedy
action: str
message: str
parameters: tuple[tuple[str, object], ...] = ()Somewhere to go: an action code, an explanation, and its arguments. ``parameters`` is sorted and key-unique like every other option table here, so "the same remedy" is one value however the caller spelled it.
Conservatism
Defined in bayesmith.artifacts.refusal, line 255.
class Conservatism(StrEnum)How a fallback compares to the route that refused. Named rather than assumed. "We fell back" reads as "we were careful", and sometimes the offered route is the cheaper, weaker one -- a caller consenting to an automatic fallback needs to know which of those they are consenting to.
EQUIVALENT = 'equivalent'
MORE_CONSERVATIVE = 'more_conservative'
LESS_CONSERVATIVE = 'less_conservative'FallbackOption
Defined in bayesmith.artifacts.refusal, line 271.
class FallbackOption
task_kind: TaskKind
backend: str
conservatism: Conservatism = Conservatism.EQUIVALENT
automatic: bool = FalseA route the caller could take instead, and whether it would be automatic.
Refusal
Defined in bayesmith.artifacts.refusal, line 289.
class Refusal
meta: ArtifactMeta
task: Task
failed_premise: str
grounds: tuple[Finding, ...]
scope: ScopeRef
remedies: tuple[Remedy, ...]
fallback: FallbackOption | None = NoneWhat is returned when a task cannot be answered as asked (§0 ruling 1). It stands in for the artifact that did not happen -- a plan that could not be compiled, or a result that could not be produced -- so its envelope carries that kind. It is never filed as an evaluation report: a report is a judgement ABOUT an artifact, and a refusal is the absence of one.
CAPABILITY_UNAVAILABLE_R1
Defined in bayesmith.artifacts.refusal, line 66.
CAPABILITY_UNAVAILABLE_R1: str = 'capability_unavailable_r1'PREMISES
Defined in bayesmith.artifacts.refusal, line 93.
PREMISES: frozenset[str] = frozenset({CAPABILITY_UNAVAILABLE_R1, 'backend_supported', 'model_source_identified', 'task_options_recognised', 'gaussian_likelihood', 'affine_prediction', 'log_linear_route', 'whole_graph_exact_solve', 'local_mode_certified', 'graph_has_latents', 'named_latents_declared', 'posterior_data_mismatch', 'predictive_noise_unsupported', 'evidence_prior_proper', 'evidence_prior_normalised', 'evidence_prior_undeclared', 'evidence_residual_integral_required', 'evidence_requires_x64', 'evidence_residual_method_unsupported', 'evidence_conditional_prior_proper'})AnalysisFinding
Defined in bayesmith.artifacts.reports, line 101.
class AnalysisFinding
code: str
conclusion: str
scope: ScopeRef
measurements: tuple[tuple[str, object], ...] = ()
grounds: tuple[str, ...] = ()One thing compilation concluded about the graph, and what it measured. ``grounds`` is a tuple of reason CODES rather than of nested findings: at compile time the support for a conclusion is a set of checks that passed, and naming them keeps the record flat enough to read. It is the same idea as a refusal's ``grounds`` -- what stands behind the claim, structured -- which is why it carries the same name.
AnalysisReport
Defined in bayesmith.artifacts.reports, line 138.
class AnalysisReport
meta: ArtifactMeta
model_ref: ModelRef
graph_fingerprint: Fingerprint
findings: tuple[AnalysisFinding, ...] = ()
candidate_routes: tuple[str, ...] = ()Compile-time reading of a graph: what it is, and what could run on it. ``candidate_routes`` is a PREFERENCE order, so it is neither sorted nor deduplicated into a set -- reordering it would rerank the routes, and a repeated route would make one option look like two.
PlanBlockRecord
Defined in bayesmith.artifacts.reports, line 169.
class PlanBlockRecord
names: tuple[str, ...]
method: str
reason_codes: tuple[str, ...] = ()
kappa: float | None = None
tolerance: float | None = None
approximation: ApproximationRecord | None = NoneOne block of the schedule: which parameters, by which method, and why. ``kappa`` and ``tolerance`` are the numbers that justify the method where it has them, and ``None`` where the method has no such knob -- an exact elimination has no tolerance to report, and reporting 0 would say it had one and met it perfectly.
InferencePlanRecord
Defined in bayesmith.artifacts.reports, line 207.
class InferencePlanRecord
meta: ArtifactMeta
task_id: str
model_ref: ModelRef
analysis_report_ref: ArtifactRef | None = None
blocks: tuple[PlanBlockRecord, ...] = ()
exact_elimination: tuple[str, ...] = ()
residual_parameters: tuple[str, ...] = ()
backend: str = 'auto'
premises: tuple[str, ...] = ()
budget: ComputeBudget = _NO_BUDGET
quality_gate: str | None = None
fallback_policy: str | None = NoneThe compiled plan, as a record: what will run, on what, under what. The analysis report it was built from is a PARENT, not merely a field. §0.3 retires a plan through the inputs it was made from, so a plan whose reading of the graph is not in its lineage would outlive a change to that reading.
Applicability
Defined in bayesmith.artifacts.reports, line 276.
class Applicability(StrEnum)Whether the check could say anything about this subject (§0 ruling 7). ``INAPPLICABLE`` and ``UNVERIFIABLE`` are different answers: the first says the check does not apply to this kind of result, the second says it applies but the inputs it needs are missing. Collapsing them would make "we cannot check this" and "there is nothing to check" one status, and only one of those is worth chasing.
APPLICABLE = 'applicable'
INAPPLICABLE = 'inapplicable'
UNVERIFIABLE = 'unverifiable'Conclusion
Defined in bayesmith.artifacts.reports, line 292.
class Conclusion(StrEnum)What an applicable check concluded, and what a gate aggregates to. One enum for both levels on purpose. A report's conclusion and a gate's verdict are the same three answers about different scopes, and two enums with identical members would be two types nothing stops a caller swapping -- the mistake ``ApproximationClass`` and ``TargetFidelity`` are kept apart to avoid is the OPPOSITE case: there, one word means two things.
PASS = 'pass'
FAIL = 'fail'
ABSTAIN = 'abstain'EvaluationReport
Defined in bayesmith.artifacts.reports, line 327.
class EvaluationReport
meta: ArtifactMeta
subject_ref: ArtifactRef
report_kind: str
applicability: Applicability
conclusion: Conclusion
findings: tuple[Finding, ...] = ()One check's judgement of one result, on the two axes of §0 ruling 7. The legal combinations are refused HERE, where the report is built, rather than where a gate reads it: an inapplicable check reporting PASS has passed nothing, and an aggregator handed one would count it faithfully.
OperationalStatus
Defined in bayesmith.artifacts.gates, line 73.
class OperationalStatus(StrEnum)Whether the gate got to judge at all (§0 ruling 7). Three of the four say it did not, and each names a different thing to fix: a missing prerequisite is upstream work, an invalidated input is a re-run, an error is a failure to investigate. Only ``EVALUATED`` carries a verdict.
BLOCKED = 'blocked'
INVALIDATED = 'invalidated'
ERROR = 'error'
EVALUATED = 'evaluated'AttemptStatus
Defined in bayesmith.artifacts.gates, line 88.
class AttemptStatus(StrEnum)Whether anybody tried to produce this report. The distinction the truth table turns on: a required report that was never attempted leaves the gate undecided (ABSTAIN), while one that was attempted and errored is an ERROR. Without this field the two look identical -- no report either way -- and the milder answer would win.
NOT_ATTEMPTED = 'not_attempted'
ATTEMPTED = 'attempted'ReportRequirement
Defined in bayesmith.artifacts.gates, line 103.
class ReportRequirement
name: str
required: bool = True
optional_error_blocks: bool = FalseOne check a gate asks for, and how much it matters. ``optional_error_blocks`` answers a question only an OPTIONAL requirement has: a required check that errored always blocks. Declaring it on a required requirement is refused rather than ignored -- a field that is silently ignored somewhere is a field somebody will set and rely on.
ReportSlot
Defined in bayesmith.artifacts.gates, line 130.
class ReportSlot
requirement: ReportRequirement
report: EvaluationReport | None = None
attempt_status: AttemptStatus = AttemptStatus.NOT_ATTEMPTED
invalidated: bool = False
error: ErrorRecord | None = NoneWhat became of one requirement on one subject. Exactly one outcome at a time: not attempted, a report, or an error. §0.6 refuses a slot holding a report AND an error at the boundary, because an aggregator reading whichever it checks first would produce a defensible answer from an impossible input.
GateDefinition
Defined in bayesmith.artifacts.gates, line 179.
class GateDefinition
name: str
version: int
requirements: tuple[ReportRequirement, ...]
blocked_actions: tuple[str, ...] = ()
remedies: tuple[Remedy, ...] = ()The schema of a gate: what it asks for, and what it governs. ``blocked_actions`` and ``remedies`` belong to the DEFINITION, not to any one run of it, which is why :func:``aggregate_gate`` copies them into the result unedited.
GateDefinition.identity
identity(self) -> str``name@version``: the spelling a task's ``quality_gate`` carries. One spelling, because a task asks for a gate by string and a result must be checkable against the gate that was asked for.
GateDefinition.requirement
requirement(self, name: str) -> ReportRequirementThe declared requirement called ``name``, or a refusal naming it.
GateResult
Defined in bayesmith.artifacts.gates, line 238.
class GateResult
meta: ArtifactMeta
definition: GateDefinition
status: OperationalStatus
verdict: Conclusion | None = None
report_refs: tuple[ArtifactRef, ...] = ()
findings: tuple[Finding, ...] = ()
blocked_actions: tuple[str, ...] = ()
remedies: tuple[Remedy, ...] = ()One gate's answer: a status always, a verdict only when it judged.
aggregate_gate
Defined in bayesmith.artifacts.gates, line 292.
aggregate_gate(definition: GateDefinition, *, meta: ArtifactMeta, prerequisites_ready: bool, inputs_current: bool, slots: tuple[ReportSlot, ...]) -> GateResult§0.6's priority, applied to a schema-checked mapping of slots. The slots are indexed by requirement name and then read in the order the DEFINITION declares, so the caller's ordering reaches nothing: not the status, not the verdict, not the findings, not the report references.