Repository navigation
Conversation
Quest-Claim: 3f7ccacfbb8a7b13
…t a base conflict The next batch's size now maximizes the expected PRs landed per check, n(1 - p)^n, at the per-PR failure rate p estimated by maximum likelihood over the last 30 checked batches, kept in batch-policy.json. Halving on each failure held moq at one to three PRs at its measured 22-24% rate, where four lands the most. A PR that would start the batch but conflicts with the base is parked for the fixer (ejected without one), and the batch starts from the next PR in the same round instead of spending a round on the conflict. The quest keeps what remains: the fixer's priority on the host, and whether rerere can replay anything at all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
marked this pull request as ready for review
November 1, 2026 23:47
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
kixelated
enabled auto-merge (squash)
November 1, 2026 23:48
Collaborator
Author
|
Closing. On 2026-11-01 the maintainer decided to move moq-dev/moq (first) back to GitHub's merge queue, serialized, with the Codex land fixer fixing every failure asynchronously and re-enqueuing it. Work on the host gate is frozen apart from what the switch needs, so this batching improvement won't land. The measurements here (failure rate, check time, base-conflict rounds) inform that plan. (Written by Claude Opus 5.5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of Throughput tuning in the land fixer epic.
Summary
src/cli/land-policy.ts, new). After each checked batch, the daemon estimates the per-PR failure rate p by maximum likelihood over the last 30 checked batches: a batch of n PRs passes with probability (1 − p)^n. It then sizes the next batch to maximize the expected PRs landed per check, n(1 − p)^n, which peaks at n = −1/ln(1 − p). The existing cap of 1 + floor(log2 queue) still applies.batch-policy.jsonstays the state and now also holdshistory: [{size, passed}]. Halving on each failure is gone.buildinsrc/cli/land.ts,serveBatchinsrc/cli/land-serve.ts). Before, a PR that would start the batch but conflicted with the base stopped the batch: it was parked, and the round ended without a check. Nowbuildsets each such PR aside and tries the next one.serveBatchparks each set-aside PR for the fixer (or ejects it, without a fixer), the same way rejections already are, then checks the batch it built in the same round. Each check log is now named after the batch's own base PR.quest land serve --help, the epic entry, and the quest are updated. The quest is rewritten to what remains (see below).Numbers (moq-dev/moq gate,
nixos:/var/lib/quest-land-moq/moq-dev-moq)Sources: the 387
batch-*.logfiles and their tails (pass,error: recipefail, orConflicts with the base); theFailure log:/PRs:lines of 222 fixer job logs; andjournalctl -u quest-land-moqfrom 2026-10-30. A passed batch's size is the count oflandedevents after its check. A failed batch's size is its fixer job's PR list, or, before parking, the burst ofejectedevents right after its check.Expected throughput
From a simulation of 40,000 rounds with the 1 + floor(log2 88) = 7 cap:
{"size":1})At the 10–17 minute rounds seen today (~5 checks an hour), that is about 6.4–7 PRs an hour, against 3.8 at one PR per check and 5.3–5.8 with halving. That's about 1.7× today's rate and 1.2× halving's. The 88-PR queue would drain in about 13–14 hours rather than about 23. Simulated windows of 10/20/30/50/100 batches gave 1.38/1.43/1.45/1.46/1.47 PRs per check at p = 0.22. A window of 30 is about 3.5–6 hours of checks: within 2% of the best fixed size, and still quick to follow a changed rate.
Choices made without asking
batch-policy.jsonholds. If the first batch fails, p reads as 1 and the next batch is one PR, until a pass arrives; the estimate settles within about ten batches. Simulations include this cold start.quest checkrejections are screened out before the check and don't count.CPUWeight/IOWeighttoday. The maintainer's session pushed there minutes before this work, so I left it alone.medium) and the fixer cap. The host'squest-land-fixer.socketalready accepts at most three fixers across every gate (kixelated/nixos@aa155d1).Open question for the maintainer (does not block this PR)
rerere (recommend dropping). 43 of the 89 PRs that conflicted with the base conflicted more than once, but only 20 of the 96 repeats named the same files as the PR's previous conflict. More to the point, the gate never resolves a conflict:
squashresets on any conflict, and the fixer resolves in a fresh container clone. The gate'srr-cachewould stay empty. Making it replay would mean training rerere from the fixer's merges and letting the gate apply them in its own squashes. The gate would then land resolutions the PR's head never had. The rewritten quest records this and recommends deleting the item.Deploying
No migration. The live
{"order":"oldest","size":2}reads as size 2 with no history yet. The first checked batch after the deploy starts the measurement.Follow-ups
src/cli/agent.ts:665may launch aclaudefound through a relativePATHentry on POSIX. It came from main moving mid-review, not from this PR.Checks
just checkandjust testpass on the merged head 389140a (823 passed, 2 skipped; worker suite 426 passed). Twoagent.test.tscases fail only when the caller's shell exportsCLAUDE_CONFIG_DIR, both on this branch and on main's; with it unset, everything passes.Review
mechanical fix by codex / Codex:
Merged base and re·solved src/cli/main.ts help-text conflict preserving both intents; passed bun install --frozen-lockfile, bun run build, bun run check, bun run test (836 passed, 2 skipped), and bun dist/quest.js check.(head 09bc0bf)gpt-6.1-sol, medium effort, viaquest review --base origin/main, session01a1997d-e138-7d20-8816-a565b613e2c7.src/cli/agent.ts:665, which this branch doesn't touch; main moved to 97ed0ff (feat(agent): run billed agents on native Windows #348) during the round. The branch then merged main (389140a).(Written by Claude Opus 5.5)
🤖 Generated with Claude Code