feat(signals): wire issue quality reports through snapshot + REST + MCP + opportunities - #56
Merged
Merged
Conversation
added 3 commits
May 29, 2026 10:07
generateSignalSnapshots now builds and persists an issue-quality snapshot alongside the other six signal types. New GET /v1/repos/:owner/:repo/issue-quality returns the cached snapshot or computes one on demand when the repo is known; 404 when the repo is unknown. The path is registered in the OpenAPI spec.
Returns the cached or freshly-computed issue-quality report for a repo. Falls back to a not_found payload when the repo is unknown locally so MCP clients can render the state without erroring.
buildContributorOpportunities now accepts an optional Map<repoFullName, IssueQualityReport> and uses each issue's quality status to drop do_not_use issues, downgrade needs_proof to caution even at high lane fit, and boost ready issues. Lookup is case-insensitive. Adds fixtures for direct-PR / issue-discovery / vague / stale / already-solved / duplicate-prone / high-volume issue paths plus opportunity-integration tests for the do_not_use drop, needs_proof downgrade, and hold-status warnings. Integration test flips the formerly-legacy /v1/repos/:owner/:repo/issue-quality 404 path to assert both snapshot and computed responses and seeds an issue-quality snapshot for the MCP tool happy path.
PR #56 should not regenerate CHANGELOG.md per CONTRIBUTING rules (changelog edits are release-prep only).
buildContributorOpportunities accepted an issueQualityByRepo map but buildContributorFit was still calling it without one, so production opportunity ranking never saw quality status. Threads the map through buildContributorFit and loads cached snapshots once per build-contributor-evidence run so do_not_use issues drop from contributor opportunities and needs_proof/hold downgrade correctly. Also moves the do_not_use filter before slice(0, 5) so dropped issues don't silently shrink the top-N output, and reuses the already-built CollisionReport when persisting issue-quality snapshots in generateSignalSnapshots to honor the Worker-budget acceptance.
Extracts the cache-or-compute load path into services/issue-quality.ts so REST and MCP return the same envelope shape with the same generatedAt fallback. Adds an enveloped IssueQualityResponseSchema in OpenAPI so the documented contract matches what the handler actually returns.
- Stale fixture now asserts status: needs_proof and exact warning. - Issue-discovery fixture asserts score >= 70 and the reasons array. - Duplicate-prone fixture asserts both issue numbers and the exact warning string. - New end-to-end unit test routes a do_not_use issue through buildContributorFit and asserts it is dropped from opportunities. - queue.test.ts now positively asserts an issue-quality snapshot is persisted after generate-signal-snapshots and that the payload has the expected shape.
Contributor
Author
|
@JSONbored thanks for your merge. could you please review this PR? |
8 tasks
jony376
pushed a commit
to jony376/gittensory
that referenced
this pull request
May 31, 2026
…CP + opportunities (JSONbored#56) * feat(signals): persist issue-quality snapshots and serve them via REST generateSignalSnapshots now builds and persists an issue-quality snapshot alongside the other six signal types. New GET /v1/repos/:owner/:repo/issue-quality returns the cached snapshot or computes one on demand when the repo is known; 404 when the repo is unknown. The path is registered in the OpenAPI spec. * feat(mcp): add gittensory_get_issue_quality tool Returns the cached or freshly-computed issue-quality report for a repo. Falls back to a not_found payload when the repo is unknown locally so MCP clients can render the state without erroring. * feat(signals): weight contributor opportunities by cached issue quality buildContributorOpportunities now accepts an optional Map<repoFullName, IssueQualityReport> and uses each issue's quality status to drop do_not_use issues, downgrade needs_proof to caution even at high lane fit, and boost ready issues. Lookup is case-insensitive. Adds fixtures for direct-PR / issue-discovery / vague / stale / already-solved / duplicate-prone / high-volume issue paths plus opportunity-integration tests for the do_not_use drop, needs_proof downgrade, and hold-status warnings. Integration test flips the formerly-legacy /v1/repos/:owner/:repo/issue-quality 404 path to assert both snapshot and computed responses and seeds an issue-quality snapshot for the MCP tool happy path. * revert(changelog): restore main CHANGELOG.md PR JSONbored#56 should not regenerate CHANGELOG.md per CONTRIBUTING rules (changelog edits are release-prep only). * fix(signals): thread issue-quality map through buildContributorFit buildContributorOpportunities accepted an issueQualityByRepo map but buildContributorFit was still calling it without one, so production opportunity ranking never saw quality status. Threads the map through buildContributorFit and loads cached snapshots once per build-contributor-evidence run so do_not_use issues drop from contributor opportunities and needs_proof/hold downgrade correctly. Also moves the do_not_use filter before slice(0, 5) so dropped issues don't silently shrink the top-N output, and reuses the already-built CollisionReport when persisting issue-quality snapshots in generateSignalSnapshots to honor the Worker-budget acceptance. * refactor(signals): share REST + MCP issue-quality loader Extracts the cache-or-compute load path into services/issue-quality.ts so REST and MCP return the same envelope shape with the same generatedAt fallback. Adds an enveloped IssueQualityResponseSchema in OpenAPI so the documented contract matches what the handler actually returns. * test(signals): tighten issue-quality fixtures and assert wiring - Stale fixture now asserts status: needs_proof and exact warning. - Issue-discovery fixture asserts score >= 70 and the reasons array. - Duplicate-prone fixture asserts both issue numbers and the exact warning string. - New end-to-end unit test routes a do_not_use issue through buildContributorFit and asserts it is dropped from opportunities. - queue.test.ts now positively asserts an issue-quality snapshot is persisted after generate-signal-snapshots and that the payload has the expected shape. * fix: complete issue-quality wiring --------- Co-authored-by: mkdev11 <MkDev11@users.noreply.github.com>
12 tasks
12 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #20.
Summary
generateSignalSnapshotsnow builds and persists anissue-qualitysnapshot alongside the other six signal types (queue/processors.ts).GET /v1/repos/:owner/:repo/issue-qualityreturns the cached snapshot when present and computes one on demand when the repo is known but uncached; 404 only when the repo itself is unknown (api/routes.ts). Path registered in OpenAPI.gittensory_get_issue_qualityexposes the same data privately (mcp/server.ts); falls back to anot_foundpayload when the repo is unknown so clients render cleanly.buildContributorOpportunitiesnow accepts an optionalMap<repoFullName, IssueQualityReport>and applies issue-quality status to opportunity ranking:do_not_usedrops the issue,needs_proofdowngrades it tocaution(even when lane fit is strong),holdadds a warning and reduces score,readyboosts. Lookup is case-insensitive; falls through to existing behavior when the map is empty (signals/engine.ts).Acceptance criteria → coverage
reasons[]andwarnings[]per issue. Integration test seeds a snapshot and exercises the tool.direct-PR firstwarning that surfaces asneeds_proofstatus; fixture asserts the warning content.readystatus without lane warnings; opportunity-integration test asserts theIssue quality report rates this issue as ready.reason surfaces.do_not_use(linked-PR) fixture confirms the issue is dropped from opportunities. Duplicate-prone fixture asserts the collision warning.Validation
npm run typecheck— passnpm run test:coverage— 359 tests pass; branches at 95.11% over the 95% gatenpm run test:workers— workers suite greenSafety
Open questions for review
signal_snapshotsrows (matching the pattern every other signal uses) rather than going through the dedicatedissue_quality_reportstable. The dedicated table +upsertIssueQualityReportare now effectively unused — happy to remove them in this PR or leave for a separate cleanup. Lean toward leaving for cleanup so this PR stays focused.ready | needs_proof | hold | do_not_use). The issue body sketched a 7-class taxonomy (actionable | too broad | stale | duplicate-prone | already solved | needs maintainer context | good candidate) — those distinctions exist today in thewarnings[]strings. Open to promoting them to first-class statuses in a follow-up if you'd rather them be enum members.Relationship to other in-flight work
engine.ts buildContributorOpportunitiesvsdecision-pack.ts buildContributorOpportunity-or-RepoDecision).