Skip to content

feat(mcp): add loopover_file_incident_report write tool#9355

Closed
bitfathers94 wants to merge 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-9298
Closed

feat(mcp): add loopover_file_incident_report write tool#9355
bitfathers94 wants to merge 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-9298

Conversation

@bitfathers94

Copy link
Copy Markdown
Contributor

feat(mcp): add loopover_file_incident_report write tool

Mirror POST /v1/repos/:owner/:repo/pulls/:number/incident-reports over the
MCP surface so a maintainer-authenticated client can file a post-merge
incident report on a harmful rented-loop PR, closing the write-side gap next
to the already-wrapped maintainer-packet/reviewability read tools.

The handler replays the REST route exactly: maintainer-manage auth, the
PR-must-exist-and-be-merged validation, then recordPostMergeIncidentReport
with reporterKind "customer" and the calling actor, returning the same
{ ok, repoFullName, pullNumber, ...report } shape. Reuses
postMergeIncidentReportSchema's field validation for the body input.

Closes #9298

Validation

Verified locally on this branch before opening:

  • npm run typecheck
  • npx turbo run build:tsc build:verify
  • npm run test:coverage — patch coverage 100.0% of changed lines

Mirror POST /v1/repos/:owner/:repo/pulls/:number/incident-reports over the
MCP surface so a maintainer-authenticated client can file a post-merge
incident report on a harmful rented-loop PR, closing the write-side gap next
to the already-wrapped maintainer-packet/reviewability read tools.

The handler replays the REST route exactly: maintainer-manage auth, the
PR-must-exist-and-be-merged validation, then recordPostMergeIncidentReport
with reporterKind "customer" and the calling actor, returning the same
{ ok, repoFullName, pullNumber, ...report } shape. Reuses
postMergeIncidentReportSchema's field validation for the body input.
@bitfathers94
bitfathers94 requested a review from JSONbored as a code owner July 27, 2026 13:53
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

❌ 74 Tests Failed:

Tests completed Failed Passed Skipped
488 74 414 0
View the top 3 failed test(s) by shortest run time
test/integration/app-installations-selfservice.test.ts > test/integration/app-installations-selfservice.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/app-installations-selfservice.test.ts:3:1
test/integration/audit-labels-routes.test.ts > test/integration/audit-labels-routes.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/audit-labels-routes.test.ts:2:1
test/integration/public-decision-ledger-routes.test.ts > test/integration/public-decision-ledger-routes.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/public-decision-ledger-routes.test.ts:2:1
test/integration/regate-pr-admin-trigger.test.ts > test/integration/regate-pr-admin-trigger.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/regate-pr-admin-trigger.test.ts:3:1
test/integration/shot-route.test.ts > test/integration/shot-route.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/shot-route.test.ts:12:1
test/unit/auth.test.ts > test/unit/auth.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/auth.test.ts:5:1
test/unit/knob-loosening-run.test.ts > test/unit/knob-loosening-run.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/knob-loosening-run.test.ts:33:1
test/unit/maintainer-chat-qa.test.ts > test/unit/maintainer-chat-qa.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/maintainer-chat-qa.test.ts:3:1
test/unit/routes-ams-notifications.test.ts > test/unit/routes-ams-notifications.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-ams-notifications.test.ts:2:1
test/unit/routes-boundary-tests.test.ts > test/unit/routes-boundary-tests.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-boundary-tests.test.ts:2:1
test/unit/routes-config-push.test.ts > test/unit/routes-config-push.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-config-push.test.ts:8:1
test/unit/routes-evaluate-escalation.test.ts > test/unit/routes-evaluate-escalation.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-evaluate-escalation.test.ts:2:1
test/unit/routes-improvement-potential.test.ts > test/unit/routes-improvement-potential.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-improvement-potential.test.ts:2:1
test/unit/routes-ingest-and-repo-scope-security.test.ts > test/unit/routes-ingest-and-repo-scope-security.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-ingest-and-repo-scope-security.test.ts:2:1
test/unit/routes-installation-bulk-agent-settings.test.ts > test/unit/routes-installation-bulk-agent-settings.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-installation-bulk-agent-settings.test.ts:2:1
test/unit/routes-intake-idea.test.ts > test/unit/routes-intake-idea.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-intake-idea.test.ts:2:1
test/unit/routes-issue-plan-draft.test.ts > test/unit/routes-issue-plan-draft.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-issue-plan-draft.test.ts:2:1
test/unit/routes-notifications.test.ts > test/unit/routes-notifications.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-notifications.test.ts:4:1
test/unit/routes-open-pr-pressure.test.ts > test/unit/routes-open-pr-pressure.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-open-pr-pressure.test.ts:2:1
test/unit/routes-plan-idea-claims.test.ts > test/unit/routes-plan-idea-claims.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-plan-idea-claims.test.ts:2:1
test/unit/routes-pr-outcomes.test.ts > test/unit/routes-pr-outcomes.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-pr-outcomes.test.ts:2:1
test/unit/routes-progress-snapshot.test.ts > test/unit/routes-progress-snapshot.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-progress-snapshot.test.ts:2:1
test/unit/routes-repo-doc-refresh.test.ts > test/unit/routes-repo-doc-refresh.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-repo-doc-refresh.test.ts:3:1
test/unit/routes-request-apr-transfer.test.ts > test/unit/routes-request-apr-transfer.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-request-apr-transfer.test.ts:2:1
test/unit/routes-results-payload.test.ts > test/unit/routes-results-payload.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-results-payload.test.ts:2:1
test/unit/routes-review-risk.test.ts > test/unit/routes-review-risk.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-review-risk.test.ts:4:1
test/unit/routes-satisfaction-floor-loosening.test.ts > test/unit/routes-satisfaction-floor-loosening.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-satisfaction-floor-loosening.test.ts:2:1
test/unit/routes-test-evidence.test.ts > test/unit/routes-test-evidence.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-test-evidence.test.ts:2:1
test/unit/routes-watches.test.ts > test/unit/routes-watches.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-watches.test.ts:4:1
test/unit/rule-calibration-trend.test.ts > test/unit/rule-calibration-trend.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/rule-calibration-trend.test.ts:12:1
test/unit/satisfaction-floor-status.test.ts > test/unit/satisfaction-floor-status.test.ts
Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/satisfaction-floor-status.test.ts:10:1
View the full list of 43 ❄️ flaky test(s)
test/integration/ams-ingest.test.ts > test/integration/ams-ingest.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 1 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/ams-ingest.test.ts:2:1
test/integration/api.test.ts > test/integration/api.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/api.test.ts:39:1
test/integration/maintainer-activation.test.ts > test/integration/maintainer-activation.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/maintainer-activation.test.ts:2:1
test/integration/orb-broker.test.ts > test/integration/orb-broker.test.ts

Flake rate in main: 80.00% (Passed 2 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/orb-broker.test.ts:2:1
test/integration/orb-ingest.test.ts > test/integration/orb-ingest.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 6 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/orb-ingest.test.ts:2:1
test/integration/orb-oauth.test.ts > test/integration/orb-oauth.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 10 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/orb-oauth.test.ts:2:1
test/integration/orb-onboarding.test.ts > test/integration/orb-onboarding.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 10 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/orb-onboarding.test.ts:2:1
test/integration/orb-relay.test.ts > test/integration/orb-relay.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 10 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/orb-relay.test.ts:2:1
test/integration/orb-webhook.test.ts > test/integration/orb-webhook.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/orb-webhook.test.ts:3:1
test/integration/public-quality-metrics-route-error.test.ts > test/integration/public-quality-metrics-route-error.test.ts

Flake rate in main: 80.00% (Passed 2 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/public-quality-metrics-route-error.test.ts:8:1
test/integration/public-stats-route-error.test.ts > test/integration/public-stats-route-error.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 10 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/public-stats-route-error.test.ts:12:1
test/integration/public-stats-route.test.ts > test/integration/public-stats-route.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/public-stats-route.test.ts:2:1
test/integration/routes-errors.test.ts > test/integration/routes-errors.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 10 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/routes-errors.test.ts:2:1
test/integration/subnet-interface.test.ts > test/integration/subnet-interface.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 6 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/integration/subnet-interface.test.ts:2:1
test/unit/access-boundary.test.ts > test/unit/access-boundary.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 10 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/access-boundary.test.ts:2:1
test/unit/ai-key-byok.test.ts > test/unit/ai-key-byok.test.ts

Flake rate in main: 80.00% (Passed 2 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/ai-key-byok.test.ts:3:1
test/unit/auth-github-token.test.ts > test/unit/auth-github-token.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 3 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/auth-github-token.test.ts:2:1
test/unit/cloudflare-worker-runtime-detection.test.ts > test/unit/cloudflare-worker-runtime-detection.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 3 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/cloudflare-worker-runtime-detection.test.ts:2:1
test/unit/docs-examples-schema.test.ts > test/unit/docs-examples-schema.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 10 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/docs-examples-schema.test.ts:3:1
test/unit/draft.test.ts > test/unit/draft.test.ts

Flake rate in main: 80.00% (Passed 2 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/draft.test.ts:2:1
test/unit/index.test.ts > test/unit/index.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ src/index.ts:1:1
test/unit/linear-key.test.ts > test/unit/linear-key.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 6 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/linear-key.test.ts:3:1
test/unit/ops-wire.test.ts > test/unit/ops-wire.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/ops-wire.test.ts:2:1
test/unit/parity-wire.test.ts > test/unit/parity-wire.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 10 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/parity-wire.test.ts:2:1
test/unit/predicted-gate-agreement.test.ts > test/unit/predicted-gate-agreement.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 5 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/predicted-gate-agreement.test.ts:2:1
test/unit/retention.test.ts > test/unit/retention.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 6 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/retention.test.ts:2:1
test/unit/routes-agent-approval.test.ts > test/unit/routes-agent-approval.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-agent-approval.test.ts:46:1
test/unit/routes-ai-byok.test.ts > test/unit/routes-ai-byok.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 6 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-ai-byok.test.ts:2:1
test/unit/routes-check-before-start.test.ts > test/unit/routes-check-before-start.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 10 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-check-before-start.test.ts:2:1
test/unit/routes-contributor-issue-draft.test.ts > test/unit/routes-contributor-issue-draft.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-contributor-issue-draft.test.ts:2:1
test/unit/routes-cors.test.ts > test/unit/routes-cors.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 3 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-cors.test.ts:2:1
test/unit/routes-focus-manifest.test.ts > test/unit/routes-focus-manifest.test.ts

Flake rate in main: 80.00% (Passed 2 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-focus-manifest.test.ts:2:1
test/unit/routes-gate-outcome-breakdown.test.ts > test/unit/routes-gate-outcome-breakdown.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 3 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-gate-outcome-breakdown.test.ts:2:1
test/unit/routes-internal-decision-calibration.test.ts > test/unit/routes-internal-decision-calibration.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 3 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-internal-decision-calibration.test.ts:2:1
test/unit/routes-issue-rag.test.ts > test/unit/routes-issue-rag.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 3 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-issue-rag.test.ts:2:1
test/unit/routes-kill-switch.test.ts > test/unit/routes-kill-switch.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-kill-switch.test.ts:12:1
test/unit/routes-maintainer-noise.test.ts > test/unit/routes-maintainer-noise.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 5 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-maintainer-noise.test.ts:2:1
test/unit/routes-post-merge-incident-reports.test.ts > test/unit/routes-post-merge-incident-reports.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 5 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-post-merge-incident-reports.test.ts:3:1
test/unit/routes-pr-ai-review-findings.test.ts > test/unit/routes-pr-ai-review-findings.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 5 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-pr-ai-review-findings.test.ts:2:1
test/unit/routes-remediation-plan.test.ts > test/unit/routes-remediation-plan.test.ts

Flake rate in main: 80.00% (Passed 2 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-remediation-plan.test.ts:2:1
test/unit/routes-self-dogfood-registration-pack.test.ts > test/unit/routes-self-dogfood-registration-pack.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 8 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-self-dogfood-registration-pack.test.ts:2:1
test/unit/routes-selfhost-dead-letter-queue.test.ts > test/unit/routes-selfhost-dead-letter-queue.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 6 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-selfhost-dead-letter-queue.test.ts:3:1
test/unit/routes-taxonomy-mirrors.test.ts > test/unit/routes-taxonomy-mirrors.test.ts

Flake rate in main: 100.00% (Passed 0 times, Failed 5 times)

Stack Traces | 0s run time
TypeError: Cannot read properties of undefined (reading 'shape')
 ❯ src/mcp/server.ts:264:36
 ❯ src/api/routes.ts:183:1
 ❯ test/unit/routes-taxonomy-mirrors.test.ts:2:1

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 27, 2026
@loopover-orb

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-27 14:00:15 UTC

3 files · 1 AI reviewer · no blockers · CI failing · unstable

🛑 Suggested Action - Fix Blockers

Review summary
This is a well-targeted mirror of the existing POST /v1/repos/:owner/:repo/pulls/:number/incident-reports REST route onto the MCP surface, reusing the exported postMergeIncidentReportSchema for field validation and replicating the exact maintainer-manage auth, PR-exists-and-merged validation, and recordPostMergeIncidentReport call. The wiring is correct end-to-end: schema export in routes.ts, shape composition and tool registration in server.ts, and a test suite exercising success (static + session actor), not-found, not-merged, and forbidden-access paths, all verified against the real audit_events row.

Nits — 5 non-blocking
  • The two size-smell flags on src/api/routes.ts and src/mcp/server.ts are pre-existing file sizes, not something this diff meaningfully worsens (72 and 1 lines added respectively), so they're not actionable here.
  • src/mcp/server.ts: the actor resolution `this.identity.kind === "session" ? this.identity.actor : "mcp"` duplicates a pattern used elsewhere in the file (e.g. generateContributorIssueDrafts) — consider a small shared helper if this repeats much further, though three call sites is still within reason.
  • The FAILED CI checks (validate, validate-code, validate-tests) have no detail provided in this context, so their cause could not be verified from what's given here — worth confirming they're not flagging something in this diff before merge.
  • src/mcp/server.ts:fileIncidentReport — if this actor-resolution pattern shows up in a fourth or fifth tool handler, factor it into a small `resolveMcpActor(this.identity)` helper for consistency.
  • Double check the `validate`/`validate-code`/`validate-tests` CI failures locally since no detail was provided in this review context.

CI checks failing

  • validate
  • validate-code
  • validate-tests

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #9298
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 65 registered-repo PR(s), 45 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bitfathers94; Gittensor profile; 65 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The PR adds loopover_file_incident_report to src/mcp/server.ts using ownerRepoPullShape plus postMergeIncidentReportSchema fields, registers it under MCP_TOOL_CATEGORIES as "maintainer", replicates the REST route's maintainer-manage auth, PR-exists/merged validation, and recordPostMergeIncidentReport call with reporterKind "customer", and includes unit tests for happy path, not-found, not-merged,

Review context
  • Author: bitfathers94
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript
  • Official Gittensor activity: 65 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
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.
🧪 Chat with LoopOver

Ask 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.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/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.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-code, validate-tests)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 27, 2026
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.

mcp: add loopover_file_incident_report tool mirroring POST .../pulls/:number/incident-reports

1 participant