Skip to content

Commit 78c5abb

Browse files
pdbethkeclaude
andcommitted
gitignore: actually ignore .hdc under tests/fixtures/ subdirectories
The three `!tests/fixtures/authored/*.hdc` negations added in 0f40ae7 were inert. The pattern they negated is `tests/fixtures/*.hdc`, and a single `*` does not cross a directory separator, so nothing under tests/fixtures/authored/ was ever ignored and the negations re-admitted nothing. The bundled files stayed tracked for a reason unrelated to my lines. That left the licensing rail open: a licensed third-party .hdc dropped into that directory would have been staged by `git add -A` without a word -- the exact failure the comment claimed to prevent. Claiming protection that is not running is worse than claiming none, because it stops anyone checking. Add `tests/fixtures/**/*.hdc` above the negations. Deny every .hdc anywhere under tests/fixtures/, re-admit exactly three by name; the negations are now load-bearing. The comment says why the ** line exists and tells the next reader to verify with `git check-ignore -v` rather than trust the prose. Verified after the change: both Ravel_background.hdc and "Ravel (CSI Kit).hdc" now report ignored at .gitignore:75; `git ls-files tests/fixtures/ | grep hdc` still lists exactly the three; porcelain clean. Live drill too -- copied the real Ravel_background.hdc in, ran `git add -A .`, nothing .hdc was staged. Minors in the same pass: - "fifteen skill rolls" -> sixteen in the report; HD_PRINTED_ROLLS has sixteen entries and the table sixteen rows. - test_the_transcribed_rolls_are_still_the_ones_hero_designer_printed drops the unused `ravel` parameter -- it reads HD's rendered output and the transcription and never loads a character, so the fixture was buying an HDCLoader run per invocation for nothing. - SKILL.md's "explicitly un-ignored" wording corrected to describe the mechanism that is actually active, and records that negations against `*.hdc` alone were inert. Oracle 656 passed, residual ledger untouched. Full suite 1753 passed, 0 skipped. Both unchanged from before the fix round. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PrVDXgpDfQpzEGErZTLjEs
1 parent 0f40ae7 commit 78c5abb

3 files changed

Lines changed: 129 additions & 6 deletions

File tree

.gitignore

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,23 @@ legal/
7272
# roundtrip_hd6_costs.json is one character's costed build. Same rule.
7373
tests/fixtures/oracle/
7474
tests/fixtures/*.hdc
75+
tests/fixtures/**/*.hdc
7576
tests/fixtures/roundtrip_hd6_costs.json
7677

7778
# DELIBERATELY TRACKED, and the only .hdc files in the repository:
7879
# tests/fixtures/authored/{Ravel,Bokor,PowerLad}.hdc are PeterB's own
7980
# characters, built on stock templates and cleared by him for publication
8081
# (2026-09-01). They are here so the canonical load path -- HDCLoader on a
8182
# real HD-saved file -- runs by default instead of only where an environment
82-
# variable happened to be set. The pattern above is `tests/fixtures/*.hdc`
83-
# and does not reach this subdirectory; the negation is written out anyway so
84-
# that tightening the pattern cannot silently drop them.
83+
# variable happened to be set.
84+
#
85+
# The `tests/fixtures/**/*.hdc` line above is what makes these three
86+
# negations load-bearing, and it was added for that reason. `*.hdc` alone
87+
# does not match a subdirectory, so before it every .hdc under
88+
# tests/fixtures/authored/ was tracked by default -- including any licensed
89+
# third-party character dropped there, which `git add -A` would have staged
90+
# without a word. Deny everything under tests/fixtures/, re-admit exactly
91+
# three by name.
8592
#
8693
# THREE FILES, NO MORE. Nothing else from that document store may be added:
8794
# the rest is licensed third-party content and personal campaign material,

.superpowers/canonical-fixture-report.md

Lines changed: 115 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ is now explicitly two-lane, and says which lane each test is in:
8484

8585
**6. The test that would have caught tonight.**
8686
`test_ravel_reproduces_every_roll_hero_designer_printed` loads Ravel
87-
canonically and asserts fifteen skill rolls against HD's own rendered output.
87+
canonically and asserts sixteen skill rolls against HD's own rendered output.
8888
`test_the_transcribed_rolls_are_still_the_ones_hero_designer_printed`
8989
re-derives that table from the dump's `column2_output` so the transcription
90-
cannot rot into a test of a typo. Seven of the fifteen — the five Proficiencies
90+
cannot rot into a test of a typo. Seven of the sixteen — the five Proficiencies
9191
and both multi-ITEM skills — are precisely the cases a dump-based test cannot
9292
state.
9393

@@ -162,3 +162,116 @@ about. Nothing was adjusted to make anything pass.
162162
`tests/fixtures/oracle_known_residuals.json` — unchanged.
163163
`conftest.py` — unchanged; the guard mechanism it implements is now armed by
164164
default rather than modified.
165+
166+
---
167+
168+
# Fix round — the licensing rail was inert
169+
170+
*2026-09-01, after review*
171+
172+
## What was wrong
173+
174+
The three `!tests/fixtures/authored/*.hdc` negations I added were **inert**,
175+
and worse than inert: they were a claim of protection where none existed.
176+
177+
The pre-existing pattern is `tests/fixtures/*.hdc`. A single `*` does not
178+
cross a directory separator, so that line never reached
179+
`tests/fixtures/authored/` at all. Nothing there was ever ignored, so
180+
negating it re-admitted nothing. The three bundled files stayed tracked for
181+
the same reason they would have without any of my lines: they were never
182+
matched.
183+
184+
The consequence is the part that mattered. A licensed third-party `.hdc`
185+
dropped into `tests/fixtures/authored/` would have been picked up by
186+
`git add -A` with no warning — the exact failure the comment above it claimed
187+
to prevent. My report said a fourth file "cannot be added by accident" and the
188+
SKILL.md said the three were "explicitly un-ignored". Both described a
189+
mechanism that was not running. A false assurance on the rail that keeps
190+
licensed content out of a public repo is worse than no claim at all, because
191+
it stops anyone from checking.
192+
193+
## The fix
194+
195+
One line, above the negations, which is what makes them load-bearing:
196+
197+
```
198+
tests/fixtures/oracle/
199+
tests/fixtures/*.hdc
200+
tests/fixtures/**/*.hdc <-- added
201+
tests/fixtures/roundtrip_hd6_costs.json
202+
...
203+
!tests/fixtures/authored/Ravel.hdc
204+
!tests/fixtures/authored/Bokor.hdc
205+
!tests/fixtures/authored/PowerLad.hdc
206+
```
207+
208+
Deny every `.hdc` anywhere under `tests/fixtures/`, then re-admit exactly
209+
three by name. The surrounding comment now says *why* the `**` line exists and
210+
tells the next reader to verify with `git check-ignore -v` rather than trust
211+
the prose — since trusting the prose is what went wrong here.
212+
213+
## Proof, run after the change
214+
215+
```
216+
$ git check-ignore -v "tests/fixtures/authored/Ravel_background.hdc"
217+
.gitignore:75:tests/fixtures/**/*.hdc tests/fixtures/authored/Ravel_background.hdc
218+
exit=0
219+
220+
$ git check-ignore -v "tests/fixtures/authored/Ravel (CSI Kit).hdc"
221+
.gitignore:75:tests/fixtures/**/*.hdc tests/fixtures/authored/Ravel (CSI Kit).hdc
222+
exit=0
223+
224+
$ git ls-files tests/fixtures/ | grep hdc
225+
tests/fixtures/authored/Bokor.hdc
226+
tests/fixtures/authored/PowerLad.hdc
227+
tests/fixtures/authored/Ravel.hdc
228+
229+
$ git status --porcelain
230+
M .gitignore
231+
M .superpowers/canonical-fixture-report.md
232+
M tests/test_skill_characteristic_roll.py
233+
```
234+
235+
Both licensed names are now ignored, and `.gitignore:75` names the line doing
236+
it. Exactly the three bundled files remain tracked. The porcelain output shows
237+
only this fix round's own edits and no stray `.hdc`.
238+
239+
**Live drill, not just a dry check.** I copied the real
240+
`Ravel_background.hdc` into `tests/fixtures/authored/`, ran `git add -A .`,
241+
and confirmed the staged set:
242+
243+
```
244+
$ git diff --cached --name-only | grep hdc
245+
NONE STAGED
246+
```
247+
248+
The file was physically present in the directory and `git add -A` did not
249+
stage it. Removed afterwards; the directory holds the three bundled `.hdc`
250+
and their four `.json` fixtures again.
251+
252+
## Minors
253+
254+
- "fifteen skill rolls" corrected to **sixteen** in both places in this
255+
report. `HD_PRINTED_ROLLS` has sixteen entries and the table above lists
256+
sixteen rows; the prose was simply wrong.
257+
- `test_the_transcribed_rolls_are_still_the_ones_hero_designer_printed` no
258+
longer takes the `ravel` fixture. It reads HD's rendered output and the
259+
transcription and never loads a character, so the parameter was buying an
260+
`HDCLoader` run per invocation for nothing. Its docstring now says it takes
261+
no hero, so the parameter does not come back.
262+
- SKILL.md's "explicitly un-ignored" wording replaced. It now states what is
263+
actually true — everything under `tests/fixtures/` is denied, exactly three
264+
are negated back in — names the `**` line as the one that reaches
265+
subdirectories, and records that negations against `*.hdc` alone were inert,
266+
so the next person does not repeat this.
267+
268+
## Gates re-run after the fix
269+
270+
| | result |
271+
|---|---|
272+
| Oracle | **656 passed**, exit 0; `oracle_known_residuals.json` unmodified |
273+
| Full suite | **1753 passed, 0 skipped**, exit 0 |
274+
275+
Unchanged from before the fix round, as expected: nothing here touches engine
276+
behaviour, and dropping an unused fixture parameter removes a redundant load
277+
rather than a test.

tests/test_skill_characteristic_roll.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,12 @@ def test_ravel_reproduces_every_roll_hero_designer_printed(ravel):
167167
assert not mismatched, f"engine vs HD's printed rolls: {mismatched}"
168168

169169

170-
def test_the_transcribed_rolls_are_still_the_ones_hero_designer_printed(ravel):
170+
def test_the_transcribed_rolls_are_still_the_ones_hero_designer_printed():
171171
"""The provenance check on the table above.
172172
173+
Takes no hero: it reads HD's rendered output and the transcription, and
174+
never loads a character.
175+
173176
``HD_PRINTED_ROLLS`` is transcribed, and a transcription can rot. This
174177
re-reads the rolls out of HD's own rendered lines and insists they still
175178
agree, so the previous test cannot quietly become a test of a typo.

0 commit comments

Comments
 (0)