Skip to content

feat: export is_decoding_completed_for_positioning for PVT readiness#74

Merged
siebc merged 1 commit into
masterfrom
sc/export-decoding-complete-for-pvt
Jul 7, 2026
Merged

feat: export is_decoding_completed_for_positioning for PVT readiness#74
siebc merged 1 commit into
masterfrom
sc/export-decoding-complete-for-pvt

Conversation

@giove-a

@giove-a giove-a commented Jul 7, 2026

Copy link
Copy Markdown

Summary

Exports is_decoding_completed_for_positioning so downstream consumers (e.g.
PositionVelocityTime.jl) can gate use of a satellite in a fix without reaching
into decoder internals. It pairs with the already-exported is_sat_healthy:

if is_decoding_completed_for_positioning(state) && is_sat_healthy(state)
    # satellite is ready and healthy for PVT
end

Changes

  • Export is_decoding_completed_for_positioning.
  • New GNSSDecoderState method that forwards to the validated data field
    (not raw_data), mirroring is_sat_healthy(state). It only returns true
    once the required message set has passed CRC/parity and the cross-subframe
    issue-of-data consistency check that promotes raw_datadata.
  • Docstring recording the guarantee and the deliberate non-guarantees.
  • API reference entry (required by checkdocs = :exports).
  • Tests covering the new state-forwarding method (fresh decoder → false;
    fully decoded state → true).

Guarantees

  • Covers the core per-satellite PVT requirements: time-of-week, full ephemeris,
    SV clock polynomial (plus week number / single-band group delay where those
    signals fold them into the required set).
  • Verified across all six signals (L1 C/A, L1C-D, L5I, L2CM, E1B, E5a): whenever
    the predicate is true, the exact health field is_sat_healthy reads has
    already been decoded — so the two checks compose safely without a separate
    nothing guard.

Deliberate non-guarantees (documented in the docstring)

A true is a necessary condition, not a blanket "no further thinking":

  1. Ephemeris freshness — presence is checked, not age; the decoder has no
    notion of "now", so consumers must still reject ephemerides outside their fit
    interval.
  2. Second-order correctionsT_GD/ISC_* beyond the required band,
    Klobuchar ionosphere, and UTC params are intentionally excluded (broadcast
    far less often); apply when present, treat nothing as zero.
  3. Alert flagis_sat_healthy reflects broadcast health bits only. GPS
    L1 C/A and CNAV (L5I/L2C) also carry a per-message alert flag
    (state.data.alert_flag) that a strict-integrity receiver may want to honour
    separately. (Galileo's equivalent — Data Validity Status — is already folded
    into is_sat_healthy; L1C-D has no alert flag.)

Testing

  • Full suite passes (2495 tests), including new assertions on the exported
    state method.
  • Docs build passes locally (checkdocs, doctests, cross-references).
  • JuliaFormatter 2.8.5 leaves src/test unchanged.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.15%. Comparing base (9fa1c6b) to head (07b01b4).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #74   +/-   ##
=======================================
  Coverage   98.15%   98.15%           
=======================================
  Files          14       14           
  Lines        1519     1520    +1     
=======================================
+ Hits         1491     1492    +1     
  Misses         28       28           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Export the positioning-readiness predicate and add a `GNSSDecoderState`
method that forwards to the validated `data` field, so a receiver
(e.g. PositionVelocityTime.jl) can gate PVT on it alongside
`is_sat_healthy` without reaching into decoder internals.

Whenever the predicate is `true` the health field `is_sat_healthy`
inspects is guaranteed decoded, so the two checks compose safely. The
docstring records what it deliberately does not gate on (ephemeris
freshness, second-order corrections, the alert flag).

Also document the export in the API reference, which the docs build
requires via `checkdocs = :exports`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@giove-a
giove-a force-pushed the sc/export-decoding-complete-for-pvt branch from de6e5f5 to 07b01b4 Compare July 7, 2026 11:40
@siebc
siebc merged commit e4c9d87 into master Jul 7, 2026
9 checks passed
@siebc
siebc deleted the sc/export-decoding-complete-for-pvt branch July 7, 2026 12:14
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