fix(beacon): close the four gaps in the FM beacon frequency pool - #140
Merged
Conversation
The FM beacon pool (_buildFreqPools) caps its tens digit at s=0..5 instead of 0..9, missing 160 of 460 possible steps (four gaps including 38.00 MHz). Confirmed inherited from legacy (same shape in migration/source/CTLD.lua) and confirmed as an artefact rather than a deliberate exclusion (a dead loop + an unimplemented 4-digit scheme comment sit right above the legacy generator). Grilled with the user 2026-08-26 following GitHub issue #127 (davidp57/Zip).
Single AFK ticket: widen s to 0..9, update the two tests that hard-code the current gap as expected behavior, update the two doc rows, add a pool-size regression test. Granularity confirmed with the user - one cohesive slice.
_buildFreqPools capped the FM pool's tens digit at s=0..5 instead of 0..9, leaving four gaps (36.0-39.9, 46.0-49.9, 56.0-59.9, 66.0-69.9 MHz) unreachable, including ordinary frequencies like 38.00 MHz. Confirmed inherited from legacy (migration/source/CTLD.lua, same shape) and confirmed as an artefact rather than a deliberate exclusion - the legacy source carries a dead loop and a comment describing a never-implemented finer scheme right above the generator, unlike VHF's principled _ndbSkip list. Widens s to 0..9 for f=3..6 only, closing the four internal gaps. f=7 keeps s=0..5 - widening it too would silently push the pool's top past the declared 75.9 MHz ceiling to 79.9 MHz, caught during implementation by the existing test that cross-checks _bands' declared min/max against the actual pool. 300 -> 460 total steps, continuous 30.0-75.9 MHz. Updates the two tests that hard-coded the gap as expected behavior (fmMHz=38 refused) to a value that's still genuinely off-grid (38.05, off the 0.1 MHz step from t, not s); adds a pool-size regression test and a "gap now closed" behavior test; updates the two doc rows (EN+FR) that documented the sub-ranges as real. FIX-BEACON-FM-POOL-GAP, grilled with the user 2026-08-26, closes GitHub issue #127.
Reviewer's GuideThe PR fixes the FM beacon pool’s decade-loop boundary so it now provides all 460 100 kHz steps from 30.0 through 75.9 MHz, while preserving the declared maximum. Tests cover exact pool size, successful allocation from a formerly missing range, and continued rejection of off-grid values; English/French API docs, changelog, and backlog records are updated accordingly. Flow diagram for FM beacon frequency pool generationflowchart TD
A[_buildFreqPools] --> B{f = 3..7}
B --> C{f = 7?}
C -- Yes --> D[s = 0..5]
C -- No --> E[s = 0..9]
D --> F[t = 0..9]
E --> F
F --> G[FM pool: 460 steps from 30.0 to 75.9 MHz]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".backlog/README.md" line_range="17" />
<code_context>
+| [`FIX-BEACON-FM-POOL-GAP`](FIX-BEACON-FM-POOL-GAP/PRD.md) | ⬜ ready | Reported by **Zip** ([GitHub issue #127](https://github.com/VEAF/CTLD/issues/127)): the FM beacon pool (`_buildFreqPools`) caps its tens digit at `s=0..5` instead of `0..9`, missing 160 of 460 possible 100 kHz steps (four gaps: 36.0–39.9, 46.0–49.9, 56.0–59.9, 66.0–69.9 MHz), including ordinary frequencies like 38.00 MHz. Confirmed inherited from legacy (`migration/source/CTLD.lua:6171`, same `s=0..5` shape) — fixing it is a legacy-parity deviation, which the issue explicitly requests. Confirmed as an artefact, not a deliberate exclusion: the legacy source carries a comment describing a never-implemented 4-digit/0.05 MHz scheme, and a dead loop right above the FM generator that reads as an uncleaned UHF-generator copy-paste. Minimal fix: widen `s` to `0..9`, closing the gaps at the existing 0.1 MHz granularity — the finer 0.05 MHz grid the dead comment gestures at is explicitly out of scope. | `fix/beacon-fm-pool-gap` |
</code_context>
<issue_to_address>
**nitpick:** The backlog index labels `FIX-BEACON-FM-POOL-GAP` as `⬜ ready` even though its added PRD and ticket both declare the work `✅ done`, so the repository's backlog dashboard reports the wrong status.
**Suggested fix:** Change the README row status to match the completed PRD/ticket state, or leave the index at `ready` only while the ticket is actually pending.
```suggestion
| [`FIX-BEACON-FM-POOL-GAP`](FIX-BEACON-FM-POOL-GAP/PRD.md) | ✅ done | Reported by **Zip** ([GitHub issue #127](https://github.com/VEAF/CTLD/issues/127)): the FM beacon pool (`_buildFreqPools`) caps its tens digit at `s=0..5` instead of `0..9`, missing 160 of 460 possible 100 kHz steps (four gaps: 36.0–39.9, 46.0–49.9, 56.0–59.9, 66.0–69.9 MHz), including ordinary frequencies like 38.00 MHz. Confirmed inherited from legacy (`migration/source/CTLD.lua:6171`, same `s=0..5` shape) — fixing it is a legacy-parity deviation, which the issue explicitly requests. Confirmed as an artefact, not a deliberate exclusion: the legacy source carries a comment describing a never-implemented 4-digit/0.05 MHz scheme, and a dead loop right above the FM generator that reads as an uncleaned UHF-generator copy-paste. Minimal fix: widen `s` to `0..9`, closing the gaps at the existing 0.1 MHz granularity — the finer 0.05 MHz grid the dead comment gestures at is explicitly out of scope. | `fix/beacon-fm-pool-gap` |
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
docs/developer/subsystems/beacons.md/.fr.md still described the pre-fix s=0..5 shape for every f, a review finding on PR #140 that the api-reference.md/.fr.md update missed - this is the same formula restated in more detail in a second file.
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.
Summary
_buildFreqPools's FM loop capped its tens digit ats=0..5instead of0..9, leaving four gaps (36.0–39.9, 46.0–49.9, 56.0–59.9, 66.0–69.9 MHz) unreachable, including ordinary frequencies like 38.00 MHz.migration/source/CTLD.lua, identical shape) and confirmed as an artefact rather than a deliberate exclusion — the legacy source carries a dead loop and a comment describing a never-implemented finer scheme right above the generator, unlike VHF's principled_ndbSkiplist.sto0..9forf=3..6only;f=7keepss=0..5— widening it too would silently push the pool's top past the declared 75.9 MHz ceiling to 79.9 MHz, caught during implementation by the existing test cross-checking_bands' declared min/max against the actual pool. 300 → 460 total steps, continuous 30.0–75.9 MHz.fmMHz=38refused) to a value still genuinely off-grid (38.05); adds a pool-size regression test and a "gap now closed" behavior test; updates the two doc rows (EN+FR) that documented the sub-ranges as real..backlog/FIX-BEACON-FM-POOL-GAP/PRD.md).Test plan
busted --pattern=_spec --helper=tests/ci/helpers/init.lua tests/ci→ 1355 passed / 0 failed / 1 pending (pre-existing, DCS-live gated).luac -p CTLD.lua— Lua 5.1 syntax OK (rebuilt viamerge_CTLD.ps1).CLAUDE.md, relies on CI).Summary by Sourcery
Restore the complete FM beacon frequency pool while preserving its declared 30.0–75.9 MHz bounds.
Bug Fixes:
Enhancements:
Documentation:
Tests:
Chores: