Test that the host matcher carries an archive row back from J2015.5, where the constant only was

6d81c45 set ARCHIVE_EPOCH to Gaia DR2's 2015.5 and tested the constant's value, through
propagateProperMotion; nothing tested that resolveHostStarId uses it. The review's mutant that
carried the matcher's queries back from 2016 passed 807 of 807, since the GJ 15 A fixture's decoy
sits 16″ away and half a year moves the query 1.5″ there.

A new case gives resolveHostStarId Barnard's star's archive row (the J2015.5 position and motion
the epoch test already uses) and three stars: Barnard's at the row carried back 15.5 years, and
decoys where carrying it back 16 and 15 years lands, 5.2″ either side at its 10.4″/yr. It must pick
Barnard's. Controls: the matcher carrying back from 2016, or from 2015, each fail it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-30 00:19:38 +02:00
co-authored by Claude Opus 5.5
parent 69a052730f
commit a70a7290f3
@@ -224,6 +224,20 @@ describe('the archive epoch', () => {
const separationArcsec = (Math.acos(Math.min(1, a.x * b.x + a.y * b.y + a.z * b.z)) * 180 * 3600) / Math.PI;
expect(separationArcsec).toBeLessThan(0.02);
});
it("matches Barnard's star from the archive's row at J2015.5, not an entry where a J2016 or J2015 row would carry it", () => {
// Half a year of its 10.4″/yr is 5.2″: a decoy placed where carrying the row back sixteen, or
// fifteen, years lands is nearer that point than Barnard's star is.
const row = { hostname: "Barnard's star", raDeg: 269.4486144, decDeg: 4.7379808, distancePc: 1.8266, pmRaMasPerYear: -802.803, pmDecMasPerYear: 10362.5 };
const at = (years: number) => propagateProperMotion(row.raDeg, row.decDeg, row.pmRaMasPerYear, row.pmDecMasPerYear, years);
const [truth, fromJ2016, fromJ2015] = [at(CATALOGUE_EPOCH - ARCHIVE_EPOCH), at(CATALOGUE_EPOCH - 2016), at(CATALOGUE_EPOCH - 2015)];
const stars = [
star(201, 'Gaia DR3 decoy', fromJ2016.raDeg, fromJ2016.decDeg, 1.8266),
star(202, 'Gaia DR3 other decoy', fromJ2015.raDeg, fromJ2015.decDeg, 1.8266),
star(200, 'GJ 699', truth.raDeg, truth.decDeg, 1.8266)
];
expect(resolveHostStarId(row, stars)).toBe(200);
});
});
describe('archiveStarId', () => {