muse_code_sdk/msp/method/feedback.rs
1// @generated from the MSP stable schema and protocol sources; do not edit by hand.
2
3use serde::Deserialize;
4use serde::Serialize;
5
6mod catch_all;
7
8/// `feedback/submit` classification: the four TUI classes in camelCase wire
9/// spelling. **Closed**: a client-selected param vocabulary.
10#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
11#[serde(rename_all = "camelCase")]
12pub enum FeedbackClassification {
13 /// A bug report; the note is non-empty.
14 Bug,
15 /// A bad model result.
16 BadResult,
17 /// A good model result; never attaches the session record.
18 GoodResult,
19 /// Anything else.
20 Other,
21}
22
23/// `feedback/submit` result `outcome`: how one confirmed submit resolved,
24/// mirroring the TUI `FeedbackSubmitOutcome` taxonomy. **Open**: a
25/// server-produced result vocabulary — an older client reading a newer value it
26/// does not know follows the open-enum tolerance rule instead of rejecting it.
27#[derive(Debug, Clone, PartialEq, Eq)]
28#[non_exhaustive]
29pub enum FeedbackSubmitOutcome {
30 /// The intake accepted and returned an upload id.
31 Uploaded,
32 /// A suppressed accept — recorded with no upload id.
33 Recorded,
34 /// Accepted, but the response receipt could not be read.
35 AcceptedWithoutReceipt,
36 /// Accepted, but the internal receipt Task definitely could not be
37 /// created.
38 TrackingFailed,
39 /// Accepted and receipt-Task creation started, but its outcome is
40 /// unknown.
41 TrackingUncertain,
42 /// The endpoint is dark — quiet, one attempt.
43 Dark,
44 /// The process-lifetime disable latch was already set.
45 Disabled,
46 /// No Model API key resolved — the upload was not attempted.
47 NoCredential,
48 /// The key was rejected; the latch is now set.
49 AuthRejected,
50 /// Rate limited, with the effective retry delay.
51 RateLimited,
52 /// Everything else (timeouts, transport errors, 4xx/5xx).
53 Failed,
54 /// A value from a newer host, kept verbatim so an older client decodes the
55 /// rest of the message. Never construct it with a known word.
56 Unknown(String),
57}
58
59/// `feedback/submit` params: mirrors the TUI confirm-time `FeedbackRequest`.
60/// The call itself is the explicit confirm.
61#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
62#[serde(rename_all = "camelCase")]
63pub struct FeedbackSubmitParams {
64 /// The report class (required).
65 pub classification: FeedbackClassification,
66 /// The user report text (required; non-empty for `bug`).
67 pub note: String,
68 /// The files-consent decision (required).
69 pub with_files: bool,
70 /// Consent to attach the session record; honored only for
71 /// `bug`/`badResult` with `session_id` present. `true` with
72 /// `with_files: false`, with a non-`bug`/`badResult` classification,
73 /// or without `session_id` is `invalidParams` (F4, F8).
74 /// Defaults to `false`.
75 #[serde(default)]
76 pub attach_session_record: bool,
77 /// Names the session this call is about when present (F8,
78 /// superseding F3): the bundle lands in that session's dir. Names a
79 /// session this host owns. When absent, the bundle lands in the
80 /// host-level feedback folder and the `session_id` tag is omitted.
81 #[serde(default, skip_serializing_if = "Option::is_none")]
82 pub session_id: Option<String>,
83 /// An absolute same-host path to a client-packed bundle, admitted
84 /// only as a regular file under a size cap.
85 #[serde(skip_serializing_if = "Option::is_none")]
86 pub client_artifacts_path: Option<String>,
87}
88
89/// `feedback/submit` result: the upload receipt.
90#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
91#[serde(rename_all = "camelCase")]
92#[non_exhaustive]
93pub struct FeedbackSubmitResult {
94 /// How the submit resolved.
95 pub outcome: FeedbackSubmitOutcome,
96 /// The intake's accept id — always present on the `uploaded` arm,
97 /// optional on `trackingFailed`/`trackingUncertain`; never fabricated
98 /// on `recorded`.
99 #[serde(skip_serializing_if = "Option::is_none")]
100 pub upload_id: Option<String>,
101 /// The internal receipt-Task id once that Task succeeds.
102 #[serde(skip_serializing_if = "Option::is_none")]
103 pub task_id: Option<String>,
104 /// The host-local absolute path of the always-written local bundle.
105 pub bundle_path: String,
106 /// The failure cause on the `failed`, `acceptedWithoutReceipt`,
107 /// `trackingFailed`, and `trackingUncertain` arms.
108 #[serde(skip_serializing_if = "Option::is_none")]
109 pub cause: Option<String>,
110 /// The effective retry delay in milliseconds, on `rateLimited`.
111 #[serde(skip_serializing_if = "Option::is_none")]
112 pub retry_after_ms: Option<u64>,
113 /// Whether the consented session record rode at all.
114 pub session_record_attached: bool,
115 /// Whether the consented session record rode shortened to fit.
116 pub session_record_truncated: bool,
117 /// The consent-vs-reality session note, kept for display.
118 #[serde(skip_serializing_if = "Option::is_none")]
119 pub session_note: Option<String>,
120 /// The consent-vs-reality local-tracing note, kept for display.
121 #[serde(skip_serializing_if = "Option::is_none")]
122 pub local_tracing_note: Option<String>,
123}