Skip to content

[codex] Add source-attributed KiwiSDR denial messages#3716

Merged
ten9876 merged 2 commits into
aethersdr:mainfrom
rfoust:codex/kiwi-source-attributed-errors
Jun 22, 2026
Merged

[codex] Add source-attributed KiwiSDR denial messages#3716
ten9876 merged 2 commits into
aethersdr:mainfrom
rfoust:codex/kiwi-source-attributed-errors

Conversation

@rfoust

@rfoust rfoust commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reintroduce source-attributed KiwiSDR terminal denial handling for the MSG keys and badp labels that were intentionally left out of #3699. The follow-up adds provenance in THIRD_PARTY_LICENSES and docs/kiwisdr-cleanroom-design.md, cites the consulted LGPL-marked KiwiSDR source snapshot, and keeps badp=5 wording conservative because deployed receivers have returned it for public-access rejection as well as the source-derived duplicate-IP case.

Constitution principle honored

Principle IV — the protocol labels come from a documented open-source LGPL reference snapshot, with no KiwiSDR code copied, translated, vendored, or linked into AetherSDR.

Test plan

  • Local build passes (cmake --build /private/tmp/aethersdr-kiwi-source-attribution-build --target AetherSDR -- -j4)
  • Behavior verified on a real radio if applicable
  • Existing tests pass (ctest --test-dir /private/tmp/aethersdr-kiwi-source-attribution-build -R '^kiwi_sdr_protocol_test$' --output-on-failure)
  • Reproduction steps documented if user-reported bug

Checklist

  • Commits are signed (docs/COMMIT-SIGNING.md)
  • No new flat-key AppSettings calls — use nested-JSON-under-one-key
    (Principle V)
  • Code is clean-room — not decompiled, disassembled, or
    reverse-engineered from a proprietary binary (Principle IV)
  • All meter UI uses MeterSmoother (AGENTS.md convention)
  • Documentation updated if user-visible behavior changed
  • Security-sensitive changes reference a GHSA if applicable

@rfoust rfoust marked this pull request as ready for review June 21, 2026 13:23
@rfoust rfoust requested review from a team as code owners June 21, 2026 13:23
Copilot AI review requested due to automatic review settings June 21, 2026 13:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reintroduces source-attributed KiwiSDR terminal denial handling by mapping additional MSG keys and badp codes to clearer user-facing error messages, and documents the consulted KiwiSDR LGPL-marked source snapshot in project provenance/license docs.

Changes:

  • Adds a badpMessage() helper to provide specific, source-attributed badp denial descriptions.
  • Extends KiwiSdrClient::handleTextMessage() to handle additional denial/disconnect MSG keys (wb_only, exclusive_use, inactivity_timeout, password_timeout, kiwi_kick).
  • Updates THIRD_PARTY_LICENSES and docs/kiwisdr-cleanroom-design.md to record source provenance and scope of use.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
THIRD_PARTY_LICENSES Adds a KiwiSDR protocol-reference provenance entry (LGPL-marked source snapshot) for denial-message labeling.
src/core/KiwiSdrClient.cpp Implements additional badp labels and new MSG denial/disconnect key handling.
docs/kiwisdr-cleanroom-design.md Documents the consulted KiwiSDR source snapshot and enumerates source-attributed denial message shapes/meanings.

Comment on lines +1944 to +1959
if (key == QStringLiteral("wb_only")) {
setState(
State::Error,
tr("This KiwiSDR is configured for wideband use only and does "
"not accept normal receiver connections."));
cleanupSockets();
return;
}
if (key == QStringLiteral("exclusive_use")) {
setState(
State::Error,
tr("This KiwiSDR is locked for exclusive use by another "
"operation. Try again later or choose another receiver."));
cleanupSockets();
return;
}
@rfoust rfoust self-assigned this Jun 21, 2026
@ten9876 ten9876 closed this Jun 22, 2026
@ten9876 ten9876 reopened this Jun 22, 2026

@ten9876 ten9876 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving — the proper "path B" follow-up to #3699, done well, CI now green on all six checks.

Verified against the diff:

  • Provenance / Principle IV — handled correctly. THIRD_PARTY_LICENSES and docs/kiwisdr-cleanroom-design.md cite the exact source (jks-prv/Beagle_SDR_GPS, LGPL-2.0-or-later, pinned commit efb38e2b, the specific files consulted) and state plainly that no code was copied/translated/vendored/linked — only protocol facts (badp codes, MSG keys) were extracted. The badp messages are original AetherSDR wording (full user-facing sentences), not the terse C-source strings. Protocol codes are facts, not copyrightable expression — this is the legitimate way to do it, and the doc cleanly separates the original black-box work from this source-attributed exception.
  • badp=5 reconciled exactly as flagged in #3699 — worded with both the source-derived duplicate-IP meaning and the observed public-access-rejection hint.
  • Copilot's "unreachable bare-token handlers" finding is resolved. The parser was refactored into KiwiSdrProtocol::parseMsgTokens() (emits hasValue=false flag tokens), handleTextMessage was rewired to iterate those (the hasValue branch only gates logging, no skip), so wb_only/exclusive_use/password_timeout reach their handlers. Covered by a new unit test (MSG wb_only password_timeout inactivity_timeout=15 … → flags vs key/value asserted, =ignored dropped). Copilot reviewed a pre-refactor state.
  • Runtime still treats these as terminal denial states only; unknown keys ignored.

CI green (build/macOS/Windows/CodeQL/analyze/a11y). Thanks @rfoust — clean provenance and a tidy parser refactor.

@ten9876 ten9876 merged commit 6498cf7 into aethersdr:main Jun 22, 2026
6 checks passed
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.

3 participants