Files
ruvnet--RuView/v2/crates/wifi-densepose-bfld/tests/changelog_entry.rs
T
ruv cbb365729f docs(adr-118): CHANGELOG [Unreleased] BFLD entry + validation test (332/332 GREEN)
Iter 50. PR-readiness pivot iter #1. Lands the BFLD entry under
CHANGELOG.md's [Unreleased] section per the project's pre-merge
checklist (CLAUDE.md). Plus a validation test that catches drift if
someone edits the entry and breaks the operator-facing summary.

Added (in CHANGELOG.md):
- New top-of-[Unreleased]-Added bullet for BFLD spanning:
  * ADR-118 umbrella + invariants I1/I2/I3 + their enforcement
    mechanism (Sink traits / Drop+no-Serialize / per-site BLAKE3)
  * ADR-119 frame format (86-byte header, payload sections, CRC32)
  * ADR-120 privacy classes + PrivacyGate::demote + apply_privacy_gating
  * ADR-121 multiplicative risk score + CoherenceGate + SoulMatchOracle
  * ADR-122 MQTT topic router + HA discovery + availability + LWT
  * ADR-123 capture path (reference; production capture is Pi5/Nexmon
    hardware-gated and remains skipped)
  * BfldPipelineHandle worker + spawn_with_oracle for Soul Signature
  * 3 operator HA blueprints (presence-lighting / motion-HVAC /
    identity-risk-anomaly)
  * Two runnable examples (bfld_minimal, bfld_handle)
  * eclipse-mosquitto:2 CI service container workflow
  * Performance measurements: 320k frames/sec, p95 0.9µs, 9.96 Hz
  * 327 default-feature tests, 101 no_std-compatible, 220+ with mqtt
  * Companion research dossier docs/research/BFLD/ (11 files, 13,544 words)
  * try-it command: cargo run -p wifi-densepose-bfld --example bfld_handle

Added (in tests/changelog_entry.rs, 5 tests):
- changelog_documents_bfld_entry_under_unreleased
    Slices CHANGELOG from `## [Unreleased]` to the first numbered
    version header and asserts the block contains BFLD,
    wifi-densepose-bfld, and the #787 tracking link.
- changelog_bfld_entry_cites_companion_adrs
    Substring asserts ADR-118..123 each appear at least once.
- changelog_bfld_entry_names_three_structural_invariants
    **I1**, **I2**, **I3** must be called out by name.
- changelog_bfld_entry_documents_a_runnable_example
    Operators get a copy-pasteable cargo command.
- changelog_bfld_entry_references_research_bundle

Caught + fixed during iter:
- First draft used "ADR-118 through ADR-123" shorthand; the
  per-ADR substring test fired for ADR-120 (not literally present).
  Re-wrote the parenthetical to "ADR-118 umbrella + ADR-119 frame
  format + ADR-120 privacy class + ADR-121 identity risk scoring +
  ADR-122 RuView HA/Matter exposure + ADR-123 capture path" so each
  ADR number is its own grep-discoverable token.

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:
- Pre-merge checklist item #5 (CLAUDE.md) — CHANGELOG `[Unreleased]`
  entry shipped. PR description can now link to the line + commit
  range as evidence.

Test config:
- cargo test --no-default-features → 101 passed (changelog_entry cfg-out)
- cargo test                       → 332 passed (327 + 5)

Out of scope (next iter target):
- Pre-merge checklist remaining: README.md update (#3 — points at the
  new crate from the workspace level), user-guide.md (#6), witness
  bundle regeneration (#8). External-resource-gated work (KIT BFId,
  Pi5/Nexmon) still skipped.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-05-24 20:03:01 -04:00

64 lines
2.1 KiB
Rust

//! Validate the BFLD entry exists in the workspace-root CHANGELOG.md.
//! `cog-ha-matter`, `wifi-densepose-sensing-server`, and the pip wheel
//! ship under their own release cadence; the workspace CHANGELOG is the
//! one canonical record an operator scans when upgrading a Cognitum Seed.
#![cfg(feature = "std")]
const CHANGELOG: &str = include_str!("../../../../CHANGELOG.md");
#[test]
fn changelog_documents_bfld_entry_under_unreleased() {
// Find the position of the [Unreleased] header.
let unreleased = CHANGELOG
.find("## [Unreleased]")
.expect("CHANGELOG must have an [Unreleased] section");
// The first numbered version header marks the end of [Unreleased].
let after_unreleased = CHANGELOG[unreleased..]
.find("\n## [0")
.or_else(|| CHANGELOG[unreleased..].find("\n## [1"))
.map(|off| unreleased + off)
.unwrap_or(CHANGELOG.len());
let unreleased_block = &CHANGELOG[unreleased..after_unreleased];
assert!(
unreleased_block.contains("BFLD"),
"[Unreleased] must mention BFLD",
);
assert!(unreleased_block.contains("wifi-densepose-bfld"));
assert!(
unreleased_block.contains("#787"),
"[Unreleased] BFLD entry must link tracking issue #787",
);
}
#[test]
fn changelog_bfld_entry_cites_companion_adrs() {
for adr in ["ADR-118", "ADR-119", "ADR-120", "ADR-121", "ADR-122", "ADR-123"] {
assert!(
CHANGELOG.contains(adr),
"CHANGELOG BFLD entry must cite {adr}",
);
}
}
#[test]
fn changelog_bfld_entry_names_three_structural_invariants() {
let needles = ["**I1**", "**I2**", "**I3**"];
for n in needles {
assert!(CHANGELOG.contains(n), "CHANGELOG must call out invariant {n}");
}
}
#[test]
fn changelog_bfld_entry_documents_a_runnable_example() {
assert!(
CHANGELOG.contains("cargo run -p wifi-densepose-bfld --example"),
"CHANGELOG entry should give operators a copy-pasteable try-it command",
);
}
#[test]
fn changelog_bfld_entry_references_research_bundle() {
assert!(CHANGELOG.contains("docs/research/BFLD/"));
}