Skip to content

feat: contrato de procedencia (Workspace vs carpeta de salida) - #86

Merged
IAnMove merged 1 commit into
mainfrom
feat/domain-provenance-contract
Sep 2, 2026
Merged

feat: contrato de procedencia (Workspace vs carpeta de salida)#86
IAnMove merged 1 commit into
mainfrom
feat/domain-provenance-contract

Conversation

@IAnMove

@IAnMove IAnMove commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Objetivo

PR mediano de contrato de dominio, no un writer más. +476/−100.

  • workspace_id = colección Workspace; output_folder = carpeta de salida física
  • GenerationProvenance / CommandContext en app/services/generation_provenance.py
  • iniciador (actor/tool/capability) distinto de proveedor/modelo
  • publish_generation_sidecar_best_effort: el media ya escrito no se borra si falla el sidecar (3D/Rig lo usan)
  • Extra info lee queue_ms / inference_ms / total_ms (antes *_seconds, siempre vacío)
  • SLICE_QUEUE.md al estado real de main (refactor: extraer el tab World de Story Lab #85)

Compatibilidad: los writers que solo pasan workspace_id= siguen guardando esa cadena en ambos campos.

Verificación local

  • pytest asset_manifest + asset_catalog + model3d_rig + architecture_contracts: 36 passed
  • npm run i18n:check
  • npm test: 491 passed

Pendiente de CI. No mezclar hasta que los checks estén verdes.


Note

Medium Risk
Changes provenance shape and catalog/API fields used by the Assets inspector; behavior is mostly additive with legacy workspace_id duplication, but incorrect future writers could mis-tag collection vs folder.

Overview
Introduces a domain provenance contract for asset-manifest v1: origin.workspace_id is an optional Workspace collection ID, while origin.output_folder is the physical directory name (never a host path). New generation_provenance.py supplies resolve_generation_location, provenance_from_manifest, and typed GenerationProvenance / CommandContext, with initiator (actor / tool / capability) kept separate from provider/model in generation.model.

Manifest and catalog writers take optional output_folder, populate both location fields via resolve_generation_location, and legacy callers that only pass workspace_id= still duplicate that string on both fields for compatibility. The global asset catalog surfaces output_folder, richer origin/execution (including command_id / workflow_id), and matching locations[] entries.

Adds publish_generation_sidecar_best_effort so provenance write failures never raise after media is committed; Hunyuan3D and Rig switch to it (replacing local try/except). Schema and DOMAIN_MODEL docs document the split, initiator vs provider, and sidecar-failure policy; SLICE_QUEUE.md is refreshed.

Assets Extra info gains an Initiator section, workspace vs output-folder labels, and displays queue_ms / inference_ms / total_ms instead of unused *_seconds keys. TypeScript AssetCatalogItem types align with the API.

Reviewed by Cursor Bugbot for commit 965b2d3. Configure here.

Record initiator vs provider/model, CommandContext IDs, and a best-effort
sidecar helper that never deletes committed media. Extra info reads timing
from queue_ms/inference_ms/total_ms.
@IAnMove

IAnMove commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

PR Review — Loreframe Studio

Risk: low
Scope: 16 file(s); +476/-100; React UI, backend services, docs

Automated review from scripts/analyze_pr.py. This is a heuristic pass (no LLM) so humans still own the merge decision.

Findings

  • low — UI changed — rebuild before merge
    Run cd ui && npm run build (CI already does this). Pinokio Update rebuilds for end users; keep ui/dist untracked.

Changed files

  • added: app/services/generation_provenance.py
  • modified: app/services/asset_catalog.py, app/services/asset_manifest.py, app/services/model3d_service.py, app/services/rig_service.py, docs/development/DOMAIN_MODEL_AND_ASSET_PROVENANCE.md, docs/development/INTERNATIONALIZATION.md, docs/development/SLICE_QUEUE.md, docs/development/asset-manifest-v1.schema.json, tests/test_asset_manifest.py, tests/test_model3d_rig_task_identity.py, ui/src/api/assets.ts, ui/src/features/assets/AssetsPanel.tsx, ui/src/i18n/locales/en/activity.json, ui/src/i18n/locales/es/activity.json, ui/tests/assetsCatalog.test.mjs

CONTRIBUTING checklist

  • python scripts/verify_clean_repo.py
  • python -m compileall -q app/services app/launch.py scripts
  • cd ui && npm run build if the UI changed
  • No weights, CivitAI sidecars, or generated guides
  • Stays local-first (no required accounts / telemetry)

Posted by the repo PR review workflow. Re-runs on each push to the PR.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 965b2d3. Configure here.

@IAnMove
IAnMove merged commit 41636a1 into main Sep 2, 2026
5 checks passed
@IAnMove
IAnMove deleted the feat/domain-provenance-contract branch September 5, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant