Skip to content

Commit ef76fd1

Browse files
committed
Add content integrity warnings to Content Manager GUI
1 parent 4a60a62 commit ef76fd1

6 files changed

Lines changed: 122 additions & 53 deletions

File tree

modules/contentManager/app.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@
3737
else:
3838
st.sidebar.error(f"Verification Failed:\n{res2.stdout}")
3939

40+
st.sidebar.write("---")
41+
st.sidebar.subheader("⚠️ Content Warnings")
42+
warnings = manager.get_warnings()
43+
if not warnings:
44+
st.sidebar.success("No issues detected!")
45+
else:
46+
for w in warnings:
47+
st.sidebar.warning(f"**{w['type']} [{w['name']}]**: {w['msg']}")
48+
49+
4050
def edit_list(data_list, key_prefix):
4151
to_delete = None
4252
for i, entry in enumerate(data_list):

modules/contentManager/data_io.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,56 @@ def _save_json(self, filename, data):
166166
path = os.path.join(self.data_dir, filename)
167167
with open(path, 'w', encoding='utf-8') as f:
168168
json.dump(data, f, indent=2)
169+
170+
def get_warnings(self):
171+
warnings = []
172+
items = { i["Name"]: i for i in self.unified_data["items"] }
173+
quests = self.unified_data["quests"]
174+
refinements = self.unified_data["refinements"]
175+
locations = self.unified_data["locations"]
176+
cadences = self.unified_data["cadences"]
177+
178+
produced_items = set()
179+
consumed_items = set()
180+
181+
# Track production
182+
for q in quests:
183+
for r in q.get("Rewards", []): produced_items.add(r["Item"])
184+
for ref in refinements:
185+
for rec in ref.get("Recipes", []): produced_items.add(rec["OutputItem"])
186+
187+
# Track consumption
188+
for q in quests:
189+
for r in q.get("Requirements", []): consumed_items.add(r["Item"])
190+
for ref in refinements:
191+
for rec in ref.get("Recipes", []): consumed_items.add(rec["InputItem"])
192+
for c in cadences:
193+
for ab in c.get("Abilities", []):
194+
for req in ab.get("Requirements", []): consumed_items.add(req["Item"])
195+
196+
# 1. Items with no source
197+
for item_name in items:
198+
if item_name not in produced_items and items[item_name]["ItemType"] not in ["Currency", "KeyItem"]:
199+
# Check if it's a starting item in any quest requirement (might be provided by prologue)
200+
# But generally if it's not produced anywhere, it's a warning
201+
warnings.append({ "type": "Item", "name": item_name, "msg": "No generation source (never rewarded or refined)." })
202+
203+
# 2. Items with no sink
204+
for item_name in produced_items:
205+
if item_name not in consumed_items and item_name in items and items[item_name]["ItemType"] not in ["Currency", "KeyItem", "Consumable"]:
206+
warnings.append({ "type": "Item", "name": item_name, "msg": "Has source but no sink (nothing to spend it on)." })
207+
208+
# 3. Useless recurring quests
209+
for q in quests:
210+
if q["Type"] == "Recurring":
211+
has_output = len(q.get("Rewards", [])) > 0 or len(q.get("StatRewards", {})) > 0
212+
213+
# Check if it unlocks anything
214+
is_prereq = any(q["Name"] in other.get("Requires", []) for other in quests)
215+
unlocks_cadence = len(q.get("UnlocksCadences", [])) > 0
216+
unlocks_loc = any(l.get("RequiredQuest") == q["Name"] for l in locations)
217+
218+
if not has_output and not is_prereq and not unlocks_cadence and not unlocks_loc:
219+
warnings.append({ "type": "Quest", "name": q["Name"], "msg": "Recurring quest that neither produces resources nor unlocks content." })
220+
221+
return warnings

scripts/data/health_summary.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"is_healthy": true,
3-
"failure_count": 0,
2+
"is_healthy": false,
3+
"failure_count": 1,
44
"metrics": {
55
"monoliths": 0,
6-
"coverage": 79.72,
6+
"coverage": 76.86,
77
"mutation_score": 0.0,
88
"missing_tests": 0,
99
"key_violations": 0,
@@ -16,7 +16,13 @@
1616
"unsustainable": 0
1717
},
1818
"pending_feedback": 0,
19-
"test_passed": true
19+
"test_passed": false
2020
},
21-
"failures": []
21+
"failures": [
22+
{
23+
"category": "tests",
24+
"message": "dotnet test failed",
25+
"metadata": {}
26+
}
27+
]
2228
}

scripts/data/shield_coverage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"schemaVersion": 1,
33
"label": "coverage",
4-
"message": "79.7%",
4+
"message": "76.9%",
55
"color": "green"
66
}

scripts/data/shield_tests.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"schemaVersion": 1,
33
"label": "tests",
4-
"message": "passed",
5-
"color": "brightgreen"
4+
"message": "failed",
5+
"color": "red"
66
}

simulation_report.md

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Game Content Health Report
2-
Generated: 2026-04-22 11:44:37
2+
Generated: 2026-04-22 12:39:05
33

44
## 💀 Reachability Analysis
55
Total Quests Completed: 36
@@ -9,67 +9,67 @@ Routed Completion Time: 64.7m
99

1010
## ⚖️ Economic Sustainability
1111
### Sustainable Recurring Activities
12-
- Deep Sea Scavenge
13-
- Refine Lightning:Ice Shard->Lightning I
14-
- Refine Earth:Crystal Shards->Earth I
15-
- Refine Scrap:Slime->Gold
16-
- Shatter the Crystals
12+
- Purify the Grove
13+
- Chop Wood
14+
- High Altitude Survey
15+
- Refine Lightning:Fire Shard->Lightning I
1716
- Hunt Sand-Sharks
18-
- Buy Potion
19-
- Hunt Spiders
17+
- Hunt Slimes
18+
- Mine Iron Ore
2019
- Refine Ice:Moonberry->Ice I
20+
- Refine Ice:Mana Leaf->Ice I
21+
- Hunt Goblins
22+
- Gather Moonberries
2123
- Refine Life:Ancient Bark->Cure I
22-
- Hunt Bats
24+
- Refine Earth:Crystal Shards->Earth I
25+
- Refine Scrap:Slime->Gold
26+
- Refine Wood:Log->Herb
2327
- Power the Forge
24-
- Refine Ice:Mana Leaf->Ice I
25-
- Refine Water:Blue Coral->Water I
26-
- Mine Iron Ore
27-
- Harvest Sea-Life
28-
- Archive Sifting
29-
- Refine Haste:Lost Parchment->Haste I
30-
- Refine Mixology:Herb->Potion
31-
- High Altitude Survey
32-
- Hunt Slimes
3328
- Study Ancient Texts
29+
- Refine Fire:Basic Gem->Fire I
30+
- Archive Sifting
31+
- Hunt Bats
32+
- Shatter the Crystals
3433
- Refine Scrap:Web->Gold
34+
- Harvest Sea-Life
3535
- Tutorial Section
36-
- Refine Fire:Iron Ore->Fire I
36+
- Buy Potion
37+
- Refine Haste:Lost Parchment->Haste I
38+
- Refine Water:Blue Coral->Water I
39+
- Refine Mixology:Herb->Potion
3740
- Sell Gem
38-
- Refine Wood:Log->Herb
41+
- Hunt Spiders
42+
- Refine Fire:Iron Ore->Fire I
3943
- Scavenge Scrap
40-
- Purify the Grove
41-
- Hunt Goblins
42-
- Chop Wood
43-
- Refine Fire:Basic Gem->Fire I
44-
- Refine Lightning:Fire Shard->Lightning I
45-
- Gather Moonberries
44+
- Refine Lightning:Ice Shard->Lightning I
45+
- Deep Sea Scavenge
4646

4747
### Net Resource Rates (per second)
48-
- **Ice Shard**: 30.0487/s
49-
- **Slime**: 20.5503/s
50-
- **Fire Shard**: 31.2959/s
51-
- **Lost Parchment**: 3.3258/s
52-
- **Gold**: 10085.1508/s
5348
- **Fire I**: 29.1009/s
54-
- **Haste I**: 24.9436/s
55-
- **Herb**: 19.9549/s
49+
- **Ancient Bark**: 6.2359/s
50+
- **Water**: 52.5561/s
5651
- **Sun-baked Scale**: 0.8315/s
57-
- **Water I**: 105.1123/s
58-
- **Ice I**: 49.8873/s
52+
- **Leather**: 26.2781/s
53+
- **Iron Ore**: 11.1049/s
5954
- **Potion**: 40.0262/s
60-
- **Mythril Spark**: 0.4157/s
61-
- **Moonberry**: 21.2893/s
55+
- **Slime**: 20.5503/s
56+
- **Crystal Shards**: 7.4831/s
6257
- **Log**: 4.9887/s
63-
- **Ancient Bark**: 6.2359/s
64-
- **Lightning I**: 49.8873/s
65-
- **Iron Ore**: 11.1049/s
58+
- **Moonberry**: 21.2893/s
59+
- **Ice Shard**: 30.0487/s
60+
- **Earth I**: 24.9436/s
6661
- **Mana Leaf**: 5.3223/s
67-
- **Cure I**: 12.4718/s
62+
- **Gold**: 10085.1508/s
63+
- **Lightning I**: 49.8873/s
6864
- **Basic Gem**: 10.7781/s
69-
- **Water**: 52.5561/s
70-
- **Crystal Shards**: 7.4831/s
71-
- **Earth I**: 24.9436/s
72-
- **Leather**: 26.2781/s
65+
- **Herb**: 19.9549/s
66+
- **Lost Parchment**: 3.3258/s
67+
- **Haste I**: 24.9436/s
68+
- **Ice I**: 49.8873/s
69+
- **Water I**: 105.1123/s
70+
- **Fire Shard**: 31.2959/s
71+
- **Mythril Spark**: 0.4157/s
72+
- **Cure I**: 12.4718/s
7373

7474
## 🔄 Feedback Loops
7575
✅ No unbounded growth loops detected (approximation).

0 commit comments

Comments
 (0)