Skip to content

Every flaky pass in Free Tests is now recorded in Trunk or the flaky-test log (GST-3303) - #4572

Merged
capy-ai[bot] merged 2 commits into
mainfrom
ci/trunk-flaky-dispatch
Nov 20, 2026
Merged

capy-ai[bot] merged 2 commits into
mainfrom
ci/trunk-flaky-dispatch

Conversation

@garrytan

@garrytan garrytan commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Free Tests now records every test that failed and then passed on its retry: dispatched runs upload their test results to Trunk, and the quick tier keeps its flaky-test log.
Why: a retried flake must always leave a record. Of the 13 retried flakes since Trunk uploads began (11-09), Trunk saw 11; one missing was on a dispatched run, the other on a main push from before the uploader reached main. The quick tier's flaky-test log was never uploaded at all.
Nothing to do: no check, test or retry rule changes.

What changed

Dispatched Free Tests runs now upload to Trunk, and the quick tier keeps its flaky-test log

Dispatched Free Tests runs now upload to Trunk, and the quick tier keeps its flaky-test log.

Before/after as text: Dispatched Free Tests runs now upload to Trunk, and the quick tier keeps its flaky-test log
--- Before · before.txt · captured output
+++ After · after.txt · captured output
 # trunk-flaky-tests runs on
 if: always() && needs.free-suite.result != 'skipped' && ((github.event_name == 'push' && g
+ithub.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch' || (github.eve
+nt_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repos
+itory))
-ithub.ref == 'refs/heads/main') || (github.event_name == 'pull_request' && github.event.pu
-ll_request.head.repo.full_name == github.repository))
 
 # quick-bun-default steps after the quick tier
+- Upload the quick tier's flake ledger -> artifact flake-ledger-quick (always, 90 days)
-(none: flake-ledger.jsonl written, never uploaded)
 
  • trunk-flaky-tests also runs on workflow_dispatch. Only someone with write access can dispatch, and the job still checks out and runs nothing from the branch, and is the only job that sees the token.
  • quick-bun-default uploads its flaky-test log as flake-ledger-quick (always, ignored when empty, kept 90 days), so the run's flaky-pass summary and test:health count it. It keeps no JUnit report, so its retries reach that log, not Trunk. docs/TESTING_INTERNALS.md says so in its sections on Trunk and the flaky-test log.
  • The wiring test pins both, and it fails on the old workflow.
Why

A test that fails and then passes on its retry is green but not fixed, so it has to leave a record somewhere. A dispatched run on test/spawn-sync.test.ts (run 44494151996) left none in Trunk, and every flaky pass in the quick tier was thrown away. Now both are kept.

Blast radius

Only the Trunk upload job's trigger and one new upload step in the quick tier change. The upload job is fail-open at step and job level (continue-on-error: true), nothing needs it, and it has permissions: {}. A dispatch run already needs write access and runs that branch's own workflow file, so it gives nobody a new way to reach the token (free-tests.yml:899-930 read). Every reader of flake-ledger-* matches on the name prefix (scripts/lib/ci-history.ts:345, lib/factory-scorecard.ts:340), and the run summary reads a flake-ledger-quick folder correctly (script ran).

How the gap was found

Every flake-ledger-* log since 11-09 03:25Z (13 entries) was matched to its test in Trunk collection 7yDVXXE3 and to that run's test runs. 11 show a failure and a success in the same run, and Trunk's Pass on Retry monitor flagged them. Run 44494151996 (dispatch, test/spawn-sync.test.ts) has no Trunk runs, because the uploader skipped dispatch events. Run 42560717406 (main push, 11-09 04:14Z) predates the uploader on main.

Pre-Landing Review

Pre-Landing Review: 1 issues — 0 auto-fixed, 1 asked (0 fixed, 1 skipped), 0 deferred, 0 noted.

Four readers checked the final change: a batched specialist (testing, security, state machines) found nothing, and a second-model review found nothing. Two notes stay open, neither blocking:

  • [ADVISORY] A quick-tier flake now counts toward a main run's flaky files, so files in the quick subset get two chances per main run to reach the 5% flaky-file rule. The rule counts each run once per file, so one run can't count twice. Skipped: it is intended, and a one-line docs note can follow.
  • [Low] Runner-sizing dispatch runs (free_runner, free_shards or free_jobs set) now upload to Trunk too, which can add timing noise to a detection-only collection. Noted for a follow-up that narrows the condition to dispatches with empty sizing inputs.
Exploratory QA

Smoke check: flake-summary over a folder holding a flake-ledger-quick log beside a shard log lists both files, the quick one under shard quick (pass). No plan checks: this is a bug fix with no plan file.

Scope Drift

Scope Check: CLEAN. The four changed files, plus the docs audit's one clause, match the stated fix.

Plan Completion

No plan file: bug fixes need no plan review.

Verification Results

No plan obligations. Smoke check: 1 PASS, 0 FAIL, 0 BLOCKED, 0 NOT RUN.

TODOS

No TODO items completed in this PR.

Tests
  • Free Tests (CI run 44804207423 at 66441e5): 1719 test files passed, 0 failed, including the macOS and Windows launcher and named-regression jobs.
  • Before CI: 51 test files that read free-tests.yml or flaky-test logs, 869 pass, 0 fail; actionlint clean; the new wiring assertion fails on the old workflow.
  • Trial merge with Free Tests plans its shards beside the reuse and docs checks (GST-3303) #4570 (also edits free-tests.yml and its wiring test): merged cleanly; free-tests-workflow-wiring, ci-reuse-workflow-wiring, docs-only-workflow and test-health-report tests 62 pass, 0 fail; actionlint clean.
Agent notes

Open in Capy

Refs GST-3303 (follow-up on audit change 6: the retry stays under R9).

Approvals

No approvals recorded for branch ci/trunk-flaky-dispatch.
Plan: exempt: bug fix, no plan review needed (R4)
Plan check: exempt bug fix

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=2 fixed=0 scope=frozen dispatches=2 est_input_tokens=5651
Gate edits: none detected (3 listed, 2 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

Documentation

Status: updated. One factual fix in docs/TESTING_INTERNALS.md, no blockers.

Scope: base a529769 to head 10d9d5a on ci/trunk-flaky-dispatch, committed changes only (4 files: .github/workflows/free-tests.yml, changelog.d/ci-flaky-passes-always-recorded.md, docs/TESTING_INTERNALS.md, test/free-tests-workflow-wiring.test.ts). Nothing was staged, unstaged or untracked. Docs that mention the flake ledger or Trunk were checked against the workflow.

Documentation health:

  • docs/TESTING_INTERNALS.md: Updated. The Flake ledger section now names the quick tier's flake-ledger-quick artifact next to the per-shard and Windows ledgers. The Trunk section already covered dispatch runs and the quick tier.
  • CONTRIBUTING.md: Current. Its flake-ledger summary is still accurate.
  • docs/flaky.md: Current. It covers gstack-flaky, which this change doesn't touch.
  • changelog.d/ci-flaky-passes-always-recorded.md: Read only. It matches the workflow change.

Coverage debt: No new public commands, flags or settings. The CI behavior change (Trunk upload on workflow_dispatch, plus the quick-tier ledger artifact) is described in docs/TESTING_INTERNALS.md. No gaps.

Diagram drift: None. No diagrams reference these jobs.

{
  "schema_version": 1,
  "pr": 4572,
  "head": "66441e58328540d7521ee043563dc4faf940fc73",
  "version": "1.102.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1719,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 44804207423,
      "attempt": 1,
      "tree": "9475df61dbcf1def241e2ac76f31bd197be23cdd"
    }
  ],
  "calls": 20,
  "session_kind": "unattended",
  "run": "ship-4572-p1",
  "head_tree": "9475df61dbcf1def241e2ac76f31bd197be23cdd",
  "product_patch_id": "0abacacf444a20eeced260101cd7e5a9a13d9d7d",
  "gstack_version": "1.102.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 20,
    "rules": "3e7e9d5d0a0d8879",
    "base": "a529769efd989ac5e83e4ee09f1ac7b199e686d3",
    "registry": "a529769efd989ac5e83e4ee09f1ac7b199e686d3",
    "gate_scan": {
      "tagged": 0,
      "head": "66441e58328540d7521ee043563dc4faf940fc73"
    },
    "reasons": [
      "gate-class",
      "runtime=20"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @9475df61dbcf (8 checks, current for 66441e583285)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/44804207423/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44804207423/attempts/1",
    "free-tests.yml/cso-windows-launcher: https://github.com/garrytan/gstack/actions/runs/44804207423/attempts/1"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/, README.md, CONTRIBUTING.md, AGENTS.md, CLAUDE.md"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 2,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "est_input_tokens": 5651,
    "dispatches": {
      "specialist-batched": 1,
      "red-team": 1
    }
  },
  "gate_dispositions": []
}

…test log (GST-3303)

Dispatched Free Tests runs now upload their JUnit to Trunk, and the quick tier uploads its flaky-test log as flake-ledger-quick.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

…edgers (GST-3303)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 6a64c49 into main Nov 20, 2026
53 checks passed
@capy-ai capy-ai Bot mentioned this pull request Nov 20, 2026
capy-ai Bot added a commit that referenced this pull request Nov 20, 2026
- Two /ship approval records stop needing workarounds. (#4549)
- For contributors: the paid auto-decide check counts a start step that ran while the skill loaded. (#4543)
- The destructive-command check closes three ways past its disk-wipe and force-push blocks. (#4534)
- A green CI run still counts when the repository's artifact storage is full. (#4536)
- `/cso` now audits repositories that track symlinks. (#4567)
- A doc-sync eval stops failing when the audit child drops one field from its result line. (#4555)
- The browse daemon no longer picks port 10080, which Chromium refuses to open. (#4554)
- Opted-in telemetry now says why a skill run ended, which coding agent and model family ran it, and whether an upgrade worked. (#4542)
- A preregistration with only its write-up and plain data now gets the write-up review: one reviewer, one round. (#4544)
- When owner rulings don't clear a stopped review, `gstack-review-read` now says which findings are left. (#4553)
- The prompt-routing hook now names your installed bug-fix skill on bug reports, alone, and never puts /verify ahead of it. (#4539)
- Owner rulings now close a stopped review whose findings were logged in a findings file. (#4568)
- /ship can finish after the owner accepts a stopped review's findings as open notes. (#4552)
- /ship no longer starts the full test suite on your machine when CI's earlier run can't be reused (GST-3277). (#4565)
- The prompt-routing hook no longer acts on words inside backticks. (#4566)
- In Claude Code, a gstack skill's start step now runs when the skill loads, so the model can't skip it. (#4509)
- gstack's telemetry backend only accepts writes through its own validated endpoint, and the community dashboard now counts real use. (#4537)
- gstack now says what it's adding before it adds a background job or a browser extension. (#4538)
- For contributors: every flaky pass in Free Tests is now recorded. (#4572)
- For contributors: Free Tests on pull requests starts its test shards one round of small jobs sooner. (#4570)
- Secret values written as `name=value` at the end of a path are now hidden. (#4571)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.

1 participant