Skip to content

feat(config): add review.enrichment analyzer per-lane toggles#2808

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
GildardoDev:feat/review-enrichment-toggles
Jul 4, 2026
Merged

feat(config): add review.enrichment analyzer per-lane toggles#2808
JSONbored merged 1 commit into
JSONbored:mainfrom
GildardoDev:feat/review-enrichment-toggles

Conversation

@GildardoDev

Copy link
Copy Markdown
Contributor

Summary

Adds review.enrichment to .gittensory.yml — a per-repo mapping of REES enrichment-analyzer names to booleans, letting a maintainer enable or disable individual enrichment analyzers declaratively instead of relying on a single opaque on/off. Absent (the default) leaves the operator's current analyzer set unchanged, so the enrichment request is byte-identical to today.

Closes #2050

Deliverables

  • enrichmentAnalyzers: Partial<Record<ReesAnalyzerName, boolean>> added to FocusManifestReviewConfig in src/signals/focus-manifest.ts, parsed from review.enrichment as a mapping of KNOWN analyzer keys to booleans — an unknown key or a non-boolean value warns and is dropped, and a non-mapping review.enrichment warns and is ignored. Wired through present, reviewConfigToJson (round-trip), and the three empty-config literals.
  • The analyzer-name registry is extracted into a new leaf module src/review/enrichment-analyzer-names.ts (no imports) so the review wiring and the signals-layer manifest parser share ONE source of truth without a heavy or circular dependency; enrichment-wire.ts re-exports REES_ANALYZER_NAMES for compatibility.
  • resolveEnrichmentAnalyzerSelection(envSelected, toggles) (pure, in enrichment-wire.ts) composes the operator's REES_ANALYZERS env selection with the per-repo toggles: the env selection (undefined ⇒ full registry) is the base, each explicit toggle adds (true) or removes (false) an analyzer from the known registry, and it returns undefined (byte-identical, "run everything") when there is no override or the toggles leave the full registry intact.
  • The per-repo toggles are threaded into buildReviewEnrichment at the enrichment call site in src/queue/processors.ts from the already-cached manifest (via resolveEnrichmentAnalyzerToggles), so a disabled analyzer is actually skipped. A null manifest (load failure) fail-safes to no toggles ⇒ the default set.

Behavior notes

  • Absent / empty review.enrichment ⇒ the analyzer list sent to REES is unchanged (byte-identical prompt), so this is a pure opt-in.
  • Only the known REES analyzer registry is honored; unknown keys are surfaced as manifest warnings, never sent downstream.

Validation

  • New test/unit/review-enrichment-config.test.ts covers the composition combiner (every branch), parsing (known keys, unknown-key warning, non-boolean-value warning, non-mapping warning, empty/absent), the reviewConfigToJson round-trip, and the null-manifest resolver. 100% branch + statement coverage on every added line.
  • npm run typecheck is clean; the full affected unit suite passes.

@GildardoDev
GildardoDev requested a review from JSONbored as a code owner July 3, 2026 19:35
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.01%. Comparing base (17fd0c7) to head (0a4fe6f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2808   +/-   ##
=======================================
  Coverage   96.00%   96.01%           
=======================================
  Files         258      259    +1     
  Lines       28251    28275   +24     
  Branches    10275    10287   +12     
=======================================
+ Hits        27123    27147   +24     
  Misses        491      491           
  Partials      637      637           
Files with missing lines Coverage Δ
src/queue/processors.ts 92.65% <100.00%> (+<0.01%) ⬆️
src/review/enrichment-analyzer-names.ts 100.00% <100.00%> (ø)
src/review/enrichment-wire.ts 99.30% <100.00%> (+0.03%) ⬆️
src/signals/focus-manifest.ts 99.39% <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.

@GildardoDev
GildardoDev force-pushed the feat/review-enrichment-toggles branch from a3d0978 to d90748e Compare July 3, 2026 19:50
@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 3, 2026
@loopover-orb

loopover-orb Bot commented Jul 3, 2026

Copy link
Copy Markdown

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-03 23:41:19 UTC

7 files · 1 AI reviewer · no blockers · readiness 62/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review

Review summary
The diff coherently adds `review.enrichment` parsing, serialization, analyzer-name sharing, and request-time analyzer selection. The composition logic preserves the existing omitted-`analyzers` default when no repo override exists and correctly applies boolean toggles against the canonical registry. I do not see a reachable correctness break in the provided changed hunks.

Nits — 6 non-blocking
  • nit: `src/review/enrichment-wire.ts:215` should have a request-building test that proves an empty analyzer selection is still sent as `[]` rather than being omitted and interpreted as the default full set.
  • nit: `src/signals/focus-manifest.ts:1478` swallows all manifest loader errors; consider limiting this to expected manifest-load failures or documenting why fail-open is intentional here.
  • Add a `buildReviewEnrichment`-level unit test around `input.enrichmentAnalyzers` so the feature is covered at the actual REES request boundary, not only in the pure selector.
  • Consider asserting the all-disabled default-base case, e.g. `resolveEnrichmentAnalyzerSelection(undefined, Object.fromEntries(REES_ANALYZER_NAMES.map(...false)))`, because that is the sharpest edge for request serialization.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2050
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 (1 linked issue).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 256 registered-repo PR(s), 180 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor GildardoDev; Gittensor profile; 256 PR(s), 0 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Review context
  • Author: GildardoDev
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 256 PR(s), 0 issue(s).
  • Related work: Titles/paths share 10 meaningful terms. (issue #2038, issue #2040)
  • Related work: Titles/paths share 9 meaningful terms. (issue #2038, issue #2042)
  • Related work: Titles/paths share 8 meaningful terms. (issue #2024, issue #2033)
  • Additional title-only matches omitted; title-only overlap does not block.
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • 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

@GildardoDev
GildardoDev force-pushed the feat/review-enrichment-toggles branch 12 times, most recently from afd9929 to 77c1992 Compare July 3, 2026 23:06
@GildardoDev
GildardoDev force-pushed the feat/review-enrichment-toggles branch from 77c1992 to 0a4fe6f Compare July 4, 2026 00:26
@JSONbored
JSONbored merged commit c7a8f76 into JSONbored:main Jul 4, 2026
8 checks passed
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

None yet

Development

Successfully merging this pull request may close these issues.

feat(config): add review.enrichment analyzer per-lane toggles

2 participants