Skip to content

Prepare proof-pilot for crates.io: kernel-arbitrated LLM proof completion for Lean 4#18

Merged
LucidSamuel merged 1 commit into
mainfrom
feat/proof-pilot-crate
Jul 21, 2026
Merged

Prepare proof-pilot for crates.io: kernel-arbitrated LLM proof completion for Lean 4#18
LucidSamuel merged 1 commit into
mainfrom
feat/proof-pilot-crate

Conversation

@LucidSamuel

Copy link
Copy Markdown
Owner

Extracts proof-pilot as a standalone, publishable crate — "kernel-arbitrated LLM proof completion for Lean 4, with anti-cheat and deterministic replay" — serving every Lean user; every non-ZK adopter discovers scribe.

Decoupling

  • notes.rs: guidance is now domain-neutral. New NotesStyle lets an embedder attach per-pattern worked-example citations + a reference-library line (render_notes_styled); render_notes stays generic. scribe-cli supplies the lean/ZkGadgets citations, so scribe's NOTES.md output is unchanged; the bare proof-pilot binary now emits generic guidance.
  • lsp_feedback.rs: the Python LSP bridge is embedded via include_str! and materialized to a temp path when no repo-local copy exists (PROOF_PILOT_LSP_SERVER override available) — --lsp works from the published crate, not just a repo checkout.
  • The patcher needed no decoupling: its statement protection and trailing-command boundary detection were already generic (#-prefixed top-level commands, not #audit_axioms specifically).

Packaging

  • Full crates.io metadata (description, repository, docs.rs link, keywords, categories, readme), crate-level rustdoc with a library quick-start, and a README pitched at general Lean users.
  • examples/prove_sum_comm.rs: a plain arithmetic lemma through the loop — the non-ZK demonstration.
  • cargo package -p proof-pilot builds standalone (verify build green); package list is self-contained.
  • Ships with --samples-per-iter in the 0.1 API per the sequencing decision (scribe judge (SOUND / UNSOUND / UNDETERMINED) + best-of-n sampling #17 landed first).

Publish checklist (manual, after merge)

  1. cargo login (crates.io token)
  2. cargo publish -p proof-pilot --dry-run
  3. cargo publish -p proof-pilot

The name proof-pilot is unclaimed on crates.io (verified against the API). Publishing is deliberately not automated — it is an outward-facing, irreversible action.

proof-pilot is domain-agnostic — a kernel-arbitrated LLM proof-completion loop
for Lean 4 with anti-cheat and deterministic replay — and every non-ZK Lean
user who adopts it discovers scribe. This decouples the scribe-isms and makes
the package self-contained:

- notes.rs: guidance is now domain-neutral. NotesStyle lets an embedder attach
  per-pattern worked-example citations + a reference-library line;
  render_notes_styled carries them, render_notes stays generic. scribe-cli
  supplies the lean/ZkGadgets citations, so scribe's NOTES.md is unchanged;
  the proof-pilot binary emits generic guidance.
- lsp_feedback.rs: the Python LSP bridge is embedded via include_str! and
  materialized to a temp path when no repo-local copy exists, with a
  PROOF_PILOT_LSP_SERVER override — LSP mode works from the published crate,
  not just the repo checkout.
- Cargo.toml: full crates.io metadata (description, repository, docs.rs,
  keywords, categories, readme). Crate-level rustdoc with a quick-start;
  crates/proof-pilot/README.md pitched at general Lean users.
- examples/prove_sum_comm.rs: a plain arithmetic lemma through the loop —
  the non-ZK demonstration.

cargo package -p proof-pilot builds standalone (verify build green). The
crate name is unclaimed on crates.io. Publishing is deliberately left as a
manual step.
@LucidSamuel
LucidSamuel merged commit e2ad750 into main Jul 21, 2026
5 checks passed
@LucidSamuel
LucidSamuel deleted the feat/proof-pilot-crate branch July 21, 2026 11:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2b81f90b84

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

decides.

```sh
proof-pilot MyProject/Theorem.lean --lake-dir MyProject --max-iters 10

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Bundle a default prompt for the standalone CLI

When users follow this new crates.io quick start from an installed proof-pilot, the binary still defaults to reading prompts/lean-prover.md and exits if that file is missing (src/main.rs defines that repo-relative default and aborts on read failure). That prompt lives outside crates/proof-pilot, so the documented standalone command fails before constructing the backend unless the caller supplies their own --system-prompt, which blocks the publishable-package path this change is adding.

Useful? React with 👍 / 👎.

}
}
Err("could not find scripts/lsp-server.py — run from the repo root".to_string())
let dir = std::env::temp_dir().join("proof-pilot");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use a user-private temp location for the embedded LSP bridge

When the installed crate falls back to the embedded script, this writes to std::env::temp_dir()/proof-pilot, which is commonly a shared /tmp location on Unix rather than the per-user path the comment describes. If another account or a previous root-run has already created /tmp/proof-pilot without write permission, create_dir_all can succeed but the subsequent script write fails, so --lsp aborts even though the bridge is bundled; use a user-specific or securely-created temp path instead.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant