From e377ba295d12090cc4a39be6355deb89d51c81b2 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sat, 14 Mar 2026 00:10:14 -0500 Subject: [PATCH] feat: dual greptile-history paths (per-project + global) - Suppressions read from ~/.gstack/projects/{slug}/greptile-history.md - Triage outcomes write to both per-project and global files - greptile-triage.md: remote-slug derivation, dual-write instructions - review/SKILL.md + ship/SKILL.md: updated save path references - TODO: add smart default QA tier (P2, S) Co-Authored-By: Claude Opus 4.6 --- TODO.md | 1 + review/SKILL.md | 6 +++--- review/greptile-triage.md | 18 +++++++++++++++--- ship/SKILL.md | 8 ++++---- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/TODO.md b/TODO.md index ebdeb0a6..b09a27eb 100644 --- a/TODO.md +++ b/TODO.md @@ -107,6 +107,7 @@ - [ ] Greptile training feedback loop — export suppression patterns to Greptile team for model improvement (P3, S) - [ ] E2E test cost tracking — track cumulative API spend, warn if over threshold (P3, S) - [ ] E2E model pinning — pin E2E tests to claude-sonnet-4-6 for cost efficiency, add retry:2 for flaky LLM (P2, XS) + - [ ] Smart default QA tier — after a few runs, check index.md for user's usual tier pick, skip the question (P2, S) ## Ideas & Notes - Browser is the nervous system — every skill should be able to see, interact with, and verify the web diff --git a/review/SKILL.md b/review/SKILL.md index 35075d16..4a9609c8 100644 --- a/review/SKILL.md +++ b/review/SKILL.md @@ -84,7 +84,7 @@ After outputting your own findings, if Greptile comments were classified in Step **Include a Greptile summary in your output header:** `+ N Greptile comments (X valid, Y fixed, Z FP)` -1. **VALID & ACTIONABLE comments:** These are already included in your CRITICAL findings — they follow the same AskUserQuestion flow (A: Fix it now, B: Acknowledge, C: False positive). If the user chooses C (false positive), post a reply using the appropriate API from the triage doc and save the pattern to `~/.gstack/greptile-history.md` (type: fp). +1. **VALID & ACTIONABLE comments:** These are already included in your CRITICAL findings — they follow the same AskUserQuestion flow (A: Fix it now, B: Acknowledge, C: False positive). If the user chooses C (false positive), post a reply using the appropriate API from the triage doc and save the pattern to both per-project and global greptile-history (see greptile-triage.md for write details). 2. **FALSE POSITIVE comments:** Present each one via AskUserQuestion: - Show the Greptile comment: file:line (or [top-level]) + body summary + permalink URL @@ -94,11 +94,11 @@ After outputting your own findings, if Greptile comments were classified in Step - B) Fix it anyway (if low-effort and harmless) - C) Ignore — don't reply, don't fix - If the user chooses A, post a reply using the appropriate API from the triage doc and save the pattern to `~/.gstack/greptile-history.md` (type: fp). + If the user chooses A, post a reply using the appropriate API from the triage doc and save the pattern to both per-project and global greptile-history (see greptile-triage.md for write details). 3. **VALID BUT ALREADY FIXED comments:** Reply acknowledging the catch — no AskUserQuestion needed: - Post reply: `"Good catch — already fixed in ."` - - Save to `~/.gstack/greptile-history.md` (type: already-fixed) + - Save to both per-project and global greptile-history (see greptile-triage.md for write details) 4. **SUPPRESSED comments:** Skip silently — these are known false positives from previous triage. diff --git a/review/greptile-triage.md b/review/greptile-triage.md index 9d26a6b6..b5dbac48 100644 --- a/review/greptile-triage.md +++ b/review/greptile-triage.md @@ -32,7 +32,13 @@ The `position != null` filter on line-level comments automatically skips outdate ## Suppressions Check -Read `~/.gstack/greptile-history.md` if it exists. Each line records a previous triage outcome: +Derive the project-specific history path: +```bash +REMOTE_SLUG=$(browse/bin/remote-slug 2>/dev/null || ~/.claude/skills/gstack/browse/bin/remote-slug 2>/dev/null || basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)") +PROJECT_HISTORY="$HOME/.gstack/projects/$REMOTE_SLUG/greptile-history.md" +``` + +Read `$PROJECT_HISTORY` if it exists (per-project suppressions). Each line records a previous triage outcome: ``` | | | | @@ -89,12 +95,18 @@ gh api repos/$REPO/issues/$PR_NUMBER/comments \ ## History File Writes -Before writing, ensure the directory exists: +Before writing, ensure both directories exist: ```bash +REMOTE_SLUG=$(browse/bin/remote-slug 2>/dev/null || ~/.claude/skills/gstack/browse/bin/remote-slug 2>/dev/null || basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)") +mkdir -p "$HOME/.gstack/projects/$REMOTE_SLUG" mkdir -p ~/.gstack ``` -Append one line per triage outcome to `~/.gstack/greptile-history.md`: +Append one line per triage outcome to **both** files (per-project for suppressions, global for retro): +- `~/.gstack/projects/$REMOTE_SLUG/greptile-history.md` (per-project) +- `~/.gstack/greptile-history.md` (global aggregate) + +Format: ``` | | | | ``` diff --git a/ship/SKILL.md b/ship/SKILL.md index ff6a2ca6..56aa9e3e 100644 --- a/ship/SKILL.md +++ b/ship/SKILL.md @@ -188,12 +188,12 @@ For each classified comment: - The comment (file:line or [top-level] + body summary + permalink URL) - Your recommended fix - Options: A) Fix now (recommended), B) Acknowledge and ship anyway, C) It's a false positive -- If user chooses A: apply the fix, commit the fixed files (`git add && git commit -m "fix: address Greptile review — "`), reply to the comment (`"Fixed in ."`), and save to `~/.gstack/greptile-history.md` (type: fix). -- If user chooses C: reply explaining the false positive, save to history (type: fp). +- If user chooses A: apply the fix, commit the fixed files (`git add && git commit -m "fix: address Greptile review — "`), reply to the comment (`"Fixed in ."`), and save to both per-project and global greptile-history (see greptile-triage.md for write details, type: fix). +- If user chooses C: reply explaining the false positive, save to both per-project and global greptile-history (type: fp). **VALID BUT ALREADY FIXED:** Reply acknowledging the catch — no AskUserQuestion needed: - Post reply: `"Good catch — already fixed in ."` -- Save to `~/.gstack/greptile-history.md` (type: already-fixed) +- Save to both per-project and global greptile-history (see greptile-triage.md for write details, type: already-fixed) **FALSE POSITIVE:** Use AskUserQuestion: - Show the comment and why you think it's wrong (file:line or [top-level] + body summary + permalink URL) @@ -201,7 +201,7 @@ For each classified comment: - A) Reply to Greptile explaining the false positive (recommended if clearly wrong) - B) Fix it anyway (if trivial) - C) Ignore silently -- If user chooses A: post reply using the appropriate API from the triage doc, save to history (type: fp) +- If user chooses A: post reply using the appropriate API from the triage doc, save to both per-project and global greptile-history (type: fp) **SUPPRESSED:** Skip silently — these are known false positives from previous triage.