# M03-RND-M2-RAW-MODEL-REPOSITORY-001 — raw M2 model repository

<!-- OPENWC_CLAIM:M03-RND-M2-RAW-MODEL-REPOSITORY-001:sindo-main-codex:2026-07-20 -->

## Ownership

- Target: M03
- Program: RND
- Owner/Agent ID: sindo-main-codex
- Branch: `work/sindo-main-codex/m03-m2-raw-model-repository`
- Lease expires UTC: 2026-07-20
- Integrator: M03 milestone integrator

## Outcome

Extract the repeated FileAccess/ClassDB native `M2Loader` boundary for static
and animated raw model Dictionaries from `StreamingWorldLoader`.

## Non-goals

- Cache raw data, Meshes, prototypes, missing paths or animation decisions.
- Build Nodes/Meshes, refresh materials or choose `.tscn/.glb` caches.
- Change static/animated parser methods, path resolution or fallback order.
- Add dependencies, persistence, retries or visible behavior.

## Paths

- Exclusive: `src/render/m2/m2_raw_model_repository.gd`,
  `src/tools/verify_m2_raw_model_repository.gd`,
  `docs/modules/m2-raw-model-repository.md`, this claim
- Shared/hotspots: `src/scenes/streaming/streaming_world_loader.gd`, M2
  finalizer/extractor/cache/pipeline/material/animation/shutdown verifiers and
  module specs, `docs/modules/world-renderer.md`, `docs/modules/README.md`,
  `RENDER.md`, `targets/03-renderer-facade.md`
- Generated/ignored: `.godot`, native DLL, generated M2 resources, caches and
  proprietary renderer corpus

## Contracts and data

- Static load calls native `load_m2`; animated load calls `load_m2_animated`.
- Paths remain `globalize_path(extracted_directory.path_join(normalized_path))`.
- Empty path, missing native class/file/instance/method, parse failure or
  non-Dictionary result returns an empty Dictionary without retained state.
- Each successful request creates one native loader instance as before.

## Dependencies

- Requires: accepted runtime Mesh finalizer package on master `1d94eac`
- Blocks: M2 prototype/cache state extraction
- External state: native M2Loader registration and local extracted files

## Verification

- Commands: dedicated invalid/missing/class/source/timing verifier; finalizer/
  classifier/extractor/cache/pipeline/material/animation/shutdown/M2 build/facade/
  internal-access/manifest, documentation and coordination gates
- Fixtures: empty/missing normalized paths plus source contract; proprietary
  success corpus remains external
- Fidelity evidence: exact native method names, path expression and three caller transitions
- Performance budget: 10,000 rejected empty-path calls under 1 second

## Documentation deliverables

- Inline public API docs
- Module specification with inputs/outputs, ownership and source map
- Data-flow, lifecycle/state, sequence and dependency diagrams
- Finalizer/extractor/cache/pipeline, world-renderer, registry and RENDER updates

## Simplicity and naming

- Important name introduced: `M2RawModelRepository`
- Simplest solution: one stateless RefCounted with static and animated load methods
- Rejected complexity: generic native repository, caching, dependency injection,
  retries, diagnostics framework or async wrapper
- Unavoidable complexity: animated native method availability is a distinct guard
- Measured optimization evidence: bounded rejected-input loop

## Status

- State: accepted
- Done: repository, three loader adapters, contract verifier and required documentation
- Next: continue M2 prototype/cache state extraction
- Blocked by:

## Handoff

- Commit: `b608a81`
- Results: repository passes invalid/missing/stateless/native-boundary contracts
  and 10,000 empty-path rejects in 3.275 ms; 45 repository-independent
  headless verifiers pass, while the proprietary ADT placement probe is
  unavailable without `data/extracted`; checkpoint dry-run passes 7/7;
  documentation and coordination gates pass.
- Remaining risks: successful/corrupt native parsing, descriptor pressure,
  leaks and p95/p99 remain asset-backed work; native calls are synchronous and
  cannot be cancelled mid-parse; no original-client visual comparison is claimed.
- Documentation updated: inline API; `m2-raw-model-repository.md` with data-flow,
  lifecycle, sequence and dependency diagrams; finalizer/classifier/world-renderer
  specs, module registry and `RENDER.md`.

<!-- OPENWC_HANDOFF:READY:M03-RND-M2-RAW-MODEL-REPOSITORY-001:b608a81 -->

## Integration

- Merge commit: `7cd07dd`
- Post-merge results: repository `cases=10 iterations=10000
  elapsed_ms=3.200`; finalizer, extractor, cache, pipeline, shutdown, facade,
  internal-access `34`, manifest `7/7`, documentation and coordination gates passed.

<!-- OPENWC_INTEGRATION:ACCEPTED:M03-RND-M2-RAW-MODEL-REPOSITORY-001:7cd07dd -->
