Skip to content

SPEC-009: Implementar Modo 3 (XML direto) — canário MCP#4

Open
dudujarra wants to merge 1 commit into
claude/angry-lehmann-b1b1c2from
feat/SPEC-009-modo3-xml-direto
Open

SPEC-009: Implementar Modo 3 (XML direto) — canário MCP#4
dudujarra wants to merge 1 commit into
claude/angry-lehmann-b1b1c2from
feat/SPEC-009-modo3-xml-direto

Conversation

@dudujarra
Copy link
Copy Markdown
Owner

Stacked on top of PR #1 (reframe v2)

Esta PR implementa SPEC-009 (Modo 3 XML direto). Modo 3 é o canário de fumaça MCP — sem decisão editorial, sem LLM, só validação + import. Valida a stack antes de SPEC-007 (Modo 1) onde o investimento é maior.

Summary

  • helpers/modo3.pyvalidate_xml() + verify_imported_clips() + CLI typer
  • Path hardening: allowlist de roots + suffix whitelist + reject de path traversal
  • Mitigação bug Premiere 2025 "random footage from other projects": cross-check expected vs actual pós-import
  • 19/19 testes pytest verdes
  • 8/8 harness checks PASS

Test plan

  • uv run pytest tests/test_spec_009_modo3.py -v → 19 passed
  • bash scripts/spec-009-harness.sh → 8 PASS / 0 FAIL / 0 SKIP
  • bash scripts/run-all-harnesses.sh → 3/3 PASS
  • CLI smoke: uv run python helpers/modo3.py validate tests/fixtures/decupagens/exemplo-modo3.xml
  • Smoke MCP ao vivo (gated, Premiere aberto) — validar com Dudu manualmente

Akita compliance

  • ✅ Spec aprovada antes da implementação (SPEC-009)
  • ✅ Harness no mesmo PR (Regra 0)
  • ✅ Sem import anthropic, sem API paga (Mandamento 7)
  • ✅ Path hardening obrigatório implementado
  • ✅ Pós-add validation pra bug Premiere 2025

Next

F2 continua: SPEC-007 (Modo 1) — depende deste merge + lições aprendidas em smoke MCP ao vivo.

Refs #2

🤖 Generated with Claude Code

helpers/modo3.py:
- validate_xml(xml_path) — parse xmeml + path hardening + allowlist
- verify_imported_clips(expected, actual) — cross-check pós-import
  (mitigação bug Premiere 2025 "random footage from other projects")
- CLI typer: validate / verify subcommands
- Schemas pydantic: XmlValidationResult, ExpectedClip, ActualClip,
  ClipMismatch, VerificationResult

Path hardening:
- ALLOWED_PATH_ROOTS = [~/Documents/AUTOEDIT/material_teste,
  ~/Documents/AUTOEDIT/tests/fixtures, ~/Movies, ~/Documents, /Volumes]
- ALLOWED_MEDIA_SUFFIXES = mp4/mov/m4v/avi/mkv/wav/mp3/aif/aiff/flac
- Resolve pathurls (file://localhost/, file:///), URL-decode, reject
  remote, reject path traversal

Tests (tests/test_spec_009_modo3.py): 19/19 PASS
- pathurl resolution (5 tests)
- path allowlist (2 tests)
- xmeml parsing happy/sad paths (8 tests)
- verify cross-check + bug Premiere 2025 detection (3 tests)
- suffix allowlist (1 test)

Harness scripts/spec-009-harness.sh: 8 PASS / 0 FAIL / 0 SKIP
- Spec + fixture existem
- Fixture xmeml válido (root <xmeml>)
- helpers/modo3.py existe + importável
- CLI validate funciona em fixture
- Pytest 19/19 PASS
- OTIO disponível

Total harnesses repo: 3/3 PASS.

Refs #2 (F2)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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