跳到正文
lauren· @poteto · X·· 4 小时前AI 评分53
AI 导读

Grok Bot 工程负责人 Lauren Tan 分享一种找 bug 的工作流:先让 Agent 画出用户流程的状态图,再用 pstack 的 /create-formal-verification-skill 生成的技能通过 TLA+ 等方式做验证。她称这样既能更好理解代码和用户流程,也能修复用户原本会看到的问题;被引用的 pstack v0.15.27 更新介绍称该元技能可按需创建形式化验证套件,作者实验中已用它发现多个 bug。

正文 · 原文

there's something really cool about asking your agent to draw a statechart (hypothetical example in this image), then using the /create-formal-verification-skill you made with pstack to find bugs through something like TLA+. you can both understand your code better and how the user flow should work, and fix issues users would otherwise see

引用lauren@poteto
pstack v0.15.27 ships with a new skill /create-formal-verification-skill! it's still in beta, and similar to /create-verification-skill, this is a meta-skill that creates a new skill and formal verification suite based on the characteristics you want to verify. for example, you may want to model state machines and systems with concurrency using TLA+, or use kani in rust to check for undefined behavior. if you're new to formal verification, think of it as mathematically proving properties and invariants (something that must always be true) or "laws" of your system. usually, this means modeling your programs in a separate language like with TLA+ and then running the solver on that spec. newer approaches like with kani and @bendlang take a different approach where there is no separate language: you write kani in rust, and bend in bend (it's also a programming language, and the proofs are written as laws and expressed in its type system). historically formal verification never reached mainstream status because of the difficulty in modeling and writing proofs. it's quite difficult to model your business requirements and keep them in sync! but i expect that we will see more innovation in formal verification in the future as being able to formally verifiy that the code does what you intended gives your agents superpowers in writing correct software. in the meantime though, i've been experimenting with modeling our code with TLA+ and have already found several bugs with the skill created by /create-formal-verification-skill. try it out and let me know how it goes!
在 X 查看被引用的帖子

来源:lauren · x.com