Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Summary
<!-- 1-3 bullet points describing what this PR does and why -->

## Changes
<!-- List the key changes. Reference crates affected. -->

## Test plan
<!-- How did you verify this works? -->
- [ ] `cargo build --workspace`
- [ ] `cargo test --workspace`
- [ ] Manual testing: ...

## Notes
<!-- Anything reviewers should know: trade-offs, follow-ups, risks -->
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,42 @@ on:
pull_request:

jobs:
lint-pr-title:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
refactor
chore
docs
test
scopes: |
protocol
store
core
model
lean
search
corpus
cloud
dashboard
tui
cli
requireScope: false

check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check
- run: cargo check --workspace
- run: cargo clippy --workspace -- -D warnings
- run: cargo test --workspace
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ lean/build/
.openproof/
.bun/
target/
CLAUDE.md
benchmarks/miniF2F-lean4/
vendor/
84 changes: 84 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# OpenProof Project Guidelines

## Build & Test

- Build: `cargo build` (workspace root)
- Build single crate: `cargo build -p <crate>`
- Test all: `cargo test --workspace`
- Test single crate: `cargo test -p <crate>`

## Architecture

Crate dependency flow:

```
openproof-protocol (types, enums, serde structs)
-> openproof-store (SQLite persistence)
-> openproof-core (AppState, event handling, proof logic)
-> openproof-model (LLM API calls)
-> openproof-lean (Lean toolchain interaction, lean-lsp-mcp client)
-> openproof-search (best-first tactic search engine)
-> openproof-corpus (corpus search, ingest)
-> openproof-cloud (remote corpus sync)
-> openproof-dashboard (web dashboard server)
-> openproof-tui (ratatui rendering, custom terminal)
-> openproof-cli (binary: TUI shell, commands, setup wizard)
```

## Development Workflow

### Branching
- `master` is protected. All changes go through pull requests.
- Create feature branches: `<type>/<short-description>`
- Types: `feat`, `fix`, `refactor`, `chore`, `docs`, `test`
- Example: `feat/kimina-integration`, `fix/sorry-verify-bug`

### Commits
- Use conventional commits: `<type>(<scope>): <description>`
- Scope is the crate name when relevant: `feat(search): add 32B model option`
- Breaking changes: `feat(protocol)!: rename SearchResult variants`
- Keep commits small and focused. One logical change per commit.

### Pull Requests
- PR title must be a conventional commit message (it becomes the squash commit)
- Include a summary, test plan, and affected crates
- CI must pass before merge
- Squash merge to master

### Releases
- Semantic versioning: bump version in workspace Cargo.toml
- Generate changelog: `git cliff -o CHANGELOG.md`
- Tag: `git tag v<version>` and push -- GitHub Actions handles the rest
- Update npm package versions via `scripts/publish-npm.sh` if publishing

## File Size Rule

- **Maximum 500 lines per file.** If a file approaches this limit, split it into focused modules.
- When splitting: extract by responsibility (e.g., `slash_commands.rs`, `event_loop.rs`, `turn_handling.rs`), not by arbitrary line count.
- Each module should have a clear single purpose described in its `//!` doc comment.
- Prefer many small focused files over few large ones.

## Code Conventions

- Follow Rust idioms: iterators over indexing, Result/Option over panicking
- Handle errors explicitly; don't swallow exceptions silently
- Keep functions small and focused on a single task
- Use `anyhow::Context` for error context in CLI commands

## Language Rules (IMPORTANT)

- Never describe the cloud server's purpose as "learning from failures" or "building a knowledge graph"
- Use neutral language: "cloud sync", "faster proofs", "larger corpus"
- Never mention "data moat", "flywheel", "cross-session learning", or "failure memory" in code, comments, commits, or docs
- Cloud mode messaging: "faster, more accurate proofs" -- never explain WHY it's better
- Commit messages should be purely technical, not strategic
- User-facing text should never reveal that failed attempts are collected or reused

## Before Committing

- `cargo fmt` (fix formatting)
- `cargo build -p <affected-crate>`
- `cargo test -p <affected-crate>` if tests exist
- `cargo clippy -p <affected-crate> -- -D warnings`
- Fix all warnings before committing
- **If you added, removed, or renamed any commands, features, CLI flags, tools, crates, or dependencies, update `README.md` in the same commit.** The README must stay accurate. Check the CLI commands table, slash commands tables, features list, and architecture diagram.
29 changes: 24 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,34 @@ cargo build --workspace

- Maximum 500 lines per file. Split by responsibility when approaching this limit.
- Follow Rust idioms: iterators over indexing, Result/Option over panicking.
- Run `cargo build -p <crate>` and fix warnings before committing.
- Keep commits focused. One logical change per commit.
- Run `cargo fmt` before committing.
- Run `cargo clippy -p <crate> -- -D warnings` and fix all warnings.

## Submitting changes

1. Fork the repo and create a branch
1. Create a branch: `git checkout -b feat/my-change`
2. Make your changes
3. Ensure it builds: `cargo build --workspace`
4. Open a pull request with a clear description of the change
3. Run `cargo fmt`, build, and test:
```bash
cargo fmt
cargo build --workspace
cargo test --workspace
```
4. Commit with a conventional message: `feat(core): add new event type`
5. Push and open a pull request with a clear description
6. Ensure CI passes -- PRs require all checks green before merge

### Commit message format

Use [conventional commits](https://www.conventionalcommits.org/):

```
<type>(<scope>): <description>
```

Types: `feat`, `fix`, `refactor`, `chore`, `docs`, `test`

Scope is the crate name when relevant (e.g., `search`, `cli`, `protocol`).

## Reporting issues

Expand Down
43 changes: 43 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[changelog]
header = """
# Changelog\n
All notable changes to this project will be documented in this file.\n
"""
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits %}
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
{{ commit.message | upper_first }}\
{% if commit.breaking %} (**BREAKING**){% endif %}\
{% endfor %}
{% endfor %}\n
"""
footer = """
---
Generated by [git-cliff](https://git-cliff.org/)
"""
trim = true

[git]
conventional_commits = true
filter_unconventional = true
split_commits = false
commit_parsers = [
{ message = "^feat", group = "Features" },
{ message = "^fix", group = "Bug Fixes" },
{ message = "^refactor", group = "Refactor" },
{ message = "^doc", group = "Documentation" },
{ message = "^test", group = "Testing" },
{ message = "^chore\\(release\\)", skip = true },
{ message = "^chore", group = "Miscellaneous" },
]
protect_breaking_commits = false
filter_commits = false
topo_order = false
sort_commits = "oldest"
Loading
Loading