alc.models¶
The domain model layer — the public API is the package __init__.
See Architecture Overview for layering rules.
Task¶
alc.models.task ¶
TaskManifest ¶
Bases: BaseModel
Standard Alchemy 'Smart' Constructor.
Source code in alc\models\task.py
contributors
property
¶
Logins that have actually done work on this task — anyone with a
version in the tree. The publish pseudo-user (the publish snapshot)
is not a person, so it's excluded. This is the "you have a path with
your username in it" signal that predates explicit assignment.
task_thumb
property
¶
The task-level thumbnail resolved live from this task's address (the
published render-tree .thumb/thumb.png) → {exists, path} with a
root-relative path for /alcroot.
Mirrors the registry entity's asset_thumb: address-derived, so it
renders even though the stored thumbnail MediaReference was never
populated (its relative_path= constructor arg is a computed field
and is silently dropped, leaving path null on disk). This is the
reliable path — templates should prefer it over thumbnail.path.
load
classmethod
¶
Explicitly load a manifest from a file path. Returns None if missing.
Source code in alc\models\task.py
hydrate_task_msd
classmethod
¶
The Universal Entry Point: Handles strings, PathObjects, raw dicts, and parameter addressing combinations. Resolves files seamlessly.
Source code in alc\models\task.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
validate_task_logic ¶
Post-initialization adjustments.
Source code in alc\models\task.py
has_versions_for ¶
Does user have a version rail on this task?
The question every "start the task if it hasn't been started" guard
actually means. Those guards used to ask if not task_msd.user_versions
— whether the register is empty at all — which is a different question
and answers wrong for the one case it matters: a task that carries the
publish pseudo-user and nobody else. That happens whenever a publish
arrives without a local rail behind it (a migrated project, a hand-placed
publish, work published from another machine): the register reads
non-empty, the guard skips, and the artist lands on a version view with a
publish chip and an empty VERSIONS rail — prp/axe/mdl in loj.
The publish pseudo-user is not a person and has no VERSIONS rail, so
it can never satisfy this for anyone.
Source code in alc\models\task.py
is_assigned_to ¶
Is this task "mine" for a set of assignment keys? True when I'm an
explicit assignee OR I've contributed a version. Keys come from
alc.services.people.assignment_keys (email + aliases + local
login), so both the canonical email and legacy login strings match.
Source code in alc\models\task.py
commit ¶
Atomic write to disk.
Source code in alc\models\task.py
update_user_versions ¶
update_user_versions(
po: PathObject,
status: Optional[str] = None,
comment: Optional[str] = None,
)
Register po's version on this task's rail.
comment is the artist's statement about the version (#3796). It is
passed explicitly because a PathObject has no comment field —
the old getattr(po, "comment", "") could only ever produce "",
so every pointer in every register carried a blank comment and the
version story lost the one thing a person actually said. An explicit
None still falls back to the PathObject, preserving old callers.
Source code in alc\models\task.py
push ¶
Ensure the task exists in the active tracker and set its status.
Source code in alc\models\task.py
pull ¶
Read the task's remote state into this manifest.
Source code in alc\models\task.py
Version¶
alc.models.version ¶
VersionStatus ¶
Bases: BaseModel
Tracks the lifecycle status of a specific version (e.g., 'published', 'approved').
ExportInfo ¶
Bases: BaseModel
The 'Passport' of the MSD: Where did this come from?
VersionManifestData ¶
Bases: BaseModel
Common foundation for all Alchemy Task Manifests.
VersionPointer ¶
Bases: BaseModel
The 'Pointer' artifact used in Task Rail UIs.
UserVersions ¶
AssetEntry ¶
Bases: BaseModel
Leaf-level asset reference for assembly (Layout/Comp).
StepState ¶
Bases: BaseModel
Tracks the execution state of an individual step.
RecipeRecord ¶
Bases: BaseModel
A record of a specific recipe run (e.g., 'publish').
RecipeWorkManifest ¶
Bases: BaseModel
The master container for all work done on this version.
VersionManifest ¶
Bases: BaseModel
source_files
property
¶
Dynamic lookup: Always reflects disk state, never stale in the JSON.
render_files
property
¶
Dynamic lookup: Always reflects disk state.
load_msd
classmethod
¶
Hydrates from disk or falls back to PathObject parsing.
Source code in alc\models\version.py
from_po
classmethod
¶
The Single Source of Truth: Merges disk data (if any) with PathObject attrs.
Source code in alc\models\version.py
sync_path_object_data ¶
Hydrates manifest fields from the PathObject context. Replaces legacy post_init.
Source code in alc\models\version.py
update_recipe_step ¶
update_recipe_step(
recipe_type: str,
step_name: str,
status: StepStatus,
message: str = "",
last_run: str = "",
shared_data: dict = None,
)
High-level helper to record progress of a recipe step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipe_type
|
str
|
e.g., 'publish', 'render', 'build' |
required |
step_name
|
str
|
The unique name of the step from the dsn.json |
required |
status
|
StepStatus
|
A StepStatus enum value (passed, failed, running, etc.) |
required |
message
|
str
|
Optional detail (e.g., error logs or success notes) |
''
|
shared_data
|
dict
|
Optional dictionary to merge into the recipe's shared_data |
None
|
Source code in alc\models\version.py
update_status ¶
update_status(
new_status: str,
comment="Automated status update by Alchemy",
user: Optional[str] = None,
origin: str = "system",
)
Convenience method to update status and commit.
Source code in alc\models\version.py
push ¶
Create/sync this version in the active tracker, stamping sg_id locally.
Returns the canonical TrackerVersion (or None). review=True also
pushes preview media and caches the dailies url.
Source code in alc\models\version.py
pull ¶
Read the version's remote state into this manifest (no history spam).
Source code in alc\models\version.py
commit ¶
The Alchemy Transaction. Uses model_dump(exclude=...) to replace the legacy 'to_dict' sifter.
Source code in alc\models\version.py
Media¶
alc.models.media ¶
MediaReference ¶
Bases: BaseModel
Standardized media pointer for Alchemy Artifacts. Provides deterministic path resolution and availability checks.
Contract: path is stored root-relative (relative to the prod root,
e.g. nca/tpb/PUBLISHES/render/.../thumb.png) so it is portable across
machines and serves directly under the /alcroot mount as
/alcroot/{path}. Disk checks (:attr:exists) resolve it to an absolute
path against the active prod root on demand — never store an absolute path.
abs_path
property
¶
The stored root-relative path resolved to an absolute path
against the active prod root (for disk access). None when unset.
exists
property
¶
Active check for file existence.
Critical for agents to avoid 'File Not Found' errors during automation.
Resolves the root-relative path to absolute before stat-ing.