Skip to content

feat(ci): per-PR pre-board fast lane — a dispatchable guard run that reports every failure (#21359) - #21361

Merged
mrveiss merged 21 commits into
mainfrom
issue-21359-preboard-fast-lane
Nov 12, 2026
Merged

mrveiss merged 21 commits into
mainfrom
issue-21359-preboard-fast-lane

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Thinking Path

Trains keep finding one mechanical guard failure per cycle (#18499). Four consecutive red cycles on one train came from four different guards, each costing a full suite, because the python suite runs the guards inside 8 shards with about 50 000 backend tests and the watcher stops at the first red shard. The owner approved a standing boarding step: the guard shard plus the types job, run on each member's head before it boards, outside the train CI slots. This PR is that lane (AC4 of #18499).

Refs #21359
Refs #18499

What Changed

  • .github/workflows/ci.yml: -rs on the python-shard pytest invocation, so each shard log names its skip reasons (no log did). .github/workflows/dispatch-preboard-guards.yml: dispatch-only, own concurrency group. Jobs guards (6 shards, not fail-fast) and types first merge the current base tip into the head as a local commit (never pushed; a conflict is a red lane), then build the suite environment; guards runs every pytest root except the product trees, with the suite's options and shard plugin, AUTOBOT_REACH_AUDIT=1 and the ratchet base set, balanced over durations restricted to the lane's roots. Job result writes result.json (schema 2) and summary.md.
  • pipeline-scripts/preboard_guard_lane.py: the one definition of the guard roots and the product roots (together exactly pytest.ini's testpaths), the merge with the base, the per-shard metadata (floor, required files, merge state). pipeline-scripts/preboard_guard_lane_junit.py: reads the junit shapes pytest 9.2.0 writes (a module skipped at collection carries its reason only in the element text). pipeline-scripts/preboard_guard_lane_report.py: the reviewed skip allowlist with a class per entry (covered-by-suite-only, equivalent-to-suite), the verdict, and the notice/warning/error annotations that carry overall, behind_base and the skip counts.
  • Verdict: the floor counts EXECUTED tests; skips must be on the reviewed allowlist (pipeline-scripts/preboard_guard_lane_skips.py, 24 entries: 1 covered-by-suite-only (promtool) naming ci: move the inline cheap checks (baseline audit, Semgrep ERROR, real-ChromaDB session, promtool) into composite actions so the pre-board lane can call them #21360, 5 guards that skip on every CI run naming ci: guard tests that skip on every CI run — the rule they enforce is never checked #21371, 18 skips by design) or the lane is red; allowlisted skips give green_with_skips; every recorded test file under the roots must produce a test; a truncated junit file is a red with a result.
  • One base per run: a first job pin resolves the base tip once (resolve, ref name validated); guards and types merge that exact commit fetched by id; the types job records the base it merged (types-meta.json, artifact preboard-types-record) and result is red unless every shard and the types record equal the pinned base_sha. Boarding rule: base_sha must equal the base tip at boarding time (not behind_base 0).
  • repo_tests/preboard_guard_lane_21359_test.py (workflow and roots, static), repo_tests/preboard_guard_lane_verdict_21359_test.py (verdicts on synthetic shards, the merge on throwaway repositories), repo_tests/preboard_guard_lane_junit_21359_test.py (the real junit shapes and the annotations), repo_tests/_preboard_guard_lane_support.py (shared builders). The merge tests build their repositories with autobot_shared.isolated_git (make_repo, git). Workflows are enumerated through the shared git helper, so no glob declaration is added to the shrink-only record.
  • .github/filters/python-paths.yml: the workflow and pytest.ini (with the uncovered-reads record lowered by one). docs/developer/CLAUDE_REVIEW.md: "Pre-board fast lane" rewritten as a checklist (what it runs, what it does not cover, the boarding rule).

Why this shape

  • Roots are written once, in the script; the workflow asks for them, so no pytest invocation in the workflow names a root and the root-agreement guard for suite invocations does not see a fifth carrier. A test requires every pytest.ini root to be either run by the lane or named as left to the suite, so a new root forces a decision.
  • Six shards: the lane's roots hold about four fifths of the recorded suite seconds, and the shard table is built from durations restricted to those roots, so the shards come out even (about 580 recorded seconds each, about 11 minutes by the suite's wall-to-recorded ratio).
  • Equivalence with the train: the head is merged with the base tip first (a pull request's merge ref has the base as first parent, so AUTOBOT_RATCHET_BASE_SHA is set to it), and AUTOBOT_REACH_AUDIT=1 is on, because a merged tree is the population a train sees for this member alone. Two members that each move a population still need the train.
  • Not covered, listed in the docs and the workflow header: product suites, frontend tests, the dependency-floor check, the hardcoded-value baseline audit, Semgrep, promtool (ci: move the inline cheap checks (baseline audit, Semgrep ERROR, real-ChromaDB session, promtool) into composite actions so the pre-board lane can call them #21360); the two real-ChromaDB modules run in the lane and a skip of either is red.
  • Green requires: every check success, every shard reported on the same base, no unexpected exit code, executed tests at or above the floor, every recorded test file present, no skip off the allowlist. green_with_skips is its own value and exits zero only because the train's full suite covers those skips.

Verification

Not run locally; needs CI. The workflow cannot be dispatched before it is on the default branch; the first evidence of the lane itself is a dispatched run after landing. The pre-push hook ran its fast guard selection on this branch.

Skip allowlist evidence: the python-suite run 43181148822 on the previous head of this PR (eight shard jobs, -rs). 443 distinct SKIPPED lines read (492 skips summed); 60 lines (73 skips) under the lane's roots, in 22 test files plus one helper (autobot_shared/live_service_probe.py, whose skips belong to backend live-stack tests the lane does not run). Entries per class: covered-by-suite-only 5 (promtool is never skipped in the suite, so its reason is derived from the test source; the two ChromaDB modules skip in the suite's shared session but the suite's dedicated session runs both, so they stay in this class), equivalent-to-suite 23 (5 guards that never run on a CI runner, tracked by #21371; 18 by design). Suite skips deliberately not listed: three tests that read git history (the suite checks out two commits, the lane the full history) and the backend live-service skips. repo_tests/preboard_guard_lane_observed_skips_21359_test.py feeds trimmed -rs lines through the verdict (green_with_skips; one unlisted skip is red), and the guard test fails an entry whose file or reason text is gone.

The same run's one failure (shard 2) was parse_cache_test: a direct ast.parse in the lane guard; fixed.

Follow-up tests (not run locally; need CI): verdict cases for a differing or missing types base record, shards off the pinned base and a missing pin; static workflow assertions (one resolving job, both jobs consume its output, env-only inputs); merge tests on throwaway repositories (pinned commit merged after the branch moved, malformed or unfetchable pin refused).

Model Used

Claude (Sonnet 5.5)

Summary by CodeRabbit

  • New Features
    • Added a manually triggered pre-board check that runs guard tests and type checks in parallel, then reports an overall result with a downloadable report.
  • Bug Fixes
    • CI now displays reasons for skipped tests, making test results easier to interpret.
    • Changes to additional workflow and test configuration files now trigger the Python checks.
  • Documentation
    • Added guidance on starting the pre-board check and understanding its results.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 55 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0fda8c9 and e6278f5.

Files selected for processing: 14

  • .github/filters/python-paths.yml
  • .github/workflows/ci.yml
  • .github/workflows/dispatch-preboard-guards.yml
  • docs/developer/CLAUDE_REVIEW.md
  • pipeline-scripts/preboard_guard_lane.py
  • pipeline-scripts/preboard_guard_lane_junit.py
  • pipeline-scripts/preboard_guard_lane_report.py
  • pipeline-scripts/preboard_guard_lane_skips.py
  • repo_tests/_preboard_guard_lane_support.py
  • repo_tests/preboard_guard_lane_21359_test.py
  • repo_tests/preboard_guard_lane_junit_21359_test.py
  • repo_tests/preboard_guard_lane_observed_skips_21359_test.py
  • repo_tests/preboard_guard_lane_verdict_21359_test.py
  • repo_tests/python_filter_uncovered_reads.py
Walkthrough

This change adds a manually dispatched pre-board guard workflow. It merges a selected base branch into the dispatched head, runs sharded guard tests and generated-type checks, classifies test skips, and reports the results. It also adds supporting CI changes, tests and developer documentation.

Changes: Pre-board guard lane

Layer / File(s) Summary
Lane roots, merge and shard metadata
pipeline-scripts/preboard_guard_lane.py, repo_tests/preboard_guard_lane_verdict_21359_test.py
The lane script validates configured guard roots, selects recorded test durations, calculates an execution floor, merges the selected base locally and provides CLI commands for shard metadata and summarisation. Tests cover base-ref validation and merge outcomes.
JUnit parsing and skip rules
pipeline-scripts/preboard_guard_lane_junit.py, pipeline-scripts/preboard_guard_lane_skips.py, .github/workflows/ci.yml, repo_tests/preboard_guard_lane_junit_21359_test.py, repo_tests/preboard_guard_lane_observed_skips_21359_test.py, repo_tests/_preboard_guard_lane_support.py
The JUnit parser extracts test outcomes, node IDs, files and skip reasons. The reviewed allowlist matches skips by file and reason prefix. Backend CI reports skip reasons, and tests cover parser behaviour and allowlist verdicts.
Verdict aggregation and reporting
pipeline-scripts/preboard_guard_lane_report.py, repo_tests/_preboard_guard_lane_support.py, repo_tests/preboard_guard_lane_verdict_21359_test.py
The report script checks shard results, required test-file coverage and execution floors. It creates a verdict and writes JSON, Markdown and workflow annotations. Tests cover verdicts, counts, unreadable results and summary output.
Dispatch workflow and validation
.github/workflows/dispatch-preboard-guards.yml, .github/filters/python-paths.yml, docs/developer/CLAUDE_REVIEW.md, repo_tests/preboard_guard_lane_21359_test.py, repo_tests/python_filter_uncovered_reads.py
The workflow runs six guard shards and generated-type checks after merging the selected base, then gathers results and uploads an artifact. Static tests check workflow properties. The developer guide describes dispatch and result handling, and the Python path filter includes the workflow and pytest.ini.
Merge Risk: Low · previous review 0fda8

This adds a manually dispatched pre-board check lane and does not change product behavior. A few gaps could produce a misleading green verdict or a missing report in rare cases. They are worth fixing but do not block merging, since the lane cannot run until it reaches the default branch.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a per-PR pre-board CI lane, dispatched on demand, that runs guard tests and reports every failure. The changeset matches this. It adds a dispatch-only workflow, guard …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: a per-PR pre-board CI lane, dispatched on demand, that runs guard tests and reports every failure. The changeset matches this. It adds a dispatch-only workflow, guard lane scripts for merge, JUnit parsing, verdicts and an allowlist of skips, plus tests and documentation. The title also cites the issue number #21359, which the body does not explain, but this does not affect relevance. The title is 99 characters, slightly above a short title, but it stays specific.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@mrveiss mrveiss added infrastructure needs-structure Missing goal milestone, matching phase label or native parent (#19522) ci area: ci-gates Wave 0 · cluster P — CI gates & merge integrity labels Nov 12, 2026
@mrveiss mrveiss added phase:M4.5 Delete dead copies and facades enhancement New feature or request priority: high labels Nov 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@github-actions

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No new hardcoded values of either class — ssot and other both block.

Known backlog in pipeline-scripts/hardcoded_values_baseline.txt is suppressed and tracked in #14371.

@mrveiss mrveiss left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Verdict: CHANGES @ cbffafc

Blocking

  1. Own CI fails: repo_tests/preboard_guard_lane_21359_test.py:119 and :182 pass "*.yml" to .glob(...). glob_declared_reads_15900_test records that as a glob declaration (suffix glob). "*.yml" is in GLOB_DECLARED_UNCOVERED (repo_tests/_glob_declared_uncovered.py:173) with an exact guard set, and test_the_record_names_exactly_the_guards_that_declare_each_glob demands recorded == discovered. The new file is not in that set, so the test fails. Fix: add the file to the "*.yml" entry, or read workflows without a quoted glob (use the entry list in .github/workflows).
  2. False-green: skips count as collected. parse_junit counts every testcase, skipped included (preboard_guard_lane.py:132). guards_status ignores skipped. A conftest/import-time skip of many tests stays above the 90 % floor and gives overall: green. Fix: apply the floor to executed (collected minus skipped) tests, and fail (or mark distinct green-with-skips) when skipped exceeds a small bound or any skip reason is not on a named allowlist (promtool, real-ChromaDB). render_lane_summary prints only a skip COUNT; list skips grouped by reason in the summary.
  3. Docs overclaim. CLAUDE_REVIEW.md "Pre-board fast lane" says "every guard test" and lets a member board on green. The lane runs only repo_tests and pipeline-scripts. The suite also runs tools, autobot_shared, scripts, autobot-infrastructure/shared/scripts/hooks (277 recorded tests, includes hook tests), and autobot-backend. It also omits AUTOBOT_REACH_AUDIT (the suite sets it only for train-* heads, ci.yml:494), so the reach-floor staleness band that failed T113 is NOT tested. It also omits AUTOBOT_REQUIRE_PROMTOOL, the dependency-floor check (shard 1), and the head-merged-with-base state. Fix: state all of this in the doc section; better, set AUTOBOT_REACH_AUDIT=1 in the lane (it fails on a train for the same tree) or run it as a separate reported check.
  4. Silent file loss is not excluded: the floor is one aggregate. Add "every .test_durations file under the roots that still exists in the tree produced >= 1 testcase", reported in problems.

Non-blocking

  • parse_junit raises ParseError on truncated XML: the run goes red but with no result.json. Catch it and add it to problems.
  • Bucket table (repo_tests/stable_shard.py) is balanced over the whole durations file, not over the two roots, so a 6-way split of guards alone may be uneven. Unmeasured.
  • Doc should require behind_base == 0, or name the interaction gap between two members.
  • Job timeout may surface as cancelled rather than failure. Either way not green.

False-green cases (from code): shard cancelled -> cancelled; timeout, no junit or no meta -> red; empty or exit 5/4/3/2 -> red; collection error is rc 2 -> red; xdist node-down is a failure element -> red; xpass strict -> failure -> red; types failed/skipped -> red, cancelled -> cancelled; artifact download failure -> "no shard reported" -> red. Skips -> GREEN (finding 2).

Would catch: file-size ratchet, hand-rolled file-save pin, env-registry parser, one-comment-stripper, glob-declared-reads, test-name predicate single home, one-after-commit queue, generated types (all repo_tests), real reach loss. Would NOT catch: reach-floor band (T113), anything in tools, autobot_shared, hooks dir, or scripts tests, promtool/ChromaDB, vitest (out of scope).

Other own-CI guards: comment stripper ok; name predicate ok; sizes ok; PR body headings ok; no trailers. Not verified: the other ~60 workflow-enumerating guards.
Static review; not run.

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Addressed at b377352. Not run locally; needs CI. The workflow cannot be dispatched before it is on the default branch.

  1. Own CI (glob): the *.yml record in _glob_declared_uncovered.py is shrink-only ("never add one"), so joining it was not allowed. The test now enumerates workflows through the shared git helper (tracked_paths on the directory, suffix filtered), which declares no glob. No shared glob-free helper for "all workflow files" existed; this one is the repository's own enumeration helper.
  2. Skips: the floor now counts executed tests (passed, failed, errored; an expected failure counts as executed). Skips are matched against a reviewed allowlist (file and reason prefix; promtool and the two real-ChromaDB tests, each naming ci: move the inline cheap checks (baseline audit, Semgrep ERROR, real-ChromaDB session, promtool) into composite actions so the pre-board lane can call them #21360, each with a source marker the guard checks still exists). A skip off the list is red. green_with_skips is a separate overall value; the final step exits non-zero only for red or cancelled. Every skipped node id and reason is in result.json and summary.md. Schema is 2, documented in the workflow header.
  3. Equivalence: roots are every pytest.ini root except the product trees (a test requires the two lists to cover testpaths exactly); AUTOBOT_REACH_AUDIT=1 is on because the head is now merged with the base tip before the environment is built (local commit, never pushed; conflict = red; merged, base_sha, behind_base recorded; AUTOBOT_RATCHET_BASE_SHA set to the base tip). Promtool, the dependency-floor check and the ChromaDB session are not provided; the first and last show as allowlisted skips, all three are listed as not covered in the docs and workflow header. Docs rewritten as a checklist with the boarding rule including behind_base = 0.
  4. Whole-file loss: each shard records the recorded test files that exist in the tree it tested; any that produced no executed or allowlisted-skipped test is named in checks.guards.problems and makes the lane red. Files newer than the record are not required.

Non-blocking: a truncated junit file or shard meta is reported as a problem naming the shard and the result is still written; the shard table is built from durations restricted to the lane's roots; the new tests cover each rule (mass skip, allowlisted, off-list, vanished file, truncated junit, conflict, schema fields) and run the merge against throwaway repositories.

@mrveiss mrveiss left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Verdict: CHANGES @ b377352

Earlier findings

  1. Glob (own CI): resolved. No glob literal, .glob( or fnmatch in the five new python files; workflows come from tracked_paths(_ROOT, ".github/workflows") plus endswith(".yml") (preboard_guard_lane_21359_test.py:53). rglob("shard-meta.json") in the report is a plain filename.
  2. False green on skips: mostly resolved. The floor counts executed tests only, so a mass skip is red (report.py:guards_status). An off-list skip is red and listed. Allowlisted-only gives green_with_skips. xfail (type="pytest.xfail") counts as executed; strict xpass is a failure element. The allowlist matches file AND reason prefix, so another reason in an allowlisted file is red. Not resolved for module-level skips (new blocking 2).
  3. Equivalence: resolved. The shards use the suite's own repo_tests.stable_shard with a restricted durations file, not a second sharding. The test requires GUARD_ROOTS | PRODUCT_ROOTS == pytest.ini testpaths, and the guard roots must be named in the suite's invocation. The merge runs before the install, with a neutral -c identity. Conflict gives red. AUTOBOT_RATCHET_BASE_SHA and AUTOBOT_REACH_AUDIT=1 are set. The audit reads only that env var (_reach.py:108-113). The merge step imports only stdlib modules, so it runs before the install. The docs list what is not covered.
  4. Whole-file loss: resolved. Files recorded and present in the tree must produce an executed or allowlisted test. I found no false-red candidate: the three marker-deselected files under the roots are absent from .test_durations.

Blocking

  1. Own CI will fail. repo_tests/preboard_guard_lane_verdict_21359_test.py:287-306 imports subprocess and calls _git(origin, "init", ...) and _git(repo, "commit", ...). It does not import autobot_shared.isolated_git. _isolated_git_detect.offends() flags that, and test_no_new_test_builds_a_git_repo_without_the_isolated_env fails (the offenders are frozen in a shrink-only baseline). scrubbed_git_env alone does not satisfy it. Fix: use isolated_git_env() or the git() helper from autobot_shared.isolated_git; the -c user.* flags then become unnecessary.
  2. Module-level skips never match the allowlist. Both chromadb tests skip at import (importorskip and pytest.skip(..., allow_module_level=True), line 25-27 in both files). pytest's junit writes a collect skip as message="collection skipped" with the reason only in the element text (_pytest/junitxml.py:214; node id is file::dotted.module). parse_junit reads only message. All four chromadb allowlist entries are therefore dead, and that skip is red. The tests only feed synthetic message=<reason> XML, so none of this was exercised. Fix: match collect skips on the element text, and add a test using a junit file written by real pytest for a module-level skip.
  3. The unreviewed-skip set is not evidenced, so the lane may be red on every dispatch. The suite logs have no -rs: shard 2/8 reports "48 skipped", shard 1/8 "2164 skipped", with no reasons or paths (runs 43167364612, jobs 131021500610 and 131021500794). I cannot attribute them to the lane's roots. Static sweep: about 250 skip sites under the roots. These look likely to fire on a runner and are not allowlisted, not verified: python_floor_test ("python3.10 not installed"), ansible-playbook is not installed (gpu_detection, postgresql_fleet, update_applies), gh could not resolve the repository slug in workflow_closed_reference_guard_test (no token in the lane), Postgres-binaries and initdb skips (slm_postgres_copy_20639, sync_to_slm_db_update_classify_14459), and the redis backup harness. The lane cannot be dispatched before it is on the default branch, so the author's "first run may be red" is a real unusability risk. Fix: get skip reasons from CI (a throwaway -rs step on a branch run of the same roots, or junit from a suite run) and complete the allowlist from that, or fix the skipping tests.

Non-blocking

  • green_with_skips and green both exit 0, and behind_base is not visible on the run's tick. Add a ::notice or ::warning that carries overall, the skip count and behind_base.
  • Running only the guard roots drops autobot-backend/conftest.py, so a repo_tests module that passes only because of the stubs it leaves would be a false RED. I found none; this is unverified.
  • Guard-style source-reading tests under the excluded product trees (for example autobot-backend/a2a/capability_enforcement_guard_test.py, autobot-backend/services/rag_single_definition_19280_test.py) are not run by the lane. The docs say the product trees are not covered, so this is disclosed, not hidden.

Guard sweep

  • comment stripper: ok.
  • test-name predicate: ok (the .yml suffix check is unrelated).
  • symbol forks: ok (only private names collide; the detector skips _ names).
  • python-paths filter: the new workflow is added; pytest.ini and .test_durations not checked against the filter.
  • file sizes: all under 600 lines.
  • No trailers on branch commits.
  • Not checked: docs line budget, the other ~60 workflow-enumerating guards.

Own CI at this head: 35 checks, all pending, none completed.

Static review; not run.

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Second review (Verdict: CHANGES @ b37735263a), point by point. New head cc52a45b85. Not run locally; needs CI; cannot be dispatched before it is on the default branch.

K1 (own CI, isolated git). The merge tests now build their repositories with autobot_shared.isolated_git (make_repo, and git(...).stdout.strip() as the runner), the way base_gated_size_ratchet_19673_test.py and check_baseline_no_growth_test.py do. No subprocess import, no -c user.* flags, nothing added to the baseline.

K2 (module-level skips). parse_junit moved to pipeline-scripts/preboard_guard_lane_junit.py. The shapes come from _pytest/junitxml.py at pytest 9.2.0 (the version the suite's CI log prints; pytest is unpinned in requirements-ci-test.txt). pytest.ini sets no junit_family; the lane passes xunit1, which keeps file and line (xunit2 drops them).

  • Call-time skip, skipif: message=<reason> (pytest removes Skipped: ), text path:line: reason.
  • Collection skip (importorskip, allow_module_level): message="collection skipped", no type, reason only in the text as str((path, lineno, 'Skipped: <reason>')); testcase classname="", name=<dotted module>, file=<module path>. Read with ast.literal_eval, regex fallback, first line only; node id is the module path, so the per-file check and the allowlist (file and reason) match.
  • xfail: type="pytest.xfail", counts as executed. Strict xpass: a failure. Collection error: an error on the module testcase.
  • xunit2 (no file): falls back to the dotted module name; the allowlist already accepts that form.
  • The suite uploads no junit file, so there is no CI artifact to copy; the fixtures in repo_tests/preboard_guard_lane_junit_21359_test.py follow the writer's source, stated in the module docstring. The synthetic helper now writes the real call-time shape (line, time, text). Both ChromaDB modules are tested end to end: green_with_skips, two covered-by-suite-only.

K3 (skip set). Evidence does not exist yet. Completed main run 43167364612 and train run 43167822566 upload only ci-apt-debs (and deployment-summary); coverage run 43167365110 uploads coverage-shard-1..12 (line data, no outcomes); test-durations uploads durations only. No junit anywhere, and the shard logs print counts only. So I did not invent entries. Added: -rs on the python-shard pytest invocation in ci.yml (it is an inline option, not a variable; no guard pins the option string), so this PR's own CI run prints SKIPPED [n] file:line: reason per shard. Next push: read the final summary of the step "Run unit tests - backend, shared, tts-worker, repo_tests" in each python-suite shard N/M job of this PR's CI run, keep the lines under the lane's roots, and classify each. Rule as implemented (workflow header and docs): a skip is accepted only if listed, by file and reason prefix, as covered-by-suite-only (suite runs it, the lane does not; the five promtool and ChromaDB entries, follow-up #21360) or equivalent-to-suite (the suite skips it too, so the train is no stricter); anything else is red. result.json carries skip_classes and a skip_class per skip. The issue for silent-skip guards is not filed yet: it needs the observed list, and the reviewer's static candidates are unverified.

Non-blocking. The run's page now has a ::notice (green), ::warning (green_with_skips) or ::error lines (red) with overall, behind_base and skip counts by class; the summary heading names overall. .test_durations was already in the python filter; pytest.ini was not and is added (the uncovered-reads record lowered 34 to 33, which the pre-push guard demanded). Docs: the not-covered line now names source-reading guards inside the product trees and the skip classes; no line-budget guard names that file. The autobot-backend/conftest.py question and the product-tree guards are checkboxes on #21360. conftest result: repo_tests has its own conftest.py and fixtures are directory-scoped, but autobot-backend/conftest.py leaves about fifty sys.modules stubs at import that leak to other modules in the same suite worker; a repo_tests module relying on one would be a false red in the lane. None known; unverified.

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Verdict CHANGES @ 2dbcbb6 addressed at 0fda8c9.

Not run locally; needs CI.

@mrveiss mrveiss left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Verdict: APPROVE @ 0fda8c9

Scope: delta 2dbcbb6..0fda8c9 (one commit, 5 files, no sync merges); the third review's verification of the rest stands.
B1 resolved: pipeline-scripts/preboard_guard_lane_skips.py:85-92 now holds only the promtool entry; no entry names either ChromaDB module or a chromadb reason. Count = 1 covered + 5 silent + 18 by-design (12 constructor calls, one expanding to 6 models) = 24. Stated 24 in the workflow header, the PR body and the docs wording (promtool only); no test asserts 28. No dead helper or import left (_covered is still used by promtool).
Tests, read statically: (a) with the ChromaDB lines out of _OBSERVED, lane_verdict (report.py:161-167) returns green_with_skips whenever guards status is success_with_skips, i.e. any allowed skip is present, regardless of class; covered 0 is therefore right and the test asserts {0, len(observed), 0}. The _NOT_LISTED chroma cases are off-list, so red. The stub-reason fixture goes through the real collection-skip junit shape (file attr, message "collection skipped", element text); the "could not import" fixtures go through the call-skip shape (support.skipped), which is not the importorskip collector shape but reaches the same result since skip_class matches file plus prefix only. The junit test file covers the real collector shape for that reason. The all-four test: unreviewed = 4, since the count is per skipped item, not per (file, reason). (b) junit tests: is_allowed_skip false for both shapes and the dotted-module form; the renamed verdict test expects red with unreviewed 2; the promtool warning test uses the entry's file and the exact prefix "promtool not found at", so covered = 1 and green_with_skips. (c) stale_entries is unaffected.
Docs: the section is still a bullet checklist (6 bullets), contains the new first-run rule, and matches the code (promtool the only suite-only class, ChromaDB runs in the lane and a skip is red).
Hygiene: no new ast.parse, comment-marker matching, filename predicate or globs; no unused names; lines at most 120 in non-test files (the long lines in the test fixtures are E501-exempt for *_test.py, as before).
Issues: #21371 now says 8 files / 10 skip lines for empty-parameter skips and 12 files by design (8+1+2+1), consistent with the module; the #21360 comment is accurate.

Non-blocking:

  1. pipeline-scripts/preboard_guard_lane_skips.py:216 comment still says "5 + 5 + 18 entries"; should be 1 + 5 + 18. Fix it with the next push.
  2. The PR is CONFLICTING with main per GitHub; merge main before any train boarding.

Static approval; this PR's own python-suite has not completed at this head (last full run at cc52a45: 7/8 shards green, the 8th failure since fixed; CI at this head is still queued or running). The lane itself cannot be dispatched until it is on the default branch; its first dispatched run on main is its real test, as the docs now state. Static review; not run.

@github-actions

Copy link
Copy Markdown
Contributor

Auto-sync: merging main into issue-21359-preboard-fast-lane conflicts

The sync aborted the merge and pushed nothing. Conflicts are information, so it never resolves one itself. Below, for each conflicted file, are the commits that touched it on each side since the merge base f87e78874a. Merge main in yourself and push; the label clears on the first run that finds this branch 0 behind.

repo_tests/python_filter_uncovered_reads.py

side commit subject issue refs
main 0c17573444 docs(ci): note the uncovered-reads ceiling lowering (#21325) #21325
main 0f6158dbff test(ci): record the apt guard's inputs as covered by the python filter (#21325) #21325
this branch cc52a45b85 fix(ci): drop pytest.ini from the uncovered filter reads now that the filter covers it (#21359) #21359

@github-actions github-actions Bot added the sync-conflict Set by the branch sync (#19548) label Nov 12, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 7

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f87e788 and 0fda8c9.

Files selected for processing: 14

  • .github/filters/python-paths.yml
  • .github/workflows/ci.yml
  • .github/workflows/dispatch-preboard-guards.yml
  • docs/developer/CLAUDE_REVIEW.md
  • pipeline-scripts/preboard_guard_lane.py
  • pipeline-scripts/preboard_guard_lane_junit.py
  • pipeline-scripts/preboard_guard_lane_report.py
  • pipeline-scripts/preboard_guard_lane_skips.py
  • repo_tests/_preboard_guard_lane_support.py
  • repo_tests/preboard_guard_lane_21359_test.py
  • repo_tests/preboard_guard_lane_junit_21359_test.py
  • repo_tests/preboard_guard_lane_observed_skips_21359_test.py
  • repo_tests/preboard_guard_lane_verdict_21359_test.py
  • repo_tests/python_filter_uncovered_reads.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread docs/developer/CLAUDE_REVIEW.md Resolved
@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Brought up to date with main (normal merge, after the apt-retry landing in #21349). Not run locally; needs CI.

Conflict: one file, repo_tests/python_filter_uncovered_reads.py. Main lowered MAX_UNCOVERED_READS 34 -> 32 (the filter now covers the setup-python-suite action and hardened-smoke-test.yml); this PR removed the pytest.ini entry. The record has 32 entries on main, 31 after removing pytest.ini, and the guard requires equality, so the value is 31. The python-paths filter merged without a conflict and keeps both sides' entries. I read the quoted paths in this PR's tests and found no new uncovered read, but did not run the guard, so CI confirms 31.

ci.yml: no change on main since this PR's head; the only difference from main is -rs (plus its comment).

Checked against main: the lane passes no inputs to setup-python-suite (the action's only input has a default); no allowlisted test file changed on main and all 24 markers are present; the new apt tests skip only when sh or timeout is missing, which the runner image has (derived from source, not from logs); none of them is in .test_durations.

Fixed the stale entry count in the skip allowlist comment: 1 + 5 + 18 (24).

@mrveiss mrveiss left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Verdict: APPROVE @ 4b4e604

Scope: delta 0fda8c9..4b4e604 only = merge d9fe321 (second parent c5a3f23, main tip) + one count-comment fix. The earlier reviews of the lane's own content stand. Head is MERGEABLE, 0 behind main.
Net change vs main (three-dot): 14 files, all this PR's (lane workflow, 4 pipeline-scripts/preboard_guard_lane*.py, support module + 4 21359 tests, 5-line filter addition, ci.yml, 9 lines in CLAUDE_REVIEW.md, and the uncovered-reads record). Two-dot diff vs main of setup-python-suite/action.yml, clean-install.yml, scripts/ci, docker/apt, ENV_VARS.md is empty: main's #21330 content is intact.
Uncovered-reads rule (python_filter_covers_its_guards_test.py): the measured set is every concrete-file read in repo_tests/*.py (quoted path or X / "a" / "b" composition) plus python-gated ci.yml job tokens, minus those the filter covers. It must equal UNCOVERED_READS (no new, no stale) and its count must equal MAX_UNCOVERED_READS exactly. Parsed the head file with ast: 31 entries, MAX = 31. Against main the file differs only by dropping pytest.ini and 32 -> 31; the two entries main removed (setup-python-suite action, hardened-smoke-test.yml) stay out and are covered at python-paths.yml:78-79. pytest.ini is covered at :425, .test_durations at :476, the lane workflow at :422.
Reads of this PR's tests, reproduced with the guard's own detector over the five files: only .github/workflows/ci.yml and .github/workflows/dispatch-preboard-guards.yml are concrete repo files outside the exempt trees; both covered. The rest are synthetic or exempt trees (repo_tests, pipeline-scripts). pytest.ini is read through lane.testpaths, not a literal in a test, and is covered anyway. Nothing is neither covered nor recorded. The ci.yml comment tokens name no real file.
Filter: diff vs main is five added lines (two entries and comments), nothing dropped.
ci.yml: diff vs main is -q -> -q -rs plus the 3-line comment, nothing else.
Lane vs main: the lane uses ./.github/actions/setup-python-suite with no with:; the action's only input (apt-fallback-mirror) has a default. The options-equality test is untouched by the merge.
Allowlist: 1 + 5 + 18 = 24 entries (the 18 = 12 literal + 6 generated); the comment fix is correct and is the only change to pipeline-scripts/repo_tests files this PR owns. Markers spot-checked on origin/main for 7 entries (7/7 present).
New #21330 tests under the lane's roots: the only skips are pytest.skip when shutil.which("sh") (and timeout in hang_bound) is None (apt_retry_one_mechanism lines 343/466/486/503, hang_bound line 129); the other two files have no conditional skip. sh and timeout exist on the hosted image, so no unlisted skip fires.
Findings: none blocking, none non-blocking.
Own CI at head: not complete (check runs queued, none failed); python-suite has not completed at this head.
Standing condition: this is a static approval; the lane's first dispatched run on main is its real test. Static review; not run.

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Two review-thread defects fixed on this head.

D1 - one base for every job. A new first job pin resolves the base branch tip once (preboard_guard_lane.py resolve; the ref name is still validated against the branch-name pattern) and exposes base_sha as its output. guards and types need it and merge exactly that commit, fetched by id (a malformed or unfetchable pin fails the job with a clear message); neither re-reads the branch. The types job writes the base it merged to types-meta.json (artifact preboard-types-record) and result downloads it. The cross-check stays as a second net: every shard and the types record must equal the pinned base_sha, otherwise a problems entry makes the lane red; a missing or unreadable types record or an empty pin is red too. result.json keeps one base_sha (the pinned one); no field was added, so the schema stays 2, and the workflow header documents the pin and the record.

D2 - boarding rule. The docs now require base_sha to equal the base branch tip at boarding time, with the one-line check (git rev-parse origin/main after a fetch, or the commits API form the docs already use); otherwise dispatch again. behind_base stays in the result and is described as fixed when the base was resolved.

Tests. Verdict: differing types base is red and named, matching base leaves green alone, missing types record is red, shards off the pinned base are red, empty pin is red. Static: base resolved in exactly one job, both consumers use its output, result gets the pin and the types record, run blocks hold no inline expressions. Merge: pinned commit merged after the branch moved, malformed pin refused, unfetchable pin fails clearly.

Not run locally; needs CI. It cannot be dispatched before it is on the default branch.

@mrveiss mrveiss left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Verdict: APPROVE @ c181760

Scope: delta 4b4e604..c181760 (4291026, c181760); 7 files, earlier reviews stand. Head is 0 behind main, MERGEABLE.

Job graph (read as Actions will run it): (a) pin has no needs, 5-min timeout, outputs.base_sha -> steps.pin.outputs.base_sha; the step has id: pin and resolve prints exactly base_sha=<sha> into $GITHUB_OUTPUT; default-depth checkout is enough (it fetches the base ref explicitly); setup-python precedes the script. (b) guards/types: needs [pin], PINNED_BASE_SHA via env, never inline; an empty output fails the 40-hex check (SystemExit), the step fails and later steps are skipped, so nothing merges and goes green. (c) result: needs [pin,guards,types], always(); pin is passed via env; both artifact downloads are continue-on-error, as is the shard one, and the summarize step still writes result.json. (d) Artifact names match (preboard-types-record up/down). (e) yaml.safe_load OK; 4 unique job names; no ${{ in any run block (checked by script); action pins are ones already used on main (checkout@v7, setup-python@v7, upload-artifact@v7.0.2, download-artifact@v8).

Fetch-by-SHA: guards/types check out with fetch-depth 0, so the pinned commit is normally already local; git fetch origin <sha> still succeeds against github.com, which serves reachable commits by id (actions/checkout does the same), then rev-parse --verify <sha>^{commit} must equal the pin. List-argv subprocess, no shell. The author's unknown is a low risk; if wrong, the failure is loud ("cannot be fetched") and red, never green.

Fail-closed: pin failed or cancelled -> guards and types skipped -> guards_status needs_result != success -> failure, types skipped != success -> red (cancelled only if guards/types themselves read cancelled). Empty pin, no shard artifacts: "no pinned base" + "no shard reported" + types record 0 -> red. Cannot read green.

base_problems: all equal -> none; a shard differs -> named problem; types differs -> problem; types record missing or unreadable JSON -> problem ("recorded 0"); pin empty -> problem; pin malformed -> shards/types cannot equal it -> problem. merged:false in the types job: its step exits 1, types result failure -> red. No mismatch path escapes.

Tests (static read): types-differs, shards-agree-but-not-pin, missing record and empty pin each assert overall == red and a named problem, so each fails if the cross-check is removed. The static tests read the workflow through the existing workflow fixture (yaml.safe_load) and the ${{ scan covers every job's run steps. The merge tests use the existing isolated-git helpers, local origin, no network. No new repo-path reads in repo_tests (the quoted strings are expressions, not paths), so MAX_UNCOVERED_READS 31 is unaffected. Largest changed file 410 lines; no new function over 30 lines.

Docs: rule now requires base_sha == base tip at boarding with a correct one-line check; behind_base is labelled not a boarding test; still a checklist; matches the code (pin, record, schema 2).

Findings: non-blocking: workflow header line 14 is over-long (cosmetic); a cancelled pin reads red not cancelled (fails closed, accepted).

Standing condition: static approval only. Own CI at this head: python-suite has not started (path-detect queued; the PR-meta checks show cancelled from superseded runs; no failure). The lane's first dispatched run on main is its real test (the by-id fetch and the pin output are only proven there). Static review; not run.

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Merged main (now includes #21373); new head 4b35cfd.
Conflict-free merge, no authored change.

@mrveiss

mrveiss commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE @ e6278f5

Delta reviewed: the only non-merge commit since the last approval (c1817600d1) is e6278f5a11; merge 4b35cfdeaf brings in main only. Read-only review, no tests run.

Severity File:line Finding Required fix
none no findings

Evidence:

  • summarize requires --types (preboard_guard_lane.py add_argument loop) and build_result(env, shard_dir, types_dir) takes three arguments (preboard_guard_lane_report.py), so both old calls failed on signature; both now match.
  • junit test: shards in s/, types record in a separate t/ created by support.write_types (base b*40, equals the env PINNED_BASE_SHA), so the exactly-one-record and pinned-base checks pass; all assertions unchanged, still green.
  • verdict test: the types dir is under tmp_path next to the broken shard, but read_shards globs only shard-meta.json and read_types_records only types-meta.json, so it is not mis-read as a shard. The broken-meta problem (preboard-shard-2: ...unreadable) is still produced and the assertion (red plus that problem) is unchanged; the types record is valid so it adds no extra problem.
  • Other callers: _preboard_guard_lane_support.verdict, the verdict test's summarize calls (lines 222-228) and the workflow's summarize --shards ... --types ... already pass the types argument. No mismatched caller left.
  • Guards: no new file read or ast.parse in repo_tests (the edits only call the existing write_types writer), so MAX_UNCOVERED_READS equality and the parse-cache guard are unaffected; no git use added; test names unchanged.
  • Review threads: 0 unresolved.

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

Labels

area: ci-gates Wave 0 · cluster P — CI gates & merge integrity ci enhancement New feature or request infrastructure needs-structure Missing goal milestone, matching phase label or native parent (#19522) phase:M4.5 Delete dead copies and facades priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant