CineForge is an AI-first film reasoning and production pipeline. It ingests creative input, normalizes it into canonical screenplay form, extracts scene-level structure, and carries forward immutable artifacts with full provenance.
- Python 3.12+
- Pydantic for schemas
- YAML recipes for pipeline orchestration
- Pytest + Ruff for quality checks
docs/spec.md: product specificationdocs/methodology/state.yaml: canonical planning statedocs/methodology/graph.json: compiled methodology graphdocs/stories.md: generated story indexdocs/stories/: individual story filesdocs/evals/registry.yaml: canonical eval and detector historysrc/cine_forge/: application codetests/: unit, integration, smoke testsconfigs/recipes/: pipeline recipesskills/: cross-agent reusable skillsoutput/: runtime artifacts (git-ignored)
Use the graph-state workflow, not ad hoc notes:
docs/ideal.md: the north stardocs/spec.md: stable problem categories (spec:1...spec:11)docs/methodology/state.yaml: the central hub for current priority, category phase (climb/hold/converge/unplanned), substrate truth, active focus, and campaignsdocs/build-map.mdanddocs/stories.md: generated views, never the source of truthdocs/stories/: concrete execution slicesdocs/evals/registry.yaml: metrics, runtime detectors, model comparisons, and compromise-deletion evidence
Rule of thumb:
- "Prioritize X" -> map
Xto the owningspeccategory, then updatedocs/methodology/state.yaml(active_focus, owning category phase/notes, and campaign if needed); create or update the owning story if execution work changed - "Build/fix X" -> create or update a story in
docs/stories/ - "Measure/benchmark/improve X" -> create or update an eval in
docs/evals/registry.yaml - "Remove a workaround" -> check whether the relevant compromise detector is green first
- Install
uv(recommended for repo-managed Python environments). - Sync dependencies through the repo wrapper so the rolling 7-day freshness delay is applied:
./scripts/uv-safe.sh sync --extra devFallback:
python3 -m pip install -e ".[dev]"The pip fallback bypasses the repo-local freshness delay. Direct uv commands do too unless
you pass --exclude-newer yourself. Use those paths only if you intentionally want to opt out.
- Read
AGENTS.mdfirst; it is the project-wide source of truth for AI agents. - Use skills under
skills/for common tasks. - Run the baseline checks:
make test-unit
make lintRun the full Story 007 MVP pipeline (ingest -> normalize -> scene extract -> project config) using mocked AI calls and the canonical Story 007 fixture:
PYTHONPATH=src python -m cine_forge.driver \
--recipe configs/recipes/recipe-mvp-ingest.yaml \
--run-id smoke-test-001 \
--param input_file=tests/fixtures/sample_screenplay.fountain \
--param default_model=mock \
--param qa_model=mock \
--param accept_config=trueEquivalent convenience target:
make smoke-testOptional live-model run (manual only; requires OPENAI_API_KEY):
make live-testCineForge employs semantic quality gates to ensure that the pipeline produces meaningful artifacts rather than structurally valid but empty or placeholder-heavy outputs.
- Ingest Fidelity: Detects and repairs tokenized or compact PDF layouts (e.g., from OCR or one-token-per-line extraction) to ensure scene-bearing structure is preserved.
- Normalization Safeguards: Rejects "degenerate" screenplay outputs (e.g., those defaulting to
UNKNOWN LOCATIONorNARRATORwhen source content contains real scene headings). - Extraction Precision: Validates scene counts and location/character presence against source expectations. Character extraction includes pronoun/noise filtering and derivative OCR suppression.
- Metadata Health: Artifacts failing semantic predicates are marked with
health: needs_review.
- Severely Mangled OCR: While CineForge repairs common PDF extraction artifacts (merged tokens, token-per-line), extremely noisy OCR without recognizable screenplay signals may still fallback to
proseclassification orneeds_reviewhealth. - Non-Standard Formatting: Scripts with highly unconventional scene heading formats may require manual normalization or custom role-prompt adjustments.
The MVP recipe produces immutable artifacts under output/project/artifacts/:
raw_input/project/vN.json: source text and format classification.canonical_script/project/vN.json: normalized screenplay with QA/cost metadata.scene/scene_XXX/vN.json: per-scene structured extraction artifacts.scene_index/project/vN.json: scene index and aggregate scene QA summary.project_config/project/vN.json: confirmed project configuration.
Per-run execution state is written to output/runs/<run_id>/:
run_state.json: stage statuses, artifact refs, durations, and total cost.pipeline_events.jsonl: ordered stage start/finish events.
Start the API and UI in two terminals:
# Terminal 1: API (hot-reloads on save)
PYTHONPATH=src python -m cine_forge.api
# Terminal 2: UI
cd ui && npm ci && npm run dev- API: http://localhost:8000 (OpenAPI docs at
/docs) - UI: http://localhost:5174
- Node installs are delayed by 7 days via repo-local npm/pnpm config.
npmuses.npmrcand needs version11.10.0+formin-release-age;pnpmusesui/pnpm-workspace.yamland needs10.16.0+forminimumReleaseAge. Older releases ignore these settings. - Python installs are delayed by 7 days when they go through
./scripts/uv-safe.sh ..., which computes a freshuv --exclude-newercutoff at runtime. - These guards reduce exposure to brand-new malicious publishes. They do not help if a bad version is already in a lockfile, is installed explicitly, or survives unnoticed past the 7-day window.
- Artifacts are immutable snapshots. Never mutate an existing artifact in place.
- Prefer tests first (or tests alongside implementation) for all module work.