Skip to content

CI COST P0 — eliminate duplicate PR waves and repeated Windows builds (P10.9K) #542

Closed

Description

@masarray

Incident: P10.9K CI fan-out wastes capacity and delays real tests

No workflow/code changes are being made by this issue. Issue creation does not trigger PR build workflows.

Measured evidence (12 Oct 2026)

  • Exact P10.9K consumer source: 069890df0a007d196ba0a9498c2c5972f8ab5c5b, ARSAS PR P10.9K: vendor-neutral control safety, typed GUI and pinned association inventory engine #541, engine a43b9b4864a9565c02f544d4135fe157c2fac577 (engine PR Release ARSAS 1.6.28 #168).
  • GitHub Actions API for that exact source returns 30 workflow runs, all pull_request, in two waves: 14 runs around 09:55:22 UTC and 16 runs around 10:02:50 UTC. Same final head SHA, repeated families and Windows jobs.
  • Exact canonical Build ARSAS run #38233003891 was SUCCESS before the later canonical run #38233823373. This proves repeated expensive work, not just a high count of unique protection checks.
  • .github/workflows/build.yml has unconditional pull_request: and Windows build/test/package; the 2nd run also succeeded and generated P10.9K portable artifact.
  • .github/workflows/smart-discovery-capture-build.yml matches /*.cs, engines/, tests/** and runs another Windows build; several unrelated workflows also match the common engines/ARIEC61850.lock.json or services files, e.g. IO, SCL, installer.
  • .github/workflows/ci-p1-shadow.yml classifier is advisory and the actual heavy workflows do not consume its classification as a gating contract.
  • Existing per-PR cancel-in-progress doesn't prevent a second wave after first completes. Each PR update can repeat heavy jobs.

Mandatory correction — without sacrificing safety

  1. No CI-triggering hotfix for this incident while P10.9K is being qualified. Preserve current known-success candidate SHA. No gratuitous new PR/commit/merge just to fix CI.
  2. Design one cheap fast PR preflight for semantic/lock/parser/source validation and deterministic touched-path classification. The selection policy must be checked by hostile negative fixtures (unknown paths fail-safe).
  3. Run one canonical Windows build/test + portable package for a frozen SHA when candidate promotion or real-user artifact is needed. Do not launch it on every intermediate commit. Honor repository required checks/rulesets; do not silently disable mandatory branch protection.
  4. Let dependent IO/SV/COMTRADE/installer workflows consume exact-SHA canonical evidence/artifacts instead of cloning, recompiling and packaging redundantly. Do not allow stale artifact reuse: verify app tree hash, pinned engine/native SHA and test manifest.
  5. Field Capture and long-running physical/provenance/package checks should be targeted, manual/on-demand at qualification, or cheap evidence validation; not automatically rerun another full build on every control semantic code change. Preserve the strict P10 physical/RCB/GI/no cyclic polling gates.
  6. Fix per-PR concurrency + event semantics and source-change classification to prevent redundant post-ready/merge PR waves. Audit exact event action before assuming any one action caused wave 2.
  7. Cost KPI: for unchanged source+engine+native dependency identity, at most one canonical Windows compile/package and no duplicate full Windows build; report workflow counts, runner-minutes and critical-path wall time per candidate. For invalid/ambiguous control: exactly zero MMS Writes remains mandatory.
  8. Validate proposed CI-routing changes with an offline dry-run of event/path fixtures first. Apply one consolidated workflow PR only after confidence, rather than incrementally triggering the entire workflow fan-out multiple times.

Status and scope

Activity

  1. masarray commented on Oct 12, 2026

    @masarray
    OwnerAuthor

    P10.9L measurable CI-fanout follow-up (2026-10-12): three successive draft PR #543 consumer heads each triggered 14 pull_request workflow runs despite control-only source/test/lock changes: c4abd9c16e03acd9b1d529b78a48576086f7e5a0 (canonical run #38239310808, failed on initial unqualified engine syntax); 5564d01f1a48bc0bdd6a36363713fe6f041717de (canonical #38239824870, passed build but failed 4 regression oracles); 7d1467817675a53e619428d5b974fa4dc258c9d1 (canonical #38240471645, SUCCESS including 1,654/1,654 ARSAS tests, 19/19 engine tests and portable EXE smoke; artifact #11742369076). Total 42 consumer workflow runs over three waves, including SCL, SV, IO, Installer, GOOSE/FAT-adjacent workflows unrelated to the control patch. Engine PR #169 required separate .NET qualification, SUCCESS at #38239451501. This is quantified evidence, not a workflow fix. Future work must preserve required safety checks but route changed-path control-only work to one canonical Windows test/package and reuse exact-SHA proofs/artifacts; avoid further unqualified broad fanout.

  2. masarray commented on Oct 26, 2026

    @masarray
    OwnerAuthor

    D18 coordinated CI-cost audit (ARSAS RC 817c3910e8223fa2ac531a4426ada5d2d4bbbe50; no new Actions run): #653 is an unabsorbed, substantive optimization, not a stale duplicate. Its original changes to .github/workflows/build.yml would add a fail-closed read-only pr-scope classification for docs-only PRs while always building source/mixed/unknown changes; .github/workflows/smart-discovery-capture-build.yml would gate extra Windows capture behind ci-field-capture or manual dispatch. None of the key pr-scope, needs.pr-scope.outputs.needs_windows, ci-field-capture controls exists in current RC source, and original scripts/test-ci-workflows.py test methods are absent. #653 HEAD 779bbdef9865004317e8fcf1de282bc0aacdd23f diverges (behind 5) and should be rebased/surgically reconciled, not merged naively or closed.

    Separately #677 was retired during D18 because direct EXE Actions artifact upload (upload-artifact@v7, archive:false) and both original regression test blobs exist in RC. That does not reduce duplicate Windows builds by itself, and #660 opt-in public prerelease is a separate security/product approval gate (its workflow is missing in RC).

    Next correct P0 CI approach: owner-isolated design review; assert docs-only skip is narrowly allowed and still leaves downstream checks fail-closed; source/engine/security/unknown-file PRs, push and manual always retain exact-SHA Windows proof; protect specialist capture for physical promotion; check required GitHub statuses/branch protection before altering job conditional; validate paths with targeted workflow tests and compare actual runner minutes. Do not launch a fleet of CI runs simply to prove a docs-only audit.

    Source/decision checkpoint: https://github.com/masarray/arsas/blob/audit/arsas-reconciliation-d18-20261027/docs/maintenance/ARSAS_RECONCILIATION_D18_2026-10-27.md. This comment records evidence, not a claim #542 is resolved.

  3. masarray commented on Oct 26, 2026

    @masarray
    OwnerAuthor

    D19 update on CI COST P0: substantial code change made but not yet merge-qualified. RC-based ci/p4-failclosed-optimized-gates-d19-20261027, exact 6065c6e8e36d67d1f5488153aa99a01183c3cf0d, implements verified-docs-only cheap PR preflight and explicitly labeled/manual Field Capture Windows. Retains canonical Windows for all source/mixed/unknown/API-error/classifier-failure/push/manual paths; old #653 would fail open if the classifier job failed, now fixed. The direct EXE artifact from retired #677 is preserved. Changes: 2 workflows, existing workflow regression test suite, and one audit document; no runtime/engine modifications.

    Executed 24 offline JS condition simulations. GitHub Actions workflow execution and Python P0 suite have not been run; creating a new PR now could fan out CI, so branch was committed without opening one. Branch protection endpoint returned 403 (no admin scope); repository ruleset list empty, not definitive proof of required-check topology. No real-world CI cost reduction claimed yet; measure representative workload only after owner verifies branch protection and authorizes a scoped qualification. Keep #542 and #653 OPEN; no automatic merge/release/promotion. Full evidence: https://github.com/masarray/arsas/blob/ci/p4-failclosed-optimized-gates-d19-20261027/docs/audits/CI_P4_D19_FAILCLOSED_IMPLEMENTATION_2026-10-27.md.

  4. masarray commented on Oct 26, 2026

    @masarray
    OwnerAuthor

    D20 engineering checkpoint: one scoped draft qualification PR now opened, #757, base protected integrated RC release/arsas-integrated-rc0-20261024, HEAD e0c9724b203ac38f2a947d71795ac1173ca5ed5b; not main or stable and not merged. It implements safer CI-P4 on top of original #653, now with a new executable regression test that extracts actual GitHub-script JS and Windows/Field Capture conditions from checked-out workflow files and checks 26 fail-closed test cases using Node VM. It runs within the existing read-only CI P0 Workflow Integrity suite, no new workflow/runner introduced.

    Actual GitHub run evidence for exact candidate: CI P0 Workflow Integrity #40407726690 is SUCCESS, with existing workflow test suite Ran 12 tests ... OK; Build ARSAS #40407726657 classifier job SUCCESS and real run log says Changed paths=4, Windows required=true. The canonical Windows job started (not yet certified). Smart Discovery Field Capture #40407726714 skipped both manual-regression and extra Windows build for a draft/unlabeled PR, as intended. CI P1 #40407726721 SUCCESS. Other source-impacting parallel workflows can still run on this PR and remain separate cost topics.

    Scope and safety: Previous design would fail open on failed classifier; current build-windows uses always(), classifier result and only explicit needs_windows=false to skip. No WPF/C# runtime, engine lock, safety, Write/SG7/UI, stable or RC changes. Do not merge #757 until remaining CI is checked, required branch-protection checks manually confirmed (GitHub App read gives HTTP 403), docs-only and label/manual event proof independently evaluated, and measured billed Windows savings. Do not rerun passed CI or push no-op changes to trigger more runs. Legacy #653 remains OPEN as historical reference, not automatically merged or closed.

  5. masarray commented on Oct 26, 2026

    @masarray
    OwnerAuthor

    D21 qualification — real GitHub Actions evidence, exact SHAs; no reruns or source changes

    Parent CI P4 draft #757 remains OPEN DRAFT, exact HEAD e0c9724b203ac38f2a947d71795ac1173ca5ed5b, base protected RC 817c3910e8223fa2ac531a4426ada5d2d4bbbe50, NOT main.

    Source-impacting real PR wave (one attempt, 8 workflows, all finished):

    Genuine documentation-only canary #758 was created from the candidate HEAD on a separate one-Markdown-file branch, targeted back to that candidate feature branch. Real Build ARSAS #40410571266 SUCCESS, pr-scope job SUCCESS (log Changed paths=1, Windows required=false), canonical Windows job SKIPPED, zero artifacts on canary SHA 00b0c519107e3d3cd7560428379a22500bb78b9a. Only one workflow triggered, demonstrating real docs-only CI saving without false package proof. Canary CLOSED UNMERGED after writing exact evidence. No commit added to #757 or the protected RC.

    Qualification now supported: actual source PR Windows admission/build; actual docs-only Windows skip/no sealed artifact; actual Field Capture draft/unlabeled opt-out; P0 26-case policy regression. Still NOT supported: main branch-protection required-check topology (GitHub App GET 403), live nondraft labeled and manual Field Capture dispatch paths, real physical IEC 61850 FAT, or a robust measured cross-PR billable-minute savings baseline.

    Disposition: retain #757 as DRAFT and #542 as OPEN, refrain from relabeling it ci-field-capture (would spend Windows runners) or pushing no-op changes. No release/engine pin/main/safety/Write/SG7/GUI modification.

  6. masarray commented on Oct 26, 2026

    @masarray
    OwnerAuthor

    D21 workflow fan-out topology — avoid optimizing the wrong runners

    The #757 PR triggered eight workflows, but NOT eight Windows builds. GitHub job states and source workflows on exact candidate e0c9724b203ac38f2a947d71795ac1173ca5ed5b demonstrate:

    • Build ARSAS: one canonical Windows package/test job; sealed package/direct EXE and immutable source evidence emitted.
    • COMTRADE viewer integration: one independent Windows native bridge job plus an Ubuntu native-shadow observer. This native job is a possible future cost optimization target but retains native integrity obligations.
    • IO List Testing and SV Evidence pull_request jobs use runs-on conditional selecting ubuntu-latest for PR, consuming the canonical exact-SHA evidence; do not falsely count these as redundant Windows compilations or disable their checks.
    • CI P0 / P1 use Ubuntu. Field Capture skipped its opt-in Windows build. Installer skipped.
    • Genuine doc-only canary #758 triggered exactly one Build ARSAS workflow, with classifier Changed paths=1, Windows required=false, Windows job SKIPPED, zero artifacts, then was CLOSED UNMERGED.

    Next CI cost work: inspect whether COMTRADE specialized native proof can safely reuse exact-SHA canonical native CTest and artifact digest on nondomain-impacting workflow changes, without weakening full native validation for COMTRADE/ARDIREC changes. Verify the exact native/engine lock, family, source SHA, proof availability and fail-closed manual controls before modification. Count actual Windows job minutes, not simply workflow events; no billing saving claimed without evidence. #542 remains OPEN.

  7. masarray commented on Oct 26, 2026

    @masarray
    OwnerAuthor

    D22 CI-cost audit of the actual #757 source wave found independent COMTRADE CTest/DLL parity with the canonical build: COMTRADE run 40407726689 advisory log reported nine matching native CTest names and the identical native DLL SHA-256 55a4818f45bb43438296c3cbd40e425b23fe21d892bf101f2c82e93a56353986, canonical run 40407726657 completed SUCCESS. Both compare on GitHub's exact synthetic merge SHA, immutable ARIEC f75e323e9f8443aa20e0a3818a1d5d77255b2c0f and ARDIREC 7dbc7149db668126a493ce338264363a6ec5ec00. Crucial: canonical comparison returned deduplicationAuthorized=false, independentWindowsCTestRetained=true, releasePromotionAuthority=false. Do not delete COMTRADE independent Windows CMake/CTest merely because one parity sample matched; its workflow explicitly makes this proof mandatory. D22 instead delivered a unique missing read-only field diagnostic validator in draft #759, routed into existing CI-P0 (20 tests GREEN, no new workflow). A separate new source PR wave is deliberately limited to three workflows, not the eight seen for #757. #542 still open; true native dedup needs multi-run evidence and owner-approved equivalent acceptance policy. No claimed billed-minute savings or weakened native tests.

  8. masarray commented on Oct 27, 2026

    @masarray
    OwnerAuthor

    D26 CI-P3J provenance hardening — exact PR identity, no deduplication permission

    A targeted source fix is staged as draft PR #760, commit 2c95d0c, isolated on protected integrated RC. The advisory COMTRADE native-shadow chooser previously matched canonical Build ARSAS only on shared head SHA/branch. Multiple PRs may share those while targeting different bases (e.g. #727 and #729), so the latest other PR run could be mistaken for the correct proof. D26 reads exact PR identity from GITHUB_EVENT_PATH and filters canonical run pull_requests[].number, still requiring exact source synthetic merge/engine/ArdIrec proof.

    Five additional hostile offline tests were added (20 total). CI P0 #40463264351 completed SUCCESS (20/20). The independent COMTRADE Windows native job within run #40463264264 also completed SUCCESS; at time of this comment its advisory observer and the canonical Windows #40463264271 were still ongoing. No final parity claim until those complete.

    No cost-saving claim from this patch. Independent Windows COMTRADE CMake/CTest stays mandatory; deduplicationAuthorized=false, release promotion remains false, and no workflows were deleted or weakened. #757 fail-closed routing is not touched. D26 audit: checkpoint.

  9. masarray commented on Oct 27, 2026

    @masarray
    OwnerAuthor

    D29 exact-scope issue disposition

    Targeted CI P4 waste mitigation delivered: #757 merged into integrated RC d459861 (fail-closed docs-only Windows admission and opt-in Field Capture), and #760 exact PR identity on the canonical COMTRADE native shadow. Obsolete duplicate staging/release PR #727/#729 were later closed, limiting duplicated PR-head waves. Scoped CI efficiency work can be marked completed, but this is NOT a measured zero-waste or global runner-minute guarantee. Mandatory independent COMTRADE Windows CMake/CTest remains on; no permission to deduplicate it based on one parity observation. GitHub PR mainline R7/reference guards remain genuine and are not bypassed.

    No repeat capture is requested from the operator. This is issue-state reconciliation, not a new hardware/engine release assertion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions