From a0dbdc95cd2337bcf57b3f9ad25b9a0dd68bd160 Mon Sep 17 00:00:00 2001 From: CTO Hermes Date: Sun, 31 May 2026 23:19:23 +0700 Subject: [PATCH] =?UTF-8?q?chore:=20prepare=20v0.1.3=20release=20=E2=80=94?= =?UTF-8?q?=20docs,=20website,=20release=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Bump version 0.1.2 → 0.1.3 in Cargo.toml - CHANGELOG: add v0.1.3 section, update comparison links - Add AGENT.md for AI-assisted development onboarding - Release notes: hybrid template (dynamic changelog + static platforms/quickstart) - Website: add /docs/changelog page with CHANGELOG.md rendering - Website: fix config page — correct priority order, update YAML schema example - Website: add Changelog to docs sidebar navigation - README: cora review → cora review --staged (explicit intent) --- .github/workflows/release.yml | 76 ++++------- AGENT.md | 122 ++++++++++++++++++ CHANGELOG.md | 5 +- Cargo.toml | 2 +- README.md | 2 +- website/src/app.d.ts | 6 + website/src/routes/docs/+layout.svelte | 1 + .../src/routes/docs/changelog/+page.svelte | 113 ++++++++++++++++ .../routes/docs/configuration/+page.svelte | 33 ++--- 9 files changed, 293 insertions(+), 67 deletions(-) create mode 100644 AGENT.md create mode 100644 website/src/routes/docs/changelog/+page.svelte diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 764a6ed1..7f18de57 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -129,55 +129,35 @@ jobs: id: version run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT - - name: Generate release notes + - name: Extract changelog for this version + id: changelog run: | - cat > release-notes.md << 'EOF' - ## What's New in VERSION - - ### 🚀 Features - - - **AI Code Review** — diff, branch comparison, full project scan - - **BYOK** — bring your own API key (OpenAI, Anthropic, Groq, Ollama, Z.AI) - - **Pre-commit Hooks** — `cora hook install` for automatic review on every commit - - **Incremental Scan** — `cora scan --incremental` with SHA256 content hash cache - - **SARIF Output** — upload findings to GitHub Code Scanning - - **Streaming** — real-time review output with `--stream` - - **Shell Completions** — `cora completion bash|zsh|fish|powershell` - - **5 Providers** — OpenAI, Anthropic, Groq, Ollama, Z.AI with auto-detection - - **Project Config** — `.cora.yaml` per-project configuration - - **MIT License** — fully open source - - ### 📦 Platforms - - | Platform | File | - |----------|------| - | Linux (x86_64) | `cora-x86_64-unknown-linux-gnu-VERSION.tar.gz` | - | Linux (ARM64) | `cora-aarch64-unknown-linux-gnu-VERSION.tar.gz` | - | macOS (Apple Silicon) | `cora-aarch64-apple-darwin-VERSION.tar.gz` | - | Windows (x86_64) | `cora-x86_64-pc-windows-msvc-VERSION.zip` | - - ### 🚀 Quick Start - - ```bash - # Install via cargo - cargo install cora - - # Or download binary (extracts as 'cora') - curl -fsSL https://github.com/ajianaz/cora-cli/releases/latest/download/cora-x86_64-unknown-linux-gnu-VERSION.tar.gz | tar xz - chmod +x cora - sudo mv cora /usr/local/bin/ - - # Init project - cora init - - # Review staged changes - CORA_API_KEY=your-key cora review --staged - ``` - - **Full changelog:** https://github.com/ajianaz/cora-cli/blob/main/CHANGELOG.md - - EOF - sed -i "s/VERSION/${{ steps.version.outputs.VERSION }}/g" release-notes.md + CHANGELOG_EXCERPT=$(sed -n '/^## \['"${{ steps.version.outputs.VERSION }}"'\]/,/^## \[/p' CHANGELOG.md | sed '$d' | tail -n +2) + { + printf '## What'\''s New in %s\n\n' "${{ steps.version.outputs.VERSION }}" + printf '%s\n\n' "$CHANGELOG_EXCERPT" + printf '### 📦 Platforms\n\n' + printf '| Platform | File |\n' + printf '|----------|------|\n' + printf '| Linux (x86_64) | `cora-x86_64-unknown-linux-gnu-%s.tar.gz` |\n' "${{ steps.version.outputs.VERSION }}" + printf '| Linux (ARM64) | `cora-aarch64-unknown-linux-gnu-%s.tar.gz` |\n' "${{ steps.version.outputs.VERSION }}" + printf '| macOS (Apple Silicon) | `cora-aarch64-apple-darwin-%s.tar.gz` |\n' "${{ steps.version.outputs.VERSION }}" + printf '| Windows (x86_64) | `cora-x86_64-pc-windows-msvc-%s.zip` |\n\n' "${{ steps.version.outputs.VERSION }}" + printf '### 🚀 Quick Start\n\n' + printf '```bash\n' + printf '# Install via cargo\n' + printf 'cargo install cora\n\n' + printf '# Or download binary (extracts as '\''cora'\'')\n' + printf 'curl -fsSL https://github.com/ajianaz/cora-cli/releases/latest/download/cora-x86_64-unknown-linux-gnu-%s.tar.gz | tar xz\n' "${{ steps.version.outputs.VERSION }}" + printf 'chmod +x cora\n' + printf 'sudo mv cora /usr/local/bin/\n\n' + printf '# Init project\n' + printf 'cora init\n\n' + printf '# Review staged changes\n' + printf 'CORA_API_KEY=your-key cora review --staged\n' + printf '```\n\n' + printf '**Full changelog:** https://github.com/ajianaz/cora-cli/blob/develop/CHANGELOG.md\n' + } > release-notes.md - name: Create GitHub Release uses: softprops/action-gh-release@v2 diff --git a/AGENT.md b/AGENT.md new file mode 100644 index 00000000..8e26ec9b --- /dev/null +++ b/AGENT.md @@ -0,0 +1,122 @@ +# AGENT.md — AI-Assisted Development Onboarding + +## Project Overview + +**cora-cli** is a Rust CLI tool for AI-powered code review. Bring Your Own Keys (BYOK) — +no managed API, no cloud service. Runs locally against diffs, scans, or branches. + +- **License:** MIT +- **Edition:** Rust 2024 (MSRV 1.85) +- **Repo:** `ajianaz/cora-cli` +- **Default branch:** `develop` + +## Build & Development Commands + +```bash +cargo build # Build (debug) +cargo build --release # Build (release) +cargo test # Run all 151 tests +cargo clippy # Lint +cargo fmt # Format check (use -- --check for CI) +``` + +## Code Structure (`src/`) + +``` +src/ +├── main.rs # Entry point, CLI argument parsing +├── commands/ # Subcommand handlers +│ ├── mod.rs +│ ├── review.rs # cora review (diff-based review) +│ ├── scan.rs # cora scan (full-file scan) +│ ├── config_cmd.rs # cora config (show/validate) +│ ├── auth.rs # cora auth (API key management) +│ ├── hook_cmd.rs # cora hook (pre-commit hook install/uninstall) +│ ├── init.rs # cora init (project scaffolding) +│ ├── upload.rs # cora upload (review upload) +│ ├── completion.rs # Shell completion generation +│ └── providers.rs # cora providers (list providers) +├── config/ +│ ├── mod.rs +│ ├── schema.rs # Config structs & defaults +│ ├── loader.rs # Config loading & priority chain +│ └── providers.rs # LLM provider definitions +├── engine/ +│ ├── mod.rs +│ ├── review.rs # Review orchestration logic +│ ├── scanner.rs # File scanning engine +│ ├── llm.rs # LLM API interaction +│ └── types.rs # Severity, finding, and result types +├── formatters/ # Output format implementations +│ ├── mod.rs +│ ├── pretty.rs # Human-readable terminal output +│ ├── compact.rs # Compact single-line output +│ ├── json_fmt.rs # JSON output +│ └── sarif.rs # SARIF format (CI integration) +├── git/ +│ ├── mod.rs +│ ├── diff.rs # Git diff parsing +│ └── files.rs # File listing & filtering +└── hook/ + ├── mod.rs + ├── install.rs # Hook install/uninstall logic + └── template.rs # Hook script templates +``` + +## Key Files + +| File | Purpose | +|---|---| +| `commands/config_cmd.rs` | Config subcommand — display, validate, path resolution | +| `config/loader.rs` | Config loading with full priority chain resolution | +| `config/schema.rs` | All config structs, defaults, serde annotations | +| `commands/init.rs` | Project scaffolding, `.cora.yaml` generation | + +## Testing + +```bash +cargo test # 151 tests total + # 129 unit tests + # 16 CLI integration tests + # 6 config tests +cargo test --no-verify # Skip pre-commit hooks (avoids timeout in hooks) +``` + +Use `--no-verify` when running tests through pre-commit hooks to prevent nested +hook execution and timeouts. + +## CI/CD + +Three GitHub Actions workflows in `.github/workflows/`: + +1. **ci.yml** — PR checks: build, test, clippy, fmt on push to `develop` and PRs +2. **release.yml** — Triggered by `v*` tags; builds for 4 platforms (Linux x86_64, + macOS x86_64, macOS ARM64, Windows x86_64), publishes to crates.io +3. **deploy-website.yml** — Deploys project website/docs + +## Config System + +### Priority Chain (highest to lowest) + +1. **CLI flags** (`--provider`, `--model`, etc.) +2. **Environment variables** (`CORA_PROVIDER`, `CORA_MODEL`, etc.) +3. **Project config** (`.cora.yaml` in repo root) +4. **Global config** (`~/.cora/config.yaml`) +5. **Built-in defaults** (defined in `config/schema.rs`) + +### Auth Separation + +API keys live in a separate `auth.toml` file (`~/.cora/auth.toml`), not in +`.cora.yaml`. This prevents accidental key leakage via committed config files. + +## Design Decisions + +- **Severity comparison uses `<=` not `>=`**: Severity filtering uses `<=` because + the ordinal maps info=1, warning=2, error=3 — so `--severity warning` means + "include warning and below (info)", not "warning and above (error)". This is + intentional; the mapping is defined in `engine/types.rs`. +- **TOML → YAML migration**: Config format migrated from TOML to YAML for better + readability and broader tooling support. The loader only reads YAML now. +- **Auth/config separation**: API keys are deliberately stored in `auth.toml` + rather than the main config to allow `.cora.yaml` to be safely committed to + repositories without exposing secrets. diff --git a/CHANGELOG.md b/CHANGELOG.md index e1aabf2f..bbfe9bff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.3] - 2026-06-01 + ### Added - `cora config set --global` — write config to `~/.cora/config.yaml` instead of project `.cora.yaml` @@ -86,7 +88,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Cross-platform** — Linux (x86_64, ARM64), macOS (Apple Silicon), Windows (x86_64) - **MIT License** — fully open source -[Unreleased]: https://github.com/ajianaz/cora-cli/compare/v0.1.2...develop +[Unreleased]: https://github.com/ajianaz/cora-cli/compare/v0.1.3...develop +[0.1.3]: https://github.com/ajianaz/cora-cli/compare/v0.1.2...v0.1.3 [0.1.2]: https://github.com/ajianaz/cora-cli/compare/v0.1.1...v0.1.2 [0.1.1]: https://github.com/ajianaz/cora-cli/compare/v0.1.0...v0.1.1 [0.1.0]: https://github.com/ajianaz/cora-cli/releases/tag/v0.1.0 diff --git a/Cargo.toml b/Cargo.toml index c83f0a67..389576b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cora-cli" -version = "0.1.2" +version = "0.1.3" edition = "2024" description = "CLI-first AI code review — BYOK, diff/scan/branch, pre-commit hooks" license = "MIT" diff --git a/README.md b/README.md index 454eaad6..f2c76aca 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ cora init ### 3. Review Staged Changes ```bash -cora review +cora review --staged ``` ### 4. Review the Last Commit diff --git a/website/src/app.d.ts b/website/src/app.d.ts index da08e6da..7d72385c 100644 --- a/website/src/app.d.ts +++ b/website/src/app.d.ts @@ -10,4 +10,10 @@ declare global { } } +// Allow ?raw imports for markdown files +declare module '*?raw' { + const content: string; + export default content; +} + export {}; diff --git a/website/src/routes/docs/+layout.svelte b/website/src/routes/docs/+layout.svelte index f7b66980..6448fd74 100644 --- a/website/src/routes/docs/+layout.svelte +++ b/website/src/routes/docs/+layout.svelte @@ -11,6 +11,7 @@ { href: '/docs/providers', label: 'Providers' }, { href: '/docs/examples', label: 'Examples' }, { href: '/docs/cli-reference', label: 'CLI Reference' }, + { href: '/docs/changelog', label: 'Changelog' }, ]; diff --git a/website/src/routes/docs/changelog/+page.svelte b/website/src/routes/docs/changelog/+page.svelte new file mode 100644 index 00000000..7fc52d13 --- /dev/null +++ b/website/src/routes/docs/changelog/+page.svelte @@ -0,0 +1,113 @@ + + + + Changelog — cora docs + + + +
+

Changelog

+

+ For the full changelog, see the + repository. +

+ + {#each releases as release, i} +
+

+ {#if release.version === 'Unreleased'} + + Unreleased + + {:else} + + v{release.version} + + {/if} + {release.date} +

+ + {#each release.categories as category} +
+

{category.type}

+
    + {#each category.items as item} +
  • {@html item}
  • + {/each} +
+
+ {/each} +
+ {/each} +
diff --git a/website/src/routes/docs/configuration/+page.svelte b/website/src/routes/docs/configuration/+page.svelte index 981b53ee..98fe0961 100644 --- a/website/src/routes/docs/configuration/+page.svelte +++ b/website/src/routes/docs/configuration/+page.svelte @@ -37,9 +37,9 @@
{#each [ { num: '1', label: 'CLI flags', desc: '--provider, --model, --base-url, etc.', accent: true }, - { num: '2', label: '.cora.yaml', desc: 'Project root config file', accent: false }, - { num: '3', label: '~/.cora/config.toml', desc: 'User-level config', accent: false }, - { num: '4', label: 'Environment variables', desc: 'CORA_API_KEY, CORA_PROVIDER, etc.', accent: false }, + { num: '2', label: 'Environment variables', desc: 'CORA_API_KEY, CORA_PROVIDER, CORA_MODEL, etc.', accent: false }, + { num: '3', label: '.cora.yaml', desc: 'Project root config file', accent: false }, + { num: '4', label: '~/.cora/config.yaml', desc: 'Global config (optional)', accent: false }, { num: '5', label: 'Built-in defaults', desc: 'Sensible defaults for all settings', accent: false } ] as item}
@@ -69,21 +69,22 @@
# cora project config
-review:
-  severity: warning          # minimum severity: info, minor, major, critical
-  max_issues: 20             # max issues to report
-  focus: security,performance  # focus areas
+provider:
+  provider: openai
+  model: gpt-4o
+  base_url: https://api.openai.com/v1
 
-ignore:
-  - "vendor/**"
-  - "*.min.js"
-  - "migrations/**"
+focus: security, performance, bugs
+
+hook:
+  mode: warn
+  min_severity: major
+  max_diff_size: 51200
 
-providers:
-  openai:
-    model: gpt-4o
-  anthropic:
-    model: claude-sonnet-4-20250514
+ignore: + files: + - "vendor/**" + - "*.min.js"