Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .claude/skills/codetrial-contribute/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,10 @@ the git steps behind them:
commit.
- "Append `Closes #N`" or "avoid ambiguous `Refs`": the PR finishes the issue,
so end the PR body, and by this tree's habit the commit message, with
`Closes #N`, each on its own line. `Refs #N` is for a PR that only touches
the issue, and then the body says what is left; a bare `Refs: #60` told the
reviewer nothing.
`Closes #N`, each on its own line. Avoid `Refs #N`: it belongs only beside a
`Closes #N`, or in a body that states the motivation and the implementation
in full, including what is left; a bare `Refs: #60` told the reviewer
nothing.
- A code change requested in review: check it against the
current head, then make it. When any item in the review is unclear, ask
about all of them before changing any, since items in one review are often
Expand Down
12 changes: 7 additions & 5 deletions .claude/skills/codetrial-contribute/collaboration.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ for its own issue, not folded in.
this pull request is worth proceeding." (#245, closed while #244 fixed
#131). Review the open one rather than writing a competitor.
- Close what the PR finishes. CONTRIBUTING.md has the rule: `Closes #N` when
the PR finishes the issue, `Refs #N` when it only touches it. Maintainers
call `Refs` on a PR that does finish its issue ambiguous ("Avoid ambiguous
`Refs #210`. Do close an issue when you submit a pull request." on #256,
"Avoid using ambiguous `Refs #261`" on #265), so decide by the issue's acceptance criteria, not by caution. A
`Refs` PR says in its body what remains:
the PR finishes the issue, and `Refs #N` avoided, since a reference that
closes nothing is easy to add to every PR. Maintainers call `Refs` on a PR
that does finish its issue ambiguous ("Avoid ambiguous `Refs #210`. Do close
an issue when you submit a pull request." on #256, "Avoid using ambiguous
`Refs #261`" on #265), so decide by the issue's acceptance criteria, not by
caution. `Refs` belongs only beside a `Closes #N`, or in a body that states
the motivation and the implementation in full, including what remains:
[#161](https://github.com/sysprog21/codetrial/issues/161#issuecomment-6131824178)
asked for `Refs #161` because the cap and modality toggle stay open. One PR
may close two issues when that was agreed, each `Closes #N` on its own line
Expand Down
3 changes: 2 additions & 1 deletion .claude/skills/codetrial-triage/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ titles or the same broad symptom are insufficient to establish duplication.
reference, and never promise the merge will close it otherwise. When the PR
delivers the issue and only says `Refs #N`, the fix is a comment on the PR
asking its author to make the last line `Closes #N`, so the merge records it
(#143 for #141).
(#143 for #141). The PR sweep's `refs_only` lists these pairs and whether a
maintainer already asked ([pulls.md](pulls.md#closing-references)).
- **Already shipped**: the tree already does what the request asks. `git grep -n`
over `src` and `web` finds a candidate and settles nothing, since a string also
lives in a fixture, a disabled branch, a generated file or code behind a flag
Expand Down
27 changes: 20 additions & 7 deletions .claude/skills/codetrial-triage/issue-sweep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
# unanswered issues no maintainer other than the author has commented on,
# oldest first, so a collaborator's own follow-up is not an answer;
# the viewer's own issues and a deleted account's are left out,
# since nobody else answers the first and nobody can the second
# since nobody else answers the first and nobody can the second;
# closing_prs lists open PRs whose merge closes the issue, which
# makes it the PR sweep's once the PR is read (waiting.md)
# waiting issues whose newest maintainer comment is newer than anything
# the reporter did since, comment or body edit; overdue once it
# is older than wait-days. Issues a maintainer opened are left
# out; claimed marks a reporter who also holds the issue
# out; claimed marks a reporter who also holds the issue, and
# closing_prs is as in unanswered
# linked issues a pull request cross-referenced after the issue opened,
# split into merged and still open; a PR from another
# repository is left out, since its number means nothing here
Expand All @@ -34,8 +37,8 @@
# is the newest comment; stale is null when the history is cut,
# and idle_days too when none of their acts is in what was read
# truncated issues with more than 100 comments or cross-references, 10
# assignees, 20 assignments or 20 body edits, whose lists above
# may miss what was cut
# assignees, 20 assignments, 20 body edits or 10 closing PRs,
# whose lists above may miss what was cut

set -eu

Expand All @@ -54,6 +57,9 @@ query='query($owner: String!, $name: String!, $endCursor: String) {
totalCount nodes { editedAt editor { login } }
}
assignees(first: 10) { totalCount nodes { login } }
closedByPullRequestsReferences(first: 10, includeClosedPrs: false) {
Comment thread
jserv marked this conversation as resolved.
totalCount nodes { number repository { nameWithOwner } }
}
assigned: timelineItems(last: 20, itemTypes: [ASSIGNED_EVENT]) {
totalCount
nodes { ... on AssignedEvent { createdAt
Expand Down Expand Up @@ -125,9 +131,14 @@ def ink: [limit(40; split("\n")[] | select(startswith("#") | not)
def maint: [.comments.nodes[] | select(human and staff)];
def cut: .comments.totalCount > 100 or .timelineItems.totalCount > 100
or .assignees.totalCount > 10 or .assigned.totalCount > 20
or .userContentEdits.totalCount > 20;
or .userContentEdits.totalCount > 20
or (.closedByPullRequestsReferences.totalCount // 0) > 10;
def prs: [.timelineItems.nodes[] | select(.source.number != null
and .source.repository.nameWithOwner == $repo)];
# A PR in another repository may close the issue too; as in prs, its number
# means nothing here.
def closing: [.closedByPullRequestsReferences.nodes[]?
| select(.repository.nameWithOwner == $repo) | .number];
def split: {open: [.[] | select(.state == "OPEN") | .number] | unique,
merged: [.[] | select(.mergedAt != null) | .number] | unique};
def mine: .author.login as $a | [.comments.nodes[]
Expand Down Expand Up @@ -194,7 +205,8 @@ def claim: . as $i | maint as $m
maintainers_known: ($pushers != null),
unanswered: [$issues[] | select(.author != null) | .author.login as $a
| select($a != $me and all(maint[]; .author.login == $a))
| {issue: .number, author: $a, age_days: (.createdAt | age)}]
| {issue: .number, author: $a, age_days: (.createdAt | age),
closing_prs: closing}]
| sort_by(-.age_days),
waiting: [$issues[] | select(.author != null and (staff | not))
| .number as $n | .author.login as $a
Expand All @@ -203,7 +215,8 @@ def claim: . as $i | maint as $m
| {issue: .number, author: .author.login, asked_by: $ask.author.login,
asked_at: $ask.createdAt, idle_days: ($ask.createdAt | age),
overdue: (($ask.createdAt | age) >= $days),
claimed: any($claims[]; .issue == $n and .assignee == $a)}]
claimed: any($claims[]; .issue == $n and .assignee == $a),
closing_prs: closing}]
| sort_by(-.idle_days),
linked: [$issues[] | (.createdAt | ts) as $born
| [prs[] | select((.createdAt | ts) >= $born) | .source] as $prs
Expand Down
Loading