Skip to content

Commit 80ecebb

Browse files
committed
fix: compare YAML against the maintained RedCMD grammar (not the dead bundle)
Correct the YAML baseline + its labeling. VS Code already switched YAML OFF the dead textmate/yaml.tmbundle to the maintained RedCMD/YAML-Syntax-Highlighter (microsoft/vscode#232244); VS Code's bundled YAML IS RedCMD (vendored), so scope-gap was already comparing against it — confirmed: RedCMD upstream gives the identical 89.7%/46.5%/-43.2. - scope-gap-yaml.ts now DEFAULTS to RedCMD upstream (/tmp/redcmd-yaml; git clone --depth 1 https://github.com/RedCMD/YAML-Syntax-Highlighter). Its header had wrongly said 'VS Code's YAML grammar is the unmaintained textmate/yaml.tmbundle' — fixed. - README: a note spells out which 'official' grammar each row compares against — HTML = dead textmate/html.tmbundle (the #203212 target), YAML = maintained RedCMD, JS/TS = Microsoft's TypeScript-TmLanguage. So YAML's -43 gap is Monogram vs a *maintained* grammar, not a dead bundle. (RedCMD upstream's last commit is 2024-12-16 / tag 1.4.1 — far fresher than textmate's 6y, but ~18mo stale by 2026-06, so 'current upstream' is more precise than 'actively maintained'.)
1 parent ed0f22e commit 80ecebb

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Per-grammar alignment vs the **official parser** as the neutral oracle (`node te
2424
| YAML | 83.0% · 63.1% | 46.5% vs 89.7% |
2525
<!-- coverage:end -->
2626

27+
<sub>**Which “official” grammar each row compares against:** HTML’s is the unmaintained [`textmate/html.tmbundle`](https://github.com/textmate/html.tmbundle) — the #203212 case Monogram targets. YAML’s is the maintained [RedCMD/YAML-Syntax-Highlighter](https://github.com/RedCMD/YAML-Syntax-Highlighter) that VS Code switched to ([microsoft/vscode#232244](https://github.com/microsoft/vscode/pull/232244)) — so YAML’s gap is Monogram vs a *maintained* grammar, not a dead bundle. JS/TS use Microsoft’s maintained [TypeScript-TmLanguage](https://github.com/microsoft/TypeScript-TmLanguage).</sub>
28+
2729
## Quick start
2830

2931
Requires Node 24+ (runs `.ts` directly — no build step, no `tsx`).

test/scope-gap-yaml.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
// scope-gap-yaml.ts — YAML adapter for the unified scope-gap harness. vscode#203212 language #1:
2-
// VS Code's YAML grammar is the unmaintained textmate/yaml.tmbundle; the oracle is the `yaml`
3-
// package (maintained). Run (bare node): node test/scope-gap-yaml.ts
4-
// Override the official grammar: MONOGRAM_OFFICIAL_YAML=/path/to/yaml.tmLanguage.json
1+
// scope-gap-yaml.ts — YAML adapter for the unified scope-gap harness. NOTE: unlike most of the
2+
// vscode#203212 list, VS Code already switched YAML OFF the dead textmate/yaml.tmbundle TO the
3+
// maintained RedCMD/YAML-Syntax-Highlighter (microsoft/vscode#232244). So YAML's "official"
4+
// baseline here is that MAINTAINED grammar — this gap is Monogram vs a maintained competitor, not
5+
// a dead bundle. Default = RedCMD UPSTREAM; clone it first:
6+
// git clone --depth 1 https://github.com/RedCMD/YAML-Syntax-Highlighter /tmp/redcmd-yaml
7+
// (VS Code's bundled YAML is the same grammar — identical result; set MONOGRAM_OFFICIAL_YAML to
8+
// .../extensions/yaml/syntaxes/yaml.tmLanguage.json for that.) Oracle = the `yaml` package.
9+
// Run (bare node): node test/scope-gap-yaml.ts
510
import { readdirSync, readFileSync } from 'node:fs';
611
import { dirname, join } from 'node:path';
712
import { parse as yamlParse, parseAllDocuments } from 'yaml';
813
import { run } from './scope-gap.ts';
914
import { yamlOracle } from './yaml-oracle.ts';
1015

11-
const OFFICIAL = process.env.MONOGRAM_OFFICIAL_YAML
12-
?? '/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/yaml/syntaxes/yaml.tmLanguage.json';
13-
// VS Code's YAML grammar is a dispatcher stub that include()s version-specific sub-grammars in
14-
// the same syntaxes/ dir — load them all, or the official scopes nothing (everything → root).
16+
const OFFICIAL = process.env.MONOGRAM_OFFICIAL_YAML ?? '/tmp/redcmd-yaml/syntaxes/yaml.tmLanguage.json';
17+
// The RedCMD/VS Code YAML grammar is a dispatcher stub that include()s version-specific
18+
// sub-grammars in the same syntaxes/ dir — load them all, or the official scopes nothing.
1519
const SYN = dirname(OFFICIAL);
1620
const officialExtra: Record<string, string> = {
1721
'source.yaml.1.2': join(SYN, 'yaml-1.2.tmLanguage.json'),

0 commit comments

Comments
 (0)