Skip to content

Latest commit

 

History

History
79 lines (67 loc) · 4.54 KB

AGENTS.md

File metadata and controls

79 lines (67 loc) · 4.54 KB

ArkLib Agent Guide

Lean 4 formalization of SNARK-related theory, interactive oracle reductions, and proof systems. Start with README.md for project overview.

AGENTS.md is the canonical root guide. CLAUDE.md is a symlink to this file.

Fast Start

  1. For a convenient routine check, start with ./scripts/validate.sh. Before committing or pushing, run it in full; it enforces repository-wide non-sorry warnings and the Lean-native source-policy gate across ArkLib/ and ArkLibTest/. It also runs lake test and rejects all test warnings.
  2. On a cold clone, run lake exe cache get first.
  3. If you add, rename, or delete files under ArkLib/, git add new paths before validation.
  4. For docstring or docs work, ./scripts/validate.sh --docs is a convenient add-on check.
  5. Only build site or blueprint output when touching blueprint/ or home_page/: ./scripts/validate.sh --site.
  6. When filling or adding a sorry (or anything that must stay axiom-clean), run ./scripts/validate.sh --axioms; it first certifies the sweep tool against its fixture matrix (./scripts/test-axiomsweep.sh), then runs the regression gate. Refresh scripts/axiom_baseline.json with lake exe axiomsweep --update-baseline and commit the diff if the change is intentional. The baseline covers sorryAx debt only — native-compiler trust is never allowlistable.

Where To Work

  • ArkLib/Data/ - reusable math, coding theory, polynomials, and supporting definitions.
  • ArkLibTest/ - compile-time acceptance examples and regression tests; run lake test.
  • ArkLib/Interaction/ - typed interactions and dependent reduction foundations.
  • ArkLib/OracleReduction/ - legacy IOR abstractions and security theory.
  • ArkLib/ProofSystem/ - protocol formalizations built on the core.
  • ArkLib/Commitments/ - commitments and opening arguments.
  • ArkLib/ToMathlib/ - local extensions intended for upstreaming.
  • blueprint/src/ - deep design docs and bibliography.
  • scripts/ - repo utilities.

Guardrails

  • Lean defaults: autoImplicit = false; source files must remain at or below 1500 lines.
  • Source-policy exceptions and linter suppressions are not supported. Fix the source or improve the linter with a repository-wide, tested policy change.
  • ArkLib.lean is generated; do not hand-edit it.
  • Every file under ArkLib/ uses Lean's module system (issue #795): module, public import, @[expose] public section. A new file must follow the same shape — lake build rejects a classic file, since the generated root imports all of them as a module. ArkLibTest/ stays classic on purpose. The conventions and an error-to-fix table are in docs/wiki/module-system.md.
  • Edit source, not derived output such as .lake/, blueprint/web/, blueprint/print/, dependency_graphs/, or home_page/docs/.
  • Pre-existing sorry blocks exist in active formalizations; distinguish existing gaps from new regressions.
  • Prefer proof scripts that expose the key mathematical steps and compose predictably. Broad automation is welcome when it closes a well-scoped goal quickly and clearly; for a slow proof, profile first, then narrow imports, local hypotheses, simp sets, or automation rules, or move a recurring argument into its owner layer. Do not mechanically expand a short, stable terminal simp into a brittle simp only list.
  • If a PR changes commands, repo structure, generated outputs, or the blueprint/citation workflow, update the matching page in docs/wiki/ in the same PR.
  • Promote recurring agent learnings into docs/wiki/; do not let stable guidance live only in ephemeral notes.

Deeper Docs

Canonical Project Docs