feat: add --strict mode to Research Pack validator#88
Merged
Conversation
05427f0 to
8cbc217
Compare
- Add --strict flag to validate_research_pack.py that checks source ID format, reference mapping (body claims reference defined IDs), unused source IDs, claim register evidence tags, and Final audit status (Pass/Partial/Fail with warnings). - Keep existing structural checks unchanged and always-on. - Update examples/research-pack-example.md with [Sxx] source IDs and Final audit status: Pass so it passes strict mode. - Add 9 regression tests for strict-mode validation. - Add strict-mode check to CI quick job.
8cbc217 to
dc0e10a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
Closes #82 —
validate_research_pack.py当前只检查 required headings / empty sections / placeholder artifacts,但不会校验 source ID 格式、source/claim 映射关系、或 audit status。修改
scripts/validate_research_pack.py新增
--strict参数,开启后依次执行:[Sxx]格式的 ID[Sxx]是否都有定义;是否有定义了但从未使用的源[Sxx]/[Ixx]/[Uxx]引用标签Pass/Partial/Fail之一;Partial输出 warning (exit 0),Fail输出 error (exit 4)原有结构检查(missing headings, empty sections, artifacts)保持不动,且总是运行。
退出码:
scripts/test_validator_regression.py新增 9 个 strict 模式测试:
strict valid baseline— 完整 source ID + Pass,exit 0strict no source IDs— source register 无[Sxx],exit 4strict undefined source ref— claim 引用[S99]但未定义,exit 4strict unused source id—[S01]定义了但未引用,exit 0 (warning)strict audit status Partial— exit 0 (warning)strict audit status Fail— exit 4 (error)strict audit status invalid—Pending非法值,exit 4strict claim no evidence tags— claim 缺引用标签,exit 0 (warning)non-strict ignores strict checks— 不加--strict时不报错examples/research-pack-example.md补充
[S01]–[S03]到 Source register,claim register 添加引用,Final audit status 改为Pass。.github/workflows/ci.ymlquickjob 增加--strict模式检查示例文件。不改的
md_to_pdf.py/render_pdf.py/markdown_to_html.pyREADME.md/SKILL.md/references/checklists/(checklist 是手动审计工具,validator 是自动化补充)测试