Skip to content

Gate: run each suite once under coverage, scope stages to touched servers, and gate fully only when a draft PR is marked ready #5759

Done

Description

@cliffhall

Problem

The pre-push gate (npm run local:gate) runs under a machine-wide lease, one gate at a time, and a waiter gives up after 45 minutes. With several agent sessions working in parallel, the queue has grown deeper than that budget: gates time out without running a single stage, and fixes wait longer for the gate than they took to write. #5757 lets gates share the machine; this issue makes each gate do less work. Three changes:

1. The gate runs every test suite twice

local:gate:stages runs validate (each TypeScript workspace's validate ends in vitest run) and then coverage (vitest run --coverage over the same suites), and likewise validate:py (pytest) and then coverage:py (pytest --cov). The coverage run executes the same tests and fails on any test failure, so the plain pass adds time and catches nothing more.

Change: in the gate and in CI, run each suite once, under coverage. Keep npm test / uv run pytest as the fast inner loop, which AGENTS.md wants kept separate from coverage.

2. The gate runs every server, whatever changed

interface-diff and image-smoke already run only for the servers a change touches, but validate, coverage, validate:py, coverage:py and smoke run all seven. A change confined to src/memory/ runs the fetch, git and everything suites too.

Change: when every changed path (against the merge base with origin/v2/main) is under one or more src/<server>/ directories, run those stages for those servers only. Any change to repository-wide files (a root manifest or lockfile, scripts/, .github/workflows/, .changeset/ config, the root tsconfig/lint/format config, AGENTS.md/skills for verify:skills) runs everything, as now. The root guards (validate:guards, verify:dco, verify:install-fresh) always run.

3. A draft PR does not need the full gate on every push

Change:

  • While a PR is a draft, a push needs only the touched servers' validate / validate:py, plus verify:dco.
  • Marking it ready for review needs a full npm run local:gate (exit 0) first.
  • After that, every push needs the gate as now, scoped by change 2.
  • In CI, coverage, smoke, the interface diff and the image smoke skip draft PRs and run on ready_for_review and on every later push. Format, lint, typecheck, build and tests still run on drafts.

Scope

  • package.json (local:gate:stages, validate, the workspace validate scripts), and a changed-servers helper in scripts/lib/, shared with interface-diff / image-smoke if they already compute it.
  • .github/workflows/typescript.yml and python.yml: drop the duplicate test pass, scope or skip by draft state, and add ready_for_review to the PR event types.
  • The workflow guard (scripts/lib/workflow-gate.mjs) and its tests, which pin what local:gate contains.
  • AGENTS.md (Before pushing, Always test new or modified code: "CI and npm run local:gate run each as a stage of its own"), docs/quality-gate.md, and the pre-push-gate and pr-flow skills.

Acceptance

  • A change confined to one server's directory gates only that server, and the gate log says which servers it chose and why.
  • A change to any repository-wide file gates every server.
  • Each test suite runs once per gate, under coverage, and the per-file thresholds still fail the gate.
  • A draft PR's CI skips coverage, smoke and the image smoke; marking it ready runs them.
  • AGENTS.md's statement that the gate runs every check CI runs stays true.
  • The docs and skills describe the new rules, and npm run verify:skills passes.
  • Before-and-after gate timings for a one-server change are recorded in the PR.

Activity

  1. added this to the v2.8.0 milestone on Dec 4, 2026
  2. added
    chore
    on Dec 4, 2026
  3. self-assigned this
    on Dec 4, 2026
  4. modified the milestones: v2.8.0, v2.7.0 on Dec 5, 2026
  5. added a commit that references this issue on Dec 5, 2026
    cd6c590
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

chorev2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions