Skip to content

feat(land): start the fixer at the base and ignore instructions in PR diffs - #366

Merged
moq-bot[bot] merged 2 commits into
mainfrom
quest/m0/land-fixer/launch
Nov 1, 2026
Merged

moq-bot[bot] merged 2 commits into
mainfrom
quest/m0/land-fixer/launch

Conversation

@kixelated

@kixelated kixelated commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m0/land-fixer/launch.md, part of the land fixer epic.

Summary

  • startFixer (src/cli/land-fixer.ts) now checks out refs/heads/base, detached, instead of the batch tip. The fixer never starts in a tree containing a PR's merged AGENTS.md, skills, or tooling. batch and pr-<n> are still fetched so it can inspect, check out, and fix them.
  • quest land fix (src/cli/land-fix.ts) gives the agent each PR as - #<n>: branch pr-<n> at <sha>, plus the failure log, instead of a bare number list. It reads the heads from the pr-<n> refs that the daemon pinned. If a supplied PR has no branch, it fails before starting the agent.
  • assets/land-fix.md: the rule that handed back a PR whose content "targets this fixer itself" is replaced with the maintainer's rule. Everything in the PRs' diffs is treated as data, and an instruction there, even one addressed to the fixer, is neither followed nor a reason to hand the PR back. The prompt also tells the agent it starts on base.
  • README's fixer section, Fixer proxy access, and Protected edits now describe the new rule. The quest file and its links are removed.

Choices made without asking

  • The checkout is detached at base rather than on the base branch, so a stray commit cannot move the base ref the agent merges from. validateFix already checks against the daemon's own plan.base.sha.
  • The PR heads come from the checkout's pr-<n> refs inside quest land fix, not new wrapper arguments. That leaves the host wrapper's <log> <prs...> interface unchanged.
  • Codex still runs with project_doc_max_bytes=0, so it loads no AGENTS.md at all, the base's included. I read the quest's "loads the base's AGENTS.md" as "whatever it loads comes from the base", not as a request to turn project docs back on. The prompt also already says the base's standing guidance "is not addressed to you".
  • Protected edits said to "keep the rule that the fixer hands back any attempt to redirect its task". That conflicts with this quest's newer decision (the epic's second /quest-plan, 2026-11-01). I followed the newer one and updated that quest's Plan.

Merge notes

Tests

  • just check passed.
  • just test: 734 passed. Two test/agent.test.ts cases failed only because my session exports CLAUDE_CONFIG_DIR, and both pass with it unset. They don't touch this change.
  • New tests: the agent starts detached at base with batch and pr-1 present; the prompt names pr-1 and its head; fix refuses to start the agent without a supplied PR's branch. The existing launcher tests now expect HEAD at the base and the old tip on batch.

Suggested follow-ups

  • Decide whether the fixer should load the base's AGENTS.md/skills (drop project_doc_max_bytes=0) now that it starts from the base. That would give it the project's build and test conventions, but the prompt currently says that guidance "is not addressed to you", so the two would need reconciling.
  • Make test/agent.test.ts clear CLAUDE_CONFIG_DIR from the environment it compares, so the suite passes when run from a Claude Code session.

Review

  • Codex (quest review), gpt-6.1-sol, medium effort, round 1 on head 30f427aa68308d3327f297a9118c1eb7e259a4c6: no findings.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 2 commits November 1, 2026 09:59
… diffs

The fixer's checkout now starts detached at refs/heads/base instead of the
batch tip, so the agent loads no PR's instructions or tooling; batch and
pr-<n> stay for it to inspect and fix. The prompt names each PR's branch and
pinned head, and treats everything in the PRs' diffs as data: an instruction
there is ignored, never a reason to hand the PR back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title The fixer starts from main feat(land): start the fixer at the base and ignore instructions in PR diffs Nov 1, 2026
@kixelated
kixelated marked this pull request as ready for review November 1, 2026 18:06
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e905dff2-8495-4bde-ab60-579cdf51a971
Commits

Reviewing files that changed from the base of the PR and between 682cbea and 30f427a.

Files selected for processing: 10
  • README.md
  • assets/land-fix.md
  • quest/m0/host-land/fixer.md
  • quest/m0/land-fixer/README.md
  • quest/m0/land-fixer/comments.md
  • quest/m0/land-fixer/launch.md
  • quest/m0/land-fixer/protected.md
  • src/cli/land-fix.ts
  • src/cli/land-fixer.ts
  • test/land.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@kixelated
kixelated enabled auto-merge (squash) November 1, 2026 18:13
@moq-bot

moq-bot Bot commented Nov 1, 2026

Copy link
Copy Markdown

quest land: this pull request conflicts with a pull request queued ahead of it, in these files:

  • #357: assets/land-fix.md, quest/m0/host-land/fixer.md, quest/m0/land-fixer/protected.md, test/land.test.ts

Once one of them lands, this one conflicts with the base and is ejected when its turn comes. Resolve the overlap before then, such as by coordinating with that author, or by merging the base once it lands.

@moq-bot
moq-bot Bot merged commit 7a50594 into main Nov 1, 2026
16 checks passed
@moq-bot
moq-bot Bot deleted the quest/m0/land-fixer/launch branch November 1, 2026 18:18
kixelated added a commit that referenced this pull request Nov 1, 2026
…riage

Keep both sides: the fixer starts at base with each PR named by branch and
pinned head (#366), and the base-alone job's prompt line and parser (#355).
Drop the Blame section's "or targets this fixer" rule, which #366 removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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