Skip to content

feat(check): drop links to finished quests after a local merge, upgrade old merge drivers, and keep quest-pinned current - #427

Merged
moq-bot[bot] merged 4 commits into
mainfrom
quest/m0/merge-driver-upkeep
Nov 3, 2026
Merged

moq-bot[bot] merged 4 commits into
mainfrom
quest/m0/merge-driver-upkeep

Conversation

@kixelated

@kixelated kixelated commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m0/merge-driver-upkeep.md: local merges, old merge drivers, and the dev shell's quest-pinned stay current.

Changes

  • quest check --fix (src/cli/move.ts fixLinks, wired in src/cli/main.ts). It drops every Required, Related, or Closes entry that links to a quest deleted in the history of HEAD (and of MERGE_HEAD during a merge) and missing from the working tree. A heading left empty goes too. This is the same core remove() edit that quest rm and quest land's prune make (moq-dev/quest#353).
    • Renames are excluded (--find-renames). A link to a path that never held a quest, and a link in prose, stay for the check to report.
    • Paths are read with --relative, so a --root nested in its repository works.
    • It prints M path for each edited document, leaves the edits unstaged, and refuses while a quest file has unresolved conflicts. Then the usual check runs (with --base too, if given).
    • The guide's merge line (assets/AGENTS.md) and README's "Merge quest lists" section point at it.
  • Driver upgrades (src/cli/resolve.ts OLD_DRIVERS, src/cli/setup.ts register). Any command, and quest init, now replaces a merge.quest.driver set to the exact string from moq-dev/quest#219 or moq-dev/quest#256 with the current DRIVER. Any other value, a custom driver, stays. The quest resolve help and README say so, replacing README's "clear it by hand" advice. (The maintainer's main clone still has feat(resolve): merge concurrent quest link-list edits with a git merge driver #219's driver, so this upgrades it on the next quest command.)
  • The pin.
    • flake.lock bumps quest-pinned from 7a191e6 (2026-11-01) to acb8682 (current main), so the dev shell's quest no longer reads a leftover quest:merge label as a hold.
    • .github/dependabot.yml's weekly nix update gives quest-pinned its own group, listed first, so a nixpkgs bump that needs work (like moq-dev/quest#281) doesn't hold it back. It also exempts it from the 7-day cooldown.
    • The flake.nix comment says so.
  • quest rm deleted the quest and its quest/m0/README.md entry.

Choices made without asking

  • Which deletions count. The quest suggested "deleted between merge-base HEAD <merge-head> and HEAD". This PR uses "deleted anywhere in HEAD's (and MERGE_HEAD's) history and absent from the working tree" instead, so a plain quest check --fix works before, during, and after the merge, with no ref to pass.
    • Cost: a list link a branch adds to a quest finished long ago is also dropped, not reported. It still shows in the M output.
    • A mistyped link (a path that never existed) is still reported.
  • Unstaged edits. rm and mv stage because git rm/git mv do. A check's fix stays unstaged, like a formatter's, so it never stages a user's unrelated hunks in the same file.
  • The pin's upkeep: Dependabot, with a dedicated group and no cooldown. Chosen over a release-checklist step (no releases yet) or a recurring quest (manual each time). A scheduled workflow that opens PRs would need write credentials, which the guide rules out. Main's commits are reviewed before they land, so the cooldown adds only lag for this input.
  • Shadowing an old driver from another scope. If the effective merge.quest.driver is an old quest string from global config, quest writes the current one to the clone's local config and never edits the global file.

Limitations

  • Dependabot's nix updater has never run against quest-pinned (a flake = false GitHub input added on 2026-11-01). Its next weekly run will show whether it opens the group's PR. If it doesn't, nix flake update quest-pinned by hand still works.
  • The pin points at today's main, which doesn't include this PR. The driver upgrade and check --fix reach the dev shell's pinned quest with the next bump after this merges.

Validation

  • just check passed. just test passed: 943 passed, 2 skipped; 474 lifecycle (run with env -u CLAUDE_CONFIG_DIR).
  • quest check --base origin/main passed. The new dev shell builds, and quest help resolve succeeds with the bumped pin.
  • New tests: test/move.test.ts "quest check --fix" (after a merge commit and during a --no-commit merge, renames/mistyped/prose links kept, nested root, unmerged refusal, outside a work tree). test/resolve.test.ts "upgrades a driver an older quest registered, but not a custom one".

Review

mechanical fix by codex / Codex: Merged base and re·solved src/cli/main.ts preserving PR link cleanup before base checkout validation; passed bun run build, bun run check, and bun run test (969 passed, 2 skipped). (head 7e95115)

  • Reviewer: quest review, Codex, gpt-6.1-sol, medium effort, base origin/main acb8682.
  • Round 1 on e722ffb: 1 finding, fixed. src/cli/move.ts: deleted paths from git log were repository-relative, so a --root nested in its repository never matched. Now --relative, with a test.
  • Round 2 on afbf1f9: 0 findings.

Suggested follow-ups

  • None needed. Once Dependabot's next nix run lands, check that it opened a quest-pinned group PR. If it didn't, plan a fallback (a release-checklist step).

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

kixelated and others added 3 commits November 2, 2026 19:42
…pgrade old merge drivers

quest check --fix drops every Required, Related, or Closes entry linking to
a quest deleted in the history of HEAD (and MERGE_HEAD during a merge) that
the working tree lacks, as quest rm does, so merging the base needs no hand
edits for the quests it finished. Renames, mistyped links, and prose stay
for the check to report; it refuses while a quest file is unmerged and
leaves its edits unstaged. The guide's merge line points at it.

Any quest command now replaces a merge.quest.driver an older quest
registered with the current DRIVER, keeping custom drivers.

Bump quest-pinned to current main, and give it its own Dependabot nix
group without the cooldown so the dev shell's merge driver stays current.

Finishes quest/m0/merge-driver-upkeep.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Keep local merges and the merge driver current feat(check): drop links to finished quests after a local merge, upgrade old merge drivers, and keep quest-pinned current Nov 3, 2026
@kixelated
kixelated marked this pull request as ready for review November 3, 2026 04:01
@coderabbitai

coderabbitai Bot commented Nov 3, 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: c7ebc6a6-f19f-4125-bf6b-cef0b415e5aa
  • 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
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 3, 2026
@moq-bot

moq-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

quest land watch: the merge queue removed this pull request at afbf1f9 because it conflicts with main (merge_conflict).

The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs.

(written by quest land watch)

@moq-bot
moq-bot Bot enabled auto-merge November 3, 2026 16:00
@moq-bot

moq-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

quest land watch: armed auto-merge on this pull request at 7e95115, so it joins the back of the merge queue once its required checks pass, with the land fixer's fix (codex / Codex): Merged base and re·solved src/cli/main.ts preserving PR link cleanup before base checkout validation; passed bun run build, bun run check, and bun run test (969 passed, 2 skipped)..

(written by quest land watch)

@moq-bot
moq-bot Bot added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 2aa60a2 Nov 3, 2026
16 checks passed
@moq-bot
moq-bot Bot deleted the quest/m0/merge-driver-upkeep branch November 3, 2026 16:13
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