vendor_fabric.meshy.persistence.repository¶
Task repository for manifest storage and retrieval.
Module Contents¶
Classes¶
File-backed repository for task manifests with atomic operations. |
API¶
- class vendor_fabric.meshy.persistence.repository.TaskRepository(base_path: str = 'client/public/models')¶
File-backed repository for task manifests with atomic operations.
Initialization
- load_project_manifest(project: str) extended_data.containers.ExtendedDict¶
Load manifest for a project, creating empty one if missing.
Args: project: Project name (e.g., “otter”, “beaver”)
Returns: Extended project manifest payload.
- save_project_manifest(manifest: vendor_fabric.meshy.persistence.schemas.ProjectManifest) None¶
Atomically save project manifest to disk.
Args: manifest: ProjectManifest to save
- get_asset_record(project: str, spec_hash: str) extended_data.containers.ExtendedDict | None¶
Get asset manifest by spec hash.
Args: project: Project name spec_hash: Asset spec hash
Returns: Extended asset manifest payload if found, None otherwise
- upsert_asset_record(project: str, asset_manifest: vendor_fabric.meshy.persistence.schemas.AssetManifest) None¶
Insert or update asset manifest.
Args: project: Project name asset_manifest: AssetManifest to save
- record_task_update(project: str, spec_hash: str, task_id: str, status: str, service: str | None = None, payload: dict[str, Any] | None = None, result_paths: dict[str, str] | None = None, artifacts: list[vendor_fabric.meshy.persistence.schemas.ArtifactRecord] | None = None, source: str = 'orchestrator', error: str | None = None) None¶
Record task status update in manifest.
Args: project: Project name spec_hash: Asset spec hash task_id: Meshy task ID status: New status string service: Service name (text3d, rigging, etc) payload: Request payload result_paths: Result URLs/paths artifacts: Downloaded artifacts source: Update source (orchestrator, webhook, manual) error: Error message if failed
- list_pending_assets(project: str) extended_data.containers.ExtendedList[extended_data.containers.ExtendedDict]¶
List all assets with pending/in-progress tasks.
Args: project: Project name
Returns: Extended asset manifest payloads with non-terminal tasks
- find_task_by_id(task_id: str, project: str | None = None) extended_data.containers.ExtendedDict | None¶
Find asset by task ID (for webhook lookups).
Args: task_id: Meshy task ID project: Optional project to narrow search
Returns: Extended payload with project, spec_hash, and asset if found
- compute_spec_hash(spec: dict[str, Any]) str¶
Compute deterministic hash for task spec.
Args: spec: Task specification dictionary
Returns: SHA256 hex digest of canonicalized spec
- record_task_submission(submission: vendor_fabric.meshy.persistence.schemas.TaskSubmission) None¶
Record a task submission to the manifest (idempotent).
Args: submission: TaskSubmission with task_id, project, service, etc.
Raises: ValueError: If submission data is invalid