wifi-densepose/v2/crates/wifi-densepose-bfld/tests
ruv a7ccac7869 feat(adr-118/p1.9): PrivacyClass capability-helper truth tables (279/279 GREEN)
Iter 41. Pins the const-helper API (PrivacyClass::allows_network /
allows_matter) and proves it stays in sync with the Sink::MIN_CLASS
trait-level enforcement. Drift between these two APIs would be a
silent correctness bug — an operator checking allows_network() might
get a different answer than the actual NetworkSink::check_class()
runtime gate.

Added (in tests/privacy_class_capability.rs, no_std-compatible):
- 10 named tests, all green:

  allows_network_truth_table     (4 classes × bool)
  allows_matter_truth_table      (4 classes × bool)
  allows_matter_implies_allows_network
    Monotonicity: Matter is a strict subset of Network. Any class
    that allows Matter MUST allow Network. The reverse is not true
    (Derived is Network-eligible but not Matter-eligible).
  allows_network_strictly_excludes_raw
    Class 0 is the ONLY class that fails allows_network. Any future
    refactor that lets Raw cross a NetworkSink violates ADR-118 I1.
  allows_matter_strictly_requires_class_two_or_three
  local_sink_accepts_every_class_per_helper
    Cross-consistency: LocalSink::MIN_CLASS = Raw, accepts all.
  network_sink_consistency_matches_allows_network
    For every class, check_class<NetworkKind> agrees with allows_network().
  matter_sink_consistency_matches_allows_matter
    Same for Matter.
  as_u8_returns_documented_byte_values    (0, 1, 2, 3)
  class_byte_ordering_matches_information_density  (raw < derived < anon < restr)

Helper:
  check_consistency<S: Sink>(class, helper_says_allowed) compares the
  Boolean helper against (class_byte >= S::MIN_CLASS.as_u8()) and asserts
  equality. Catches drift before it reaches operator-visible behavior.

ADR-124 status (iter step 0 sibling check):
- docs/adr/ADR-124-rvagent-mcp-ruvector-npm-integration.md unchanged
  at 431 lines. SENSE-BRIDGE scope remains orthogonal.

ACs progressed:
- ADR-118 invariant I1 reinforced at the const-helper layer: a future
  PR refactoring PrivacyClass::Raw to be Network-eligible breaks 4 of
  the 10 tests (truth table + monotonicity + Raw exclusion + sink
  consistency), so the regression is loud rather than silent.
- ADR-120 §2.2 sink-class contract pinned at the helper layer. The
  iter 3 (Sink + check_class) and iter 1 (allows_network) APIs now
  have a regression test enforcing their agreement.

Test config:
- cargo test --no-default-features → 90 passed (+10 no_std-compat)
- cargo test                       → 279 passed (269 + 10)

Out of scope (next iter target):
- PR-readiness pivot remains the genuine next step: CHANGELOG batch,
  witness bundle regeneration, AC closeout table. All ADR-118/119/120/
  121/122 ACs are now empirically covered. External-resource-gated
  work (KIT BFId, Pi5/Nexmon hardware) stays skipped.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-05-24 19:18:11 -04:00
..
availability_topic.rs feat(adr-118/p5.8): availability topic + LWT integration (203/203 GREEN) 2026-05-24 17:57:55 -04:00
ci_workflow.rs feat(adr-118/p6.5): GitHub Actions mosquitto Docker CI workflow (235/235 GREEN) 2026-05-24 18:49:49 -04:00
coherence_gate.rs feat(adr-118/p3.3): CoherenceGate hysteresis + 5s debounce — 85/85 GREEN 2026-05-24 15:07:40 -04:00
crc32_polynomial.rs feat(adr-118/p1.8): CRC-32/ISO-HDLC polynomial pinning (262/262 GREEN) 2026-05-24 19:08:38 -04:00
embedding_ring.rs feat(adr-118/p2.2): EmbeddingRing 64-entry FIFO buffer — 53/53 GREEN 2026-05-24 14:37:03 -04:00
emitter_hasher.rs feat(adr-118/p4.3): wire SignatureHasher into BfldEmitter (123/123 GREEN) 2026-05-24 15:57:44 -04:00
emitter_pipeline.rs feat(adr-118/p4.2): BfldEmitter end-to-end pipeline (109/109 GREEN) 2026-05-24 15:37:23 -04:00
event_gating_irreversibility.rs feat(adr-118/p6.7): apply_privacy_gating irreversibility tests (255/255 GREEN) 2026-05-24 19:04:00 -04:00
event_privacy_gating.rs feat(adr-118/p4.1): BfldEvent privacy-gated output + JSON (102/102 GREEN) 2026-05-24 15:27:49 -04:00
frame_header_size.rs feat(adr-118/p1): scaffold wifi-densepose-bfld crate + frame header (3/3 tests GREEN) 2026-05-24 13:34:05 -04:00
frame_payload_integration.rs feat(adr-118/p1.6): BfldFrame <-> BfldPayload wire integration (39/39 GREEN) 2026-05-24 14:16:54 -04:00
frame_roundtrip.rs feat(adr-118/p1.4): BfldFrame (header + payload + CRC32) — 24/24 GREEN 2026-05-24 13:58:26 -04:00
ha_blueprints.rs feat(adr-118/p5.10): three HA operator blueprints (210/210 GREEN) 2026-05-24 18:17:41 -04:00
ha_discovery.rs feat(adr-118/p5.6): HA auto-discovery payload publisher (187/187 GREEN) 2026-05-24 17:37:26 -04:00
ha_discovery_publish.rs feat(adr-118/p5.7): publish_discovery bootstrap helper (193/193 GREEN) 2026-05-24 17:47:17 -04:00
handle_soul_oracle.rs feat(adr-118/p6.4): spawn_with_oracle for Soul Signature deployments (227/227 GREEN) 2026-05-24 18:45:54 -04:00
header_roundtrip.rs feat(adr-118/p1.2): header encode/decode + 6 round-trip tests (9/9 GREEN) 2026-05-24 13:38:11 -04:00
identity_embedding.rs feat(adr-118/p2.1): IdentityEmbedding newtype + zeroizing Drop — 44/44 GREEN 2026-05-24 14:27:28 -04:00
identity_features_encoder.rs feat(adr-118/p3.6): IdentityFeatures canonical-bytes encoder (137/137 GREEN) 2026-05-24 16:18:33 -04:00
identity_risk_score.rs feat(adr-118/p3.2): identity_risk score + GateAction enum — 72/72 GREEN 2026-05-24 14:57:08 -04:00
json_hash_format.rs feat(adr-118/p4.4): rf_signature_hash JSON as "blake3:<hex>" (128/128 GREEN) 2026-05-24 16:08:29 -04:00
mosquitto_integration.rs feat(adr-118/p5.4): mosquitto integration test (env-gated, 178/178 with mqtt) 2026-05-24 17:17:38 -04:00
motion_publish_rate.rs feat(adr-118/p6.3): motion publish rate ≥ 1Hz integration test (ADR-122 AC3) — 224/224 GREEN 2026-05-24 18:39:58 -04:00
mqtt_publish_loop.rs feat(adr-118/p5.2): Publish trait + publish_event free function — 169/169 GREEN 2026-05-24 16:57:05 -04:00
mqtt_topic_routing.rs feat(adr-118/p5.1): MQTT topic router (BfldEvent → Vec<TopicMessage>) — 162/162 GREEN 2026-05-24 16:47:11 -04:00
payload_sections.rs feat(adr-118/p1.5): payload section parser (BfldPayload) — 32/32 GREEN 2026-05-24 14:07:14 -04:00
pipeline_determinism.rs feat(adr-118/p6.6): pipeline event-stream JSON determinism (248/248 GREEN) 2026-05-24 18:59:29 -04:00
pipeline_facade.rs feat(adr-118/p4.5): BfldPipeline facade + BfldConfig (146/146 GREEN) 2026-05-24 16:28:42 -04:00
pipeline_gate_observability.rs feat(adr-118/p6.8): pipeline gate-state observability (269/269 GREEN) 2026-05-24 19:13:17 -04:00
pipeline_handle_worker.rs feat(adr-118/p5.5): BfldPipelineHandle worker thread (177/177 GREEN) 2026-05-24 17:27:48 -04:00
pipeline_i3_isolation.rs feat(adr-118/p6.1): end-to-end I3 isolation proof via BfldPipeline (217/217 GREEN) 2026-05-24 18:32:01 -04:00
pipeline_to_frame.rs feat(adr-118/p4.6): BfldPipeline::process_to_frame wire-bytes path (152/152 GREEN) 2026-05-24 16:37:11 -04:00
privacy_class_capability.rs feat(adr-118/p1.9): PrivacyClass capability-helper truth tables (279/279 GREEN) 2026-05-24 19:18:11 -04:00
privacy_gate_demote.rs feat(adr-118/p3.1): PrivacyGate::demote monotonic class transformer (60/60 GREEN) 2026-05-24 14:48:01 -04:00
reserved_flags.rs feat(adr-118/p1.7): reserved-flag-bits forward-compat (243/243 GREEN) 2026-05-24 18:55:04 -04:00
rumqttc_lwt.rs feat(adr-118/p5.9): RumqttPublisher::connect_with_lwt — broker auto-publishes "offline" (220/220 GREEN with mqtt) 2026-05-24 18:08:59 -04:00
rumqttc_publisher_smoke.rs feat(adr-118/p5.3): RumqttPublisher behind mqtt feature gate (176/176 GREEN with mqtt) 2026-05-24 17:09:05 -04:00
serialization_throughput.rs feat(adr-118/p6.2): serialization throughput test (ADR-119 AC7) — 221/221 GREEN 2026-05-24 18:35:48 -04:00
signature_hasher.rs feat(adr-118/p3.5): SignatureHasher (BLAKE3-keyed) — 117/117 GREEN 2026-05-24 15:47:21 -04:00
sink_enforcement.rs feat(adr-118/p1.3): Sink marker traits + PrivacyClass::try_from (17/17 GREEN) 2026-05-24 13:43:05 -04:00
soul_match_oracle.rs feat(adr-118/p3.4): SoulMatchOracle + Recalibrate exemption (93/93 GREEN) 2026-05-24 15:17:24 -04:00