# ISIS v2 WS07-006: Render Pass Outputs

## Scope

`WS07-006` adds explicit render pass contracts for cinematic/video workflows so
beauty, depth, mask, and normals outputs can be declared, validated, and
surfaced through execution APIs.

## Research and Existing Implementation Alignment

- Reused `output_spec` contract patterns already used for output bundle and 3D
  package declarations in `@isis/workflows`.
- Aligned runtime output projection with existing `JobOutput.files` contract in
  `@isis/generation-api`, extending rather than replacing existing outputs.
- Followed existing workflow capability resolution path in
  `apps/isis/generation-api/src/workflows/executor.ts` so render-pass support is
  available to both real provider execution and simulated fallback execution.

## Deliverables

1. Extended workflow schema contracts with first-class render pass metadata:

- Added `RenderPassType` enum (`beauty`, `depth`, `mask`, `normals`).
- Added `RenderPassOutputSchema` and `OutputSpec.render_passes`.
- Added duplicate render-pass validation within `output_spec`.

2. Applied render pass declarations to a representative cinematic workflow:

- Updated `animatediff-controlnet` to emit beauty/depth/mask/normals contracts.

3. Extended generation-api workflow resolution and outputs:

- Added `WorkflowOutputConfig.renderPasses`.
- Parsed render passes from `output_spec.render_passes`.
- Mapped rendered files back to typed render-pass outputs.
- Emitted diagnostics for missing required passes.
- Added simulated render-pass file generation for provider-disabled paths.

4. Extended shared output contracts:

- Added `JobOutput.renderPasses` and `JobRenderPassOutput` types in API and
  client contracts.
- Added schema validation support for render pass outputs.

5. Added tests for schema/runtime coverage:

- Workflow schema accepts valid render passes and rejects duplicates.
- Job output schema accepts render pass payloads.
- Executor simulation emits configured beauty/depth/mask/normals render passes.

## Verification Commands

```bash
pnpm --filter @isis/workflows exec vitest run src/workflows.spec.ts
pnpm --filter @isis/generation-api exec vitest run src/schemas/job.schema.spec.ts src/workflows/executor.spec.ts
node scripts/isis/validate-v2-compliance-gate.mjs
```
