Skip to content

quest: a quest's PR leaves its quest accurate - #155

Merged
kixelated merged 2 commits into
mainfrom
quest-plan/landed-quests
Oct 20, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest-plan/landed-quests

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Summary

Plans A quest's PR leaves its quest accurate in m0, ranked right after finished milestone links.

On 2026-10-20 a quest-tree audit in moq-dev/moq found quests left behind by PRs merged from their own branches:

No skill step tells a PR to delete or trim its quest, and merge enables auto-merge without looking at the file.

The plan:

  • Guide rule: assets/AGENTS.md states the rule once. The PR that finishes a quest deletes the file and every link to it, and a partial PR rewrites the quest to what remains.
  • Guard: quest check --base <ref> [--branch <head>] fails when a quest branch's diff neither deletes nor modifies that quest's file.
  • Merge step: the merge skill runs the guard before enabling auto-merge. When it fails, the skill fixes the branch, and asks only when what remains is unclear.

Decisions

Goal: a quest's PR leaves the tree accurate when it merges. A PR that finishes its quest deletes the file and every reference, a partial one rewrites the quest to what remains, and merging refuses a quest-branch PR that does neither.

  • ✅ Yes
  • Wording only (no merge-time refusal)

Split into a skill-wording quest and a separate mechanical-guard quest?

  • Two quests
  • ✅ One quest

Which milestone?

  • ✅ m0
  • m1

How should the merge-time guard work?

  • ✅ quest check --base: reads the head branch; a quest branch's diff must delete or modify its quest file; the merge skill runs it; repos may run it in CI
  • CI action only
  • Skill step only

Where does the rule live?

  • ✅ The guide, said once; the merge skill runs the guard
  • Every skill

When the guard fails at merge time, what does the merge skill do?

  • ✅ Fix on the branch (delete, or rewrite to the remainder the PR body names), re-check, merge; ask only if the remainder is unclear
  • Refuse and report

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

Plan the guide rule and a 'quest check --base' guard so a PR merged from
a quest branch deletes its finished quest or rewrites it to the remainder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T04:56:56.203358Z 6e82df8 New commits
🔒 Security Review ✅ Completed 2026-10-20T04:57:26.939103Z 6e82df8 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d0318fa970

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread quest/m0/landed-quests.md Outdated
Comment on lines +51 to +52
- `assets/skills/merge.md` runs `quest check --base <base> --branch <head>`
with the PR's base and head ref names before enabling auto-merge. On a

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply the guard to the decision-inbox merge path

When the planned decision-inbox merge is implemented, it will call mergePullRequest directly as specified in quest/m0/kix/merge.md, without going through this skill. Updating only assets/skills/merge.md therefore still lets a quest-branch PR merge from the hosted UI without modifying its quest, contradicting the goal that merging refuses such PRs; add the guard to that merge path or make the inbox merge quest depend on and explicitly reuse it.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partly agreed. The inbox merge is a maintainer's click on a hosted service with no checkout, and it already refuses failing checks and branch rules. Planning chose the local quest check --base guard plus optional CI over a CI-only or hosted guard, so porting the diff to the GitHub API is out of scope here. I added a non-goal: merges that bypass the merge skill (GitHub's button or the decision inbox) are guarded only where the repository runs the guard as a required check.

(Written by Claude Opus 5.5)

Comment thread quest/m0/landed-quests.md Outdated
Comment on lines +51 to +52
- `assets/skills/merge.md` runs `quest check --base <base> --branch <head>`
with the PR's base and head ref names before enabling auto-merge. On a

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve the base to the PR's actual commit

Using the PR's bare base ref name can silently weaken the guard when the local branch is stale: for example, if local main predates creation of the quest but the PR head contains it, the merge base also predates the quest and the explicit “names no existing quest at the base” exemption skips the finding. The current merge skill does not fetch or update the base ref, and non-default PR bases may not exist locally at all, so pass a fetched remote ref or the PR's base SHA rather than a bare ref name.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. The merge skill step now fetches the PR's base and head and runs quest check --base <remote>/<base> --branch <head> on a checkout of the PR head, so a stale or missing local base cannot move the merge base before the quest existed.

(Written by Claude Opus 5.5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary

Adds A quest's PR leaves its quest accurate to m0, ranked right after finished milestone links. The planning decisions in the PR body are unchanged.

Review fixes (6e82df8):

  • Stale base (Codex, agreed): the merge skill fetches the PR's base and head and runs quest check --base <remote>/<base> --branch <head> on a checkout of the PR head, so a stale or missing local base cannot skip the guard.
  • Decision-inbox merge (Codex, partly agreed): added a non-goal. Merges that bypass the merge skill, such as the web merge button or the decision inbox, are guarded only where the repository runs the guard as a required check. A hosted guard would reverse the planned "local guard plus optional CI" choice, so it stays out of scope.

CI passes and quest check is clean.

(Written by Claude Opus 5.5)

@kixelated
kixelated merged commit 961140f into main Oct 20, 2026
5 checks passed
@kixelated
kixelated deleted the quest-plan/landed-quests branch October 21, 2026 21:05
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