Full engineering entry (verbatim)
### Milestone 16 — decision resolution & final combat specification audit (2026-08-10)
- **No production code changes** (version stays 0.12.0) — the M16 brief granted no approvals of the M15 decision package; the milestone is an audit/verification/documentation lock.
- Added `tests/unit/test_m16_audit.py` (24 tests): curse audit dimensions (buildup/resistance/threshold/duration/removal/ ownership/inflictor/summons/nullification/isolation/replay), ultimate audit (canonical V1/affinity/Harmony tiers/one-action/ summon exclusion/replay), consumable audit (12 registered; Ability Cache inert and blocked), security/isolation invariants (no registry/library mutation, no cross-battle hook leakage, no global instance growth, no Divine exposure through Human builds), and bounded performance sanity (stress battles terminate; no growth across 30 battles). 855 tests, 82.69% coverage.
- Documented finding M16-AUD-002: targetless ULTIMATE actions fall back to the actor per the docs/04 §4.3 effect normalization (legacy defaulted to the opponent); not silently fixed — a target-defaulting rule is a
- Deliverables: MILESTONE16_DECISION_RESOLUTION.md + MILESTONE16_FINAL_COMBAT_SPECIFICATION_REPORT.md. ### Added
- Full 50-document specification set (Developer Constitution through AI Development Roadmap).
- Complete AI ecosystem documentation (Combat Intelligence through Multi-Agent Architecture).
- Repository structure: README, INDEX, appendices, AI context files.
- **Milestone 0 — Project Foundation (v0.1.0).** Layered `dio` package implementing the docs/03 architecture: - Registry framework with automatic discovery, duplicate protection, reference/circular-dependency validation, and the ten documented registries (docs/05, docs/17). - Typed event system with priority ordering, cancellation, and chain-depth protection (docs/18). - Canonical 30-hook catalog with the documented priority tiers (1000/500/300/100/0) and a HookDispatcher over the event bus (docs/06). - Trigger framework: conditions, validation rules, per-battle cooldowns (docs/06 §7-8, §12). - Calculation-layer framework: Calculator interface, Modifier model, modifier pipeline (Base→Flat→Percentage→Multiplier→Cap→Final), formula registry (docs/04 §13-14, docs/08). - Configuration (pydantic-settings, `DIO_*` env + `.env`, nested groups, feature flags), structured logging with correlation ids, error hierarchy per docs/04 §20, and a DI container. - Data layer: SQLAlchemy 2 models for every docs/13 entity (15 tables), generic typed repositories with immutable-model enforcement, Alembic migration 0001 (verified up/down, zero model drift). - Combat engine skeleton: battle phase machine, combat state, action object, action resolver contract (execution pipeline is Stage 1). - Discord bootstrap: DioBot, cog auto-discovery, graceful shutdown, fail-fast token check, `/ping` health cog (docs/16). - `dio` CLI (check/ db-init/ db-migrate/ db-revision/ bot-run), Makefile tooling, GitHub Actions CI (ruff + mypy + pytest on 3.11–3.13), pre-commit hooks. - Reference prototype preserved verbatim at `src/dio_engine/` (41 artifacts, 79 abilities; fuzz harness verified clean). - 128 tests, 85.7% coverage; new tracking docs (PROJECT_ROADMAP.md, TASKS.md, KNOWN_ISSUES.md, DECISIONS.md); AI_MEMORY.md session 2. ### Changed
- **v0.2.0 — Milestone 1: Core Combat Engine.** Added the combat engine on top of the foundation (no foundation rewrite): - Battle lifecycle, CombatState, TurnEngine, ActionResolver (11-step docs/06 §10 pipeline), EffectResolver with the documented damage and curse pipelines, status runtime (docs/07), resources, cooldowns, temporary modifiers, seeded RNG, death/victory/draw, battle records, recovery architecture, BattleRecorder persistence, DB-backed session store. - Documented calculators registered: stats.ratio_allocation, damage.final, healing.final, curse.buildup, defense.effective_ resistance, stat.modified, resource.update, cooldown.final. - Conflict resolutions (developer-approved 2026-08-10): BAL-001 spec curse formula (threshold configurable, default 200), default Human stats activated, dotted IDs confirmed, canonical hooks confirmed. - 135 new tests (264 total, 87.0% coverage); engine version 0.2.0.
- Foundation API evolution (documented): CombatState gained the full canonical state; ActionResolver executes actions (previously raised UnimplementedFeatureError); effect model added to core. ### Added (v0.3.0 — Milestone 3: Core Game Content & Registration System)
- Content architecture (`dio.content`): AbilityDefinition, ArtifactDefinition, AffinityDefinition, CurseDefinition, ConsumableDefinition, UltimateDefinition, SummonDefinition, HumanClassDefinition; Race/HumanBeing/DivineBeing configuration with the authoritative AI_CONTEXT slot limits; build rules per docs/13.
- Registry: CLASS and SUMMON content types (12 registries); production content homes wired into discovery; canonical ID prefix validation.
- ContentLibrary: typed retrieval, cross-registry dependency validation, being/loadout validation, content-version recording; DI-wired.
- Combat Engine integration: ParticipantLoadout + loadout ownership, artifact/affinity hook binding, affinity stat modifiers, curse activation content effects, consumable use limits, summon identity, being→participant adapter. Approved engine rules untouched.
- 57 new tests (345 total, 88.2% coverage). ### Changed
- Engine version 0.3.0. Registry now rejects id prefixes that do not match the registry's content type (enforcement). ### Added (v0.4.0 — Milestone 4: Production Game Content & Character Build System)
- Production content (96 items) from the existing project specification: 16 affinities, 16 curses (7 with translated mechanics), 16 ultimates (identity-only), 12 consumables, 11 supporting statuses, 25 Human Classes (tiers, roll weights, Rune Master bonuses, stat modifiers, canonical-hook mechanics).
- Class Roll System (TIER_WEIGHTS 44.85/44.95/10/0.1) via the centralized RNG.
- Character/build persistence: CharacterService over the existing schema; migration 0002 (character affinity, docs/13 §6); affinity-ultimate gating; cumulative-stats/ratio validation.
- 42 new tests (387 total, 87.8% coverage). ### Changed
- Engine version 0.4.0. Engine changes were minimal content-integration additions (status data payloads, class stat modifiers at preparation, class hook binding, BattleRNG.choices/sample). ### Added (v0.4.1 — Milestone 5: Combat Content Integration & Spec Resolution)
- Full audit/design milestone: content matrix, curse/ultimate/harmony/ consumable/status/artifact/summon/nullification audits, Decay conflict investigation, engine extension proposal, implementation boundary classification.
- Audit-justified infrastructure: explicit approved combat stage order (dio.engine.lifecycle), CombatContext standard content context (dio.engine.context), summon-ultimate restriction guard (documented rule), declarative legacy-hook map (48 hooks, dio.content.legacy.hook_map). 11 new tests (398 total, 88%).
- MILESTONE5_COMBAT_INTEGRATION_REPORT.md with ### Changed
- Engine version 0.4.1. No approved combat rule or production content changed; blocked mechanics remain blocked and documented. ### Added (v0.4.2 — Milestone 5 corrections: Canonical Decisions & Harmony Design)
- Canonical.): Decay (60% healing->damage canonical), Nullification absolute negation (implemented in the EffectResolver; bypass only when explicit), Summons never trigger artifact passives (verified), Rune Master confirmed, connected Affinity/Curse/Ultimate/Harmony model, Human/Divine content separation across the whole content ecosystem (current set classified Divine), 25-50 total-action pacing.
- Harmony system implemented (dio/engine/harmony.py): four approved generation sources wired into battle events and the resolver, economy designed around the pacing model, ultimate Harmony requirements (low 40/ moderate 60/ high 80/ very_high 100) and spend-reset-to-0.
- Human/Divine separation: production content classified; filtering + validation; tests.
- 15 new canonical-rule tests (416 total, 88% coverage). ### Changed
- Engine version 0.4.2. Engine changes were the audit-justified corrections above; no approved combat rule or balance value changed outside the user-authorized Harmony economy design. ### Fixed
- Foundation-era defect: `apply_default_human_stats` behavior was pending approval — now approved and implemented per AI_CONTEXT.
- Hook integration gap closed: before_damage/after_damage/before_heal/ after_heal now emit at the documented moments.
- **Final approved rules implemented (2026-08-10, DECISIONS ..):** crit multiplier caps per race (Human 4x/3x, Divine 3x/3x) with explicit overrides; summon source identity + canonical summon events; Basic Attack = Power x RNG(0.85-1.25) via the seeded battle RNG; Rest = +3 Energy, +20% lost HP, +20% DR until the player's next turn; curse meter resets on activation with no default overflow (per-effect override available). BattleConfig.basic_attack/rest_recovery placeholders removed; 25 new tests (288 total, 87.4% coverage). ---