Skip to content

feat(land): hand back a fixer's protected edit as a ready commit - #409

Merged
kixelated merged 2 commits into
mainfrom
quest/m0/land-fixer/protected-commit
Nov 3, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest/m0/land-fixer/protected-commit

Conversation

@kixelated

@kixelated kixelated commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes and deletes quest/m0/land-fixer/protected-commit.md.

When validateFix rejects a fixer result because it edits protected paths (.github/, nix/, flake.nix, flake.lock, shell.nix, default.nix, .envrc, .gitmodules, gitlinks) beyond what the base merge carries, the handback now includes the validated resolution as a ready commit. It uses the same format as a refused fork push from moq-dev/quest#358. A maintainer runs quest land apply <pr>, reviews the protected edits, pushes, and re-picks the PR. Protected edits still never land automatically.

Changes

  • validateFix throws a new ProtectedEdit error for the protected-set check. importFix turns it into a FixerRefusal that carries the resolution, but only while the PR is still at its pinned head, which is the only head quest land apply can rebuild on. The refused-push path in publishHead now uses the same ready() helper. Both the host gate (src/cli/land-fixer.ts) and the queue watcher (src/cli/land-watch-fix.ts) pass the head the PR stands at.
  • The gate stores the resolution from either refusal in its single outer FixerRefusal catch. Before, only publishHead's refusal stored one.
  • Resolution has an optional cause: "protected", which is kept in the job state and not in the comment marker. The comment uses it to say why the fix came back and to ask for a review of the protected edits. The v1 marker is unchanged, so existing handbacks still apply.
  • A fix that merges no base is now carried as a patch on the PR head itself, with base set to the head. A head that already contains the base is treated the same way. quest land apply then makes a one-parent commit, Apply the quest land fixer's fix to <branch>, instead of a merge. A fix that merges only part of the base still gets a plain handback.
  • assets/land-fix.md lets the fixer make a protected edit when the mechanical fix needs one, such as a conflict in flake.nix. It says to prefer fixes that leave protected paths alone, to report the fix as fixed, and to name the protected paths in the reason, since quest land hands it back instead of pushing it. Before, the prompt said "never edit", so the fixer handed these PRs back unresolved and there was nothing to apply.
  • Docs: the README landing and watcher sections, plus the quest land apply and quest land serve help text.
  • Tests: a protected conflict resolved and applied as a two-parent merge, a protected fix that merges no base applied as a one-parent commit, the comment wording, and the watcher's handback of a protected fix.

Choices made without asking

  • The fixer may now edit protected paths. The quest's Goal assumes fixer-written protected edits exist, but the old prompt forbade them. The base-alone fix (proposeFix) still refuses protected edits and opens the halt issue: its branch lives in the upstream repository, where an unreviewed workflow change would run with the repository's secrets.
  • Non-merge fixes are carried too. I widened resolution() instead of only covering merges, so a protected fix to a failing check, such as a workflow lint fix, also comes back ready.
  • No list of the edited paths in the comment. The fixer's reason names them, and the maintainer reviews the rebuilt commit itself. Listing contributor-controlled paths would add escaping surface for little gain.

Conflicts expected

Lockfile merges also edits assets/land-fix.md. Its plan says a fixer-written flake.lock comes back through this ready commit, which matches the prompt wording here.

Checks

just check and just test pass locally on be49fcf6. quest check --base origin/main passes.

Review

  • Reviewer: Codex (quest review), gpt-6.1-sol, medium effort
  • Head: be49fcf6fd7a46b3649e95a271d425340f9d922b, round 1
  • Findings: none

Follow-ups

None.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

When validateFix rejects a fixer result for editing protected paths beyond
what the base merge carries, the handback now carries the validated
resolution in the same form as a refused push, for `quest land apply`. The
prompt lets the fixer make such an edit when the mechanical fix needs it,
knowing quest land never pushes it. A fix that merges no base is carried as
a patch on the PR head itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title A protected edit the fixer writes comes back as a ready commit feat(land): hand back a fixer's protected edit as a ready commit Nov 3, 2026
@kixelated
kixelated marked this pull request as ready for review November 3, 2026 03:07
@coderabbitai

coderabbitai Bot commented Nov 3, 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 49 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: 3b68f7c7-aed6-4e9b-a0c2-4ba59a7e3d01
Commits

Reviewing files that changed from the base of the PR and between 91058d2 and be49fcf.

Files selected for processing: 12
  • README.md
  • assets/land-fix.md
  • quest/m0/host-land/fixer.md
  • quest/m0/land-fixer/README.md
  • quest/m0/land-fixer/lockfile.md
  • quest/m0/land-fixer/protected-commit.md
  • src/cli/land-apply.ts
  • src/cli/land-fixer.ts
  • src/cli/land-watch-fix.ts
  • src/cli/main.ts
  • test/land-watch.test.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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@kixelated
kixelated added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit c4165f5 Nov 3, 2026
19 checks passed
@kixelated
kixelated deleted the quest/m0/land-fixer/protected-commit branch November 3, 2026 15:24
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