Skip to content

Share the telemetry-consent test harness between wxc_common and mxc_ffi #690

Closed

Description

@RamonArjona4

Description of the task

src/ffi/mxc_ffi/src/lib.rs carries its own copy of the telemetry-consent test harness — a CONSENT_ENV_LOCK mutex and a LocalAppDataGuard that redirects the consent store to a temp directory — duplicating the equivalent harness in src/core/wxc_common/src/telemetry/consent.rs.

This is structural rather than an oversight: wxc_common::telemetry::consent::test_support is #[cfg(test)] pub(crate), so it is not compiled into wxc_common when that crate is built as a dependency, and mxc_ffi therefore cannot reference it.

Sharing it requires exposing the harness behind a cargo feature:

  1. Add a test-support feature to wxc_common.
  2. Gate telemetry::consent::test_support on #[cfg(any(test, feature = "test-support"))] and make it pub rather than pub(crate).
  3. Add wxc_common = { workspace = true, features = ["test-support"] } to mxc_ffi's [dev-dependencies].
  4. Delete the duplicate harness from mxc_ffi and re-point its consent tests at the shared one.

The feature must stay off by default so the harness never reaches a shipping build.

Additional context

Raised as a Low finding during the adversarial review of the telemetry consent work, and noted again in docs/telemetry/telemetry-consent-design.md §12 under "Known gaps". Test-only scaffolding, no shipped behavior at risk — but it is duplicated logic across crates, which the consent work otherwise set out to eliminate.

Activity

  1. added
    Needs-TriageHas not yet been reviewed, classified, and routed.
    Issue-TaskEngineering, maintenance, or operational work that is not a bug or feature request.
    on Jul 27, 2026
  2. added
    Area-Rust-SDKPublic Rust SDK APIs and integration with the MXC execution engine.
    on Jul 27, 2026
  3. github-actions commented on Jul 27, 2026

    @github-actions

    Triage complete.

    • Labels applied: Area-Build-Rust
    • Assigned: @bbonaby (Rust build)

    This is a Rust refactoring task to expose wxc_common's telemetry-consent test harness behind a test-support cargo feature so mxc_ffi can share it instead of duplicating it. Needs-Triage has been removed.

    Generated by 🏷️ Issue Triage for #690 · 23.7 AIC · ⌖ 5.59 AIC · ⊞ 6.4K · ◷

  4. RamonArjona4 commented on Sep 22, 2026

    @RamonArjona4
    MemberAuthor

    Addressed by the landed telemetry stack. PR #819 added the opt-in wxc_common/test-support feature, and PR #821 exposed the shared wxc_common::telemetry::test_support::TelemetryTestEnv, enabled it for mxc_ffi dev tests, and redirected the FFI consent tests to that shared harness. The remaining local FFI wrapper only owns the temporary directory; it no longer duplicates the consent lock or LocalAppDataGuard.

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

Metadata

Metadata

Assignees

Labels

Area-Rust-SDKPublic Rust SDK APIs and integration with the MXC execution engine.Issue-TaskEngineering, maintenance, or operational work that is not a bug or feature request.

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions