Some checks failed
Main Confidence / confidence (push) Failing after 46s
## Summary - implement Spec 211 runtime trend reporting with bounded lane history, drift classification, hotspot trend output, and recalibration evidence handling - extend the repo-truth governance seams and workflow wrappers for comparable-bundle hydration, trend artifact publication, and contract-backed reporting - add the Spec 211 planning artifacts, data model, quickstart, tasks, and repository contract documents ## Validation - parsed `specs/211-runtime-trend-recalibration/contracts/test-runtime-trend-history.schema.json` - parsed `specs/211-runtime-trend-recalibration/contracts/test-runtime-trend.logical.openapi.yaml` - re-ran cross-artifact consistency analysis for the Spec 211 artifact set until no material findings remained - no application test suite was re-run as part of this final commit/push/PR step Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #244
72 lines
3.5 KiB
PHP
72 lines
3.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Symfony\Component\Yaml\Yaml;
|
|
use Tests\Support\TestLaneTrendFixtures;
|
|
|
|
it('keeps the logical OpenAPI contract synchronized with the generated trend assessment vocabulary', function (): void {
|
|
$contractPath = repo_path('specs/211-runtime-trend-recalibration/contracts/test-runtime-trend.logical.openapi.yaml');
|
|
$artifactDirectory = TestLaneTrendFixtures::artifactDirectory('trend-logical-contract');
|
|
$report = TestLaneTrendFixtures::buildReport(
|
|
laneId: 'confidence',
|
|
wallClockSeconds: 438.1,
|
|
durationsByFile: [
|
|
'tests/Feature/Baselines/BaselineCompareMatrixCompareAllActionTest.php' => 22.8,
|
|
'tests/Feature/Baselines/BaselineCompareMatrixBuilderTest.php' => 19.4,
|
|
'tests/Feature/Rbac/OnboardingWizardUiEnforcementTest.php' => 17.6,
|
|
],
|
|
artifactDirectory: $artifactDirectory,
|
|
ciContext: [
|
|
'workflowId' => 'main-confidence',
|
|
'triggerClass' => 'mainline-push',
|
|
'entryPointResolved' => true,
|
|
'workflowLaneMatched' => true,
|
|
],
|
|
);
|
|
|
|
/** @var array<string, mixed> $contract */
|
|
$contract = Yaml::parseFile($contractPath);
|
|
$paths = $contract['paths'] ?? [];
|
|
$schemas = $contract['components']['schemas'] ?? [];
|
|
$assessment = $report['trendCurrentAssessment'];
|
|
$decision = $report['trendRecalibrationDecisions'][0] ?? null;
|
|
|
|
expect(array_keys($paths))->toEqualCanonicalizing([
|
|
'/test-governance/lanes/{laneId}/trend-history',
|
|
'/test-governance/lanes/{laneId}/trend-assessment',
|
|
'/test-governance/lanes/{laneId}/recalibration',
|
|
'/test-governance/cycles/{cycleId}/summary',
|
|
])
|
|
->and($paths['/test-governance/lanes/{laneId}/trend-history']['post']['operationId'])->toBe('updateLaneTrendHistory')
|
|
->and($paths['/test-governance/lanes/{laneId}/trend-assessment']['post']['operationId'])->toBe('evaluateLaneTrendAssessment')
|
|
->and($paths['/test-governance/lanes/{laneId}/recalibration']['post']['operationId'])->toBe('evaluateLaneRecalibration')
|
|
->and($paths['/test-governance/cycles/{cycleId}/summary']['get']['operationId'])->toBe('getTrendSummaryCycle')
|
|
->and($schemas['DriftAssessment']['properties']['healthClass']['enum'])->toEqualCanonicalizing([
|
|
'healthy',
|
|
'budget-near',
|
|
'trending-worse',
|
|
'regressed',
|
|
'unstable',
|
|
])
|
|
->and($schemas['DriftAssessment']['properties']['recalibrationRecommendation']['enum'])->toEqualCanonicalizing([
|
|
'none',
|
|
'investigate',
|
|
'review-baseline',
|
|
'review-budget',
|
|
])
|
|
->and($schemas['RecalibrationDecision']['properties']['decisionStatus']['enum'])->toEqualCanonicalizing([
|
|
'candidate',
|
|
'approved',
|
|
'rejected',
|
|
])
|
|
->and($schemas['LaneTrendHistoryArtifact']['required'])->toContain('schemaVersion', 'policy', 'history', 'currentAssessment')
|
|
->and($assessment['healthClass'])->toBeIn($schemas['DriftAssessment']['properties']['healthClass']['enum'])
|
|
->and($assessment['recalibrationRecommendation'])->toBeIn($schemas['DriftAssessment']['properties']['recalibrationRecommendation']['enum']);
|
|
|
|
if (is_array($decision)) {
|
|
expect($decision['decisionStatus'])->toBeIn($schemas['RecalibrationDecision']['properties']['decisionStatus']['enum'])
|
|
->and($decision['targetType'])->toBeIn($schemas['RecalibrationDecision']['properties']['targetType']['enum']);
|
|
}
|
|
});
|