Repository navigation
feat(ai): list_maple_feedback, the Maple team's cross-org reader for agent feedback - #2330
Confidence 10/10 · No issues found
🟢 Confidence 10/10 · safe to merge. Cross-org read gated by MAPLE_INTERNAL_ORG_ID and the transport's credential class; both paths are pinned by the new service and registry tests.
no findings · tests covered · risk high · 2/2 new units observable
Adds AgentFeedbackService.triage, a cross-org newest-first read gated on MAPLE_INTERNAL_ORG_ID and on a person/API-key audit actor, and the list_maple_feedback MCP tool over it. The gate, LIKE escaping and filters are covered by tests; safe to merge. It does not touch the open McpQueryError issues: the registry diff is one import and one registration line, so those stacks are unchanged.
AgentFeedbackService.triagereads every org via.crossTenant()after the internal-org checklist_maple_feedbackrefuses asystemor absent audit actor and maps the forbidden error toinsufficient_scopeMAPLE_INTERNAL_ORG_IDbound onmaple-aiasEnv.MAPLE_INTERNAL_ORG_IDListMapleFeedbackOutputadded toMcpToolOutputsand the registry
Before merge
- Manual · Confirm
MAPLE_INTERNAL_ORG_IDin the maple-ai plain-var store for prd and dev, exactly equal to the internal org's tenant id
Production impact
Open errors in the changed files (2)
| Issue | Service | Occurrences | File |
|---|---|---|---|
| @maple/mcp/errors/McpQueryError (5 issues) | maple-chat | 33 | apps/ai/src/mcp/tools/registry.ts |
| @maple/mcp/errors/McpQueryError (5 issues) | maple-ai | 15 | apps/ai/src/mcp/tools/registry.ts |
After this merges, Maple checks whether they stop.
Production traffic of the changed files (last 7 days)
| File | Calls/day | Busiest operations |
|---|---|---|
apps/ai/src/mcp/tools/list-maple-feedback.ts |
58k | POST /mcp 29k/day, 0.0% errPOST /mcp 29k/day, 0.0% errGET /mcp 293/day, 0.0% err |
apps/ai/src/worker.ts |
58k | POST /mcp 29k/day, 0.0% errPOST /mcp 29k/day, 0.0% errGET /mcp 293/day, 0.0% err |
Telemetry this change adds and removes (2)
- ➕ span name
McpTool.listMapleFeedback·apps/ai/src/mcp/tools/list-maple-feedback.ts:44 - ➕ span name
AgentFeedbackService.triage·packages/backend/src/services/feedback/AgentFeedbackService.ts:198
What was checked
- Gate holds end to end:
mcpAuditActormarksmaple_svc_bears assystem(mcp/app.ts:117) and api forwards headers untouched (ai-forward.ts:103) related_toescapes\,%and_; therunXsqldecoy in AgentFeedbackService.test.ts proves_is literalstart_timedecodes throughWarehouseTimeInputandlimitclamps 1..200, so no NaN reaches the column compare
Observability coverage: 2 of 2 changes observable
| Change | Kind | Observable | Evidence |
|---|---|---|---|
| list_maple_feedback MCP tool handler | inbound tool call | yes | Effect.fn("McpTool.listMapleFeedback") span at list-maple-feedback.ts:44 |
| AgentFeedbackService.triage cross-org Postgres read | database query | yes | Effect.fn("AgentFeedbackService.triage") with orgId/limit/result.rowCount, plus the dbExecute span at AgentFeedbackService.ts:198-229 |
7f2c60e · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.