# 07 — Claude Handoff: Apply CANVAS Without Trusting VLM

This is the short operational guide for Claude or any implementation agent working on TheRoad-I1 after reading the CANVAS research pack.

## Core Correction

Do not interpret CANVAS as "add VLM judge everywhere."

The useful part for TheRoad-I1 is:

1. explicit long-range story/world memory,
2. typed character/background/prop state,
3. anchor retrieval from that memory,
4. memory updates after generation,
5. continuity planning before shot-level prompts.

The risky part is:

1. VLM as truth source,
2. VLM as autonomous pass/fail gate,
3. VLM overwriting memory,
4. VLM replacing deterministic contract checks.

Current VLMs are not reliable enough for this project's closure gates. They can miss or hallucinate character identity, prop identity, hands, small objects, spatial relations, background layout, exact state, and multi-shot continuity. Treat them as advisory only.

## How To Apply The Paper To This Project

### Apply

- Add a typed `StoryWorldMemory` layer later.
- Track character appearance state, location/background anchors, prop state, previous-frame summaries.
- Let `scene_reference_service` retrieve anchors from memory, but only after a dry-run phase.
- Keep `RenderPromptCard` as the shot-level contract.
- Use structured fields from `shot_staging`, `scene_consistency`, `render_contracts`, and future memory records.
- Persist generated asset provenance and intended contract state after image generation.
- Add human-readable diagnostics for continuity risk.

### Do Not Apply

- Do not add a VLM closure gate now.
- Do not let model observations overwrite memory.
- Do not use VLM output to justify removing deterministic checks.
- Do not create a monolithic CANVAS-style agent.
- Do not put global memory into RenderPromptCard.
- Do not use semantic regex or noun lists to imitate a memory system.

## Current Regex + Prompt-Contamination Cleanup

Question: should CANVAS ideas change the current regex + polluted prompt removal work?

Answer: yes, but only as architectural support. Do not widen the current cleanup into a memory/VLM project.

### What CANVAS Supports In The Current Work

The paper supports the current direction:

- split overloaded prose fields into structured axes,
- move semantic decisions into LLM-produced structured fields,
- validate only closed-world IDs/enums in code,
- remove open-world semantic regex,
- remove scenario-specific prompt examples,
- replace prompt noun lists with schema fields and helper SOT,
- make old field names fail-fast rather than silently fallback.

Area #1 and Area #2 are therefore aligned with the useful part of CANVAS.

### What Not To Do During Current Cleanup

Do not add:

- StoryWorldMemory,
- VLM judge,
- candidate selection,
- generated-image observer,
- embedding/VAE memory,
- new retrieval policy.

Those are next-phase architecture items after the current semantic debt areas close.

## Recommended Sequencing

```mermaid
flowchart TD
  A[Finish regex + prompt contamination cleanup]
  B[Finish Area #2 state/gaze separation]
  C[Run residue gates and full regression baseline]
  D[Design StoryWorldMemory read model]
  E[Add dry-run memory retrieval logs]
  F[Add contract/provenance-based post-generation memory records]
  G[Optional advisory image review]

  A --> B
  B --> C
  C --> D
  D --> E
  E --> F
  F --> G
```

## Claude Decision Rule

When implementing current cleanup:

- If a finding is about semantic regex or contaminated prompt prose, fix it in the active Area scope.
- If a finding suggests memory, anchor retrieval, or post-generation observation, record it as future StoryWorldMemory work unless it is already required by the current spec.
- If a finding depends on VLM correctness, downgrade it to advisory and do not use it as a blocker unless backed by deterministic evidence.

## Concrete Near-Term Guidance

For Area #2 and similar work:

1. Continue field separation (`gaze_direction_kind`, `gaze_target_id`, `subject_state`).
2. Keep using schema oneOf and helper validation for closed-world IDs/enums.
3. Remove `gaze_target` legacy reads.
4. Remove prompt text that teaches the model to mix state, direction, and target.
5. Add residue gates that exclude new valid fields like `gaze_target_id`.
6. Do not introduce VLM checks as part of this wave.

For future memory work:

1. Start with a read-only `StoryWorldMemory` table/service.
2. Populate it from existing structured contracts and generated asset metadata.
3. Add retrieval dry-run logs before retrieval changes generation.
4. Add model/image observation only as low-trust proposals.

