fix(spheres): restore archetype sections, Polished Dark talents/drawbacks, audit & class cleanup #61

Merged
clanker merged 6 commits from fix/sphere-archetypes-and-polished-dark into main 2026-09-09 07:23:02 +00:00
Member

Addresses the review of the class parser and Polished Dark sphere. Key change of direction after evaluation: the JSON declarative engine is sound — the archetype collapse was a DOM-contract break, and the polished-dark loss was a spec-regeneration error. Fixes restore the signals instead of adding per-sphere parse code.

1. Archetype sections restored across all 68 spheres

clean_html_node was unwrapping every relative wikidot link before the sphere engine ran, silently destroying the <a> on archetype heading entries that build_archetypes gates on (linked headings = real archetypes; unlinked = junk section labels/statblocks). Every sphere page emitted 0 archetypes since 3d2542c. Heading anchors are now preserved (body anchors still unwrapped — content-bloat win intact). Plus: class inference from the wiki page <title> ("Darkthrone (Sentinel Archetype)") restored for entries without a heading qualifier — previously class fell back to the sphere slug, missing the spec lookup and degrading cards to summary-only.
Result: magic 156 / combat 29 / skill 44 archetypes, junk (statblocks, "Other", "Special Abilities") excluded.

2. Polished Dark fork structure

Talent sections are h3 talents carrying h4 sub-options. Spec now declares talentHeading: h3 + new optionHeading: h4; build_talents gains a generic nested branch embedding each option verbatim under its talent card and feeding option titles into tag extraction. Restores 26 dropped talent cards (7/12/7 vs the erroneous 18/36/30 h4-option cards).

3. Polished Dark drawbacks — page-native only

Dropped the slug == "polished-dark" alias that injected the Original Dark canon (11 entries incl. duplicated Black Spot / Shadowed Brew). Injection now only happens when the page has no native drawbacks section (verified: canonical keys never overlap native sections).

4. Audit gate

Removed the two retired fork-parser commands (parse_polished_dark.py, parse_bear_sphere.py) from PARSER_CMDS; --regen-check now passes.

5. ClassView cleanup

Removed the dead client-side Class Equipment normalization (parser emits description directly since 0a266f8).

Corpus regenerated; audit.py and audit.py --regen-check both pass with 0 errors; production build passes.

Suggested test steps:

  • Open https://spheres4dummies.rulytafzil.com/spheres/magic/dark — Archetypes section should show 9 entries with full cards.
  • Open /spheres/magic/polished-dark — Dark Talents (7), Cloak and Gloom Talents (12), Advanced Dark Talents (7) with nested options; 5 archetypes; 9 drawbacks (no Black Spot duplicate).
  • Search "Darkthrone" in the global palette.
Addresses the review of the class parser and Polished Dark sphere. Key change of direction after evaluation: the JSON declarative engine is sound — the archetype collapse was a DOM-contract break, and the polished-dark loss was a spec-regeneration error. Fixes restore the *signals* instead of adding per-sphere parse code. ## 1. Archetype sections restored across all 68 spheres `clean_html_node` was unwrapping every relative wikidot link before the sphere engine ran, silently destroying the `<a>` on archetype heading entries that `build_archetypes` gates on (linked headings = real archetypes; unlinked = junk section labels/statblocks). Every sphere page emitted 0 archetypes since 3d2542c. Heading anchors are now preserved (body anchors still unwrapped — content-bloat win intact). Plus: class inference from the wiki page `<title>` ("Darkthrone (Sentinel Archetype)") restored for entries without a heading qualifier — previously class fell back to the sphere slug, missing the spec lookup and degrading cards to summary-only. Result: magic 156 / combat 29 / skill 44 archetypes, junk (statblocks, "Other", "Special Abilities") excluded. ## 2. Polished Dark fork structure Talent sections are h3 talents carrying h4 sub-options. Spec now declares `talentHeading: h3` + new `optionHeading: h4`; `build_talents` gains a generic nested branch embedding each option verbatim under its talent card and feeding option titles into tag extraction. Restores 26 dropped talent cards (7/12/7 vs the erroneous 18/36/30 h4-option cards). ## 3. Polished Dark drawbacks — page-native only Dropped the `slug == "polished-dark"` alias that injected the Original Dark canon (11 entries incl. duplicated Black Spot / Shadowed Brew). Injection now only happens when the page has no native drawbacks section (verified: canonical keys never overlap native sections). ## 4. Audit gate Removed the two retired fork-parser commands (`parse_polished_dark.py`, `parse_bear_sphere.py`) from `PARSER_CMDS`; `--regen-check` now passes. ## 5. ClassView cleanup Removed the dead client-side Class Equipment normalization (parser emits `description` directly since 0a266f8). Corpus regenerated; `audit.py` and `audit.py --regen-check` both pass with 0 errors; production build passes. Suggested test steps: - Open https://spheres4dummies.rulytafzil.com/spheres/magic/dark — Archetypes section should show 9 entries with full cards. - Open /spheres/magic/polished-dark — Dark Talents (7), Cloak and Gloom Talents (12), Advanced Dark Talents (7) with nested options; 5 archetypes; 9 drawbacks (no Black Spot duplicate). - Search "Darkthrone" in the global palette.
clean_html_node was unwrapping every relative wikidot link before the
sphere engine ran, silently destroying the <a> on archetype heading
entries. build_archetypes gates on that anchor (linked headings are real
archetype entries; unlinked section labels/statblock headings are junk),
so every sphere page collapsed to 0 archetypes since 3d2542c.

Keep anchors inside/around h1-h4 headings; body-content anchors are still
unwrapped, so the content-bloat win is untouched.
- Talents: polished-dark talent sections are h3 talents carrying h4
  sub-options (the fork structure the dedicated parser once handled).
  Spec now declares talentHeading h3 + optionHeading h4; build_talents
  gains a generic nested-option branch that embeds each option verbatim
  (kept as <h4>) under the talent card, feeding option titles into tag
  extraction so (blot)/(darkness)/(meld)/(shadow) tags survive.
  Restores 26 dropped talent cards (7/12/7 vs the erroneous 18/36/30
  h4-option cards).
- Drawbacks: Polished Dark has its own Sphere-Specific Drawbacks section;
  drop the fallback that injected the Original Dark canon (11 entries,
  incl. duplicated Black Spot/Shadowed Brew). Injection now only happens
  when the page has no native drawbacks section.
scripts/parse_polished_dark.py and parse_bear_sphere.py were replaced by
the spec engine (4c4b03e); the stale entries made --regen-check fail on
missing files on every invocation.
The parser now emits Class Equipment intro text as the option group's
description (0a266f8); no class JSON carries a Class Equipment feature
card anymore, so the normalize-and-strip useMemo in ClassView was dead
code.
Sphere archetype entries often lack a (Class) qualifier on the sphere
page ('Darkthrone'); class then fell back to parent_entity (the sphere),
so 'Polished Dark' was used for the classSlug, spec lookups missed
(specs/archetypes/sentinel/darkthrone.json), and cards degraded to
summary-only. Restore the legacy inference: read the archetype page
<title> ('Darkthrone (Sentinel Archetype)') before deriving class_slug.
Generic fix — affects every sphere-page archetype entry.
- Sphere pages: archetype sections restored across all 68 spheres
  (magic 156 / combat 29 / skill 44) with class, spec-driven feature
  cards, and links; junk statblock/section headings excluded.
- Polished Dark: 26 h3 talents restored with verbatim nested h4 options,
  5 archetypes (Darkthrone, Ebonmage, Night Terror, Sablesavant,
  Shadowsinger) with full features, and page-native drawbacks only (9).
- Classes: featureCounts re-synced after the Class Equipment move.
- Traditions/feats/gear: linkification re-hits polished-dark cards.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Home/Spheres4Dummies!61
No description provided.