Skip to content

perf(rees): share analyzer request context - #1817

Merged
JSONbored merged 1 commit into
mainfrom
codex/rees-analysis-context
Jun 30, 2026
Merged

perf(rees): share analyzer request context#1817
JSONbored merged 1 commit into
mainfrom
codex/rees-analysis-context

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Adds a request-scoped REES analysis context for shared parsed PR state, request caches, and safe metrics.
  • Migrates representative local and external analyzers onto the new substrate.

What changed

  • Parses changed files, paths, added lines, patch hunks, file categories, repo identity, and dependency manifest changes once per enrichment request.
  • Adds request-scoped in-flight de-duplication for identical external lookups through cachedExternalCall.
  • Migrates secret to shared added-line parsing and dependency to shared dependency parsing plus cached OSV calls.
  • Adds aggregate cache/external/skipped/capped-work metrics to safe Sentry analyzer-degradation context.
  • Documents the shared context contract for future analyzer work.

Why

  • Reduces repeated parsing and duplicate package lookups inside a single REES run.
  • Gives future analyzers a stable modular boundary for shared inputs, bounded fanout, and diagnostics without changing the public ReviewBrief response shape.

Validation

  • git diff --check
  • npm --prefix review-enrichment test (234 tests passed)
  • npm run test:ci (passed; existing UI fast-refresh lint warnings remained warnings)
  • npm audit --audit-level=moderate (0 vulnerabilities)

Notes

@JSONbored JSONbored added the maintainer-only Owner-only work — yields no Gittensor points. label Jun 30, 2026
@JSONbored JSONbored self-assigned this Jun 30, 2026
@dosubot dosubot Bot added the size:XL label Jun 30, 2026
@loopover-orb

loopover-orb Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-06-30 06:45:11 UTC

12 files · 1 AI reviewer · no blockers · readiness 75/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This change adds a shared request-scoped analysis context and migrates the secret and dependency analyzers onto it. The visible wiring is coherent: `buildBrief` constructs the context once, passes it through `AnalyzerRunContext`, and the migrated analyzers preserve their existing parsing/scan behavior while adding request-local cache metrics. The notable detail is that the cache key implementation already uses JSON tuple encoding, so the cited delimiter-collision concern is not present in the post-change file.

Nits — 7 non-blocking
  • nit: `review-enrichment/test/analysis-context.test.ts` includes a synthetic high-confidence token-shaped string, which predictably trips the repository's own secret detector even though it is test data; use a non-matching fixture helper or assemble the regex boundary differently.
  • nit: `review-enrichment/src/analysis-context.ts:117` sanitizes cache categories before keying, so two distinct raw categories that normalize to the same metric category intentionally share cache entries; document that categories must be stable metric identifiers or key on the raw category and sanitize only metrics.
  • nit: `review-enrichment/src/brief.ts:148` builds `AnalysisContext` even when no requested analyzer currently consumes it, which is acceptable for now but worth watching as more parsing gets added to the constructor.
  • Change the token-shaped fixture in `review-enrichment/test/analysis-context.test.ts` so test coverage does not require suppressing the same detector this service is meant to enforce.
  • In `review-enrichment/src/analysis-context.ts:117`, either key the request cache with the raw category or add a short comment stating that cache categories are canonical metric categories and may be normalized.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.
  • Pull request duplicates other open work — Check for an existing pull request or issue covering this change and coordinate or consolidate before continuing.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #1810
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (size label size:XL; 1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 2 registered-repo PR(s), 2 merged, 273 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 2 PR(s), 273 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Triage stale or unlinked PRs.
  • No action.
  • Check active issues and PRs before submitting.
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

@loopover-orb loopover-orb Bot added gittensor gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jun 30, 2026
@JSONbored JSONbored removed gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. gittensor labels Jun 30, 2026
@loopover-orb loopover-orb Bot added gittensor gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jun 30, 2026
@JSONbored
JSONbored force-pushed the codex/rees-analysis-context branch from 9ca8262 to 7b21986 Compare June 30, 2026 05:27
@JSONbored
JSONbored force-pushed the codex/rees-analyzer-manifests branch from 49aa188 to e3174e2 Compare June 30, 2026 05:29
@JSONbored
JSONbored force-pushed the codex/rees-analysis-context branch from 7b21986 to 5947079 Compare June 30, 2026 05:30
Base automatically changed from codex/rees-analyzer-manifests to main June 30, 2026 05:51
@dosubot dosubot Bot added size:XXL and removed size:XL labels Jun 30, 2026
@JSONbored
JSONbored force-pushed the codex/rees-analysis-context branch from 5947079 to fb072b0 Compare June 30, 2026 05:57
@dosubot dosubot Bot added size:XL and removed size:XXL labels Jun 30, 2026
@JSONbored
JSONbored force-pushed the codex/rees-analysis-context branch from fb072b0 to 79edf35 Compare June 30, 2026 06:26
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 30, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui edea2d5 Commit Preview URL

Branch Preview URL
Jun 30 2026, 06:33 AM

@JSONbored JSONbored removed gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. gittensor labels Jun 30, 2026
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jun 30, 2026
@JSONbored JSONbored removed the maintainer-only Owner-only work — yields no Gittensor points. label Jun 30, 2026
@JSONbored
JSONbored force-pushed the codex/rees-analysis-context branch from 79edf35 to edea2d5 Compare June 30, 2026 06:31
@JSONbored
JSONbored merged commit a14aced into main Jun 30, 2026
16 checks passed
@JSONbored
JSONbored deleted the codex/rees-analysis-context branch June 30, 2026 06:48
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 30, 2026
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

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

perf(rees): add shared analysis context and request caches

1 participant