Files
Metamorph/backend
Knacky 90036437cc test(m4): pytest parser + endpoints + e2e tag picker
- backend/tests/test_mitre.py: 12 integration tests using a hand-crafted
  minimal STIX bundle (no network in tests). Covers parser
  (revoked/deprecated skip, sub-technique parent linkage), seed idempotence,
  persisted settings, checksum mismatch path, all four read endpoints, perm
  enforcement on /mitre/sync, ILIKE search.
- e2e/tests/m4-mitre.spec.ts: 6 Playwright tests against the live stack.
  beforeAll calls POST /mitre/sync once (real bundle, ~50 MB, ~1.1 s) then
  the suite validates tactics ≥14, T1003 has ≥5 sub-techniques, the picker
  walks tactic→technique→subtechnique with chip multi-select, and non-admin
  sees /mitre but no Sync card.
- tasks/testing-m4.md: manual + automated checklist, air-gapped operator
  notes, volume-permission caveat for pre-existing root-owned volumes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 13:54:26 +02:00
..

Metamorph backend

Flask 3 API. See repo root README.md for the big picture.

Layout

app/
├── api/        # HTTP layer (blueprints), versioned under /api/v1
├── core/       # config (env-driven), structured logging
├── db/         # SQLAlchemy session + Alembic (M1+)
├── models/     # ORM models (M1+)
├── services/   # domain logic (M2+)
└── i18n/       # message catalogs (M13)
tests/          # pytest

Local dev

Requires uv and a reachable Postgres (M1+; not needed yet for /health).

uv sync                                            # install deps from pyproject.toml
uv run flask --app app.main run --debug --port 8000
curl http://localhost:8000/api/v1/health

Tests

uv run pytest

Lint

uv run ruff check .
uv run ruff format .