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.
44 lines
2.4 KiB
Markdown
44 lines
2.4 KiB
Markdown
# marqdo-std-data
|
||
|
||
本仓负责 JSON、CSV 与 GFM 数据交换。当前处于**标准库源码归位迁移**阶段:JSON/CSV 与 Table 序列化源码、断言已迁入本仓,等待父仓候选组合验收(父仓工单 [marqdo#9](https://git.cflmy.cn/cflmy/marqdo/issues/9),本仓工单 [#1](https://git.cflmy.cn/cflmy/marqdo-std-data/issues/1))。
|
||
|
||
## 唯一公开入口(Bundle 根相对路径)
|
||
|
||
| 发布路径 | 公开导入 | 职责 |
|
||
| --- | --- | --- |
|
||
| `data/json.mq.md` | `std:data/json` | 递归 JSON 解析/格式化(128 层上限、多值);显式严格入口 `json.严格解析` 拒绝同层重复键(按解码后键比较,含转义等价)与无法表示为有限值的数字(`json.duplicate_key` / `json.non_finite_number`),普通 `json.解析` 行为不变。 |
|
||
| `data/csv.mq.md` | `std:data/csv` | 引号单行/多行 CSV 解析与格式化 |
|
||
| `data/table.mq.md` | `std:data/table` | Table 序列化:`连接片段`、`连接行`、`转义单元格`、`转GFM` |
|
||
|
||
**职责切分(本迁移内冻结)**:Table 值操作归 `std:collections/table`,本仓只保留序列化;不复制集合算法,不保留旧入口兼容转发。跨模块组合断言由根 Bundle 组合测试承担。
|
||
|
||
`modules/` 保存 Bundle 根相对路径;Bundle 与 `stdlib.json` 由父仓唯一生产者生成,本仓不维护第二份官方 manifest。
|
||
|
||
## 目录
|
||
|
||
- `modules/`:对外发布的模块源码。
|
||
- `tests/`:迁入的自测源与 `tests/cases/` 期望。
|
||
- `scripts/`:独立验收入口。
|
||
|
||
## 独立验收
|
||
|
||
```sh
|
||
MARQDO_BIN=/path/to/verified/marqdo \
|
||
MARQDO_STDLIB_DIR=/path/to/installed/bundle \
|
||
scripts/test.sh
|
||
|
||
# Candidate-input strict suite: requires a Bundle built from this component's
|
||
# current gitlink (the frozen ecosystem Bundle predates `json.严格解析`).
|
||
MARQDO_BIN=/path/to/verified/marqdo \
|
||
MARQDO_STDLIB_DIR=/path/to/candidate/bundle \
|
||
scripts/test-strict.sh
|
||
```
|
||
|
||
期望值取自迁移前基线 Bundle 的真实执行(JSON/CSV 分项断言、Table GFM 输出);修改期望值等于声明公开行为变化,必须单独评审。
|
||
|
||
## 边界
|
||
|
||
不实现语言内核、Host 权限、集合算法或数据库接口;GFM 序列化只复用自身转义/连接函数。
|
||
|
||
[生态迁移台账](https://git.cflmy.cn/cflmy/marqdo/src/branch/main/docs/MIGRATION.md) · [开发流程](https://git.cflmy.cn/cflmy/marqdo/src/branch/main/docs/DEVELOPMENT.md)
|