V21: Add formalization variable explanation lint check#47
Merged
Conversation
- scripts/lint_wiki.py 新增 formalization_unexplained_vars 检查:从 $$...$$ 显示公式抽取单字母拉丁大写变量,验证正文是否给出物理含义解释 - 启发式覆盖列表项/表格行/动词解释/其中子句/等式定义等 7 类模式,并用负向预查排除 R(s,a,s') 这类函数调用形式 - 同步补齐 6 个被命中页面的变量含义:bellman-equation、control-lyapunov-function、ekf、hjb、lqr、tsid-formulation - make lint 0 errors,eval_search_quality 通过率 37/37 (100%) - V21 checklist P0 第二项已勾选
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.
Summary
Adds automated validation to ensure that formula variables in
wiki/formalizations/pages have corresponding physical meaning explanations in the document body. This is part of the V21 execution phase for improving semantic consistency in formalization documentation.Key Changes
New lint rule
formalization_unexplained_varsinscripts/lint_wiki.py:$$...$$) in formalization pagesR(s,a,s')) using negative lookahead(?![A-Za-z_(])- $X$: meaning)$X$: meaning)Documentation fixes in 6 formalization pages to satisfy the new rule:
bellman-equation.md: Clarifiedcontrol-lyapunov-function.md: Addedekf.md: Comprehensive matrix explanations (hjb.md: Added variable definitions for LQR special caselqr.md: Explainedtsid-formulation.md: DefinedUpdated V21 checklist to mark the "自动化背链一致性 Lint" item as complete
Implementation Details
The variable extraction uses regex
(?<![A-Za-z\\_^{])([A-Z])(?![A-Za-z_(])to identify candidate variables while avoiding:R(s,a,s')Pattern matching is case-insensitive and multiline-aware to handle various documentation styles. Variables are reported with their containing file path for easy remediation.
https://claude.ai/code/session_01EuF6h7rZ7irF6ACREZ8iXs