Implements Spec 116 baseline drift engine v1 (meta fidelity) with coverage guard, stable finding identity, and Filament UI surfaces. Highlights - Baseline capture/compare jobs and supporting services (meta contract hashing via InventoryMetaContract + DriftHasher) - Coverage proof parsing + compare partial outcome behavior - Filament pages/resources/widgets for baseline compare + drift landing improvements - Pest tests for capture/compare/coverage guard and UI start surfaces - Research report: docs/research/golden-master-baseline-drift-deep-analysis.md Validation - `vendor/bin/sail bin pint --dirty` - `vendor/bin/sail artisan test --compact --filter="Baseline"` Notes - No destructive user actions added; compare/capture remain queued jobs. - Provider registration unchanged (Laravel 11+/12 uses bootstrap/providers.php for panel providers; not touched here). Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #141
60 lines
1.7 KiB
PHP
60 lines
1.7 KiB
PHP
<?php
|
|
|
|
use App\Services\Baselines\InventoryMetaContract;
|
|
|
|
it('builds a deterministic v1 contract regardless of input ordering', function () {
|
|
$builder = app(InventoryMetaContract::class);
|
|
|
|
$a = $builder->build(
|
|
policyType: 'deviceConfiguration',
|
|
subjectExternalId: 'policy-a',
|
|
metaJsonb: [
|
|
'etag' => 'E1',
|
|
'odata_type' => '#microsoft.graph.deviceConfiguration',
|
|
'scope_tag_ids' => ['2', '1'],
|
|
'assignment_target_count' => 3,
|
|
],
|
|
);
|
|
|
|
$b = $builder->build(
|
|
policyType: 'deviceConfiguration',
|
|
subjectExternalId: 'policy-a',
|
|
metaJsonb: [
|
|
'assignment_target_count' => 3,
|
|
'scope_tag_ids' => ['1', '2'],
|
|
'odata_type' => '#microsoft.graph.deviceConfiguration',
|
|
'etag' => 'E1',
|
|
],
|
|
);
|
|
|
|
expect($a)->toBe($b);
|
|
});
|
|
|
|
it('represents missing signals as null (not omitted)', function () {
|
|
$builder = app(InventoryMetaContract::class);
|
|
|
|
$contract = $builder->build(
|
|
policyType: 'deviceConfiguration',
|
|
subjectExternalId: 'policy-a',
|
|
metaJsonb: [],
|
|
);
|
|
|
|
expect($contract)->toHaveKeys([
|
|
'version',
|
|
'policy_type',
|
|
'subject_external_id',
|
|
'odata_type',
|
|
'etag',
|
|
'scope_tag_ids',
|
|
'assignment_target_count',
|
|
]);
|
|
|
|
expect($contract['version'])->toBe(1);
|
|
expect($contract['policy_type'])->toBe('deviceConfiguration');
|
|
expect($contract['subject_external_id'])->toBe('policy-a');
|
|
expect($contract['odata_type'])->toBeNull();
|
|
expect($contract['etag'])->toBeNull();
|
|
expect($contract['scope_tag_ids'])->toBeNull();
|
|
expect($contract['assignment_target_count'])->toBeNull();
|
|
});
|