Skip to content

Commit 7c99635

Browse files
committed
Update README with simulation shields and integrate tool explanation into QA section
1 parent d2f3e95 commit 7c99635

6 files changed

Lines changed: 44 additions & 6 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
![Monoliths](https://img.shields.io/endpoint?url=https://DerekGooding.github.io/Mythril/health/shield_monoliths.json)
77
![Docs](https://img.shields.io/endpoint?url=https://DerekGooding.github.io/Mythril/health/shield_docs.json)
88
![UI Integrity](https://img.shields.io/endpoint?url=https://DerekGooding.github.io/Mythril/health/shield_ui.json)
9+
![Reachability](https://img.shields.io/endpoint?url=https://DerekGooding.github.io/Mythril/health/shield_simulation.json)
10+
![Optimal Completion](https://img.shields.io/endpoint?url=https://DerekGooding.github.io/Mythril/health/shield_game_time.json)
911

1012
[**Live Website**](https://DerekGooding.Github.io/Mythril) | [**How to Play**](docs/instructions.md)
1113

@@ -46,6 +48,8 @@ Mythril is an RPG-inspired web application built with **.NET 10** and **Blazor W
4648
## ⚖️ Quality Assurance & Health
4749
We maintain project health through a custom automated suite (`scripts/check_health.py`) which runs on every commit:
4850
- **Monolith Prevention**: Strict 250-line limit for source files (excluding tools).
51+
- **Game Graph Simulation**: Integrated Fixed-Point Iteration engine that mathematically verifies every quest and resource is attainable from a fresh start. Prevents "logic orphans" and provides estimated optimal completion times for the endgame.
52+
- **Automated Balancing**: The reachability simulation is part of the health suite. If a content change makes a quest mathematically impossible (e.g. required stat cannot be reached), the build fails.
4953
- **Coverage**: Mandatory 70% overall line coverage; 25% per-file minimum.
5054
- **Razor Integrity**: All interactive components must have bUnit tests, `@key` usage in loops, and `data-testid` anchors.
5155
- **Documentation Integrity**: Automated staleness tracking via local file modification times.

scripts/check_health.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,22 @@ def check_reachability():
260260
print("--- Running Reachability Simulation ---")
261261
try:
262262
# Run the headless simulation
263-
# Use shell=True for windows/powershell compatibility if needed,
264-
# but direct list is safer for argument passing.
265263
cmd = ["dotnet", "run", "--project", "Mythril.Headless", "--", "--run-sim"]
266264
subprocess.check_call(cmd)
267-
return True
265+
266+
# Parse the report for time estimate
267+
report_path = Path("simulation_report.md")
268+
game_time = "Unknown"
269+
if report_path.exists():
270+
content = report_path.read_text(encoding="utf-8")
271+
match = re.search(r"- \*\*Rekindling the Spark\*\*: ([\d:]+)", content)
272+
if match:
273+
game_time = match.group(1)
274+
275+
return {"passed": True, "time": game_time}
268276
except subprocess.CalledProcessError:
269277
record_failure("reachability", "Simulation failed: One or more quests are mathematically unreachable.")
270-
return False
278+
return {"passed": False, "time": "N/A"}
271279

272280
# -----------------------
273281
# Feedback Check
@@ -335,6 +343,17 @@ def generate_shields(metrics):
335343
message = "passed" if ui_passed else "failed"
336344
write_shield("ui", "UI integrity", message, color)
337345

346+
# Simulation Shield
347+
sim = metrics.get('reachability_passed', {})
348+
sim_passed = sim.get('passed', False)
349+
color = "brightgreen" if sim_passed else "red"
350+
message = "passed" if sim_passed else "failed"
351+
write_shield("simulation", "reachability", message, color)
352+
353+
# Game Time Shield
354+
game_time = sim.get('time', "N/A")
355+
write_shield("game_time", "optimal completion", game_time, "blue")
356+
338357
# -----------------------
339358
# Export Results
340359
# -----------------------

scripts/data/health_summary.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
"key_violations": 0,
99
"testid_violations": 0,
1010
"stale_docs": 0,
11-
"reachability_passed": true,
11+
"reachability_passed": {
12+
"passed": true,
13+
"time": "00:13:47"
14+
},
1215
"pending_feedback": 0,
1316
"test_passed": true
1417
},

scripts/data/shield_game_time.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"schemaVersion": 1,
3+
"label": "optimal completion",
4+
"message": "00:13:47",
5+
"color": "blue"
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"schemaVersion": 1,
3+
"label": "reachability",
4+
"message": "passed",
5+
"color": "brightgreen"
6+
}

simulation_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Simulation Reachability Report
2-
Generated at: 2026-03-04 1:20:03 PM
2+
Generated at: 2026-03-04 1:24:03 PM
33

44
## ✅ All Content Reachable
55
No orphaned or mathematically impossible quests detected.

0 commit comments

Comments
 (0)