Skip to content

feat(check): flag Required links to finished milestones - #160

Merged
kixelated merged 2 commits into
mainfrom
quest/m0/milestone-links
Oct 21, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest/m0/milestone-links

Conversation

@kixelated

Copy link
Copy Markdown
Owner

Completes quest/m0/milestone-links.md.

Problem

Milestones are permanent, so a Required link to /quest/mN/README.md keeps resolving after the milestone finishes and blocks its quest forever (discussion on kixelated/quest#152). /quest-recurring's gate relies on that link clearing.

Change

  • quest check gains a rule in src/core/rules.ts: a Required entry whose target is a milestone README (a permanent README other than the root) with no ## Required heading is a finding at the entry's line: requires /quest/m0/README.md, a finished milestone; remove the link, and the '## Required' heading with its last entry.
  • Non-child blockers count, so a milestone whose README still lists quests elsewhere is not finished.
  • The root's own listing of its milestones is membership and is exempt. Only the root can list a milestone as a child, so the rule skips the root document rather than computing children.
  • Readiness is unchanged: ready() and blockers() still grep for the heading, as decided in the plan.
  • README: a PR that finishes a milestone removes the links to it too, and quest check flags any it misses.
  • Deletes the quest and its links from quest/m0/README.md and quest/m0/landed-quests.md.

Decision made without asking

  • quest/m0/helpers/move.md linked this quest mid-plan, and that link would dangle. I rewrote the bullet to say quest check already flags these links, and dropped "whichever of the two quests lands second wires it up". Once this merges, the quest rm work owns that wiring. If quest mv/rm lands first instead, this PR should wire rm before merging. A parallel agent is editing that quest, so expect a small conflict there.

Validation

  • just check and just test pass in the Nix shell (249 tests).
  • New finished milestones cases in test/tree.test.ts:
    • a link to an open milestone still blocks;
    • a quest requiring a finished milestone is flagged at its line, and it stays not ready;
    • a milestone with only non-child blockers left is open;
    • the root's listing of a finished milestone passes;
    • removing the link makes the quest ready.

Follow-ups

None.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

kixelated and others added 2 commits October 21, 2026 10:21
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A milestone is permanent, so a Required link to one keeps resolving after
the milestone finishes and blocks its quest forever. quest check now flags
a Required entry whose target is a milestone README with no '## Required'
left; the root's own listing of its milestones is membership and exempt.
Readiness stays a grep for the heading.

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

chatgpt-codex-connector Bot commented Oct 21, 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-21T17:28:06.400601Z 630e2ab PR opened
🔒 Security Review ✅ Completed 2026-10-21T17:33:35.933334Z 630e2ab PR opened
ℹ️ 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.

@kixelated

Copy link
Copy Markdown
Owner Author

Outcome: the quest is complete. just check and just test pass locally (249 tests). One choice was made without asking: quest/m0/helpers/move.md now says quest check already flags finished-milestone links, so the quest rm work owns wiring rm to drop them. No move/rm PR was open when this one was created. If that work lands first instead, this PR should add the rm wiring before merging. No follow-ups.

(Written by Claude Opus 5.5)

@kixelated

Copy link
Copy Markdown
Owner Author

Merge summary: quest check now flags a Required link to a finished milestone (a milestone README with no ## Required), exempting the root's own milestone listing; readiness stays a grep for the heading. The quest file and its links are removed, and quest/m0/helpers/move.md now gives the quest rm wiring to the move/rm work.

Review: Codex completed code and security reviews of 630e2ab with no findings. CI is green and the branch is current with main.

Decision: this PR lands before kixelated/quest#164 and keeps its wording, so #164 adds the rm wiring that drops links to finished milestones after this merges.

(Written by Claude Opus 5.5)

@kixelated
kixelated merged commit ad5e938 into main Oct 21, 2026
14 checks passed
kixelated added a commit that referenced this pull request Oct 21, 2026
quest rm now also drops every Required link to a finished milestone,
including one it just emptied and links that were already stale, and
repeats until nothing changes. The root's listing stays. It reuses the
finished-milestone predicate from the check rule (#160).

The guide's Deletion section points at quest rm instead of a grep.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated added a commit that referenced this pull request Oct 21, 2026
* chore(quest): claim quest/m0/helpers/move.md

* feat: move and delete quests with quest mv and quest rm

`quest mv <from> <to>` moves a quest or epic with git mv and rewrites every
root-absolute link to it. `quest rm [-r] <path>` deletes one with git rm and
drops each Required, Related, or Closes entry that linked to it, with any
heading left empty. Both stage the change, report other mentions without
editing them, and run quest check on the result. mv refuses while a moved
quest has a claim branch on origin or an open PR on GitHub.

The link edits are pure functions in the core (src/core/edit.ts); the CLI
owns git. The GitHub client moves out of wait.ts into src/cli/github.ts so
the claim lookup can share it.

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

* feat(rm): drop Required links to finished milestones

quest rm now also drops every Required link to a finished milestone,
including one it just emptied and links that were already stale, and
repeats until nothing changes. The root's listing stays. It reuses the
finished-milestone predicate from the check rule (#160).

The guide's Deletion section points at quest rm instead of a grep.

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

* fix(mv): keep milestones put, report epic mentions, check upstream claims

- mv refuses milestones as well as the root, as rm does.
- Mentions of a moved or removed epic match its directory path itself,
  not only paths under it, while skipping longer sibling names.
- In a fork's clone, claims also count open PRs in the repository the
  fork came from.

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

* fix(mv): count a fork parent's quest branches as claims

In a fork's clone, a quest branch pushed upstream while its draft PR is
opened is a claim too, so check the parent's quest/* branches through
the GitHub API alongside its open PRs.

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

* fix(mv): encode parentheses and refuse rm of a directory without quests

An unmatched parenthesis in a destination path ended the rewritten inline
link early, so encode both as %28 and %29. rm -r on a directory holding
only non-quest files would delete them all; refuse it instead.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated deleted the quest/m0/milestone-links 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