Skip to content

vscode: prove a file and manage proof jobs from the editor - #519

Merged
0xGeorgii merged 6 commits into
mainfrom
feat/vscode-prover
Oct 9, 2026
Merged

0xGeorgii merged 6 commits into
mainfrom
feat/vscode-prover

Conversation

@0xGeorgii

@0xGeorgii 0xGeorgii commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Why

The journey from Inference source to a reviewed proof result should work from VS Code: compile locally, submit, then watch, review and manage proof jobs. Until now that took a terminal, the web portal, and a separate unpublished extension in the proof server's repository.

What users get

  • Inference: Prove This File (editor title and Explorer menus on .inf, or the command palette):
    1. Finds the infc that infs build will spawn (from the doctor's Resolved infc).
    2. Compares its --commit-hash and --abi-version with the compiler the proof server accepts (GET /api/v1/meta → acceptedToolchain). A mismatch is refused before anything is uploaded, with an offer to install the accepted release when there is one.
    3. Runs infs build <file>.inf -v in the file's folder, with INFC_PATH pinned to the checked binary. The output is out/<file>.v.
    4. Checks the .v for proof holes and the upload limit, then submits it under the portal's content-derived idempotency key.
    5. Opens the job panel and selects the job in the jobs view.
  • Inference: Submit Rocq File for Proof: submits an existing .v.
  • Proof Jobs view in the Inference sidebar: newest first, status filter, "Load more…", and per-job Cancel, Run Again, Delete, Copy ID, Compare and Open Certificate.
  • Job panel, following the run live over SSE (with a polling fallback):
    • phase ribbon, obligations (including refuted), time budget and deadline;
    • the prover's activity as readable lines scoped to theorem and attempt (previously truncated JSON);
    • the independent verifier's verdict and kernel-reported assumptions, with the existing fail-closed claim banners;
    • artifacts that open read-only after a SHA-256 check, a diff of the completed proof against its input, and Open certificate in portal. The portal keeps the single implementation of the certificate's claim rules.
  • Setup: an API key per server, stored in secret storage and checked against /api/v1/me when set. A Proof Server group appears in the Configuration view. The new setting inference.prover.serverUrl must be HTTPS; plain HTTP is accepted only for localhost. Before the first upload to a server, the extension shows a notice once.

Where the code comes from

  • The API client, SSE client, detail renderer and their 85 tests move here from Inferara/inference-ai-prover/editors/vscode. That extension was never published and will be retired once this ships.
  • New calls: meta, me, paging/filtering, delete, artifact listing, and a 64 MiB artifact cap.
  • The prove flow (src/prover/proveFlow.ts) injects every effect, so each gate is unit-tested.
  • The server side is Inferara/inference-ai-prover#267, which adds acceptedToolchain to /meta. Against an older server, Prove asks before compiling unchecked.

Release

  • New .github/workflows/vscode_extension_publish.yml publishes from a vscode-v<version> tag. It builds through vscode_extension.yml, which is now also workflow_call and uploads the checked .vsix, so the published bytes are the bytes those checks passed.
  • It publishes to the Marketplace (VSCE_PAT) and Open VSX (OVSX_PAT) from the marketplace environment, then attaches the .vsix to a GitHub release.
  • Maintainer setup before the first release:
    • create the marketplace environment with required reviewers;
    • add VSCE_PAT (Marketplace > Manage for the inference-lang publisher);
    • claim the inference-lang namespace on Open VSX and add OVSX_PAT;
    • bump version in package.json.
  • The packaged file list is unchanged: the same 11 files, with a production bundle.

Risk and limits

  • Nothing changes for users who never set a key: no proof-server traffic, and the toolchain features are untouched.
  • Until the proof server accepts a released compiler, "Prove This File" correctly refuses a release infc. The server currently pins d71a9c3e (ABI 1.3), and adopting v0.0.6 is planned after the TAITRONICS booth. Submitting a .v works today.
  • License: the moved client code was Inferara-owned and is now GPL-3.0 with the rest of the extension.

Verification

All of these ran in a node:24 container.

  • npx tsc --noEmit -p .: clean.
  • npm test: 433 passed: 298 existing, 79 moved (the moved suite's 6 manifest tests are replaced by new ones for this package), and 56 new. The new tests cover:
    • the identity check;
    • preflight, and an idempotency key matching an independently computed reference;
    • server-URL rules;
    • list paging and merging;
    • spawn timeout and abort;
    • the API endpoints;
    • agent-activity formatting;
    • detail actions and the phase ribbon;
    • every prove-flow gate, plus an end-to-end run with fake infs/infc scripts and a local HTTP server;
    • manifest wiring, which checks each job action's when clause against the context value for all 15 statuses. That test caught a /\.proof/ regex matching every job.
  • npm run "test syntax": 93 passed.
  • npm run package: the 11 expected files and no source map.
  • rhysd/actionlint: clean on both workflows.
  • Real toolchain: in a Linux arm64 container with the accepted infs/infc (d71a9c3e) against a stub server, the flow resolved infc through infs doctor, matched it, built fixtures/aerospace/telemetry_limit.inf and uploaded a .v whose SHA-256 is 7796bcb9…. That is exactly the canonical output recorded in the prover's contracts/infc.lock.json. The same binary was refused against a v0.0.6/ABI 1.8 server.
  • Not yet done: a manual pass in the Extension Development Host against the hosted server (QA_GUIDE §14). It needs a service key.

🤖 Generated with Claude Code

RetriggerConfidence Score: 5/5

The change since the last review appears safe to merge.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Source["Inference file"] --> Check["Check compiler identity"]
    Check --> Build["Compile locally"]
    Build --> Upload["Check and upload Rocq file"]
    Rocq["Existing Rocq file"] --> Upload
    Upload --> Job["Proof job"]
    Job --> Watch["Follow events and status"]
    Watch --> Review["Review verdict and artifacts"]
    Review --> Again["Run again with original filename"]
    Again --> Job
Loading

Reviews (5) · Last reviewed commit: "vscode: keep the job's filename when run..." · Reviewed by Greptile

0xGeorgii and others added 2 commits October 7, 2026 18:52
"Inference: Prove This File" compiles the open .inf in proof mode with the
installed toolchain and submits the generated .v to the Inference proof
server. Before compiling it finds the infc that `infs build` will spawn (the
doctor's "Resolved infc"), compares its --commit-hash and --abi-version with
the compiler the server accepts (GET /api/v1/meta, acceptedToolchain), and
refuses a mismatch before anything is uploaded, offering to install the
accepted release when it is one. The build runs in the file's folder with
INFC_PATH pinned to the checked binary; the generated .v is checked for
proof holes and the upload limit and submitted under a content-derived
idempotency key (the portal's), so the same content returns the same job.

A Proof Jobs view lists the account's jobs with a status filter and older
pages. A job panel follows a run live over SSE: a phase ribbon, obligations,
the prover's activity as readable lines, the independent verifier's verdict
and kernel-reported assumptions, and the artifacts, which open read-only
after a SHA-256 check. A completed proof can be diffed against its input,
and the exportable certificate opens in the portal, which keeps one
implementation of the claim rules. Jobs can be cancelled, run again and
deleted.

The API client, SSE client, detail renderer and their 85 tests move here
from the proof server's repository (Inferara/inference-ai-prover,
editors/vscode), extended with meta/me/paging/delete/artifact calls and a
64 MiB artifact cap. API keys live in secret storage, per server, checked
against /api/v1/me when set. inference.prover.serverUrl selects the server:
HTTPS, or plain HTTP on localhost only.

Every effect in the prove flow is injected, so each gate is unit-tested; an
end-to-end test runs it with fake infs/infc scripts against a local HTTP
server. The README's privacy section now says what is uploaded and to whom.

A publish workflow releases the extension to the VS Code Marketplace and
Open VSX from a vscode-v<version> tag. It builds through the existing
extension workflow (now also reusable, and uploading the checked .vsix), so
the published bytes are the ones those checks passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread editors/vscode/src/prover/api.ts
Comment thread editors/vscode/src/utils/spawn.ts
Comment thread editors/vscode/src/prover/proveFlow.ts Outdated
Comment thread editors/vscode/src/prover/index.ts
Comment thread editors/vscode/src/prover/jobDetailView.ts
- An upload no longer follows a redirect to another origin. Credentials
  were already dropped there, but the body, the whole Rocq file, was sent
  on; any request with a body now refuses a cross-origin redirect.
- Cancelling or timing out a build stops the whole process tree. infs
  spawns infc, which kept the output pipes open, so the wait for the
  build could hang after infs alone was killed. The build runs in its own
  process group on POSIX (taskkill /T on Windows).
- A cancel that arrives after the build no longer uploads: the prove flow
  checks it right before submitting.
- Changing the proof server or the key resets the jobs list and closes
  open job panels, and a reply from the previous server is dropped rather
  than merged into the new list.
- A finished job's panel reads the events past its cursor, so a panel
  that was polling when the job ended still shows the final events, and
  a panel opened afterwards still gets the whole history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread editors/vscode/src/prover/jobsTree.ts
0xGeorgii and others added 3 commits October 7, 2026 21:25
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The portal routes by hash, so /job/<id>/certificate loaded the portal's
fallback route (the jobs list) instead of the certificate. Links now use
/#/job/<id>/certificate, which the portal's login redirect also keeps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server stores every input artifact as input.v, so a resubmitted job was
listed as input.v instead of the file it was first submitted as.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@0xGeorgii
0xGeorgii merged commit b50a17b into main Oct 9, 2026
15 checks passed
0xGeorgii added a commit that referenced this pull request Oct 9, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@0xGeorgii
0xGeorgii deleted the feat/vscode-prover branch October 9, 2026 15:29
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