Skip to content

test(flaky): marathon census reds on 297f50c7 (gh telemetry in fixture HOME, /autoplan handoff) and two free flakes (GST-1793) - #4128

Merged
capy-ai[bot] merged 6 commits into
mainfrom
capy/flaky-2026-11-07
Nov 7, 2026
Merged

capy-ai[bot] merged 6 commits into
mainfrom
capy/flaky-2026-11-07

Conversation

@garrytan

@garrytan garrytan commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 4128,
  "head": "549f3e0f4007412343e586356e2280a0593c3efa",
  "version": "1.98.0.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 192,
      "fail": 0,
      "skip": 0
    },
    "test": {
      "pass": 1627,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 42385155841,
      "attempt": 1,
      "tree": "a744fa98901d03d601631d027e8526711e4321b7"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "a744fa98901d03d601631d027e8526711e4321b7",
  "product_patch_id": "f043d143a5839b1429ee2128fa12c17daf519758",
  "gstack_version": "1.97.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 2,
    "rules": "c6a079fdf812f479",
    "base": "cfabbbbc6196f3e44bebab5c73ae6b33e2c05181",
    "registry": "cfabbbbc6196f3e44bebab5c73ae6b33e2c05181",
    "gate_scan": {
      "tagged": 0,
      "head": "549f3e0f4007412343e586356e2280a0593c3efa"
    },
    "reasons": [
      "runtime=2"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @a744fa98901d (8 checks, current for 549f3e0f4007)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42385155841/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=a744fa98901d tests=36079 skipped=105 runs=42385155841/1 profiles=ci-reuse/free-tests heads=549f3e0f4007 verified=2026-11-07T15:20:07.377Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "AGENTS.md, ARCHITECTURE.md, CLAUDE.md, CONTRIBUTING.md, README.md and docs/ (read: docs/TESTING_INTERNALS.md, CONTRIBUTING.md, docs/TEST_PORTFOLIO.md, docs/PROJECT_STRUCTURE.md)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 1,
    "scope": "frozen",
    "rounds": 2,
    "ledgers_read": 3,
    "dispatches": {
      "specialist": 2
    }
  }
}

What changed

No visible surface changed: every edit is a test, a test helper, a harness pin or a changelog fragment, so this PR carries a text before/after instead of an image.

  • test/helpers/hermetic-env.ts: the hermetic branch of buildHermeticEnv now sets GH_TELEMETRY=0 after the allowlist scrub; a per-test override still wins.
  • scripts/harness-pins/test/helpers/hermetic-env.ts.json: the shared-harness pin records that change as non-behavioral at HARNESS_VERSION 6, with its reason.
  • test/helpers/office-hours-completion.ts: the handoff check accepts /autoplan|/plan-(ceo|design|devex)-review instead of /plan-(ceo|eng|design|devex)-review.
  • test/release-cut.test.ts: two slow exception cases take a 30 s per-test timeout.
  • test/ship-finish-ruled-notes.test.ts: the grant ask names both shas after review_loop_grant.

Why

The marathon census on main 297f50c (run 42371706491) went red twice: autoplan-ceo-only reported "wrote 1 file(s) outside its roots, under .local/state: .local/state/gh/device-id", and office-hours-section-loading reported "Handoff lacks the next-skill recommendation" after a correct /autoplan handoff. Two free tests also failed at random. After this PR the eval children run gh with telemetry off, the office-hours check accepts the menu the skill now offers, and the two free tests stop flaking.

Blast radius

buildHermeticEnv builds the env for every hermetic eval child (agent-sdk, PTY, session and codex runners all reach it through hermeticChildEnv), so GH_TELEMETRY=0 reaches every paid case; that is why the shared-harness pin needed a HARNESS_VERSION decision, recorded here as non-behavioral (gh's stdout, stderr and exit code do not change with the variable). The eval selector does not read that non-behavioral flag, so the pin selects all 252 dependent gate cases; this PR ran the two hermetic probes and reuses one earlier pass instead of the 108 selected PR cases (see Eval Results). The other edits are test-only and touch no shipped code.

Approvals

No approvals recorded for branch capy/flaky-2026-11-07.
Plan: exempt: flaky (daily flaky pass repairs)
Plan check: exempt flaky

Summary

Daily flaky pass for 2026-11-07 (GST-1793). It repairs both marathon census reds on main 297f50c (run 42371706491, #4125) and two free-suite flakes. The census reds were a launch-environment defect (gh 2.103.0 writing a telemetry device-id into the fixture HOME) and an invalid test expectation (the validator still required the retired /plan-eng-review). The free flakes were an all-digit short sha read as a phone number by the approval scanner, and two release-cut cases that need more than Bun's 5 s default. During /ship the branch took origin/main (cfabbbb, the v1.98.0.0 release fold), recorded the harness pin, and relabeled the live gh spawn in the new wiring test as a smoke check after review.

Census reds

  • autoplan-ceo-only: "wrote 1 file(s) outside its roots, under .local/state: .local/state/gh/device-id". This was a launch-environment defect, not a skill defect. The skill's base-branch probe runs gh auth status. gh 2.103.0, which the CI image installs unpinned from the stable apt channel, writes a telemetry device-id under $HOME/.local/state/gh on any command run with telemetry on, and that file lands inside the fixture HOME. With GH_TELEMETRY=0, gh writes nothing. buildHermeticEnv now pins GH_TELEMETRY=0 in the hermetic branch, after the allowlist scrub, and a per-test override can still replace it. The new wiring test checks the pin and the override, and smoke-checks a real gh spawn into an empty HOME.
  • office-hours-section-loading: "Handoff lacks the next-skill recommendation". This was an invalid test expectation. feat: cut standalone /plan-eng-review; /autoplan keeps its eng phase (GST-1698) #4108 made /autoplan the default next-skill recommendation in office-hours/sections/design-and-handoff.md, and the model recommended /autoplan as the skill says. The validator still accepted only /plan-(ceo|eng|design|devex)-review. It now accepts /autoplan|/plan-(ceo|design|devex)-review and no longer accepts the retired /plan-eng-review alone. A new test reads the menu's A–C options from the section file, so the next menu change fails here instead of in a paid run.

Free flakes

  • test/ship-finish-ruled-notes.test.ts (Free Tests 42345572767 shard 2, Require the daemon secret and loopback Host/Origin on the design and iOS QA daemons #4117 @ 320435e, passed on serial retry). The grant ask put passHead's 12-character sha after the word "after". About one sha in 300 is all digits, and pii.phone.e164 reads that as a phone number, so gstack-approvals refused the row. Only a sha right after review_loop_grant is exempt from the scanner. The ask now names both shas after review_loop_grant. ship-release's grant match reads every hex sha in the row, so the test still checks the same thing.
  • test/release-cut.test.ts (ledger 2026-11-06). The two exception cases take 5–6.5 s on a 4-core machine. They time out at Bun's 5 s default in a bare local bun test, while CI uses 30 s. Both cases now carry the free suite's own 30 s per-test timeout.

No threshold, trial count, case kind or model budget changed.

Test Coverage

Coverage: skipped (no runtime file changed; no audit reader). The diff adds tests: test/hermetic-wiring.test.ts gains the GH_TELEMETRY pin, override and smoke case, and test/office-hours-completion.test.ts gains the menu-driven next-skill case.
Tests ran: focused 192
Tests ran: test 1627 (files, carried from CI run 42385155841/1)

Pre-Landing Review

Pass 1 (light depth, frozen scope) dispatched one batched specialist (testing, security, state-machines, red-team checklists). It raised one INFORMATIONAL test-gap at test/hermetic-wiring.test.ts:117: the live gh spawn could not fail on unfixed code, because /ship's offline gh auth status probe in a fresh HOME wrote nothing with or without GH_TELEMETRY=0. That probe went through this machine's authenticated gh wrapper; the unwrapped, unauthenticated gh does write the device-id (see Exploratory QA). /ship auto-fixed it in 549f3e0 by relabeling the case as a smoke check; the two pin assertions remain the regression guard. Pass 2 re-read the fix range on the frozen tree a744fa98901d and found nothing.
Pre-Landing Review: 1 issue — 1 auto-fixed, 0 asked, 0 deferred, 3 noted
REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=0 fixed=1 scope=frozen ledgers_read=3 dispatches=2
Gate edits: none detected (GATE_SCAN tagged=0 at 549f3e0)
Outside review: openai/gpt-6.1-sol (host subagent) completed with no findings; recommendation: approve. The native adversarial pass found four low, non-blocking items: one duplicates the pass-1 smoke-check finding, and three are listed under Review notes.

Review notes

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

  • INFORMATIONAL test/helpers/hermetic-env.ts:127 GH_TELEMETRY=0 is pinned only in the hermetic branch; the EVALS_HERMETIC=0 legacy branch re-pins DISABLE_AUTOUPDATER but not GH_TELEMETRY, and the header comment does not say hermetic-only.
  • INFORMATIONAL test/helpers/office-hours-completion.ts:226 The next-skill regex stops accepting /plan-eng-review but does not reject a handoff naming it beside /autoplan, still accepts /plan-devex-review which the menu no longer offers, and \b lets /autoplan-anything match.
  • INFORMATIONAL changelog.d/capy-flaky-2026-11-07.md:1 The changelog says a bare local bun test stops timing out at 5 s, but only two release-cut cases got the 30 s timeout; other cases were not timed by the reviewer.

Exploratory QA

Not applicable as a product surface: the diff changes only tests, test helpers, a harness pin and a changelog fragment, so no shipped CLI, API or page changed. Two probes of the riskiest assumption gave different results. /ship's probe found no device-id with or without GH_TELEMETRY=0. On this machine gh is a Capy wrapper that sets GH_CONFIG_DIR to an authenticated config, which likely explains it. The lane re-ran the reproduction at 549f3e0 with the unwrapped binary (/usr/bin/gh.real, gh 2.103.0) and GH_CONFIG_DIR/GH_HOST unset, which is the unauthenticated gh a hermetic fixture gets in CI. gh auth status in a fresh HOME wrote $HOME/.local/state/gh/device-id, and the same command with GH_TELEMETRY=0 wrote nothing. stdout, stderr and the exit code were identical either way.

Design Review

No frontend files changed — design review skipped.

Eval Results

The PR-profile selector chose 108 paid gate cases (82 shards) because the shared-harness pin scripts/harness-pins/test/helpers/hermetic-env.ts.json is a derived reference for 252 dependent cases. That is far over the lane's $10 paid cap, so the Captain chose to run only the two probes that exercise the hermetic env directly:

  • hermetic-canary: PASS 1/1, $0.03 (claude-haiku-4-5, at cb46f64)
  • hermetic-sentinel: PASS 1/1, $0.02 (claude-haiku-4-5, at cb46f64)

Reused evidence: autoplan-ceo-only focused PASS 1/1 ($5.16) at 4bfa70a with the same hermetic-env change.

Named gap: the other 106 selected gate cases did not run on this PR. The eval selector does not read the pin's nonBehavioral flag (only lib/ship-release.ts reads it), so the harness pin selects every dependent gate case; that follow-up is with the Captain. The release gate covers these cases after merge.

Review bot comments

No review bot comments.

Scope Drift

Scope Check: CLEAN
Intent: repair the two census reds on 297f50c and two free-suite flakes.
Delivered: the GH_TELEMETRY hermetic pin with its harness-pin decision, the office-hours next-skill check, two release-cut timeouts, the ruled-notes grant wording, tests for each, and a changelog fragment.

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). The Plan line is Plan: exempt: flaky (daily flaky pass repairs).

Verification Results

No plan-specific verification items (plan-exempt flaky pass). Focused lane 192 pass at the final tree; CI free-tests run 42385155841/1 green at 549f3e0.

TODOS

No TODO items completed in this PR.

Documentation

undefined

Test plan

  • focused: bun test --timeout=30000 test/hermetic-wiring.test.ts test/office-hours-completion.test.ts test/release-cut.test.ts test/ship-finish-ruled-notes.test.ts: 192 pass, 0 fail
  • test: bun run test carried from CI free-tests run 42385155841/1 at tree a744fa98901d: 1627 files green
  • bun test test/harness-version.test.ts: 12 pass, 0 fail
  • hermetic-canary and hermetic-sentinel paid probes: 2/2 PASS ($0.05)

Open in Capy

garrytan and others added 3 commits November 7, 2026 14:09
…ccepts /autoplan (flaky pass 2026-11-07)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…otes grant names both shas after review_loop_grant (flaky pass 2026-11-07)

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

trunk-io Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 7, 2026 14:46
…t HARNESS_VERSION 6 (flaky pass 2026-11-07)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…026-11-07

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=testing
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 52d6c46 into main Nov 7, 2026
43 checks passed
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