TenantAtlas/specs/210-ci-matrix-budget-enforcement/contracts/ci-lane-matrix.schema.json
ahmido bf38ec1780
Some checks failed
Main Confidence / confidence (push) Failing after 3m36s
Spec 210: implement CI test matrix budget enforcement (#243)
## Summary
- add explicit Gitea workflow files for PR Fast Feedback, `dev` Confidence, Heavy Governance, and Browser lanes
- extend the repo-truth lane support seams with workflow profiles, trigger-aware budget enforcement, artifact publication contracts, CI summaries, and failure classification
- add deterministic artifact staging, new CI governance guard coverage, and Spec 210 planning/contracts/docs updates

## Validation
- `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent`
- `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Guards/CiFastFeedbackWorkflowContractTest.php tests/Feature/Guards/CiConfidenceWorkflowContractTest.php tests/Feature/Guards/CiHeavyBrowserWorkflowContractTest.php tests/Feature/Guards/CiLaneFailureClassificationContractTest.php tests/Feature/Guards/FastFeedbackLaneContractTest.php tests/Feature/Guards/ConfidenceLaneContractTest.php tests/Feature/Guards/HeavyGovernanceLaneContractTest.php tests/Feature/Guards/BrowserLaneIsolationTest.php tests/Feature/Guards/FixtureLaneImpactBudgetTest.php tests/Feature/Guards/TestLaneManifestTest.php tests/Feature/Guards/TestLaneArtifactsContractTest.php tests/Feature/Guards/TestLaneCommandContractTest.php`
- `./scripts/platform-test-lane fast-feedback`
- `./scripts/platform-test-lane confidence`
- `./scripts/platform-test-lane heavy-governance`
- `./scripts/platform-test-lane browser`
- `./scripts/platform-test-report fast-feedback`
- `./scripts/platform-test-report confidence`

## Notes
- scheduled Heavy Governance and Browser workflows stay gated behind `TENANTATLAS_ENABLE_HEAVY_GOVERNANCE_SCHEDULE=1` and `TENANTATLAS_ENABLE_BROWSER_SCHEDULE=1`
- the remaining rollout evidence task is capturing the live Gitea run set this PR enables: PR Fast Feedback, `dev` Confidence, manual and scheduled Heavy Governance, and manual and scheduled Browser runs

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #243
2026-04-17 18:04:35 +00:00

383 lines
8.4 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://tenantpilot.local/specs/210/contracts/ci-lane-matrix.schema.json",
"title": "CI Lane Matrix Contract",
"type": "object",
"additionalProperties": false,
"required": [
"version",
"mainlineBranch",
"workflowProfiles",
"laneBindings",
"budgetEnforcementProfiles",
"failureClasses"
],
"properties": {
"version": {
"type": "integer",
"minimum": 1
},
"mainlineBranch": {
"type": "string",
"minLength": 1
},
"workflowProfiles": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/workflowProfile"
}
},
"laneBindings": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/laneBinding"
}
},
"budgetEnforcementProfiles": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/budgetEnforcementProfile"
}
},
"artifactPublicationContracts": {
"type": "array",
"items": {
"$ref": "#/definitions/artifactPublicationContract"
}
},
"failureClasses": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/failureClassification"
}
}
},
"definitions": {
"workflowProfile": {
"type": "object",
"additionalProperties": false,
"required": [
"workflowId",
"filePath",
"triggerClass",
"gitEvents",
"runnerLabel",
"blockingDefault",
"laneBindings"
],
"properties": {
"workflowId": {
"type": "string",
"minLength": 1
},
"filePath": {
"type": "string",
"pattern": "^\\.gitea/workflows/.+\\.ya?ml$"
},
"triggerClass": {
"enum": [
"pull-request",
"mainline-push",
"scheduled",
"manual"
]
},
"gitEvents": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1
}
},
"branchFilters": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"runnerLabel": {
"type": "string",
"minLength": 1
},
"blockingDefault": {
"type": "boolean"
},
"scheduleCron": {
"type": [
"string",
"null"
]
},
"laneBindings": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1
}
}
}
},
"laneBinding": {
"type": "object",
"additionalProperties": false,
"required": [
"laneId",
"executionWrapper",
"reportWrapper",
"commandRef",
"governanceClass",
"requiredArtifacts"
],
"properties": {
"laneId": {
"enum": [
"fast-feedback",
"confidence",
"heavy-governance",
"browser",
"profiling",
"junit"
]
},
"executionWrapper": {
"const": "scripts/platform-test-lane"
},
"reportWrapper": {
"const": "scripts/platform-test-report"
},
"commandRef": {
"type": "string",
"minLength": 1
},
"governanceClass": {
"enum": [
"fast",
"confidence",
"heavy",
"support"
]
},
"parallelMode": {
"enum": [
"required",
"optional",
"forbidden"
]
},
"requiredArtifacts": {
"type": "array",
"minItems": 1,
"items": {
"enum": [
"summary.md",
"budget.json",
"report.json",
"junit.xml",
"profile.txt"
]
}
},
"optionalArtifacts": {
"type": "array",
"items": {
"enum": [
"summary.md",
"budget.json",
"report.json",
"junit.xml",
"profile.txt"
]
}
},
"artifactExportProfile": {
"type": "string",
"minLength": 1
}
}
},
"budgetEnforcementProfile": {
"type": "object",
"additionalProperties": false,
"required": [
"policyId",
"laneId",
"triggerClass",
"thresholdSource",
"baseThresholdSeconds",
"varianceAllowanceSeconds",
"effectiveThresholdSeconds",
"enforcementMode",
"lifecycleState"
],
"properties": {
"policyId": {
"type": "string",
"minLength": 1
},
"laneId": {
"type": "string",
"minLength": 1
},
"triggerClass": {
"enum": [
"pull-request",
"mainline-push",
"scheduled",
"manual"
]
},
"thresholdSource": {
"enum": [
"lane-budget",
"governance-contract"
]
},
"baseThresholdSeconds": {
"type": "number",
"minimum": 0
},
"varianceAllowanceSeconds": {
"type": "number",
"minimum": 0
},
"effectiveThresholdSeconds": {
"type": "number",
"minimum": 0
},
"enforcementMode": {
"enum": [
"hard-fail",
"soft-warn",
"trend-only"
]
},
"lifecycleState": {
"type": "string",
"minLength": 1
},
"reviewCadence": {
"type": "string"
}
}
},
"artifactPublicationContract": {
"type": "object",
"additionalProperties": false,
"required": [
"contractId",
"laneId",
"sourceDirectory",
"requiredFiles",
"stagingDirectory",
"stagedNamePattern",
"uploadGroupName"
],
"properties": {
"contractId": {
"type": "string",
"minLength": 1
},
"laneId": {
"type": "string",
"minLength": 1
},
"sourceDirectory": {
"const": "storage/logs/test-lanes"
},
"sourcePatterns": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"requiredFiles": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1
}
},
"optionalFiles": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"stagingDirectory": {
"type": "string",
"minLength": 1
},
"stagedNamePattern": {
"type": "string",
"minLength": 1
},
"uploadGroupName": {
"type": "string",
"minLength": 1
},
"retentionClass": {
"enum": [
"pr-short",
"mainline-medium",
"scheduled-medium"
]
}
}
},
"failureClassification": {
"type": "object",
"additionalProperties": false,
"required": [
"failureClassId",
"sourceStep",
"blockingOn",
"summaryLabel",
"remediationHint"
],
"properties": {
"failureClassId": {
"enum": [
"test-failure",
"wrapper-failure",
"budget-breach",
"artifact-publication-failure",
"infrastructure-failure"
]
},
"sourceStep": {
"type": "string",
"minLength": 1
},
"blockingOn": {
"type": "array",
"items": {
"enum": [
"pull-request",
"mainline-push",
"scheduled",
"manual"
]
}
},
"summaryLabel": {
"type": "string",
"minLength": 1
},
"remediationHint": {
"type": "string",
"minLength": 1
}
}
}
}
}