Skip to content

fix(satellites): refuse invalid observer coordinates before look-angle propagation - #1050

Closed
rudycelekli wants to merge 1 commit into
bilawalsidhu:mainfrom
rudycelekli:contrib/gods-029-satellite-observer-boundary-20261011-reviewed
Closed

rudycelekli wants to merge 1 commit into
bilawalsidhu:mainfrom
rudycelekli:contrib/gods-029-satellite-observer-boundary-20261011-reviewed

Conversation

@rudycelekli

Copy link
Copy Markdown

The public look-angle helper accepted impossible or absent observer coordinates, producing plausible angles for out-of-range locations or returning NaN angle objects.

Validate finite numeric observer coordinates, WGS84 ranges and a representable UTC instant before propagation; retain null as the helper’s unavailable outcome.

Validation: native regression fails on unchanged main and passes with the change, along with the adjacent source tests. Changed JavaScript passes Prettier and the diff whitespace check.

The combined compatibility branch passes the full unit suite (6,274 passed, one skipped), production build, package boundaries, allocation gates and browser tracking (109 passed). Browser checks use isolated local imagery and terrain fixtures; they do not establish live-source acceptance or geographic measurement accuracy.

@asturksever

Copy link
Copy Markdown
Collaborator

Thanks @rudycelekli for checking the look-angle helper against bad observer input; the boundary tests are clearly written.

I am going to close this one because the helper never sees that input on main. findNextSatellitePass already rejects non-finite or out-of-range coordinates and times before calling it (

if (
!satrec ||
![
latDeg,
lonDeg,
fromMs,
minElevDeg,
horizonHours,
coarseStepSec,
fineStepSec,
maxSunElevDeg,
].every(Number.isFinite) ||
Math.abs(latDeg) > 90 ||
Math.abs(lonDeg) > 180 ||
Math.abs(fromMs) > 8.63e15 ||
minElevDeg < 0 ||
minElevDeg > 90 ||
horizonHours <= 0 ||
horizonHours > 72 ||
coarseStepSec < 1 ||
coarseStepSec > 120 ||
fineStepSec < 0.1 ||
fineStepSec > 60
)
return null;
). The satellites_overhead tool gets its lat and lon through the point schema (
export const POINT_SCHEMA = Object.freeze({
type: 'object',
description: 'A place name, or lat and lon.',
properties: {
place: { type: 'string', minLength: 1, maxLength: 200 },
lat: { type: 'number', minimum: -90, maximum: 90 },
lon: { type: 'number', minimum: -180, maximum: 180 },
},
additionalProperties: false,
});
), which the catalog validates before run (
const problems = validateValue(tool.inputSchema, args);
). Adding the same checks inside lookAnglesAt would repeat them on every step of the pass search without changing any result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants