You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parse a Submission's species_type at the read (null drafts, legacy values) #435
Species.species_type is string (src/species/types.ts:12), though SpeciesType exists.
Species.is_cares_species is number (src/species/types.ts:17); should be boolean.
NewSpecies.pointClass?: number | null and the update input (src/species/curation.ts:45, :92) should use PointClass.
Each DB read that builds a Species has to parse at the boundary (isSpeciesType / admitPointClass), not cast. Same for the species_type: string copies in db/submissions.ts, db/activity.ts, db/members.ts, db/cares.ts.
🤖 Claude Opus 5.5 responding on behalf of John Allen
#592 did most of this, so I'm narrowing the issue to what remains:
Species.species_type is SpeciesType, is_cares_species is boolean, and base_points is PointClass | null. Every read that builds a Species parses with speciesOfRow.
NewSpecies.pointClass and SpeciesUpdate.pointClass take PointClass.
The copies in db/members.ts and db/cares.ts are gone.
Still open: species_type: string on Submission (src/db/submissions.ts:39) and SubmissionApprovedData (src/db/activity.ts:34). These can't be parsed the same way yet. submissions.species_type is nullable with no CHECK, and drafts are saved from a partial form. We need to decide first:
What a draft with no species_type parses to: SpeciesType | null, or a separate draft type.
What happens to stored values outside SpeciesType: a migration that normalizes them plus a CHECK constraint, or refusing at the read. This needs a count of the distinct values in prod first.
Relabelled ready-for-human until those are settled.
changed the title [-]Tighten Species public types: SpeciesType, boolean CARES flag, PointClass[/-][+]Parse a Submission's species_type at the read (null drafts, legacy values)[/+]on Oct 28, 2026
Activity
Type a Species' type, Point class and CARES flag, parsed at the read (#…
jra3 commentedon Oct 28, 2026
Note
🤖 Claude Opus 5.5 responding on behalf of John Allen
#592 did most of this, so I'm narrowing the issue to what remains:
Species.species_typeisSpeciesType,is_cares_speciesisboolean, andbase_pointsisPointClass | null. Every read that builds a Species parses withspeciesOfRow.NewSpecies.pointClassandSpeciesUpdate.pointClasstakePointClass.db/members.tsanddb/cares.tsare gone.Still open:
species_type: stringonSubmission(src/db/submissions.ts:39) andSubmissionApprovedData(src/db/activity.ts:34). These can't be parsed the same way yet.submissions.species_typeis nullable with no CHECK, and drafts are saved from a partial form. We need to decide first:species_typeparses to:SpeciesType | null, or a separate draft type.SpeciesType: a migration that normalizes them plus a CHECK constraint, or refusing at the read. This needs a count of the distinct values in prod first.Relabelled
ready-for-humanuntil those are settled.[-]Tighten Species public types: SpeciesType, boolean CARES flag, PointClass[/-][+]Parse a Submission's species_type at the read (null drafts, legacy values)[/+]