Python API

The Python package is a typed wrapper over the installed C ABI.

Python access to the public PostProject C ABI.

class postproject.Activity(id: 'ActivityId', kind: 'str', started_at_unix_micros: 'int | None', finished_at_unix_micros: 'int | None', tool: 'ToolIdentity | None', agent: 'AgentIdentity | None', inputs: 'tuple[ActivityEdge, ...]', outputs: 'tuple[ActivityEdge, ...]')

Bases: object

agent: AgentIdentity | None
finished_at_unix_micros: int | None
id: ActivityId
inputs: tuple[ActivityEdge, ...]
kind: str
outputs: tuple[ActivityEdge, ...]
started_at_unix_micros: int | None
tool: ToolIdentity | None
class postproject.ActivityCreatedEvent(activity_id: 'ActivityId', kind: 'str')

Bases: object

activity_id: ActivityId
kind: str
class postproject.ActivityEdge(representation_id: 'RepresentationId', role: 'str | None' = None, snapshot: 'ActivityEdgeSnapshot | None' = None)

Bases: object

representation_id: RepresentationId
role: str | None
snapshot: ActivityEdgeSnapshot | None
class postproject.ActivityEdgeSnapshot(revision_sequence: int, fingerprints: tuple[FingerprintSnapshot, ...])

Bases: object

Storage-owned fingerprint state captured when an activity committed.

fingerprints: tuple[FingerprintSnapshot, ...]
revision_sequence: int
class postproject.ActivityInputAddedEvent(activity_id: 'ActivityId', representation_id: 'RepresentationId', role: 'str | None' = None)

Bases: object

activity_id: ActivityId
representation_id: RepresentationId
role: str | None
class postproject.ActivityOutputAddedEvent(activity_id: 'ActivityId', representation_id: 'RepresentationId', role: 'str | None' = None)

Bases: object

activity_id: ActivityId
representation_id: RepresentationId
role: str | None
class postproject.ActivityRef(id: ActivityId)

Bases: object

Explicit activity target for polymorphic operations.

id: ActivityId
class postproject.ActivitySpec(kind: 'str', outputs: 'tuple[ActivityEdgeInput, ...]' = (), inputs: 'tuple[ActivityEdgeInput, ...]' = (), started_at_unix_micros: 'int | None' = None, finished_at_unix_micros: 'int | None' = None, tool: 'ToolIdentity | None' = None, agent: 'AgentIdentity | None' = None, parameters: 'ActivityParameters' = ())

Bases: object

agent: AgentIdentity | None
finished_at_unix_micros: int | None
inputs: tuple[RepresentationId | tuple[RepresentationId, str | None], ...]
kind: str
outputs: tuple[RepresentationId | tuple[RepresentationId, str | None], ...]
parameters: Mapping[MetadataProperty | tuple[str, str], str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[MetadataValue, ...], ...] | Sequence[str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[MetadataValue, ...], ...] | Sequence[MetadataInput] | bytearray | memoryview] | bytearray | memoryview] | Iterable[tuple[MetadataProperty | tuple[str, str], str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[MetadataValue, ...], ...] | Sequence[str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[MetadataValue, ...], ...] | Sequence[MetadataInput] | bytearray | memoryview] | bytearray | memoryview]]
started_at_unix_micros: int | None
tool: ToolIdentity | None
class postproject.AgentIdentity(name: 'str | None' = None, identifier: 'ExternalIdentifier | None' = None)

Bases: object

identifier: ExternalIdentifier | None
name: str | None
exception postproject.AlreadyExistsError(code: int, message: str)

Bases: PostProjectError

A unique production object or attachment already exists.

exception postproject.AmbiguousResolutionError(code: int, message: str)

Bases: PostProjectError

A mutation requires an explicit choice between resolution candidates.

class postproject.AmbiguousResourceIssue

Bases: object

Resource candidates need a caller decision.

kind: ClassVar[AvailabilityIssueKind] = 'ambiguous_resource'
class postproject.ArtifactDependencyFingerprintChanged(activity_id: ActivityId, input_representation_id: RepresentationId, representation_id: RepresentationId, dependency_path: tuple[ArtifactDependencyPathSegment, ...], fingerprint_algorithm: str, fingerprint_version: int, snapshot_value: bytes, current_value: bytes)

Bases: _ArtifactReasonValue

dependency fingerprint changed.

activity_id: ActivityId
current_value: bytes
dependency_path: tuple[ArtifactDependencyPathSegment, ...]
fingerprint_algorithm: str
fingerprint_version: int
input_representation_id: RepresentationId
kind: ClassVar[ArtifactReasonKind] = 'dependency_fingerprint_changed'
representation_id: RepresentationId
snapshot_value: bytes
class postproject.ArtifactDependencyFingerprintEvidenceMissing(activity_id: ActivityId, input_representation_id: RepresentationId, representation_id: RepresentationId, dependency_path: tuple[ArtifactDependencyPathSegment, ...], fingerprint_algorithm: str | None, fingerprint_version: int | None, snapshot_value: bytes | None, current_value: bytes | None)

Bases: _ArtifactReasonValue

dependency fingerprint evidence missing.

activity_id: ActivityId
current_value: bytes | None
dependency_path: tuple[ArtifactDependencyPathSegment, ...]
fingerprint_algorithm: str | None
fingerprint_version: int | None
input_representation_id: RepresentationId
kind: ClassVar[ArtifactReasonKind] = 'dependency_fingerprint_evidence_missing'
representation_id: RepresentationId
snapshot_value: bytes | None
class postproject.ArtifactDependencyFingerprintRecomputationPending(activity_id: ActivityId, input_representation_id: RepresentationId, representation_id: RepresentationId, dependency_path: tuple[ArtifactDependencyPathSegment, ...])

Bases: _ArtifactReasonValue

dependency fingerprint recomputation pending.

activity_id: ActivityId
dependency_path: tuple[ArtifactDependencyPathSegment, ...]
input_representation_id: RepresentationId
kind: ClassVar[ArtifactReasonKind] = 'dependency_fingerprint_recomputation_pending'
representation_id: RepresentationId
class postproject.ArtifactDependencyIssue(*values)

Bases: Enum

Why captured dependency knowledge cannot prove currentness.

DEPTH_TRUNCATED = 'depth_truncated'
NEEDS_EXTRACTION = 'needs_extraction'
REPRESENTATIONS_TRUNCATED = 'representations_truncated'
UNRESOLVED = 'unresolved'
class postproject.ArtifactDependencyKnowledgeIncomplete(activity_id: ActivityId, input_representation_id: RepresentationId, representation_id: RepresentationId, dependency_path: tuple[ArtifactDependencyPathSegment, ...], dependency_issue: ArtifactDependencyIssue)

Bases: _ArtifactReasonValue

dependency knowledge incomplete.

activity_id: ActivityId
dependency_issue: ArtifactDependencyIssue
dependency_path: tuple[ArtifactDependencyPathSegment, ...]
input_representation_id: RepresentationId
kind: ClassVar[ArtifactReasonKind] = 'dependency_knowledge_incomplete'
representation_id: RepresentationId
class postproject.ArtifactDependencyPathChanged(activity_id: ActivityId, input_representation_id: RepresentationId, dependency_path: tuple[ArtifactDependencyPathSegment, ...])

Bases: _ArtifactReasonValue

dependency path changed.

activity_id: ActivityId
dependency_path: tuple[ArtifactDependencyPathSegment, ...]
input_representation_id: RepresentationId
kind: ClassVar[ArtifactReasonKind] = 'dependency_path_changed'
class postproject.ArtifactDependencyPathSegment(source_representation_id: RepresentationId, dependency_position: int, source_resource_id: ResourceId | None, kind: str, target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef, resolved_representation_id: RepresentationId | None, authored_reference: str)

Bases: object

One exact authored edge in a captured dependency path.

authored_reference: str
dependency_position: int
kind: str
resolved_representation_id: RepresentationId | None
source_representation_id: RepresentationId
source_resource_id: ResourceId | None
target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef
class postproject.ArtifactDependencySnapshotAbsent(activity_id: ActivityId, representation_id: RepresentationId)

Bases: _ArtifactReasonValue

dependency snapshot absent.

activity_id: ActivityId
kind: ClassVar[ArtifactReasonKind] = 'dependency_snapshot_absent'
representation_id: RepresentationId
class postproject.ArtifactEdgeKind(*values)

Bases: Enum

Side of an activity supplying fingerprint evidence.

INPUT = 'input'
OUTPUT = 'output'
class postproject.ArtifactEvaluation(representation_id: RepresentationId, state: ArtifactKnowledgeState, visited_representations: int, truncated: bool, reasons: tuple[ArtifactProducerMissing | ArtifactProducerAmbiguous | ArtifactSnapshotAbsent | ArtifactFingerprintEvidenceMissing | ArtifactFingerprintChanged | ArtifactFingerprintRecomputationPending | ArtifactUpstreamNotCurrent | ArtifactTraversalTruncated | ArtifactDependencySnapshotAbsent | ArtifactDependencyKnowledgeIncomplete | ArtifactDependencyPathChanged | ArtifactDependencyFingerprintChanged | ArtifactDependencyFingerprintRecomputationPending | ArtifactDependencyFingerprintEvidenceMissing, ...])

Bases: object

Complete, bounded evaluation of one artifact representation.

reasons: tuple[ArtifactProducerMissing | ArtifactProducerAmbiguous | ArtifactSnapshotAbsent | ArtifactFingerprintEvidenceMissing | ArtifactFingerprintChanged | ArtifactFingerprintRecomputationPending | ArtifactUpstreamNotCurrent | ArtifactTraversalTruncated | ArtifactDependencySnapshotAbsent | ArtifactDependencyKnowledgeIncomplete | ArtifactDependencyPathChanged | ArtifactDependencyFingerprintChanged | ArtifactDependencyFingerprintRecomputationPending | ArtifactDependencyFingerprintEvidenceMissing, ...]
representation_id: RepresentationId
state: ArtifactKnowledgeState
truncated: bool
visited_representations: int
class postproject.ArtifactFingerprintChanged(activity_id: ActivityId, representation_id: RepresentationId, edge_kind: ArtifactEdgeKind, fingerprint_algorithm: str, fingerprint_version: int, snapshot_value: bytes, current_value: bytes)

Bases: _ArtifactReasonValue

fingerprint changed.

activity_id: ActivityId
current_value: bytes
edge_kind: ArtifactEdgeKind
fingerprint_algorithm: str
fingerprint_version: int
kind: ClassVar[ArtifactReasonKind] = 'fingerprint_changed'
representation_id: RepresentationId
snapshot_value: bytes
class postproject.ArtifactFingerprintEvidenceMissing(activity_id: ActivityId, representation_id: RepresentationId, edge_kind: ArtifactEdgeKind, fingerprint_algorithm: str | None, fingerprint_version: int | None, snapshot_value: bytes | None, current_value: bytes | None)

Bases: _ArtifactReasonValue

fingerprint evidence missing.

activity_id: ActivityId
current_value: bytes | None
edge_kind: ArtifactEdgeKind
fingerprint_algorithm: str | None
fingerprint_version: int | None
kind: ClassVar[ArtifactReasonKind] = 'fingerprint_evidence_missing'
representation_id: RepresentationId
snapshot_value: bytes | None
class postproject.ArtifactFingerprintRecomputationPending(activity_id: ActivityId, representation_id: RepresentationId, edge_kind: ArtifactEdgeKind)

Bases: _ArtifactReasonValue

fingerprint recomputation pending.

activity_id: ActivityId
edge_kind: ArtifactEdgeKind
kind: ClassVar[ArtifactReasonKind] = 'fingerprint_recomputation_pending'
representation_id: RepresentationId
class postproject.ArtifactKnowledgeState(*values)

Bases: Enum

Knowledge-only state of an activity-produced representation.

CURRENT = 'current'
DIVERGED = 'diverged'
INDETERMINATE = 'indeterminate'
STALE = 'stale'
class postproject.ArtifactProducerAmbiguous(representation_id: RepresentationId, activity_count: int)

Bases: _ArtifactReasonValue

producing activity ambiguous.

activity_count: int
kind: ClassVar[ArtifactReasonKind] = 'producing_activity_ambiguous'
representation_id: RepresentationId
class postproject.ArtifactProducerMissing(representation_id: RepresentationId)

Bases: _ArtifactReasonValue

producing activity missing.

kind: ClassVar[ArtifactReasonKind] = 'producing_activity_missing'
representation_id: RepresentationId
class postproject.ArtifactReasonKind(*values)

Bases: Enum

Machine-readable explanation of a non-current artifact state.

DEPENDENCY_FINGERPRINT_CHANGED = 'dependency_fingerprint_changed'
DEPENDENCY_FINGERPRINT_EVIDENCE_MISSING = 'dependency_fingerprint_evidence_missing'
DEPENDENCY_FINGERPRINT_RECOMPUTATION_PENDING = 'dependency_fingerprint_recomputation_pending'
DEPENDENCY_KNOWLEDGE_INCOMPLETE = 'dependency_knowledge_incomplete'
DEPENDENCY_PATH_CHANGED = 'dependency_path_changed'
DEPENDENCY_SNAPSHOT_ABSENT = 'dependency_snapshot_absent'
FINGERPRINT_CHANGED = 'fingerprint_changed'
FINGERPRINT_EVIDENCE_MISSING = 'fingerprint_evidence_missing'
FINGERPRINT_RECOMPUTATION_PENDING = 'fingerprint_recomputation_pending'
PRODUCING_ACTIVITY_AMBIGUOUS = 'producing_activity_ambiguous'
PRODUCING_ACTIVITY_MISSING = 'producing_activity_missing'
SNAPSHOT_ABSENT = 'snapshot_absent'
TRAVERSAL_TRUNCATED = 'traversal_truncated'
UPSTREAM_NOT_CURRENT = 'upstream_not_current'
class postproject.ArtifactReproducibility(representation_id: RepresentationId, reproducible: bool, producing_activity_id: ActivityId | None, activity_kind: str | None, issues: tuple[ReproducibilityProducerMissing | ReproducibilityProducerAmbiguous | ReproducibilityToolMissing | ReproducibilityParametersMissing | ReproducibilityInputMissing, ...])

Bases: object

Recorded knowledge needed to reproduce an artifact.

activity_kind: str | None
issues: tuple[ReproducibilityProducerMissing | ReproducibilityProducerAmbiguous | ReproducibilityToolMissing | ReproducibilityParametersMissing | ReproducibilityInputMissing, ...]
producing_activity_id: ActivityId | None
representation_id: RepresentationId
reproducible: bool
class postproject.ArtifactReproducibilityIssueKind(*values)

Bases: Enum

Missing condition that prevents artifact reproduction.

INPUT_REPRESENTATION_MISSING = 'input_representation_missing'
PARAMETERS_MISSING = 'parameters_missing'
PRODUCING_ACTIVITY_AMBIGUOUS = 'producing_activity_ambiguous'
PRODUCING_ACTIVITY_MISSING = 'producing_activity_missing'
TOOL_IDENTITY_MISSING = 'tool_identity_missing'
class postproject.ArtifactSnapshotAbsent(activity_id: ActivityId, representation_id: RepresentationId, edge_kind: ArtifactEdgeKind)

Bases: _ArtifactReasonValue

snapshot absent.

activity_id: ActivityId
edge_kind: ArtifactEdgeKind
kind: ClassVar[ArtifactReasonKind] = 'snapshot_absent'
representation_id: RepresentationId
class postproject.ArtifactTraversalLimit(*values)

Bases: Enum

Explicit bound that stopped artifact evaluation.

DEPTH = 'depth'
REPRESENTATIONS = 'representations'
class postproject.ArtifactTraversalTruncated(representation_id: RepresentationId, traversal_limit: ArtifactTraversalLimit)

Bases: _ArtifactReasonValue

traversal truncated.

kind: ClassVar[ArtifactReasonKind] = 'traversal_truncated'
representation_id: RepresentationId
traversal_limit: ArtifactTraversalLimit
class postproject.ArtifactUpstreamNotCurrent(representation_id: RepresentationId, upstream_state: ArtifactKnowledgeState)

Bases: _ArtifactReasonValue

upstream not current.

kind: ClassVar[ArtifactReasonKind] = 'upstream_not_current'
representation_id: RepresentationId
upstream_state: ArtifactKnowledgeState
class postproject.Asset(id: AssetId, created_at_unix_micros: int, display_name: str | None, import_source: str | None)

Bases: object

Immutable logical asset summary.

created_at_unix_micros: int
display_name: str | None
id: AssetId
import_source: str | None
class postproject.AssetImportedEvent(asset_id: 'AssetId')

Bases: object

asset_id: AssetId
class postproject.AssetRef(id: AssetId)

Bases: object

Explicit asset target for polymorphic operations.

id: AssetId
class postproject.AvailabilityIssue(resource_id: ResourceId, required: bool, detail: OfflineResourceIssue | AmbiguousResourceIssue | ResourceErrorIssue | MissingSequenceFrames)

Bases: object

Resource-specific diagnostic with only its applicable payload.

detail: OfflineResourceIssue | AmbiguousResourceIssue | ResourceErrorIssue | MissingSequenceFrames
property frames: tuple[int, ...]

Missing frames exactly for a frame-specific diagnostic.

property kind: AvailabilityIssueKind

Display category derived from the diagnostic detail.

required: bool
resource_id: ResourceId
class postproject.AvailabilityIssueKind(*values)

Bases: Enum

Machine-readable category of a representation availability issue.

AMBIGUOUS_RESOURCE = 'ambiguous_resource'
MISSING_FRAMES = 'missing_frames'
OFFLINE_RESOURCE = 'offline_resource'
RESOURCE_ERROR = 'resource_error'
class postproject.CancelToken(*, library_path: str | PathLike[str] | None = None)

Bases: object

A cancellation flag shared with running operations.

cancel() may be called from any thread, including while Production.resolve runs on another; that call then raises CancelledError. Cancellation cannot be undone.

cancel() → None

Request cancellation of every operation observing this token.

exception postproject.CancelledError(code: int, message: str)

Bases: PostProjectError

The caller cancelled the operation through a cancellation token.

class postproject.CommitReceipt(production_id: ProductionId, revision: CommittedRevision | None)

Bases: object

Atomic commit outcome; no revision means no new journal entry.

production_id: ProductionId
revision: CommittedRevision | None
class postproject.CommittedRevision(id: RevisionId, sequence: int)

Bases: object

Identity and sequence produced by one successful commit.

id: RevisionId
sequence: int
exception postproject.ConflictError(code: int, message: str, conflict: TransactionConflict | None = None)

Bases: PostProjectError

An operation conflicts with current transaction or production state.

class postproject.ConflictKey(kind: ConflictKeyKind, target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef | MediaRootId, namespace_name: str | None = None, local_name: str | None = None, qualifier: str | None = None, version: int | None = None)

Bases: object

One non-mergeable semantic fact changed after a transaction base.

kind: ConflictKeyKind
local_name: str | None
namespace_name: str | None
qualifier: str | None
target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef | MediaRootId
version: int | None
class postproject.ConflictKeyKind(*values)

Bases: IntEnum

Stable category of a semantic transaction conflict key.

DEPENDENCY_SET = 3
EXTERNAL_IDENTIFIER = 5
LOCATOR_SET = 1
MEDIA_ROOT = 4
METADATA_PROPERTY = 2
REPRESENTATION_FINGERPRINT = 7
RESOURCE_FILE_FACTS = 8
RESOURCE_FINGERPRINT = 6
class postproject.ContentObservationOutcome(*values)

Bases: Enum

How observed content relates to the stored fingerprints.

CHANGED = 'changed'
FIRST = 'first'
UNCHANGED = 'unchanged'
class postproject.ContentStructureKind(*values)

Bases: Enum

Structural shape used to realize a representation.

IMAGE_SEQUENCE = 'image_sequence'
ORDERED_PARTS = 'ordered_parts'
PACKAGE = 'package'
SINGLE_RESOURCE = 'single_resource'
class postproject.ContentVerification(*values)

Bases: Enum

Result of comparing present content with stored fingerprints.

DIFFERS = 'differs'
MATCHES = 'matches'
NOT_COMPARABLE = 'not_comparable'
class postproject.DecisionBase(production_id: ProductionId, revision: CommittedRevision | None)

Bases: object

Detached production-scoped decision context, without a retained view.

classmethod from_token(token: str, *, library_path: str | PathLike[str] | None = None) → DecisionBase

Parse canonical scoped context; editing still validates store membership.

production_id: ProductionId
revision: CommittedRevision | None
to_token(*, library_path: str | PathLike[str] | None = None) → str

Export context without retaining a view, lock or permission.

class postproject.Dependency(kind: str, target: AssetRef | RepresentationRef, authored_reference: str, required: bool = True, source_resource_id: ResourceId | None = None, resolved_representation_id: RepresentationId | None = None)

Bases: object

One exact authored dependency edge.

authored_reference: str
kind: str
required: bool
resolved_representation_id: RepresentationId | None
source_resource_id: ResourceId | None
target: AssetRef | RepresentationRef
class postproject.DependencyMatch(target: AssetRef | RepresentationRef, depth: int)

Bases: object

One dependency-query target and its shortest observed depth.

depth: int
target: AssetRef | RepresentationRef
class postproject.DependencySet(source_representation_id: RepresentationId, recorded_at_revision: int, status: DependencySetStatus, dependencies: tuple[Dependency, ...])

Bases: object

One complete ordered dependency observation.

dependencies: tuple[Dependency, ...]
recorded_at_revision: int
source_representation_id: RepresentationId
status: DependencySetStatus
class postproject.DependencySetRecordedEvent(representation_id: 'RepresentationId')

Bases: object

representation_id: RepresentationId
class postproject.DependencySetStatus(*values)

Bases: Enum

Freshness of one complete dependency observation.

CURRENT = 'current'
NEEDS_EXTRACTION = 'needs_extraction'
class postproject.Edit(native: NativeLibrary, handle: _Pointer[NativeTransaction])

Bases: object

A caller-serialized edit; uncommitted context work rolls back.

add_external_identifier(target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef, identifier: ExternalIdentifier) → None

Stage an external identifier attachment.

add_media_root(name: str, label: str | None = None, priority: int = 0) → MediaRootId

Stage a portable logical root used for resource discovery.

add_metadata(target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef, property: MetadataProperty | tuple[str, str], value: str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[MetadataValue, ...], ...] | Sequence[MetadataInput] | bytearray | memoryview) → None

Stage one assertion using native scalars or an explicit metadata kind.

add_representation(asset_id: AssetId, kind: RepresentationKind, source: str | PathLike[str] | ImageSequenceSource | OrderedPartsSource | PackageSource) → RepresentationId

Stage a representation of kind with the source’s structure for an existing asset. A path adds a single file.

cancel_job(job_id: JobId) → None

Stage administrative cancellation of a requested or claimed job.

claim_job_lease(job_id: JobId, tool: ToolIdentity, duration: timedelta, *, agent: AgentIdentity | None = None) → JobLease

Claim work with library-controlled time; ownership activates on commit.

close() → None

Release the handle, implicitly rolling back if still open.

commit() → CommitReceipt

Persist staged mutations and return this commit’s atomic receipt.

The attempt is terminal, including failure. A receipt with no revision creates no journal entry and does not identify another writer’s head.

complete_job_lease(lease: JobLease, output_representation_id: RepresentationId, activity_id: ActivityId) → None

Bind staged output and provenance into one guarded atomic completion.

confirm_locator(resource_id: ResourceId, uri: str, *, media_root: str | None = None, sequence_naming: SequenceNaming | None = None) → None

Stage explicit confirmation of one resource candidate URI.

media_root records the logical root the URI was found under; it is retained as query evidence and need not name a configured or enabled root. sequence_naming names the files at a locator of an image-sequence resource: required for such a resource and rejected at commit for any other. Pass a candidate’s media_root and sequence_naming to record it as found.

confirm_selection(selection: RelinkSelection) → None

Stage every location from the original read-bound selection atomically.

Open this edit with base=selection.base. A mismatch or malformed location leaves staged work unchanged. Files are not rechecked here; the host still checks association/generation before applying results. Commit remains explicit.

create_activity(spec: ActivitySpec) → ActivityId

Stage an activity describing existing outputs and its actual parameters.

fail_job_lease(lease: JobLease, diagnostic: str) → None

Stage claimant failure through current unexpired ownership.

import_media(source: str | PathLike[str] | ImageSequenceSource | OrderedPartsSource | PackageSource, display_name: str | None = None) → ImportedMedia

Stage a new asset whose original representation has the source’s structure. A path imports a single file.

observe_resource_content(resource_id: ResourceId, path: str | PathLike[str], *, sequence_naming: SequenceNaming | None = None) → ContentObservationOutcome

Stage the content at path as the resource’s new observation.

Every representation using the resource is recomputed and staged too, so commit leaves no representation pending recomputation. The outcome says whether the content changed; changed file facts can still create a revision when it is UNCHANGED. Requires a decision-bound edit; session edits retain their original view. Detached edits must match the head when this operation pins its view. sequence_naming is as for Production.verify_resource().

prepare_proposal(client_id: ClientId, request_id: RequestId, base: ProtocolBase | None = None) → Proposal

Close staged intent without committing; retain its original identities.

Failure leaves the edit open. A mirror-derived decision needs its full protocol base. Only a fresh successful submission delivers owning leases.

record_dependency_set(representation_id: RepresentationId, dependencies: tuple[Dependency, ...]) → None

Stage replacement of one complete ordered dependency observation.

record_representation_fingerprint(representation_id: RepresentationId, fingerprint: Fingerprint) → None

Stage a representation fingerprint from a decision-bound edit.

record_resource_fingerprint(resource_id: ResourceId, fingerprint: Fingerprint) → None

Stage a resource fingerprint from a decision-bound edit.

register_outputs(outputs: Iterable[tuple[AssetId | None, RepresentationKind, str | PathLike[str] | ImageSequenceSource | OrderedPartsSource | PackageSource] | tuple[AssetId | None, RepresentationKind, str | PathLike[str] | ImageSequenceSource | OrderedPartsSource | PackageSource, str | None] | tuple[AssetId | None, RepresentationKind, str | PathLike[str] | ImageSequenceSource | OrderedPartsSource | PackageSource, str | None, str | None]], spec: ActivitySpec) → RegisteredOutputs

Stage produced sources, one actual activity and its parameters together.

Each output is (asset_or_None, kind, source[, role[, display_name]]). None explicitly creates a new original asset. The recipe’s outputs must be empty; its inputs take representation IDs or (id, role) pairs. No job or dependency observation is created. Commit stays explicit.

release_job_lease(lease: JobLease) → None

Stage explicit release of a current unexpired claim.

remove_external_identifier(target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef, identifier: ExternalIdentifier) → None

Stage removal of one exact external identifier attachment.

remove_media_root(root_id: MediaRootId) → None

Stage removal of one resolver root from a read-bound edit.

An unbased transaction rejects before staging and remains open.

remove_metadata_property(target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef, property: MetadataProperty | tuple[str, str]) → None

Remove every assertion for a target/property in a read-bound edit.

An unbased transaction rejects before staging and remains open. Intervening property changes, including appends, conflict at commit.

renew_job_lease(lease: JobLease, duration: timedelta) → None

Stage renewal from current authority time for a checked duration.

request_job(request: JobRequest) → JobId

Stage one durable requested job.

retire_locator(locator_id: LocatorId) → None

Stage retirement of one superseded resource locator.

rollback() → None

Discard every staged mutation.

set_media_root_enabled(root_id: MediaRootId, enabled: bool) → None

Stage a resolver root’s enabled state from a read-bound edit.

An unbased transaction rejects before staging and remains open.

class postproject.EvidenceKind(*values)

Bases: Enum

Machine-readable reason supporting or opposing a candidate.

CONFLICTING_CANDIDATE = 'conflicting_candidate'
DISCOVERY_ERROR = 'discovery_error'
EXACT_FINGERPRINT_MATCH = 'exact_fingerprint_match'
FILE_NAME_MATCH = 'file_name_match'
FILE_SIZE_MATCH = 'file_size_match'
FINGERPRINT_MISMATCH = 'fingerprint_mismatch'
FINGERPRINT_NOT_VERIFIED = 'fingerprint_not_verified'
FULL_HASH_MATCH = 'full_hash_match'
KNOWN_LOCATOR_AVAILABLE = 'known_locator_available'
MEDIA_ROOT_RELATION = 'media_root_relation'
MEDIA_ROOT_UNAVAILABLE = 'media_root_unavailable'
MEDIA_ROOT_UNMAPPED = 'media_root_unmapped'
PARTIAL_FINGERPRINT_MATCH = 'partial_fingerprint_match'
RELATIVE_PATH_SIMILARITY = 'relative_path_similarity'
SEARCH_TRUNCATED = 'search_truncated'
class postproject.ExternalIdentifier(scheme: str, value: str, qualifier: str | None = None)

Bases: object

Opaque external identity preserved exactly as supplied.

qualifier: str | None
scheme: str
value: str
class postproject.ExternalIdentifierAddedEvent(target: 'ObjectReference', identifier: 'ExternalIdentifier')

Bases: object

identifier: ExternalIdentifier
target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef
class postproject.ExternalIdentifierRemovedEvent(target: 'ObjectReference', identifier: 'ExternalIdentifier')

Bases: object

identifier: ExternalIdentifier
target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef
class postproject.FileResourceInput(path: str, role: str, required: bool = True)

Bases: object

Filesystem source and membership semantics for a compound member.

path: str
required: bool
role: str
class postproject.FilteredRevisionPage(revisions: tuple[Revision, ...], through_sequence: int)

Bases: object

Matching revisions and the cursor for the next filtered page.

Every matching revision with a sequence up to through_sequence is in revisions.

revisions: tuple[Revision, ...]
through_sequence: int
class postproject.Fingerprint(algorithm: str, version: int, value: bytes)

Bases: object

Versioned, opaque content-identity evidence.

algorithm: str
value: bytes
version: int
exception postproject.FingerprintError(code: int, message: str)

Bases: PostProjectError

Media fingerprinting failed.

class postproject.FingerprintSnapshot(algorithm: str, version: int, value: bytes, observed_revision_sequence: int | None)

Bases: object

Fingerprint evidence captured at one semantic revision.

algorithm: str
observed_revision_sequence: int | None
value: bytes
version: int
class postproject.HostObjectBinding(production_id: ProductionId, object: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef)

Bases: object

Portable production-scoped reference stored by a host application.

object: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef
production_id: ProductionId
class postproject.ImageSequenceContent(resource_id: ResourceId, descriptor: ImageSequenceDescriptor)

Bases: object

One patterned resource with a compact sequence descriptor.

descriptor: ImageSequenceDescriptor
resource_id: ResourceId
class postproject.ImageSequenceDescriptor(start: int, end: int, step: int, rate_numerator: int, rate_denominator: int, missing_frames: tuple[int, ...])

Bases: object

What an image sequence is: frames, rate, and known gaps.

Its file names belong to each locator (see SequenceNaming).

end: int
missing_frames: tuple[int, ...]
property rate: Fraction

Exact sequence rate as a standard Fraction.

rate_denominator: int
rate_numerator: int
start: int
step: int
class postproject.ImageSequenceSource(directory: str | PathLike[str], naming: SequenceNaming, start: int, end: int, step: int, rate: Fraction, missing_frames: tuple[int, ...] = ())

Bases: object

Media source for one compact image sequence in a directory.

The directory and naming become the sequence’s first locator. rate is a positive exact fractions.Fraction.

directory: str | PathLike[str]
end: int
missing_frames: tuple[int, ...]
naming: SequenceNaming
rate: Fraction
start: int
step: int
class postproject.ImportedMedia(asset_id: AssetId, representation_id: RepresentationId)

Bases: object

Identities staged by import; only explicit commit makes them durable.

asset_id: AssetId
representation_id: RepresentationId
exception postproject.InternalError(code: int, message: str)

Bases: PostProjectError

The native library reported an internal invariant failure.

exception postproject.InvalidArgumentError(code: int, message: str)

Bases: PostProjectError, ValueError

An argument violates the public domain contract.

exception postproject.IoError(code: int, message: str)

Bases: PostProjectError, OSError

A filesystem or operating-system operation failed.

class postproject.KnownMediaMatch(asset_id: AssetId, representation_id: RepresentationId, resource_id: ResourceId)

Bases: object

One matching resource and its owning representation and asset.

asset_id: AssetId
representation_id: RepresentationId
resource_id: ResourceId
class postproject.Locator(id: 'LocatorId', uri: 'str', availability: 'LocatorAvailability', last_seen_unix_micros: 'int | None', sequence_naming: 'SequenceNaming | None' = None)

Bases: object

availability: LocatorAvailability
id: LocatorId
last_seen_unix_micros: int | None
sequence_naming: SequenceNaming | None

Naming of the files in the directory, exactly for a locator of an image-sequence resource.

uri: str
class postproject.LocatorAddedEvent(resource_id: 'ResourceId', locator_id: 'LocatorId')

Bases: object

locator_id: LocatorId
resource_id: ResourceId
class postproject.LocatorAvailability(*values)

Bases: Enum

Last observed availability of a resource locator.

OFFLINE = 'offline'
ONLINE = 'online'
UNKNOWN = 'unknown'
class postproject.LocatorIdentity(uri: str, sequence_naming: SequenceNaming | None = None)

Bases: object

Exact current locator evidence used to find known media.

Image-sequence identities include the directory URI and naming. A directory URI without naming does not match a sequence.

sequence_naming: SequenceNaming | None
uri: str
class postproject.LocatorMatch(resource_id: ResourceId, locator: Locator, media_root: str | None)

Bases: object

One locator-query result with its owning resource and logical root.

locator: Locator
media_root: str | None
resource_id: ResourceId
class postproject.LocatorRetiredEvent(resource_id: 'ResourceId', locator_id: 'LocatorId')

Bases: object

locator_id: LocatorId
resource_id: ResourceId
class postproject.MediaRoot(id: MediaRootId, name: str, label: str | None, legacy_uri: str | None, priority: int, enabled: bool)

Bases: object

Immutable configured resolver root.

enabled: bool
id: MediaRootId
label: str | None
legacy_uri: str | None
name: str
priority: int
class postproject.MediaRootAddedEvent(media_root_id: 'MediaRootId')

Bases: object

media_root_id: MediaRootId
class postproject.MediaRootEnabledChangedEvent(media_root_id: 'MediaRootId', enabled: 'bool')

Bases: object

enabled: bool
media_root_id: MediaRootId
class postproject.MediaRootRemovedEvent(media_root_id: 'MediaRootId')

Bases: object

media_root_id: MediaRootId
class postproject.MetadataAddedOrReplacedEvent(target: 'ObjectReference', property: 'MetadataProperty')

Bases: object

property: MetadataProperty
target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef
class postproject.MetadataAssertion(target: 'ObjectReference', property: 'MetadataProperty', value: 'MetadataValue')

Bases: object

property: MetadataProperty
target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef
value: str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[MetadataValue, ...]
class postproject.MetadataDecimal(coefficient: 'int', scale: 'int')

Bases: object

coefficient: int
scale: int
class postproject.MetadataLanguageString(value: 'str', language: 'str')

Bases: object

language: str
value: str
class postproject.MetadataProperty(vocabulary: str, property: str)

Bases: object

Vocabulary-qualified metadata property identity.

property: str
vocabulary: str
class postproject.MetadataReference(target: 'ObjectReference')

Bases: object

target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef
class postproject.MetadataRemovedEvent(target: 'ObjectReference', property: 'MetadataProperty')

Bases: object

property: MetadataProperty
target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef
class postproject.MetadataStruct(fields: 'tuple[MetadataStructField, ...]')

Bases: object

fields: tuple[MetadataStructField, ...]
class postproject.MetadataStructField(name: 'str', value: 'MetadataInput')

Bases: object

name: str
value: str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[MetadataValue, ...], ...] | Sequence[MetadataInput] | bytearray | memoryview
class postproject.MetadataTimestamp(unix_micros: 'int')

Bases: object

unix_micros: int
class postproject.MetadataU64(value: 'int')

Bases: object

value: int
class postproject.MetadataUri(value: 'str')

Bases: object

value: str
exception postproject.MigrationError(code: int, message: str)

Bases: PostProjectError

A production schema could not be migrated safely.

class postproject.MissingSequenceFrames(frames: tuple[int, ...])

Bases: object

Owned, sorted missing-frame observations.

frames: tuple[int, ...]
kind: ClassVar[AvailabilityIssueKind] = 'missing_frames'
class postproject.NativeLibrary(path: str | PathLike[str] | None = None)

Bases: object

One located PostProject shared library.

The library is the explicit path, else POSTPROJECT_LIBRARY, else the one a platform wheel installed inside this package. No other place is searched.

A library is loaded and checked once per resolved path; constructing it again returns the same instance.

check(status: int, error: _Pointer[Error]) → None

Release an optional native error and raise its Python equivalent.

lib: CDLL
path: Path
exception postproject.NotFoundError(code: int, message: str)

Bases: PostProjectError

A requested production object does not exist.

class postproject.OfflineResourceIssue

Bases: object

The resource has no credible locator.

kind: ClassVar[AvailabilityIssueKind] = 'offline_resource'
class postproject.OrderedPartsContent(members: Iterable[RepresentationMember])

Bases: object

Ordered required resources, with unique identities and explicit roles.

members: tuple[RepresentationMember, ...]
class postproject.OrderedPartsSource(parts: tuple[FileResourceInput, ...])

Bases: object

Media source for ordered, fully required files, such as camera spans.

parts: tuple[FileResourceInput, ...]
class postproject.OriginIdentity(name: str, version: str | None = None, uri: str | None = None)

Bases: object

Integrating application or process identity, not an authenticated user.

name: str
uri: str | None
version: str | None
class postproject.PackageContent(members: Iterable[RepresentationMember])

Bases: object

Required and optional resources, with at least one required member.

members: tuple[RepresentationMember, ...]
class postproject.PackageSource(members: tuple[FileResourceInput, ...])

Bases: object

Media source for role-bearing required and optional files.

members: tuple[FileResourceInput, ...]
exception postproject.PostProjectError(code: int, message: str)

Bases: RuntimeError

Base error reported by the native PostProject library.

class postproject.Production(native: NativeLibrary, handle: _Pointer[NativeProduction])

Bases: object

An owned native production handle supporting concurrent operations.

Calls may run from multiple threads, but close() must not overlap them.

property activities: tuple[Activity, ...]

Return every provenance activity in deterministic order.

property activities_consuming: _ActivitiesByRepresentation

Return consuming activities keyed by representation identity.

activities_consuming_page(representation_id: RepresentationId, *, limit: int, cursor: str | None = None) → QueryPage[Activity]

Return one bounded page of activities consuming a representation.

property activities_producing: _ActivitiesByRepresentation

Return producing activities keyed by representation identity.

activities_producing_page(representation_id: RepresentationId, *, limit: int, cursor: str | None = None) → QueryPage[Activity]

Return one bounded page of activities producing a representation.

apply_changes(path: str | PathLike[str], limits: ExchangeLimits | None = None) → ExchangePosition

Apply atomic records to a passive mirror; explicitly retry after loss.

Failure may retain an earlier complete prefix. Inspect after reopening and retry the same sealed file; verified duplicates create no revision.

artifact_reproducibility(representation_id: RepresentationId) → ArtifactReproducibility

Report whether stored knowledge is sufficient to reproduce an artifact.

asset(asset_id: AssetId) → Asset

Return one asset, raising NotFoundError when it is absent.

asset_exists(asset_id: AssetId) → bool

Return whether an asset identity belongs to this production.

assets_page(*, limit: int, cursor: str | None = None) → QueryPage[Asset]

Return one bounded asset page in creation and identity order.

changes_since(sequence: int, limit: int) → tuple[Revision, ...]

Return a bounded ascending page of revisions after sequence.

changes_since_filtered(sequence: int, kinds: Iterable[type[AssetImportedEvent | RepresentationAddedEvent | ResourceAddedEvent | RepresentationResourceAddedEvent | LocatorAddedEvent | LocatorRetiredEvent | MediaRootAddedEvent | MediaRootEnabledChangedEvent | MediaRootRemovedEvent | ExternalIdentifierAddedEvent | ExternalIdentifierRemovedEvent | MetadataAddedOrReplacedEvent | MetadataRemovedEvent | ActivityCreatedEvent | ActivityInputAddedEvent | ActivityOutputAddedEvent | ResourceFileFactsObservedEvent | ResourceFingerprintObservedEvent | RepresentationFingerprintObservedEvent | DependencySetRecordedEvent | JobRequestedEvent | JobClaimedEvent | JobClaimRenewedEvent | JobClaimReleasedEvent | JobSucceededEvent | JobFailedEvent | JobCancelledEvent]], limit: int = 100) → FilteredRevisionPage

Return revisions after sequence with an event of one of kinds.

kinds are event payload classes such as JobSucceededEvent. Continue from the returned through_sequence, which skips unrelated revisions without reading them.

close() → None

Release the native handle. Repeated calls are harmless.

classmethod create(path: str | PathLike[str], display_name: str | None = None, *, library_path: str | PathLike[str] | None = None) → Self

Create a new production without overwriting an existing path.

dependencies(representation_id: RepresentationId, *, max_depth: int, max_representations: int, limit: int, cursor: str | None = None) → QueryPage[DependencyMatch]

Return one bounded page of direct or transitive dependencies.

dependency_set(representation_id: RepresentationId) → DependencySet | None

Return recorded dependency knowledge, preserving absent versus empty.

dependents(target: AssetRef | RepresentationRef, *, max_depth: int, max_representations: int, limit: int, cursor: str | None = None) → QueryPage[DependencyMatch]

Return one bounded page of direct or transitive dependents.

edit(base: DecisionBase | None = None, *, origin: OriginIdentity | str | None = None, message: str | None = None) → Edit

Begin an additive or detached decision edit requiring explicit commit.

Omit base for additive writes. Pass the decision_base copied from a read session for decisions after closing that view. Use view.edit() when staging needs the exact retained knowledge. Uncommitted context exit rolls back; a failed commit is terminal.

evaluate_artifact(representation_id: RepresentationId, *, max_depth: int = 64, max_representations: int = 1000) → ArtifactEvaluation

Evaluate stored artifact evidence without accessing media files.

property exchange_state: ExchangeState

Copy coherent role, source scope, limits, floor and available head.

export_changes(position: ExchangePosition, path: str | PathLike[str]) → ExchangePosition

Publish exact complete records through one pinned source head.

export_checkpoint(path: str | PathLike[str]) → ExchangePosition

Exclusively publish a sealed checkpoint from one pinned view.

property external_identifiers: _ExternalIdentifiers

Return external identifiers keyed by their target object.

find_known_media(source: str | PathLike[str] | LocatorIdentity | Fingerprint, *, limit: int, cursor: str | None = None) → QueryPage[KnownMediaMatch]

Find ownership candidates by file path, exact locator or fingerprint.

Paths must exist for canonicalization; lookup never hashes their bytes. Sequences require a LocatorIdentity with exact naming. Follow the page continuation before treating candidates as complete; lookup never adopts or merges identity. Strings are paths, not guessed URI inputs.

property host_bindings: _HostBindings

Return the portable host-binding formatter and parser.

property id: ProductionId

Return this production’s stable identity.

classmethod import_checkpoint(path: str | PathLike[str], destination: str | PathLike[str], limits: ExchangeLimits | None = None, *, library_path: str | PathLike[str] | None = None) → Self

Create a passive mirror without overwriting an existing destination.

import_job_lease(token: str) → JobLease

Import an explicit worker credential and check current authority.

job(job_id: JobId) → Job

Return one durable job, raising NotFoundError when absent.

jobs(*, limit: int, cursor: str | None = None, state: JobState | None = None, kind: str | None = None) → QueryPage[Job]

Return one bounded job page with optional exact predicates.

property latest_revision: Revision | None

Return the newest committed revision, if one exists.

locators_page(resource_id: ResourceId, *, limit: int, cursor: str | None = None) → QueryPage[LocatorMatch]

Return one bounded page of locators belonging to a resource.

property media_roots: tuple[MediaRoot, ...]

Return resolver roots in priority order, with a 1000-root cap.

media_roots_page(*, limit: int, cursor: str | None = None) → QueryPage[MediaRoot]

Read a bounded root page in priority and identity order.

property metadata: _Metadata

Return metadata assertions keyed by their target object.

property metadata_by_property: _MetadataByProperty

Return metadata assertions keyed by vocabulary-qualified property.

property objects_by_external_identifier: _ObjectsByExternalIdentifier

Return object matches keyed by (scheme, value).

A (scheme, value, qualifier) key matches only identifiers with exactly that qualifier; a two-element key matches any qualifier.

objects_changed_since(sequence: int, *, limit: int, cursor: str | None = None) → QueryPage[ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef]

Return distinct semantic objects touched after revision sequence.

classmethod open(path: str | PathLike[str], *, library_path: str | PathLike[str] | None = None) → Self

Open an existing production.

outputs_by_activity_kind(kind: str, *, limit: int, cursor: str | None = None) → QueryPage[RepresentationId]

Return outputs produced by activities of one exact kind.

outputs_by_tool(tool: ToolIdentity, *, limit: int, cursor: str | None = None) → QueryPage[RepresentationId]

Return outputs produced by activities with one exact tool identity.

plan_regeneration(artifact_representation_ids: Iterable[RepresentationId]) → tuple[RegenerationJobPlan, ...]

Derive job proposals without enqueuing or executing them.

proposal_builder(client_id: ClientId, request_id: RequestId, *, base: DecisionBase | ProtocolBase | None = None, context: RevisionContext | None = None) → ProposalBuilder

Stage typed command collections; closing never writes a revision.

property provenance_ancestors: _ProvenanceRepresentations

Return transitive ancestors keyed by representation identity.

provenance_ancestors_page(representation_id: RepresentationId, *, max_depth: int, max_representations: int, limit: int, cursor: str | None = None) → QueryPage[ProvenanceMatch]

Return one bounded page of shortest-depth provenance ancestors.

property provenance_descendants: _ProvenanceRepresentations

Return transitive descendants keyed by representation identity.

provenance_descendants_page(representation_id: RepresentationId, *, max_depth: int, max_representations: int, limit: int, cursor: str | None = None) → QueryPage[ProvenanceMatch]

Return one bounded page of shortest-depth provenance descendants.

query_metadata(property: MetadataProperty | tuple[str, str], *, limit: int, cursor: str | None = None, value: str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[MetadataValue, ...], ...] | Sequence[str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[MetadataValue, ...], ...] | Sequence[MetadataInput] | bytearray | memoryview] | bytearray | memoryview | None = None) → QueryPage[MetadataAssertion]

Return one bounded assertion page with an optional exact scalar value.

read_session() → ReadSession

Open a pinned view with its production and revision captured together.

representation(representation_id: RepresentationId) → Representation

Return one representation, raising NotFoundError when absent.

property representations: _Representations

Return immutable representation snapshots keyed by asset identity.

representations_page(asset_id: AssetId, *, limit: int, cursor: str | None = None) → QueryPage[Representation]

Return one bounded page of representations belonging to an asset.

representations_under_media_root(root_name: str, *, limit: int, cursor: str | None = None) → QueryPage[Representation]

Return one bounded page of representations located under a root.

representations_using_resource(resource_id: ResourceId, *, limit: int, cursor: str | None = None) → QueryPage[Representation]

Return one bounded page of representations that use a resource.

property resolutions: _Resolutions

Return representation-resolution results keyed by asset identity.

resolve(asset_ids: AssetId | Iterable[AssetId], root_mappings: Mapping[str, str | PathLike[str]] | None = None, *, search_directories: Iterable[str | PathLike[str]] = (), verification: VerificationMode = VerificationMode.PRESENCE, max_depth: int = 64, max_entries_per_directory: int = 100000, cancel_token: CancelToken | None = None) → tuple[RepresentationResolution, ...]

Resolve one or more assets, scanning the search scope once.

root_mappings map logical roots to this machine’s directories and search_directories are unnamed places searched after them; neither is recorded. Results cover every representation of each asset, in asset order. A cancelled cancel_token raises CancelledError.

resources_page(representation_id: RepresentationId, *, limit: int, cursor: str | None = None) → QueryPage[ResourceId]

Return one bounded page of resources in representation order.

resynchronize_history(base: ProtocolBase, *, records: int, encoded_bytes: int) → ExchangePosition

Explicitly recover incomplete authority history, preserving old evidence.

property revision_events: _RevisionEvents

Return semantic event lists keyed by revision identity.

revision_events_page(revision_id: RevisionId, *, limit: int, cursor: str | None = None) → QueryPage[RevisionEvent]

Return one bounded page of immutable events in position order.

revision_waiter() → RevisionWaiter

Create a waiter that blocks until new revisions are committed.

The waiter observes commits from this production immediately and from other processes by polling. Closing the production closes it.

stale_artifacts(*, max_depth: int, max_representations: int, limit: int, cursor: str | None = None, source: RepresentationId | None = None) → QueryPage[RepresentationId]

Return produced representations currently evaluated as stale.

source restricts the query to its provenance descendants; the depth and representation bounds apply to each artifact evaluation.

submission_outcome(identity: RequestIdentity) → SubmissionOutcome

Copy the original public result; absent request raises NotFoundError.

submit_proposal(proposal: Proposal, *, leases: Iterable[JobLease] = (), private_tokens: Iterable[str] = ()) → SubmissionResult

Submit once; recover public facts separately from fresh worker delivery.

Private context is borrowed explicitly, without exporting a token or checking current ownership before the retained native request lookup.

unresolved_media(*, limit: int, cursor: str | None = None) → QueryPage[RepresentationId]

Return representations whose required resources lack locators.

classmethod validate_checkpoint(path: str | PathLike[str], limits: ExchangeLimits | None = None, *, library_path: str | PathLike[str] | None = None) → ExchangePosition

Validate all domain facts in private temporary storage.

verify_resource(resource_id: ResourceId, path: str | PathLike[str], *, sequence_naming: SequenceNaming | None = None) → ContentVerification

Compare the content at path with the resource’s stored fingerprints.

Only fingerprint domains PostProject computes are compared; a resource with only foreign fingerprints is NOT_COMPARABLE. For an image sequence, path is its directory and sequence_naming names its files; None means the naming recorded for that directory.

class postproject.ProductionRef(id: ProductionId)

Bases: object

Explicit production target for polymorphic operations.

id: ProductionId
class postproject.ProvenanceMatch(representation_id: RepresentationId, depth: int)

Bases: object

One provenance-query representation and its shortest observed depth.

depth: int
representation_id: RepresentationId
class postproject.QueryPage(items: tuple[QueryItem, ...], next_cursor: str | None, traversal_truncated: bool = False)

Bases: Generic[QueryItem]

One bounded page from a named domain query.

items: tuple[QueryItem, ...]
next_cursor: str | None
traversal_truncated: bool
class postproject.ReadSession(native: NativeLibrary, handle: _Pointer[_abi.ReadSession])

Bases: object

Owned pinned view; copied results outlive close, further reads reject.

activities_consuming_page(representation_id: RepresentationId, *, limit: int, cursor: str | None = None) → QueryPage[Activity]

Return one bounded page of activities consuming a representation.

activities_producing_page(representation_id: RepresentationId, *, limit: int, cursor: str | None = None) → QueryPage[Activity]

Return one bounded page of activities producing a representation.

artifact_reproducibility(representation_id: RepresentationId) → ArtifactReproducibility

Report whether stored knowledge is sufficient to reproduce an artifact.

asset(asset_id: AssetId) → Asset

Return one asset, raising NotFoundError when it is absent.

assets(*, page_size: int = 100) → Iterator[Asset]

Iterate bounded asset pages in this explicitly owned snapshot.

Page size is validated immediately. Each advance requires an open session, including advances through buffered values. Copied assets outlive close; closing this iterator does not close the session.

assets_page(*, limit: int, cursor: str | None = None) → QueryPage[Asset]

Return one bounded asset page in creation and identity order.

changes_since(sequence: int, limit: int) → tuple[Revision, ...]

Return a bounded ascending page of revisions after sequence.

changes_since_filtered(sequence: int, kinds: Iterable[type[AssetImportedEvent | RepresentationAddedEvent | ResourceAddedEvent | RepresentationResourceAddedEvent | LocatorAddedEvent | LocatorRetiredEvent | MediaRootAddedEvent | MediaRootEnabledChangedEvent | MediaRootRemovedEvent | ExternalIdentifierAddedEvent | ExternalIdentifierRemovedEvent | MetadataAddedOrReplacedEvent | MetadataRemovedEvent | ActivityCreatedEvent | ActivityInputAddedEvent | ActivityOutputAddedEvent | ResourceFileFactsObservedEvent | ResourceFingerprintObservedEvent | RepresentationFingerprintObservedEvent | DependencySetRecordedEvent | JobRequestedEvent | JobClaimedEvent | JobClaimRenewedEvent | JobClaimReleasedEvent | JobSucceededEvent | JobFailedEvent | JobCancelledEvent]], limit: int = 100) → FilteredRevisionPage

Return revisions after sequence with an event of one of kinds.

kinds are event payload classes such as JobSucceededEvent. Continue from the returned through_sequence, which skips unrelated revisions without reading them.

close() → None

Release the pinned view; repeated calls are harmless.

property decision_base: DecisionBase

Detach the revision and production captured with this view.

dependencies(representation_id: RepresentationId, *, max_depth: int, max_representations: int, limit: int, cursor: str | None = None) → QueryPage[DependencyMatch]

Return one bounded page of direct or transitive dependencies.

dependency_set(representation_id: RepresentationId) → DependencySet | None

Return recorded dependency knowledge, preserving absent versus empty.

dependents(target: AssetRef | RepresentationRef, *, max_depth: int, max_representations: int, limit: int, cursor: str | None = None) → QueryPage[DependencyMatch]

Return one bounded page of direct or transitive dependents.

edit(*, origin: OriginIdentity | str | None = None, message: str | None = None) → Edit

Begin a decision edit retaining this view’s exact read knowledge.

evaluate_artifact(representation_id: RepresentationId, *, max_depth: int = 64, max_representations: int = 1000) → ArtifactEvaluation

Evaluate stored artifact evidence without accessing media files.

external_identifiers(target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef) → tuple[ExternalIdentifier, ...]

Return every external identifier attached to target.

find_by_external_identifier(scheme: str, value: str, qualifier: str | None) → tuple[ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef, ...]

Find objects carrying an exact external scheme, value, and qualifier.

find_known_media(source: str | PathLike[str] | LocatorIdentity | Fingerprint, *, limit: int, cursor: str | None = None) → QueryPage[KnownMediaMatch]

Find ownership candidates by file path, exact locator or fingerprint.

Paths must exist for canonicalization; lookup never hashes their bytes. Sequences require a LocatorIdentity with exact naming. Follow the page continuation before treating candidates as complete; lookup never adopts or merges identity. Strings are paths, not guessed URI inputs.

job(job_id: JobId) → Job

Return one durable job, raising NotFoundError when absent.

jobs(*, limit: int, cursor: str | None = None, state: JobState | None = None, kind: str | None = None) → QueryPage[Job]

Return one bounded job page with optional exact predicates.

property latest_revision: Revision | None

Return the newest committed revision, if one exists.

locators_page(resource_id: ResourceId, *, limit: int, cursor: str | None = None) → QueryPage[LocatorMatch]

Return one bounded page of locators belonging to a resource.

property media_roots: tuple[MediaRoot, ...]

Return resolver roots in priority order, with a 1000-root cap.

media_roots_page(*, limit: int, cursor: str | None = None) → QueryPage[MediaRoot]

Read a bounded root page in priority and identity order.

metadata(target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef) → tuple[MetadataAssertion, ...]

Return copied metadata assertions for one object in this view.

metadata_by_property(property: MetadataProperty | tuple[str, str]) → tuple[MetadataAssertion, ...]

Return copied assertions of one property in this view.

objects_changed_since(sequence: int, *, limit: int, cursor: str | None = None) → QueryPage[ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef]

Return distinct semantic objects touched after revision sequence.

outputs_by_activity_kind(kind: str, *, limit: int, cursor: str | None = None) → QueryPage[RepresentationId]

Return outputs produced by activities of one exact kind.

outputs_by_tool(tool: ToolIdentity, *, limit: int, cursor: str | None = None) → QueryPage[RepresentationId]

Return outputs produced by activities with one exact tool identity.

plan_regeneration(artifact_representation_ids: Iterable[RepresentationId]) → tuple[RegenerationJobPlan, ...]

Derive job proposals from this view without enqueuing or executing them.

provenance_ancestors_page(representation_id: RepresentationId, *, max_depth: int, max_representations: int, limit: int, cursor: str | None = None) → QueryPage[ProvenanceMatch]

Return one bounded page of shortest-depth provenance ancestors.

provenance_descendants_page(representation_id: RepresentationId, *, max_depth: int, max_representations: int, limit: int, cursor: str | None = None) → QueryPage[ProvenanceMatch]

Return one bounded page of shortest-depth provenance descendants.

query_metadata(property: MetadataProperty | tuple[str, str], *, limit: int, cursor: str | None = None, value: str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[MetadataValue, ...], ...] | Sequence[str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[str | bool | int | bytes | Fraction | MetadataLanguageString | MetadataU64 | MetadataDecimal | MetadataTimestamp | MetadataUri | MetadataStruct | MetadataReference | tuple[MetadataValue, ...], ...] | Sequence[MetadataInput] | bytearray | memoryview] | bytearray | memoryview | None = None) → QueryPage[MetadataAssertion]

Return one bounded assertion page with an optional exact scalar value.

representation(representation_id: RepresentationId) → Representation

Return one representation, raising NotFoundError when absent.

representations_page(asset_id: AssetId, *, limit: int, cursor: str | None = None) → QueryPage[Representation]

Return one bounded page of representations belonging to an asset.

representations_under_media_root(root_name: str, *, limit: int, cursor: str | None = None) → QueryPage[Representation]

Return one bounded page of representations located under a root.

representations_using_resource(resource_id: ResourceId, *, limit: int, cursor: str | None = None) → QueryPage[Representation]

Return one bounded page of representations that use a resource.

resolve(asset_ids: AssetId | Iterable[AssetId], root_mappings: Mapping[str, str | PathLike[str]] | None = None, *, search_directories: Iterable[str | PathLike[str]] = (), verification: VerificationMode = VerificationMode.PRESENCE, max_depth: int = 64, max_entries_per_directory: int = 100000, cancel_token: CancelToken | None = None) → tuple[RepresentationResolution, ...]

Resolve current files using this view’s stored media knowledge.

resources_page(representation_id: RepresentationId, *, limit: int, cursor: str | None = None) → QueryPage[ResourceId]

Return one bounded page of resources in representation order.

revision_events_page(revision_id: RevisionId, *, limit: int, cursor: str | None = None) → QueryPage[RevisionEvent]

Return one bounded page of events visible in this retained view.

revisions(*, after: int = 0, page_size: int = 100) → Iterator[Revision]

Scan copied revision summaries in ascending order within this view.

This is a finite scan of the pinned history, not a live subscription. Page size bounds each native read; the complete scan has no total cap. Closing the session invalidates unstarted and buffered advances.

stale_artifacts(*, max_depth: int, max_representations: int, limit: int, cursor: str | None = None, source: RepresentationId | None = None) → QueryPage[RepresentationId]

Return produced representations currently evaluated as stale.

source restricts the query to its provenance descendants; the depth and representation bounds apply to each artifact evaluation.

unresolved_media(*, limit: int, cursor: str | None = None) → QueryPage[RepresentationId]

Return representations whose required resources lack locators.

verify_resource(resource_id: ResourceId, path: str | PathLike[str], *, sequence_naming: SequenceNaming | None = None) → ContentVerification

Compare current files with resource fingerprints in this view.

class postproject.RegisteredOutputs(activity_id: ActivityId, outputs: tuple[ImportedMedia, ...])

Bases: object

Staged identities and the actual producer; explicit commit makes them durable.

activity_id: ActivityId
outputs: tuple[ImportedMedia, ...]
class postproject.RelinkLocation(resource_id: ResourceId, candidate: ResolutionCandidate)

Bases: object

Copied resource and candidate, including its verification evidence.

candidate: ResolutionCandidate
resource_id: ResourceId
class postproject.RelinkSelection(base: DecisionBase, representation_id: RepresentationId, locations: tuple[RelinkLocation, ...])

Bases: object

Copied locations with the original database decision; no filesystem lock.

base: DecisionBase
locations: tuple[RelinkLocation, ...]
representation_id: RepresentationId
class postproject.Representation(id: 'RepresentationId', asset_id: 'AssetId', kind: 'RepresentationKind', content: 'RepresentationContent', fingerprints: 'tuple[Fingerprint, ...]', resources: 'tuple[Resource, ...]')

Bases: object

asset_id: AssetId
content: SingleResourceContent | ImageSequenceContent | OrderedPartsContent | PackageContent
fingerprints: tuple[Fingerprint, ...]
id: RepresentationId
property image_sequence: ImageSequenceDescriptor | None

Sequence descriptor exactly for sequence content.

kind: RepresentationKind
property members: tuple[RepresentationMember, ...]

Membership derived from the content alternative.

resources: tuple[Resource, ...]
property structure_kind: ContentStructureKind

Category derived from the stored content alternative.

class postproject.RepresentationAddedEvent(asset_id: 'AssetId', representation_id: 'RepresentationId')

Bases: object

asset_id: AssetId
representation_id: RepresentationId
class postproject.RepresentationAvailability(*values)

Bases: Enum

Aggregate availability of a complete representation.

AMBIGUOUS = 'ambiguous'
ERROR = 'error'
OFFLINE = 'offline'
ONLINE = 'online'
PARTIAL = 'partial'
class postproject.RepresentationFingerprintObservedEvent(representation_id: 'RepresentationId', algorithm: 'str', version: 'int')

Bases: object

algorithm: str
representation_id: RepresentationId
version: int
class postproject.RepresentationKind(*values)

Bases: Enum

Semantic role of an asset representation.

DERIVED = 'derived'
OPTIMIZED = 'optimized'
ORIGINAL = 'original'
PROXY = 'proxy'
class postproject.RepresentationMember(resource_id: 'ResourceId', role: 'str | None', required: 'bool')

Bases: object

required: bool
resource_id: ResourceId
role: str | None
class postproject.RepresentationRef(id: RepresentationId)

Bases: object

Explicit representation target for polymorphic operations.

id: RepresentationId
class postproject.RepresentationResolution(asset_id: 'AssetId', representation_id: 'RepresentationId', availability: 'RepresentationAvailability', resources: 'tuple[ResourceResolution, ...]', issues: 'tuple[AvailabilityIssue, ...]', _selection: 'RelinkSelection | None' = None, _selection_error: 'str | None' = None)

Bases: object

asset_id: AssetId
availability: RepresentationAvailability
issues: tuple[AvailabilityIssue, ...]
representation_id: RepresentationId
resources: tuple[ResourceResolution, ...]
select_verified() → RelinkSelection

Select this representation’s verified locations without more media I/O.

Requires complete required content and unique full verification, with no failed or truncated search. Optional unverified members are omitted. The selection keeps the original coherent decision after the view closes.

class postproject.RepresentationResourceAddedEvent(representation_id: 'RepresentationId', resource_id: 'ResourceId', structural_position: 'int')

Bases: object

representation_id: RepresentationId
resource_id: ResourceId
structural_position: int
class postproject.ReproducibilityInputMissing(activity_id: ActivityId, representation_id: RepresentationId)

Bases: object

A producing activity references an absent input representation.

activity_id: ActivityId
kind: ClassVar[ArtifactReproducibilityIssueKind] = 'input_representation_missing'
representation_id: RepresentationId
class postproject.ReproducibilityParametersMissing(activity_id: ActivityId)

Bases: object

The producing activity has no recorded parameters.

activity_id: ActivityId
kind: ClassVar[ArtifactReproducibilityIssueKind] = 'parameters_missing'
class postproject.ReproducibilityProducerAmbiguous(activity_count: int)

Bases: object

Several activities claim to have produced the artifact.

activity_count: int
kind: ClassVar[ArtifactReproducibilityIssueKind] = 'producing_activity_ambiguous'
class postproject.ReproducibilityProducerMissing

Bases: object

No activity records how the artifact was produced.

kind: ClassVar[ArtifactReproducibilityIssueKind] = 'producing_activity_missing'
class postproject.ReproducibilityToolMissing(activity_id: ActivityId)

Bases: object

The producing activity has no tool identity.

activity_id: ActivityId
kind: ClassVar[ArtifactReproducibilityIssueKind] = 'tool_identity_missing'
class postproject.ResolutionCandidate(uri: 'str', confidence_basis_points: 'int', media_root: 'str | None', sequence_naming: 'SequenceNaming | None', evidence: 'tuple[ResolutionEvidence, ...]')

Bases: object

confidence_basis_points: int
evidence: tuple[ResolutionEvidence, ...]
media_root: str | None

Logical root the candidate was found under; None for a candidate found only in an unnamed search directory.

sequence_naming: SequenceNaming | None

Naming the image-sequence files were found under; confirm the candidate with it. None for any other resource.

uri: str
class postproject.ResolutionEvidence(kind: EvidenceKind, detail: str | None = None)

Bases: object

Copied diagnostic evidence with a known category.

detail: str | None
kind: EvidenceKind
class postproject.Resource(id: 'ResourceId', file_size: 'int | None', modified_at_unix_micros: 'int | None', fingerprints: 'tuple[Fingerprint, ...]', locators: 'tuple[Locator, ...]')

Bases: object

file_size: int | None
fingerprints: tuple[Fingerprint, ...]
id: ResourceId
locators: tuple[Locator, ...]
modified_at_unix_micros: int | None
class postproject.ResourceAddedEvent(resource_id: 'ResourceId')

Bases: object

resource_id: ResourceId
class postproject.ResourceAmbiguous(candidates: tuple[ResolutionCandidate, ...])

Bases: object

Two or more candidates require an explicit caller decision.

candidates: tuple[ResolutionCandidate, ...]
state: ClassVar[ResourceResolutionState] = 'ambiguous'
class postproject.ResourceErrorIssue

Bases: object

Resource discovery or verification failed.

kind: ClassVar[AvailabilityIssueKind] = 'resource_error'
class postproject.ResourceFileFactsObservedEvent(resource_id: 'ResourceId')

Bases: object

resource_id: ResourceId
class postproject.ResourceFingerprintObservedEvent(resource_id: 'ResourceId', algorithm: 'str', version: 'int')

Bases: object

algorithm: str
resource_id: ResourceId
version: int
class postproject.ResourceOffline

Bases: object

No credible candidate was found.

state: ClassVar[ResourceResolutionState] = 'offline'
class postproject.ResourceOnlineAtKnownLocator(candidate: ResolutionCandidate)

Bases: _SingleResolutionCandidate

One persisted locator is available.

state: ClassVar[ResourceResolutionState] = 'online_at_known_locator'
class postproject.ResourceRef(id: ResourceId)

Bases: object

Explicit resource target for polymorphic operations.

id: ResourceId
class postproject.ResourceResolution(resource_id: ResourceId, outcome: ResourceOnlineAtKnownLocator | ResourceResolvedExact | ResourceResolvedProbable | ResourceOffline | ResourceAmbiguous | ResourceResolutionFailure, evidence: tuple[ResolutionEvidence, ...])

Bases: object

Owned resource facts with one checked resolution outcome.

property candidates: tuple[ResolutionCandidate, ...]

Applicable candidates derived from the outcome.

evidence: tuple[ResolutionEvidence, ...]
outcome: ResourceOnlineAtKnownLocator | ResourceResolvedExact | ResourceResolvedProbable | ResourceOffline | ResourceAmbiguous | ResourceResolutionFailure
resource_id: ResourceId
property state: ResourceResolutionState

Display category derived from the outcome.

class postproject.ResourceResolutionFailure

Bases: object

Discovery or verification could not complete safely.

state: ClassVar[ResourceResolutionState] = 'error'
class postproject.ResourceResolutionState(*values)

Bases: Enum

Outcome of resolving one storage resource.

AMBIGUOUS = 'ambiguous'
ERROR = 'error'
OFFLINE = 'offline'
ONLINE_AT_KNOWN_LOCATOR = 'online_at_known_locator'
RESOLVED_EXACT = 'resolved_exact'
RESOLVED_PROBABLE = 'resolved_probable'
class postproject.ResourceResolvedExact(candidate: ResolutionCandidate)

Bases: _SingleResolutionCandidate

One candidate has exact identity evidence.

state: ClassVar[ResourceResolutionState] = 'resolved_exact'
class postproject.ResourceResolvedProbable(candidate: ResolutionCandidate)

Bases: _SingleResolutionCandidate

One candidate requires a caller decision before confirmation.

state: ClassVar[ResourceResolutionState] = 'resolved_probable'
class postproject.Revision(id: RevisionId, sequence: int, transaction_id: TransactionId, committed_at_unix_micros: int, origin: OriginIdentity | None, message: str | None)

Bases: object

One committed production mutation transaction.

committed_at_unix_micros: int
id: RevisionId
message: str | None
origin: OriginIdentity | None
sequence: int
transaction_id: TransactionId
class postproject.RevisionContext(origin: OriginIdentity | None = None, message: str | None = None)

Bases: object

Optional context applied to a transaction’s future revision.

message: str | None
origin: OriginIdentity | None
class postproject.RevisionEvent(position: int, payload: AssetImportedEvent | RepresentationAddedEvent | ResourceAddedEvent | RepresentationResourceAddedEvent | LocatorAddedEvent | LocatorRetiredEvent | MediaRootAddedEvent | MediaRootEnabledChangedEvent | MediaRootRemovedEvent | ExternalIdentifierAddedEvent | ExternalIdentifierRemovedEvent | MetadataAddedOrReplacedEvent | MetadataRemovedEvent | ActivityCreatedEvent | ActivityInputAddedEvent | ActivityOutputAddedEvent | ResourceFileFactsObservedEvent | ResourceFingerprintObservedEvent | RepresentationFingerprintObservedEvent | DependencySetRecordedEvent | JobRequestedEvent | JobClaimedEvent | JobClaimRenewedEvent | JobClaimReleasedEvent | JobSucceededEvent | JobFailedEvent | JobCancelledEvent)

Bases: object

One ordered semantic event within a revision.

payload: AssetImportedEvent | RepresentationAddedEvent | ResourceAddedEvent | RepresentationResourceAddedEvent | LocatorAddedEvent | LocatorRetiredEvent | MediaRootAddedEvent | MediaRootEnabledChangedEvent | MediaRootRemovedEvent | ExternalIdentifierAddedEvent | ExternalIdentifierRemovedEvent | MetadataAddedOrReplacedEvent | MetadataRemovedEvent | ActivityCreatedEvent | ActivityInputAddedEvent | ActivityOutputAddedEvent | ResourceFileFactsObservedEvent | ResourceFingerprintObservedEvent | RepresentationFingerprintObservedEvent | DependencySetRecordedEvent | JobRequestedEvent | JobClaimedEvent | JobClaimRenewedEvent | JobClaimReleasedEvent | JobSucceededEvent | JobFailedEvent | JobCancelledEvent
position: int
class postproject.RevisionObserver(production: Production, callback: Callable[[Revision, tuple[RevisionEvent, ...]], object], *, after_sequence: int = 0, kinds: Iterable[type[AssetImportedEvent | RepresentationAddedEvent | ResourceAddedEvent | RepresentationResourceAddedEvent | LocatorAddedEvent | LocatorRetiredEvent | MediaRootAddedEvent | MediaRootEnabledChangedEvent | MediaRootRemovedEvent | ExternalIdentifierAddedEvent | ExternalIdentifierRemovedEvent | MetadataAddedOrReplacedEvent | MetadataRemovedEvent | ActivityCreatedEvent | ActivityInputAddedEvent | ActivityOutputAddedEvent | ResourceFileFactsObservedEvent | ResourceFingerprintObservedEvent | RepresentationFingerprintObservedEvent | DependencySetRecordedEvent | JobRequestedEvent | JobClaimedEvent | JobClaimRenewedEvent | JobClaimReleasedEvent | JobSucceededEvent | JobFailedEvent | JobCancelledEvent]] | None = None)

Bases: object

Delivers new revisions to callback on a thread the observer owns.

callback(revision, events) runs on the observer thread for each revision after after_sequence; with kinds, only for revisions that contain an event of one of those payload classes. Stop the observer before closing the production. An exception from the callback or a query ends observation and is kept in error.

property cursor: int

Sequence of the last fully delivered revision or filtered page.

property error: BaseException | None

The exception that ended observation, if any.

stop() → None

Cancel the wait and join the observer thread.

Called from the callback, it only cancels.

class postproject.RevisionWait(result: RevisionWaitResult, revisions: tuple[Revision, ...])

Bases: object

Outcome of one bounded revision wait.

revisions is non-empty only for RevisionWaitResult.REVISIONS. Closed and cancelled results are terminal for the waiter.

result: RevisionWaitResult
revisions: tuple[Revision, ...]
class postproject.RevisionWaitResult(*values)

Bases: Enum

Why a revision wait returned.

CANCELLED = 'cancelled'
CLOSED = 'closed'
REVISIONS = 'revisions'
TIMED_OUT = 'timed_out'
class postproject.RevisionWaiter(native: NativeLibrary, handle: _Pointer[NativeRevisionWaiter])

Bases: object

Blocks until revisions after a sequence are committed.

The waiter owns its own connection to the production file, so a wait never blocks other calls on the production. Waits must not overlap one another or close(); cancel() may be called from any thread at any time.

cancel() → None

End the current wait; later waits return CANCELLED.

close() → None

Release the native waiter. Repeated calls are harmless.

wait(after_sequence: int, *, limit: int = 100, timeout: float = 60.0) → RevisionWait

Wait up to timeout seconds (at most 60) for revisions.

A zero timeout checks once. The GIL is released while waiting.

class postproject.SequenceNaming(prefix: str, suffix: str, padding: int)

Bases: object

How the files of an image sequence are named in one directory.

A file is named by the prefix, the frame number zero-padded to at least padding digits, and the suffix. A naming belongs to a locator, not to the sequence: copies of one sequence may name their files differently.

filename(frame: int) → str

Return the file name of one frame, without a directory.

padding: int
prefix: str
suffix: str
class postproject.SingleResourceContent(resource_id: ResourceId)

Bases: object

One required storage resource.

resource_id: ResourceId
exception postproject.StorageError(code: int, message: str)

Bases: PostProjectError

Persistent production data could not be read or written safely.

class postproject.ToolIdentity(name: 'str', version: 'str | None' = None, uri: 'str | None' = None)

Bases: object

name: str
uri: str | None
version: str | None
class postproject.TransactionConflict(key: ConflictKey, base_revision_id: RevisionId | None, base_revision_sequence: int, superseding_revision_id: RevisionId, superseding_revision_sequence: int)

Bases: object

Machine-readable detail for one optimistic transaction conflict.

base_revision_id: RevisionId | None
base_revision_sequence: int
key: ConflictKey
superseding_revision_id: RevisionId
superseding_revision_sequence: int
exception postproject.UnsupportedError(code: int, message: str)

Bases: PostProjectError

The requested operation is not supported by the current ABI.

class postproject.VerificationMode(*values)

Bases: Enum

Cost tier for resources found at a known locator.

CONTENT = 'content'
PRESENCE = 'presence'
postproject.file_locator(path: str | PathLike[str], *, library_path: str | PathLike[str] | None = None) → str

Return the canonical file: locator URI import records for a path.

Compare locators only through URIs returned here or read from a production.

postproject.fingerprint_file(path: str | PathLike[str], *, library_path: str | PathLike[str] | None = None) → Fingerprint

Compute the fingerprint import records for a regular file.

postproject.locator_file_path(uri: str, *, library_path: str | PathLike[str] | None = None) → Path

Convert a local file: locator URI to a path, which need not exist.

postproject.parse_id(text: str, kind: Callable[[UUID], Identity]) → Identity

Parse UUID text and annotate its kind; the store checks existence/scope.

Worker API

Durable requests, claims and leases are optional worker functionality.

Explicit durable work, claims and leases.

class postproject.jobs.ActiveJobLease(expires_at_unix_micros: int)

Bases: object

Cached accepted expiry; mutations still recheck authoritative state.

expires_at_unix_micros: int
class postproject.jobs.ClosedJobLease

Bases: object

Ownership ended; freeing the handle remains necessary.

class postproject.jobs.Job(id: JobId, kind: str, inputs: tuple[RepresentationId, ...], output_asset_id: AssetId, output_representation_kind: RepresentationKind, target_root: str | None, status: JobRequested | JobClaim | JobCompletion | JobFailure | JobCancelled)

Bases: object

One durable production-work request.

property claim: JobClaim | None

Claim detail when claimed; otherwise None.

property completion: JobCompletion | None

Completion detail when succeeded; otherwise None.

property failure_diagnostic: str | None

Diagnostic when failed; otherwise None.

id: JobId
inputs: tuple[RepresentationId, ...]
kind: str
output_asset_id: AssetId
output_representation_kind: RepresentationKind
property state: JobState

Category of the active status alternative.

status: JobRequested | JobClaim | JobCompletion | JobFailure | JobCancelled
target_root: str | None
class postproject.jobs.JobCancelled

Bases: object

A request cancelled by its coordinator.

class postproject.jobs.JobCancelledEvent(job_id: 'JobId')

Bases: object

job_id: JobId
class postproject.jobs.JobClaim(tool: ToolIdentity, agent: AgentIdentity | None, expires_at_unix_micros: int)

Bases: object

Attribution and lease detail for one active claim.

agent: AgentIdentity | None
expires_at_unix_micros: int
tool: ToolIdentity
class postproject.jobs.JobClaimReleasedEvent(job_id: 'JobId')

Bases: object

job_id: JobId
class postproject.jobs.JobClaimRenewedEvent(job_id: 'JobId')

Bases: object

job_id: JobId
class postproject.jobs.JobClaimedEvent(job_id: 'JobId')

Bases: object

job_id: JobId
class postproject.jobs.JobCompletion(activity_id: ActivityId, representation_id: RepresentationId)

Bases: object

Activity and representation committed by a successful job.

activity_id: ActivityId
representation_id: RepresentationId
class postproject.jobs.JobFailedEvent(job_id: 'JobId')

Bases: object

job_id: JobId
class postproject.jobs.JobFailure(diagnostic: str)

Bases: object

A failed request carrying its bounded diagnostic.

diagnostic: str
class postproject.jobs.JobLease(native: NativeLibrary, handle: _Pointer[_abi.JobLease])

Bases: object

Owns a worker capability; closing/freeing it never writes to storage.

Pending ownership belongs to its claiming edit. Successful commit activates it; rollback closes it. Every worker mutation still validates the store.

close() → None

Free local ownership only; repeated calls are harmless.

export_token() → str

Explicitly export a secret for a protected file/pipe, never logs.

property job_id: JobId

Return the claimed job without credentials.

property production_id: ProductionId

Return production scope without credentials.

property state: PendingJobLease | ActiveJobLease | ClosedJobLease

Return local pending, active-with-expiry or closed ownership.

class postproject.jobs.JobRef(id: JobId)

Bases: object

Explicit job target for polymorphic operations.

id: JobId
class postproject.jobs.JobRequest(kind: str, inputs: tuple[RepresentationId, ...], output_asset_id: AssetId, output_representation_kind: RepresentationKind, target_root: str | None = None)

Bases: object

New requested work to stage in a transaction.

inputs: tuple[RepresentationId, ...]
kind: str
output_asset_id: AssetId
output_representation_kind: RepresentationKind
target_root: str | None
class postproject.jobs.JobRequested

Bases: object

A request with no current worker or result.

class postproject.jobs.JobRequestedEvent(job_id: 'JobId')

Bases: object

job_id: JobId
class postproject.jobs.JobState(*values)

Bases: Enum

Lifecycle state of durable requested work.

CANCELLED = 'cancelled'
CLAIMED = 'claimed'
FAILED = 'failed'
REQUESTED = 'requested'
SUCCEEDED = 'succeeded'
class postproject.jobs.JobSucceededEvent(job_id: 'JobId')

Bases: object

job_id: JobId
class postproject.jobs.PendingJobLease

Bases: object

Ownership belongs to an edit that has not committed.

class postproject.jobs.RegenerationJobPlan(artifact_representation_id: RepresentationId, job: Job, parameters: tuple[MetadataAssertion, ...])

Bases: object

Read-only job proposal derived from an artifact’s provenance.

artifact_representation_id: RepresentationId
job: Job
parameters: tuple[MetadataAssertion, ...]

Exchange API

Portable intent, durable outcomes and passive catch-up are advanced workflows.

Explicit portable intent, outcomes and passive replication.

class postproject.exchange.AddIdentifierCommand(target: 'ObjectReference', identifier: 'ExternalIdentifier')

Bases: object

identifier: ExternalIdentifier
target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef
class postproject.exchange.AddMediaRootCommand(name: 'str', label: 'str | None' = None, priority: 'int' = 0)

Bases: object

label: str | None
name: str
priority: int
class postproject.exchange.AddRepresentationCommand(asset_id: 'AssetId', kind: 'RepresentationKind', source: 'MediaSource')

Bases: object

asset_id: AssetId
kind: RepresentationKind
source: str | PathLike[str] | ImageSequenceSource | OrderedPartsSource | PackageSource
class postproject.exchange.AppendMetadataCommand(target: 'ObjectReference', property: 'MetadataKey', value: 'MetadataInput')

Bases: object

property: MetadataKey
target: ObjectReference
value: MetadataInput
class postproject.exchange.CancelJobCommand(job_id: 'JobId')

Bases: object

job_id: JobId
class postproject.exchange.ClaimJobCommand(job_id: 'JobId', tool: 'ToolIdentity', duration: 'timedelta', agent: 'AgentIdentity | None' = None)

Bases: object

agent: AgentIdentity | None
duration: timedelta
job_id: JobId
tool: ToolIdentity
class postproject.exchange.ClaimedJobResult(expires_at_unix_micros: int)

Bases: object

Original authority-selected expiry; grants no worker ownership.

expires_at_unix_micros: int
class postproject.exchange.CompleteJobCommand(lease: 'JobLease', output_representation_id: 'RepresentationId', activity_id: 'ActivityId')

Bases: object

activity_id: ActivityId
lease: JobLease
output_representation_id: RepresentationId
class postproject.exchange.ConfirmLocatorCommand(resource_id: 'ResourceId', uri: 'str', media_root: 'str | None' = None, sequence_naming: 'SequenceNaming | None' = None)

Bases: object

media_root: str | None
resource_id: ResourceId
sequence_naming: SequenceNaming | None
uri: str
class postproject.exchange.CreateActivityCommand(spec: 'ActivitySpec')

Bases: object

spec: ActivitySpec
exception postproject.exchange.ExchangeError(code: int, message: str)

Bases: PostProjectError

Portable framing, scope, identity, replay or role check failed.

property kind: ExchangeFailure

Return the checked category without parsing a diagnostic.

class postproject.exchange.ExchangeFailure(*values)

Bases: IntEnum

Stable checked protocol failure, independent of diagnostic wording.

DIVERGENCE = 19
HISTORY_GAP = 17
INTEGRITY = 18
INVALID_BASE = 15
LIMIT_EXCEEDED = 13
MALFORMED = 12
MIRROR_READ_ONLY = 20
REQUEST_IDENTITY_MISMATCH = 16
SCOPE_MISMATCH = 14
class postproject.exchange.ExchangeLimits(file_bytes: int = 1073741824, disk_bytes: int = 2147483648, frames: int = 10000000, document_bytes: int = 67108864, document_depth: int = 192, document_nodes: int = 1000000)

Bases: object

Positive receiver budgets; container depth is at most 192.

disk_bytes: int
document_bytes: int
document_depth: int
document_nodes: int
file_bytes: int
frames: int
class postproject.exchange.ExchangePosition(base: ProtocolBase, digest: bytes)

Bases: object

One complete source boundary and its exact BLAKE3 commitment.

base: ProtocolBase
digest: bytes
class postproject.exchange.ExchangeRole(*values)

Bases: IntEnum

Persisted execution authority; replay never promotes a mirror.

AUTHORITY = 1
PASSIVE_MIRROR = 2
class postproject.exchange.ExchangeState(protocol_version: int, role: ExchangeRole, supported_features: int, observed_base: ProtocolBase, floor: ExchangePosition, head: ExchangePosition | None, limits: ExchangeLimits)

Bases: object

One coherent observation, including a possibly incomplete native head.

floor: ExchangePosition
head: ExchangePosition | None
limits: ExchangeLimits
observed_base: ProtocolBase
protocol_version: int
role: ExchangeRole
supported_features: int
class postproject.exchange.FailJobCommand(lease: 'JobLease', diagnostic: 'str')

Bases: object

diagnostic: str
lease: JobLease
class postproject.exchange.FailedJobResult

Bases: object

Failure observed at the receipt; diagnostics remain in committed history.

class postproject.exchange.ImportMediaCommand(source: 'MediaSource', display_name: 'str | None' = None)

Bases: object

display_name: str | None
source: str | PathLike[str] | ImageSequenceSource | OrderedPartsSource | PackageSource
class postproject.exchange.JobResult(job_id: JobId, status: JobRequested | ClaimedJobResult | JobCompletion | FailedJobResult | JobCancelled)

Bases: object

Final public job observation at this submission’s own receipt.

job_id: JobId
status: JobRequested | ClaimedJobResult | JobCompletion | FailedJobResult | JobCancelled
class postproject.exchange.ObserveResourceContentCommand(resource_id: 'ResourceId', path: 'str | os.PathLike[str]', sequence_naming: 'SequenceNaming | None' = None)

Bases: object

path: str | PathLike[str]
resource_id: ResourceId
sequence_naming: SequenceNaming | None
class postproject.exchange.PreparedActivity(activity_id: 'ActivityId')

Bases: object

activity_id: ActivityId
class postproject.exchange.PreparedAsset(asset_id: 'AssetId', representation_id: 'RepresentationId')

Bases: object

asset_id: AssetId
representation_id: RepresentationId
class postproject.exchange.PreparedJob(job_id: 'JobId')

Bases: object

job_id: JobId
class postproject.exchange.PreparedMediaRoot(root_id: 'MediaRootId')

Bases: object

root_id: MediaRootId
class postproject.exchange.PreparedRepresentation(representation_id: 'RepresentationId')

Bases: object

representation_id: RepresentationId
class postproject.exchange.Proposal(native: NativeLibrary, handle: _Pointer[_abi.Proposal])

Bases: object

Own immutable prepared intent; closing never submits or commits it.

close() → None

Release local immutable intent; repeated calls are harmless.

property document: bytes

Copy canonical portable bytes containing no private capability.

property identity: RequestIdentity

Copy the complete public recovery scope, independently of this handle.

classmethod parse(document: bytes, *, library_path: str | PathLike[str] | None = None) → Self

Read bounded public transport; ordinary commands use typed staging.

class postproject.exchange.ProposalBuilder(transaction: Edit, client: ClientId, request: RequestId, base: ProtocolBase | None)

Bases: object

Caller-serialized staging for typed local commands and exact prepared IDs.

Preparation closes staging without a commit. Closing/discarding the builder never submits. If staging fails, discard it before deciding on a new intent.

close() → None

Discard local staging only; repeated calls are harmless.

prepare() → Proposal

Freeze checked ordered intent; failure leaves native staging open.

stage(commands: Iterable[ImportMediaCommand | AddRepresentationCommand | AddMediaRootCommand | SetMediaRootEnabledCommand | RemoveMediaRootCommand | ConfirmLocatorCommand | RetireLocatorCommand | RecordResourceFingerprintCommand | RecordRepresentationFingerprintCommand | ObserveResourceContentCommand | RecordDependencySetCommand | AddIdentifierCommand | RemoveIdentifierCommand | AppendMetadataCommand | ReplaceMetadataCommand | RemoveMetadataCommand | CreateActivityCommand | RequestJobCommand | ClaimJobCommand | RenewJobCommand | ReleaseJobCommand | FailJobCommand | CompleteJobCommand | CancelJobCommand]) → list[PreparedAsset | PreparedRepresentation | PreparedMediaRoot | PreparedActivity | PreparedJob | ContentObservationOutcome | None]

Stage an ordered collection; copy checked values and return prepared IDs.

class postproject.exchange.ProtocolBase(decision: DecisionBase, history_id: HistoryId)

Bases: object

Detached decision retaining its original source history.

decision: DecisionBase
history_id: HistoryId
class postproject.exchange.RecordDependencySetCommand(representation_id: 'RepresentationId', dependencies: 'list[Dependency]')

Bases: object

dependencies: list[Dependency]
representation_id: RepresentationId
class postproject.exchange.RecordRepresentationFingerprintCommand(representation_id: 'RepresentationId', fingerprint: 'Fingerprint')

Bases: object

fingerprint: Fingerprint
representation_id: RepresentationId
class postproject.exchange.RecordResourceFingerprintCommand(resource_id: 'ResourceId', fingerprint: 'Fingerprint')

Bases: object

fingerprint: Fingerprint
resource_id: ResourceId
class postproject.exchange.ReleaseJobCommand(lease: 'JobLease')

Bases: object

lease: JobLease
class postproject.exchange.RemoveIdentifierCommand(target: 'ObjectReference', identifier: 'ExternalIdentifier')

Bases: object

identifier: ExternalIdentifier
target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef
class postproject.exchange.RemoveMediaRootCommand(root_id: 'MediaRootId')

Bases: object

root_id: MediaRootId
class postproject.exchange.RemoveMetadataCommand(target: 'ObjectReference', property: 'MetadataKey')

Bases: object

property: MetadataProperty | tuple[str, str]
target: ProductionRef | AssetRef | RepresentationRef | ResourceRef | ActivityRef | JobRef
class postproject.exchange.RenewJobCommand(lease: 'JobLease', duration: 'timedelta')

Bases: object

duration: timedelta
lease: JobLease
class postproject.exchange.ReplaceMetadataCommand(target: 'ObjectReference', property: 'MetadataKey', values: 'list[MetadataInput]')

Bases: object

property: MetadataKey
target: ObjectReference
values: list[MetadataInput]
class postproject.exchange.RequestIdentity(production_id: ProductionId, history_id: HistoryId, client_id: ClientId, request_id: RequestId)

Bases: object

Complete public scope to retain after an uncertain response.

client_id: ClientId
history_id: HistoryId
production_id: ProductionId
request_id: RequestId
class postproject.exchange.RequestJobCommand(request: 'JobRequest')

Bases: object

request: JobRequest
class postproject.exchange.RetireLocatorCommand(locator_id: 'LocatorId')

Bases: object

locator_id: LocatorId
class postproject.exchange.SetMediaRootEnabledCommand(root_id: 'MediaRootId', enabled: 'bool')

Bases: object

enabled: bool
root_id: MediaRootId
class postproject.exchange.SubmissionOutcome(status: CommitReceipt | PostProjectError, jobs: list[JobResult], document: bytes)

Bases: object

Copied accepted receipt or terminal rejection, without ownership.

document: bytes
jobs: list[JobResult]
status: CommitReceipt | PostProjectError
class postproject.exchange.SubmissionResult(outcome: SubmissionOutcome, leases: list[JobLease])

Bases: object

Public facts and freshly delivered owning leases; duplicates have none.

leases: list[JobLease]
outcome: SubmissionOutcome