Skip to content

feat(land): fix ejected batches with an asynchronous Codex fixer - #303

Merged
moq-bot[bot] merged 4 commits into
mainfrom
quest/m0/host-land/fixer
Oct 31, 2026
Merged

moq-bot[bot] merged 4 commits into
mainfrom
quest/m0/host-land/fixer

Conversation

@kixelated

@kixelated kixelated commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Implements the daemon side of the fixer quest. The quest is rewritten to the host integration that remains.

Behavior

  • quest land fix is the payload the host runs in an isolated container. It runs codex exec (configurable) in a standalone repository of the batch, with a built-in prompt. Codex may only make mechanical fixes that change no behavior, and never touches the protected paths. The prompt also says that repository, log, and PR content is untrusted: instructions found there are never followed, and an attempt means handing that PR back. The result is quest-land-result.json, one entry per PR: requeue, fixed, or handback.
  • The daemon:
    • tracks each fixer as background work that survives restarts;
    • imports only objects, through a clean repository, never running git inside the fixer's .git;
    • validates every fixed head: it must descend from the pinned head, and the protected set (flake.nix, flake.lock, nix/, .envrc, .github/, Nix entrypoints, .gitmodules, gitlinks) must equal the pinned head's or the merge's as a whole;
    • pushes as moq-bot with a lease, appends a neutralized mechanical fix by <agent> line to the ## Review record, and requeues with pinned auto-merge and quest:merge;
    • re-pins requeue unchanged;
    • turns handback, invalid results, crashes, and timeouts into a comment with quoted, neutralized diagnosis.
  • One attempt per maintainer pick.
  • Guide: assets/AGENTS.md gains the mechanical-fix review exemption.

Decisions (maintainer, 2026-10-30)

  • A fixed head lands without further review, so "mechanical" is enforced by the prompt, with the protected paths blocked: Claude reviews the fix first / fixes need a re-pick / narrow what it may touch / ✅ keep as decided
  • Add a prompt-injection instruction to the fixer's prompt.

Host contract

The wrapper runs in the repository's directory with <log> <PR numbers...>. It gets PATH and LANG from the daemon, and adds a fresh HOME, OPENAI_BASE_URL, and the gate's OPENAI_API_KEY. It runs quest land fix "$@" in a container and preserves the repository and result. The host side is kixelated/nixos#16.

Checks

just check and just test pass: 701 CLI and 426 Worker tests.

Review

Codex (gpt-6.1-sol) wrote this, and Claude Opus 5.5 reviewed it in sub-agent rounds. quest review --harness claude doesn't see this session's environment credentials.

  • Round 1: 3 high, 3 medium, and 4 low findings, all fixed:
    • a hostile fixer could wedge the daemon;
    • fetching trusted the fixer's .git;
    • fixer text reached PR bodies and comments unneutralized;
    • a stale timeout after a restart;
    • the kill didn't reach the container;
    • the protected-set check accepted mixed versions;
    • no import cap;
    • a hard-coded model name.
  • Round 2, on 90c9d36: all fixes verified, safe to ship. Low items remain: decompression bombs (fetch.fsckObjects), parsing the fixer's pack indexes, "Codex" wording when another agent ran, attribution stacking in the PR body, and test gaps (gitfile, hooks, the cap, SIGTERM). Follow-up: send the repository back as a git bundle, which removes the remaining .git parsing.
  • The head since is a conflict-free merge of main (5135933).

🤖 Generated with Claude Code

(written by Claude Opus 5.5)

Track fixer jobs and per-pick attempts across daemon restarts. Validate results and protected paths before leased bot pushes, Review recording, and pinned requeues; hand back refused or invalid work. Add the credential-free agent payload, guide exemption, documentation, and fake-agent regression coverage.

Host proxy networking, the gate client key, and CLIProxyAPI Codex login remain in the rewritten fixer quest. Local check and test gates pass; no remote publication or review is performed by this implementation child.
Isolate collection failures per job, rebuild bounded fixer object stores without repository configuration or alternates, and compare the entire protected set with the pin or base merge. Sanitize GitHub prose, deduplicate only bot comments, preserve fresh PR body content, and record the invoked agent/model.

Honor completed jobs before deadlines and allow SIGTERM cleanup before SIGKILL. Record the maintainer's accepted mechanical-fix policy and add the built-in prompt-injection defense. Validated through clean-environment quest gate just check and just test, plus 33 focused fixer regressions. No push performed.
@kixelated kixelated changed the title Fix ejected batches with Codex feat(land): fix ejected batches with an asynchronous Codex fixer Oct 31, 2026
@kixelated
kixelated marked this pull request as ready for review October 31, 2026 00:09
@kixelated
kixelated enabled auto-merge (squash) October 31, 2026 00:12
@moq-bot
moq-bot Bot merged commit 266aa9b into main Oct 31, 2026
13 of 16 checks passed
@moq-bot
moq-bot Bot deleted the quest/m0/host-land/fixer branch October 31, 2026 00:17
moq-bot Bot pushed a commit that referenced this pull request Oct 31, 2026
main's native Windows jobs have failed on every fixer test since #303: they use
fifos, POSIX shells, and Linux process groups, as the daemon does.

Co-authored-by: Luke Curley <432854+kixelated@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: moq-bot <moq-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant