feat(mcp): gittensory_remediation_plan - #650
Conversation
Turn local branch blocker lists into an ordered, deduplicated public-safe remediation checklist with per-item rerun conditions. 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. |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
gittensory · advisory review Reviewed 10 changed file(s) — two independent AI reviewers. Changed files (10)
Suggested action: 🛠️ Request changes. Address the suggestions below before merging. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
Cover blocker-specific rerun paths and MCP tool-call behavior so CI branch coverage stays above the 97% threshold. Co-authored-by: Cursor <cursoragent@cursor.com>
Treat wallet or score redactions as empty steps so fallback remediation text is used, and align tests with public sanitizer output. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
) * fix(gate): never leave the Gittensory Gate check stuck in_progress Production incident: the 'Gittensory Gate is evaluating' check on PR #650 stayed in_progress for ~8h. Root cause: maybePublishPrPublicSurface posts the pending (in_progress) gate check, then does D1 + GitHub + Gittensor work before the completing PATCH — with no request timeouts and no failure finalization. If anything in that gap hangs (a bare fetch to a slow upstream) or throws, the completing PATCH never runs and the check is orphaned forever; the caller's .catch only logs it. Confirmed via prod: miner detection was a cache hit at 13:35:08, the pending check posted at 13:35:11, then nothing — no completion, no error row (a hang, not a caught throw), while prod D1 was intermittently overloaded. Fix: - Bound every external call in the gate window with a request timeout so a hang becomes a catchable error: AbortSignal.timeout on the GitHub App fetches + the Octokit instance (src/github/app.ts) and on the Gittensor API client (src/gittensor/api.ts, the single fetchJson chokepoint). - Wrap the pending-post -> completion window in try/catch. On any failure, finalize the SAME check run to a neutral, non-blocking 'could not finish evaluating — will re-run' state (createOrUpdateErroredGateCheckRun) and audit it, so the Gate is always terminal and never hangs. Only finalizes when a real conclusion was not already published (no clobbering verdicts). Test proves a failed completion PATCH is followed by a neutral finalize of the same check id. Coverage holds above the 97% gate. * fix(queue): dead-letter exhausted gittensory-jobs instead of dropping them silently The gittensory-jobs consumer had no dead_letter_queue, so a webhook job that fails its retries was silently dropped (no record once webhook_events isn't reached). Route exhausted jobs to a new gittensory-jobs-dlq landing queue (created on the account; no consumer, matching the house pattern) and set max_retries explicitly. Validated with wrangler deploy --dry-run. Co-requisite infra (already provisioned): `wrangler queues create gittensory-jobs-dlq`.
|
Hi, @JSONbored |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #650 +/- ##
==========================================
+ Coverage 96.59% 96.66% +0.06%
==========================================
Files 91 92 +1
Lines 13646 13720 +74
Branches 4975 5001 +26
==========================================
+ Hits 13182 13263 +81
+ Misses 97 88 -9
- Partials 367 369 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Cover invalid/unauthorized route paths, focusManifest handling, and remaining remediation-plan branch arms so patch coverage clears 97%. Co-authored-by: Cursor <cursoragent@cursor.com>
Use an admin session for forbidden_contributor coverage and expect fallback steps when blocker text is fully redacted. Co-authored-by: Cursor <cursoragent@cursor.com>
Exercise the remediation-plan route manifest merge path and remaining remediation-plan rerun fallbacks to clear codecov patch coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
JSONbored
left a comment
There was a problem hiding this comment.
PR #650 — feat(mcp): gittensory_remediation_plan
Verdict: MERGE
Resolves issue #548: FULLY
CI: All green (validate, test x2, lint, workers, mcp, ui, security, Superagent Security Scan = success, codecov). gittensory/Context neutral.
Highlights:
- Implements the tool: buildRemediationPlan consolidates accountStateBlockers/branchQualityBlockers/scoreBlockers + recommendedRerunCondition into an ordered, deduplicated checklist; each item carries impact level + tailored rerun condition; account-state prioritized first, then branch-quality, then score ("highest-impact first").
- Registered in both the HTTP MCP server (with outputSchema) and the local MCP bin, plus POST /v1/local/remediation-plan with requireContributorAccess self-only enforcement and 400/403 negative tests.
- Public-safe authoring: sanitizePublicComment + forbidden-term/filesystem-path regex; rerun conditions rewrite scoreability/multiplier language and strip local paths; extensive ordering/dedup/forbidden-term unit tests.
Concerns / required changes:
- Minor (prior scope-creep re-checked): the unrelated gittensory_explain_score_breakdown / /v1/scoring/explain-breakdown additions are now TEST-ONLY for a route that already exists on main — no new unrelated production endpoint. Tangential but harmless; could be trimmed.
Completeness vs issue: Given multiple blockers it returns a correctly ordered, deduped, public-safe remediation plan with rerun conditions, registered and tested per the AC. Fully resolves #548.
Summary
buildRemediationPlanto consolidatebranchQualityBlockers,accountStateBlockers, andscoreBlockersfrom local branch analysis into an ordered, deduplicated public-safe checklist.gittensory_remediation_planin the HTTP MCP server and local MCP package, plusPOST /v1/local/remediation-planfor the bin client.Closes #548
Test plan
npm run typechecknpm run build:mcpnpm run test:coverage -- test/unit/remediation-plan.test.tsnpm run validate)Made with Cursor