Skip to content

ci(efficiency): reduce redundant cost and latency without weakening required quality/security gates #550

Description

@qnbs

Purpose

Create one bounded S12 owner for CI efficiency, latency and duplication. The repository already has strong granular quality/governance trackers; what is missing is an integration-level optimization contract that decides where each expensive check belongs, how often it needs to run, and how to reduce repeated work without weakening evidence.

This issue is explicitly about execution efficiency. It must not become a pretext to lower thresholds, remove coverage/security checks, or bypass branch protection.

Existing specialist owners to reconcile, not duplicate

This issue owns the whole-pipeline cost/latency model and de-duplication plan, not those specialist semantics.

Inventory first

For every workflow/job on main, pull requests, tags, schedules and manual dispatch, record:

  • trigger;
  • required vs advisory status;
  • runner/OS/runtime matrix;
  • median/p95 queue time and execution time where observable;
  • duplicated setup/build/test work;
  • cache inputs/outputs and hit assumptions;
  • artifact production/consumption;
  • whether result is needed for every PR, only affected paths, main, release, schedule, or evidence cadence;
  • security/trust reason a job cannot safely reuse PR-controlled artifacts;
  • failure signal uniqueness (what defect class only this job catches).

Optimization principles

  1. Preserve evidence before reducing frequency. A slow check that uniquely catches a real class of failures is not redundant merely because another green job looks similar.
  2. Share deterministic artifacts only across compatible trust boundaries. Do not let untrusted PR artifacts become authority for write-scoped/release/security jobs.
  3. Prefer one build, many consumers when platform/runtime semantics genuinely match.
  4. Use path/change awareness only when sound. Shared configuration, generated files, workspace packages and transitive dependencies must invalidate affected gates correctly.
  5. Separate fast merge feedback from deep evidence cadence. Expensive mutation/soak/nightly/browser/platform work can be scheduled if merge-safety coverage remains adequate.
  6. Do not optimize by weakening thresholds, skipping required matrices, or hiding flaky failures.

Specific audit targets

  • duplicate dependency installation/setup across jobs;
  • repeated production builds that can safely consume one immutable artifact;
  • repeated i18n/docs/parity/governance scans with identical inputs;
  • Node 22/24 matrix value versus duplicated work, preserving compatibility evidence;
  • Storybook/VRT/Lighthouse execution topology;
  • Playwright vs Deep E2E overlap and unique scenarios;
  • CodeQL/Semgrep/OSV/Socket/GitGuardian boundaries and trigger cadence;
  • Tauri platform builds versus qualification/release-only lanes;
  • cache-key breadth and stale-cache correctness;
  • concurrency cancellation of superseded PR runs;
  • generated artifact reuse and retention;
  • merge-queue/main/tag duplicate cycles;
  • reviewer/provider integrations that trigger repeatedly on correction commits but add little new signal.

Required measurements

Before and after each optimization, record at minimum:

PR feedback median/p95
full required-check wall clock
runner minutes by OS/runtime
cache hit/miss where measurable
number of duplicated build/install operations
failure-detection coverage retained

Cost optimization should be expressed as evidence, not intuition.

Safety gates

Any proposed optimization must answer:

If uncertain, preserve the stronger current behavior until deterministic proof exists.

Acceptance criteria

Non-goals

  • making CI green by deleting tests;
  • lowering coverage/bundle/security thresholds;
  • bypassing protected-branch/ruleset requirements;
  • trusting PR-controlled code/artifacts in privileged workflows;
  • eliminating deep scheduled evidence merely because it is slow;
  • optimizing reviewer/model quotas by suppressing genuinely useful findings.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions