Skip to content

feat(rees): add performance guardrails and telemetry - #1836

Merged
JSONbored merged 1 commit into
codex/rees-generated-configfrom
codex/rees-performance-guardrails
Jun 30, 2026
Merged

feat(rees): add performance guardrails and telemetry#1836
JSONbored merged 1 commit into
codex/rees-generated-configfrom
codex/rees-performance-guardrails

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

What changed

  • Added per-request telemetry to ReviewBrief with profile, reserve budget, requested analyzer counts, per-analyzer timing/status, cache hit rate, external endpoint counts, skipped work, and capped work counters.
  • Added profile, cost, and response reserve fields to analyzer Sentry context and tags.
  • Added parseEnrichRequestBody guardrails for raw body size, file count, diff and patch sizes, analyzer list shape, repo slug, and PR number.
  • Switched /v1/enrich to validate the raw request body before calling buildBrief.
  • Added guardrail, telemetry, and Sentry context regression tests.

Why

A REES failure needs to show whether the request was too large, which analyzer consumed budget, which cost/profile path it used, and whether work was skipped, capped, timed out, or degraded, without logging request bodies, diffs, tokens, comments, prompts, or private config.

Validation

  • npm --prefix review-enrichment test
  • npx vitest run test/unit/enrichment-wire.test.ts test/unit/enrichment-wiring.test.ts
  • npm run typecheck
  • git diff --check

Notes

@dosubot dosubot Bot added the size:L label Jun 30, 2026
@JSONbored JSONbored added the maintainer-only Owner-only work — yields no Gittensor points. label Jun 30, 2026

@superagent-security superagent-security Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superagent found 2 security concern(s).

Comment thread review-enrichment/src/brief.ts Outdated
Comment thread review-enrichment/src/server.ts Outdated
@superagent-security superagent-security Bot added the pr:flagged PR flagged for review by security analysis. 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-performance-guardrails branch from b2d62e3 to e1baa6c Compare June 30, 2026 06:31
@JSONbored
JSONbored force-pushed the codex/rees-generated-config branch from 7585051 to b458d26 Compare June 30, 2026 06:31
@loopover-orb

loopover-orb Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-06-30 06:56:50 UTC

9 files · 1 AI reviewer · no blockers · readiness 75/100 · CI pending · clean

⏸️ Suggested Action - Manual Review

Review summary
The change adds a streaming request-size guard, shallow payload validation, and public-safe analyzer telemetry across the REES brief and Sentry degradation path. The main guardrail path is wired correctly in `server.ts` through `readEnrichRequestText` before parsing, so the visible diff does not have the buffered-body defect flagged by the external CI note. The remaining concern is that the validator only checks the fields it needs for routing and size limits; several optional fields that downstream analyzers may consume are still trusted after the cast.

Nits — 6 non-blocking
  • nit: `review-enrichment/src/request-guardrails.ts:67` only validates `repoFullName`, `prNumber`, `files`, `diff`, and `analyzers`; add defensive validation for optional structured fields such as `budget`, `profile`, and `linkedIssue` before casting the parsed object to `EnrichRequest`.
  • nit: `review-enrichment/src/request-guardrails.ts:102` accepts empty analyzer names because `entry.length <= 80` permits `""`; reject blank strings here so explicit analyzer lists cannot carry no-op entries downstream.
  • nit: `review-enrichment/src/request-guardrails.ts:118` validates `previousPath` type but not its length, so rename metadata can bypass the same path-size guard applied to `path`.
  • nit: `review-enrichment/src/brief.ts:137` intentionally collapses unsafe partial reasons to generic values; consider documenting that contract near `PUBLIC_PARTIAL_REASON_RE` because analyzer authors may expect their public-safe reason strings to survive unchanged.
  • Tighten `parseEnrichRequestBody` with small validators for `budget.timeoutMs`, `budget.maxBriefChars`, `profile`, and `linkedIssue.number/title/body` so the runtime request contract matches `EnrichRequest` instead of relying on a shallow cast.
  • 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.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #1814
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:L; 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:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jun 30, 2026
@JSONbored
JSONbored force-pushed the codex/rees-generated-config branch from b458d26 to 42021ed Compare June 30, 2026 06:51
@JSONbored
JSONbored force-pushed the codex/rees-performance-guardrails branch from e1baa6c to 8f88037 Compare June 30, 2026 06:51
@JSONbored JSONbored self-assigned this Jun 30, 2026
@JSONbored
JSONbored force-pushed the codex/rees-performance-guardrails branch from 8f88037 to 7ddfab3 Compare June 30, 2026 06:57
@superagent-security superagent-security Bot removed the pr:flagged PR flagged for review by security analysis. label Jun 30, 2026
@JSONbored
JSONbored merged commit cf22679 into codex/rees-generated-config Jun 30, 2026
3 checks passed
@JSONbored
JSONbored deleted the codex/rees-performance-guardrails branch June 30, 2026 07:01
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 30, 2026
JSONbored added a commit that referenced this pull request Jun 30, 2026
* feat(rees): generate analyzer config metadata

* feat(rees): add performance guardrails and telemetry (#1836)
JSONbored added a commit that referenced this pull request Jun 30, 2026
* perf(rees): add cost-aware analyzer scheduling

* feat(rees): generate analyzer config metadata (#1835)

* feat(rees): generate analyzer config metadata

* feat(rees): add performance guardrails and telemetry (#1836)
JSONbored added a commit that referenced this pull request Jun 30, 2026
* fix(rees): bound external analyzer fetches

* perf(rees): add cost-aware analyzer scheduling (#1833)

* perf(rees): add cost-aware analyzer scheduling

* feat(rees): generate analyzer config metadata (#1835)

* feat(rees): generate analyzer config metadata

* feat(rees): add performance guardrails and telemetry (#1836)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant