[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7898CBQFQ1PT5NFHB5MV8F9":3,"skill-same:01M7898CBQFQ1PT5NFHB5MV8F9":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":38,"ownerHtmlUrl":39,"ownerBlogUrl":40,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M7898CBQFQ1PT5NFHB5MV8F9","yaml-domain-reference",null,"YAML 1.2.2 semantics as noyalib implements them: scalar resolution, block vs flow, chomping, anchors, aliases, merge keys with DoS budgets, tags, 1.1-vs-1.2 flags, the Norway problem, and whether nan or octal 0o7 scalars resolve. Use for spec-conformance and plain-scalar questions.","sebastienrousseau\u002Fagtmls","sebastienrousseau","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1394998?v=4","01M78952QGX0RG3V4QVGESS3N7","Sebastien Rousseau","01M78952R7PPYXEW5VZKQRB0VW",1,"MIT","https:\u002F\u002Fgithub.com\u002Fsebastienrousseau\u002Fagtmls\u002Fblob\u002Fmain\u002Fpacks\u002Fnoyalib\u002Fskills\u002Fyaml-domain-reference\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: yaml-domain-reference\ndescription: \"YAML 1.2.2 semantics as noyalib implements them: scalar resolution, block vs flow, chomping, anchors, aliases, merge keys with DoS budgets, tags, 1.1-vs-1.2 flags, the Norway problem, and whether nan or octal 0o7 scalars resolve. Use for spec-conformance and plain-scalar questions.\"\nlicense: MIT\ncompatibility: \"Requires cargo, git. Tested with Claude Code, Codex, and Aider skill layouts\"\nallowed-tools: \"Read Glob Grep Write Edit Bash WebFetch WebSearch\"\nmetadata:\n  agtmls-owner: \"Sebastien Rousseau\"\n  agtmls-maturity: \"project\"\n  agtmls-bundle: \"noyalib\"\n  agtmls-risk-level: \"medium\"\n  agtmls-network-access: \"optional\"\n  agtmls-writes-files: \"true\"\n  agtmls-executes-commands: \"true\"\n  agtmls-handles-secrets: \"false\"\n  agtmls-requires-human-review: \"true\"\n---\n\n# YAML domain reference\n\n> **Reference material** (full `resolve_plain_ext` table, directive\n> regression case list, block-scalar chomping worked-example matrix,\n> official-suite integration walkthrough, YAML 1.1 vs 1.2 long-form flag\n> matrix): see `reference.md` in this directory. Load when the terse\n> summaries below are insufficient — spec-conformance work, tracing a\n> case ID back to its rule, or verifying chomping edge cases.\n\n**Purpose.** Domain-theory pack — the YAML 1.2.2 subset noyalib\nimplements, plus the gotchas that hit real code.\n\n**When NOT to use.** Parser\u002FCST internals →\n`noyalib-architecture-contract`. Config flags in depth →\n`noyalib-config-and-flags`. Historical incidents →\n`noyalib-failure-archaeology`.\n\n**Ground truth files** (re-read if you doubt any claim):\n`GLOSSARY.md`; `doc\u002Fadr\u002F0002-yaml-1.2-default.md`;\n`crates\u002Fnoyalib\u002Fsrc\u002Fstreaming.rs` (`resolve_plain_ext` at L1620\nis *the* scalar table); `crates\u002Fnoyalib\u002Fsrc\u002Fparser\u002Fscanner.rs`\n(§5.4, §6.8, §9.1.2 rules cited inline);\n`crates\u002Fnoyalib\u002Fsrc\u002Fde\u002Fconfig.rs` (every flag + default);\n`crates\u002Fnoyalib\u002Ftests\u002Fofficial_suite.rs` +\n`crates\u002Fnoyalib\u002Ftests\u002Fyaml_compliance_report.rs` (conformance\narithmetic).\n\n**Provenance re-verify (one-liners):**\n```bash\ngrep -n '\"\\.nan\"\\|\"\\.inf\"' crates\u002Fnoyalib\u002Fsrc\u002Fstreaming.rs\ngrep -n 'yaml_version: YamlVersion::V1_2' crates\u002Fnoyalib\u002Fsrc\u002Fde\u002Fconfig.rs\ngrep -n 'max_alias_expansions:\\|alias_anchor_ratio:\\|max_merge_keys:' crates\u002Fnoyalib\u002Fsrc\u002Fde\u002Fconfig.rs\ngrep -n '§5\\.4\\|§6\\.8\\|§9\\.1\\.2' crates\u002Fnoyalib\u002Fsrc\u002Fparser\u002Fscanner.rs\ngrep -n 'SKIP_LIST' crates\u002Fnoyalib\u002Ftests\u002Fofficial_suite.rs\n```\n\n---\n\n## 1. Documents and streams\n\nA YAML **stream** is zero or more **documents**, bounded by\noptional `---` (start) and `...` (end) markers. The first `---`\nis optional; markers become mandatory between documents once\ndirectives, `!!binary`-tag context, or a preceding `...` appear.\n\n**Directives** are `%`-prefixed head lines: `%YAML 1.2` sets\nversion, `%TAG !x! tag:example.com,2026:` binds a tag-shorthand\nprefix. Only one `%YAML` per document (§6.8.1).\n\n**noyalib's strict rules** (scanner.rs, § cited inline):\n- **§6.8:** directive *must* be followed by explicit `---`.\n  Pending directive at stream end → error.\n- **§6.8 \u002F §9.1.2:** directive *must not* appear after content\n  without intervening `...`.\n- **ADR-0002:** `%YAML 1.1` is *recorded but not honoured* — no\n  auto-flip of `legacy_*` flags. Silently honouring it would\n  reintroduce the Norway problem, which 1.2 was created to fix.\n\n> Regression case IDs (9MMA, B63P, RHX7, EB22, 9HCY, MUS6:1,\n> ZYU8): see **reference.md §R2**.\n\n---\n\n## 2. Block vs flow, indentation, column tracking\n\n**Block style** is the indentation-driven form:\n```yaml\ndb:\n  host: localhost\n  port: 5432\n```\n**Flow style** is the JSON-shaped inline form: `db: {host: localhost, port: 5432}`. YAML mixes freely — flow can nest inside block and vice versa.\n\nIndentation is *structure*, not decoration: a mapping value at\ncolumn *N+2* is a child of a key at column *N*. This is why\n**column tracking is load-bearing** — every byte offset must\nmap to the correct visual column, or nesting silently mis-parses.\n\nTwo column-desync incidents shaped this code (see\n`noyalib-failure-archaeology` for the full stories):\n- **BOM incident** — UTF-8 BOM is three bytes, zero visual\n  columns. Fix: `advance_by(3)` over the BOM *without* touching\n  `col` (scanner.rs L1150–L1181).\n- **Lone-CR incident** — classic-Mac `\\r`-only breaks left column\n  state stale. Fix (v0.0.14): recognise LF, CR, CRLF per §5.4\n  (see §5 below).\n\n---\n\n## 3. Scalars and block-scalar chomping\n\nFive scalar styles:\n- **Plain** — no quotes, resolved by the plain-scalar table\n  (§4): `port: 8080`.\n- **Single-quoted** — `'literal ''with'' apostrophes'`. Only\n  `''` escape.\n- **Double-quoted** — full backslash-escape alphabet plus\n  `\\uXXXX` (paired for surrogates).\n- **Literal block** (`|`) — every newline byte preserved.\n- **Folded block** (`>`) — non-empty lines joined with a space;\n  blank lines preserved as paragraph breaks.\n\n**Chomping** on block scalars (stacked as `|-`, `>+`, etc.):\n`-` = strip all trailing newlines; *(none)* = clip to one;\n`+` = keep every trailing newline \u002F blank line.\n\n**noyalib gotcha (v0.0.14 fix).** For keep-chomped (`|+` \u002F `>+`)\nblock scalars, `Document::span_at` now includes the *kept\ntrailing blank lines* in the returned span. Earlier releases\ntruncated at the last non-blank byte — byte-faithful for the\n*value* but not for the *span*, breaking editor diagnostics.\n\n> Worked-example matrix (six header combinations with literal\n> byte-level output including folding rules): see **reference.md §R3**.\n\n---\n\n## 4. The plain-scalar resolution table (as implemented)\n\nEvery plain scalar walks `resolve_plain_ext`\n(`streaming.rs:1620`). ~17 rows covering five null forms,\ncanonical + non-strict + legacy booleans, 12 inf\u002Fnan forms,\ninteger variants (decimal, `0x`, `0o`, bare-`0` octal, `u64` under\n`lossless_u64`), sexagesimal, f64 fallback, then string.\n\n**Precedence:** null → bool → hard-coded inf\u002Fnan → legacy booleans\n→ integer parse → sexagesimal → **f64 fallback** → string.\n\n> Full row-by-row table (verbatim source order): see\n> **reference.md §R1**.\n\n**The Norway problem.** YAML 1.1 boolean lexicon includes\n`yes`\u002F`no`\u002F`on`\u002F`off`; `country: NO` (Norway's ISO 3166) was\nsilently coerced to `false` for a decade in Ruby\u002Fpyyaml. YAML\n1.2 narrowed the lexicon to `true`\u002F`false` only. noyalib\ndefaults to 1.2; `legacy_booleans` opt-in reintroduces the\nhazard.\n\n**The bare-`nan` gotcha.** Nothing in the match table lists bare\n`nan` — but the f64 fallback (`s.parse::\u003Cf64>()`) accepts\n`\"nan\"`, `\"inf\"`, `\"+inf\"`, `\"-inf\"` case-insensitively (Rust\nstdlib). So bare `nan` resolves to `NaN` even under strict 1.2.\nThis bit **mapping keys**: `{nan: 1, nan: 2}` collided because\nboth stringified to the same `NaN` bucket. The distinct-typed\nKeyCollision guard (§8) catches similar collisions but the f64\nfallback route was the surprise.\n\n**Schema-strict mode.** `no_schema = true` short-circuits the\ntable — every plain scalar surfaces as\n`Scalar::Str(Cow::Borrowed(s))`.\n\n---\n\n## 5. Line breaks (§5.4)\n\nPer §5.4 a line break is **LF (`\\n`), CR (`\\r`), or CRLF\n(`\\r\\n`)**. All three valid; parser normalises on input. CRLF\ncounts as one break (scanner.rs L554). Lone-CR (classic-Mac) was\nadded v0.0.14 (scanner.rs L1769).\n\n**Gotcha.** Downstream code assuming `\\n`-only (naive\n`split('\\n')`) mis-counts columns on CR-only input. External\nconsumers of `Document::source()` should re-normalise if they\ncare.\n\n---\n\n## 6. Anchors, aliases, merge keys — and DoS budgets\n\n**Anchor** (`&name`) labels a node. **Alias** (`*name`) references\nit inside the same document. Per §7.1 each document has its own\nnamespace; noyalib clears the anchor table on `DocumentEnd`.\n\n**Merge key** (`\u003C\u003C`) — when the value is a mapping or a sequence\nof mappings, merged keys are inherited unless overridden locally.\n\n**Billion-laughs DoS.** Nested aliases\n(`c: &c [*b, *b, *b, ...]` where `b` references `a` etc.)\nmultiply expanded size by 9 per level; ten levels ≈ 3.5 billion\nterminal nodes from ~50 lines. Libyaml has historically crashed\non such inputs.\n\n**noyalib's budgets** (`ParserConfig`, defaults from\n`de\u002Fconfig.rs`):\n\n| Knob | Default | Strict | Trip |\n|------|--------:|-------:|------|\n| `max_alias_expansions` | 1 024 | 100 | `Error::RepetitionLimitExceeded` (not `BudgetBreach`) |\n| `max_document_length` | 64 MB | 1 MB | `Error::Parse` (also caps `alias_bytes` post-expansion) |\n| `max_total_scalar_bytes` | 64 MB | 1 MB | `BudgetBreach::MaxTotalScalarBytes` |\n| `max_merge_keys` | 10 000 | 1 000 | `BudgetBreach::MaxMergeKeys` |\n| `alias_anchor_ratio` | `Some(10.0)` | `Some(5.0)` | `BudgetBreach::AliasAnchorRatio` (`aliases > ratio × anchors`) |\n| `max_events` | 1 000 000 | 100 000 | `BudgetBreach::MaxEvents` |\n| `max_nodes` | 250 000 | 25 000 | `BudgetBreach::MaxNodes` |\n| `max_depth` | 128 | 64 | `Error::RecursionLimitExceeded` (not `BudgetBreach`) |\n\n**Only six `BudgetBreach` variants exist** in `error.rs`:\n`MaxEvents`, `MaxNodes`, `MaxTotalScalarBytes`, `MaxDocuments`,\n`MaxMergeKeys`, `AliasAnchorRatio`. `max_alias_expansions` and\n`max_depth` surface as top-level `Error::Repetition-` \u002F\n`Error::RecursionLimitExceeded`; `max_mapping_keys` and\n`max_sequence_length` surface as `Error::Serialize(...)` (wart\ndocumented in `noyalib-architecture-contract` §5.1).\n\n`alias_anchor_ratio` is the *early-warning* signal — real files\nrarely exceed 2–3 aliases per anchor; above 10 (5 in strict) is\nbomb-shaped. Set to `None` to disable.\n\n**MergeKeyPolicy** (`de\u002Fconfig.rs:973`, note real variants):\n- **`Auto`** *(default)* — YAML 1.2 semantics: `\u003C\u003C` triggers\n  automatic merge of the value into the enclosing mapping.\n- **`AsOrdinary`** — treat `\u003C\u003C` as a plain string key. The\n  mapping keeps a literal `\u003C\u003C` entry. Useful for round-tripping\n  files where `\u003C\u003C` is a data key, not a merge instruction.\n- **`Error`** — refuse any document containing `\u003C\u003C` with\n  `Error::Custom`. For schema-strict pipelines.\n\n> Note: GLOSSARY.md drift — it lists `{Auto, Disabled, Strict}`.\n> The source of truth is `de\u002Fconfig.rs` — `{Auto, AsOrdinary,\n> Error}`. Trust the code.\n\n---\n\n## 7. Tags\n\nExplicit type annotations. Three families:\n- **Core-schema tags** — `!!str`, `!!int`, `!!float`, `!!bool`,\n  `!!null`, `!!seq`, `!!map`, `!!binary`. noyalib **never\n  strips** these — they carry semantics (`!!str 42` forces\n  string).\n- **Custom tags** — `!shopping`, `!myapp\u002Fconfig`. Carried through\n  as `Value::Tagged`; a `TagRegistry` can transform them inline\n  on the streaming path.\n- **Verbatim tags** — `!\u003Ctag:yaml.org,2002:str>` (rare).\n\n**Shorthand.** `!!x` expands to `tag:yaml.org,2002:x` (§6.8.2).\nCustom prefixes come from `%TAG !x! tag:example.com,2026:`.\n\n**`!!binary`** — RFC 4648 base64 (§10.4). Decoded on the\nstreaming path (`streaming.rs` L1095–L1115); failure →\n`Error::Deserialize(\"!!binary: {why}\")`. Deserialising into a\n`String` target defaults to tag-mismatch error; set\n`ignore_binary_tag_for_string = true` for pyyaml-style advisory\nbehaviour (returns the literal base64 source).\n\n---\n\n## 8. Keys — and the KeyCollision guard\n\nYAML permits any node type as a mapping key, including complex\nkeys (`? key\\n: value`). noyalib exposes two mapping types:\n\n- **`Mapping`** — string-keyed (`IndexMap\u003CString, Value>`).\n  Default, JSON-compatible.\n- **`MappingAny`** — `Value`-keyed. Use when non-string keys\n  matter for fidelity.\n\nWhen YAML produces a non-string key (`1`, `true`, `null`) and the\ntarget is `Mapping`, the key is **stringified on entry**. This is\nwhere the **distinct-typed KeyCollision guard** lives\n(`error.rs:509`, `Error::KeyCollision(String)`). Given\n`1: one` and `\"1\": two`, both stringify to `\"1\"`; silently\ndropping one is data loss, so noyalib rejects with\n`KeyCollision(\"1\")` at parse time.\n\nStreaming path bypass (`de.rs:405-421`): serde asks the streaming\ndeserializer for `String` keys, stringifying typed scalars\n*before* `ValueVisitor::visit_map` can distinguish `1` from\n`\"1\"`. The `Value` target therefore routes through the AST\nloader (which owns the collision check and DoS budgets).\n\n**DuplicateKeyPolicy** (unrelated axis — same string key twice):\n`First` (keep first) \u002F **`Last`** *(default, YAML 1.2)* \u002F\n`Error` (reject).\n\n---\n\n## 9. YAML 1.1 vs 1.2 — the flags that matter\n\nPer ADR-0002, **noyalib defaults to YAML 1.2 strict semantics.**\nThree 1.1 legacy behaviours are opt-in on `ParserConfig`:\n\n- **`legacy_booleans`** — off: `yes`\u002F`no`\u002F`on`\u002F`off` → string;\n  on: → bool (Norway problem).\n- **`legacy_octal_numbers`** — off: `0644` → int 644; on: → 420.\n- **`legacy_sexagesimal`** — off: `60:00` → string; on: → int 3600.\n\n`ParserConfig::version(YamlVersion::V1_1)` flips all three as a\nbundle; fine-grained flags remain callable individually.\n\n- **`strict_booleans`** — narrows 1.2 further: only `true`\u002F`false`\n  (lowercase) are boolean; `True`\u002F`TRUE` become strings. Off by\n  default.\n- **`no_schema`** — every plain scalar surfaces as string;\n  table (§4) bypassed entirely.\n\n> Long-form matrix with hazard column, precedence ordering, and\n> flag-interaction notes: see **reference.md §R5**.\n\n---\n\n## 10. Official YAML Test Suite\n\nThe [yaml\u002Fyaml-test-suite](https:\u002F\u002Fgithub.com\u002Fyaml\u002Fyaml-test-suite)\ncorpus. Each case is a wrapper with `yaml:`, `json:`, `fail:`,\n`tags:`. IDs are four-character codes (`9MMA`, `RHX7`, `ZYU8`).\n\n- `tests\u002Fyaml-test-suite\u002F` — vendored corpus.\n- `tests\u002Fofficial_suite.rs` — regression-net. Scores\n  `pass \u002F (total − skip)`, asserts `compliance >= 94.0`.\n- `tests\u002Fyaml_compliance_report.rs` — the *gap report*. No\n  assertions; writes `target\u002Fyaml-compliance-report.md`. Hard\n  floor `total >= 350` guards against vacuous 0\u002F0.\n\n**Ground-truth reminders (assert every time you cite them):**\n```\nofficial_suite.rs::SKIP_LIST     = &[]        # zero entries\nyaml_compliance_report.rs::SKIP  = &[]        # zero entries\ncompliance floor                 = 94.0%      # assertion\ntotal-cases floor                = 350        # regression guard\n```\n\n**Drift alert.** Top-level and crate READMEs claim \"100% strict\ncompliance — 387\u002F387 attempted, 0 failures, 19 skipped\". Test\nfiles carry **empty** SKIP_LIST and **94%** floor. Report what\nthe TEST FILES say (skip = 0 today) — README numbers are\naspirational and may lag.\n\n> Wrapper-marker table, six report classifications, full\n> walkthrough: see **reference.md §R4**.\n\n---\n\n## Cross-references\n\n- **Extended tables** (full `resolve_plain_ext`, directive cases,\n  chomping matrix, official-suite walkthrough, 1.1\u002F1.2 long\n  matrix): `reference.md` here.\n- **Flags in depth** (`ParserConfig`, presets): `noyalib-config-and-flags`.\n- **Parser\u002FCST internals** (green tree, event stream, streaming\n  vs loader): `noyalib-architecture-contract`.\n- **Historical fixes** (BOM, lone-CR, span_at): `noyalib-failure-archaeology`.\n- **Change control** (spec-conformance PRs): `noyalib-change-control`.\n","# YAML domain reference\n\n> **Reference material** (full `resolve_plain_ext` table, directive\n> regression case list, block-scalar chomping worked-example matrix,\n> official-suite integration walkthrough, YAML 1.1 vs 1.2 long-form flag\n> matrix): see `reference.md` in this directory. Load when the terse\n> summaries below are insufficient — spec-conformance work, tracing a\n> case ID back to its rule, or verifying chomping edge cases.\n\n**Purpose.** Domain-theory pack — the YAML 1.2.2 subset noyalib\nimplements, plus the gotchas that hit real code.\n\n**When NOT to use.** Parser\u002FCST internals →\n`noyalib-architecture-contract`. Config flags in depth →\n`noyalib-config-and-flags`. Historical incidents →\n`noyalib-failure-archaeology`.\n\n**Ground truth files** (re-read if you doubt any claim):\n`GLOSSARY.md`; `doc\u002Fadr\u002F0002-yaml-1.2-default.md`;\n`crates\u002Fnoyalib\u002Fsrc\u002Fstreaming.rs` (`resolve_plain_ext` at L1620\nis *the* scalar table); `crates\u002Fnoyalib\u002Fsrc\u002Fparser\u002Fscanner.rs`\n(§5.4, §6.8, §9.1.2 rules cited inline);\n`crates\u002Fnoyalib\u002Fsrc\u002Fde\u002Fconfig.rs` (every flag + default);\n`crates\u002Fnoyalib\u002Ftests\u002Fofficial_suite.rs` +\n`crates\u002Fnoyalib\u002Ftests\u002Fyaml_compliance_report.rs` (conformance\narithmetic).\n\n**Provenance re-verify (one-liners):**\n```bash\ngrep -n '\"\\.nan\"\\|\"\\.inf\"' crates\u002Fnoyalib\u002Fsrc\u002Fstreaming.rs\ngrep -n 'yaml_version: YamlVersion::V1_2' crates\u002Fnoyalib\u002Fsrc\u002Fde\u002Fconfig.rs\ngrep -n 'max_alias_expansions:\\|alias_anchor_ratio:\\|max_merge_keys:' crates\u002Fnoyalib\u002Fsrc\u002Fde\u002Fconfig.rs\ngrep -n '§5\\.4\\|§6\\.8\\|§9\\.1\\.2' crates\u002Fnoyalib\u002Fsrc\u002Fparser\u002Fscanner.rs\ngrep -n 'SKIP_LIST' crates\u002Fnoyalib\u002Ftests\u002Fofficial_suite.rs\n```\n\n---\n\n## 1. Documents and streams\n\nA YAML **stream** is zero or more **documents**, bounded by\noptional `---` (start) and `...` (end) markers. The first `---`\nis optional; markers become mandatory between documents once\ndirectives, `!!binary`-tag context, or a preceding `...` appear.\n\n**Directives** are `%`-prefixed head lines: `%YAML 1.2` sets\nversion, `%TAG !x! tag:example.com,2026:` binds a tag-shorthand\nprefix. Only one `%YAML` per document (§6.8.1).\n\n**noyalib's strict rules** (scanner.rs, § cited inline):\n- **§6.8:** directive *must* be followed by explicit `---`.\n  Pending directive at stream end → error.\n- **§6.8 \u002F §9.1.2:** directive *must not* appear after content\n  without intervening `...`.\n- **ADR-0002:** `%YAML 1.1` is *recorded but not honoured* — no\n  auto-flip of `legacy_*` flags. Silently honouring it would\n  reintroduce the Norway problem, which 1.2 was created to fix.\n\n> Regression case IDs (9MMA, B63P, RHX7, EB22, 9HCY, MUS6:1,\n> ZYU8): see **reference.md §R2**.\n\n---\n\n## 2. Block vs flow, indentation, column tracking\n\n**Block style** is the indentation-driven form:\n```yaml\ndb:\n  host: localhost\n  port: 5432\n```\n**Flow style** is the JSON-shaped inline form: `db: {host: localhost, port: 5432}`. YAML mixes freely — flow can nest inside block and vice versa.\n\nIndentation is *structure*, not decoration: a mapping value at\ncolumn *N+2* is a child of a key at column *N*. This is why\n**column tracking is load-bearing** — every byte offset must\nmap to the correct visual column, or nesting silently mis-parses.\n\nTwo column-desync incidents shaped this code (see\n`noyalib-failure-archaeology` for the full stories):\n- **BOM incident** — UTF-8 BOM is three bytes, zero visual\n  columns. Fix: `advance_by(3)` over the BOM *without* touching\n  `col` (scanner.rs L1150–L1181).\n- **Lone-CR incident** — classic-Mac `\\r`-only breaks left column\n  state stale. Fix (v0.0.14): recognise LF, CR, CRLF per §5.4\n  (see §5 below).\n\n---\n\n## 3. Scalars and block-scalar chomping\n\nFive scalar styles:\n- **Plain** — no quotes, resolved by the plain-scalar table\n  (§4): `port: 8080`.\n- **Single-quoted** — `'literal ''with'' apostrophes'`. Only\n  `''` escape.\n- **Double-quoted** — full backslash-escape alphabet plus\n  `\\uXXXX` (paired for surrogates).\n- **Literal block** (`|`) — every newline byte preserved.\n- **Folded block** (`>`) — non-empty lines joined with a space;\n  blank lines preserved as paragraph breaks.\n\n**Chomping** on block scalars (stacked as `|-`, `>+`, etc.):\n`-` = strip all trailing newlines; *(none)* = clip to one;\n`+` = keep every trailing newline \u002F blank line.\n\n**noyalib gotcha (v0.0.14 fix).** For keep-chomped (`|+` \u002F `>+`)\nblock scalars, `Document::span_at` now includes the *kept\ntrailing blank lines* in the returned span. Earlier releases\ntruncated at the last non-blank byte — byte-faithful for the\n*value* but not for the *span*, breaking editor diagnostics.\n\n> Worked-example matrix (six header combinations with literal\n> byte-level output including folding rules): see **reference.md §R3**.\n\n---\n\n## 4. The plain-scalar resolution table (as implemented)\n\nEvery plain scalar walks `resolve_plain_ext`\n(`streaming.rs:1620`). ~17 rows covering five null forms,\ncanonical + non-strict + legacy booleans, 12 inf\u002Fnan forms,\ninteger variants (decimal, `0x`, `0o`, bare-`0` octal, `u64` under\n`lossless_u64`), sexagesimal, f64 fallback, then string.\n\n**Precedence:** null → bool → hard-coded inf\u002Fnan → legacy booleans\n→ integer parse → sexagesimal → **f64 fallback** → string.\n\n> Full row-by-row table (verbatim source order): see\n> **reference.md §R1**.\n\n**The Norway problem.** YAML 1.1 boolean lexicon includes\n`yes`\u002F`no`\u002F`on`\u002F`off`; `country: NO` (Norway's ISO 3166) was\nsilently coerced to `false` for a decade in Ruby\u002Fpyyaml. YAML\n1.2 narrowed the lexicon to `true`\u002F`false` only. noyalib\ndefaults to 1.2; `legacy_booleans` opt-in reintroduces the\nhazard.\n\n**The bare-`nan` gotcha.** Nothing in the match table lists bare\n`nan` — but the f64 fallback (`s.parse::\u003Cf64>()`) accepts\n`\"nan\"`, `\"inf\"`, `\"+inf\"`, `\"-inf\"` case-insensitively (Rust\nstdlib). So bare `nan` resolves to `NaN` even under strict 1.2.\nThis bit **mapping keys**: `{nan: 1, nan: 2}` collided because\nboth stringified to the same `NaN` bucket. The distinct-typed\nKeyCollision guard (§8) catches similar collisions but the f64\nfallback route was the surprise.\n\n**Schema-strict mode.** `no_schema = true` short-circuits the\ntable — every plain scalar surfaces as\n`Scalar::Str(Cow::Borrowed(s))`.\n\n---\n\n## 5. Line breaks (§5.4)\n\nPer §5.4 a line break is **LF (`\\n`), CR (`\\r`), or CRLF\n(`\\r\\n`)**. All three valid; parser normalises on input. CRLF\ncounts as one break (scanner.rs L554). Lone-CR (classic-Mac) was\nadded v0.0.14 (scanner.rs L1769).\n\n**Gotcha.** Downstream code assuming `\\n`-only (naive\n`split('\\n')`) mis-counts columns on CR-only input. External\nconsumers of `Document::source()` should re-normalise if they\ncare.\n\n---\n\n## 6. Anchors, aliases, merge keys — and DoS budgets\n\n**Anchor** (`&name`) labels a node. **Alias** (`*name`) references\nit inside the same document. Per §7.1 each document has its own\nnamespace; noyalib clears the anchor table on `DocumentEnd`.\n\n**Merge key** (`\u003C\u003C`) — when the value is a mapping or a sequence\nof mappings, merged keys are inherited unless overridden locally.\n\n**Billion-laughs DoS.** Nested aliases\n(`c: &c [*b, *b, *b, ...]` where `b` references `a` etc.)\nmultiply expanded size by 9 per level; ten levels ≈ 3.5 billion\nterminal nodes from ~50 lines. Libyaml has historically crashed\non such inputs.\n\n**noyalib's budgets** (`ParserConfig`, defaults from\n`de\u002Fconfig.rs`):\n\n| Knob | Default | Strict | Trip |\n|------|--------:|-------:|------|\n| `max_alias_expansions` | 1 024 | 100 | `Error::RepetitionLimitExceeded` (not `BudgetBreach`) |\n| `max_document_length` | 64 MB | 1 MB | `Error::Parse` (also caps `alias_bytes` post-expansion) |\n| `max_total_scalar_bytes` | 64 MB | 1 MB | `BudgetBreach::MaxTotalScalarBytes` |\n| `max_merge_keys` | 10 000 | 1 000 | `BudgetBreach::MaxMergeKeys` |\n| `alias_anchor_ratio` | `Some(10.0)` | `Some(5.0)` | `BudgetBreach::AliasAnchorRatio` (`aliases > ratio × anchors`) |\n| `max_events` | 1 000 000 | 100 000 | `BudgetBreach::MaxEvents` |\n| `max_nodes` | 250 000 | 25 000 | `BudgetBreach::MaxNodes` |\n| `max_depth` | 128 | 64 | `Error::RecursionLimitExceeded` (not `BudgetBreach`) |\n\n**Only six `BudgetBreach` variants exist** in `error.rs`:\n`MaxEvents`, `MaxNodes`, `MaxTotalScalarBytes`, `MaxDocuments`,\n`MaxMergeKeys`, `AliasAnchorRatio`. `max_alias_expansions` and\n`max_depth` surface as top-level `Error::Repetition-` \u002F\n`Error::RecursionLimitExceeded`; `max_mapping_keys` and\n`max_sequence_length` surface as `Error::Serialize(...)` (wart\ndocumented in `noyalib-architecture-contract` §5.1).\n\n`alias_anchor_ratio` is the *early-warning* signal — real files\nrarely exceed 2–3 aliases per anchor; above 10 (5 in strict) is\nbomb-shaped. Set to `None` to disable.\n\n**MergeKeyPolicy** (`de\u002Fconfig.rs:973`, note real variants):\n- **`Auto`** *(default)* — YAML 1.2 semantics: `\u003C\u003C` triggers\n  automatic merge of the value into the enclosing mapping.\n- **`AsOrdinary`** — treat `\u003C\u003C` as a plain string key. The\n  mapping keeps a literal `\u003C\u003C` entry. Useful for round-tripping\n  files where `\u003C\u003C` is a data key, not a merge instruction.\n- **`Error`** — refuse any document containing `\u003C\u003C` with\n  `Error::Custom`. For schema-strict pipelines.\n\n> Note: GLOSSARY.md drift — it lists `{Auto, Disabled, Strict}`.\n> The source of truth is `de\u002Fconfig.rs` — `{Auto, AsOrdinary,\n> Error}`. Trust the code.\n\n---\n\n## 7. Tags\n\nExplicit type annotations. Three families:\n- **Core-schema tags** — `!!str`, `!!int`, `!!float`, `!!bool`,\n  `!!null`, `!!seq`, `!!map`, `!!binary`. noyalib **never\n  strips** these — they carry semantics (`!!str 42` forces\n  string).\n- **Custom tags** — `!shopping`, `!myapp\u002Fconfig`. Carried through\n  as `Value::Tagged`; a `TagRegistry` can transform them inline\n  on the streaming path.\n- **Verbatim tags** — `!\u003Ctag:yaml.org,2002:str>` (rare).\n\n**Shorthand.** `!!x` expands to `tag:yaml.org,2002:x` (§6.8.2).\nCustom prefixes come from `%TAG !x! tag:example.com,2026:`.\n\n**`!!binary`** — RFC 4648 base64 (§10.4). Decoded on the\nstreaming path (`streaming.rs` L1095–L1115); failure →\n`Error::Deserialize(\"!!binary: {why}\")`. Deserialising into a\n`String` target defaults to tag-mismatch error; set\n`ignore_binary_tag_for_string = true` for pyyaml-style advisory\nbehaviour (returns the literal base64 source).\n\n---\n\n## 8. Keys — and the KeyCollision guard\n\nYAML permits any node type as a mapping key, including complex\nkeys (`? key\\n: value`). noyalib exposes two mapping types:\n\n- **`Mapping`** — string-keyed (`IndexMap\u003CString, Value>`).\n  Default, JSON-compatible.\n- **`MappingAny`** — `Value`-keyed. Use when non-string keys\n  matter for fidelity.\n\nWhen YAML produces a non-string key (`1`, `true`, `null`) and the\ntarget is `Mapping`, the key is **stringified on entry**. This is\nwhere the **distinct-typed KeyCollision guard** lives\n(`error.rs:509`, `Error::KeyCollision(String)`). Given\n`1: one` and `\"1\": two`, both stringify to `\"1\"`; silently\ndropping one is data loss, so noyalib rejects with\n`KeyCollision(\"1\")` at parse time.\n\nStreaming path bypass (`de.rs:405-421`): serde asks the streaming\ndeserializer for `String` keys, stringifying typed scalars\n*before* `ValueVisitor::visit_map` can distinguish `1` from\n`\"1\"`. The `Value` target therefore routes through the AST\nloader (which owns the collision check and DoS budgets).\n\n**DuplicateKeyPolicy** (unrelated axis — same string key twice):\n`First` (keep first) \u002F **`Last`** *(default, YAML 1.2)* \u002F\n`Error` (reject).\n\n---\n\n## 9. YAML 1.1 vs 1.2 — the flags that matter\n\nPer ADR-0002, **noyalib defaults to YAML 1.2 strict semantics.**\nThree 1.1 legacy behaviours are opt-in on `ParserConfig`:\n\n- **`legacy_booleans`** — off: `yes`\u002F`no`\u002F`on`\u002F`off` → string;\n  on: → bool (Norway problem).\n- **`legacy_octal_numbers`** — off: `0644` → int 644; on: → 420.\n- **`legacy_sexagesimal`** — off: `60:00` → string; on: → int 3600.\n\n`ParserConfig::version(YamlVersion::V1_1)` flips all three as a\nbundle; fine-grained flags remain callable individually.\n\n- **`strict_booleans`** — narrows 1.2 further: only `true`\u002F`false`\n  (lowercase) are boolean; `True`\u002F`TRUE` become strings. Off by\n  default.\n- **`no_schema`** — every plain scalar surfaces as string;\n  table (§4) bypassed entirely.\n\n> Long-form matrix with hazard column, precedence ordering, and\n> flag-interaction notes: see **reference.md §R5**.\n\n---\n\n## 10. Official YAML Test Suite\n\nThe [yaml\u002Fyaml-test-suite](https:\u002F\u002Fgithub.com\u002Fyaml\u002Fyaml-test-suite)\ncorpus. Each case is a wrapper with `yaml:`, `json:`, `fail:`,\n`tags:`. IDs are four-character codes (`9MMA`, `RHX7`, `ZYU8`).\n\n- `tests\u002Fyaml-test-suite\u002F` — vendored corpus.\n- `tests\u002Fofficial_suite.rs` — regression-net. Scores\n  `pass \u002F (total − skip)`, asserts `compliance >= 94.0`.\n- `tests\u002Fyaml_compliance_report.rs` — the *gap report*. No\n  assertions; writes `target\u002Fyaml-compliance-report.md`. Hard\n  floor `total >= 350` guards against vacuous 0\u002F0.\n\n**Ground-truth reminders (assert every time you cite them):**\n```\nofficial_suite.rs::SKIP_LIST     = &[]        # zero entries\nyaml_compliance_report.rs::SKIP  = &[]        # zero entries\ncompliance floor                 = 94.0%      # assertion\ntotal-cases floor                = 350        # regression guard\n```\n\n**Drift alert.** Top-level and crate READMEs claim \"100% strict\ncompliance — 387\u002F387 attempted, 0 failures, 19 skipped\". Test\nfiles carry **empty** SKIP_LIST and **94%** floor. Report what\nthe TEST FILES say (skip = 0 today) — README numbers are\naspirational and may lag.\n\n> Wrapper-marker table, six report classifications, full\n> walkthrough: see **reference.md §R4**.\n\n---\n\n## Cross-references\n\n- **Extended tables** (full `resolve_plain_ext`, directive cases,\n  chomping matrix, official-suite walkthrough, 1.1\u002F1.2 long\n  matrix): `reference.md` here.\n- **Flags in depth** (`ParserConfig`, presets): `noyalib-config-and-flags`.\n- **Parser\u002FCST internals** (green tree, event stream, streaming\n  vs loader): `noyalib-architecture-contract`.\n- **Historical fixes** (BOM, lone-CR, span_at): `noyalib-failure-archaeology`.\n- **Change control** (spec-conformance PRs): `noyalib-change-control`.\n",{"name":5,"license":15,"metadata":24,"description":7,"allowed-tools":31,"compatibility":32},{"agtmls-owner":12,"agtmls-bundle":25,"agtmls-maturity":26,"agtmls-risk-level":27,"agtmls-writes-files":28,"agtmls-network-access":29,"agtmls-handles-secrets":30,"agtmls-executes-commands":28,"agtmls-requires-human-review":28},"noyalib","project","medium","true","optional","false","Read Glob Grep Write Edit Bash WebFetch WebSearch","Requires cargo, git. Tested with Claude Code, Codex, and Aider skill layouts","main","ecf7dfb9e0505c9584e5838603d8cd9cb0e64efc","packs\u002Fnoyalib\u002Fskills\u002Fyaml-domain-reference",0,"https:\u002F\u002Fgithub.com\u002Fsebastienrousseau\u002Fagtmls","https:\u002F\u002Fpypi.org\u002Fproject\u002Fagtmls\u002F","https:\u002F\u002Fgithub.com\u002Fsebastienrousseau","https:\u002F\u002Fsebastienrousseau.com","Payments leader, 19 years in banking. I build open-source ISO 20022, post-quantum cryptography and applied AI for finance.","2026-11-09 15:12:45",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add sebastienrousseau\u002Fagtmls --skill yaml-domain-reference",{"tool":49,"command":50},"bunx","bunx skills add sebastienrousseau\u002Fagtmls --skill yaml-domain-reference",{"tool":52,"command":53},"pnpm","pnpm dlx skills add sebastienrousseau\u002Fagtmls --skill yaml-domain-reference","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsebastienrousseau\u002Fagtmls\u002Fblob\u002Fmain\u002Fpacks\u002Fnoyalib\u002Fskills\u002Fyaml-domain-reference\u002FSKILL.md",true,[57,63],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"metadata.json","REFERENCE","参考文档",411,"https:\u002F\u002Fgithub.com\u002Fsebastienrousseau\u002Fagtmls\u002Fblob\u002Fmain\u002Fpacks\u002Fnoyalib\u002Fskills\u002Fyaml-domain-reference\u002Fmetadata.json",{"path":64,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":65,"sourceHtmlUrl":66},"reference.md",10110,"https:\u002F\u002Fgithub.com\u002Fsebastienrousseau\u002Fagtmls\u002Fblob\u002Fmain\u002Fpacks\u002Fnoyalib\u002Fskills\u002Fyaml-domain-reference\u002Freference.md",[68,75,82,89,96,103],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M789BV3SY53CRXRKQXT13DSB","example-skill","Use when the user needs this reusable workflow. Replace this with trigger-rich wording that says when to load the skill, what task it handles, and when not to use it.","https:\u002F\u002Fgithub.com\u002Fsebastienrousseau\u002Fagtmls\u002Fblob\u002Fmain\u002Ftemplates\u002Fskill\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M789BPMXXTXQPSMDQ06DSV1P","writing-plans","Turn a vague or multi-step request into an ordered list of small steps, each with its own done-condition and verification. Load before starting work that touches several files, has unclear scope, or spans more than one session, and when a request needs decomposing before any code is written. Produces a plan a reviewer can check against, not a to-do list.","https:\u002F\u002Fgithub.com\u002Fsebastienrousseau\u002Fagtmls\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-plans\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M789BK5BBSDBQENG56CPAEDF","web-research-and-source-triage","Use when gathering current web evidence, comparing sources, triaging credibility, reading GitHub repositories, checking docs, or deciding whether a claim needs live verification.","https:\u002F\u002Fgithub.com\u002Fsebastienrousseau\u002Fagtmls\u002Fblob\u002Fmain\u002Fskills\u002Fweb-research-and-source-triage\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M789BF76AAKX8MGWA48YFHMX","vetting-a-skill-before-install","Use before installing, importing or enabling a third-party skill, plugin, marketplace or skills repository in Claude Code, Codex, Antigravity, Cursor or any agent. Pins the source to a commit, audits every skill and the agent configuration it ships, reads what the audit could not cover, and ends in install, mirror or refuse. Not for auditing this registry's own skills.","https:\u002F\u002Fgithub.com\u002Fsebastienrousseau\u002Fagtmls\u002Fblob\u002Fmain\u002Fskills\u002Fvetting-a-skill-before-install\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M789B5SQ8G7RCAJBYZ0CR0R4","verification-before-completion","The gate between doing work and claiming it is done. Load before saying finished, fixed, working, or ready, before marking a task complete, and before reporting an outcome to a human. Converts each claim into the observation that would justify it, and names the rationalizations that let unverified work ship. Not the project's own evidence bar or test taxonomy.","https:\u002F\u002Fgithub.com\u002Fsebastienrousseau\u002Fagtmls\u002Fblob\u002Fmain\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":19},"01M789B1JXCYBRY5P3MWYQBKJ0","using-agtmls","Meta-router for the AgtMLS skill catalog. Read first when unsure which AgtMLS skill applies, when several look relevant, when asking 'is there a skill for porting or noyalib work', or when onboarding to how the hub's skills and shared references fit together.","https:\u002F\u002Fgithub.com\u002Fsebastienrousseau\u002Fagtmls\u002Fblob\u002Fmain\u002Fskills\u002Fusing-agtmls\u002FSKILL.md",[],[]]