Skip to content

Complete core systems test coverage improvements (epic 10.1.1)#48

Merged
SorraTheOrc merged 5 commits into
mainfrom
copilot/improve-core-systems-test-coverage
Dec 4, 2025
Merged

Complete core systems test coverage improvements (epic 10.1.1)#48
SorraTheOrc merged 5 commits into
mainfrom
copilot/improve-core-systems-test-coverage

Conversation

Copilot AI commented Dec 3, 2025

Copy link
Copy Markdown

Implements all child tasks (10.1.2–10.1.8) of the test coverage epic, adding 166 tests and improving coverage from 90.25% to 90.95%.

Changes

SimEngine API coverage (10.1.3)

  • 41 new tests for all public APIs: director_feed, explanations (query_timeline, explain_metric, explain_faction), progression helpers
  • Error path coverage: uninitialized state, invalid views, tick limit enforcement
  • Integration test validating progression updates on tick advance

FactionSystem RNG decoupling (10.1.4)

  • Replaced brittle seed-based tests with DeterministicRNG injection
  • State transitions now verified against config deltas (legitimacy, resources)
class DeterministicRNG:
    def __init__(self, uniform_value: float = 0.0):
        self._uniform_value = uniform_value

    def uniform(self, lo: float, hi: float) -> float:
        return max(lo, min(hi, self._uniform_value))

Persistence fidelity (10.1.5)

  • 17 round-trip tests (save → load → save) for all subsystems
  • Backwards compatibility tests for missing/unknown fields

Cross-system integration (10.1.6)

  • 7 scenario tests: unrest cascades, faction rivalry, economy-environment feedback
  • Marked @integration/@slow for selective CI execution

Performance guardrails (10.1.7)

  • Tick limit enforcement for engine, CLI, service
  • Timing thresholds (100 ticks < 10s)

AI/LLM mocking (10.1.8)

  • ConfigurableMockProvider and AIPlayerMockProvider for OpenAI/Anthropic
  • Gateway → LLM → Simulation flow coverage
  • CI-friendly: no external API calls

Coverage Impact

Component Before After
SimEngine 85% 98%
AI/LLM 0-20% 74-97%
Total 90.25% 90.95%
Original prompt

"Issue 45 - 10.1.1 — Core systems test coverage improvements (epic)" to test agent

Created from Copilot CLI via the copilot delegate command.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…1.1)

- Task 10.1.3: Add 41 SimEngine API and error-path tests
- Task 10.1.4: Refactor FactionSystem tests with DeterministicRNG
- Task 10.1.5: Add 17 persistence save/load fidelity tests
- Task 10.1.6: Add 7 cross-system integration scenario tests
- Task 10.1.7: Add 14 performance and tick-limit guardrail tests
- Task 10.1.8: Add 78 AI/LLM mock-based tests

Total: 166 new tests, 849 tests total at 90.95% coverage

Co-authored-by: SorraTheOrc <250240+SorraTheOrc@users.noreply.github.com>
Copilot AI changed the title [WIP] Add improvements for core systems test coverage Complete core systems test coverage improvements (epic 10.1.1) Dec 3, 2025
Copilot AI requested a review from SorraTheOrc December 3, 2025 04:30
SorraTheOrc added a commit that referenced this pull request Dec 4, 2025
… Complete core systems test coverage improvements (epic 10.1.1)
@SorraTheOrc SorraTheOrc merged commit e736cf8 into main Dec 4, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants