Skip to content

Add Lean Squad formal verification agentic workflow#7782

Merged
Evangelink merged 6 commits intomainfrom
agentic/lean-squad
Apr 23, 2026
Merged

Add Lean Squad formal verification agentic workflow#7782
Evangelink merged 6 commits intomainfrom
agentic/lean-squad

Conversation

@Evangelink
Copy link
Copy Markdown
Member

Lean Squad Formal Verification Agentic Workflow

This PR adds the Lean Squad workflow for progressive Lean 4 formal verification of the codebase.

Workflow Added

File Trigger Purpose
lean-squad.md Every 8h + /lean-squad Progressive Lean 4 formal verification

How It Works

The Lean Squad is a multi-phase automated agent that progressively applies formal verification:

  1. Research & Target Identification — Survey codebase for FV-amenable targets
  2. Informal Spec Extraction — Extract design intentions and informal contracts
  3. Formal Spec Writing — Write Lean 4 type signatures and property statements
  4. Implementation Extraction — Translate code to a Lean-verifiable functional model
  5. Proof Assistance — Attempt proofs, find counterexamples, report bugs
  6. Correspondence Review — Document how Lean models map to C# source
  7. Proof Utility Critique — Assess value and coverage of proved properties
  8. Correspondence Validation — Executable tests comparing source vs Lean model
  9. CI Automation — Set up CI workflows for proof verification
  10. Project Report — Maintain REPORT.md with mermaid diagrams

Key Features

  • Weighted task selection: Tasks are selected based on current FV progress state
  • Hard toolchain requirement: No .lean files submitted without successful lake build
  • On-demand mode: /lean-squad <instructions> for specific tasks
  • Persistent memory across runs for continuity
  • Bug finding is success: Counterexamples are valuable outcomes

Safety

  • Never submits unverified proofs
  • Explicitly documents all model approximations
  • One target per task per run for focused progress

Part of the agentic workflows setup series.

Copilot AI review requested due to automatic review settings April 23, 2026 12:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new gh-aw agentic workflow (“Lean Squad”) intended to drive progressive Lean 4 formal verification efforts over time (scheduled + on-demand).

Changes:

  • Introduces .github/workflows/lean-squad.md workflow source defining phases/tasks, repo-memory usage, and safe-output limits.
  • Adds a pre-step that inspects repo state and writes /tmp/gh-aw/task_selection.json to guide phase-weighted task selection.
Show a summary per file
File Description
.github/workflows/lean-squad.md New Lean Squad agentic workflow definition (frontmatter + prompt/instructions + state-based task selection step).

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 4

Comment thread .github/workflows/lean-squad.md
Comment thread .github/workflows/lean-squad.md
Comment thread .github/workflows/lean-squad.md Outdated
Comment thread .github/workflows/lean-squad.md
Add the Lean Squad workflow for progressive Lean 4 formal verification:
- Multi-phase weighted task selection (research, specs, proofs, CI, reporting)
- On-demand via /lean-squad command
- Automatic Lean toolchain installation and verification
- Hard requirement: no .lean files submitted without successful lake build
@Evangelink Evangelink marked this pull request as ready for review April 23, 2026 12:38
Copilot AI review requested due to automatic review settings April 23, 2026 12:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 5

Comment thread .github/workflows/lean-squad.md Outdated
Comment thread .github/workflows/lean-squad.md Outdated
Comment thread .github/workflows/lean-squad.md Outdated
Comment thread .github/workflows/lean-squad.md
Comment thread .github/workflows/lean-squad.md Outdated
@Evangelink Evangelink enabled auto-merge April 23, 2026 13:00
Copilot AI review requested due to automatic review settings April 23, 2026 13:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 3/4 changed files
  • Comments generated: 3

Comment thread .github/workflows/lean-squad.md
Comment thread .github/workflows/lean-squad.md
Comment thread .github/workflows/lean-squad.md Outdated
GitHub Copilot added 3 commits April 23, 2026 16:12
# Conflicts:
#	.github/aw/actions-lock.json
#	.github/workflows/lean-squad.lock.yml
Copilot AI review requested due to automatic review settings April 23, 2026 14:20
@Evangelink Evangelink merged commit 0b98a01 into main Apr 23, 2026
4 checks passed
@Evangelink Evangelink deleted the agentic/lean-squad branch April 23, 2026 14:21
@Evangelink Evangelink review requested due to automatic review settings April 23, 2026 14:42
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.

3 participants