Commit Graph

15 Commits

Author SHA1 Message Date
bf069fad39 feat(json): add PureYAMLJSON product, a standalone YAML <-> JSON converter
PureYAMLJSON is a separate library product layered on the core engine. JSON is
a subset of YAML 1.2, so the existing parser already reads both into one value
tree; this product adds the missing half and the value-level policy:

- JSON.Writer: a pure-Swift RFC-8259 serializer (no Foundation; WASI-clean),
  pretty or compact, rejecting non-string keys and non-finite numbers.
- JSON representability rules expressed in PureYAML's own Validation framework:
  mappingKeysAreStrings and numbersAreFinite join the core mappingKeysAreUnique.
- JSON.Validator: the representability rule set plus issues(for:)/isRepresentable.
- JSON.Convert: standalone convert(_:to:) with the round-trip law (parse ->
  validate representability -> emit -> re-parse must equal the source). To JSON
  rejects complex keys and non-finite numbers; to YAML rejects duplicate keys,
  which are legal in JSON but not in YAML.

19 tests cover the writer, the rules, and both conversion directions including
the dual-rejection edges. Carved out of the catch-all Sources/Tests paths via
exclude so the core PureYAML target is unchanged.
2026-06-25 00:33:40 +02:00
ce0585f77e test(conformance): track all 402 suite cases; fix 3 regressions
The gap-only manifest stopped guarding a case once it was fixed, so later
work silently regressed previously-fixed cases (caught only by an external
full-suite run, not the gated sweep or full corpus). Replace it with a full
manifest of all 402 official cases (Tests/Fixtures/yaml-test-suite-manifest.yaml),
each carrying its conformant expectation and a passing/gap status, with every
case's files vendored. The gated sweep now asserts every passing case still
passes (the regression guard) and every gap still reproduces, so any regression
fails the build.

The honest gate-enforced count is 329/402 passing (the earlier 348 came from a
more lenient one-time oracle).

Repairs three regressions the new gate revealed: the bucket-6 tab rule
over-rejected tabs in block-scalar content and as separation before a scalar
value (root cause: the batch scanner and the incremental TokenCursor had
divergent line-start loops; unified onto a single scanStep, fixing 96NN/00,
96NN/01, R4YG, Y79Y/001, DK95/00, DK95/03, DK95/07, 6CA3, Q5MG, J3BT); an anchor
on a prior line before an alias key wrongly rejected 26DV; and a tag-only flow
key mis-parsed WZ62. Genuine tab-indentation errors (4EJS, Y79Y/000) still reject.
2026-06-24 00:16:28 +02:00
13a3859e21 test(conformance): track YAML test suite gaps
Vendor the 206 official YAML test suite cases (yaml/yaml-test-suite, data branch, commit 6ad3d2c) that PureYAML does not yet handle correctly, under Tests/Fixtures/yaml-test-suite/, with a manifest recording each gap's category and current behavior.

Add an opt-in conformance sweep (scripts/check-yaml-test-suite.sh, gated behind PUREYAML_RUN_YAML_TEST_SUITE=1) that reproduces every recorded gap, so a future fix must update the manifest. Document the measured result (196/402 passing) and the ordered plan for closing the gaps in docs/YAML_TEST_SUITE_CONFORMANCE.md.

No parser behavior changed.
2026-06-23 19:34:18 +02:00
7006d1eb52 chore(style): skip vendored yaml fixture corpora
Keep repo prose checks focused on authored files while preserving upstream fixture contents verbatim.
2026-06-06 08:25:03 +02:00
208b892019 feat(parser): harden diagnostics and streaming
Add structured validation diagnostics, JSON and Yams comparison gates, and lazy token/event parsing so production behavior is measured without retaining full intermediate parser arrays.
2026-06-06 07:57:48 +02:00
b47ca4fc31 ci: run optimized build gates 2026-06-05 22:36:28 +02:00
3a90df095d fix(ci): prepare 0.1.0 release 2026-06-05 21:20:20 +02:00
bc54528353 Harden parser against real YAML fixtures 2026-06-05 19:34:30 +02:00
611c079255 test(coding): add sequence fixtures and contract gate 2026-06-05 12:33:09 +02:00
b61ed10fb2 docs(roadmap): collapse completed epic diagrams 2026-06-05 10:50:13 +02:00
c25c35f82c ci(gates): add full local verification script 2026-06-05 10:24:04 +02:00
788126e3a0 docs(roadmap): follow tiledown mermaid palette 2026-06-05 07:04:46 +02:00
03779526b2 docs(roadmap): use apple web colors 2026-06-05 06:59:32 +02:00
18adb7db5b docs(roadmap): add parser roadmap epic tracking 2026-06-05 06:46:20 +02:00
9c718e3303 feat(package): bootstrap pure swift yaml package 2026-06-05 06:34:20 +02:00