Repository navigation
chore: quality gates — CI, coverage thresholds, UI tests, static analysis, docs #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
401dce1
ci: GitHub Actions pipeline + Dependabot
hutusi ebf45a1
test: per-file coverage thresholds via bunfig
hutusi bcb53e7
chore: tighten static analysis — strict tsc flags, biome error level,…
hutusi f33fdbe
refactor(cli): extract pure parseCliArgs from the entrypoint
hutusi 5244218
test(cli): full-stack Ink UI tests via ink-testing-library
hutusi 420ce66
test: PTY smoke and e2e scripts for the TUI
hutusi 9d0d3fc
test: close coverage gaps, ratchet per-file threshold to 0.80
hutusi 579ecc9
docs: contributor guide, wire-protocol reference, changelog
hutusi cc8e9db
fix(ci): bundle react-devtools-core into the compiled binary
hutusi 8e370d2
fix(ci): eof diagnostics in expect scripts + headless sanity step
hutusi 0a5477d
fix(ci): block scalar for the sanity step
hutusi e68f19a
fix(ci): ASCII-only expect patterns for the PTY scripts
hutusi ea385cd
fix(ci): hide CI env vars from the PTY-spawned TUI
hutusi 9bfde8e
fix(ci): give the expect PTY an explicit geometry
hutusi 4538c60
fix: address CodeRabbit review findings
hutusi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: npm | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| groups: | ||
| ai-sdk: | ||
| patterns: | ||
| - "ai" | ||
| - "@ai-sdk/*" | ||
| dev-tooling: | ||
| dependency-type: development | ||
| - package-ecosystem: github-actions | ||
| directory: / | ||
| schedule: | ||
| interval: weekly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| concurrency: | ||
| group: ci-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| BUN_VERSION: 1.3.12 | ||
|
|
||
| jobs: | ||
| test: | ||
| name: verify (${{ matrix.os }}) | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest] | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: ${{ env.BUN_VERSION }} | ||
| - run: bun install --frozen-lockfile | ||
| - name: Typecheck, lint, tests | ||
| run: bun run verify | ||
| - name: Dead code and unused dependencies | ||
| run: bun run knip | ||
| - name: Coverage (thresholds from bunfig.toml) | ||
| run: bun test --coverage | ||
|
|
||
| tui-smoke: | ||
| name: TUI smoke + e2e (${{ matrix.os }}) | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest] | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: ${{ env.BUN_VERSION }} | ||
| - name: Install expect (linux) | ||
| if: runner.os == 'Linux' | ||
| run: sudo apt-get update && sudo apt-get install -y expect | ||
| - run: bun install --frozen-lockfile | ||
| - name: Sanity — entrypoint runs headless in this job context | ||
| run: ANTHROPIC_API_KEY=fake bun run packages/cli/src/index.tsx --help | grep -q "Usage: minerva" | ||
| - name: PTY render smoke | ||
| run: bun run smoke:tui | ||
| - name: PTY scripted conversation e2e | ||
| run: bun run e2e:tui | ||
|
|
||
| release-smoke: | ||
| name: compiled binary (ubuntu) | ||
| # macOS excluded on purpose: Bun 1.3.12 emits unsigned arm64 binaries the | ||
| # kernel SIGKILLs — tracked in docs/DESIGN.md watchlist. | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: ${{ env.BUN_VERSION }} | ||
| - run: bun install --frozen-lockfile | ||
| - run: bun run build:release | ||
| - name: Binary answers --help | ||
| run: | | ||
| out="$(ANTHROPIC_API_KEY=fake ./dist/minerva --help)" | ||
| echo "$out" | ||
| echo "$out" | grep -q "Usage: minerva" | ||
|
|
||
| live-smoke: | ||
| name: live model smoke (main only, needs secret) | ||
| # Never runs on PRs: no secret exposure to fork-able contexts, no token | ||
| # spend per pull request. Skips quietly when the secret is not configured. | ||
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: ${{ env.BUN_VERSION }} | ||
| - run: bun install --frozen-lockfile | ||
| - name: One real prompt against the default provider | ||
| env: | ||
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| run: bun run scripts/live-smoke.ts | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to Minerva are documented here. The format follows | ||
| [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow | ||
| [SemVer](https://semver.org/) once tagged. | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| ### Added | ||
| - CI (GitHub Actions): verify matrix on ubuntu/macos, per-file coverage | ||
| thresholds, knip, PTY smoke + e2e for the TUI, compiled-binary smoke, and a | ||
| secret-gated live-model smoke on main pushes; Dependabot. | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| - Ink UI test suite (ink-testing-library) and PTY e2e scripts in `scripts/`. | ||
| - `CONTRIBUTING.md`, `docs/PROTOCOL.md`, this changelog. | ||
|
|
||
| ### Changed | ||
| - Stricter static analysis: `exactOptionalPropertyTypes`, `noImplicitOverride`, | ||
| Biome `noExplicitAny` at error level, knip in the gate. | ||
| - `PermissionBridge` is a factory function instead of a class. | ||
|
|
||
| ## [0.1.0] — 2026-07-10 | ||
|
|
||
| Initial version: the headless kernel + CLI milestone (PR #1). | ||
|
|
||
| ### Added | ||
| - **Protocol** (`@minerva/protocol`): bidirectional JSON-RPC 2.0 with | ||
| ACP-shaped methods, in-process and stdio (newline-delimited) transports, | ||
| `minerva/*` extension namespace. See `docs/PROTOCOL.md`. | ||
| - **Kernel** (`@minerva/kernel`): streaming agent loop; append-only JSONL | ||
| event-sourced sessions with resume (`session/load` replay, kill-9 safe) and | ||
| audit trail; permission rule engine (`bash(git *)` patterns) with session | ||
| modes (`plan`/`default`/`acceptEdits`/`auto`) and always-allow persistence; | ||
| built-in tools (read/write/edit files, glob, grep, bash, todo) with | ||
| workspace confinement; MCP client (stdio servers from settings, tools | ||
| permission-gated as `mcp__server__tool`); manual `/compact`. | ||
| - **Providers** (`@minerva/providers`): kernel-owned `ModelProvider` boundary | ||
| over the Vercel AI SDK; Anthropic (default `claude-opus-4-8`) and OpenAI via | ||
| `provider/model` references. | ||
| - **Client** (`@minerva/client`): frontend-agnostic protocol client + session | ||
| view-model store shared by the CLI and the planned GUI. | ||
| - **CLI** (`@minerva/cli`): Ink terminal UI with streaming, permission | ||
| prompts, todo checklist, `--continue`/`--resume`, `/mode`, `/compact`, | ||
| `/sessions`, `/new`; `minerva acp` stdio host for editors. | ||
|
|
||
| ### Known issues | ||
| - Bun 1.3.12 on macOS arm64 emits unsigned compiled binaries (SIGKILLed on | ||
| launch); run via `bun` until resolved. | ||
| - Live Zed interop over `minerva acp` not yet validated (wire contract is | ||
| harness-tested). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # Contributing to Minerva | ||
|
|
||
| ## Setup | ||
|
|
||
| ```sh | ||
| bun install # Bun ≥ 1.3 (CI pins 1.3.12) | ||
| bun run verify # typecheck + lint + all tests — the gate for everything | ||
| ``` | ||
|
|
||
| The repo is a Bun workspace; packages export TypeScript source directly (no | ||
| build step). `tsc --noEmit` typechecks, Biome lints/formats, `bun test` runs | ||
| everything, and knip guards against dead exports and unused dependencies. | ||
|
|
||
| ## The verify gate | ||
|
|
||
| `bun run verify` must be green before anything lands on `main`. CI enforces it | ||
| on every PR (ubuntu + macos), plus: | ||
|
|
||
| - `bun test --coverage` — per-file thresholds from `bunfig.toml` (bun applies | ||
| them per file, not to the total). Ratchet up, never down. | ||
| - `bun run knip` — dead code / unused deps. | ||
| - `bun run smoke:tui` and `bun run e2e:tui` — the Ink UI under a real PTY | ||
| (requires `expect`; preinstalled on macOS, `apt install expect` on Linux). | ||
|
|
||
| ## Workflow | ||
|
|
||
| - **Branch for substantial work** (`<type>/<topic>`, e.g. `feat/mcp-http`, | ||
| `chore/quality-gates`); trivial fixes may land on `main` directly with a | ||
| green gate. | ||
| - **One commit per logical slice**, Conventional Commits. The subject says | ||
| what changed; the body explains *why* — the problem, the decision, the | ||
| trade-off. `git log` should make sense without opening PRs. | ||
| - **PRs merge without squashing** (merge commit) so the curated history | ||
| survives on `main`. | ||
|
|
||
| ## Test layout | ||
|
|
||
| | Location | What it covers | | ||
| |---|---| | ||
| | `packages/*/test/*.test.ts` | Unit + integration per package | | ||
| | `packages/client/test/` | Full-stack flows over the in-proc transport (resume, compact, permissions) | | ||
| | `packages/cli/test/acp.test.ts` | Real child process over stdio (ACP wire contract) | | ||
| | `packages/cli/test/app.test.tsx` | Ink UI via ink-testing-library, real kernel underneath | | ||
| | `packages/kernel/test/mcp.test.ts` | Real spawned MCP server from project settings | | ||
| | `scripts/*.exp` | The TUI under a genuine pseudo-terminal | | ||
|
|
||
| Tests never touch `~/.minerva`: they pass a temp `dataDir` to the kernel (or | ||
| set `MINERVA_DATA_DIR` for spawned processes). Do the same for manual testing: | ||
|
|
||
| ```sh | ||
| MINERVA_DATA_DIR=$(mktemp -d) bun run --cwd packages/cli dev | ||
| ``` | ||
|
|
||
| ## Running things | ||
|
|
||
| ```sh | ||
| bun run --cwd packages/cli dev # interactive TUI (needs ANTHROPIC_API_KEY) | ||
| bun run packages/cli/src/index.tsx acp # kernel on stdio for editors | ||
| bun run build:release # single-file executable (see README caveat) | ||
| ``` | ||
|
|
||
| ## Design context | ||
|
|
||
| Read [docs/DESIGN.md](docs/DESIGN.md) (architecture decisions and their | ||
| rationale) and [docs/PROTOCOL.md](docs/PROTOCOL.md) (the wire protocol) before | ||
| changing kernel or protocol behavior. The protocol version is pinned; breaking | ||
| wire changes need a version bump and a documented migration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.