topicforge 0.5.3__tar.gz → 0.5.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. {topicforge-0.5.3 → topicforge-0.5.4}/.gitignore +5 -0
  2. {topicforge-0.5.3 → topicforge-0.5.4}/CHANGELOG.md +111 -3
  3. topicforge-0.5.4/PKG-INFO +241 -0
  4. topicforge-0.5.4/README.md +182 -0
  5. topicforge-0.5.4/docs/DDS_QUICKSTART.md +121 -0
  6. topicforge-0.5.4/docs/TESTING.md +105 -0
  7. topicforge-0.5.4/docs/TROUBLESHOOTING.md +77 -0
  8. {topicforge-0.5.3 → topicforge-0.5.4}/docs/TUTORIEL.md +2 -70
  9. {topicforge-0.5.3 → topicforge-0.5.4}/docs/dds-interop-matrix.md +8 -4
  10. topicforge-0.5.4/docs/pro.md +38 -0
  11. {topicforge-0.5.3 → topicforge-0.5.4}/docs/product-plan.md +9 -29
  12. topicforge-0.5.4/examples/README.md +22 -0
  13. topicforge-0.5.4/examples/dds/00_hello_pub_sub/README.md +113 -0
  14. topicforge-0.5.4/examples/dds/01_who_is_on_the_bus/README.md +58 -0
  15. topicforge-0.5.4/examples/dds/02_why_cant_they_talk/README.md +61 -0
  16. topicforge-0.5.4/examples/dds/03_a_node_crashed/README.md +61 -0
  17. topicforge-0.5.4/examples/dds/04_late_joiner_misses_data/README.md +52 -0
  18. topicforge-0.5.4/examples/dds/05_reliability_in_code/README.md +102 -0
  19. topicforge-0.5.4/examples/dds/06_durability_late_joiner_in_code/README.md +127 -0
  20. topicforge-0.5.4/examples/dds/07_deadline_in_code/README.md +112 -0
  21. topicforge-0.5.4/examples/dds/08_crash_seen_from_inside/README.md +119 -0
  22. topicforge-0.5.4/examples/dds/10_lidar_silent_after_driver_swap/README.md +63 -0
  23. topicforge-0.5.4/examples/dds/11_who_talks_to_whom/README.md +53 -0
  24. topicforge-0.5.4/examples/dds/12_safety_monitor_dropout/README.md +67 -0
  25. topicforge-0.5.4/examples/dds/13_deadline_not_offered/README.md +66 -0
  26. topicforge-0.5.4/examples/dds/14_restart_loop/README.md +51 -0
  27. topicforge-0.5.4/examples/dds/README.md +141 -0
  28. {topicforge-0.5.3 → topicforge-0.5.4}/pyproject.toml +7 -1
  29. topicforge-0.5.4/scripts/integration/README.md +186 -0
  30. topicforge-0.5.4/scripts/integration/publishers/cyclone_c/README.md +41 -0
  31. topicforge-0.5.4/scripts/integration/publishers/cyclone_cpp/README.md +44 -0
  32. topicforge-0.5.4/scripts/integration/publishers/cyclone_rust/README.md +48 -0
  33. topicforge-0.5.4/scripts/integration/publishers/dust_py/README.md +35 -0
  34. topicforge-0.5.4/scripts/integration/publishers/fast_publisher_cpp/README.md +32 -0
  35. topicforge-0.5.4/scripts/integration/publishers/fast_py/README.md +65 -0
  36. topicforge-0.5.4/scripts/integration/publishers/opensplice_publisher/README.md +123 -0
  37. topicforge-0.5.4/scripts/integration/publishers/rti_c/README.md +62 -0
  38. topicforge-0.5.4/scripts/integration/publishers/rti_cpp/README.md +65 -0
  39. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/__init__.py +1 -1
  40. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/common/__init__.py +8 -0
  41. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/common/dds_helpers.py +40 -24
  42. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/common/dds_introspection.py +122 -10
  43. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/common/lifecycle.py +8 -0
  44. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/common/qos_normalize.py +5 -1
  45. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/dds_cyclone/adapter.py +62 -30
  46. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/ros2_mock/fixtures.py +30 -2
  47. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/models/schemas.py +47 -7
  48. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/tools/handlers.py +7 -6
  49. topicforge-0.5.4/tests/integration/__init__.py +1 -0
  50. topicforge-0.5.4/tests/integration/test_real_bus.py +56 -0
  51. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_cyclone_adapter.py +4 -1
  52. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_dds_cross_vendor.py +11 -5
  53. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_dds_helpers.py +59 -33
  54. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_dds_introspection.py +120 -0
  55. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_dds_qos_normalization.py +40 -0
  56. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_dds_schemas.py +1 -1
  57. topicforge-0.5.4/tests/test_example_node_spec.py +118 -0
  58. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_fast_adapter.py +4 -1
  59. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_inspector.py +2 -2
  60. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_mock_adapter.py +8 -2
  61. topicforge-0.5.3/PKG-INFO +0 -440
  62. topicforge-0.5.3/README.md +0 -381
  63. topicforge-0.5.3/docs/DDS_QUICKSTART.md +0 -206
  64. topicforge-0.5.3/docs/MIGRATION_v0.1_to_v0.2.md +0 -140
  65. topicforge-0.5.3/docs/MIGRATION_v0.2_to_v0.3.md +0 -157
  66. topicforge-0.5.3/docs/MIGRATION_v0.3_to_v0.4.md +0 -248
  67. topicforge-0.5.3/docs/TESTING.md +0 -434
  68. topicforge-0.5.3/docs/TROUBLESHOOTING.md +0 -312
  69. topicforge-0.5.3/docs/pro.md +0 -65
  70. topicforge-0.5.3/examples/README.md +0 -37
  71. topicforge-0.5.3/scripts/integration/README.md +0 -124
  72. topicforge-0.5.3/tests/integration/__init__.py +0 -16
  73. topicforge-0.5.3/tests/integration/conftest.py +0 -58
  74. topicforge-0.5.3/tests/integration/scenarios/lifecycle_tracking.json +0 -34
  75. topicforge-0.5.3/tests/integration/scenarios/multi_vendor_basic.json +0 -39
  76. topicforge-0.5.3/tests/integration/scenarios/qos_mismatch_detection.json +0 -47
  77. topicforge-0.5.3/tests/integration/scenarios/topic_metrics_frequency.json +0 -30
  78. topicforge-0.5.3/tests/integration/scenarios/topic_metrics_sequence_gaps.json +0 -34
  79. topicforge-0.5.3/tests/integration/scenarios/xtypes_decode.json +0 -29
  80. topicforge-0.5.3/tests/integration/test_real_bus.py +0 -89
  81. topicforge-0.5.3/tests/integration/test_scenarios_schema.py +0 -140
  82. {topicforge-0.5.3 → topicforge-0.5.4}/LICENSE +0 -0
  83. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/__main__.py +0 -0
  84. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/__init__.py +0 -0
  85. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/base.py +0 -0
  86. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/common/cdr_decoder.py +0 -0
  87. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/common/metrics_buffer.py +0 -0
  88. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/common/qos_analyzer.py +0 -0
  89. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/common/qos_endpoints.py +0 -0
  90. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/common/xtypes.py +0 -0
  91. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/composite.py +0 -0
  92. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/dds_cyclone/__init__.py +0 -0
  93. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/dds_dust/__init__.py +0 -0
  94. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/dds_dust/adapter.py +0 -0
  95. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/dds_fast/__init__.py +0 -0
  96. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/dds_fast/adapter.py +0 -0
  97. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/dds_opendds/__init__.py +0 -0
  98. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/dds_opendds/adapter.py +0 -0
  99. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/ros2_live/__init__.py +0 -0
  100. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/ros2_live/adapter.py +0 -0
  101. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/ros2_mock/__init__.py +0 -0
  102. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/adapters/ros2_mock/adapter.py +0 -0
  103. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/config/__init__.py +0 -0
  104. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/config/settings.py +0 -0
  105. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/constants.py +0 -0
  106. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/models/__init__.py +0 -0
  107. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/server/__init__.py +0 -0
  108. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/server/app.py +0 -0
  109. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/services/__init__.py +0 -0
  110. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/services/bag_service.py +0 -0
  111. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/services/factory.py +0 -0
  112. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/services/health.py +0 -0
  113. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/services/inspector.py +0 -0
  114. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/telemetry/__init__.py +0 -0
  115. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/telemetry/client.py +0 -0
  116. {topicforge-0.5.3 → topicforge-0.5.4}/src/topicforge/tools/__init__.py +0 -0
  117. {topicforge-0.5.3 → topicforge-0.5.4}/tests/__init__.py +0 -0
  118. {topicforge-0.5.3 → topicforge-0.5.4}/tests/conftest.py +0 -0
  119. {topicforge-0.5.3 → topicforge-0.5.4}/tests/fixtures/csv_echo_imu.txt +0 -0
  120. {topicforge-0.5.3 → topicforge-0.5.4}/tests/fixtures/csv_echo_pose_multi.txt +0 -0
  121. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_analyze_bag_multi_format.py +0 -0
  122. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_bag_service.py +0 -0
  123. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_cdr_decoder.py +0 -0
  124. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_composite_adapter.py +0 -0
  125. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_config.py +0 -0
  126. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_dust_adapter.py +0 -0
  127. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_factory.py +0 -0
  128. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_health.py +0 -0
  129. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_lifecycle_buffer.py +0 -0
  130. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_live_adapter_parse.py +0 -0
  131. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_live_adapter_subprocess.py +0 -0
  132. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_metrics_buffer.py +0 -0
  133. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_opendds_adapter.py +0 -0
  134. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_peek_bag_samples.py +0 -0
  135. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_qos_analyzer.py +0 -0
  136. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_qos_endpoints.py +0 -0
  137. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_telemetry.py +0 -0
  138. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_tools_integration.py +0 -0
  139. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_topic_metrics.py +0 -0
  140. {topicforge-0.5.3 → topicforge-0.5.4}/tests/test_xtypes.py +0 -0
@@ -230,3 +230,8 @@ CLAUDE*.md
230
230
  # Pro tier: paid features kept out of the open-source repo
231
231
  # -------------------------------------------------------------------------
232
232
  pro/
233
+
234
+ # Vendor license files for the demo participants (never commit)
235
+ scripts/integration/**/rti_license.dat
236
+ scripts/integration/**/*.dat
237
+ .venv-demo/
@@ -7,6 +7,112 @@ and this project adheres to [Semantic Versioning 2.0.0](https://semver.org/spec/
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.5.4] - 2026-10-02
11
+
12
+ First run of the DDS code against a live multi-vendor bus (Windows 11, a
13
+ Python / Cyclone DDS participant and a Rust / Dust DDS participant, TopicForge
14
+ driven by a real MCP client). Until now every DDS adapter had only been
15
+ checked statically. The run exposed four defects that together made the DDS
16
+ module non-functional on Cyclone; all are fixed and pinned by tests.
17
+
18
+ ### Fixed
19
+
20
+ - Role nodes published below their rate (about 7 Hz for 10 Hz on Windows):
21
+ they now keep an absolute schedule.
22
+
23
+ - **`list_participants` now reports the participant name and the hostname on
24
+ Cyclone.** The name comes from the EntityName QoS and the hostname from the
25
+ `__Hostname` discovery property; both were always null on a real bus.
26
+ - **Participant GUIDs were never read.** cyclonedds 11.0.1 exposes the builtin
27
+ key as a `uuid.UUID`, which the extractor did not handle, so every
28
+ participant collapsed onto a single `unknown` entry.
29
+ - **Vendors were never identified.** The builtin participant sample carries no
30
+ vendor field. The vendor id is now read from the first two bytes of the GUID
31
+ prefix, as RTPS recommends; implementations that do not follow that
32
+ convention (Dust DDS, and RTI by default) still report `unknown`, because
33
+ the Cyclone Python binding does not expose the vendor id from the RTPS
34
+ header.
35
+ - **The OMG vendor-id table was wrong.** It mapped `01.05` to Fast DDS and
36
+ `01.16` to Cyclone; the correct ids are `01.0F` (eProsima) and `01.10`
37
+ (Eclipse), verified against both vendors' sources. The Cyclone side ran on a
38
+ live bus; the Fast DDS side (`fast_extract_vendor_id`) is verified
39
+ statically only, since its tests need a binding that is not on PyPI. The `vendor` field of
40
+ `ParticipantInfo` and `ParticipantEvent` now also accepts `rti_micro`,
41
+ `opensplice`, `opendds`, `coredx`, `intercom` and `dust` (soft-breaking for
42
+ clients validating the previous enum).
43
+ - **`detect_qos_mismatches` never reported anything on Cyclone.** cyclonedds
44
+ scopes its policy class names (`Reliability.BestEffort`), and the
45
+ normalizer matched only the bare name, so no QoS profile was ever built.
46
+ - **A stopped participant never disappeared.** Discovery readers keep the last
47
+ sample of a departed participant with a NOT_ALIVE instance state; those are
48
+ now ignored for participants and endpoints, so a participant is reported as
49
+ left when its lease expires, and a dead endpoint no longer produces a
50
+ mismatch.
51
+
52
+ - Cyclone adapter created a new DDS reader on a builtin discovery topic on
53
+ every tool call and never deleted it. It now keeps one reader per builtin
54
+ topic and takes a non-blocking snapshot, so calls no longer wait 2 s each
55
+ (`detect_qos_mismatches` waited 4 s).
56
+ - `peek_dds_samples` on `DCPSPublication` / `DCPSSubscription` reported the
57
+ endpoints of participants that had left; disposed entries are now dropped.
58
+ Its payload also carries the endpoint `type_name`.
59
+ - `test_dds_cross_vendor.py` expected an error message from v0.3; it had
60
+ never run, since CI has no DDS binding. First run against the real Cyclone
61
+ binding.
62
+
63
+ ### Added
64
+
65
+ - `examples/dds/`: a "write the code" track. Examples 00 (hello publisher
66
+ and subscriber), 05 (Reliability), 06 (Durability and the late joiner),
67
+ 07 (Deadline declared and kept) and 08 (a crash seen from inside and from
68
+ outside) each ship a readable `publisher.py` and `subscriber.py` in Cyclone
69
+ DDS Python; the subscriber prints what it receives and the DDS statuses,
70
+ and TopicForge explains the same situation from outside. All fourteen
71
+ examples pass on a live bus.
72
+ - The generic role nodes print one line per second per reader with what
73
+ they received, and examples 02, 04, 10 and 13 check that the broken
74
+ subscriber receives nothing while the control one receives data.
75
+ - The harness keeps each program's output in a log file and prints it live
76
+ under `--hold`.
77
+
78
+ - `scripts/integration/interop_check.py`: one-command multi-vendor demo
79
+ that starts a Rust / Dust and a Python / Cyclone participant, drives
80
+ TopicForge over stdio through the official MCP client, checks participant
81
+ discovery, a deliberate Reliability mismatch between the two vendors, and
82
+ the departure of a stopped participant, then stops every process it started.
83
+ - A real Rust / Dust DDS participant (`publishers/dust_publisher`) and a real
84
+ Python / Cyclone participant replacing the previous scaffold, which never
85
+ wrote a sample.
86
+ - Twelve interop programs in total, one per vendor and language with an
87
+ officially released binding (Cyclone C / C++ / Rust / Python, Dust Rust /
88
+ Python, Fast DDS C++ / Python, RTI Connext C / C++ / Python, OpenSplice C),
89
+ all following the contract in `scripts/integration/DEMO_CONTRACT.md`. The
90
+ driver starts whichever ones are built on the host and adapts its checks;
91
+ `--list` shows what can run. Only Cyclone Python and Dust Rust / Python / C
92
+ have been run, on Windows; the rest are written but unrun. RTI participants
93
+ need a local license and are never run in CI.
94
+ - One-command launch scripts, `scripts/integration/launch/setup` and
95
+ `run_demo` (`.ps1` and `.sh`), which create `.venv-demo`, install the Cyclone
96
+ binding and build the Rust participant. `setup.ps1 -Firewall` adds inbound
97
+ UDP 7400-7500 rules on private networks for multi-machine runs.
98
+ - Unicast peer configuration for Cyclone and Fast DDS and a guide for a mixed
99
+ Linux and Windows bus (`scripts/integration/config/`).
100
+ - `.github/workflows/demo.yml` runs the driver with the Cyclone and Dust
101
+ participants on Ubuntu and Windows; `demo-fast.yml` builds Fast DDS 3 from
102
+ pinned tags and starts the C++ participant (weekly and manual).
103
+ - `scripts/integration/README.md` rewritten around the demo: it previously
104
+ described the removed docker / scenario rig.
105
+
106
+ - `examples/dds/`: real use cases 10 to 14 (driver swap, wiring, safety
107
+ monitor dropout, deadline not offered, restart loop) next to the concept
108
+ examples 01 to 04. All nine pass on a live bus.
109
+
110
+ ### Removed
111
+
112
+ - The docker / scenario integration rig (`scenarios_runner.py`, `run-local.*`,
113
+ `docker-compose.yml`, per-vendor Dockerfiles, scenario JSON files, schema
114
+ test and `integration.yml`) is removed in favour of the demo driver.
115
+
10
116
  ## [0.5.3] - 2026-10-01
11
117
 
12
118
  Fixes from an independent senior review of the whole repository (five
@@ -23,8 +129,9 @@ the findings.
23
129
  because the names are unclaimed anyone could have registered them: users
24
130
  following the documented `pip install topicforge[dds]` would then have run
25
131
  that code. Those extras are removed; `[dds]` now means Cyclone only. The
26
- metadata of 0.3.0 to 0.5.2 is immutable on PyPI, which is why those
27
- releases are being yanked and a security advisory published.
132
+ metadata of 0.3.0 to 0.5.2 is immutable on PyPI, so those releases have
133
+ been yanked: `pip install topicforge` no longer selects them, although an
134
+ exact pin such as `topicforge==0.5.2` still installs one.
28
135
  - **Removed the automatic `topicforge_pro` plugin hook.** At startup the
29
136
  server imported any installed package named `topicforge_pro` and handed it
30
137
  the full MCP server instance, so a third-party package with that
@@ -1007,7 +1114,8 @@ Initial MVP release of TopicForge: ROS Topic Inspector & Bag Analyzer MCP server
1007
1114
  - The write path (publishing, commanding robots) is intentionally out of scope for the MVP.
1008
1115
  - `analyze_bag` in live mode parses `ros2 bag info` text output; deeper anomaly detection remains mock-only for now.
1009
1116
 
1010
- [Unreleased]: https://github.com/yaniswav/TopicForge/compare/v0.5.3...HEAD
1117
+ [Unreleased]: https://github.com/yaniswav/TopicForge/compare/v0.5.4...HEAD
1118
+ [0.5.4]: https://github.com/yaniswav/TopicForge/compare/v0.5.3...v0.5.4
1011
1119
  [0.5.3]: https://github.com/yaniswav/TopicForge/compare/v0.5.2...v0.5.3
1012
1120
  [0.5.2]: https://github.com/yaniswav/TopicForge/compare/v0.5.1...v0.5.2
1013
1121
  [0.5.1]: https://github.com/yaniswav/TopicForge/compare/v0.5.0...v0.5.1
@@ -0,0 +1,241 @@
1
+ Metadata-Version: 2.5
2
+ Name: topicforge
3
+ Version: 0.5.4
4
+ Summary: ROS Topic Inspector & Bag Analyzer MCP server for AI agents
5
+ Project-URL: Homepage, https://github.com/yaniswav/TopicForge
6
+ Project-URL: Repository, https://github.com/yaniswav/TopicForge
7
+ Project-URL: Issues, https://github.com/yaniswav/TopicForge/issues
8
+ Project-URL: Changelog, https://github.com/yaniswav/TopicForge/blob/main/CHANGELOG.md
9
+ Author-email: Yanis ETHVIGNOT <ethvignot.yanis@gmail.com>
10
+ License: MIT License
11
+
12
+ Copyright (c) 2026 Yanis ETHVIGNOT
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ License-File: LICENSE
32
+ Keywords: ai,claude,mcp,model-context-protocol,robotics,ros2
33
+ Classifier: Development Status :: 3 - Alpha
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Operating System :: OS Independent
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3.10
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Programming Language :: Python :: 3.12
41
+ Classifier: Programming Language :: Python :: 3.13
42
+ Requires-Python: >=3.10
43
+ Requires-Dist: mcp<2,>=1.0.0
44
+ Requires-Dist: pydantic>=2.6
45
+ Provides-Extra: all
46
+ Requires-Dist: cyclonedds>=0.10; extra == 'all'
47
+ Provides-Extra: bags
48
+ Requires-Dist: rosbags>=0.9; extra == 'bags'
49
+ Provides-Extra: dds
50
+ Requires-Dist: cyclonedds>=0.10; extra == 'dds'
51
+ Provides-Extra: dds-cyclone
52
+ Requires-Dist: cyclonedds>=0.10; extra == 'dds-cyclone'
53
+ Provides-Extra: dev
54
+ Requires-Dist: pytest-cov>=5.0; extra == 'dev'
55
+ Requires-Dist: pytest>=8.0; extra == 'dev'
56
+ Requires-Dist: rosbags>=0.9; extra == 'dev'
57
+ Requires-Dist: ruff>=0.4; extra == 'dev'
58
+ Description-Content-Type: text/markdown
59
+
60
+ # TopicForge
61
+
62
+ <!-- mcp-name: io.github.yaniswav/topicforge -->
63
+
64
+ [![PyPI version](https://img.shields.io/pypi/v/topicforge.svg)](https://pypi.org/project/topicforge/)
65
+ [![CI](https://github.com/yaniswav/TopicForge/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/yaniswav/TopicForge/actions/workflows/ci.yml)
66
+ [![Python versions](https://img.shields.io/pypi/pyversions/topicforge.svg)](https://pypi.org/project/topicforge/)
67
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/yaniswav/TopicForge/blob/main/LICENSE)
68
+ [![Read-only by architecture](https://img.shields.io/badge/safety-read--only_by_architecture-2563eb)](https://github.com/yaniswav/TopicForge#security-model)
69
+
70
+ A read-only MCP (Model Context Protocol) server that lets an AI agent inspect a ROS2 graph, recorded bag files and the DDS layer underneath ROS, without being able to publish to the bus or command a robot. It is read-only by **architecture**, not by configuration: there is no write path to misconfigure and no permission system to audit.
71
+
72
+ Without grounding, an LLM asked about a robot will invent topic names, message types and bag contents. TopicForge gives it **eleven typed tools** that return frozen Pydantic schemas, identical whether the server talks to a real robot or to its built-in mock fixtures. It is aimed at ROS2 developers, robotics ML/CV engineers and teams that cannot accept a write path into a production stack.
73
+
74
+ For DDS, TopicForge joins a domain as a read-only participant through one open-source binding (Eclipse CycloneDDS from PyPI) and reads the builtin discovery topics that the OMG DDS-RTPS protocol standardizes. Every conformant vendor announces itself there, so a Cyclone participant also sees RTI Connext, OpenDDS, CoreDX and Dust DDS endpoints without any proprietary binding. This covers discovery only: participants, readers, writers and their QoS. See [`docs/dds-interop-matrix.md`](docs/dds-interop-matrix.md).
75
+
76
+ ## Quickstart
77
+
78
+ No ROS2 needed; the mock adapter serves deterministic fixtures for a small differential robot (LIDAR + RGB camera). Python 3.10 to 3.13.
79
+
80
+ ```bash
81
+ pip install topicforge
82
+ TOPICFORGE_MODE=mock python -m topicforge
83
+ # Windows PowerShell: $env:TOPICFORGE_MODE="mock"; python -m topicforge
84
+ ```
85
+
86
+ The server speaks MCP over stdio and waits for a client, so wire it into one. For Claude Desktop, add to `claude_desktop_config.json`:
87
+
88
+ ```json
89
+ {
90
+ "mcpServers": {
91
+ "topicforge": {
92
+ "command": "python",
93
+ "args": ["-m", "topicforge"],
94
+ "env": { "TOPICFORGE_MODE": "auto" }
95
+ }
96
+ }
97
+ }
98
+ ```
99
+
100
+ Then ask it to list the topics or to analyze `/tmp/demo.mcap`. For Claude Code: `claude mcp add topicforge -- topicforge`. Setup for a real ROS2 environment (WSL2, Linux, Docker, native Windows) is in [`docs/TESTING.md`](docs/TESTING.md); recurring monitoring prompts and the privacy contract are in [`docs/TUTORIEL.md`](docs/TUTORIEL.md).
101
+
102
+ ## Tools
103
+
104
+ All eleven tools are read-only. Every response except `health_check` carries `mode_effective` (`"live"` or `"mock"`), so a caller can tell a real graph from fixtures.
105
+
106
+ | Tool | Purpose |
107
+ | ----------------------- | ------------------------------------------------------------------------------------------------ |
108
+ | `health_check` | Environment and mode introspection. Always succeeds; reports `mode` next to `requested_mode` |
109
+ | `list_topics` | Discover the ROS2 graph |
110
+ | `get_topic_info` | Message type, publisher/subscriber counts and QoS for one topic |
111
+ | `sample_messages` | Peek recent messages on a ROS2 topic (count clamped to 50) |
112
+ | `analyze_bag` | Summarize a `.mcap` / `.db3` / `.bag` recording |
113
+ | `list_participants` | DDS participants on the domain: vendor, `name` (EntityName QoS, Cyclone) and `hostname` |
114
+ | `detect_qos_mismatches` | Incompatible QoS pairs between DDS readers and writers |
115
+ | `peek_dds_samples` | Raw DDS samples; structured on the three builtin discovery topics, presence-only on user topics |
116
+ | `participant_events` | Timeline of participant `discovered` / `lost` events |
117
+ | `topic_metrics` | Frequency, sequence-gap and latency schema; data only for builtin discovery topics |
118
+ | `peek_bag_samples` | Decoded samples from a recorded bag (needs `pip install topicforge[bags]`) |
119
+
120
+ Walkthroughs against the mock, each with the exact tool calls and payloads, are in [`examples/`](examples/README.md). To run the DDS tools against a real bus with several programs and vendors, see [`examples/dds/README.md`](examples/dds/README.md) (`python examples/dds/run_all.py`).
121
+
122
+ ## Modes
123
+
124
+ | Mode | When to use | Backend |
125
+ | ------ | ------------------------------------------------ | -------------------------- |
126
+ | `mock` | Development, demos, CI, screencasts | Deterministic fixtures |
127
+ | `live` | ROS2 sourced and on PATH, and/or a DDS backend | `ros2` CLI, DDS participant |
128
+ | `auto` | Detect what is available, else mock (default) | Best available |
129
+
130
+ `live` and `auto` degrade instead of failing: if neither `ros2` nor a DDS backend comes up, the server serves the mock fixtures and `health_check` reports `mode: "mock"` next to `requested_mode`. Only `TOPICFORGE_MODE=mock` forces fixtures unconditionally. The live ROS2 adapter shells out to the `ros2` CLI, so `rclpy` does not need to be importable.
131
+
132
+ ## DDS backends
133
+
134
+ ```bash
135
+ pip install topicforge[dds] # Eclipse CycloneDDS ([dds-cyclone] is the same thing)
136
+ TOPICFORGE_DDS_BACKEND=cyclone python -m topicforge
137
+ ```
138
+
139
+ `TOPICFORGE_DDS_BACKEND` accepts `mock` (default), `cyclone`, `fast` and `auto` (`fast`, then `cyclone`, then `mock`, whichever binding imports). An explicit value is honoured with or without `ros2` on PATH, in any mode except `mock`. If the binding is missing or the participant cannot start, the server logs a warning naming the cause and falls back to the ROS2 CLI alone, or to the mock fixtures. When both `ros2` and a DDS backend are up, a composite adapter routes the five ROS2 graph and bag tools to the CLI and the five DDS tools to the DDS backend.
140
+
141
+ A Fast DDS adapter exists but has never run against a bus, and its `fastdds` Python binding is not on PyPI: build it from eProsima's sources and install it next to TopicForge. There is no `[dds-fast]` extra. `opendds` and `dust` are permanent stubs that never serve. `rti`, `opensplice`, `coredx` and `intercom` are rejected with a configuration error, since the Pro tier is retired (see [`docs/pro.md`](docs/pro.md)). Full backend selection, the routing table and the QoS mismatch scenario are in [`docs/DDS_QUICKSTART.md`](docs/DDS_QUICKSTART.md); error messages are in [`docs/TROUBLESHOOTING.md`](docs/TROUBLESHOOTING.md).
142
+
143
+ ## Configuration reference
144
+
145
+ | Variable | Default | Description |
146
+ | -------------------------- | ------- | ------------------------------------------------------------------------------------------------- |
147
+ | `TOPICFORGE_MODE` | `auto` | `mock`, `live` or `auto` |
148
+ | `TOPICFORGE_LOG_LEVEL` | `INFO` | `DEBUG`, `INFO`, `WARNING`, `ERROR` |
149
+ | `TOPICFORGE_ROS2_BIN` | `ros2` | Name or path of the ROS2 CLI binary |
150
+ | `TOPICFORGE_TELEMETRY` | `off` | Opt-in anonymous telemetry; an unrecognized value aborts startup. See [Telemetry](#telemetry) |
151
+ | `TOPICFORGE_DDS_BACKEND` | `mock` | `mock`, `cyclone`, `fast`, `auto` (`opendds` and `dust` are stubs) |
152
+ | `TOPICFORGE_DDS_DOMAIN_ID` | `0` | DDS domain observed (0..232). Joined at startup; changing it needs a restart |
153
+
154
+ Samples with comments are in [`.env.example`](.env.example). Any invalid value stops the server with `topicforge: configuration error: ...` and exit code 2, so a typo cannot silently change behaviour.
155
+
156
+ ## Limitations
157
+
158
+ - **DDS validation is partial.** The Cyclone adapter has run against a real bus, with Cyclone and Dust DDS participants, on Windows and in CI on Ubuntu and Windows (`.github/workflows/demo.yml`). The Fast DDS adapter has never run against a bus, and no RTI, OpenDDS, CoreDX or OpenSplice participant has been observed by this project. The multi-vendor claim rests on the RTPS protocol guarantee, not on a recorded cross-vendor run.
159
+ - **User-topic payloads are not decoded.** `peek_dds_samples` on a user topic reports that the topic is announced on the bus and returns one placeholder sample (`_decode_status="raw"`, empty `_raw_bytes_hex`); no traffic is read. Consequently `topic_metrics` only has data for the builtin discovery topics, its observed frequency is the cadence of your own `peek_dds_samples` calls, and latency and sequence gaps are `null`. It is a discovery-layer probe, not a publish-rate monitor.
160
+ - **Cyclone vendor ids.** Participants that do not follow the RTPS vendor-id convention in their GUID prefix (Dust DDS, and RTI by default) are reported with vendor `unknown`.
161
+ - **DDS Security is not handled.** A participant without credentials sees an empty secure bus. `detect_qos_mismatches` covers Reliability, Durability, History and Deadline; Liveliness, Ownership and Partition are not checked.
162
+ - **`sample_messages` (live)** runs `ros2 topic echo --csv --once` with a short timeout; a topic with no current publisher returns an empty sample. `timestamp_ns` is the message `header.stamp` for `Header`-stamped types and `0` for headerless ones.
163
+ - **`analyze_bag` (live)** parses `ros2 bag info` text and does not use `rosbags`; anomaly detection is mock-only. `peek_bag_samples` is the only tool that reads the file itself, through `rosbags`, and is served only by the ROS2 CLI adapter or the mock. Without `ros2`, bag tools return fixtures: check `health_check` for `mode: "mock"` before trusting bag output.
164
+ - **Synchronous handlers.** The tools run on the MCP event loop; on Windows a hung `ros2` launcher can block the server.
165
+ - No streaming or push subscriptions: tools are strictly request/response.
166
+
167
+ The roadmap and the open work behind these limits are in [`docs/product-plan.md`](docs/product-plan.md).
168
+
169
+ ## Telemetry
170
+
171
+ Opt-in, anonymous and **off by default**. When off, instrumentation returns the handler unchanged: no event is built, no transport is constructed, no network code runs (pinned by `tests/test_telemetry.py::test_build_app_off_makes_no_transport_calls`).
172
+
173
+ ```bash
174
+ TOPICFORGE_TELEMETRY=on python -m topicforge
175
+ ```
176
+
177
+ On-values: `on`, `1`, `true`, `yes`, `enabled`. Off-values: unset, `off`, `0`, `false`, `no`, `disabled`. Anything else is a configuration error, not a silent "off".
178
+
179
+ When on, each tool call emits one event with exactly six fields:
180
+
181
+ | Field | Example | Notes |
182
+ | ------------ | --------------- | ----------------------------------------------------------- |
183
+ | `tool_name` | `"list_topics"` | One of the eleven tools, never argument values |
184
+ | `latency_ms` | `12.34` | Handler wall-clock duration, 2 decimals |
185
+ | `mode` | `"mock"` | Mode of the adapter actually serving: `mock` or `live` |
186
+ | `version` | `"0.5.3"` | TopicForge server version |
187
+ | `session_id` | `"a1b2c3..."` | Random UUID per process, never persisted |
188
+ | `success` | `true` | Whether the handler returned or raised |
189
+
190
+ Never sent: topic names, message types or payloads, bag paths or contents, hostnames, usernames, IP addresses, environment variables, error messages. The field set is fenced by `tests/test_telemetry.py::test_payload_contains_only_whitelisted_keys`; adding a field requires updating this section. The default transport is a structured log line, there is no HTTP endpoint yet. The implementation is in [`src/topicforge/telemetry/`](src/topicforge/telemetry/).
191
+
192
+ ## Security model
193
+
194
+ TopicForge is designed for **local trust**: it runs as a subprocess of your MCP client on a machine you control and inspects your own ROS2 graph, DDS domain and bag files. It is not hardened for adversarial inputs.
195
+
196
+ - `TOPICFORGE_ROS2_BIN` accepts an arbitrary path; treat it the way you treat `PATH`.
197
+ - `analyze_bag` and `peek_bag_samples` open whatever path the client passes (no workspace isolation, no symlink restriction).
198
+ - All `ros2` invocations use `subprocess.run` with an argument list, never `shell=True`. ROS2 topic names are validated against `^/[A-Za-z0-9_/]+$` first.
199
+ - The server loads no third-party code at startup. Until 0.5.2 it imported any installed `topicforge_pro` package; that hook was removed in 0.5.3 because it was an opening for a package of that name to add write tools.
200
+ - No outbound network calls unless telemetry is turned on.
201
+
202
+ Before exposing TopicForge to untrusted MCP clients (hosted endpoints, shared environments), add path isolation and revisit the `TOPICFORGE_ROS2_BIN` policy. Vulnerability reports: see [`SECURITY.md`](SECURITY.md).
203
+
204
+ ## Development
205
+
206
+ ```bash
207
+ git clone https://github.com/yaniswav/TopicForge.git && cd TopicForge
208
+ python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\Activate.ps1
209
+ pip install -e ".[dev]"
210
+ python -m ruff check src tests
211
+ python -m pytest
212
+ ```
213
+
214
+ Tests run against the mock adapter, the live adapter's pure parsers and the binding-free DDS helpers; they never need a running ROS graph. Tests needing the `cyclonedds` or `fastdds` binding skip themselves when it is absent, and the `integration` marker (real-bus tests) is deselected by default. The `Makefile` (`make check`) uses POSIX shell syntax; on plain PowerShell run the commands above. See [`CONTRIBUTING.md`](CONTRIBUTING.md).
215
+
216
+ ## Upgrading
217
+
218
+ TopicForge is pre-1.0 and the 0.x releases changed things freely; [`CHANGELOG.md`](CHANGELOG.md) is the record. Two points matter if you are coming from an old install. Releases 0.3.0 to 0.5.2 are yanked, so `pip install -U topicforge` resolves to 0.5.3 or later. And since 0.5.3 the `[dds-fast]`, `[dds-opendds]`, `[dds-dust]` and `[dds-all-oss]` extras no longer exist, the DDS backend values `rti`, `opensplice`, `coredx` and `intercom` are rejected, and `[dds]` and `[all]` resolve to Cyclone only. Schema changes across 0.x were additive optional fields; a client that pins a JSON Schema with `additionalProperties: false` needs to regenerate it.
219
+
220
+ ## Layout
221
+
222
+ ```
223
+ src/topicforge/
224
+ server/ MCP bootstrap, build_app(settings)
225
+ tools/ thin FastMCP handlers, no backend logic
226
+ services/ input validation, orchestration, adapter factory
227
+ adapters/ ros2_live, ros2_mock, dds_cyclone, dds_fast, common/ (binding-free logic)
228
+ models/ frozen Pydantic schemas, the contract with MCP clients
229
+ config/ settings and mode resolution
230
+ telemetry/ opt-in, off by default
231
+ examples/ mock walkthroughs (*.md) and runnable live DDS examples (dds/)
232
+ scripts/ real-bus interop checks
233
+ docs/ guides, product plan
234
+ tests/ pytest suite, mock-only, no ROS2 or DDS required
235
+ ```
236
+
237
+ Layers are strictly separated: handlers never call `subprocess`, adapters are the only code that talks to a backend, and new backends implement the `MiddlewareAdapter` protocol in `adapters/base.py`.
238
+
239
+ ## License
240
+
241
+ MIT, see [LICENSE](LICENSE). Commercial support and integration work: [`docs/pro.md`](docs/pro.md).
@@ -0,0 +1,182 @@
1
+ # TopicForge
2
+
3
+ <!-- mcp-name: io.github.yaniswav/topicforge -->
4
+
5
+ [![PyPI version](https://img.shields.io/pypi/v/topicforge.svg)](https://pypi.org/project/topicforge/)
6
+ [![CI](https://github.com/yaniswav/TopicForge/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/yaniswav/TopicForge/actions/workflows/ci.yml)
7
+ [![Python versions](https://img.shields.io/pypi/pyversions/topicforge.svg)](https://pypi.org/project/topicforge/)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/yaniswav/TopicForge/blob/main/LICENSE)
9
+ [![Read-only by architecture](https://img.shields.io/badge/safety-read--only_by_architecture-2563eb)](https://github.com/yaniswav/TopicForge#security-model)
10
+
11
+ A read-only MCP (Model Context Protocol) server that lets an AI agent inspect a ROS2 graph, recorded bag files and the DDS layer underneath ROS, without being able to publish to the bus or command a robot. It is read-only by **architecture**, not by configuration: there is no write path to misconfigure and no permission system to audit.
12
+
13
+ Without grounding, an LLM asked about a robot will invent topic names, message types and bag contents. TopicForge gives it **eleven typed tools** that return frozen Pydantic schemas, identical whether the server talks to a real robot or to its built-in mock fixtures. It is aimed at ROS2 developers, robotics ML/CV engineers and teams that cannot accept a write path into a production stack.
14
+
15
+ For DDS, TopicForge joins a domain as a read-only participant through one open-source binding (Eclipse CycloneDDS from PyPI) and reads the builtin discovery topics that the OMG DDS-RTPS protocol standardizes. Every conformant vendor announces itself there, so a Cyclone participant also sees RTI Connext, OpenDDS, CoreDX and Dust DDS endpoints without any proprietary binding. This covers discovery only: participants, readers, writers and their QoS. See [`docs/dds-interop-matrix.md`](docs/dds-interop-matrix.md).
16
+
17
+ ## Quickstart
18
+
19
+ No ROS2 needed; the mock adapter serves deterministic fixtures for a small differential robot (LIDAR + RGB camera). Python 3.10 to 3.13.
20
+
21
+ ```bash
22
+ pip install topicforge
23
+ TOPICFORGE_MODE=mock python -m topicforge
24
+ # Windows PowerShell: $env:TOPICFORGE_MODE="mock"; python -m topicforge
25
+ ```
26
+
27
+ The server speaks MCP over stdio and waits for a client, so wire it into one. For Claude Desktop, add to `claude_desktop_config.json`:
28
+
29
+ ```json
30
+ {
31
+ "mcpServers": {
32
+ "topicforge": {
33
+ "command": "python",
34
+ "args": ["-m", "topicforge"],
35
+ "env": { "TOPICFORGE_MODE": "auto" }
36
+ }
37
+ }
38
+ }
39
+ ```
40
+
41
+ Then ask it to list the topics or to analyze `/tmp/demo.mcap`. For Claude Code: `claude mcp add topicforge -- topicforge`. Setup for a real ROS2 environment (WSL2, Linux, Docker, native Windows) is in [`docs/TESTING.md`](docs/TESTING.md); recurring monitoring prompts and the privacy contract are in [`docs/TUTORIEL.md`](docs/TUTORIEL.md).
42
+
43
+ ## Tools
44
+
45
+ All eleven tools are read-only. Every response except `health_check` carries `mode_effective` (`"live"` or `"mock"`), so a caller can tell a real graph from fixtures.
46
+
47
+ | Tool | Purpose |
48
+ | ----------------------- | ------------------------------------------------------------------------------------------------ |
49
+ | `health_check` | Environment and mode introspection. Always succeeds; reports `mode` next to `requested_mode` |
50
+ | `list_topics` | Discover the ROS2 graph |
51
+ | `get_topic_info` | Message type, publisher/subscriber counts and QoS for one topic |
52
+ | `sample_messages` | Peek recent messages on a ROS2 topic (count clamped to 50) |
53
+ | `analyze_bag` | Summarize a `.mcap` / `.db3` / `.bag` recording |
54
+ | `list_participants` | DDS participants on the domain: vendor, `name` (EntityName QoS, Cyclone) and `hostname` |
55
+ | `detect_qos_mismatches` | Incompatible QoS pairs between DDS readers and writers |
56
+ | `peek_dds_samples` | Raw DDS samples; structured on the three builtin discovery topics, presence-only on user topics |
57
+ | `participant_events` | Timeline of participant `discovered` / `lost` events |
58
+ | `topic_metrics` | Frequency, sequence-gap and latency schema; data only for builtin discovery topics |
59
+ | `peek_bag_samples` | Decoded samples from a recorded bag (needs `pip install topicforge[bags]`) |
60
+
61
+ Walkthroughs against the mock, each with the exact tool calls and payloads, are in [`examples/`](examples/README.md). To run the DDS tools against a real bus with several programs and vendors, see [`examples/dds/README.md`](examples/dds/README.md) (`python examples/dds/run_all.py`).
62
+
63
+ ## Modes
64
+
65
+ | Mode | When to use | Backend |
66
+ | ------ | ------------------------------------------------ | -------------------------- |
67
+ | `mock` | Development, demos, CI, screencasts | Deterministic fixtures |
68
+ | `live` | ROS2 sourced and on PATH, and/or a DDS backend | `ros2` CLI, DDS participant |
69
+ | `auto` | Detect what is available, else mock (default) | Best available |
70
+
71
+ `live` and `auto` degrade instead of failing: if neither `ros2` nor a DDS backend comes up, the server serves the mock fixtures and `health_check` reports `mode: "mock"` next to `requested_mode`. Only `TOPICFORGE_MODE=mock` forces fixtures unconditionally. The live ROS2 adapter shells out to the `ros2` CLI, so `rclpy` does not need to be importable.
72
+
73
+ ## DDS backends
74
+
75
+ ```bash
76
+ pip install topicforge[dds] # Eclipse CycloneDDS ([dds-cyclone] is the same thing)
77
+ TOPICFORGE_DDS_BACKEND=cyclone python -m topicforge
78
+ ```
79
+
80
+ `TOPICFORGE_DDS_BACKEND` accepts `mock` (default), `cyclone`, `fast` and `auto` (`fast`, then `cyclone`, then `mock`, whichever binding imports). An explicit value is honoured with or without `ros2` on PATH, in any mode except `mock`. If the binding is missing or the participant cannot start, the server logs a warning naming the cause and falls back to the ROS2 CLI alone, or to the mock fixtures. When both `ros2` and a DDS backend are up, a composite adapter routes the five ROS2 graph and bag tools to the CLI and the five DDS tools to the DDS backend.
81
+
82
+ A Fast DDS adapter exists but has never run against a bus, and its `fastdds` Python binding is not on PyPI: build it from eProsima's sources and install it next to TopicForge. There is no `[dds-fast]` extra. `opendds` and `dust` are permanent stubs that never serve. `rti`, `opensplice`, `coredx` and `intercom` are rejected with a configuration error, since the Pro tier is retired (see [`docs/pro.md`](docs/pro.md)). Full backend selection, the routing table and the QoS mismatch scenario are in [`docs/DDS_QUICKSTART.md`](docs/DDS_QUICKSTART.md); error messages are in [`docs/TROUBLESHOOTING.md`](docs/TROUBLESHOOTING.md).
83
+
84
+ ## Configuration reference
85
+
86
+ | Variable | Default | Description |
87
+ | -------------------------- | ------- | ------------------------------------------------------------------------------------------------- |
88
+ | `TOPICFORGE_MODE` | `auto` | `mock`, `live` or `auto` |
89
+ | `TOPICFORGE_LOG_LEVEL` | `INFO` | `DEBUG`, `INFO`, `WARNING`, `ERROR` |
90
+ | `TOPICFORGE_ROS2_BIN` | `ros2` | Name or path of the ROS2 CLI binary |
91
+ | `TOPICFORGE_TELEMETRY` | `off` | Opt-in anonymous telemetry; an unrecognized value aborts startup. See [Telemetry](#telemetry) |
92
+ | `TOPICFORGE_DDS_BACKEND` | `mock` | `mock`, `cyclone`, `fast`, `auto` (`opendds` and `dust` are stubs) |
93
+ | `TOPICFORGE_DDS_DOMAIN_ID` | `0` | DDS domain observed (0..232). Joined at startup; changing it needs a restart |
94
+
95
+ Samples with comments are in [`.env.example`](.env.example). Any invalid value stops the server with `topicforge: configuration error: ...` and exit code 2, so a typo cannot silently change behaviour.
96
+
97
+ ## Limitations
98
+
99
+ - **DDS validation is partial.** The Cyclone adapter has run against a real bus, with Cyclone and Dust DDS participants, on Windows and in CI on Ubuntu and Windows (`.github/workflows/demo.yml`). The Fast DDS adapter has never run against a bus, and no RTI, OpenDDS, CoreDX or OpenSplice participant has been observed by this project. The multi-vendor claim rests on the RTPS protocol guarantee, not on a recorded cross-vendor run.
100
+ - **User-topic payloads are not decoded.** `peek_dds_samples` on a user topic reports that the topic is announced on the bus and returns one placeholder sample (`_decode_status="raw"`, empty `_raw_bytes_hex`); no traffic is read. Consequently `topic_metrics` only has data for the builtin discovery topics, its observed frequency is the cadence of your own `peek_dds_samples` calls, and latency and sequence gaps are `null`. It is a discovery-layer probe, not a publish-rate monitor.
101
+ - **Cyclone vendor ids.** Participants that do not follow the RTPS vendor-id convention in their GUID prefix (Dust DDS, and RTI by default) are reported with vendor `unknown`.
102
+ - **DDS Security is not handled.** A participant without credentials sees an empty secure bus. `detect_qos_mismatches` covers Reliability, Durability, History and Deadline; Liveliness, Ownership and Partition are not checked.
103
+ - **`sample_messages` (live)** runs `ros2 topic echo --csv --once` with a short timeout; a topic with no current publisher returns an empty sample. `timestamp_ns` is the message `header.stamp` for `Header`-stamped types and `0` for headerless ones.
104
+ - **`analyze_bag` (live)** parses `ros2 bag info` text and does not use `rosbags`; anomaly detection is mock-only. `peek_bag_samples` is the only tool that reads the file itself, through `rosbags`, and is served only by the ROS2 CLI adapter or the mock. Without `ros2`, bag tools return fixtures: check `health_check` for `mode: "mock"` before trusting bag output.
105
+ - **Synchronous handlers.** The tools run on the MCP event loop; on Windows a hung `ros2` launcher can block the server.
106
+ - No streaming or push subscriptions: tools are strictly request/response.
107
+
108
+ The roadmap and the open work behind these limits are in [`docs/product-plan.md`](docs/product-plan.md).
109
+
110
+ ## Telemetry
111
+
112
+ Opt-in, anonymous and **off by default**. When off, instrumentation returns the handler unchanged: no event is built, no transport is constructed, no network code runs (pinned by `tests/test_telemetry.py::test_build_app_off_makes_no_transport_calls`).
113
+
114
+ ```bash
115
+ TOPICFORGE_TELEMETRY=on python -m topicforge
116
+ ```
117
+
118
+ On-values: `on`, `1`, `true`, `yes`, `enabled`. Off-values: unset, `off`, `0`, `false`, `no`, `disabled`. Anything else is a configuration error, not a silent "off".
119
+
120
+ When on, each tool call emits one event with exactly six fields:
121
+
122
+ | Field | Example | Notes |
123
+ | ------------ | --------------- | ----------------------------------------------------------- |
124
+ | `tool_name` | `"list_topics"` | One of the eleven tools, never argument values |
125
+ | `latency_ms` | `12.34` | Handler wall-clock duration, 2 decimals |
126
+ | `mode` | `"mock"` | Mode of the adapter actually serving: `mock` or `live` |
127
+ | `version` | `"0.5.3"` | TopicForge server version |
128
+ | `session_id` | `"a1b2c3..."` | Random UUID per process, never persisted |
129
+ | `success` | `true` | Whether the handler returned or raised |
130
+
131
+ Never sent: topic names, message types or payloads, bag paths or contents, hostnames, usernames, IP addresses, environment variables, error messages. The field set is fenced by `tests/test_telemetry.py::test_payload_contains_only_whitelisted_keys`; adding a field requires updating this section. The default transport is a structured log line, there is no HTTP endpoint yet. The implementation is in [`src/topicforge/telemetry/`](src/topicforge/telemetry/).
132
+
133
+ ## Security model
134
+
135
+ TopicForge is designed for **local trust**: it runs as a subprocess of your MCP client on a machine you control and inspects your own ROS2 graph, DDS domain and bag files. It is not hardened for adversarial inputs.
136
+
137
+ - `TOPICFORGE_ROS2_BIN` accepts an arbitrary path; treat it the way you treat `PATH`.
138
+ - `analyze_bag` and `peek_bag_samples` open whatever path the client passes (no workspace isolation, no symlink restriction).
139
+ - All `ros2` invocations use `subprocess.run` with an argument list, never `shell=True`. ROS2 topic names are validated against `^/[A-Za-z0-9_/]+$` first.
140
+ - The server loads no third-party code at startup. Until 0.5.2 it imported any installed `topicforge_pro` package; that hook was removed in 0.5.3 because it was an opening for a package of that name to add write tools.
141
+ - No outbound network calls unless telemetry is turned on.
142
+
143
+ Before exposing TopicForge to untrusted MCP clients (hosted endpoints, shared environments), add path isolation and revisit the `TOPICFORGE_ROS2_BIN` policy. Vulnerability reports: see [`SECURITY.md`](SECURITY.md).
144
+
145
+ ## Development
146
+
147
+ ```bash
148
+ git clone https://github.com/yaniswav/TopicForge.git && cd TopicForge
149
+ python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\Activate.ps1
150
+ pip install -e ".[dev]"
151
+ python -m ruff check src tests
152
+ python -m pytest
153
+ ```
154
+
155
+ Tests run against the mock adapter, the live adapter's pure parsers and the binding-free DDS helpers; they never need a running ROS graph. Tests needing the `cyclonedds` or `fastdds` binding skip themselves when it is absent, and the `integration` marker (real-bus tests) is deselected by default. The `Makefile` (`make check`) uses POSIX shell syntax; on plain PowerShell run the commands above. See [`CONTRIBUTING.md`](CONTRIBUTING.md).
156
+
157
+ ## Upgrading
158
+
159
+ TopicForge is pre-1.0 and the 0.x releases changed things freely; [`CHANGELOG.md`](CHANGELOG.md) is the record. Two points matter if you are coming from an old install. Releases 0.3.0 to 0.5.2 are yanked, so `pip install -U topicforge` resolves to 0.5.3 or later. And since 0.5.3 the `[dds-fast]`, `[dds-opendds]`, `[dds-dust]` and `[dds-all-oss]` extras no longer exist, the DDS backend values `rti`, `opensplice`, `coredx` and `intercom` are rejected, and `[dds]` and `[all]` resolve to Cyclone only. Schema changes across 0.x were additive optional fields; a client that pins a JSON Schema with `additionalProperties: false` needs to regenerate it.
160
+
161
+ ## Layout
162
+
163
+ ```
164
+ src/topicforge/
165
+ server/ MCP bootstrap, build_app(settings)
166
+ tools/ thin FastMCP handlers, no backend logic
167
+ services/ input validation, orchestration, adapter factory
168
+ adapters/ ros2_live, ros2_mock, dds_cyclone, dds_fast, common/ (binding-free logic)
169
+ models/ frozen Pydantic schemas, the contract with MCP clients
170
+ config/ settings and mode resolution
171
+ telemetry/ opt-in, off by default
172
+ examples/ mock walkthroughs (*.md) and runnable live DDS examples (dds/)
173
+ scripts/ real-bus interop checks
174
+ docs/ guides, product plan
175
+ tests/ pytest suite, mock-only, no ROS2 or DDS required
176
+ ```
177
+
178
+ Layers are strictly separated: handlers never call `subprocess`, adapters are the only code that talks to a backend, and new backends implement the `MiddlewareAdapter` protocol in `adapters/base.py`.
179
+
180
+ ## License
181
+
182
+ MIT, see [LICENSE](LICENSE). Commercial support and integration work: [`docs/pro.md`](docs/pro.md).