mcpField
M
maintain-formal-verification-skill

maintain-formal-verification-skill

github.com/yeachan-heo其他40.7k8 次安装今天更新
代码仓库

关于 maintain-formal-verification-skill

Maintain Formal Verification Skill 用于将现有形式化验证项目 skill 与其建模代码重新同步。它检查引用和假设,按需更新模型并重跑验证器,同时记录同步结果,不弱化验证属性。

主要功能

  1. 01审查代码引用和假设
  2. 02检测模型偏移
  3. 03按代码更新步骤和假设
  4. 04重新运行验证工具
  5. 05通过 ledger 记录结果

适用场景

  1. 01协议或不变量改变后更新模型
  2. 02重构后检查代码引用
  3. 03针对近期代码重新验证既有通过结果
  4. 04判断是否需要重新生成模型

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/yeachan-heo/oh-my-claudecode --skill maintain-formal-verification-skill

安装后在 Claude Code 中输入/maintain-formal-verification-skill确认已加载。

README 原文English

来自项目 README

README 暂无中文译文,以下为英文原文;中文介绍见上方。

Maintain Formal Verification Skill

A formal spec that cites lines that no longer exist is stale, and a stale spec's green is worthless. This skill re-syncs an existing verify-formal-* project skill (created by create-formal-verification-skill) to the code it models.

When to use

  • the modeled protocol, arithmetic, or invariant changed shape
  • cited file:line anchors drifted after refactors
  • before trusting a green run that predates recent changes to the covered code

Workflow

  1. Inventory the model's bindings: every cited file:line, every named function, every assumption on the skill's assumption list.
  2. Re-check each binding against current code: does the cited line still contain the modeled step? Does the assumption still hold (pid reuse, atomicity, integer width, timing)? A binding that no longer matches is drift; record it, do not silently absorb it.
  3. Update the model where drift is real: move citations, adjust steps to the new protocol shape, and rewrite the assumption list to match reality. The property itself does not weaken — if the new code violates the property, that is a finding to report, not a model edit.
  4. Rerun the tool (TLC/apalache, lake build, cargo kani) and capture real output.
  5. Update the project skill in place: new citations, new assumption list, same run command — and record the resync through the ledger's locked writer (appendLedgerEntry and defaultLedgerPath from the installed package's dist/features/verification-ledger/index.js; babysit's ledger step demonstrates the exact invocation — never append raw rows): formally-verified with the rerun command as evidence only when the rerun is green; a counterexample during resync records verifier-failed with the counterexample as evidence and is reported before any model change.

Rules

  • A counterexample found during resync is reported before any model change; verify whether the code shares the flaw.
  • Never mark a resync done with an unrerun tool; the rerun is the resync.
  • If more than half the bindings drifted, say so — the model may have been modeling an implementation that no longer exists, and regeneration via create-formal-verification-skill is the honest path.

评论

支持 Markdown