the-mindscape-of-bro-tsong/reports/规则Schema工作流检查摘要_v0.1.md

117 lines
4.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 规则 Schema 工作流检查摘要 v0.1
## Completed
- 新增 GPT 规划本地化协议。
- 新增模型抽取规则。
- 新增模型卡 Markdown contract。
- 新增模型抽取 workflow。
- 新增机器模型索引 `models/model_index.json`
- 新增人读模型卡索引 `cards/card_index.md`
- 新增权威机器模型卡 schema `schemas/model_card.schema.json`
- 新增 `schemas/model_index.schema.json`
- 新增 `schemas/card_index.schema.json`
- 为 source article、source excerpt、regression case schema 补充中文 `description`
- 为 regression case schema 增加 `case_type` 枚举:`positive`、`boundary`、`misuse`。
- 升级 `scripts/validate_model_library.py`,增加本地 contract 子集、index、回归覆盖检查。
- 新增 `scripts/check_card_contract.py`
- 新增 `scripts/run_selector_demo.py`
- 新增和更新单元测试。
- 更新 README、workflow、schema/scripts/selector/cards/models 目录说明。
## Files Changed
Created:
- `docs/MODEL_CARD_CONTRACT.md`
- `docs/MODEL_EXTRACTION_WORKFLOW.md`
- `schemas/model_card.schema.json`
- `schemas/model_index.schema.json`
- `schemas/card_index.schema.json`
- `models/model_index.json`
- `cards/card_index.md`
- `scripts/check_card_contract.py`
- `scripts/run_selector_demo.py`
- `tests/test_card_contract.py`
- `reports/规则Schema工作流检查摘要_v0.1.md`
Modified:
- `README.md`
- `docs/WORKFLOW.md`
- `schemas/README.md`
- `schemas/source_article.schema.json`
- `schemas/source_excerpt.schema.json`
- `schemas/regression_case.schema.json`
- `scripts/README.md`
- `scripts/validate_model_library.py`
- `selector/README.md`
- `models/README.md`
- `cards/README.md`
- `tests/test_validate_model_library.py`
- `reports/validation_report.md`
## Checks Run
```powershell
python -m unittest discover -s tests -p "test*.py" -v
```
Result:
- PASS
- 9 tests run.
```powershell
python scripts\check_card_contract.py
```
Result:
- FAIL as expected.
- Current `cards/qpi.md` and `cards/intellectual_archaeology.md` are still `draft_pre_contract` and do not yet contain all required headings.
- `cards/README.md` is now ignored by the checker.
```powershell
python scripts\validate_model_library.py
```
Result:
- FAIL as expected.
- Current `models/qpi.model.json` and `models/intellectual_archaeology.model.json` are still `draft_pre_contract`.
- Main failures are missing recommended/required GPT-plan fields, invalid enum values, invalid `selection_priority` range, and incomplete `stability_profile`.
```powershell
python scripts\run_selector_demo.py
```
Result:
- PASS.
- Demo outputs recommended model IDs, scores, reasons, and routing notes.
- Scores are low because current model JSON has not yet been repaired with trigger keywords and 1-10 priority values.
## Known Limits
- `scripts/validate_model_library.py` implements the local schema subset required by current contracts. It does not implement a complete JSON Schema draft 2020-12 engine.
- Current model/card content is intentionally not repaired in this pass.
- `models/model_index.json` and `cards/card_index.md` mark both sample models as `draft_pre_contract`.
- Selector demo works, but its output quality depends on model JSON fields that are not yet repaired.
- `card_index.schema.json` defines card index metadata, but `cards/card_index.md` itself is Markdown and is checked by local tooling rather than full JSON Schema.
## Owner Review Checklist
- GPT 规划是否已正确本地化?
- card contract 是否覆盖模型卡样例?
- model schema 是否覆盖机器 JSON 样例?
- index 设计是否满足当前和未来扩展?
- 工作流 gate 是否足以防止直接跳内容?
- 工具需求是否足够但不过度?
- 是否接受 `tests/regression_cases.json` 继续作为合并式 regression case 文件?
- 是否接受 `model_spec.schema.json` 暂时保留为 pre-contract legacy schema
## Do Not Proceed Before Owner Confirms
Do not repair QPI or Intellectual Archaeology content until this foundation is reviewed or the owner explicitly authorizes content repair.