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
5 changes: 5 additions & 0 deletions .claude/skills/discord-reports-resolve/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ For every folder marked `resolved`, this archives and locks the matching Discord
hand — then flips the local `status` to `"closed"` and stamps `closed_at`. The Discord thread is
never deleted, only archived: it stays the permanent, searchable record.

If `resolution` names a commit hash that actually exists in this repo (`"fixed in a1b2c3d: ..."`),
a plain message — `Fixed in commit `a1b2c3d` — https://github.com/JIRPOS/PathOfPriceCheck/commit/...`
— is posted to the thread first, before it's archived. A `resolution` with no verifiable hash
(`"wontfix: ..."`, `"duplicate of ..."`) just archives as before — nothing is guessed or posted.

```sh
./resolve.sh --cleanup
```
Expand Down
3 changes: 2 additions & 1 deletion discord-reports/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
A local-only maintainer tool: pulls bug reports out of the private `#ppc-reports` Discord forum
(see [worker/README.md](../worker/README.md) for how a report gets there) into `inbox/`, so they
can be triaged without a Discord client open. The only things it ever writes back to Discord are a
reaction, to mark a report as pulled, and — once a report is marked resolved locally — archiving
reaction, to mark a report as pulled, and — once a report is marked resolved locally — a
"fixed in commit ..." message (only when `resolution` names a real commit) followed by archiving
that report's own thread.

Two Claude Code skills drive it day to day: **discord-reports-ingest** and
Expand Down
25 changes: 24 additions & 1 deletion discord-reports/resolve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# copies. See .claude/skills/discord-reports-resolve/SKILL.md.
#
# ./resolve.sh archive+lock the Discord thread for every inbox/*/meta.json with
# status "resolved", then flip that status to "closed"
# status "resolved", then flip that status to "closed". If
# "resolution" names a commit hash that exists in this repo, a
# "Fixed in commit ..." message with a GitHub link is posted to
# the thread first.
# ./resolve.sh --cleanup also list local folders closed longer than DISCORD_REPORTS_CLEANUP_DAYS
# ./resolve.sh --cleanup --yes ...and actually delete them (Discord thread is never touched)
set -euo pipefail
Expand All @@ -29,12 +32,32 @@ done

CLEANUP_DAYS=${DISCORD_REPORTS_CLEANUP_DAYS:-90}

GITHUB_REPO="https://github.com/JIRPOS/PathOfPriceCheck"

closed=0
for dir in inbox/*/; do
[[ -f "$dir/meta.json" ]] || continue
[[ $(jq -r '.status' "$dir/meta.json") == "resolved" ]] || continue

thread_id=$(jq -r '.thread_id' "$dir/meta.json")

# If the resolution names a real commit in this repo, post it to the thread before archiving —
# only a hash git can actually verify counts, never a bare guess out of the resolution text.
resolution=$(jq -r '.resolution // empty' "$dir/meta.json")
commit=""
if [[ -n $resolution ]]; then
for candidate in $(grep -oE '\b[0-9a-f]{7,40}\b' <<<"$resolution"); do
commit=$(git -C .. rev-parse --verify --quiet "${candidate}^{commit}" 2>/dev/null) && break
commit=""
done
fi
if [[ -n $commit ]]; then
note_body=$(jq -n --arg c "Fixed in commit \`${commit:0:7}\` — $GITHUB_REPO/commit/$commit" \
'{content: $c}')
api POST "/channels/$thread_id/messages" "$note_body" >/dev/null \
|| echo "failed to post fixed-in-commit message to $thread_id ($dir), archiving anyway" >&2
fi

if ! api PATCH "/channels/$thread_id" '{"archived":true,"locked":true}' >/dev/null; then
echo "failed to archive thread $thread_id ($dir), leaving it marked resolved" >&2
continue
Expand Down