openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Assert feature-gate forwarding across embed, tinyhumans and cli crates

Open senamakel opened this issue 2 months ago • 2 comments

Summary

Make scripts/ci/check-feature-forwarding.mjs assert that openhuman-embed, openhuman-tinyhumans and openhuman-cli forward the same feature-gate list, so a gate added to or removed from the core cannot silently drift in the layers above it.

Problem / Context

The core's gates are forwarded 1:1 three times: openhuman-embed → openhuman-tinyhumans → openhuman-cli (plus the desktop shell's openhuman_core line, which the script already checks). Today the script only inspects the shell manifest, so the other three lists are maintained by hand.

This bit during #6360: peripheral-rpi was removed from the core mid-flight, and openhuman-embed/openhuman-tinyhumans still forwarded it — a cargo check error (package openhuman-cli depends on openhuman with feature peripheral-rpi but openhuman does not have that feature) rather than a gate check. The inverse (a new core gate that embed forgets to forward) fails silently: the product lanes' --features "$(scripts/ci/product-features.sh)" still resolve on openhuman-cli, but the gate is off for any embedder.

Scope (optional)

  • Parse [features] of crates/openhuman-embed/Cargo.toml, crates/openhuman-tinyhumans/Cargo.toml, crates/openhuman-cli/Cargo.toml.
  • Assert: every non-default core gate is forwarded by embed as <gate> = ["openhuman-core/<gate>"]; tinyhumans forwards exactly embed's list to openhuman-embed/<gate>; cli forwards every core gate to openhuman-core/<gate> (and to openhuman-tinyhumans/<gate> where tinyhumans has it). Allow the crate-local gates (bin-tools, rss-bench-dhat, crash-reporting's extra dep:sentry) via an explicit allowlist, mirroring INTENTIONALLY_NOT_FORWARDED in scripts/lib/feature-forwarding.mjs.
  • Wire into the same CI Lite step that runs the existing check; add a node test beside scripts/__tests__/.

Acceptance criteria

  • [ ] Drift is caught — removing a gate from the core (or adding one) without touching the three forwarding lists fails node scripts/ci/check-feature-forwarding.mjs with a message naming the crate and gate.
  • [ ] Current tree passes — the check is green on main as-is.
  • [ ] Tested — a node --test case for each direction (missing forward, stale forward, allowlisted local gate).
  • [ ] Diff coverage ≥ 80% — the implementing PR meets the changed-lines coverage gate.

Related

  • #6360 (where the drift surfaced), #6362
  • scripts/lib/feature-forwarding.mjs, scripts/ci/product-features.txt

senamakel avatar Sep 19 '26 18:09 senamakel

Assert feature-gate forwarding across embed, tinyhumans and cli crates

Labelled priority: p2.

tinysweeper avatar Sep 19 '26 18:09 tinysweeper

Picking this one up. I'll extend the existing check so it also walks embed, tinyhumans and cli, with the crate-local gates allow-listed so they don't read as drift, and add tests for the missing and stale cases.

obchain avatar Sep 24 '26 12:09 obchain