Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion harness/pstack/claude-code/skills/statechart/SKILL.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pstack/skills/statechart/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Run against a `.lean` file pinned to Lean `v4.34.1`, or a standalone `.lean` fil
- `THEOREM` takes a full declaration name or a unique dotted suffix in `FILE.lean`. Unsafe declarations and non-theorem definitions exit 2.
- Point `--out` at a scratch folder outside the repo so charts stay out of your checkout. Without `--out`, output goes to `<short-theorem>-proof` beside `FILE.lean`.
- `--view FILE` applies a plain-English view module to `lemmas.mmd` and `proof.mmd`.
- `--tactics` shows raw Lean tactic lines inside `proof.mmd` boxes.
- `--tactics` shows raw Lean tactic lines inside `proof.mmd` boxes, including boxes with custom `branch()` text.
- `--config` applies only to TLA+ specs and exits 2 on `.lean` inputs.
- Toolchain lookup checks `LEAN_SYSROOT`, then `lean` and `lake` on `PATH` from the package root, then a pinned `mise` `http:lean` install for `v4.34.1`. Every resolved binary must report `v4.34.1`. Any other pin or version exits 2.
- Runs on a Lake package call `lake setup-file` in place. `lake setup-file` writes the gitignored `.lake/` folder and may create `lake-manifest.json` when the package has none. Copy the Lake package into a temporary folder first so `.lake/` stays out of your checkout.
Expand Down
4 changes: 4 additions & 0 deletions pstack/skills/statechart/scripts/lean/backends/proof-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ export function buildProofChart(input: {
lines.push("────────");
lines.push(clipLine(branchView.detail, 120));
}
if (tactics) {
const tLines = tacticLines(block, stepById);
if (tLines.length > 0) lines.push("────────", ...tLines);
}
if (badge !== undefined) lines.push(badge);
} else if (tactics) {
if (block.times > 1) {
Expand Down
12 changes: 12 additions & 0 deletions pstack/skills/statechart/scripts/test/lean-cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,18 @@ test("lean CLI supports --tactics and --view and exits 2 when a view tries to hi
assert.match(proofMmd, /title: "Proof by induction"/);
assert.match(proofMmd, /Every double is even/);
assert.match(proofMmd, /Start at zero/);
assert.doesNotMatch(proofMmd, /induction n with/);

const combinedOut = path.join(tmp, "combined");
const rCombined = runCli({
args: [cleanLean, "main", "--view", viewFile, "--tactics", "--out", combinedOut],
env: { STATECHART_LEAN_REPLAY: path.join(corpus, "Clean") },
});
assert.equal(rCombined.stderr, "");
assert.equal(rCombined.status, 0);
const combinedMmd = read(path.join(combinedOut, "proof.mmd"));
assert.match(combinedMmd, /Every double is even<br\/>────────<br\/>induction n with/);
assert.match(combinedMmd, /Start at zero/);

const badView = path.join(tmp, "bad-view.mjs");
fs.writeFileSync(
Expand Down