Skip to content

fix(review): include cached/published AI findings for @gittensory resolve#4017

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-resolve-command-to-record-ai-findings
Jul 7, 2026
Merged

fix(review): include cached/published AI findings for @gittensory resolve#4017
JSONbored merged 1 commit into
mainfrom
codex/fix-resolve-command-to-record-ai-findings

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • The resolve command rebuilt only the deterministic advisory and therefore could not find or record suppressions for AI-origin findings (e.g. ai_review_split, ai_consensus_defect), causing finding_not_found and preventing review-memory from recording AI false-positive signals.

Description

  • Enrich the resolve advisory with any public AI review findings by loading the cached review (via getCachedAiReview) and falling back to the last published review (getLatestPublishedAiReview) when appropriate, then appending those findings into the advisory before gate evaluation. (change in src/queue/processors.ts — new helper appendPublishedAiReviewFindingsForResolve and a call site in maybeProcessResolveCommand).
  • Preserve fail-open parity with the main review path by catching read errors when loading cache/published rows so resolve still handles deterministic findings even if AI reads fail.
  • Add regression tests that exercise resolving a current cached AI warning and falling back to the last published public AI review when the cached row has no public assessment (added tests in test/unit/queue.test.ts).

Testing

  • Ran git diff --check with no issues.
  • Ran the focused unit tests npx vitest run test/unit/queue.test.ts -t "@gittensory resolve" and the added resolve-focused tests passed.
  • Ran type checking via npm run typecheck and it completed with no errors.

Codex Task

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 7, 2026
@loopover-orb

loopover-orb Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-07 10:25:39 UTC

2 files · 1 AI reviewer · 2 blockers · readiness 93/100 · CI pending · blocked

⏸️ Suggested Action - Manual Review

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.

Review summary
This PR fixes a real gap: `maybeProcessResolveCommand` only rebuilt the deterministic advisory, so `@​gittensory resolve` could never find AI-origin findings (`ai_review_split`, `ai_consensus_defect`) and would return `finding_not_found`. The new `appendPublishedAiReviewFindingsForResolve` helper loads the cached review keyed by the PR's current `headSha`, falls back to the last published review when the current cache has no public assessment, and appends findings into `advisory.findings` before `evaluateGateCheck` runs — ordering is correct since the append happens before gate evaluation and warning selection. Both new tests exercise real code paths (a live cached-review hit and a genuine published-review fallback via `markAiReviewPublished`) rather than fabricating unreachable states, and fail-open error handling on the cache/published reads mirrors the main review path's parity requirement.

Nits — 5 non-blocking
  • src/queue/processors.ts: `advisory.findings.push(...publishedReview.findings)` has no dedup guard — if a deterministic and AI finding ever share the same code, `selectWarningsForResolve` could match multiple entries for one resolve call; worth a defensive dedup by code before pushing.
  • src/queue/processors.ts: `appendPublishedAiReviewFindingsForResolve`'s `aiReviewMode: string` param is looser than the typed value on `settings.aiReviewMode` — consider reusing that type for consistency.
  • The two `.catch(() => null)` fail-open blocks duplicate the same pattern inline; a small shared helper would reduce repetition, though this is purely stylistic.
  • Confirm this PR closes/links an eligible open issue per repo convention — the description doesn't state one explicitly, though the test fixture names (`resolve-1964-ai-cached`, `resolve-1964-ai-published`) suggest issue Review memory — repeat false-positive suppression #1964; call that out in the description.
  • Consider deduping `publishedReview.findings` against existing `advisory.findings` by code before the push in src/queue/processors.ts.

Concerns raised — review before merging

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
Signal Result Evidence
Code review ❌ 2 blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 51 registered-repo PR(s), 43 merged, 569 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 51 PR(s), 569 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, JavaScript, Ruby, Go, Kotlin, MDX, Shell
  • Official Gittensor activity: 51 PR(s), 569 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@JSONbored
JSONbored merged commit b0ccfb8 into main Jul 7, 2026
8 checks passed
@JSONbored
JSONbored deleted the codex/fix-resolve-command-to-record-ai-findings branch July 7, 2026 10:28
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.70%. Comparing base (283a496) to head (3cfb90a).
⚠️ Report is 30 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4017   +/-   ##
=======================================
  Coverage   93.70%   93.70%           
=======================================
  Files         373      373           
  Lines       35076    35081    +5     
  Branches    12862    12864    +2     
=======================================
+ Hits        32868    32873    +5     
  Misses       1584     1584           
  Partials      624      624           
Files with missing lines Coverage Δ
src/queue/processors.ts 94.72% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant