do.md: require strict RFC 8259 JSON with escaped quotes/newlines (#46)

Action skills emit AL source in message/suggested-code fields. Quoted
identifiers and multi-line snippets must have their embedded quotes and
newlines escaped, otherwise the consumer JSON parse fails and silently
drops the report. Add a JSON validity subsection to the output contract
making the escaping requirement explicit.

Co-authored-by: wenjiefan <wenjiefan@microsoft.com>
This commit is contained in:
Wenjie Fan 2026-06-24 14:06:50 +02:00 committed by GitHub
parent 4a7a34b5c9
commit 5277150469
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -117,6 +117,12 @@ Every action skill emits a single JSON document that conforms to this schema:
} }
``` ```
### JSON validity
The emitted document MUST be strict, valid JSON per [RFC 8259](https://www.rfc-editor.org/rfc/rfc8259). Inside every string value, all double quotes MUST be escaped as `\"` and all line breaks as `\n`; other control characters MUST use their JSON escapes. This is not optional polish — it is the difference between a parseable report and one a consumer silently drops.
AL source is the common failure case. Quoted identifiers (for example `Rec."No."`) and multi-line snippets routinely appear in `message`, `suggested-code`, and `suggested-code-omission-reason`, and each embedded quote or newline MUST be escaped when placed in a string value. A `suggested-code` payload that spans several lines is a single JSON string with `\n` separators, not a literal multi-line block. Emit the document as one JSON value with no trailing commentary, and do not rely on the consumer to repair unescaped output.
### Field semantics ### Field semantics
**`outcome`** (required) — **`outcome`** (required) —