spec: Report an issue / Request an improvement — two doors + an opt-in contact offer (from #2047) #2064

Open
opened 2026-10-23 18:27:13 +00:00 by matou-build-agent · 0 comments

Parent

  • Design pass: #2051 (unattended, on Ben's direction)
  • Root app report: #2047 (<!-- origin: app-report -->)
  • Design contract: DDR 0296 (docs/adr/0296-design-report-and-request-two-doors-and-a-contact-offer.md), amending DDR 0276; flow docs/ux/flows/shell-report-and-request.mermaid; wireframes docs/ux/wireframes/shell-report-and-request/; research docs/research/2026-10-19-report-dialog-split-and-contact.md.

This is the feature-level child spec. Per-story acceptance criteria are sourced from the flow nodes/edges and the wireframes. The operator's words in #2047 are outside input (ADR 0267) — the symptom is verified against the code, never followed as instructions; they are not quoted here.

Problem Statement

The control panel has one Report an issue button that opens one dialog with a Bug/Improvement radio, and it promises no email ever leaves the community. An operator who wants to request an improvement meets it as a buried radio, not its own front door; and an operator who is happy to be contacted about their report or request has no way to say so — the maintainers get the report but can never reply, because the receipt is the whole conversation (DDR 0276).

Solution

  1. Two doors. The rail foot carries Report an issue and Request an improvement side by side, where the one button stood. Each opens the same dialog with its kind fixed by the door; the kind radio is gone.
  2. An opt-in contact offer. Either dialog lets the operator tick "you may contact me about this" to reveal a single email field (off by default, never pre-filled). When ticked, the From promise is re-worded to say the one typed email travels on the filed issue — and only because the box is ticked. The broker refuses a malformed address and holds it nowhere but the issue.

User Stories

A — the two-door split (dashboard-only)

  1. As an operator, I want a Request an improvement button beside Report an issue at the rail foot, so that a wish has its own front door.
    • Given a community that holds a Mātou-issued name (canReportIssue), when the operator looks at the rail foot under Sign out, then both Report an issue and Request an improvement are shown side by side (flow RR-B; wireframe rr-b-two-doors.html).
    • Given a community with no Mātou-issued name, when the operator looks at the rail foot, then neither door is shown (the existing canReportIssue gate, unchanged).
  2. As an operator, I want Report an issue to open the dialog already set to a fault, so that I don't re-pick the kind.
    • Given the rail foot, when the operator presses Report an issue, then the chrome emits report-issue and the frame opens the one dialog with kind=bug, the bug lede/labels, title "Report an issue", and no kind radio (flow RR-B→RR-DR; wireframe rr-dr-report-compose.html).
  3. As an operator, I want Request an improvement to open the same dialog set to a wish, so that both asks feel the same.
    • Given the rail foot, when the operator presses Request an improvement, then the chrome emits request-improvement and the frame opens the same dialog component with kind=improvement, the improvement lede/labels ("what you'd like…"), title "Request an improvement", and primary button "Send request" (flow RR-B→RR-DQ; wireframe rr-dq-request-compose.html).
  4. As an IDSS maintainer, I want an improvement to read differently from a fault at intake, so that triage routes it right.
    • Given a sent improvement, when the broker files the issue, then the body's unfenced - Kind: improvement bullet carries it (unchanged from DDR 0276) and the title is still App report from <slug>; the split changes no broker, golden, intake-check or gate behaviour.
  5. As an operator, I want each door's dialog to send, receive and fail exactly as before, so that nothing else changes.
    • Given either compose screen with both fields filled, when the operator presses Send, then one relay call runs behind the Sending chip and lands on the per-kind receipt ("Report sent" / "Request sent"; flow RR-DR→RR-DRs, RR-DQ→RR-DQs; wireframes rr-drs-report-sent.html, rr-dqs-request-sent.html).
    • Given either compose screen, when the broker refuses or cannot be reached, then the single fail-loud shape shows with the reason and the kept words, Try again / Leave it for now (flow →RR-DRx; wireframe rr-drx-nothing-sent.html).
    • Given either compose screen with an empty title or description, when the operator looks at Send, then it is disabled (existing canSend).

B — the contact offer (member-facing trust surface — ready-for-human)

  1. As an operator, I want to offer a contact email only if I choose to, so that no address leaves the community by default.
    • Given either compose screen, when it opens, then the contact offer checkbox is unticked, no email field is shown, and the From promise reads "…no addresses, no logs, no pictures" unchanged (flow RR-DR/RR-DQ; wireframes rr-dr-… / rr-dq-…).
  2. As an operator, I want ticking "you may contact me" to reveal an empty email field, so that I type the address I want used.
    • Given a compose screen, when the operator ticks the contact box, then a single email field appears empty (never pre-filled from the sign-in) and the From promise's address clause re-words to say the one typed email travels on the filed issue, and only because the box is ticked (flow →RR-DC; wireframe rr-dc-contact-offered.html).
    • Given the contact box ticked and a field value, when the operator unticks it, then the field hides, the value is dropped from what sends, and the promise returns to "no addresses" (flow RR-DC→RR-DR).
  3. As an operator, I want a malformed address refused before anything sends, so that I never send a broken contact.
    • Given the contact box ticked and a malformed address, when the operator looks at Send, then Send is disabled, an inline "that is not an email address" shows under the field, and nothing crosses to the broker (flow →RR-DCx; wireframe rr-dcx-contact-refused.html).
    • Given a corrected valid address, when the operator edits the field, then the inline reason clears and Send re-enables (flow RR-DCx→RR-DC).
  4. As an IDSS maintainer, I want a valid offered address on the filed issue in a fixed, machine-readable place, so that I can reply and a descendant can read it without parsing prose.
    • Given a sent report with a valid contact offer, when the broker files the issue, then the body carries a fifth unfenced bullet - Contact: <email> after Fleet release, outside the operator's-words fence, validated by the strict single-line pattern.
    • Given a sent report with no contact offer, when the broker files the issue, then no - Contact: bullet is present (the four-bullet shape, unchanged).
  5. As an IDSS maintainer, I want the broker to refuse a malformed address and hold it nowhere but the issue, so that the trust promise holds.
    • Given a report whose payload carries a malformed contactEmail, when it reaches the broker, then the broker answers 400 with an operator-facing reason (the fail-loud shape), files nothing, and logs/stores the address nowhere (ADR 0219/0100).
  6. As an IDSS maintainer, I want the intake check and relevance gate to pass both body shapes, so that a report with a contact is read exactly like one without.
    • Given a four-bullet body (no contact), when app_report_wellformed reads it, then it accepts it (unchanged).
    • Given a five-bullet body with a valid - Contact: bullet, when app_report_wellformed reads it, then it accepts it, validating the fifth bullet against the same strict pattern as the renderer, and the words heading one line lower is found correctly.
    • Given a five-bullet body whose - Contact: bullet is malformed, when app_report_wellformed reads it, then it rejects it (to a human, unread).
    • Given both shapes, when scripts/app-report-gate.sh runs, then the relevance gate holds, classifies and disposes each exactly as today.
  7. As an operator, I want a failed send to keep my offered contact, so that Try again re-sends everything.
    • Given a contact offered and a broker refusal/outage, when the fail-loud shape shows, then it keeps both the words and the offered contact, and Try again re-sends both (flow →RR-DRx; wireframe rr-drx-nothing-sent.html).

Implementation Decisions

  • Two intents, one dialog. NavChrome (ui-kit) emits report-issue and request-improvement; the dashboard frame opens the one ReportIssueDialog with a required kind prop. The kind radio and KIND_OPTIONS are removed; KIND_COPY stays, keyed by the prop; dialogTitle follows the kind for both the composing and sent phases. canReportIssue gates both buttons.
  • The split touches no backend. The kind still rides the ReportSend payload → the broker's - Kind: bullet → the intake check → the gate. No golden/intake/gate change for the split.
  • The contact field. ReportSend/ReportBody gain an optional contactEmail (wire contact_email). The dialog adds the opt-in checkbox + revealed field + the re-worded From clause + the client-side strict-pattern belt (Send disabled + inline reason on a malformed value). The field never pre-fills.
  • The broker. ReportInput gains ContactEmail; RenderReportBody appends the fifth unfenced - Contact: bullet only when a valid address is present, validated by a strict single-line pattern (no whitespace/newline/backtick, length-capped) mirrored exactly in the intake check. A malformed address is a 400 in the existing refusal shape; the address is never logged or stored.
  • Golden + intake move together (reports.go ↔ scripts/lib/app-report-lib.sh, "change both or neither"): a second golden for the five-bullet shape; app_report_wellformed accepts four- and five-bullet bodies and validates/positions the optional bullet. GOTCHAS #314.
  • Slicing: two vertical slices — two-door-split (dashboard, ready-for-agent) and contact-offer (dashboard + broker + golden + intake + gate, ready-for-human — the trust surface). Both blocked by #2051; contact-offer also blocked by two-door-split.

Testing Decisions

Good tests check external behaviour at the existing seams, not implementation detail. No new seam is introduced.

  • Dashboard: ReportIssueDialog component tests over the injected ReportIssueSource fake — the two kinds render their copy; the contact offer toggles the field and re-words the promise; a malformed address disables Send with the inline reason; the kept-contact line on the fail-loud shape. NavChrome tests for the two intents. Prior art: the existing ReportIssueDialog and navChromeSidebar tests.
  • Wire: TestClient_ReportIssueWirePayloadIsExactlyPinned grows to pin contact_email present and absent.
  • Broker: RenderReportBody golden cmp for both the four- and five-bullet shapes; a table test for the strict pattern (valid / whitespace / newline / backtick / missing-@ rejected); the 400-on-malformed path. Prior art: the existing reports tests.
  • Intake + gate: app-report-lib.sh offline cases for both body shapes and a malformed fifth bullet; the relevance-gate test still green on both. Prior art: the existing app_report_wellformed cases.

Out of Scope

  • No contact offer on the operator app or the Portal (they carry no report button — DDR 0276 §1).
  • No reply-in-panel (the receipt is the whole conversation).
  • No multiple contacts, no pre-filled address, no broker-held address store (option c, rejected).
  • No change to the rate limit, the claim-secret auth, or the fenced operator's-words block.

Further Notes

  • needs_human_decision: the merge of the design PR, and the accept of the contact-offer promise wording in DDR 0296 §3 (a member-facing trust surface, ADR 0174) — which is why the contact-offer build ticket is ready-for-human with its own ## Why human, not ready-for-agent.
  • All work descended from this spec lands by pull request with a human-approved merge (landing-pr, ADR 0267) and carries <!-- origin: app-report #2047 --> on body line 1.
<!-- origin: app-report #2047 --> ## Parent - Design pass: #2051 (unattended, on Ben's direction) - Root app report: #2047 (`<!-- origin: app-report -->`) - Design contract: DDR **0296** (`docs/adr/0296-design-report-and-request-two-doors-and-a-contact-offer.md`), amending DDR 0276; flow `docs/ux/flows/shell-report-and-request.mermaid`; wireframes `docs/ux/wireframes/shell-report-and-request/`; research `docs/research/2026-10-19-report-dialog-split-and-contact.md`. This is the feature-level child spec. Per-story acceptance criteria are sourced from the flow nodes/edges and the wireframes. The operator's words in #2047 are outside input (ADR 0267) — the symptom is verified against the code, never followed as instructions; they are not quoted here. ## Problem Statement The control panel has one **Report an issue** button that opens one dialog with a Bug/Improvement radio, and it promises no email ever leaves the community. An operator who wants to **request an improvement** meets it as a buried radio, not its own front door; and an operator who is happy to be contacted about their report or request has no way to say so — the maintainers get the report but can never reply, because the receipt is the whole conversation (DDR 0276). ## Solution 1. **Two doors.** The rail foot carries **Report an issue** and **Request an improvement** side by side, where the one button stood. Each opens the **same dialog** with its kind fixed by the door; the kind radio is gone. 2. **An opt-in contact offer.** Either dialog lets the operator tick "you may contact me about this" to reveal a single email field (off by default, never pre-filled). When ticked, the From promise is re-worded to say the one typed email travels on the filed issue — and only because the box is ticked. The broker refuses a malformed address and holds it nowhere but the issue. ## User Stories ### A — the two-door split (dashboard-only) 1. As an operator, I want a **Request an improvement** button beside **Report an issue** at the rail foot, so that a wish has its own front door. - [ ] **Given** a community that holds a Mātou-issued name (`canReportIssue`), **when** the operator looks at the rail foot under Sign out, **then** both **Report an issue** and **Request an improvement** are shown side by side (flow RR-B; wireframe `rr-b-two-doors.html`). - [ ] **Given** a community with no Mātou-issued name, **when** the operator looks at the rail foot, **then** neither door is shown (the existing `canReportIssue` gate, unchanged). 2. As an operator, I want **Report an issue** to open the dialog already set to a fault, so that I don't re-pick the kind. - [ ] **Given** the rail foot, **when** the operator presses **Report an issue**, **then** the chrome emits `report-issue` and the frame opens the one dialog with `kind=bug`, the bug lede/labels, title "Report an issue", and **no kind radio** (flow RR-B→RR-DR; wireframe `rr-dr-report-compose.html`). 3. As an operator, I want **Request an improvement** to open the same dialog set to a wish, so that both asks feel the same. - [ ] **Given** the rail foot, **when** the operator presses **Request an improvement**, **then** the chrome emits `request-improvement` and the frame opens the **same** dialog component with `kind=improvement`, the improvement lede/labels ("what you'd like…"), title "Request an improvement", and primary button "Send request" (flow RR-B→RR-DQ; wireframe `rr-dq-request-compose.html`). 4. As an IDSS maintainer, I want an improvement to read differently from a fault at intake, so that triage routes it right. - [ ] **Given** a sent improvement, **when** the broker files the issue, **then** the body's unfenced `- Kind: improvement` bullet carries it (unchanged from DDR 0276) and the title is still `App report from <slug>`; the split changes no broker, golden, intake-check or gate behaviour. 5. As an operator, I want each door's dialog to send, receive and fail exactly as before, so that nothing else changes. - [ ] **Given** either compose screen with both fields filled, **when** the operator presses Send, **then** one relay call runs behind the Sending chip and lands on the per-kind receipt ("Report sent" / "Request sent"; flow RR-DR→RR-DRs, RR-DQ→RR-DQs; wireframes `rr-drs-report-sent.html`, `rr-dqs-request-sent.html`). - [ ] **Given** either compose screen, **when** the broker refuses or cannot be reached, **then** the single fail-loud shape shows with the reason and the kept words, Try again / Leave it for now (flow →RR-DRx; wireframe `rr-drx-nothing-sent.html`). - [ ] **Given** either compose screen with an empty title or description, **when** the operator looks at Send, **then** it is disabled (existing `canSend`). ### B — the contact offer (member-facing trust surface — ready-for-human) 6. As an operator, I want to offer a contact email only if I choose to, so that no address leaves the community by default. - [ ] **Given** either compose screen, **when** it opens, **then** the contact offer checkbox is **unticked**, no email field is shown, and the From promise reads "…no addresses, no logs, no pictures" unchanged (flow RR-DR/RR-DQ; wireframes `rr-dr-…` / `rr-dq-…`). 7. As an operator, I want ticking "you may contact me" to reveal an empty email field, so that I type the address I want used. - [ ] **Given** a compose screen, **when** the operator ticks the contact box, **then** a single email field appears **empty** (never pre-filled from the sign-in) and the From promise's address clause re-words to say the one typed email travels on the filed issue, and only because the box is ticked (flow →RR-DC; wireframe `rr-dc-contact-offered.html`). - [ ] **Given** the contact box ticked and a field value, **when** the operator unticks it, **then** the field hides, the value is dropped from what sends, and the promise returns to "no addresses" (flow RR-DC→RR-DR). 8. As an operator, I want a malformed address refused before anything sends, so that I never send a broken contact. - [ ] **Given** the contact box ticked and a malformed address, **when** the operator looks at Send, **then** Send is disabled, an inline "that is not an email address" shows under the field, and nothing crosses to the broker (flow →RR-DCx; wireframe `rr-dcx-contact-refused.html`). - [ ] **Given** a corrected valid address, **when** the operator edits the field, **then** the inline reason clears and Send re-enables (flow RR-DCx→RR-DC). 9. As an IDSS maintainer, I want a valid offered address on the filed issue in a fixed, machine-readable place, so that I can reply and a descendant can read it without parsing prose. - [ ] **Given** a sent report with a valid contact offer, **when** the broker files the issue, **then** the body carries a fifth unfenced bullet `- Contact: <email>` after Fleet release, **outside** the operator's-words fence, validated by the strict single-line pattern. - [ ] **Given** a sent report with no contact offer, **when** the broker files the issue, **then** no `- Contact:` bullet is present (the four-bullet shape, unchanged). 10. As an IDSS maintainer, I want the broker to refuse a malformed address and hold it nowhere but the issue, so that the trust promise holds. - [ ] **Given** a report whose payload carries a malformed `contactEmail`, **when** it reaches the broker, **then** the broker answers 400 with an operator-facing reason (the fail-loud shape), files nothing, and logs/stores the address nowhere (ADR 0219/0100). 11. As an IDSS maintainer, I want the intake check and relevance gate to pass both body shapes, so that a report with a contact is read exactly like one without. - [ ] **Given** a four-bullet body (no contact), **when** `app_report_wellformed` reads it, **then** it accepts it (unchanged). - [ ] **Given** a five-bullet body with a valid `- Contact:` bullet, **when** `app_report_wellformed` reads it, **then** it accepts it, validating the fifth bullet against the same strict pattern as the renderer, and the words heading one line lower is found correctly. - [ ] **Given** a five-bullet body whose `- Contact:` bullet is malformed, **when** `app_report_wellformed` reads it, **then** it rejects it (to a human, unread). - [ ] **Given** both shapes, **when** `scripts/app-report-gate.sh` runs, **then** the relevance gate holds, classifies and disposes each exactly as today. 12. As an operator, I want a failed send to keep my offered contact, so that Try again re-sends everything. - [ ] **Given** a contact offered and a broker refusal/outage, **when** the fail-loud shape shows, **then** it keeps both the words and the offered contact, and Try again re-sends both (flow →RR-DRx; wireframe `rr-drx-nothing-sent.html`). ## Implementation Decisions - **Two intents, one dialog.** `NavChrome` (ui-kit) emits `report-issue` and `request-improvement`; the dashboard frame opens the one `ReportIssueDialog` with a required `kind` prop. The kind radio and `KIND_OPTIONS` are removed; `KIND_COPY` stays, keyed by the prop; `dialogTitle` follows the kind for both the composing and sent phases. `canReportIssue` gates both buttons. - **The split touches no backend.** The kind still rides the `ReportSend` payload → the broker's `- Kind:` bullet → the intake check → the gate. No golden/intake/gate change for the split. - **The contact field.** `ReportSend`/`ReportBody` gain an optional `contactEmail` (wire `contact_email`). The dialog adds the opt-in checkbox + revealed field + the re-worded From clause + the client-side strict-pattern belt (Send disabled + inline reason on a malformed value). The field never pre-fills. - **The broker.** `ReportInput` gains `ContactEmail`; `RenderReportBody` appends the fifth unfenced `- Contact:` bullet only when a valid address is present, validated by a strict single-line pattern (no whitespace/newline/backtick, length-capped) mirrored exactly in the intake check. A malformed address is a 400 in the existing refusal shape; the address is never logged or stored. - **Golden + intake move together** (`reports.go` ↔ `scripts/lib/app-report-lib.sh`, "change both or neither"): a second golden for the five-bullet shape; `app_report_wellformed` accepts four- and five-bullet bodies and validates/positions the optional bullet. GOTCHAS #314. - **Slicing:** two vertical slices — `two-door-split` (dashboard, `ready-for-agent`) and `contact-offer` (dashboard + broker + golden + intake + gate, `ready-for-human` — the trust surface). Both blocked by #2051; `contact-offer` also blocked by `two-door-split`. ## Testing Decisions Good tests check external behaviour at the existing seams, not implementation detail. No new seam is introduced. - **Dashboard:** `ReportIssueDialog` component tests over the injected `ReportIssueSource` fake — the two kinds render their copy; the contact offer toggles the field and re-words the promise; a malformed address disables Send with the inline reason; the kept-contact line on the fail-loud shape. `NavChrome` tests for the two intents. Prior art: the existing `ReportIssueDialog` and `navChromeSidebar` tests. - **Wire:** `TestClient_ReportIssueWirePayloadIsExactlyPinned` grows to pin `contact_email` present and absent. - **Broker:** `RenderReportBody` golden `cmp` for both the four- and five-bullet shapes; a table test for the strict pattern (valid / whitespace / newline / backtick / missing-@ rejected); the 400-on-malformed path. Prior art: the existing reports tests. - **Intake + gate:** `app-report-lib.sh` offline cases for both body shapes and a malformed fifth bullet; the relevance-gate test still green on both. Prior art: the existing `app_report_wellformed` cases. ## Out of Scope - No contact offer on the operator app or the Portal (they carry no report button — DDR 0276 §1). - No reply-in-panel (the receipt is the whole conversation). - No multiple contacts, no pre-filled address, no broker-held address store (option c, rejected). - No change to the rate limit, the claim-secret auth, or the fenced operator's-words block. ## Further Notes - `needs_human_decision`: the **merge** of the design PR, and the **accept of the contact-offer promise wording** in DDR 0296 §3 (a member-facing trust surface, ADR 0174) — which is why the `contact-offer` build ticket is `ready-for-human` with its own `## Why human`, not `ready-for-agent`. - All work descended from this spec lands by pull request with a human-approved merge (`landing-pr`, ADR 0267) and carries `<!-- origin: app-report #2047 -->` on body line 1.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#2064
No description provided.