//! P6: regression guard. Native plugins must report populated decl
//! lists even though wasm plugins don't. If this test ever fails,
//! the native path has regressed and the bifurcation is no longer
//! "wasm-only" — escalate to a real fix per the rejected Option A
//! or C in
//! `docs/superpowers/specs/completed/2026-05-23-P6-document-registration-bifurcation.md`.
//!
//! See the "Native vs wasm32 registration paradigm" subsection in
//! CLAUDE.md for the documented bifurcation this guard protects.

use maat_checkers::CheckersPlugin;

#[test]
fn p6_native_checkers_manifest_has_populated_decls() {
    let manifest = CheckersPlugin::manifest();
    assert!(
        !manifest.declared_handlers.is_empty(),
        "regression: checkers declared_handlers is empty on native — \
         the linkme walker no longer finds entries; the native path \
         has drifted to the wasm32 shape. See \
         docs/superpowers/specs/completed/2026-05-23-P6-document-registration-bifurcation.md"
    );
    // `declared_types` may or may not be populated depending on whether
    // the plugin uses `#[derive(EntityType)]` directly — checkers does
    // (see plugins/games/checkers/src/lib.rs), so we assert it too.
    assert!(
        !manifest.declared_types.is_empty(),
        "regression: checkers declared_types is empty on native — \
         #[derive(EntityType)] registrations are no longer visible \
         to the #[plugin] manifest walker"
    );
}
