Vigil
← All news

v1.5.9 — wiki damage-reduction-% scrape (M-MIT prep)

- **Schema**: new nullable `abilities.mit_pct` column (Integer, 0..100). Alembic migration `cead7d264bf9_abilities_mit_pct`. 17 tables in dev DB. - **`ingest/wiki.py`**: extended…

Added — abilities.mit_pct + extended wiki scraper

  • Schema: new nullable abilities.mit_pct column (Integer, 0..100). Alembic migration cead7d264bf9_abilities_mit_pct. 17 tables in dev DB.
  • ingest/wiki.py: extended with extract_mit_pct(html) + fetch_metadata_for_ability(client, name) + scrape_metadata_for_abilities(client, batch). One HTTP request per ability returns both duration_ms and mit_pct. Regex: anchored to verb (reduces?|lowers?|reduced|reducing|lowering) + ≤120 non-period chars + (\d{1,2})\s*%. Takes the FIRST match; sanity-bounds 1..100.
  • scripts/scrape_ability_durations.py updated to populate both fields in one pass. --force re-scrapes fully; otherwise rows are scraped if either field is missing. Output table now shows both old/new values per row.
  • API (api/main.py): AbilityLabelOut.mit_pct surfaced on /api/abilities/labels so the strat editor palette can render it.
  • UI (web/src/StratEditor.jsx): MitPalette pill now shows the mit % in green (e.g. "Rampart 20s -20%") alongside duration. Tooltip combines both.

Live AC — 10 mit abilities scraped

  • Rampart 20s / 20%, Reprisal 15s / 10%, Troubadour 15s / 15%, Collective Unconscious 18s / 10%, Intervention 8s / 10%, Holy Sheltron 8s / 15%, Oblation 10s / 10%, Expedient 10s / 10%, Exaltation 8s / 10%, Guardian 15s / 40% (RPR — high mit value correctly captured). All match in-game values.

Known limitations (documented in _MIT_PCT_RE docstring; M-MIT today doesn't quantify so this is conservative-first)

  • Multi-value abilities (Feint 10% physical + 5% magic; Heart of Light 5% physical + 10% magic) get the FIRST listed value, which is the headline for the mit-class but not always what the user wants.
  • Patch-note text on the page can shadow the current value (e.g. Mantra "reduced from 20% to 10%" picks up 20).
  • Barrier-style mits (Divine Veil) that don't reduce a %-value don't match.
  • A wiki cleanup pass + hand-curated overrides could fix all three when M-MIT actually uses this data.

Tests

  • 7 new tests in tests/test_wiki.py: simple reduce, multi-value first-wins, no-verb returns None, sanity bound (0%), combined fetch returns both fields, 404 yields all-None, batch scrape with mixed pages. 386 tests passing (379 → 386).