Repository navigation
feat(land): the watcher disables a test seen flaking twice in its own PR - #406
Conversation
Quest-Claim: a32acf64ebfdf217
The watcher keeps the repository's flaky verdicts by test in flaky.json and tells each failed build's fixer round which tests flaked before. When a known test flakes again, the fixer commits the skip and its follow-up quest in quest/m0/flaky/ on a `disable` branch from the base; the watcher validates that commit, pushes it to quest-land/flaky-<sha>, opens it as a PR with its Review recorded, and enqueues it like any other. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
Two follow-ups from the /quest-spawn coordinator's evidence check. Both are relevant to this PR's flaky-disable rule, so they belong here:
(Written by Claude Opus 5.5) |
|
quest land watch: the merge queue removed this pull request at 73b45f1 because it conflicts with The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs. (written by quest land watch) |
|
quest land watch: armed auto-merge on this pull request at d60228f, so it joins the back of the merge queue once its required checks pass, with the land fixer's fix ( (written by quest land watch) |
Completes
quest/m0/queue-watcher/flaky.md: a flaky failure is re-enqueued unchanged (which the watcher already did), and a test seen flaking twice is now disabled in a separate PR with a follow-up quest. The watcher enqueues that PR with no human pick.Changes
Per-repository flaky record (
src/cli/land-watch-flaky.ts): the watcher stores each flaky verdict inflaky.jsonin its state directory. Verdicts are grouped by the fixer'sfailuresignature, across every PR, and keep the failingmerge_groupjob URLs. A fixer round's job file now carries those URLs (runs).Fixer input: before each failed-build round, the watcher writes the tests that have flaked and are not yet disabled to
.git/quest-land-flaky.jsonin the fixer's checkout. That file is bounded to 50 KB, most recently seen first, with each test's last 10 verdicts' jobs.quest land fixreads it (bounded, no symlinks) and appends it to the agent's input asKnown flaky tests: [...]. The nixos fixer client already tars the whole checkout,.git/included, so the host needs no change.Prompt (
assets/land-fix.md, new## Flaky testssection): when a listed test flakes again, the fixer reuses its signature and commits, on adisablebranch frombase:#[ignore = "flaky: /quest/m0/flaky/<name>.md"],test.skip,pytest.mark.skip);quest/m0/flaky/<name>.md, whose Goal is to fix the test or delete it, linking the jobs that showed the flake;quest/m0/flaky/README.mdepic, creating the epic if it is missing.It returns the commit as
"disable": "<sha>"on its requeue entry.parseFixResultacceptsdisableonly on arequeue.Validation (
recordFlaky): the round's verdict is recorded first. Adisableis taken only once the test has 2 verdicts; one verdict alone is ignored. A taken disable is imported and checked withvalidateFixagainst the base, so it must descend from the base and leave every protected path untouched, and it must add exactly onequest/m0/flaky/<name>.md. A refused disable waits for the test's next flake.Publication (
advanceDisablesinsrc/cli/land-watch-fix.ts): the watcher lease-pushes the disable toquest-land/flaky-<sha12>and opens a PR on the base it was built on. The PR body lists the verdicts with their job links and a## Reviewrecord of the mechanical change. The watcher then enqueues the PR (or arms auto-merge) through the samerequeueit uses for fixed PRs. Each step is recorded, so a restart repeats none. A failed push or a GitHub error is retried on the next pass. An enqueue GitHub refuses is reported on the disable PR, which then waits for a maintainer. If the queue later drops the disable PR, the watcher handles it like any other PR.Docs and tree: the README's watcher section describes the record. The quest is deleted, and its links in the queue-watcher and land-fixer epics now point here.
Choices made without asking
validateFix's protected paths, the watcher only checks that the disable adds exactly one follow-up quest. It does not check the skip itself.quest-land/flaky-<sha12>, so it never collides with a stale branch.Tests
test/land-watch.test.ts: an end-to-end run over three PRs. The first verdict's disable is ignored, the second's editsflake.nixand is refused, and the third's is pushed, opened as PR 8 with its Review, and enqueued; a restart does not repeat it. A second test checks the bound on the known-flaky input.test/land.test.ts:disableis accepted only on a requeue, andquest land fixpasses the known list to the agent and rejects a malformed one.just checkandjust testpass locally: 938 CLI tests and 474 worker tests.Suggested follow-ups
quest/m0/flaky/epic passesquest check. The epic's end-to-end run covers the flaky re-enqueue but not the disable.quest land serve) still requeues flaky failures without recording them. This was left out because gate work is frozen until the gate is retired.Review
mechanical fix by codex / Codex:
Merged base and re·solved documentation/test-fixture conflicts preserving both sides; bun run build, bun run check, bun run test (942 passed, 2 skipped), and node node_modules/vitest/vitest.mjs run test/land-watch.test.ts test/land.test.ts (211 passed) passed.(head d60228f)Codex
gpt-6.1-sol, medium effort, viaquest review --base origin/main, head 73b45f1: round 2 reported no findings.Round 1 (head 9662061) raised two findings, both fixed:
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)