Serve the six starship content types - #28
Merged
Merged
Conversation
FlyTripVisa
approved these changes
Aug 30, 2026
FlyTripVisa
approved these changes
Aug 30, 2026
|
Deploy |
christopherfowers
force-pushed
the
feat/starship-content-types
branch
from
August 31, 2026 00:36
49e9dea to
df05e39
Compare
This was referenced Aug 31, 2026
Starship content is landing in sw5e-database, and the API cannot serve a
type it does not know about: the registry is a closed set on purpose, because
the {type} route value reaches a path join in the file store and a table
selection in the database one. So the six types are added to it explicitly,
with a migration for the seeded content_type rows, rather than the registry
being made directory-driven.
Two of the six are awkward in ways worth pinning down in tests. Starship
equipment has a plural identical to its singular, so its route segment and its
key are the same string and the registry indexes both to the same entry. A
rule chapter is titled rather than named, exactly as a source is, so its
projection takes its display name from `title` - a projection that assumed
`name` would serve thirteen nameless rows that no list or search could find.
The reference map gains the starship edges. These are the first references in
the corpus that arrive already resolved in the document: the import parsed
each printed prerequisite clause and wrote the target it identified into a
field beside the wording, so the map reads the field rather than picking a
name out of prose. A clause it declined to resolve - a ship size, a weapon
mounting, a Constitution requirement - deliberately produces no edge, because
an unresolvable edge would sit in the unresolved report for ever as noise
hiding the real gaps.
christopherfowers
force-pushed
the
feat/starship-content-types
branch
from
August 31, 2026 01:00
df05e39 to
9d7a447
Compare
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.
sw5e-database is publishing all 453 items of Starships of the Galaxy
(christopherfowers/sw5e-database#16). The API cannot serve a type it does not
know about, so this registers the six.
The registry stays a closed set
ContentTypeRegistryis hard-coded on purpose — the{type}route valuereaches a path join in the file-backed store and a table selection in the
database-backed one — so the six types are added to it explicitly rather than
the registry being made directory-driven.
Sw5eContentDbContextseedscontent_typefrom the registry, so this also carries the migration those rowsneed. The new entries are appended, so no existing row's
sort_ordermoves.starship-base-sizestarship-base-sizesstarship-deploymentstarship-deploymentsstarship-equipmentstarship-equipmentstarship-modificationstarship-modificationsstarship-venturestarship-venturesstarship-rulestarship-rulesTwo of the six are awkward in ways the tests pin down.
starship-equipmenthasa plural identical to its singular, so its key and its route segment are the
same string and the registry indexes both to the same entry. A rule chapter is
titled rather than named, exactly as a source is, so its projection takes the
display name from
title— a projection that assumednamewould servethirteen nameless rows that no list and no search could find.
Cross-references
ContentReferenceMapgains five relations: a modification's prerequisitemodification and prerequisite equipment, a venture's prerequisite venture and
deployment, and the launcher that fires a piece of ammunition.
These are the first references in the corpus that arrive already resolved in
the document. The import parsed each printed prerequisite clause and wrote the
target it identified into a field beside the wording, so the map reads that
field rather than picking a name out of prose. A clause the import declined to
resolve — a ship size, a weapon mounting, "12 Constitution, no Droid Brain
modification" — deliberately produces no edge, because an unresolvable edge
would sit in the unresolved report for ever as noise hiding the real gaps.
Tests
StarshipContentEndpointTestsserves all six types over a real fixture ofeleven starship documents copied from the canonical set: list counts per
type, hyphenated route segments accepted and near-misses (
starship,starship-,starship-equipments) refused, a modification's grade andresolved prerequisite, ammunition's two damage scales and its launcher, a
base size's six tier rows and six roles, the rule chapter's title, the
per-type facets by value, and a search that has to reach a starship
document's prose rather than its name.
StarshipReferenceMapTestscovers extraction directly. Resolution, storageand re-resolution are type-agnostic and already covered; the rules that
decide which fields are links are per-type and hand-written, and one
pointing at the wrong content type would still import cleanly.
The existing assertions on the registry list and its size are updated from nine
types to fifteen.
Companion pull requests
Merge order is sw5e-database → its release → this → sw5e-web.