feat: explicit strict JSON entry (#13) #14

Merged
cflmy merged 1 commits from codex/issue-13-strict-json into main 2026-11-30 12:29:02 +08:00
Owner

概述

实现 marqdo-std-data#13(消费方 marqdo-ext-ai AI-U2b):为 std:data/json 增加显式严格入口,不改变普通 json.解析 行为、不新增第二套 JSON 语法/解析器、不新增跨仓依赖。

交付

  • json.严格解析(文本):
    • 同一对象层重复键(按解码后键比较,"a" 与 "\u0061" 等价)→ json.duplicate_key;
    • 无法表示为 binary64 有限值的数字(1e400、-1e400、1.8e308)→ json.non_finite_number;1e308、1.79e308 保持有限;
    • 复用现有 tokenizer/解析器与 128 层深度上限。
  • 普通 json.解析 行为不变(默认套件 3/3 PASS)。
  • 候选输入自测:tests/json-strict.mq.md + tests/cases-strict/json-strict.json + scripts/test-strict.sh;run_cases.py 支持 MARQDO_STDLIB_CASES_DIR。严格入口尚未进入冻结生态 Bundle,所以该套件分离于默认 CI 套件,由根 Bundle 生产者/晋升流水线以候选 Bundle 显式运行。
  • README 记录新入口、错误码与候选 Bundle 测试入口;docs/evidence-2026-11-30-strict-json.md 记录真实 CLI 运行与摘要。

验证(真实,Linux x86_64 / glibc 2.43)

MARQDO_BIN=<rc.6 candidate> MARQDO_STDLIB_DIR=<candidate Bundle> sh scripts/test.sh
PASS csv / PASS json / PASS table — 3 cases passed

MARQDO_BIN=<rc.6 candidate> MARQDO_STDLIB_DIR=<same> sh scripts/test-strict.sh
PASS json-strict — 1 cases passed

候选 Bundle:pinned 0.2.0 + 本仓当前 modules,tree digest sha256:4e47b0ff4b1e17d252cc74f20837014298fed4831050d65ca0c69f9cbdac55e9;模块 sha256 0f099d02…。

未验证:冻结 Bundle/CI 镜像尚未包含新入口(需根 Bundle 重建,属晋升/根工单);未创建 release/tag;未做 Unicode 额外规范化(与普通键语义一致)。

refs #13 #10 #12

## 概述 实现 `marqdo-std-data#13`(消费方 `marqdo-ext-ai` AI-U2b):为 `std:data/json` 增加显式严格入口,不改变普通 `json.解析` 行为、不新增第二套 JSON 语法/解析器、不新增跨仓依赖。 ## 交付 - `json.严格解析(文本)`: - 同一对象层重复键(按解码后键比较,`"a"` 与 `"\u0061"` 等价)→ `json.duplicate_key`; - 无法表示为 binary64 有限值的数字(`1e400`、`-1e400`、`1.8e308`)→ `json.non_finite_number`;`1e308`、`1.79e308` 保持有限; - 复用现有 tokenizer/解析器与 128 层深度上限。 - 普通 `json.解析` 行为不变(默认套件 3/3 PASS)。 - 候选输入自测:`tests/json-strict.mq.md` + `tests/cases-strict/json-strict.json` + `scripts/test-strict.sh`;`run_cases.py` 支持 `MARQDO_STDLIB_CASES_DIR`。严格入口尚未进入冻结生态 Bundle,所以该套件分离于默认 CI 套件,由根 Bundle 生产者/晋升流水线以候选 Bundle 显式运行。 - README 记录新入口、错误码与候选 Bundle 测试入口;`docs/evidence-2026-11-30-strict-json.md` 记录真实 CLI 运行与摘要。 ## 验证(真实,Linux x86_64 / glibc 2.43) ```text MARQDO_BIN=<rc.6 candidate> MARQDO_STDLIB_DIR=<candidate Bundle> sh scripts/test.sh PASS csv / PASS json / PASS table — 3 cases passed MARQDO_BIN=<rc.6 candidate> MARQDO_STDLIB_DIR=<same> sh scripts/test-strict.sh PASS json-strict — 1 cases passed ``` 候选 Bundle:pinned 0.2.0 + 本仓当前 modules,tree digest `sha256:4e47b0ff4b1e17d252cc74f20837014298fed4831050d65ca0c69f9cbdac55e9`;模块 sha256 `0f099d02…`。 未验证:冻结 Bundle/CI 镜像尚未包含新入口(需根 Bundle 重建,属晋升/根工单);未创建 release/tag;未做 Unicode 额外规范化(与普通键语义一致)。 refs #13 #10 #12
cflmy added 1 commit 2026-11-30 12:18:23 +08:00
Implement marqdo-std-data#13 without changing the default `json.解析`
behavior:

- `json.严格解析(文本)` rejects duplicate keys in one object level after
  decoding (`"\u0061"` equals `"a"`) with `json.duplicate_key`, and numbers that
  cannot be represented as finite binary64 values with
  `json.non_finite_number` (1e400 / -1e400 / 1.8e308 reject; 1e308 / 1.79e308
  stay finite).
- The strict validator reuses the existing tokenizer/parser helpers and the
  128-level depth limit; no second JSON grammar or parser is introduced.
- Candidate-input self-test: `tests/json-strict.mq.md` +
  `tests/cases-strict/json-strict.json` + `scripts/test-strict.sh`, kept
  separate from the default suite because the frozen ecosystem Bundle predates
  the new function. `run_cases.py` accepts `MARQDO_STDLIB_CASES_DIR`.
- README documents the new entry, error codes and candidate-Bundle test lane;
  docs/evidence records the real CLI runs and digests.

No cross-repo dependency, no CLI change, no release.
cflmy merged commit 250633fdca into main 2026-11-30 12:29:02 +08:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cflmy/marqdo-std-data#14