# ISIS v2 WS07-010: Sequence E2E Tests for Rerender and Continuity Retention

## Scope

`WS07-010` adds end-to-end sequence lifecycle tests that cover initial sequence
render, rerender, patch-rerender, and continuity-retention behavior for
cinematic workflow execution.

## Research and Existing Implementation Alignment

- Extended the existing `WorkflowExecutor` end-to-end harness in
  `apps/isis/generation-api/src/workflows/executor.spec.ts` because it already
  validates full workflow resolution and runtime execution behavior, including
  simulated output contracts.
- Reused established continuity assertions from existing tests (determinism,
  revision token change behavior) and expanded them into sequence-specific
  rerender and patch-rerender paths.
- Reused existing cinematic workflow family (`animatediff-controlnet`) and
  sequence-compatible control inputs (ControlNet sequence source + editorial
  bundle outputs) to validate real sequence execution contracts rather than a
  synthetic isolated fixture.

## Deliverables

1. Added sequence lifecycle test fixture:

- `createSequenceLifecycleJob()` defines a sequence-oriented cinematic job with:
  - `animatediff-controlnet` workflow routing,
  - sequence control source package (`kind: sequence`),
  - continuity directives,
  - sequence plan metadata (timeline, forecasting, shot plan).

2. Added E2E lifecycle test for sequence generation + rerender + patch-rerender:

- Executes initial sequence generation and verifies editorial package outputs.
- Executes rerender and verifies continuity metadata retention across runs.
- Executes patch-rerender with non-continuity runtime patches and verifies
  continuity metadata remains stable while patched output seed changes.

3. Added E2E continuity-revision patch test:

- Executes baseline sequence run.
- Executes patch-rerender with continuity revision bump.
- Verifies continuity token changes with revision, confirming revision-aware
  continuity identity behavior.

## Verification Commands

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