Fix every NPC sheet, which has never opened

npc-sheet.hbs line 43 read

    {{#if (lookup ../skillsByCategory key).length}}

and Handlebars cannot read a property off a subexpression. That is a PARSE
error, so the template never compiled, so every NPC sheet in the system threw
on click — Natives & Threats, the starter's enemy roster, and the whole LAST
ADMISSION cast. #if already treats an empty array as falsy, so the .length was
never doing anything in the first place.

It was invisible to all four existing guards, and the reason is worth writing
down: check-rules reads .mjs, check-behaviour says in its own header that it
cannot reach sheets, and every play-through in this project has driven the
system through its API rather than by clicking. Nobody had ever opened an NPC
sheet, including me, in any of the sessions that "played through" scenarios
full of NPCs.

So: check-templates.mjs, a fifth guard, compiling every .hbs in about a tenth
of a second, wired into the build ahead of check-behaviour. It also names the
specific shape — a property read off a subexpression — because the raw parse
error says only where. Verified it bites by reintroducing the bug. Handlebars
is a devDependency now.

Opening the sheet then showed a second thing nobody had seen: the NPC skill
rows carry four children and were using the character sheet's seven-column
grid, so the name landed in a 13px column and the whole list overlapped
itself. The NPC row now has its own four-column template.

Verified by opening all six LAST ADMISSION cast sheets with an error hook
attached: six rendered, no errors, and Old Marrow reads HP 20/20, major wound
10, armour 2, Brawl 60%, Melee Weapon (Polearm) 60%.

Version 1.0.1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
slaguru666
2026-08-12 18:42:05 +01:00
co-authored by Claude Opus 5
parent c595bf5a33
commit 02ec47a351
143 changed files with 131 additions and 126 deletions
+2 -2
View File
@@ -180,9 +180,9 @@ The build runs all three guards before it writes anything:
<!-- guards:start -->
```
check-rules: OK — 87 rules, 20 files scanned, 3 aliases + 41 constant sets checked, 275 formulas verified
check-rules: OK — 87 rules, 21 files scanned, 3 aliases + 41 constant sets checked, 275 formulas verified
check-kits: OK — 25 roles, 10 trades, 218 catalogue items, every kit key resolves, every posting can use what it carries, every loadout distinct
check-lang: OK — en.json, 927 keys, no leaf/branch collisions
check-behaviour: OK — 43 behavioural tests
check-behaviour: OK — 44 behavioural tests
```
<!-- guards:end -->
+4 -1
View File
@@ -7,7 +7,7 @@
"build": "node tools/build-packs.mjs && node tools/update-readme.mjs",
"icons": "node tools/make-icons.mjs",
"dice": "node tools/make-dice-textures.mjs",
"check": "node tools/check-rules.mjs && node tools/check-kits.mjs && node tools/check-lang.mjs && node tools/check-behaviour.mjs",
"check": "node tools/check-rules.mjs && node tools/check-kits.mjs && node tools/check-lang.mjs && node tools/check-templates.mjs && node tools/check-behaviour.mjs",
"test": "npm run check",
"readme": "node tools/update-readme.mjs"
},
@@ -17,5 +17,8 @@
"type": "commonjs",
"dependencies": {
"classic-level": "^3.0.0"
},
"devDependencies": {
"handlebars": "^4.7.9"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000004
MANIFEST-000002
+1 -5
View File
@@ -1,5 +1 @@
2026/08/12-18:25:14.825703 1726ef000 Recovering log #3
2026/08/12-18:25:14.825849 1726ef000 Level-0 table #5: started
2026/08/12-18:25:14.825995 1726ef000 Level-0 table #5: 4591 bytes OK
2026/08/12-18:25:14.826236 1726ef000 Delete type=0 #3
2026/08/12-18:25:14.826263 1726ef000 Delete type=3 #2
2026/08/12-18:41:45.665018 17412b000 Delete type=3 #1
-1
View File
@@ -1 +0,0 @@
2026/08/12-18:25:00.997036 17328b000 Delete type=3 #1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000004
MANIFEST-000002
+1 -5
View File
@@ -1,5 +1 @@
2026/08/12-18:25:14.845998 172efb000 Recovering log #3
2026/08/12-18:25:14.846266 172efb000 Level-0 table #5: started
2026/08/12-18:25:14.846391 172efb000 Level-0 table #5: 4129 bytes OK
2026/08/12-18:25:14.846614 172efb000 Delete type=0 #3
2026/08/12-18:25:14.846646 172efb000 Delete type=3 #2
2026/08/12-18:41:45.733783 172907000 Delete type=3 #1
-1
View File
@@ -1 +0,0 @@
2026/08/12-18:25:01.063788 173a97000 Delete type=3 #1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000004
MANIFEST-000002
+1 -5
View File
@@ -1,5 +1 @@
2026/08/12-18:25:14.826938 171ee3000 Recovering log #3
2026/08/12-18:25:14.827153 171ee3000 Level-0 table #5: started
2026/08/12-18:25:14.827483 171ee3000 Level-0 table #5: 31614 bytes OK
2026/08/12-18:25:14.827723 171ee3000 Delete type=0 #3
2026/08/12-18:25:14.827764 171ee3000 Delete type=3 #2
2026/08/12-18:41:45.666832 17391f000 Delete type=3 #1
-1
View File
@@ -1 +0,0 @@
2026/08/12-18:25:00.998955 172a7f000 Delete type=3 #1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000004
MANIFEST-000002
+1 -5
View File
@@ -1,5 +1 @@
2026/08/12-18:25:14.839430 1726ef000 Recovering log #3
2026/08/12-18:25:14.839716 1726ef000 Level-0 table #5: started
2026/08/12-18:25:14.840052 1726ef000 Level-0 table #5: 44390 bytes OK
2026/08/12-18:25:14.840621 1726ef000 Delete type=0 #3
2026/08/12-18:25:14.840694 1726ef000 Delete type=3 #2
2026/08/12-18:41:45.717519 17412b000 Delete type=3 #1
-1
View File
@@ -1 +0,0 @@
2026/08/12-18:25:01.048880 17328b000 Delete type=3 #1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000004
MANIFEST-000002
+1 -5
View File
@@ -1,5 +1 @@
2026/08/12-18:25:14.812575 1726ef000 Recovering log #3
2026/08/12-18:25:14.814591 1726ef000 Level-0 table #5: started
2026/08/12-18:25:14.816158 1726ef000 Level-0 table #5: 225945 bytes OK
2026/08/12-18:25:14.816434 1726ef000 Delete type=0 #3
2026/08/12-18:25:14.816497 1726ef000 Delete type=3 #2
2026/08/12-18:41:45.701249 173113000 Delete type=3 #1
-1
View File
@@ -1 +0,0 @@
2026/08/12-18:25:01.033123 172a7f000 Delete type=3 #1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000004
MANIFEST-000002
+1 -5
View File
@@ -1,5 +1 @@
2026/08/12-18:25:14.822117 173707000 Recovering log #3
2026/08/12-18:25:14.822240 173707000 Level-0 table #5: started
2026/08/12-18:25:14.822383 173707000 Level-0 table #5: 3295 bytes OK
2026/08/12-18:25:14.822727 173707000 Delete type=0 #3
2026/08/12-18:25:14.822771 173707000 Delete type=3 #2
2026/08/12-18:41:45.728905 173113000 Delete type=3 #1
-1
View File
@@ -1 +0,0 @@
2026/08/12-18:25:01.058642 173a97000 Delete type=3 #1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000007
MANIFEST-000002
+1 -3
View File
@@ -1,3 +1 @@
2026/08/12-18:25:14.806453 172efb000 Recovering log #6
2026/08/12-18:25:14.806833 172efb000 Delete type=0 #6
2026/08/12-18:25:14.806857 172efb000 Delete type=3 #4
2026/08/12-18:41:45.686790 17412b000 Delete type=3 #1
-5
View File
@@ -1,5 +0,0 @@
2026/08/12-18:25:01.665437 16f483000 Recovering log #3
2026/08/12-18:25:01.667727 16f483000 Level-0 table #5: started
2026/08/12-18:25:01.671815 16f483000 Level-0 table #5: 545293 bytes OK
2026/08/12-18:25:01.672145 16f483000 Delete type=0 #3
2026/08/12-18:25:01.672193 16f483000 Delete type=3 #2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000004
MANIFEST-000002
+1 -5
View File
@@ -1,5 +1 @@
2026/08/12-18:25:14.829681 173707000 Recovering log #3
2026/08/12-18:25:14.829858 173707000 Level-0 table #5: started
2026/08/12-18:25:14.830111 173707000 Level-0 table #5: 21613 bytes OK
2026/08/12-18:25:14.830352 173707000 Delete type=0 #3
2026/08/12-18:25:14.830387 173707000 Delete type=3 #2
2026/08/12-18:41:45.725345 17412b000 Delete type=3 #1
-1
View File
@@ -1 +0,0 @@
2026/08/12-18:25:01.055569 172a7f000 Delete type=3 #1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000004
MANIFEST-000002
+1 -5
View File
@@ -1,5 +1 @@
2026/08/12-18:25:14.841492 1726ef000 Recovering log #3
2026/08/12-18:25:14.841753 1726ef000 Level-0 table #5: started
2026/08/12-18:25:14.842198 1726ef000 Level-0 table #5: 43953 bytes OK
2026/08/12-18:25:14.842469 1726ef000 Delete type=0 #3
2026/08/12-18:25:14.842504 1726ef000 Delete type=3 #2
2026/08/12-18:41:45.721830 17391f000 Delete type=3 #1
-1
View File
@@ -1 +0,0 @@
2026/08/12-18:25:01.052553 173a97000 Delete type=3 #1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000004
MANIFEST-000002
+1 -5
View File
@@ -1,5 +1 @@
2026/08/12-18:25:14.831296 172efb000 Recovering log #3
2026/08/12-18:25:14.831754 172efb000 Level-0 table #5: started
2026/08/12-18:25:14.832094 172efb000 Level-0 table #5: 33484 bytes OK
2026/08/12-18:25:14.832323 172efb000 Delete type=0 #3
2026/08/12-18:25:14.832355 172efb000 Delete type=3 #2
2026/08/12-18:41:45.732314 17391f000 Delete type=3 #1
-1
View File
@@ -1 +0,0 @@
2026/08/12-18:25:01.062100 17328b000 Delete type=3 #1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000004
MANIFEST-000002
+1 -5
View File
@@ -1,5 +1 @@
2026/08/12-18:25:14.819152 173707000 Recovering log #3
2026/08/12-18:25:14.819603 173707000 Level-0 table #5: started
2026/08/12-18:25:14.819785 173707000 Level-0 table #5: 7590 bytes OK
2026/08/12-18:25:14.820023 173707000 Delete type=0 #3
2026/08/12-18:25:14.820059 173707000 Delete type=3 #2
2026/08/12-18:41:45.659409 172907000 Delete type=3 #1
-1
View File
@@ -1 +0,0 @@
2026/08/12-18:25:00.991223 172a7f000 Delete type=3 #1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000004
MANIFEST-000002
+1 -5
View File
@@ -1,5 +1 @@
2026/08/12-18:25:14.843251 1726ef000 Recovering log #3
2026/08/12-18:25:14.843315 1726ef000 Level-0 table #5: started
2026/08/12-18:25:14.843666 1726ef000 Level-0 table #5: 16902 bytes OK
2026/08/12-18:25:14.843880 1726ef000 Delete type=0 #3
2026/08/12-18:25:14.843909 1726ef000 Delete type=3 #2
2026/08/12-18:41:45.727208 173113000 Delete type=3 #1
-1
View File
@@ -1 +0,0 @@
2026/08/12-18:25:01.057365 1742a3000 Delete type=3 #1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More