fix(review): make size-gate file/line thresholds configurable - #5997
Conversation
The oversized-PR HOLD gate (gate.size.mode) has been configurable for a while, but its actual thresholds -- SIZE_HOLD_DEFAULT_MAX_FILES=10 / SIZE_HOLD_DEFAULT_MAX_LINES=1000 -- were bare hardcoded constants in src/rules/advisory.ts (and its engine-parity twin), with no way to override them. The doc comments on GateCheckPolicy.sizeGateMode already referenced sizeGateMaxFiles/sizeGateMaxLines as if they existed; they never did. Adds sizeGateMaxFiles/sizeGateMaxLines as real RepositorySettings fields, wired through gate.size.maxFiles/maxLines in the config parser (both the host and engine copies), gateCheckPolicy, and buildSizeHoldFinding in both src/rules/advisory.ts and its engine twin -- falling back to the same 10/1000 defaults when unset, so existing behavior is unchanged until an operator sets one.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Bundle ReportChanges will increase total bundle size by 258 bytes (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: loopover-uiAssets Changed:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-15 06:20:13 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 5 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agent
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
gate.size.mode) has been configurable for a while, but its actual thresholds --SIZE_HOLD_DEFAULT_MAX_FILES=10/SIZE_HOLD_DEFAULT_MAX_LINES=1000-- were bare hardcoded module constants insrc/rules/advisory.ts(and its intentionally-divergent engine-parity twin,packages/loopover-engine/src/advisory/gate-advisory.ts), with no config path at all. The doc comments onGateCheckPolicy.sizeGateModealready referencedsizeGateMaxFiles/sizeGateMaxLinesas if they were real fields -- they never were.sizeGateMaxFiles/sizeGateMaxLinesas realRepositorySettingsfields, wired end-to-end:.loopover.yml gate.size.maxFiles/maxLinesparsing in both the host (src/signals/focus-manifest.ts) and engine (packages/loopover-engine/src/focus-manifest.ts) config layers, plus the engine'spredicted-gate.tspolicy builder.gateCheckPolicy()(src/queue/gate-checks.ts) into theGateCheckPolicyobject.buildSizeHoldFindingin bothsrc/rules/advisory.tsand its engine twin now falls back to the same 10-file/1000-line defaults only when the setting is unset -- existing behavior is byte-identical until an operator sets one.sizeGateMaxFiles/sizeGateMaxLinesto the OpenAPIRepositorySettingsSchemaand regeneratesopenapi.json, and documents both fields in.loopover.yml.example/config/examples/loopover.full.yml(replacing the stale "engine defaults, not configurable here" comment).Test plan
npm run test:ci(full local gate) greennpm audit --audit-level=moderate-- 0 vulnerabilitiesmaxFileslets an over-threshold-by-default PR pass; loweredmaxLinesholds an under-threshold-by-default PR; explicitnullstill falls back to the built-in default;gateCheckPolicythreading + default-null cases;resolveEffectiveSettingsconfig-mapping case