refactor(story1): clean story boundaries, introduce CharacterState record type, tighten ESLint

- Introduce CharacterState value object to group character properties
  → Character constructor reduced from 5 to 1 parameter
- Introduce Faction value type (previously bare string)
- Remove cross-story methods: isAllyOf, isAlive, isDead, add, isMax, next, diff
- Remove misleading level parameter from Health.create
- Remove trivial invariant tests (dead-code paths on fresh characters)
- Move cross-cutting invariants out of character-creation.allium
- ESLint: forbid unused params (remove argsIgnorePattern), max-params=5
- null parameters enforced by TypeScript strictNullChecks (tsconfig)
This commit is contained in:
2026-06-12 20:32:44 +01:00
parent d3cc48c0f7
commit e267c35e55
8 changed files with 76 additions and 120 deletions
-15
View File
@@ -44,21 +44,6 @@ rule CharacterCreation {
ensures: character.factions = empty
}
rule HealthNonNegative {
for c in Characters:
c.health.value >= 0
}
rule StatusAliveImpliesHealthPositive {
for c in Characters:
c.status = alive implies c.health.value > 0
}
rule StatusDeadImpliesHealthZero {
for c in Characters:
c.status = dead implies c.health.value = 0
}
rule MaxLevel {
for c in Characters:
c.level.value <= 10