From 52771504690b18e441883417e922c12cad22e341 Mon Sep 17 00:00:00 2001 From: Wenjie Fan <31087545+gggdttt@users.noreply.github.com> Date: Wed, 24 Jun 2026 14:06:50 +0200 Subject: [PATCH] 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 --- skills/do.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/skills/do.md b/skills/do.md index 317750d..777f89f 100644 --- a/skills/do.md +++ b/skills/do.md @@ -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 **`outcome`** (required) —