Skip to content

Post-v0.5.0 cruft sweep - #3

Merged
yaniswav merged 1 commit into
mainfrom
chore/post-v0.5.0-cruft-sweep
May 21, 2026
Merged

Post-v0.5.0 cruft sweep#3
yaniswav merged 1 commit into
mainfrom
chore/post-v0.5.0-cruft-sweep

Conversation

@yaniswav

Copy link
Copy Markdown
Owner

Eight items found in a /effort max second-pass after v0.5.0 shipped. Zero behavior change, zero schema change, zero new MCP tool. House-keeping commit.

Summary

  • .env.exampleTOPICFORGE_DDS_BACKEND list and auto chain refreshed from v0.3.0 (Fast > Cyclone > Mock) to v0.4.0 Phase 1.5 (8-vendor + Pro tier ordering).
  • MAX_SAMPLE_COUNT consolidation — two adapters had re-declared the constant locally (ros2_mock/adapter.py, bag_service.py), exactly the smell audit A4 prevented. Canonical home moved from services/constants.py to topicforge/constants.py (root-level, layer-neutral — services/constants.py triggered a circular load when imported from adapters/). Dropped the v0.1.x re-export shim from services/inspector.py __all__.
  • DDS adapter docstringsdds_cyclone/adapter.py and dds_fast/adapter.py module docstrings refreshed from the v0.3.0 "raise on user topics" framing to the v0.4.0 reality (_decode_status annotation, participant_events, topic_metrics).
  • Doc reference cleanup — 5 "v0.3.x patch" / "v0.3.x roadmap" callouts in DDS_QUICKSTART.md and mcp-02-spec.md revisited : shipped items rewritten as past-tense, still-pending QoS expansion re-tagged v0.5.x.

The four remaining v0.3.x strings in MIGRATION_v0.3_to_v0.4.md, audit-post-v0.4.0.md, and archive/launch-posts-v0.3.0/ are legitimate historical references (quotes of old error messages, audit narrative, frozen marketing copy) — kept as-is.

Test plan

  • `python -m pytest -q` → 399 passed, 24 skipped (baseline preserved)
  • `python -m ruff check src tests` → clean
  • `python -m ruff format --check src tests` → clean
  • CI matrix 6 cells green (this PR's checks)
  • Manual grep verified : no stale `v0.3.x roadmap/patch/candidate` outside legitimate historical context

Backward-compatibility checklist

  • No MCP tool added or removed (still 11)
  • No Pydantic schema change
  • No telemetry contract change
  • No env var renamed (TOPICFORGE_DDS_BACKEND value list widened pre-v0.5.0 — `.env.example` was just stale)
  • Public API removal : `MAX_SAMPLE_COUNT` no longer importable from `topicforge.services.inspector` ; canonical path is now `topicforge.constants`. Only known caller was our own `tests/test_health.py` — updated in this PR. If anyone else was importing from the old path, the migration is trivial (one-line import change).

Notes for the maintainer

  • This is a strict housekeeping PR — no version bump warranted. If accumulated with other changes later, fold into v0.5.1 or v0.6.
  • The constants relocation reopens audit item A4 in spirit (the constant moved one more time) — but A4's intent was "eliminate cross-service smuggling", which is preserved ; the move is purely a layering refinement so `adapters/` can use the constant without a circular import.

Eight stale-doc and minor-dedup items found in a second-pass review
post-v0.5.0. Zero behavior change, zero schema change, 399 tests still
green, ruff clean.

.env.example (item 1):
- TOPICFORGE_DDS_BACKEND backend list and `auto` chain were stuck at
  v0.3.0 (Fast > Cyclone > Mock). Refreshed to the v0.4.0 Phase 1.5
  8-vendor list and the rti > opensplice > coredx > intercom (Pro) >
  opendds > fast > cyclone > dust > mock auto chain.

MAX_SAMPLE_COUNT consolidation (items 2-3):
- Two adapters had silently re-declared `_MAX_SAMPLE_COUNT = 50`
  locally (`ros2_mock/adapter.py`, `bag_service.py`) — exactly the
  smell audit item A4 set out to prevent.
- A4's home `services/constants.py` was layer-misplaced — importing
  it from `adapters/` triggered a circular load through
  `services/__init__.py`. Moved the canonical home up to
  `topicforge/constants.py` (root-level, layer-neutral).
- Dropped the `MAX_SAMPLE_COUNT` re-export from `services/inspector.py`
  `__all__` ; updated `tests/test_health.py` to import from the new
  canonical location (the only remaining caller — the "v0.1.x
  backcompat" comment was misleading).

DDS adapter docstring + comment refresh (items 4-6):
- `dds_cyclone/adapter.py` module docstring still listed a "v0.3.0
  scope" with `peek_dds_samples` raising on user topics. Phase 1.5
  shipped the XTypes pipeline ; refreshed to the v0.4.0+ scope listing
  full participant_events, topic_metrics, and the user-topic
  `_decode_status` annotation behavior.
- `dds_cyclone/adapter.py:100` `_BUILTIN_DCPS_TOPICS` comment likewise
  refreshed.
- `dds_fast/adapter.py` module docstring mirrored — Fast's user-topic
  path returns raw-annotated samples (not raises), `participant_events`
  is listener-callback-native, `topic_metrics` is opportunistic.

Doc references retired (items 7-8):
- `DDS_QUICKSTART.md §3`: extended-QoS coverage tagged "v0.3.x patches"
  → "v0.5.x patches" (consistent with §6 already updated).
- `mcp-02-spec.md`: four "v0.3.x patch/candidate" callouts revisited.
  Two pointed at things already shipped (FastDdsAdapter v0.3.0, IDL/
  XTypes Cyclone v0.4.0 Phase 1.5) — restated as past tense with
  pointers. One QoS callout retagged v0.5.x. Section heading "resolve
  before v0.3.x patches" → "v0.5.x patches".

Out of scope :
- The four remaining "v0.3.x roadmap" strings in
  `MIGRATION_v0.3_to_v0.4.md`, `audit-post-v0.4.0.md`, and
  `archive/launch-posts-v0.3.0/` are legitimate historical
  references (quoting the v0.3.0 error message, audit narrative,
  frozen marketing post) — kept as-is.
Copilot AI review requested due to automatic review settings May 21, 2026 15:48

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

Housekeeping PR to align post-v0.5.0 code/docs with current layering and shipped DDS feature set, including consolidating MAX_SAMPLE_COUNT into a layer-neutral module and refreshing DDS/documentation wording.

Changes:

  • Moved MAX_SAMPLE_COUNT to a new topicforge.constants module and updated services/adapters/tests to import from the new canonical location.
  • Refreshed DDS adapter module docstrings and updated roadmap/past-tense references in docs.
  • Updated .env.example DDS backend value list and auto priority chain to the widened vendor matrix.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_health.py Updates import path for MAX_SAMPLE_COUNT to the new canonical module.
src/topicforge/services/inspector.py Switches MAX_SAMPLE_COUNT import source and removes it from __all__.
src/topicforge/services/health.py Switches MAX_SAMPLE_COUNT import source for health reporting.
src/topicforge/services/constants.py Removes the previous services-layer home of MAX_SAMPLE_COUNT.
src/topicforge/services/bag_service.py Reuses canonical MAX_SAMPLE_COUNT rather than a local constant.
src/topicforge/constants.py Introduces new root-level constants module containing MAX_SAMPLE_COUNT.
src/topicforge/adapters/ros2_mock/adapter.py Reuses canonical MAX_SAMPLE_COUNT rather than a local constant.
src/topicforge/adapters/dds_fast/adapter.py Updates module docstring to reflect current (v0.4.0+) behavior.
src/topicforge/adapters/dds_cyclone/adapter.py Updates module docstring/comment to reflect current (v0.4.0+) behavior.
docs/projet-file/mcp-02-spec.md Updates roadmap section wording to reflect shipped vs planned items.
docs/DDS_QUICKSTART.md Updates QoS expansion reference from v0.3.x to v0.5.x patches.
.env.example Updates DDS backend value list and auto-detect chain documentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

`list_participants` poll calls (no native at-discovery callbacks).
* `topic_metrics` — opportunistic frequency / sequence-gap / latency
metrics buffered as `peek_dds_samples` surfaces samples (no native
at-sample-receive callback in cyclonedds 2.6.x Python).
Comment on lines 12 to +13
from topicforge.adapters.base import AdapterError, AdapterName, MiddlewareAdapter
from topicforge.constants import MAX_SAMPLE_COUNT
Comment on lines 343 to 346
`dds-cyclone`, `dds-fast`, `dds` (union). Reframe DDS module
positioning around OMG-DDS-RTPS multi-vendor — see
`topicforge/docs/dds-interop-matrix.md` for the canonical
statement and the OMG May 2025 interop reference. Same 3 MCP
@yaniswav
yaniswav merged commit 9fbc2b6 into main May 21, 2026
7 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.

2 participants