Skip to content

Trunk flaky-test upload runs after Free Tests, off the pull request's checks (GST-3303) - #4579

Merged
capy-ai[bot] merged 5 commits into
mainfrom
ci/trunk-upload-workflow-run
Nov 20, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
ci/trunk-upload-workflow-run

Conversation

@garrytan

@garrytan garrytan commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Pull requests no longer wait on the upload that sends Free Tests results to Trunk. It now runs on its own after Free Tests finishes.
The quick test tier's flaky passes now reach Trunk too, so a test that fails once and passes on its retry shows up there wherever it ran.
Nothing to do: no required check changes, and the upload still never affects whether a check passes.

What changed
  • The Trunk upload moves out of free-tests.yml into its own workflow, trunk-flaky-tests.yml, which runs when a Free Tests run completes. It covers the same runs as before (pull requests from this repository, pushes to main and manual runs), skips pull requests from forks, checks out nothing and runs no shell. Its GitHub token can only read the finished run's files.
  • The quick tier on the install-default Bun now keeps its JUnit reports (bun run test:quick --junit-dir <dir> is new) and saves them as quick-junit. The new workflow uploads them as a separate bun-default variant, because the same files also run on the pinned Bun.
  • The tests that pin the workflows' shape, and the testing docs, follow the move.
Why

Pull requests waited on the Trunk upload. In 61 of 223 pull request runs it was the last job to finish, and in the slowest twentieth of those it held the checks for about three more minutes. Now the checks finish when the tests do, and the quick tier's flaky passes reach Trunk as well.

Blast radius

It touches the Free Tests workflow, the new Trunk Flaky Tests workflow, the shard runner's --junit-dir flag and the tests that pin those workflows. It is safe because nothing reads the new workflow's result and both JUnit uploads in Free Tests are fail-open; the workflow wiring test checks this (18 pass at 77954d0), and the full Free Tests run at d07496a passed (run 44836203825).

Numbers

Before, from 223 pull request Free Tests runs between 11-09 and 11-20 that had the upload job: the upload job finished after every other Free Tests job in 61 runs (27%). When it did, it was 7 s later at the median, 175 s later at p95 and 380 s at most. Waiting for a GitHub runner explains most of that gap in 13 of the 61 runs. So this saves almost nothing on a typical run and about 3 minutes on the slowest twentieth of them. It runs for 12 s once it starts.

How to check it after merge

A workflow that runs after another workflow always uses the copy on main, so the new upload can't run on this pull request. After merge, the first push to main and the next pull request should each show a Trunk Flaky Tests run, and Trunk should show test runs for that commit, including bun-default ones from the quick tier.

Test Coverage

10 of 13 changed paths have tests that would catch a regression (77%). Two gaps are end-to-end only and can be checked after merge: the new workflow firing after Free Tests and downloading the other run's files, and a flaky quick-tier pass reaching Trunk as bun-default. One unit gap: no test runs the full quick tier with --junit-dir; the quick-tier job's own quick-junit file (894,943 bytes at 9ef148b) shows it works.
Tests: 1840 → 1840 (+0 new)
Coverage: 77% value-weighted (77% including 0 weakly covered paths)
Test value: 0 tests written, 0 rejected by the authoring gate, 0 existing tests extended, 0 paths weakly covered (weak = ★, gate-failing or unrated).
Tests ran: free 1721

Pre-Landing Review

First pass over the whole change: the specialist checklists (testing, security, state machines) found nothing, and the red team raised 2 informational findings (details recorded privately), both fixed in 77954d0. Second pass over that fix: no findings. A second-model review (GPT-6.1 Sol) of the fix was clean, and the gate reader over the whole diff found nothing.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL test/free-tests-workflow-wiring.test.ts:270 The wiring test asserts the JUnit upload steps fail open but not their timeout-minutes: 3 (same gap for the shard upload), so a later edit could drop the limit unnoticed.
  • INFORMATIONAL .github/workflows/trunk-flaky-tests.yml:10 The header comment's 61 of 223 figure was not recounted by this reader (it comes from the PR body's measurement); a code comment, not a published number.
Exploratory QA

Two checks, both pass. The quick-tier job at 9ef148b uploaded a non-empty quick-junit file, so test:quick --junit-dir writes reports. --junit-dir without --ci-run or --quick still exits 1 with its message and writes nothing. After the fixes the report writer was byte-identical and the wiring test passed at 77954d0. The new workflow itself can't run before merge.

Scope Drift

Scope Check: CLEAN

Verification Results

No plan-specific checks (the plan line exempts this change); the automatic checks above ran: 2 PASS, 0 FAIL, 0 BLOCKED, 0 NOT RUN.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. No documentation edits were needed.

Scope: the release diff from 87a473e to d07496a (12 files: the free-tests.yml and new trunk-flaky-tests.yml workflows, the test-free-shards --junit-dir with --quick support, the workflow inventory, tests, and the changelog.d fragment). I also searched tracked docs for references to the Trunk uploader, TRUNK_ORG_API_TOKEN, quick-junit, --junit-dir and test:quick.

Documentation health:

  • docs/TESTING_INTERNALS.md: current. The branch already updated the Trunk Flaky Tests and dynamic-CI sections to match the new workflow.
  • changelog.d/ci-trunk-upload-after-run.md: current and accurate against the diff.
  • AGENTS.md, CONTRIBUTING.md, docs/TEST_PORTFOLIO.md, docs/ship-policy.md: current; their test:quick mentions are still true.
  • CHANGELOG.md: historical entry left as it is.

Coverage debt: the new bun run test:quick --junit-dir <dir> option is documented only in the changelog fragment and TESTING_INTERNALS (reference only; no how-to in CONTRIBUTING). Diagram drift: none.

Tests
  • Free Tests at d07496a (run 44836203825): green, 1721 files
  • bun test test/free-tests-workflow-wiring.test.ts at 77954d0: 18 pass, 0 fail
  • bun test test/harness-version.test.ts at 77954d0: 12 pass, 0 fail
  • actionlint 1.7.11 on free-tests.yml and trunk-flaky-tests.yml at 77954d0: clean
Agent notes

Tracking: GST-3303, change 5 of the CI speed plan, plus the quick-tier JUnit upload proposed after #4572.

Local: free-tests-workflow-wiring, ci-reuse-workflow-wiring, trunk-dynamic-ci-observers, shard-jobs, cso-distribution, workflow-action-pins, workflow-shell-lint and the other workflow-reading tests (204 pass), the 16 tests that read TESTING_INTERNALS.md (185 pass), typecheck clean, actionlint 1.7.11 clean on both workflows.

Approvals

No approvals recorded for branch ci/trunk-upload-workflow-run.
Plan: exempt: audited-list
Plan check: exempt audited-list

REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=2 fixed=2 scope=frozen ledgers_read=4 dispatches=8
Gate edits: 16 listed, 16 read, 0 findings — 0 kept, 0 restored, 0 open

Refs GST-3303

Open in Capy

{
  "schema_version": 1,
  "pr": 4579,
  "head": "d07496a8d0615a3c0ae14f29be1a3e80f08a13f1",
  "version": "1.102.1.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1721,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 44836203825,
      "attempt": 1,
      "tree": "94d7ffc3bd1fc1661aae67457deef3c08c5c8062"
    }
  ],
  "calls": 35,
  "session_kind": "unattended",
  "run": "/home/user/.capy/work/ship-4579-9ef148b",
  "head_tree": "94d7ffc3bd1fc1661aae67457deef3c08c5c8062",
  "product_patch_id": "c0ac30d897fac6dbaf9bd8d4be0902f97b8d400f",
  "gstack_version": "1.102.1.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 193,
    "rules": "85b3923b1a978e41",
    "base": "92c57ca4ce41b81af450a7543152fa0e5771928c",
    "registry": "92c57ca4ce41b81af450a7543152fa0e5771928c",
    "gate_scan": {
      "tagged": 5,
      "head": "d07496a8d0615a3c0ae14f29be1a3e80f08a13f1"
    },
    "reasons": [
      "gate-class",
      "runtime=193"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @94d7ffc3bd1f (8 checks, current for d07496a8d061)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/44836203825/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44836203825/attempts/1",
    "free-tests.yml/cso-windows-launcher: https://github.com/garrytan/gstack/actions/runs/44836203825/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44836102438/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=94d7ffc3bd1f tests=38591 skipped=67 runs=44836203825/1 profiles=ci-reuse/free-tests heads=d07496a8d061 verified=2026-11-20T23:28:09.038Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, CONTRIBUTING.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md (re-audit at d07496a after the changelog edit; TESTING_INTERNALS.md already updated on the branch)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 2,
    "fixed": 2,
    "scope": "frozen",
    "rounds": 2,
    "ledgers_read": 4,
    "dispatches": {
      "specialist": 6,
      "red-team": 2
    }
  },
  "gate_dispositions": [],
  "review_targeted": {
    "classes": [
      "gate"
    ],
    "rules": "b3f6f8b4843c0c30",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "c0ac30d897fac6dbaf9bd8d4be0902f97b8d400f",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}

The uploader moves from a free-tests.yml job to trunk-flaky-tests.yml on
workflow_run, so pull request checks no longer wait on it. It keeps the same
event scope (same-repo PRs, main pushes, dispatches), stays detection only and
fail-open, and its token can only read Actions artifacts. The quick tier now
keeps JUnit reports (test:quick --junit-dir), uploaded as the bun-default
variant, so its flaky passes reach Trunk too.

Refs: GST-3303
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.

garrytan and others added 4 commits November 20, 2026 22:41
Refs: GST-3303
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Refs: GST-3303
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
It gets the same three-minute limit and fail-open setting as the shard upload, and the uploader's header cites the measured figure (61 of 223 Free Tests runs).

Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/red-team#2 reader=red-team
Refs: GST-3303
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Refs: GST-3303
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit faae7f7 into main Nov 20, 2026
88 of 89 checks passed
@garrytan garrytan mentioned this pull request Nov 21, 2026
capy-ai Bot added a commit that referenced this pull request Nov 21, 2026
- Habits from nine teams, written into gstack. (#4585)
- Three more habits from teams that run evals. (#4602)
- The /ship conductor trial plan gives its real-problem judge one more attempt on fresh labels after it missed its agreement bar twice, and stops the trial incomplete if it misses again (GST-3003). (#4611)
- The /ship conductor trial plan now stops a trial only at the final remote-gate refusal, gives both arms the same note that the brief overrides team rules, and counts every report the no-gstack arm returns (GST-3003). (#4609)
- The /ship conductor trial plan now ends a trial at the remote gate when its case base isn't main, gives the no-gstack arm a test runner, and audits every trial for exposure to the plan (GST-3003). (#4605)
- The /ship conductor trial plan now runs an uncounted pilot in every arm before its counted trials and takes one planned look at half the cases (GST-3003). (#4587)
- gstack's own use on Capy can be counted, and is kept out of real-use numbers. (#4576)
- Free Tests shards finish closer together. (#4578)
- The weekly test-time recording can land again on its own. (#4581)
- The job-log tree.json step's recommended sleep is long enough for real runners. (#4589)
- Pull requests no longer wait on the Trunk flaky-test upload, and the quick tier's flaky passes now reach Trunk. (#4579)
- Windows Setup E2E finishes sooner on install changes. (#4575)
- Skills no longer stop on Codex when they clean up temp files. (#4612)
- /review on Codex with OpenAI models no longer holds back a review that ran its adversarial pass. (#4622)
- Crew threads on Capy now check in at 500M own tokens, standing threads rotate at 250M and any subagent past 50M gets a look, half the old lines, because Capy's token counts read about half what they did before 2026-11-15. (#4582)
- gstack no longer offers to add a `## Skill routing` section to your project's CLAUDE.md. (#4629)
- The README and docs no longer say gstack makes your agent fix more bugs. (#4598)
- `/eval-plan` now writes eval plans that waste less money. (#4591)
- /cso checks every folder above a source file before it looks at the file, so it never looks through a symlinked folder. (#4592)
- Plan reviews no longer read a /design-review audit summary as the branch's design doc. (#4623)
- Node's built-in test files now run with `node --test` in repos that use vitest or jest. (#4626)
- A quarantined test that the runner skipped now fails the run instead of passing it. (#4590)
- A flaky free test is fixed: the spawnSync overflow check no longer fails about once an hour on CI. (#4613)
- Free Tests runs its shards on 16-core runners. (#4600)
- /office-hours asks for ground truth first. (#4468)
- Every startup session ends with a dated test. (#4468)
- /plan-tune's dream cycle now logs each send of your typed answers to Anthropic. (#4621)
- Landing a ready PR no longer depends on a hand-copied gate decision, and the ready note, release PR and squash message say the right thing. (#4596)
- /ship no longer asks for a fresh review because of a stacked parent that main already had. (#4580)
- Results PRs with large captured agent sessions can be reviewed. (#4574)
- /ship no longer stalls on review notes a reviewer already cleared, counts review rounds the way the review policy reads them, and keeps security findings out of the PR body. (#4595)
- /ship's review readers are now told never to stop processes they didn't start. (#4607)
- /ship's review no longer stops when Capy's own drive sync database grows past 100 MB. (#4606)
- /ship's preflight now honors your repository's time limit for rerunning CI-skipped tests, and tells you when a fresh worktree needs its packages installed. (#4608)
- The slowest free test file is now six files. (#4588)
- Step 11.5 keeps a reviewed head current across base-only merges. (#4577)
- On a Capy install, only the owner's opt-in sends telemetry. (#4597)
- New page: working across agent systems. (#4583)

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