<?php

declare(strict_types=1);

use App\Support\Governance\GovernanceSubjectTaxonomyRegistry;
use App\Support\Governance\PlatformVocabularyGlossary;

it('resolves registry ownership descriptors from glossary metadata', function (): void {
    $glossary = app(PlatformVocabularyGlossary::class);
    $descriptor = $glossary->registry('governance_subject_taxonomy_registry');

    expect($descriptor)->not->toBeNull()
        ->and($descriptor?->boundaryClassification)->toBe(PlatformVocabularyGlossary::BOUNDARY_CROSS_DOMAIN_GOVERNANCE)
        ->and($descriptor?->ownerLayer)->toBe(PlatformVocabularyGlossary::OWNER_PLATFORM_CORE)
        ->and($descriptor?->sourceClassOrFile)->toBe(GovernanceSubjectTaxonomyRegistry::class)
        ->and($descriptor?->canonicalNouns)->toBe(['domain_key', 'subject_class', 'subject_type_key', 'subject_type_label']);
});

it('exposes contributor-facing ownership metadata from the taxonomy registry seam', function (): void {
    $descriptor = app(GovernanceSubjectTaxonomyRegistry::class)->ownershipDescriptor();

    expect($descriptor->registryKey)->toBe('governance_subject_taxonomy_registry')
        ->and($descriptor->allowedConsumers)->toContain('compare', 'snapshot', 'review')
        ->and($descriptor->compatibilityNotes)->toContain('legacy policy-type payloads');
});