Files
hermes-agent/tests/conformance/vectors/telegram.json
Brooklyn Nicholson c82abc309a fix(telegram): widen fence anchors to keep mid-line and indented blocks
The anchored fence regex from the upstream commits (kept here via
cherry-pick) fixed #85381 but required the opening ``` to sit at a
line start with <=3 spaces of indent, silently downgrading two shapes
that main renders as <pre> into escaped literal prose:

- mid-line-opened fences ("Here is the code: ```python")
- fences indented by 4+ spaces (list/blockquote-nested code)

Widen the anchors while keeping the inline-triple fix:

- the opening line may now carry any leading whitespace or lead-in
  prose, as long as the opening ``` is the first triple-backtick run
  on the line and the rest of the line is backtick-free (so an inline
  pair like ```x``` can never end a line and open a fence);
- the closing fence may sit at any indent, not just 0-3 spaces.

The tempered prefix cannot skip past an earlier triple-backtick run,
so an inline pair followed later by a real fence no longer swallows
it (both main and the anchored regex mangled that mix in different
ways). The scar conformance vector reverts to main's committed value:
the mid-line-opened fence it encodes is protected again.
2026-10-02 22:25:39 -05:00

326 lines
15 KiB
JSON

{
"$comment": "GENERATED — do not hand-edit. Regenerate with hermes-agent scripts/generate_conformance_vectors.py; the native renderers are the oracle (executable spec).",
"oracle": {
"repo": "NousResearch/hermes-agent",
"commit": "40eebc7d70f3d8e95c429c8aa482f31ba6c867f6",
"generator": "scripts/generate_conformance_vectors.py",
"generator_version": 1
},
"platform": "telegram",
"vectors": [
{
"id": "plain-text",
"category": "grid",
"expect": "semantic",
"input": "Just a plain sentence.",
"native_output": "Just a plain sentence\\."
},
{
"id": "bold",
"category": "grid",
"expect": "semantic",
"input": "This is **bold** text.",
"native_output": "This is *bold* text\\."
},
{
"id": "italic",
"category": "grid",
"expect": "semantic",
"input": "This is *italic* text.",
"native_output": "This is _italic_ text\\."
},
{
"id": "bold-italic",
"category": "grid",
"expect": "semantic",
"input": "Mix of **bold** and *italic* in one line.",
"native_output": "Mix of *bold* and _italic_ in one line\\."
},
{
"id": "strikethrough",
"category": "grid",
"expect": "semantic",
"input": "This is ~~struck~~ text.",
"native_output": "This is ~struck~ text\\."
},
{
"id": "inline-code",
"category": "grid",
"expect": "semantic",
"input": "Run `pip install hermes` to start.",
"native_output": "Run `pip install hermes` to start\\."
},
{
"id": "fenced-code",
"category": "grid",
"expect": "semantic",
"input": "```\nprint('hello')\n```",
"native_output": "```\nprint('hello')\n```"
},
{
"id": "fenced-code-lang",
"category": "grid",
"expect": "semantic",
"input": "```python\ndef f(x):\n return x * 2\n```",
"native_output": "```python\ndef f(x):\n return x * 2\n```"
},
{
"id": "link",
"category": "grid",
"expect": "semantic",
"input": "See [the docs](https://example.com/docs) for more.",
"native_output": "See [the docs](https://example.com/docs) for more\\."
},
{
"id": "link-parens-url",
"category": "grid",
"expect": "semantic",
"input": "See [spec](https://example.com/a_(b)) here.",
"native_output": "See [spec](https://example.com/a_\\(b\\)) here\\."
},
{
"id": "header-h1",
"category": "grid",
"expect": "semantic",
"input": "# Big Title\nBody follows.",
"native_output": "*Big Title*\nBody follows\\."
},
{
"id": "header-h2",
"category": "grid",
"expect": "semantic",
"input": "## Section\nBody follows.",
"native_output": "*Section*\nBody follows\\."
},
{
"id": "header-h3",
"category": "grid",
"expect": "semantic",
"input": "### Sub-section\nBody follows.",
"native_output": "*Sub\\-section*\nBody follows\\."
},
{
"id": "ul-list",
"category": "grid",
"expect": "semantic",
"input": "- first\n- second\n- third",
"native_output": "\\- first\n\\- second\n\\- third"
},
{
"id": "ol-list",
"category": "grid",
"expect": "semantic",
"input": "1. first\n2. second\n3. third",
"native_output": "1\\. first\n2\\. second\n3\\. third"
},
{
"id": "nested-list",
"category": "grid",
"expect": "semantic",
"input": "- outer\n - inner one\n - inner two\n- outer two",
"native_output": "\\- outer\n \\- inner one\n \\- inner two\n\\- outer two"
},
{
"id": "blockquote",
"category": "grid",
"expect": "semantic",
"input": "> quoted wisdom\nregular line",
"native_output": "> quoted wisdom\nregular line"
},
{
"id": "hrule",
"category": "grid",
"expect": "semantic",
"input": "above\n\n---\n\nbelow",
"native_output": "above\n\n\\-\\-\\-\n\nbelow"
},
{
"id": "table-simple",
"category": "grid",
"expect": "divergent",
"input": "| name | value |\n|------|-------|\n| a | 1 |\n| b | 2 |",
"native_output": "*a*\n• value: 1\n\n*b*\n• value: 2",
"note": "native wraps tables into row groups; connector renders <pre> — content preserved, layout differs"
},
{
"id": "emoji",
"category": "grid",
"expect": "semantic",
"input": "Done ✅ with 🎉 emoji 👀 test.",
"native_output": "Done ✅ with 🎉 emoji 👀 test\\."
},
{
"id": "cjk",
"category": "grid",
"expect": "semantic",
"input": "中文测试:**粗体** 和 `代码` 混排。",
"native_output": "中文测试:*粗体* 和 `代码` 混排。"
},
{
"id": "bare-url",
"category": "grid",
"expect": "semantic",
"input": "Visit https://example.com/path?q=1&r=2 today.",
"native_output": "Visit https://example\\.com/path?q\\=1&r\\=2 today\\."
},
{
"id": "mixed-document",
"category": "grid",
"expect": "semantic",
"input": "## Report\n\nStatus: **green**. Details in `runbook.md`.\n\n- item *one*\n- item **two**\n\n```sh\nmake deploy\n```\n\nSee [dashboard](https://grafana.example.com/d/x).",
"native_output": "*Report*\n\nStatus: *green*\\. Details in `runbook.md`\\.\n\n\\- item _one_\n\\- item *two*\n\n```sh\nmake deploy\n```\n\nSee [dashboard](https://grafana.example.com/d/x)\\."
},
{
"id": "mdv2-reserved-chars",
"category": "scar",
"expect": "semantic",
"input": "Price is 3.50 (was 4.00) — save ~12%! #deal +tax = win.",
"native_output": "Price is 3\\.50 \\(was 4\\.00\\) — save \\~12%\\! \\#deal \\+tax \\= win\\."
},
{
"id": "mdv2-underscores",
"category": "scar",
"expect": "semantic",
"input": "snake_case_name and file_name.py in prose.",
"native_output": "snake\\_case\\_name and file\\_name\\.py in prose\\."
},
{
"id": "mdv2-brackets",
"category": "scar",
"expect": "semantic",
"input": "Array[0] and dict{key} and (parens) live here.",
"native_output": "Array\\[0\\] and dict\\{key\\} and \\(parens\\) live here\\."
},
{
"id": "slack-bold-conversion",
"category": "scar",
"expect": "semantic",
"input": "**important** word",
"native_output": "*important* word"
},
{
"id": "slack-link-conversion",
"category": "scar",
"expect": "semantic",
"input": "[click here](https://example.com)",
"native_output": "[click here](https://example.com)"
},
{
"id": "slack-broadcast-mention",
"category": "scar",
"expect": "semantic",
"input": "Hey <!everyone> and <!channel> and <!here>!",
"native_output": "Hey <\\!everyone\\> and <\\!channel\\> and <\\!here\\>\\!"
},
{
"id": "fence-lang-tag-slack",
"category": "scar",
"expect": "semantic",
"input": "```text\nliteral first line issue\n```",
"native_output": "```text\nliteral first line issue\n```"
},
{
"id": "backslash-in-code",
"category": "scar",
"expect": "semantic",
"input": "`C:\\Users\\ben\\file.txt` and ```\npath = \"a\\\\b\"\n```",
"native_output": "`C:\\\\Users\\\\ben\\\\file.txt` and ```\npath = \"a\\\\\\\\b\"\n```"
},
{
"id": "backtick-in-fence",
"category": "scar",
"expect": "semantic",
"input": "```\nuse `inline` inside fence\n```",
"native_output": "```\nuse \\`inline\\` inside fence\n```"
},
{
"id": "header-with-bold",
"category": "scar",
"expect": "semantic",
"input": "## The **Real** Deal",
"native_output": "*The Real Deal*"
},
{
"id": "table-cjk",
"category": "scar",
"expect": "divergent",
"input": "| 名前 | 値 |\n|------|----|\n| 中文 | 42 |\n| b | 2 |",
"native_output": "*中文*\n• 値: 42\n\n*b*\n• 値: 2",
"note": "same as table-simple (CJK width alignment is native-only)"
},
{
"id": "link-display-escapes",
"category": "scar",
"expect": "semantic",
"input": "[v2.0 (beta)](https://example.com/v2)",
"native_output": "[v2\\.0 \\(beta\\)](https://example.com/v2)"
},
{
"id": "media-tag",
"category": "adversarial",
"expect": "semantic",
"input": "Here you go\nMEDIA:/tmp/output.png\ndone",
"native_output": "Here you go\nMEDIA:/tmp/output\\.png\ndone"
},
{
"id": "unclosed-fence",
"category": "adversarial",
"expect": "divergent",
"input": "```python\nprint('never closed')",
"native_output": "\\`\\`\\`python\nprint\\('never closed'\\)",
"note": "unterminated fence: native escapes as prose, connector HTML may close the block — degraded either way, never a 400"
},
{
"id": "pathological-nesting",
"category": "adversarial",
"expect": "semantic",
"input": "**bold *italic ~~struck `code` struck~~ italic* bold**",
"native_output": "*bold \\*italic \\~\\~struck `code` struck\\~\\~ italic\\* bold*"
},
{
"id": "placeholder-injection",
"category": "adversarial",
"expect": "divergent",
"input": "sneaky \u0000PH0\u0000 token and \u0000SL1\u0000 too",
"native_output": "sneaky \u0000PH0\u0000 token and \u0000SL1\u0000 too",
"note": "NUL placeholder tokens are renderer-internal; each side neutralizes its own pattern"
},
{
"id": "triple-markers",
"category": "adversarial",
"expect": "semantic",
"input": "***what is this*** and ____that____",
"native_output": "*\\*what is this*\\* and \\_\\_\\_\\_that\\_\\_\\_\\_"
},
{
"id": "empty-string",
"category": "adversarial",
"expect": "semantic",
"input": "",
"native_output": ""
},
{
"id": "whitespace-only",
"category": "adversarial",
"expect": "divergent",
"input": " \n\t\n ",
"native_output": " \n\t\n ",
"note": "native collapses to empty-ish prose, connector HTML preserves — cosmetic"
},
{
"id": "long-line",
"category": "adversarial",
"expect": "semantic",
"input": "word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word ",
"native_output": "word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word "
},
{
"id": "many-fences",
"category": "adversarial",
"expect": "semantic",
"input": "```\na\n```\nmid\n```\nb\n```\nend ```inline``` tail",
"native_output": "```\na\n```\nmid\n```\nb\n```\nend \\`\\``inline`\\`\\` tail"
}
]
}