Skip to content

fix(pr-kit): keep outdated review threads, check the whole tree for conflict markers, and pin skill contracts - #94

Merged
jbabin91 merged 1 commit into
mainfrom
fix/pr-kit-audit-findings
Sep 25, 2026
Merged

jbabin91 merged 1 commit into
mainfrom
fix/pr-kit-audit-findings

Conversation

@jbabin91

Copy link
Copy Markdown
Contributor

Fixes two pr-kit skill defects from the 2026-09-17 audit and adds pr-kit's first tests. Every command claim below was measured in scratch repos or against live PRs.

Changes

  • get-pr-comments keeps open threads (cpl-0ye). It skipped every outdated thread, but outdated means only that a later push changed the code the comment was left on. Outdated but unresolved threads now appear under Possibly stale — verify, located by originalLine (line is null on them — measured on fix(css): @import with .css in node_modules importing a different package failed to resolve vitejs/vite#15000, #11228, #2432 and Add a skill for chaptered CLI recordings cli/cli#14475).
  • get-pr-comments pages for real (cpl-0ye). The thread query declares $endCursor, which gh api --paginate requires; --slurp returns every page. A node(id) follow-up re-reads a thread with more than 50 comments. Measured with first:2: 5 pages, 9 threads; --paginate follows the thread cursor even when a nested comments page has more.
  • fix-merge-conflicts checks the whole tree (cpl-r73). git diff --cached --check missed a conflicted file left unstaged and failed on trailing whitespace. It is replaced by git diff --name-only --diff-filter=U plus two git grep marker searches with -- ':/': one over the working tree, one over the index (--cached). The pattern covers diff3 ||||||| and markers longer than 7; exit 128 is a failed search.
  • fix-merge-conflicts states that a rebase swaps sides (cpl-r73). A table and sentence: during git rebase, ours is the upstream and theirs is your commit; check git status for rebase in progress first.
  • fix-merge-conflicts handles conflicts that leave no markers. Binaries, symlinks, and paths one side deleted or both sides renamed pass every marker check once staged, with git add silently keeping the working-tree copy (the upstream, during a rebase). The skill now has the agent keep a side or git rm the path explicitly and report it. Submodule conflicts are out of scope: git checkout --ours/--theirs exits 0 on them and changes nothing.
  • pr-kit prose-anchor tests (cpl-k3s). plugins/pr-kit/tests/skill-contracts.spec.ts, 16 vitest tests, pinning the fixes above plus the earlier audit's contracts: the make-pr-easy-to-review tree guard, the fix-ci round cap, no skill invoking a model-disabled skill, every gh field a skill fills in being fetched, and the README's gh requirement matching the skills that call gh. Each of 42 literal mutations fails its own test.
  • Release note: .changeset/pr-kit-audit-findings.md (pr-kit patch).

cpl-121 (README gh claim) was already fixed on main by #54 and is closed with no code change.

Review

/review-cycle:review converged in 5 iterations (Codex, code-reviewer, pr-test-analyzer, silent-failure-hunter; then spec conformance and a maintainability audit). Spec conformance found no missing or wrong requirements.

Follow-ups

  • cpl-yxo — deferred anchor and marker-check gaps (CRLF =======, slashless skill references, True in frontmatter, a submodule cue, nine test-tightening suggestions).
  • cpl-crj — share anchor helpers across plugins and run the model-disabled-reference check repo-wide (3 unchecked references in review-cycle today).

Test plan

  • pnpm test — 727 passed
  • pnpm lint, pnpm format:check, markdownlint — clean
  • claude plugin validate ./plugins/pr-kit --strict — passed
  • pnpm exec oakum check --strict — exit 0

…onflict markers, and pin skill contracts

get-pr-comments skipped every outdated thread, but outdated means only
that a later push changed the code the comment was left on. Outdated but
unresolved threads now go under "Possibly stale — verify", located by
originalLine (line is null on them, measured on vitejs/vite and cli/cli
PRs). The thread query declares $endCursor, so gh api --paginate --slurp
pages the thread list; a node(id) follow-up re-reads a thread with more
than 50 comments.

fix-merge-conflicts replaces git diff --cached --check, which missed an
unstaged conflicted file and failed on trailing whitespace. It now lists
unmerged paths and greps for markers over the whole repository in both
the working tree and the index, treating exit 128 as a failed search. It
states that a rebase swaps ours and theirs, and has the agent decide
conflicts that leave no markers (binaries, symlinks, deleted or
rename/rename paths) explicitly; submodule conflicts are out of scope.

plugins/pr-kit/tests/skill-contracts.spec.ts adds 16 vitest prose
anchors for these fixes and the earlier audit's contracts; each of 42
literal mutations fails its own test.

Closes cpl-0ye
Closes cpl-r73
Closes cpl-k3s
@oakoss

oakoss Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

These packages will release:

  • pr-kit 0.1.2 → 0.1.3 (patch)
  • review-cycle 0.22.0 → 0.22.1 (patch)

@jbabin91
jbabin91 merged commit ecec121 into main Sep 25, 2026
11 checks passed
@jbabin91
jbabin91 deleted the fix/pr-kit-audit-findings branch September 25, 2026 14:57
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