validate
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseValidate an OKF bundle
验证OKF包
Run the deterministic conformance checker against the target bundle. Default to
the project's directory when no path is given.
.okf/bash
uv run "${CLAUDE_SKILL_DIR}/scripts/okf_validate.py" $ARGUMENTSIf is unavailable, fall back to:
uvbash
python3 -m pip install --quiet pyyaml && \
python3 "${CLAUDE_SKILL_DIR}/scripts/okf_validate.py" $ARGUMENTS${CLAUDE_SKILL_DIR}okfnpx skills addInterpret the result:
- ERROR → a hard §11 conformance failure (no parseable frontmatter, or a
missing/empty ). The bundle is non-conformant. Fix every one.
type - warn → soft guidance (missing recommended field, non-ISO log date, broken cross-link, a malformed v0.2 family, a footnote naming no source, an actor that misses the §7 shapes, a computation path that resolves nowhere). Never blocks; broken links in particular are explicitly tolerated by the spec (§6.1). Fix when cheap.
One warning is worth more than the others: a §7 near-miss such as
or . §5.3 keys trust tiers off the exact lowercase prefix,
so the concept silently reads as machine-confirmed when a person did review it.
Fix that one on sight.
Human:danahuman/danahuman:v0.1 bundles validate too: a legacy or section is
reported as a warning naming its v0.2 replacement (, ),
never as an error (§13.1). Under those warnings do fail the run —
that is the migration nudge, and is the door.
timestamp# Citationsgenerated.atsources--strict--migrate针对目标包运行确定性合规检查器。若未指定路径,默认使用项目的目录。
.okf/bash
uv run "${CLAUDE_SKILL_DIR}/scripts/okf_validate.py" $ARGUMENTS若不可用,可使用备用命令:
uvbash
python3 -m pip install --quiet pyyaml && \
python3 "${CLAUDE_SKILL_DIR}/scripts/okf_validate.py" $ARGUMENTS${CLAUDE_SKILL_DIR}okfnpx skills add结果解读:
- ERROR → 违反第11节的硬性合规要求(无可解析的前置元数据,或字段缺失/为空)。该包不符合规范。必须修复所有错误。
type - warn → 软性指导建议(缺失推荐字段、非ISO格式的日志日期、失效的交叉链接、格式错误的v0.2家族、未标注来源的脚注、不符合第7节格式的参与者、无法解析的计算路径)。此类警告不会阻止流程;尤其是失效链接,规范第6.1节明确允许存在。若修复成本低则建议修复。
其中有一个警告需要重点关注:接近第7节格式但存在错误的情况,例如或。第5.3节的信任层级依赖于精确的小写前缀,因此如果是人工审核的内容却使用了错误格式,会被默认为机器确认的内容。遇到此类情况必须立即修复。
Human:danahuman/danahuman:v0.1版本的包也可进行验证:旧版的或部分会被标记为警告,并提示对应的v0.2替代字段(、),不会被判定为错误(第13.1节)。在模式下,这些警告会导致运行失败——这是迁移提示,而参数则是迁移入口。
timestamp# Citationsgenerated.atsources--strict--migrateMigrating a v0.1 bundle
迁移v0.1版本的包
--migratebash
uv run "${CLAUDE_SKILL_DIR}/scripts/okf_validate.py" .okf --migrate --strictIt hoists to , lifts a
list into , and bumps . Two limits worth
repeating to the user: cannot be recovered for pre-v0.2 content
(hence the actor — the concept stays correctly under
§5.3), and per-claim attribution was never encoded in v0.1, so only the
source list moves up.
timestampgenerated: { by: process:okf-migrate, at }# Citationssourcesokf_versiongenerated.byprocess:unverified[^id]--migratebash
uv run "${CLAUDE_SKILL_DIR}/scripts/okf_validate.py" .okf --migrate --strict它会将字段升级为,将列表移至字段,并更新。需要向用户说明两个限制:对于v0.2之前的内容,无法恢复字段(因此使用参与者——根据第5.3节,该内容会被正确标记为);另外v0.1版本从未编码每条声明的属性,因此仅会将来源列表移至顶层。
timestampgenerated: { by: process:okf-migrate, at }# Citationssourcesokf_versiongenerated.byprocess:unverified[^id]Exit codes
退出码
Non-zero if any error is present, or if warnings exceed the gate:
allows none, allows N, the default allows any.
Add for machine-readable output (useful in CI).
--strict--max-warnings N--json若存在任何错误,或警告数量超过限制,退出码为非零:模式不允许任何警告,允许最多N个警告,默认模式允许任意数量的警告。添加参数可获取机器可读的输出(适用于CI环境)。
--strict--max-warnings N--json