Skip to content

Define autoformalizer REPL protocol specification#2

Open
faezs wants to merge 4 commits into
mainfrom
claude/autoformalizer-repl-protocol-0UbHX
Open

Define autoformalizer REPL protocol specification#2
faezs wants to merge 4 commits into
mainfrom
claude/autoformalizer-repl-protocol-0UbHX

Conversation

@faezs

@faezs faezs commented Dec 19, 2025

Copy link
Copy Markdown
Owner

No description provided.

This implements the Autoformalizer REPL Protocol Specification v1.0, which
enables session-typed interaction with an autoformalizer that completes
partial Agda formalizations guided by source documents.

Protocol components:
- Types: All protocol types including identifiers, domains, task/result,
  priority system, and session operations
- Source: Read-only operations on source documents (peek_section,
  grep_source, get_theorem, get_dependencies)
- Bijection: Source-to-formal correspondence tracking with coverage stats
- Session: Priority-based session type system ensuring deadlock freedom
- Handler: Delegates target operations to agda-mcp, manages state
- Protocol: Top-level API with example policies and trace recording

Key properties guaranteed by the protocol:
- Deadlock freedom (priority ordering)
- Session fidelity (linear types)
- Termination (bounded priority)

Includes comprehensive test suite covering type serialization, source
operations, bijection management, session invariants, and handler operations.
The flake.nix had packages.default pointing to 'example' which doesn't
exist. Fixed to point to 'agda-mcp' which is the actual package name.
- Add Parser import from Data.Aeson.Types for JSON parsing in Types.hs
- Fix Text/String type mismatch in Source.hs section ID generation
- Fix handler type in Session.hs executeOp from generic m to IO
- Disable tests and haddock in flake.nix for build configuration
Test suite for autoformalizer protocol against mathematical content:
- LaTeX source document (ModularSymbols and Continued Fractions)
- Agda module with postulates and holes for formalization
- Comprehensive test spec covering:
  - Source document parsing (LaTeX sections, math extraction)
  - Theorem and definition extraction
  - Bijection workflow (source-to-formal mapping)
  - Formalization tasks (fill-hole, section, postulate)
  - Coverage tracking
  - Session workflow and priority management

Based on themes from Marcolli-Manin paper on modular symbols
and noncommutative geometry.
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