-
Notifications
You must be signed in to change notification settings - Fork 0
feat(operability): add bounded control-plane SLI receipts #905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
.github/workflows/control-plane-sli-receipt-quality-ci.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: Control Plane SLI Receipt Quality CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - ".github/workflows/control-plane-sli-receipt-quality-ci.yml" | ||
| - "scripts/ci/control_plane_sli_receipt.py" | ||
| - "tests/test_control_plane_sli_receipt.py" | ||
| - "docs/doctoring/control-plane-sli-receipts.md" | ||
| - "CHANGELOG.md" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: control-plane-sli-receipt-quality-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| exact-head-quality: | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 20 | ||
| steps: | ||
| - name: Checkout exact source revision | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Python 3.14 | ||
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | ||
| with: | ||
| python-version: "3.14" | ||
|
|
||
| - name: Install hash-locked repository quality tooling | ||
| shell: bash --noprofile --norc -e -o pipefail {0} | ||
| run: >- | ||
| python -m pip install --disable-pip-version-check --require-hashes | ||
| -r requirements-opencode-review-ci-hashes.txt | ||
|
|
||
| - name: Run focused SLI receipt tests with complete branch coverage | ||
| shell: bash --noprofile --norc -e -o pipefail {0} | ||
| run: | | ||
| test "$(git rev-parse HEAD)" = "${{ github.event.pull_request.head.sha || github.sha }}" | ||
| python -m coverage erase | ||
| python -m coverage run --branch --source=scripts.ci.control_plane_sli_receipt \ | ||
| -m pytest tests/test_control_plane_sli_receipt.py -q | ||
| python -m coverage report --show-missing --fail-under=100 | ||
|
|
||
| - name: Enforce public docstrings and compilation | ||
| shell: bash --noprofile --norc -e -o pipefail {0} | ||
| run: | | ||
| python -m interrogate --fail-under 100 --ignore-init-method \ | ||
| scripts/ci/control_plane_sli_receipt.py | ||
| python -m compileall -q \ | ||
| scripts/ci/control_plane_sli_receipt.py \ | ||
| tests/test_control_plane_sli_receipt.py | ||
|
|
||
| - name: Run complete central test suite | ||
| shell: bash --noprofile --norc -e -o pipefail {0} | ||
| run: python -m pytest tests -q | ||
|
|
||
| - name: Verify clean patch | ||
| shell: bash --noprofile --norc -e -o pipefail {0} | ||
| run: git diff --check | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Bounded control-plane SLI receipts | ||
|
|
||
| ## Decision | ||
|
|
||
| `scripts/ci/control_plane_sli_receipt.py` builds one canonical | ||
| `cwl.control-plane-sli/v1` receipt from a local, finite-cardinality evidence | ||
| document. The builder does not query GitHub, interpret reviews, or acquire | ||
| mutation authority. Unknown fields, duplicate JSON members, non-finite | ||
| numbers, unbounded arrays, impossible recovery counts, and out-of-order or | ||
| future timestamps fail closed. | ||
|
|
||
| Receipts are operator evidence: they tell a buyer whether the org control | ||
| plane is executable now, deferred for a named wait reason, or carrying | ||
| operational-acceptance debt. They are not merge authority. | ||
|
|
||
| ## Why the boundary exists | ||
|
|
||
| A commercial operator cannot see queue health from GitHub check rollups | ||
| alone. Waiting on review or Checks is not a coding stop, but the wait must | ||
| be named and aged. An unbounded or authority-bearing collector would turn | ||
| that observability surface into a second control plane. | ||
|
|
||
| CWE-807 (reliance on untrusted inputs in a security decision) is the | ||
| rejection reason for treating a receipt as merge or writer authority | ||
| (MITRE, 2026). Timestamps are canonical whole-second UTC RFC 3339 values | ||
| ending in `Z` (Internet Engineering Task Force, 2002). | ||
|
|
||
| ## Trust-boundary sequence | ||
|
|
||
| ```mermaid | ||
| flowchart LR | ||
| A["Local finite evidence JSON"] --> B["Strict load: no NaN, no duplicate keys"] | ||
| B --> C["Field, regex, and cardinality guards"] | ||
| C --> D["Age, retry, transition, redirection aggregates"] | ||
| D --> E["Canonical cwl.control-plane-sli/v1 JSON"] | ||
| ``` | ||
|
|
||
| Each arrow is fail-closed. A later stage does not repair an earlier | ||
| rejection. | ||
|
|
||
| ## Verification contract | ||
|
|
||
| `tests/test_control_plane_sli_receipt.py` exercises a two-repository fixture, | ||
| strict JSON boundaries, impossible premature-stop recovery counts, and | ||
| timestamp canonicalization. The permanent quality workflow runs that suite | ||
| with 100% branch coverage, interrogate, compileall, and the full central | ||
| test suite on the exact pull-request head. | ||
|
|
||
| ## References | ||
|
|
||
| Internet Engineering Task Force. (2002). *Date and time on the Internet: | ||
| Timestamps* (RFC 3339). https://www.rfc-editor.org/rfc/rfc3339 | ||
|
|
||
| MITRE. (2026). *CWE-807: Reliance on untrusted inputs in a security | ||
| decision*. https://cwe.mitre.org/data/definitions/807.html |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ADR-only edits to
AGENTS.md,ARCHITECTURE.md, andCLAUDE.mddo not retrigger this exact-head gate. Add those paths plus the quality-workflow contract test so a documentation-only honesty change still produces current-head evidence.