协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
flexport-common-errors【开发与工程】Classify Flexport REST, OAuth, webhook, and MCP failures into safe operator actions. Use when triaging status/code/message errors, permission failures, validation problems, or ambiguous mutations. Trigger with: "debug Flexport error", "Flexport 422", "Flexport permission denied".
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: flexport-common-errors description: >- Classify Flexport REST, OAuth, webhook, and MCP failures into safe operator actions. Use when triaging status/code/message errors, permission failures, validation problems, or ambiguous mutations. Trigger with: "debug Flexport error", "Flexport 422", "Flexport permission denied". allowed-tools: Read, Grep, Write, Edit version: 2.0.0 argument-hint: '[redacted-failure-receipt]' model: inherit effort: high license: MIT author: Jeremy Longshore jeremy@intentsolutions.io tags:
Do not convert every failure into a retry. First identify the surface and operation class, then distinguish authentication, authorization, validation, provider availability, and ambiguous mutation outcomes.
Label OAuth token, REST v3, MCP JSON-RPC, or webhook delivery; each has different failure semantics.
Capture timestamp, credential alias, version header, operation digest, status/code/message, and provider correlation metadata without payloads or secrets.
Separate 401 authentication, 403 permission/scope, 404 resource or route, 400/422 request validation, throttling evidence, and 5xx/transport uncertainty.
Retry only transient, idempotent work with bounded backoff. Never retry a create or booking until its prior outcome is reconciled.
Route credential issues to credential owners, schema issues to integration owners, business validation to data owners, and provider incidents to support.
Record the corrected contract or recovered result and add a regression fixture when the defect was local.
REST calls authenticate with a cached OAuth 2.0 client-credentials Bearer token using audience https://api.flexport.com, or an explicitly accepted broad API key. Use distinct credentials per workload and never log credentials or tokens. MCP calls use the authenticated connection to https://mcp.flexport.com/mcp and remain subject to each tool's documented account permissions.
Use Read and Grep for discovery and evidence. Use Write or Edit only for the approved artifact, code, configuration, test, or receipt described by this workflow; do not make an unapproved Flexport-side change.
Return a machine-reviewable receipt in this shape; adapt the operation values, but never place credentials or provider payloads in it:
surface: rest-v3
operation: shipment-read
decision: approved
outcome: verified
evidence:
release_sha: recorded-out-of-band
provider_reference: redacted
rollback_owner: logistics-platform
A document upload returns 422 with a provider message. The operator preserves the code/message, fixes the source document metadata, and submits a new approved operation rather than repeatedly sending the unchanged payload.
| Failure | Response |
|---|---|
| 401 persists after one cached-token refresh | Stop and inspect credential revocation, audience, and secret source. |
| 403 on one endpoint | Verify OAuth endpoint resources or MCP role permission; do not broaden silently. |
404 on /tools/... | Use the real MCP JSON-RPC endpoint rather than the synthetic docs path. |
| Timeout after mutation | Reconcile using known references before any retry. |