Skip to content

fix(markdown): NESTED_QUOTES skips flow-sequence arrays of quoted strings (closes #529)#535

Open
mayazbay wants to merge 1 commit into
garrytan:masterfrom
mayazbay:fix/issue-529-nested-quotes-flow-array
Open

fix(markdown): NESTED_QUOTES skips flow-sequence arrays of quoted strings (closes #529)#535
mayazbay wants to merge 1 commit into
garrytan:masterfrom
mayazbay:fix/issue-529-nested-quotes-flow-array

Conversation

@mayazbay

@mayazbay mayazbay commented Apr 30, 2026

Copy link
Copy Markdown

Summary

Closes #529.

The NESTED_QUOTES lint check counts unescaped double-quotes per line. This produces false-positives on legitimate YAML flow-sequence arrays of quoted strings:

related: ["LAW-001", "LAW-009", "LAW-013"]

This line has 6 unescaped double quotes, but each is part of an independently-quoted item — the YAML is valid and parses correctly. The check fired anyway because per-line quote-counting is the wrong primitive for flow-arrays.

Fix

Skip lines where the value starts with [ and ends with ]. Genuine nested-quote pattern is a SINGLE value containing inner unescaped quotes (title: "He said "hello" loudly"), which is what the check was originally designed for.

Tests

Added 3 regression tests in test/markdown-validation.test.ts:

  1. Flow-array of quoted IDs (["LAW-001", "LAW-009"]) — must NOT trigger
  2. Flow-array of quoted wikilinks (["[[skill-a]]", "[[skill-b]]"]) — must NOT trigger
  3. Inline genuine nested-quote on single value (title: "a "b" c") — must STILL trigger (no false-negative)

bun test test/markdown-validation.test.ts22/22 pass.

Impact

On the Nous AGaaS production wiki (2533 pages, gbrain v0.22.16):

  • 14+ legitimate vault files were tripping NESTED_QUOTES with related: ["[[X]]"] syntax
  • Brain owners couldn't reach Health 100/100 without rewriting valid YAML

After this fix: 0 NESTED_QUOTES findings on the same brain.

Related


View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

Closes garrytan#529.

Detector counted unescaped double-quotes per line. Flow-sequence arrays
like `related: ["LAW-001", "LAW-009"]` legitimately have 4+ quotes
because each item is independently quoted. This triggered FP NESTED_QUOTES
on valid YAML.

Genuine "nested quote" pattern is a SINGLE value with inner unescaped
quotes (`title: "a "b" c"`), not a flow-array of separately-quoted
items. Skip lines where value starts with `[` and ends with `]`.

3 regression tests added:
- flow-array of quoted IDs (closes garrytan#529)
- flow-array of quoted wikilinks (closes garrytan#529)
- inline genuine nested-quote on single value still triggers (no false-negative)

All 22 markdown-validation tests pass.
@mayazbay

Copy link
Copy Markdown
Author

@garrytan polite ping — this is a one-line skip-condition + 3 regression tests, would close my production wiki's last frontmatter_integrity WARN. 22/22 tests pass. Happy to iterate on review feedback. Running on 2533-page Tan-style OpenClaw + GBrain + Hermes substrate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FP] NESTED_QUOTES lint false-positives on flow-sequence arrays of quoted strings

1 participant