rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:lizyoko9/dsh-formula-verify
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A DeepSeek Harness skill for verifying paper formulas with executable checks instead of trusting chat prose.
It turns a formula into:
simplify(lhs - rhs) == 0),pytest file.The skill is model-invocable and user-invocable. It ships a self-bootstrapping Python CLI; the first run creates a private SymPy environment under $DSH_HOME/formula-verify/venv.
Install from the Plugins page with:
git+https://github.com/lizyoko9/dsh-formula-verify
Copy assets/ to ~/.dsh/skills/formula-verify/, renaming assets/formula-verify.md to SKILL.md and replacing {{RESOURCE_DIR}} with that directory's absolute path:
mkdir -p ~/.dsh/skills/formula-verify
cp -R assets/scripts assets/templates ~/.dsh/skills/formula-verify/
sed 's#{{RESOURCE_DIR}}#'"$HOME"'/.dsh/skills/formula-verify#g' \
assets/formula-verify.md > ~/.dsh/skills/formula-verify/SKILL.md
DSH's filesystem skill provider watches ~/.dsh/skills; the skill appears in the next catalog without a restart.
Ask the agent to verify a formula, or run the CLI directly:
python3 ~/.dsh/skills/formula-verify/scripts/formula_check.py check \
--lhs '\sin(x)^2 + \cos(x)^2' --rhs '1' --json
Commands:
| Command | Use |
|---|---|
check --lhs ... --rhs ... |
identity / equivalence |
check --expr ... |
check that an expression is zero |
diff --expr ... --var x |
derivative |
integrate --expr ... --var x [--lower a --upper b] |
indefinite/definite integral |
eval --expr ... --values 'x=2' --digits 30 |
high-precision evaluation |
simplify --expr ... |
canonical simplification |
latex --expr ... |
render to LaTeX |
test --path formulas/ |
run formula-card pytest in the private environment |
setup |
prewarm the private SymPy environment |
check returns:
verdict: "symbolic" — SymPy proved the difference is zero;verdict: "numeric" — samples agreed, but this is not a proof;verdict: "failed" — at least one check disagreed (exit code 1).For a paper, keep the check:
formulas/
eq13.md
eq13.py
test_eq13.py
Templates live in assets/templates/. Run:
python3 ~/.dsh/skills/formula-verify/scripts/formula_check.py test --path formulas/
test runs pytest inside the private environment, so the project does not need its own pytest or SymPy install.
The bundle also ships a Formula Lab panel in the right Sidebar:
git+https://github.com/lizyoko9/dsh-formula-verify, then reload DSH.+ and choose Formula Lab..tex, .pdf, .md, .mmd or .markdown file from the workspace, set the output directory, and press Convert & extract.MATHPIX_APP_ID / MATHPIX_APP_KEY) or an external command such as MinerU; direct PDF extraction is the lossy fallback.report.md or index.md to open it in the document preview. The panel stays mounted across tab switches; a preview opens as a normal tab in the same pane, never as a new split.The panel calls a local host route protected by a per-process token injected into the DSH index; the Python CLI is never exposed to other pages. If you already installed the plain filesystem skill, remove ~/.dsh/skills/formula-verify before installing the bundle so the same skill is not registered twice.
python3 ~/.dsh/skills/formula-verify/scripts/formula_check.py paper extract \
--input paper.tex --out formulas --json
python3 ~/.dsh/skills/formula-verify/scripts/formula_check.py paper report --dir formulas
TeX is the reliable source: equation, align, gather, multline, eqnarray, $$...$$ and \[...\] are extracted with section, source line, label and context.
PDF is a fallback: candidate lines are extracted with pypdf and marked needs-latex; convert them to LaTeX before trusting.
paper extract also accepts .md, .markdown and .mmd from Mathpix, MinerU or Nougat.
To convert a PDF first:
# Mathpix (requires MATHPIX_APP_ID / MATHPIX_APP_KEY; uploads the PDF)
python3 ~/.dsh/skills/formula-verify/scripts/formula_check.py paper convert \
--input paper.pdf --out paper.md --backend mathpix
# or an external converter such as MinerU / Nougat
python3 ~/.dsh/skills/formula-verify/scripts/formula_check.py paper convert \
--input paper.pdf --out paper.md --backend command \
--command 'mineru -p {input} -o {outdir}'
python3 ~/.dsh/skills/formula-verify/scripts/formula_check.py paper extract \
--input paper.md --out formulas
Mathpix uploads the PDF to api.mathpix.com; --backend command runs a shell command, so only use converters you trust.
The extractor writes eq-*.md cards (the formula is a display-math block), test_eq_*.py stubs, index.md, a section-grouped report.md and report.json.
Auto-probe statuses: verified-symbolic, numeric-evidence, probe-failed, definition, needs-modeling, unparsed, needs-latex.
Extraction is a draft: review, fill assumptions, replace the skipped pytest stub with the real model, then run test.
symbolic is strong evidence, not a formal proof.Integral(exp(-x**2), (x, 0, oo))).MIT.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。