feat: add species eligibility foundation#63
Merged
Conversation
added 9 commits
July 22, 2026 18:03
📝 WalkthroughWalkthroughAdds a source-backed Human/Psi-Stalker catalog, structured O.C.C. species eligibility, shared validation for species and attributes, legacy-compatible backend persistence, Human-locked builder identity, and species display in derived sheets. ChangesSpecies Eligibility Foundation
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Builder
participant Eligibility
participant CharacterCreate
participant CharacterSheet
Builder->>Eligibility: validate OCC, species, and attributes
Eligibility-->>Builder: eligibility result and failure descriptions
Builder->>CharacterCreate: character input with speciesId
CharacterCreate->>Eligibility: validate character eligibility
Eligibility-->>CharacterCreate: valid result or combined failures
CharacterSheet->>Eligibility: resolve species during deriveSheet
Eligibility-->>CharacterSheet: resolved species and validated sheet
Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
StreamDemon
marked this pull request as ready for review
July 22, 2026 13:28
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.codex/superpowers/specs/2026-07-22-occ-breadth-foundation-design.md:
- Around line 456-457: Update the wrapped text in the “next-up” section so
“#58.” remains at the end of the preceding sentence rather than starting the
next line, eliminating the MD018 warning while preserving the content and
meaning.
- Line 5: Update the Status declaration in the foundation design specification
to reflect that implementation has begun or is completed, replacing
“implementation not started” with the appropriate current status.
In `@apps/web/src/builder/steps/occ.tsx`:
- Around line 63-71: Update the failure-message rendering in the OCC eligibility
block using the failures returned by check(occ): show an
identity/O.C.C.-unavailable message when any failure is species-related, and
show the existing “REROLL ATTRIBUTES TO QUALIFY” guidance only for
attribute-only failures. Keep the existing failure descriptions and danger alert
intact.
In `@apps/web/tests/builder.test.ts`:
- Around line 28-39: Replace source-text assertions in
apps/web/tests/builder.test.ts lines 28-39 with behavioral tests that
instantiate the builder store and verify valid and species-ineligible O.C.C.
results through its accessors. In apps/web/tests/character-sheet.test.ts lines
46-48, render SheetView with a resolved sheet and assert the visible species
identity line, including the locked Human display. Ensure rule assertions use
printed rulebook values and cite the printed page via the content JSON page
field.
In `@packages/rules/src/engine/species.ts`:
- Around line 4-25: Make the exported species data immutable before it is
indexed or returned: freeze the parsed species catalog and each species entry,
then build speciesById from those frozen values. Update speciesCatalog,
humanSpecies, and getSpecies to expose only immutable entries while preserving
existing lookup and validation behavior in buildSpeciesIndex.
In `@packages/rules/tests/species.test.ts`:
- Around line 11-20: Extend the humanSpecies expectation in the “pins the
complete two-entry catalog and p.233 source” test to assert source metadata
matching the printed rulebook: book “Rifts Ultimate Edition” and page 233,
alongside the existing Human fields.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d1df2f8f-873a-48b8-b4fe-6e0248d8e02a
📒 Files selected for processing (30)
.codex/superpowers/plans/2026-07-22-species-eligibility-foundation.md.codex/superpowers/specs/2026-07-22-occ-breadth-foundation-design.mdREADME.mdapps/web/src/builder/steps/identity.tsxapps/web/src/builder/steps/occ.tsxapps/web/src/builder/store.tsapps/web/src/components/sheet-view.tsxapps/web/tests/builder.test.tsapps/web/tests/character-sheet.test.tspackages/backend/convex/characters.tspackages/backend/convex/schema.tspackages/backend/tests/characters.test.tspackages/backend/tests/combat.test.tspackages/backend/tests/healing-cast.test.tspackages/rules/src/content/occ/ley-line-walker.jsonpackages/rules/src/content/species/species.jsonpackages/rules/src/engine/builder.tspackages/rules/src/engine/character.tspackages/rules/src/engine/eligibility.tspackages/rules/src/engine/occ.tspackages/rules/src/engine/species.tspackages/rules/src/index.tspackages/rules/src/schema/character.tspackages/rules/src/schema/occ.tspackages/rules/src/schema/species.tspackages/rules/tests/builder.test.tspackages/rules/tests/character.test.tspackages/rules/tests/eligibility.test.tspackages/rules/tests/occ.test.tspackages/rules/tests/species.test.ts
💤 Files with no reviewable changes (1)
- packages/rules/src/engine/builder.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #60.
Adds source-stamped Human and deferred Psi-Stalker identity, structured O.C.C. species eligibility, shared species/attribute enforcement, explicit new-character persistence, legacy Human compatibility, and locked-Human builder/sheet presentation.
Validation:
vp check: 139 files formatted; 101 lint/typecheck files cleanvp test: 26 files; 559 tests passedThe human maintainer retains merge authority.
Summary by cubic
Adds source-validated species identity and structured O.C.C. species eligibility with hardened checks across rules, web, and backend. Human is the only playable species; the builder is locked to Human and the sheet shows species (implements #60).
New Features
@riftforge/rulesspeciesEligibility(any | oneOf) and validate viavalidateOccEligibility(+ failure descriptions).deriveSheetnow projects species and rejects unknown/unavailable identities; LLW set to{ kind: "any" }.characters.createrequiresspeciesIdandsheetreturns resolved species.Migration
speciesId: "human"tocharacters.createfor new characters.speciesIdstill load and default to Human.speciesIdonly for existing documents.Written for commit cdf5f70. Summary will update on new commits.