From 7a112e4bb36a3c3d3236d1228506fc1b10ce8cbf Mon Sep 17 00:00:00 2001 From: Senrokai Date: Thu, 27 Aug 2026 20:16:11 +0200 Subject: [PATCH] Answer the review: HYG's own last-resort name is a designation too Junie: a HYG star that fell all the way through the ETL's naming chain -- no proper name, Bayer, Flamsteed, HD, Gliese or HIP -- is called "HYG ", and with `source: 'hyg'` the predicate was looking for a lower-case "hyg " prefix and calling it named. None in the current catalogue, but the path is in `tools/etl/fetchStars.ts` and a refresh could walk it. Fixed in the table rather than in the predicate: `hyg: 'HYG'` next to `gaia: 'Gaia DR3'`, so the encoder, the decoder and the predicate all read the one rule. The sourceless case reads the same entry instead of repeating it. npm test 609/609, build and ETL typecheck clean. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_014fcUfL82nvyh9VebX1Fz6w --- src/app/shared/models/star-catalog.spec.ts | 5 +++++ src/app/shared/models/star-catalog.ts | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/app/shared/models/star-catalog.spec.ts b/src/app/shared/models/star-catalog.spec.ts index 1a415e8..fadb1e5 100644 --- a/src/app/shared/models/star-catalog.spec.ts +++ b/src/app/shared/models/star-catalog.spec.ts @@ -139,5 +139,10 @@ describe('star catalogue provenance and derived names', () => { // 32-bit row id can equal — so it is the prefix that decides, not a round trip through the id. expect(isDesignation({ ...MIXED[1], name: 'Gaia DR3 5853498713190525696' })).toBe(true); expect(isDesignation({ ...MIXED[1], name: 'Proxima Centauri' })).toBe(false); + // HYG's own last resort, once every designation it knows has come up empty. Upper case, + // whatever case the source id is in. + expect(isDesignation({ ...MIXED[0], name: 'HYG 5' })).toBe(true); + expect(isDesignation({ ...MIXED[0], source: undefined, name: 'HYG 5' })).toBe(true); + expect(isDesignation({ ...MIXED[0], name: 'HD 48915' })).toBe(false); }); }); diff --git a/src/app/shared/models/star-catalog.ts b/src/app/shared/models/star-catalog.ts index 19e7ff2..cac8a00 100644 --- a/src/app/shared/models/star-catalog.ts +++ b/src/app/shared/models/star-catalog.ts @@ -66,11 +66,14 @@ export interface StarCatalogIndex { } /** - * How a source names a star that has no name of its own. `Gaia DR3 ` for Gaia; HYG's own - * fallbacks already produce real designations, so it never needs this. + * How a source names a star that has no name of its own. `Gaia DR3 ` for Gaia; `HYG ` + * for HYG, whose ETL reaches for that only after a proper name, Bayer, Flamsteed, HD, Gliese and + * HIP have all come up empty (`tools/etl/fetchStars.ts`) — none in the current catalogue, but + * the path is there, and a name made that way is no more a name than Gaia's. */ const DESIGNATION_PREFIXES: Readonly> = { - gaia: 'Gaia DR3' + gaia: 'Gaia DR3', + hyg: 'HYG' }; interface StarMetaColumns { @@ -168,7 +171,8 @@ function designationFor(prefix: string | undefined, id: number): string | undefi * round-trip through the id would call every one of those stars named. */ export function isDesignation(star: StarRecord): boolean { - const prefix = star.source === undefined ? 'HYG' : (DESIGNATION_PREFIXES[star.source] ?? star.source); + // No source at all is a single-catalogue build, whose fallback is HYG's — see `decodeStarCatalog`. + const prefix = star.source === undefined ? DESIGNATION_PREFIXES['hyg'] : (DESIGNATION_PREFIXES[star.source] ?? star.source); return star.name.startsWith(`${prefix} `); }