Skip to content

mcp: add proof recording and tactic replay#167

Open
ckocaogullar wants to merge 3 commits intojrh13:masterfrom
ckocaogullar:mcp-server
Open

mcp: add proof recording and tactic replay#167
ckocaogullar wants to merge 3 commits intojrh13:masterfrom
ckocaogullar:mcp-server

Conversation

@ckocaogullar
Copy link
Copy Markdown

Adds proof recording to the MCP server so tactic sequences can be captured and replayed, enabling proof resumption after session crashes or context window exhaustion.

Motivation

During long interactive proofs, the LLM may run out of context window or the session may crash. Without recording, all proof progress is lost and tactics must be manually re-applied. This PR adds recording and replay so proofs can resume from where they left off.

Changes

Proof recording tools

New start_recording(path) and stop_recording() tools write tactic applications to a JSONL file. Recording hooks in eval, apply_tactic, apply_tactics, and backtrack capture the proof trace automatically. The eval hook uses paren-counting to extract tactics from e(TACTIC);; calls.

Recording format (one JSON object per line):

    {"action": "tactic", "tactic": "GEN_TAC", "total_goals": 1}
    {"action": "tactic", "tactic": "ARITH_TAC", "total_goals": 0}

Auto-recording via config

Set recording_dir in hol-mcp.toml or HOL_RECORDING_DIR env var to start recording automatically at server startup, without the LLM needing to call start_recording.

Tactic replay on startup

Configure replay_prefix (JSONL file) and optionally replay_init (ML file to #use first) to restore proof state on startup. The server replays the tactic sequence and seeds the recording so new tactics append to the prefix. Backtracks cleanly on any failure.

All recording operations are synchronized with the existing _lock to prevent races with concurrent tool calls.

Ceren Kocaogullar added 3 commits April 10, 2026 11:24
Record e(TACTIC) and b() calls from eval, apply_tactic, and backtrack
to a JSONL file. Includes paren-counting tactic extraction from eval
and automatic backtrack tracking.

New tools: start_recording(path), stop_recording().
If recording_dir is set in hol-mcp.toml or HOL_RECORDING_DIR env var,
recording starts automatically at server startup without needing the
LLM to call start_recording.
On startup, optionally #use an ML init file then replay a JSONL tactic
prefix to restore proof state. Configured via replay_init/replay_prefix
in hol-mcp.toml or HOL_REPLAY_INIT/HOL_REPLAY_PREFIX env vars. Seeds
the recording with replayed steps so new tactics append to the prefix.
Backtracks cleanly on any failure.
Copy link
Copy Markdown
Contributor

@sgmenda sgmenda left a comment

Choose a reason for hiding this comment

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

lgtm. could you add a test and update the SKILL.md?

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.

2 participants