App report opt-in contact offer (contact-offer, DDR 0296 §3) (#2066) #2173

Closed
matou-build-agent wants to merge 0 commits from agent/issue-2066 into main

closes #2066

Builds the App report opt-in contact offer (DDR 0296 §3) on both compose doors, as Ben ruled on 2026-10-29 ("adopt as designed"). Descends from app report #2047 via design pass #2051; blocked-by #2065 (the two-door split) is landed.

What changed

Dashboard (RR-DR → RR-DC → RR-DCx / RR-DRx) — ReportIssueDialog.vue:

  • An off-by-default checkbox "You may contact me about this report / request" (data-action="toggle-contact"). Ticking reveals a single, never-pre-filled email field (data-field="contact-email" in contact-email-row) and re-words the From promise (from-contact-clause): the standing "…no addresses…" becomes an honest statement that the one typed email travels on the filed issue, and only because the box is ticked.
  • A malformed address shows an inline reason (contact-email-bad) and disables Send — nothing crosses. Correcting it re-enables Send. Unticking hides the field, drops the value and restores the "no addresses" promise.
  • A broker refusal/outage after an offer keeps both the words and the contact (report-contact-kept); Try again re-sends both.

Wire: ReportSend/ReportBody gain an optional contactEmail (wire contact_email, omitempty), added only on a valid offer. The OpenAPI spec grew the field and the generated client was regenerated; TestClient_ReportIssueWirePayloadIsExactlyPinned now pins it present and absent.

Broker (option a): RenderReportBody appends - Contact: <email> as the fifth unfenced bullet after Fleet release, only on a valid, strictly-patterned address (contactEmailPattern — no whitespace/newline/backtick, RFC-254 capped). http_reports.go 400s a malformed offer in the existing refusal shape, before the limiter (a bad offer spends no allowance), and holds the address nowhere but the filed issue (ADR 0219/0100). A new five-bullet golden sibling pins the shape; the four-bullet golden is unchanged.

Intake (same commit — change both or neither): scripts/lib/app-report-lib.sh (app_report_wellformed) now accepts both the four- and five-bullet bodies, validates the optional fifth against the same pattern, shifts the words heading one line lower when present, and rejects a malformed fifth bullet. scripts/app-report-gate.sh holds/classifies/disposes both shapes unchanged.

Acceptance criteria

  • Off by default on both doors; no email field; From promise unchanged (RR-DR/RR-DQ).
  • Ticking reveals an empty field (never pre-filled) and re-words the From clause; unticking hides, drops, restores (RR-DC).
  • Malformed → inline reason, Send disabled, nothing crosses; correcting re-enables (RR-DCx).
  • ReportSend/ReportBody carry optional contactEmail (wire contact_email); pinned present + absent.
  • Broker renders the fifth unfenced bullet only on a valid offer; 400s a malformed one; never logs/stores it.
  • Golden sibling + app-report-lib.sh changed in this commit; four- and five-bullet bodies both accepted; malformed fifth rejected.
  • app-report-gate.sh holds/classifies/disposes both shapes as today.
  • Fail-loud keeps both the words and the contact; Try again re-sends both (RR-DRx).

Tests

Go brokerclient/controlapi/appreport/broker internal/broker (test + vet + gofmt); app-report-lib-test.sh (11 groups) + gate/inherit/workflow/rule-drift; dashboard reportIssueDialog.test.ts (16) + reportIssueClient.test.ts + i18n parity guard + the reportIssue harness spec (contact on/refused/kept states added); vue-tsc + eslint clean.

Unproven by the seam: the real browser→broker→tracker round trip of a contact email (fakes/goldens only).

Screenshots: none — the dashboard browser e2e harness cannot launch Chromium in the Sandcastle sandbox (the downloaded headless shell is missing the system libs libnspr4/libnss3/libgbm/… and flake.nix documents that the swarm container cannot run it — the container's glibc is older than the nixpkgs libs, so they cannot be back-filled; only an Electron e2e shell is provided, for the operator app). The RR-DR/RR-DC/RR-DCx/RR-DRx states are instead proven by the mounted-component unit suite dashboard/tests/unit/reportIssueDialog.test.ts (16 tests over the real component) and by the Playwright harness spec dashboard/tests/e2e/preview-harness/reportIssue.spec.ts (contact on/refused/nothing-sent states added), which a reviewer with a graphical host can run with pnpm --filter @idss/dashboard e2e:harness -- reportIssue.spec.ts to capture the screens.

🤖 Generated with Claude Code

closes #2066 Builds the App report **opt-in contact offer** (DDR 0296 §3) on both compose doors, as Ben ruled on 2026-10-29 ("adopt as designed"). Descends from app report #2047 via design pass #2051; blocked-by #2065 (the two-door split) is landed. ## What changed **Dashboard (RR-DR → RR-DC → RR-DCx / RR-DRx)** — `ReportIssueDialog.vue`: - An off-by-default checkbox *"You may contact me about this report / request"* (`data-action="toggle-contact"`). Ticking reveals a single, **never-pre-filled** email field (`data-field="contact-email"` in `contact-email-row`) and **re-words the From promise** (`from-contact-clause`): the standing "…no addresses…" becomes an honest statement that the one typed email travels on the filed issue, *and only because the box is ticked*. - A malformed address shows an inline reason (`contact-email-bad`) and **disables Send** — nothing crosses. Correcting it re-enables Send. Unticking hides the field, drops the value and restores the "no addresses" promise. - A broker refusal/outage after an offer keeps **both** the words and the contact (`report-contact-kept`); Try again re-sends both. **Wire:** `ReportSend`/`ReportBody` gain an optional `contactEmail` (wire `contact_email`, `omitempty`), added only on a valid offer. The OpenAPI spec grew the field and the generated client was regenerated; `TestClient_ReportIssueWirePayloadIsExactlyPinned` now pins it **present and absent**. **Broker (option a):** `RenderReportBody` appends `- Contact: <email>` as the **fifth unfenced bullet** after Fleet release, only on a valid, strictly-patterned address (`contactEmailPattern` — no whitespace/newline/backtick, RFC-254 capped). `http_reports.go` 400s a malformed offer in the existing refusal shape, **before the limiter** (a bad offer spends no allowance), and holds the address nowhere but the filed issue (ADR 0219/0100). A new five-bullet golden sibling pins the shape; the four-bullet golden is unchanged. **Intake (same commit — change both or neither):** `scripts/lib/app-report-lib.sh` (`app_report_wellformed`) now accepts both the four- and five-bullet bodies, validates the optional fifth against the **same** pattern, shifts the words heading one line lower when present, and rejects a malformed fifth bullet. `scripts/app-report-gate.sh` holds/classifies/disposes both shapes unchanged. ## Acceptance criteria - [x] Off by default on both doors; no email field; From promise unchanged (RR-DR/RR-DQ). - [x] Ticking reveals an empty field (never pre-filled) and re-words the From clause; unticking hides, drops, restores (RR-DC). - [x] Malformed → inline reason, Send disabled, nothing crosses; correcting re-enables (RR-DCx). - [x] `ReportSend`/`ReportBody` carry optional `contactEmail` (wire `contact_email`); pinned present + absent. - [x] Broker renders the fifth unfenced bullet only on a valid offer; 400s a malformed one; never logs/stores it. - [x] Golden sibling + `app-report-lib.sh` changed in this commit; four- and five-bullet bodies both accepted; malformed fifth rejected. - [x] `app-report-gate.sh` holds/classifies/disposes both shapes as today. - [x] Fail-loud keeps both the words and the contact; Try again re-sends both (RR-DRx). ## Tests Go `brokerclient`/`controlapi`/`appreport`/broker `internal/broker` (test + vet + gofmt); `app-report-lib-test.sh` (11 groups) + gate/inherit/workflow/rule-drift; dashboard `reportIssueDialog.test.ts` (16) + `reportIssueClient.test.ts` + i18n parity guard + the `reportIssue` harness spec (contact on/refused/kept states added); `vue-tsc` + eslint clean. **Unproven by the seam:** the real browser→broker→tracker round trip of a contact email (fakes/goldens only). **Screenshots:** none — the dashboard browser e2e harness cannot launch Chromium in the Sandcastle sandbox (the downloaded headless shell is missing the system libs libnspr4/libnss3/libgbm/… and flake.nix documents that the swarm container cannot run it — the container's glibc is older than the nixpkgs libs, so they cannot be back-filled; only an Electron e2e shell is provided, for the operator app). The RR-DR/RR-DC/RR-DCx/RR-DRx states are instead proven by the mounted-component unit suite `dashboard/tests/unit/reportIssueDialog.test.ts` (16 tests over the real component) and by the Playwright harness spec `dashboard/tests/e2e/preview-harness/reportIssue.spec.ts` (contact on/refused/nothing-sent states added), which a reviewer with a graphical host can run with `pnpm --filter @idss/dashboard e2e:harness -- reportIssue.spec.ts` to capture the screens. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sandcastle: #2066 — App report opt-in contact offer (contact-offer, DDR 0296 §3)
All checks were successful
ci / seam (pull_request) Successful in 15m28s
ci / publish (pull_request) Has been skipped
ci / publish-broker (pull_request) Has been skipped
ci / deploy-broker (pull_request) Has been skipped
09972c718c
Build the one member-facing trust change DDR 0296 §3 designed, as Ben ruled
(2026-10-29, "adopt as designed"). Blocked-by #2065 (two-door split) is landed.

Dashboard (RR-DR/RR-DC/RR-DCx/RR-DRx):
- ReportIssueDialog.vue gains the opt-in contact offer: an off-by-default
  checkbox (data-action="toggle-contact"), a never-pre-filled email field
  (data-field="contact-email" / contact-email-row), an inline refusal
  (contact-email-bad), the re-worded From clause (from-contact-clause) while on,
  and the kept-contact line on the fail-loud shape (report-contact-kept). Send
  is disabled on a malformed address; unticking drops the value and restores the
  "no addresses" promise.
- reportIssue.ts: ReportSend += optional contactEmail; isValidContactEmail +
  CONTACT_EMAIL_MAX/pattern (no whitespace/newline/backtick, 254 cap).
- reportIssueClient.ts: adds wire contact_email ONLY on a valid offer.
- OpenAPI ReportBody += optional contact_email (generated client regenerated).
- Copy keys in all five shell locales (es/nl/fr/pt machine drafts — accept owed).

Control plane / wire:
- controlapi/reports.go decodes contact_email into appreport.SendRequest/Report;
  appreport + brokerclient reportWire carry ContactEmail (contact_email,omitempty);
  TestClient_ReportIssueWirePayloadIsExactlyPinned now pins it present AND absent.

Broker (option a):
- reports.go: ReportInput.ContactEmail + contactEmailPattern/validContactEmail;
  RenderReportBody appends "- Contact: <email>" as the fifth unfenced bullet
  only on a valid address. New golden sibling app-report-body-contact.golden.md.
- http_reports.go: a malformed offer is a 400 in the refusal shape, before the
  limiter (spends no allowance); the address is held nowhere but the issue.

Intake (same commit — change both or neither):
- app-report-lib.sh: app_report_wellformed accepts both the four- and five-bullet
  bodies, validates the fifth against the same pattern (APP_REPORT_CONTACT_RE/_MAX),
  shifts the words heading one line lower when present, rejects a malformed fifth.
- fixtures/app-report/wellformed-contact.md mirrors the golden sibling.

Tests green: Go brokerclient/controlapi/appreport/broker (test+vet+gofmt);
app-report-lib-test.sh (11 groups) + gate/inherit/workflow/rule-drift; dashboard
reportIssueDialog (16) + reportIssueClient + i18n parity + the reportIssue harness
spec (contact states added); vue-tsc + eslint clean.

Unproven by the seam: the real browser->broker->tracker round trip of a contact
email (fakes/goldens only). Lands by human-approved merge (landing-pr, ADR 0267).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Factory-Account: d631bd58e1e9
Author
Member
close-report gates passed for #2066 — every claim verified; this PR is cleared for merge.
<!-- close-report: gates-passed --> close-report gates passed for #2066 — every claim verified; this PR is cleared for merge.
ben referenced this pull request from a commit 2026-11-16 17:31:44 +00:00
Owner

Merged — merge commit c85ebed9. Merged to main by hand at Ben's request (main now at 1776d784), stacked with #2170, #2171, #2172, #2173 and #1897. Forgejo did not auto-detect the pushed merge and manually-merged is disabled on this repo, so this PR is closed by hand — the code IS on main. Verified on the merged stack: dashboard 2339/2339, app 2394/2394, both vue-tsc clean, touched Go + broker packages green.

**Merged** — merge commit c85ebed9. Merged to `main` by hand at Ben's request (main now at 1776d784), stacked with #2170, #2171, #2172, #2173 and #1897. Forgejo did not auto-detect the pushed merge and `manually-merged` is disabled on this repo, so this PR is closed by hand — the code IS on main. Verified on the merged stack: dashboard 2339/2339, app 2394/2394, both `vue-tsc` clean, touched Go + broker packages green.
ben closed this pull request 2026-11-16 17:33:24 +00:00
All checks were successful
ci / seam (pull_request) Successful in 15m28s
ci / publish (pull_request) Has been skipped
ci / publish-broker (pull_request) Has been skipped
ci / deploy-broker (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!2173
No description provided.