rouse-context/docs
Jason Monk 567e9ee9a7
Fix #426: Test-methodology gap that let #417 ship (#428)
Two gates to prevent reintroduction of the malformed-JSON bug class
that shipped in #417 (Outreach error helpers used a """{...}""" template
with raw exception text, producing unparseable bodies).

(A) Harness-level JSON parse assertion. Introduces shared
`McpToolTestHarness` (in `integrations/src/test/.../testing/`) that
wraps the duplicated mockk(Server) + addTool capture pattern previously
copy-pasted across `OutreachMcpProviderTest`, `UsageMcpProviderTest`,
`NotificationMcpToolExecutionTest`, and `NotificationMcpProviderToolsTest`.
Every `callTool(...)` invocation runs the result body through
`Json.parseToJsonElement`; parse failures throw with the offending tool
name and body content. Per-call `expectJsonBody = false` opt-out for
tools whose contract is plain text (currently only one test uses it,
referencing #427 which tracks the underlying core MCP DSL gap the
harness surfaced).

Regression test `McpToolTestHarnessTest` constructs fake tools that
return non-JSON bodies and asserts the harness throws with the tool
name + body in the message, plus a passing-case to lock down the
expectJsonBody opt-out.

(B) CI grep check. New `scripts/check-no-manual-json.sh` greps
`*/src/main/*.kt` for `"""\{` and fails the build on hits unless the
line carries a `// allow-manual-json: <reason>` marker, or matches the
explicit `AuditDetailScreen.kt` allowlist (Compose preview fixtures).
Wired into `.github/workflows/android-ci.yml` next to the existing
`check-zombie-screens.sh` step. Verified manually that the script
fires on a synthetic `"""{"x":"$bar"}"""` and clears once the marker
is added.

Documents the convention in new `docs/agent-quickstart.md`.

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
2026-04-26 17:31:31 -04:00
..
auth-pages Regenerate auth page gallery with correct icon 2026-04-08 08:53:44 -04:00
design Fix #406 final wave: ui.md drift fixes + relay.md endpoint pointer (#413) 2026-04-25 18:49:10 -04:00
internal Add UX changes rule + decision log + onboarding flow page (#397) 2026-04-24 19:39:08 -04:00
notifications Fix #347: Client-subject notification copy + deep-link taps + Manage action (#362) 2026-04-22 03:11:08 -04:00
screenshots Regenerate screenshots after design language refactor 2026-04-07 12:25:12 -04:00
user Set baseurl to empty for custom domain on GitHub Pages 2026-04-16 17:47:49 -04:00
agent-quickstart.md Fix #426: Test-methodology gap that let #417 ship (#428) 2026-04-26 17:31:31 -04:00
audit.md Update tunnel-client + health-connect-expansion docs; delete superseded proposal docs (#406) (#412) 2026-04-25 18:13:09 -04:00
security-audit-2026-04-07.md Update README and security docs to match shipped behavior (#406 chunk A) (#411) 2026-04-25 18:38:12 -04:00
security-decisions.md Update README and security docs to match shipped behavior (#406 chunk A) (#411) 2026-04-25 18:38:12 -04:00
security.md Add comprehensive security overview document 2026-04-10 09:39:55 -04:00
self-hosting.md Fix #391: Update design docs to reflect GTS as primary CA (#398) 2026-04-24 22:41:23 -04:00
test-coverage-audit.md Delete stale planning + status + QA-snapshot docs (#405) 2026-04-25 15:08:59 -04:00
ux-decisions.md Add UX changes rule + decision log + onboarding flow page (#397) 2026-04-24 19:39:08 -04:00
workflow.md Add T-11 security monitoring task, renumber subsequent tasks 2026-04-04 19:48:46 -04:00