Skip to content

feat(land): drop links to quests the base finished - #353

Merged
moq-bot[bot] merged 5 commits into
mainfrom
quest/m0/helpers/queue-siblings
Nov 2, 2026
Merged

moq-bot[bot] merged 5 commits into
mainfrom
quest/m0/helpers/queue-siblings

Conversation

@kixelated

@kixelated kixelated commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m0/helpers/queue-siblings.md. On quest land, a queued PR that links a quest the base finished after the PR branched now lands, and that link is dropped. Before, the PR was parked for the fixer, or ejected as failed_checks without one. GitHub's merge queue gets nothing more (decision 2).

Changes

  • Drop the base's finished links (src/cli/land.ts prune). The daemon makes two trusted merges: each squash it builds (screening alone, the chain, overlap reports) and the base merged into a PR head before landing. After each clean merge, prune collects the quest files the merged-into side deleted since the PR's merge base. Rename detection is on, so a moved quest doesn't count. It then applies core remove(), the edit quest rm makes, to the staged tree:
    • It drops every Required, Related, or Closes entry linking to one of those quests, and a heading left empty.
    • "Deleted since the merge base" is how it tells a finished quest from a mistyped link.
    • A link in prose stays, so quest check still parks that PR for the fixer, or ejects it without one.
    • Both merges go through prune, so the prepared head lands exactly the tree the chain tested.
    • When it drops links, the prepared merge commit's message names the files it changed.
  • Read from git objects only (src/cli/tree.ts committedSources). This is split out of snapshot, so prune reads quest sources from the merged tree's objects. Nothing from the worktree is read and nothing from the PR runs. It writes blobs with hash-object --no-filters and keeps each file's mode.
  • Tests (test/land.test.ts):
    • A PR whose Required and Related links to a quest the base finished lands. main and the prepared head match.
    • Two sibling PRs land in one batch, where one finishes a quest the other links.
    • A link in prose to a finished quest, and a list link to a quest the base moved, are both still ejected.
    • The two existing ejection tests now use a link to a quest that never existed, since a link to a quest the base finished no longer ejects.
  • README and the quest land serve help describe the drop.
  • Merged origin/main (no rebase), bringing in moq-dev/quest#355's parking, triage, and base check, moq-dev/quest#358, and moq-dev/quest#367. land.ts merged cleanly: every squash (screening, chain, overlap reports) still goes through squash() and prune, and the prepared head through mergeBase and prune (src/cli/land-head.ts). The fixer's results and quest land apply rebuild a tree the fixer made and validated, so they don't prune. The README and land serve help conflicts take main's parking wording, keep a mistyped link as the example finding, and prepend the drop sentence to the help.
  • quest rm deleted the quest and its links from quest/m0/helpers/README.md and quest/m0/helpers/merge-driver.md's Related.

No change to quest merge or src/cli/hold.ts, which moq-dev/quest#347 changes.

Why not the quest's listed options

  • Change the link-list format. Tried with git merge-file: deleting two adjacent entries conflicts in git's line merge, while non-adjacent ones merge. Adding blank lines between entries doesn't help, because diff alignment around repeated blank lines is ambiguous, so the two deletions still touch. No format avoids this short of a unique separator line between every pair of entries.
  • A tolerant quest check. It can't keep the rule that a finished quest leaves no dangling reference once the siblings land. On a gate that never edits the tree, the landed main would keep the dead link until someone cleans it up. quest land writes the tree it lands, so the cleanup can happen at landing, deterministically, and the rule holds.
  • Re-land from quest merge --land. Declined for GitHub's queue (decision 2): those repositories adopt quest land instead.

Decisions

The maintainer picked every recommended option in a /quest-complete session on 2026-11-01:

  1. Spare the PR on quest land by dropping the dead link at landing?
    • ✅ A: drop list links to quests the base finished in each squash and prepared head, as above. Already implemented; no further change.
    • B: keep moq-dev/quest#322's behavior and send the PR to the fixer.
    • C: make quest check treat a link to a deleted quest as done.
  2. Repositories still on GitHub's merge queue.
    • ✅ A: nothing more in quest. Those repositories get both fixes by adopting quest land, so this PR deletes the quest.
    • B: a follow-up quest to re-land from quest merge --land after GitHub's queue drops a PR.
    • C: the format change or the tolerant check, ruled out above.

Choices made without asking

  • "Moved, not finished" uses git's default rename detection (50% similarity). A quest that moves and is mostly rewritten in the same base change reads as deleted, so links to it would be dropped. Dropping a Required link unblocks a quest, so this is the risky direction. It is still checked by the chain's CI and quest check, but neither would notice.
  • remove() also drops Required links to finished milestones, as quest rm does, but only in a merge where the base finished some quest.
  • The prune runs only when the merged-into side deleted a quest file, so other merges stay byte-for-byte unchanged.

Suggested follow-ups

  • The same drop for local merges. An agent that merges the base into its quest branch, as the guide says to after a GitHub conflict, gets the same dead link, and quest check flags it until fixed by hand. A command could apply this edit in a checkout. For example, quest check --fix or quest resolve --finish <merge-head> would drop list links to quests deleted between merge-base HEAD <merge-head> and HEAD, using the same remove(). The guide's merge line would then point to it.

Review

mechanical fix by codex / Codex: Merged base, preserved its quest deletion, combined both CLI help edits, and removed a dangling quest list link; bun run build, bun run check, bun run --silent quest check passed; bun run test had four timeout failures, all passed via bun run test test/agent.test.ts test/init.test.ts test/re·solve.test.ts --maxWorkers=1 --testTimeout=30000. (head f6ad34a)

  • Reviewer: Codex, gpt-6.1-sol, medium effort (quest review --base origin/main).
  • Round 1 on head 9e45521a9ab2d8149abc46b7317753e58d185581 (the origin/main merge): 0 findings.

Local checks on 9e45521: just check passed. just test passed (765 passed, 2 skipped; 426 for each build's lifecycle), run with env -u CLAUDE_CONFIG_DIR. quest check --base origin/main --branch quest/m0/helpers/queue-siblings passed.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 2 commits November 1, 2026 00:17
A queued PR that links a quest the base finishes after it branched used
to fail `quest check` on its squash and be ejected for a fixer, even
though the PR wrote the link while the quest was open. Each squash
quest land builds, and each base it merges into a PR head, now drops
the Required, Related, and Closes entries linking to quests the base
deleted since the PR branched, with `quest rm`'s edit. Deletion since
the merge base tells a finished quest from a mistyped link; a moved
quest is a rename, and prose links still fail the check.

Finishes quest/m0/helpers/queue-siblings.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Sibling quest PRs land through a server-side merge feat(land): drop links to quests the base finished Nov 1, 2026
# Conflicts:
#	README.md
#	src/cli/main.ts
@kixelated
kixelated marked this pull request as ready for review November 1, 2026 21:16
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

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: 05e6eaf1-ac98-45ff-a7a5-229b3ee43502
  • 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

Copy link
Copy Markdown
Collaborator Author

Landing 9e45521.

  • Decisions (maintainer, /quest-complete on 2026-11-01): 1A, drop list links to quests the base finished in each squash and prepared head, already implemented; 2A, nothing more for repositories still on GitHub's merge queue, so the quest is deleted.
  • Merged origin/main (no rebase), bringing in the quest land changes from moq-dev/quest#355, moq-dev/quest#358, and moq-dev/quest#367. land.ts merged cleanly. The README and land serve help conflicts were resolved by hand to take main's parking wording.
  • Local checks pass (just check, just test). Codex review round 1 on this head reported 0 findings. CI passed, and quest check --base origin/main passed.

(Written by Claude Opus 5.5)

@moq-bot
moq-bot Bot disabled auto-merge November 1, 2026 23:34
@moq-bot
moq-bot Bot enabled auto-merge (squash) November 1, 2026 23:34
@moq-bot

moq-bot Bot commented Nov 1, 2026

Copy link
Copy Markdown

codex / Codex land fixer note:

Resolved the conflicts reported on failure-log line 1 by merging base, keeping its deletion of quest/m0/helpers/merge-driver.md, and combining the independent CLI help edits. Removed the Related list entry in quest/m0/merge-driver-upkeep.md pointing to the quest this PR deletes. No runtime behavior was changed by the resolution.

Build, type and formatting checks, and quest validation passed. The full test run completed with 813 passed, two skipped, and four five-second timeouts. All 87 tests in the affected test files passed with one worker and a 30-second timeout (one skipped). The timeout cases were:

  • codex runs with its key variable and reports its thread and last message
  • Codex finished releases scratch and resume restores the registered checkout
  • setup and removal preserve CRLF instructions and recognize CRLF stubs
  • the merge driver > matches native diff3 labels and custom marker size with missing quest

(written by codex / Codex)

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