- AGENTS.md: replace hardcoded Traefik/Authelia references with generic reverse-proxy/OIDC SSO triggers and align Tier 1 dangerous extensions (case-insensitive, adding .ps1 and .7z). - docs/adr/001-pipeline-safety-and-bff-dual-client.md: remove hardcoded addmovie.roadtotech.me/Traefik/Authelia references, add CORS_ALLOWED_ORIGINS portability, and restrict local_user fallback strictly to AUTH_ENABLED=false (fail-closed 401 otherwise). - docs/adr/002-pipeline-invariants-and-active-reconciliation.md: add Base32-to-hex info_hash normalization and uq_download_jobs_active_info_hash index (DEC-2), refine Tier 1/2 sanitizer and path/subtitle rules (DEC-3/5), add bounded startup retry and zero-delta stall wording (DEC-6), separate relocation executor and subscribe-before-snapshot coalescing (DEC-7), and enforce fail-closed AUTH_ENABLED + CORS_ALLOWED_ORIGINS (DEC-8). - docs/architecture.md: add Canonical References and Scope/Non-Goals/Operational Limits, document QUEUED->FAILED transition, align DEC-2..DEC-8 invariants, and add /healthz and gRPC health check probes. - docs/deployment.md: parameterize Compose environment/volume/proxy variables (MAGNETFLIX_HOST, TRAEFIK_AUTH_MIDDLEWARE, proxy_network, MAGNETFLIX_*_DIR), add worker non-root PUID/PGID + depends_on + transmission healthcheck, and update fail-closed identity adapter table. - docs/roadmap.md & todo.txt: mark M1.1-M1.7 completed, add pending M1.8 (Base32 info_hash normalization + migration 003), and synchronize M2-M4 work items with the reconciled DEC-3..DEC-8 requirements.
40 lines
5.0 KiB
Plaintext
40 lines
5.0 KiB
Plaintext
# Milestone 1: Contracts, Toolchain & Database Hardening (Prerequisites & Blockers)
|
|
x 2026-10-31 (A) Create services/contracts workspace package with pyproject.toml (module-name = 'magnetflix') +contracts @workspace
|
|
x 2026-10-31 (A) Reconfigure buf.gen.yaml to output stubs into services/contracts/src, generate stubs + docs/api_spec.md, and track in Git +proto @contracts
|
|
x 2026-10-31 (A) Update services/worker and services/bff to depend on magnetflix-contracts via workspace dependency +deps @workspace
|
|
x 2026-10-31 (A) Update pyproject.toml to include tests/ in pyright, remove exclusions masking broken imports, and add test rule to Makefile +ci @workspace
|
|
x 2026-10-31 (A) Update services/worker/Dockerfile and services/bff/Dockerfile to copy services/contracts, and copy alembic/ into worker image +docker @deploy
|
|
x 2026-10-31 (A) Create Alembic migration 002_add_info_hash_and_partial_unique_index.py adding info_hash column and uq_download_jobs_active_imdb_id index +db @worker
|
|
x 2026-10-31 (A) Update DownloadJob ORM model and write unit tests in tests/test_db.py verifying duplicate active insertion rejection +test @worker
|
|
(A) Normalize Base32 btih info_hash to 40-char lowercase hex in DownloadJob and add partial unique index uq_download_jobs_active_info_hash via Alembic migration 003 +db @worker
|
|
|
|
# Milestone 2: Pipeline Domain Engine & Filesystem Safety
|
|
(B) Implement Two-Tier Media Sanitizer in services/worker/src/worker/sanitizer.py (hard-fail on symlinks/traversal/executables, ignore .txt/.nfo, sample discard, largest video selector) +sanitizer @worker
|
|
(B) Write comprehensive unit tests in tests/test_sanitizer.py covering allowlist, traversal, sample filtering, and largest video selection +test @worker
|
|
(B) Implement TMDB Client & Token Verifier in services/worker/src/worker/metadata.py (early ingestion resolution via /find/{imdb_id} and post-download token overlap check) +metadata @worker
|
|
(B) Write unit tests with mocked TMDB responses in tests/test_metadata.py verifying match, 404, non-movie rejection, and token overlap +test @worker
|
|
(B) Implement Multi-Track Library Relocator in services/worker/src/worker/relocator.py (title path sanitization, format preservation for .srt/.vtt/.sub/.ass, language/disambiguation tagging, two-stage atomic directory swap) +relocator @worker
|
|
(B) Write unit tests in tests/test_relocator.py testing destination directory formatting, subtitle moving, and atomic swap cleanup +test @worker
|
|
|
|
# Milestone 3: Transmission Integration & Worker Coordinator
|
|
(C) Implement Transmission client wrapper in services/worker/src/worker/transmission.py (add_torrent to /data/staging/<job_id>, poll progress, remove_torrent with delete_data) +transmission @worker
|
|
(C) Write unit tests with mocked transmission-rpc client in tests/test_transmission.py +test @worker
|
|
(C) Implement pipeline state machine coordinator in services/worker/src/worker/pipeline.py (linear transitions + QUEUED->FAILED, 15-min zero-delta stall timeout, separate relocation pool, in-memory pub/sub queues) +pipeline @worker
|
|
(C) Implement startup active reconciliation sweep in pipeline.py (auto-fail non-terminal jobs, remove Transmission torrents with bounded startup retry, purge staging disks) +pipeline @worker
|
|
(C) Implement gRPC PipelineServiceServicer in services/worker/src/worker/service.py and entrypoint worker/main.py (SubmitDownload, GetJob, StreamJobStatus, ListJobs) +grpc @worker
|
|
(C) Write integration tests in tests/test_grpc_service.py verifying duplicate rejection, job submission, status querying, and pagination +test @worker
|
|
|
|
# Milestone 4: FastAPI BFF Gateway, SSE & Web UI
|
|
(D) Implement Pluggable Identity Adapter Middleware in FastAPI BFF (fail-closed 401 when AUTH_ENABLED=true, configurable AUTH_HEADER_USER/CORS, local_user only when AUTH_ENABLED=false) +auth @bff
|
|
(D) Implement BFF gRPC client wrapper in services/bff/src/bff/grpc_client.py connecting to Worker service +grpc @bff
|
|
(D) Implement REST endpoints in services/bff/src/bff/main.py (dual routes POST /api/v1/downloads and POST /download with Pydantic aliases, GET /api/v1/movies/search TMDB proxy) +api @bff
|
|
(D) Implement Server-Sent Events stream GET /api/v1/movies/events connected to gRPC StreamJobStatus +sse @bff
|
|
(D) Embed single-origin HTML Web UI dashboard in services/bff/src/bff/templates/ and static/ with movie search autocomplete, poster previews, and live progress bars +ui @bff
|
|
(D) Write API tests in tests/test_bff_routes.py covering auth extraction, dual routes, search proxy, and SSE streams +test @bff
|
|
|
|
# Milestone 5: Multi-Container Stack & Deployment Verification
|
|
(E) Finalize services/worker/Dockerfile and services/bff/Dockerfile multi-stage production builds +docker @deploy
|
|
(E) Author canonical production-ready docker-compose.yml including bff, worker, transmission, volume mounts, and network bridges +compose @deploy
|
|
(E) Configure Traefik routing labels, health probes (/healthz and gRPC health), and verify container communication +traefik @deploy
|
|
(E) Execute end-to-end integration test with public domain torrent verifying full acquisition, organization, and SSE reporting lifecycle +e2e @test
|