feat(feedback): POST /v1/feedback files crash and bug reports as Gitea issues
A CLI user sends a crash report or /bug report with their own token; the registry files it as an issue in the private feedback repo, titled "[<tenant slug>] <kind>: <title>", with a provenance block (tenant, user, product, version, device, kind, time received) above the body. The caller gets the issue number only. - route group "feedback"; user tokens only; tenant from the principal - 10 reports per person and hour (in memory) - FEEDBACK_GITEA_URL / _REPO / _TOKEN; no token answers 503 - Gitea errors become 502 feedback_failed without body, URL or token - audit event feedback.submitted Refs platform/werkpilot#86 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q9inRayW7ztyk1uAtwMJPR
This commit is contained in:
1 parent
69c15be333
commit
553f4c52fe
13 files changed
+718
-16
No files matched your search
@@ -2635,6 +2635,51 @@ paths:
|
||||
"429": { description: "More than 60 calls for this key in the last hour." }
|
||||
"503": { description: Licence signer not configured. }
|
||||
|
||||
/v1/feedback:
|
||||
post:
|
||||
summary: File a crash report or bug report from a CLI (werkpilot#86).
|
||||
description: |
|
||||
Sent with the person's own token (device flow); any member of the
|
||||
tenant may send one, and the tenant is the token's. Each report
|
||||
becomes an issue in an internal Gitea repo (FEEDBACK_GITEA_REPO),
|
||||
titled `[<tenant slug>] <kind>: <title>`, whose body is a provenance
|
||||
block (tenant slug and id, the user's subject and e-mail, product,
|
||||
version, device, kind, time received in UTC), a `---` rule, then
|
||||
`body` verbatim. Only the issue number is returned. Route group
|
||||
`feedback`. At most 10 reports per person and hour. Fields are
|
||||
trimmed; title, product, version and device must be one line, and
|
||||
longer ones are refused, not cut.
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [product, kind, title, body]
|
||||
properties:
|
||||
product: { type: string, minLength: 1, maxLength: 100, example: werkpilot }
|
||||
kind: { type: string, enum: [crash, bug] }
|
||||
title: { type: string, minLength: 1, maxLength: 200 }
|
||||
body: { type: string, description: "Markdown, at most 200000 bytes." }
|
||||
version: { type: string, maxLength: 100, example: "0.3.1" }
|
||||
device: { type: string, maxLength: 100, description: "hostname" }
|
||||
responses:
|
||||
"201":
|
||||
description: Filed.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [id]
|
||||
properties:
|
||||
id: { type: integer, description: "The issue number in the feedback repo." }
|
||||
"400": { $ref: "#/components/responses/BadRequest" }
|
||||
"403": { description: "Not a user token (user_token_required), or the client lacks the feedback group." }
|
||||
"413": { description: "body exceeds 200000 bytes (too_large)." }
|
||||
"429": { description: "More than 10 reports from this person in the last hour (rate_limited)." }
|
||||
"502": { description: "Gitea did not create the issue (feedback_failed)." }
|
||||
"503": { description: "FEEDBACK_GITEA_TOKEN not set (feedback_disabled)." }
|
||||
|
||||
/.well-known/licence-keys.json:
|
||||
get:
|
||||
summary: Licence verification keys (JWKS, OKP/Ed25519). PUBLIC_EXPLICIT.
|
||||
|
||||
Reference in new issue
Block a user