用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/lukemcqueen/hermes-cortex --skill cleanup-commit-regression-check命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | cleanup-commit-regression-check |
| version | 1.0.0 |
| category | devops |
| description | When scripts fail with NameError after a mass-edit commit. |
| platforms | ["linux","macos"] |
Load this when:
NameError: <name> is not defined after a
recent "fix"/"cleanup"/"adversarial findings" commitMass-edit commits that replace no-op lines (e.g. _ = None # expected — silently handled) with real handling (e.g. print(...)) routinely delete
structural lines adjacent to the edit — the very def line of the next
function, plus return statements. The result compiles (the orphaned body
becomes module-level or attaches to the previous function) but fails at
runtime with NameError or silently misbehaves.
Confirmed 2026-07-31: commit 84272894 ("fix: all high adversarial
findings") stripped def _resolve_var(...) and return env from two bus
scripts, def embed_skills(...) + conn.commit() + return count from a
cache script, def get_previous_good_sha(...) + return None from a
rollback script, and def _analyze_python(...) + return files + two
append lines from a project-map script. The bus forwarder cron crashed
every 2 minutes with NameError: name '_resolve_var' is not defined.
py_compile passes on these files (the damage is semantically wrong but
syntactically valid). The reliable check is an AST function-set diff
between the commit and its parent:
# For every .py file touched by the suspicious commit:
import ast, subprocess, pathlib
def funcs_of(text):
try:
tree = ast.parse(text)
except SyntaxError:
return set()
return {n.name for n in ast.walk(tree)
if isinstance(n, (ast.FunctionDef, ast.AsyncFunctionDef))}
parent = subprocess.run(['git','show',f'{COMMIT}^:{path}'],
capture_output=True, text=True).stdout
current = pathlib.Path(path).read_text()
deleted = funcs_of(parent) - funcs_of(current)
if deleted:
print(f"{path}: DELETED FUNCS: {sorted(deleted)}")
Single-function deletions are the smoking gun; wholesale file rewrites legitimately delete many functions and need manual review instead.
Re-runnable probe: scripts/find-deleted-funcs.py <commit> (AST function-set
diff, exit 1 on deletions).
Verifying a cleanup-commit fix surfaced a deeper deployment trap: the cron
runner executes from ~/.hermes/scripts/, but cortex-update deploys to
~/.hermes-cortex/scripts/. The symlink bridge is skipped when local-only
files exist, so deployed fixes silently don't reach the running cron, and
the doctor misses it (it checks the deploy dir, not the cron dir). Full
detail, detection commands, and the safe sync fix:
references/cron-path-vs-deploy-path.md.
A function whose def line was stripped leaves its docstring dangling.
Grep for callers of an undefined helper:
grep -rn "_resolve_var(" ops/scripts/ 2>/dev/null | grep -v "def _resolve_var"
# → files that CALL it without defining it
git show COMMIT^:path — extract the original structural linesdef <name>(...): + missing return statements +
any append lines that were collateralpython3 -m py_compile — execute the
script or import it so the module-level code exercises the restored
function~/.hermes/cron/output/<job>/)
that the next tick flips to silentpy_compile is NOT verification for this bug class — orphaned bodies
compile fine. Run the actual code path.used - defined scan flags every HOME, STATE_DIR, etc.
The function-set diff between commit and parent is the precise tool.# SOURCE: header — diff -q against the
repo always reports drift even when synced. Compare deployed vs the
deploy dir (~/.hermes-cortex/scripts/) or strip the header.