feat(github-app): merge-readiness aggregate gate - #632
Conversation
Add mergeReadinessGateMode to roll linked-issue, duplicate, readiness, and slop signals into one Gittensory Gate conclusion with a blocking summary. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
ghost
left a comment
There was a problem hiding this comment.
Gittensory review · advisory — a maintainer merges
0 actionable · 6 nitpick(s) · 23 file(s) · two independent AI reviewers
Suggested action: 🛠️ Request changes. (reviewers split: request changes / merge) Address the suggestions below before merging.
📋 Walkthrough
The PR adds a mergeReadinessGateMode setting across the database, API, and internal gate evaluation, allowing composite gating based on linked issues, duplicate PRs, quality scores, and slop findings. It updates schemas, types, and adds comprehensive unit and integration tests, but the queue processor lacks an import for listPullRequestFiles.
Changes
| File | Summary |
|---|---|
apps/gittensory-ui/public/openapi.json |
Adds mergeReadinessGateMode property to RepositorySettings schema and required list. |
migrations/0026_merge_readiness_gate_mode.sql |
Adds new column merge_readiness_gate_mode with default 'off' to repository_settings table. |
src/api/routes.ts |
Extends repository settings validation and handling to include mergeReadinessGateMode. |
src/db/repositories.ts |
Handles default, parsing, upserting, and retrieving of the new setting. |
src/db/schema.ts |
Defines new column in sqlite schema. |
src/openapi/schemas.ts |
Adds Zod schema entry for the new setting. |
src/queue/processors.ts |
Integrates slop findings into gate evaluation and adds helper to load them (missing import for listPullRequestFiles). |
src/rules/advisory.ts |
Adds composite gate handling, new helper functions, and updates evaluation flow. |
src/rules/merge-readiness-gate.ts |
Implements merge‑readiness composite gate logic and mapping of slop findings. |
src/types.ts |
Adds mergeReadinessGateMode to RepositorySettings type. |
test/unit/merge-readiness-gate.test.ts |
Adds extensive unit tests for the new composite gate. |
test/unit/... (multiple) |
Updates existing tests to include the new setting in default configurations. |
🔍 Reviewer notes
Reviewer A · gpt-oss-120b — recommends 🛠️ request changes
This PR introduces a new merge‑readiness aggregate gate, adding a DB column, API schema, type definitions, evaluation logic, and extensive tests. The implementation is thorough but misses an import for listPullRequestFiles in the queue processor, causing a compile error.
Suggestions
- Import
listPullRequestFilesinsrc/queue/processors.ts(e.g.,import { listPullRequestFiles } from "../github/pull-requests";). - Run the TypeScript compiler and tests after adding the import to ensure no further missing symbols.
- Verify that the new public output does not contain any forbidden terms (tests already check this).
Worth double-checking
- Missing import will prevent the app from building and deploying.
- Potential runtime errors if the slop assessment integration behaves unexpectedly with large PRs.
Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
The PR adds a merge-readiness aggregate gate feature that combines linked issue, duplicate PR, quality, and slop checks into a single composite gate with three modes (off, advisory, block). Changes span database schema, API, types, rules logic, and tests. Implementation follows existing patterns, maintains backward compatibility via default 'off' mode, and includes comprehensive test coverage. No public/private boundary violations detected.
Suggestions
- Add a comment in migration 0026_merge_readiness_gate_mode.sql explaining the column's purpose
- Consider extracting buildMergeReadinessBlockingSummary to a test utility if reused elsewhere
- Verify slop findings reuse doesn't introduce redundant computation in high-throughput scenarios
Worth double-checking
- Performance impact from loading slop findings for every PR when gate is enabled (mitigated by existing slop signal reuse)
- Ensure gateMode function export doesn't break internal callers (updated usage appears consistent)
- Confirm OpenAPI required array addition aligns with schema nullability (column is NOT NULL with default)
Warning
Could not capture a preview of the changed route(s) — review the rendered page manually before merging.
🤖 Automated advisory review · a maintainer makes the final call.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 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. |
ghost
left a comment
There was a problem hiding this comment.
Gittensory review · advisory — a maintainer merges
0 actionable · 6 nitpick(s) · 23 file(s) · two independent AI reviewers
Suggested action: 🔍 Manual review. The changed route's preview could not be captured — review the rendered page manually before merging.
📋 Walkthrough
The PR adds a mergeReadinessGateMode column to repository settings, updates schemas and defaults, implements composite gate evaluation that aggregates linked‑issue, duplicate‑PR, quality, and slop findings, and extends the queue processor to load slop findings when needed. Comprehensive tests cover the new behavior.
Changes
| File | Summary |
|---|---|
apps/gittensory-ui/public/openapi.json |
Adds mergeReadinessGateMode enum to RepositorySettings schema. |
migrations/0026_merge_readiness_gate_mode.sql |
Adds new column merge_readiness_gate_mode with default 'off' to repository_settings table. |
src/api/routes.ts |
Validates and persists mergeReadinessGateMode in repository settings API. |
src/db/repositories.ts |
Handles default, parsing, upserting, and returning of mergeReadinessGateMode. |
src/db/schema.ts |
Adds column definition for merge_readiness_gate_mode. |
src/openapi/schemas.ts |
Exports mergeReadinessGateMode in Zod schema for RepositorySettings. |
src/queue/processors.ts |
Loads slop findings and passes them into gate check policy for composite gate evaluation. |
src/rules/advisory.ts |
Delegates to merge‑readiness composite evaluation when enabled; adds helper exports. |
src/rules/merge-readiness-gate.ts |
Implements composite gate logic, mapping slop findings, and evaluation functions. |
src/types.ts |
Adds mergeReadinessGateMode to RepositorySettings type. |
test/unit/merge-readiness-gate.test.ts |
Adds extensive unit tests for the new composite gate behavior. |
test/unit/* |
Updates numerous tests to include default mergeReadinessGateMode settings. |
🔍 Reviewer notes
Reviewer A · gpt-oss-120b — recommends ✅ merge
This PR introduces a new merge‑readiness aggregate gate, adds a DB column and migration, extends API schemas, updates repository settings handling, and implements composite gate logic with slop findings. The changes are well‑tested and do not introduce forbidden public content.
Suggestions
- Confirm that
listPullRequestFilesis imported insrc/queue/processors.ts(or already present) to avoid a compile error. - Add a brief comment in the migration file noting the default value for future maintainers.
- Update any internal documentation to reflect the new
mergeReadinessGateModesetting.
Worth double-checking
- If
listPullRequestFilesis not imported, the queue processor will fail at runtime. - The new DB column requires the migration to be applied in all environments; ensure deployment scripts run it.
Reviewer B · mistral-small-3.1-24b-instruct — recommends ✅ merge
This PR adds a new 'merge-readiness' gate to the Gittensory platform, which aggregates multiple gate checks into a single composite gate. The change is comprehensive, including updates to the API schema, database migrations, and extensive test coverage. The implementation appears to be well-thought-out and follows the project's conventions.
Suggestions
- Consider adding a brief description of the new 'merge-readiness' gate in the documentation to help users understand its purpose and functionality.
- Ensure that the new gate's behavior is thoroughly documented in the code comments, especially in the
merge-readiness-gate.tsfile. - Review the test coverage to ensure that all edge cases are handled, particularly around the interaction between different gate modes.
Worth double-checking
- Verify that the new gate does not introduce any performance regressions, especially in repositories with a large number of pull requests.
- Ensure that the new gate's behavior is consistent across different repository settings and configurations.
- Check that the new gate's output is properly sanitized to avoid leaking any forbidden terms.
Warning
Could not capture a preview of the changed route(s) — review the rendered page manually before merging.
🤖 Automated advisory review · a maintainer makes the final call.
JSONbored
left a comment
There was a problem hiding this comment.
Appreciate the ambition, but please hold — as written this reverses the safety fix from #644 and needs a redesign first.
Blocking concerns
- Re-introduces over-blocking (critical).
evaluateMergeReadinessGateCheck(src/rules/merge-readiness-gate.ts) never readsconfirmedContributor, andadvisory.tsshort-circuits into it before any contributor check — somergeReadinessGateMode: "block"would block non-confirmed contributors again, exactly what #644 fixed. - Resurrects
action_required. It returnsaction_requiredfor app/infra state; #644 deliberately made those neutral ("not evaluated yet") so contributors are never blocked on the app's own sync state. - Two parallel gate engines. Forking a separate evaluator duplicates the blocker logic and is the root cause of (1)/(2). Please extend the single
evaluateGateCheckpath so the contributor gate is enforced in exactly one place. - Tests lock in the regression (assert
failure/action_requiredfor non-confirmed authors) — rewrite against #644 semantics. - Scope. +630 lines bundles settings/migration scaffolding with the engine; consider splitting them.
gateCheckPolicy's 3rd param also collides with #644's confirmedContributor. Happy to pair on the rebase.
|
Hi, @JSONbored |


Summary
mergeReadinessGateModesetting (off/advisory/block) with migration0026_merge_readiness_gate_mode.sql.src/rules/merge-readiness-gate.tsto aggregate linked-issue, duplicate, readiness, and slop conditions into one composite gate evaluation.evaluateGateCheckwhen composite mode is enabled.Closes #551
Test plan
npm run typecheckand unit/integration tests pass locallytest/unit/merge-readiness-gate.test.tstest/unit/queue.test.ts)test/unit/github-app.test.ts)npm run ui:openapi:checkMade with Cursor