Skip to content

fix(ci): isolate ratchet and scaling execution budgets - #3347

Merged
Daniel Meppiel (danielmeppiel) merged 2 commits into
mainfrom
danielmeppiel-ci-ratchet-budgets
Oct 22, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 2 commits into
mainfrom
danielmeppiel-ci-ratchet-budgets

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Description

fix(ci): isolate ratchet and scaling execution budgets

TL;DR

Run the existing architecture-contract selection and real scaling benchmark in separate Linux jobs, each retaining its five-minute limit. Keep Test Architecture Ratchets as an always-running aggregate that succeeds only when both executions succeed. This repairs a demonstrated job-budget cancellation without changing test selection, scaling thresholds, provisional-baseline policy or required-check membership.

Important

This is a bounded CI scheduling repair, not release authorization. The ratchet check is not currently listed in merge-gate.yml's EXPECTED_CHECKS; this PR preserves that membership rather than adding a new policy gate.

Problem (WHY)

  • At exact 7246bc54d7931d1342bbe151acdac33d21cd1eba, job 119772530067 was cancelled after 302 seconds. Its annotation states: The job has exceeded the maximum execution time of 5m0s.
  • The same job printed 153 passed in 164.96s and 1 passed in 113.07s. Those executions shared one five-minute setup-to-cleanup budget. All listed steps reported success, but the job was cancelled; passing test summaries do not turn that cancellation into a passing CI run.
  • [!] A split must retain both real workloads and reject missing, skipped, failed or cancelled results. The new tests therefore execute the actual aggregate shell and mutate its workflow inputs, rather than treating a syntactically valid YAML edit as scheduling proof.

The recovery follows the Agent Skills validation-loop guidance: "do the work, run a validator (a script, a reference checklist, or a self-check), fix any issues, and repeat until validation passes." The linked run is the observed failure; local contracts and the unchanged benchmark are evidence layers, not a substitute for the new head's hosted results.

Approach (WHAT)

  • Move the unchanged six-module contract command into test-architecture-contracts.
  • Move the unchanged real benchmark command into test-architecture-scaling.
  • Preserve Ubuntu 24.04, Python 3.12, frozen dependency setup, contents-read permissions, five-minute execution caps and both original step environments.
  • Retain the original emitted aggregate name, with always() and both explicit dependencies; only two literal success results permit exit zero.
  • Keep the real benchmark, merge-gate policy, lifecycle workflow and all application code unchanged.

Implementation (HOW)

File Change and boundary
.github/workflows/ci.yml Gives each existing workload its own setup-to-cleanup budget. The aggregate has no checkout, no token permissions and a one-minute limit.
tests/quality/test_ci_topology.py Keeps the original inventory and draft-provisional guards; adds source/environment/selection/cap and aggregate mutation controls. A shared test-only helper executes all 36 result pairs, including actually absent variables. Existing lifecycle assertions reuse it without changing lifecycle workflow behavior.
docs/src/content/docs/contributing/integration-testing.md Explains the independent limits, strict aggregate and unchanged non-required status. No new CLI surface, guide-resource contract, README claim or TOC change.

Diagrams

Legend: the highlighted region separates the two existing executions and joins their actual results; it does not change required-check membership.

sequenceDiagram
    participant W as ci.yml
    participant C as Architecture Ratchet Contracts
    participant S as Architecture Scaling (Linux)
    participant G as Test Architecture Ratchets
    rect rgb(255, 247, 200)
        Note over W,G: NEW: independent jobs, unchanged workloads and five-minute caps
        par Contracts execution
            W->>C: Checkout current source and frozen setup
            C->>C: Run original six-module pytest selection
        and Scaling execution
            W->>S: Checkout current source and frozen setup
            S->>S: Run real benchmark with PYTEST_PERF=1
        end
        C-->>G: CONTRACT_RESULT
        S-->>G: SCALING_RESULT
        Note over G: always() after both jobs
        alt Both results are literal success
            G->>G: Exit 0
        else Failure, cancellation, skip or missing result
            G->>G: Print diagnostic and exit 1
        end
    end
    Note over W,G: merge-gate.yml membership remains unchanged
Loading

Trade-offs

  • Two setup executions consume more runner work than one combined job. The limits and workloads remain unchanged instead of extending a timeout or removing the benchmark.
  • The aggregate preserves the existing diagnostic signal; adding it to mandatory branch policy would be a separate decision, not an incidental CI repair.
  • Workflow-contract tests execute the real shell but cannot establish hosted runner timing. The actual new-head contract, scaling and aggregate jobs must succeed before a ready-to-land handoff.

Benefits

  1. Each existing workload receives a separate five-minute budget, including setup and cleanup.
  2. Every one of the original 153 contract cases is retained; the qualified selection has 188 unique passing cases, including 35 new guards.
  3. Only one of the 36 result combinations permits aggregate success; failure suppression and ignoring either execution are rejected.

Issue and approved scope

Issue: none, under the user's explicit task-specific CI-recovery exception.

Human scope-approval comment: the user instructed, "you do it, and do not mandate for these fixes to require an issue and approval, it's not needed. get CI working ASAP". The coordinator subsequently directed a separate issue-less carrier for this observed scheduling defect, with the same sole writer and an actual-public-main base. This records the exception honestly; it is not a fabricated accepted issue, governance-admission pass or ruleset bypass.

This PR addresses only the architecture job-budget cancellation. The broader main-CI and non-publishing release-validation mission remains open. It does not expand the existing test-contract carrier #3343 / issue #3342, rewrite landed #3345, take #3344's receipt scope, or claim completion of #3341, #2070 or #1882. Those issues remain open; there are no closing directives.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Validation

Current head: c366f256dd49c7fb033db7756b6bf51136bb259c, composed from frozen 7e33bc740b9c2894df8829081830193b73198d75 and actual public main fe2cfad0884bafceae78a478d13a8c8a9a7aaf0d after #3346 landed. Rerere was disabled; the conflict-free merge preserves every public I5 path byte-for-byte. The three-path full-index diff remains identical to root's no-finding bounded review. The local and current-head hosted results below were independently observed; they do not claim full-main release validation.

The original 7e33 results (188 passes in 80.28s and one benchmark pass in 60.85s) remain a separately sealed historical snapshot. They are not relabelled as executions on c366.

Evidence Actual result
Core split guard against original public-main workflow 1 intended failure, specifically rejecting the unsplit topology; no setup/import failure
Restored focused workflow contracts 38 passed, 106 deselected, 18.78s; pre-freeze result, overlapping later coverage
Full original six-module selection at current head 188 passed, 0 failures/errors/skips, 77.01s; all original 153 node IDs individually matched to passing XML cases
Real scaling benchmark at current head 1 passed, 0 skips, 55.92s; original target, marker, PYTEST_PERF=1 and threshold unchanged
Canonical lint/static/quality mirror Passed; exact commands below, including duplication and architecture boundaries
Canonical owner detector 0 touched application owners; full completion schema and strict terminal verification passed with terminal_evidence_required=true
Docs assessment In-place resolved in the existing integration guide; direct owner assessment plus bounded root review, not a new panel
Hosted CI SUCCESS at exact c366: CI run 39771865459 and required gate. All Windows, lifecycle, Linux, lint and actual CodeQL analysis jobs succeeded.

Current-head hosted scheduling proof: contracts 188 passed in 162.62s, whole job 177s; real scaling one passed in 113.29s, whole job 126s; strict aggregate success in 3s. Both execution caps remain five minutes.

The captured terminal inventory is 28 checks: 25 success, two neutral, one skipped. The imposed-native CodeQL check is not claimed passed; the existing explicit user exception remains unchanged. Docs deployment was skipped. The sole bounded observer exited0, and actual run/job conclusions were verified separately. No new full release-validation dispatch occurred.

Executed commands and verbatim terminal summaries

The current-head invocation used the shared two-slot gate once, running both commands sequentially with separate temporary/JUnit paths and clean exact-head guards before and after. These are the executed inner commands; the full wrapper and its successful runtime receipt are preserved separately.

E=/Users/danielmeppiel/.copilot/session-state/067b35fc-52fb-4db4-b316-c606d23b4b34/files
uv run --frozen --extra dev pytest -p no:cacheprovider -q \
  tests/unit/scripts/test_check_test_assertions.py tests/unit/scripts/test_check_exact_test_duplicates.py \
  tests/quality/test_test_taxonomy.py tests/quality/test_quality_baselines.py \
  tests/quality/test_lifecycle_bug_ledger.py tests/quality/test_ci_topology.py \
  --basetemp="$E/ratchet-public-contracts-tmp" --junitxml="$E/ratchet-public-contracts.xml"
188 passed in 77.01s (0:01:17)
env PYTEST_PERF=1 \
  uv run --frozen --extra dev pytest -p no:cacheprovider -q -m benchmark \
  tests/perf/test_architecture_linter_scaling.py::test_ci_real_catalog_work_scales_below_fifteen_x_after_fixed_cost_subtraction \
  --basetemp="$E/ratchet-public-scaling-tmp" --junitxml="$E/ratchet-public-scaling.xml"
1 passed in 55.92s

Each canonical command below completed successfully at current c366:

uv run --frozen --extra dev ruff check src/ tests/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ scripts/windows_native_symlink_probe_entry.py
uv run --frozen --extra dev ruff format --check src/ tests/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ scripts/windows_native_symlink_probe_entry.py
uv run --frozen --extra dev python -m pylint --disable=all --enable=R0801 --min-similarity-lines=10 --fail-on=R0801 src/apm_cli/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ scripts/windows_native_symlink_probe_entry.py
bash scripts/lint-auth-signals.sh
bash scripts/lint-architecture-boundaries.sh
uv run --frozen python scripts/check_test_assertions.py
uv run --frozen python scripts/check_exact_test_duplicates.py

YAML-I/O, portable-relative-path and 2100-line guards also passed using exact Python-regex equivalents because macOS grep lacks -P. Complete recorded commands, runtime receipts and XML are preserved in the owner's sealed evidence. No dependencies or validation thresholds changed.

Scenario Evidence

# Scenario (user promise) Principle(s) Test(s) proving it Type
1 Contributor CI retains both real workloads with independent bounded execution OSS / community-driven tests/quality/test_ci_topology.py::test_ratchet_executions_are_separate_and_bounded (regression trap for the linked 302-second cancellation); original-selection XML binding; actual hosted jobs linked above unit
2 A failed, skipped, cancelled or absent execution cannot become a green aggregate Governed by policy tests/quality/test_ci_topology.py::test_ratchet_aggregate_cannot_ignore_either_execution; test_ratchet_aggregate_cannot_suppress_failure; real shell over 36 result pairs unit
3 CI cannot silently substitute main, unfreeze dependencies, change opt-ins or suppress a workload OSS / community-driven, Governed by policy tests/quality/test_ci_topology.py::test_ratchet_execution_step_drift_fails; test_ratchet_execution_job_drift_fails; test_ratchet_execution_step_cannot_skip_or_suppress unit
4 The real architecture-scaling threshold still executes rather than skipping OSS / community-driven tests/perf/test_architecture_linter_scaling.py::test_ci_real_catalog_work_scales_below_fifteen_x_after_fixed_cost_subtraction, real catalog execution integration

How to test

  • With the committed dev dependencies, run the six-module command above using fresh local evidence paths; expect 188 passing contract cases.
  • Run the real scaling command with PYTEST_PERF=1; expect one passing benchmark, not a skipped test.
  • Inspect the new head's actual hosted Architecture Ratchet Contracts, Architecture Scaling (Linux) and Test Architecture Ratchets jobs; require all three to finish successfully, not merely print passing test summaries.
  • Confirm .github/workflows/merge-gate.yml and the benchmark source have no diff; do not dispatch a release, change policy, or retry an unchanged workflow merely to review this PR.

Spec conformance (OpenAPM v0.1)

If this PR changes behaviour that an OpenAPM v0.1 req-XXX covers,
confirm the three-step ritual in the
development guide:

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
    (new/changed <a id="req-XXX"></a> anchor + prose + Appendix C
    row).
  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml
    updated.
  • Test edit: a @pytest.mark.req("req-XXX") test under
    tests/spec_conformance/ added or extended.
  • CONFORMANCE.{md,json} regenerated via
    uv run --extra dev python -m tests.spec_conformance.gen_statement
    and committed.
  • N/A -- this PR does not change OpenAPM-observable behaviour.

Co-authored-by: Copilot [email protected]

Keep both original selections and five-minute execution caps, with an always-run success-only aggregate preserving the existing non-required check. Add topology, source, environment and failure-state regression coverage.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 067b35fc-52fb-4db4-b316-c606d23b4b34
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 067b35fc-52fb-4db4-b316-c606d23b4b34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Current-head hosted completion within the separate five-minute budgets remains unconfirmed in the available evidence.

No open issues 🎉

What changed in this PR

This PR addresses architecture CI timeouts by giving the existing contract suite and scaling benchmark separate execution budgets, without changing application behavior or required-check membership.

Changes:

  • Split both workloads into independent Linux jobs, each retaining its five-minute limit.
  • Preserve Test Architecture Ratchets as an aggregate that succeeds only when both jobs succeed.
  • Add topology and aggregate-result regression tests, and document the scheduling change.
File Description
tests/​quality/​test_ci_topology.py Validates job separation, preserved execution settings, and strict aggregate results.
docs/​src/​content/​docs/​contributing/​integration-testing.md Explains independent limits and unchanged non-required check status.
.github/​workflows/​ci.yml Separates contract and scaling execution and adds the aggregate job.

Review effort: Balanced

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

Merge Master delivery assessment: ship_now

Exact head c366f256dd49c7fb033db7756b6bf51136bb259c is qualified against actual public main fe2cfad0884bafceae78a478d13a8c8a9a7aaf0d, following the author's ALL-writes release. This is a separately authorized MM assessment for the bounded issue-less CI repair, not a new persona panel, CEO verdict, or human approval.

The complete three-path diff is identical to the independently reviewed scheduling correction. It preserves the existing workloads, five-minute caps, benchmark thresholds, environments and non-required check membership. Pure current-main compatibility yields tree 6a3e3b523e67f9189f86fba605f101be8d9b1daa.

All 66 sealed artifacts and the full completion schema verified. Fresh strict owner-v2 verification reports verified=true, terminal_evidence_required=true, and zero touched application owners. Exact-head XML contains 188 passing contracts, including every original 153 test ID, plus a separate real scaling pass. Original successful command receipts and the full canonical lint receipt are bound to this head. The unsplit-workflow negative fails as intended; restored tests and executable workflow/aggregate mutations pass. Historical execution populations remain separate; no tests or panels were replayed by MM.

The earlier Copilot review's unconfirmed hosted-budget caveat is now resolved by actual current-head CI run 39771865459: contracts succeeded in 177s whole-job (188 passed in 162.62s), real scaling in 126s (one passed in 113.29s), and the original-name strict aggregate in 3s. Required gate, Windows, lifecycle, Linux, lint and actual Python/actions analyses succeeded. All 30 current checks are terminal: 27 success, two neutral, one skipped. No open review threads or outstanding in-scope findings.

The imposed-native CodeQL comparison remains missing/neutral, not a passed scan, under the existing narrow user exception. Eligibility is advisory-neutral; docs deployment is skipped. The first terminal PR-body equality guard remains a recorded failure; its official correction and final exact-byte equality were verified, without source changes or validation replay.

Fresh capability is ADMIN with applicable ruleset bypass always; MERGEABLE/BLOCKED is not a conflict. Landing still uses fresh exact-head guards and a normal merge. Closing references are empty; #3341, #2070 and #1882 stay open. This does not qualify other heads or complete the full-main nonpublishing CI recovery mission.


Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors.

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit cdecf44 into main Oct 22, 2026
30 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-ci-ratchet-budgets branch October 22, 2026 12:02
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Oct 22, 2026
Compose landed #3346 and #3347; preserve receipt source and both conformance bindings.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 13c28cd3-d648-498c-97d8-95dd47e91145
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants