Skip to content

fix(microservices): validate pre-identified telemetry and keep stored data out of CVT - #4000

Open
ryanmelt wants to merge 3 commits into
mainfrom
fix/interface-tlm-identification
Open

ryanmelt wants to merge 3 commits into
mainfrom
fix/interface-tlm-identification

Conversation

@ryanmelt

@ryanmelt ryanmelt commented Oct 4, 2026

Copy link
Copy Markdown
Member

Summary

In InterfaceMicroservice#handle_packet (Ruby and Python):

  • Pre-identified packets are validated. If a protocol identifies a packet whose target isn't in the interface's tlm_target_names, or names a packet that doesn't exist, the interface now logs Received unknown identified telemetry: TGT PKT and identifies the packet by content against the mapped targets. Before, any known target was accepted even if it wasn't mapped. Stored packets with an unknown identity were silently published as UNKNOWN, with no warning and no fallback.
  • Stored packets stay out of the CVT. A stored packet that can't be identified is published as UNKNOWN from a clone of the UNKNOWN definition. It no longer calls update! or CvtModel.set.
  • Python matches Ruby output. The unknown-packet hex prefix is now uppercase, and TelemetryTopic.write_packet writes stored as "true"/"false". All readers use the case-insensitive handle_true_false.

Fixes the IF-CFG-001, IF-TLM-001, IF-TLM-002 and IF-TLM-003 deviations in architecture/specs/interface-microservice.yaml.

Test plan

  • bundle exec rspec spec/topics spec/microservices/interface_microservice_spec.rb (76 examples, 0 failures). The 3 new examples fail on the old code.
  • uv run pytest test/topics test/microservices/test_interface_microservice.py test/microservices/test_decom_microservice.py (85 passed). The 3 new handle_packet tests and the new test_telemetry_topic.py fail on the old code.
  • ruff check / ruff format --check

🤖 Generated with Claude Code

… data out of CVT

A protocol-identified packet for an unmapped target, or a stored packet with
an unknown identity, is now warned about and identified by content. Stored
packets that cannot be identified no longer update the UNKNOWN CVT entry.
Python logs the unknown hex prefix in uppercase and writes stored as
"true"/"false" like Ruby.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.23529% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.16%. Comparing base (0d8985e) to head (4988cb4).
⚠️ Report is 28 commits behind head on main.

Files with missing lines Patch % Lines
...lib/openc3/microservices/interface_microservice.rb 88.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4000      +/-   ##
==========================================
+ Coverage   80.06%   80.16%   +0.10%     
==========================================
  Files         901      901              
  Lines       68370    68449      +79     
  Branches     2699     2714      +15     
==========================================
+ Hits        54738    54874     +136     
+ Misses      12976    12906      -70     
- Partials      656      669      +13     
Flag Coverage Δ
frontend 67.00% <ø> (+0.43%) ⬆️
python 80.16% <ø> (+0.03%) ⬆️
ruby-api 82.67% <ø> (+0.06%) ⬆️
ruby-backend 85.71% <88.23%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread openc3/python/openc3/microservices/interface_microservice.py Fixed
Comment thread openc3/python/openc3/microservices/interface_microservice.py Fixed
ryanmelt and others added 2 commits October 9, 2026 19:03
Resolves ty unresolved-attribute errors on self.interface, which is
typed as possibly None, in the new pre-identified telemetry check.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Type the microservice interface as non-optional, require scope on the
handler threads (matching Ruby), and align the shutdown override with
Microservice.shutdown. Also fixes router reconnect with new params
writing to an undefined interface_model and logging the bound
connection_string method instead of its value.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@ryanmelt ryanmelt added the review-and-merge-ready Ready for a manual review and merge label Oct 10, 2026

This branch has not been deployed

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

Labels

review-and-merge-ready Ready for a manual review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants