Movi | Review-first file organization docs

Architecture And Data Flow

graph TD
    A["<workspace-root>/data/raw (input directory)"] --> B["Media scanner"]
    B --> C["Analyze"]
    C --> D["<workspace-root>/.movi/manifests/manifest.jsonl"]
    D --> E["Apply (move / rename)"]
    E --> F["<workspace-root>/data/organized/organized-images-* (output directory)"]
    D --> G["Rollback"]
    H["contracts/runtime/config.example.toml / --config"] --> C
    H --> E
    I["Logging (structured logs)"] --> C
    I --> E
    I --> G
    J["ErrorCode"] --> C
    J --> E

Core Modules

Layer Responsibilities

Layer Directory Responsibility Key Files
CLI orchestration apps/cli/ argument parsing, command routing, stage orchestration (analyze/apply/rollback/report) cli_app.py
Application core packages/application/ media analysis, manifest generation, apply / rollback, error states analyze_media.py, apply_command.py, reporting.py
Tooling distribution tooling/gates/ + tooling/runtime/ + tooling/docs/ + tooling/cleanup/ + tooling/ci/ + tooling/upstreams/ public entrypoints for gates, runtime, docs, cleanup, CI support, and upstream governance quality_gate.sh, pre_push_gate.sh, run_analyze.sh, docs_smoke.sh
Verification tests/ unit / integration / E2E / live verification tests/unit/, tests/integration/, tests/e2e/
Documentation governance docs/ architecture, operations, and render-only references architecture.md, env_contract.md, reference/*.generated.md
Delivery automation .github/workflows/ CI lanes, change detection, evidence upload ci.yml, live-integration.yml

Runtime Topology (Local / Container / CI)

graph LR
    A["developer / terminal"] --> B["scripts/container_exec.sh"]
    B --> C[docker-compose runtime]
    C --> D[pipeline cli_app]
    D --> E[<workspace-root>/data/raw -> <workspace-root>/.movi/manifests -> <workspace-root>/data/organized]
    C --> F["tests + quality gates"]
    F --> G[<workspace-root>/.movi/artifacts/evidence-bundle.json]
    H[GitHub Actions] --> I[.github/workflows/ci.yml]
    I --> C
    I --> G

Key Design Decisions

Current Web API Fact Summary

Auto-generated: current Web API facts come from contracts/api/web_api.openapi.yaml; the full method/path list lives in generated reference.

Product Purpose And Target Users

Purpose

Target Users

Value Proposition

Current External Surfaces

Movi now exposes four outward-facing surfaces, but they are still one system:

Think of it like one workshop with different doors for different visitors. The CLI is for operators, the WebUI is for humans, the Web API is for integration work, and Movi MCP is the guarded service window for agents. None of them gets to bypass manifest review.

Governance Truth Surfaces (Dynamic Projection)

This section documents where architecture truth converges. It is not meant to be a real-time CI weather report.

Auto-generated: delivery-complete truth, governance scorecard truth, hosted CI facts, and platform-alignment facts live in generated governance reference, required checks matrix, and runner contract.


Repository Segmentation And Boundaries

repo_root/
├─ apps/                  # CLI / API / WebUI entry surfaces
├─ packages/              # core / observability
├─ contracts/             # machine truth sources
├─ tooling/               # governed tooling area; public entrypoints live under runtime|gates|docs|cleanup|ci|upstreams
├─ tests/                 # unit / integration / e2e / live
├─ docs/                  # repo-level documentation
├─ ops/                   # compose / devcontainer / CI support
├─ <repo-runtime-cache>/  # the only legal repo-local temporary noise outlet
├─ sitecustomize.py       # repo-level Python startup hygiene hook (machine-cache pycache)
└─ .env.example           # runtime environment template

Boundary Rules

Auto-generated: runtime services, default ports, runtime paths, and entrypoint facts live in generated runtime topology.

Architecture Evolution Roadmap

Short Term (0-4 weeks)

Medium Term (1-3 months)

Long Term (3-6 months)

Transition note: Generated blocks in this document remain the machine-truth overlays. Some lower-level localized terminology may still appear elsewhere in the repository during the transition, but this English architecture narrative is the canonical public explanation.