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
111 changes: 0 additions & 111 deletions .agent.md

This file was deleted.

52 changes: 40 additions & 12 deletions AGENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ src/
└── template.rs # Hook script templates
```

### Dependency rules

```
config/ → engine/ → formatters/
main.rs → commands/ → output
commands/, mcp/ → engine/* (rules, scanners, profiles, diff_parser, index_bridge)
git/, hook/ are leaf helpers
```

Engine modules must not depend on `commands/` or on `config/loader` directly; `mcp/tools`
reaches the engine through `crate::engine::*`.

## Key Files

| File | Purpose |
Expand Down Expand Up @@ -142,12 +154,24 @@ The pre-commit hook runs the installed `cora` binary on the staged diff. Never s

## 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
The workflows in `.github/workflows/`:

1. **ci.yml** — Check, Format, Clippy, Test, Build, Security Audit (CVE), Website Build,
NPM Audit and Cargo Outdated on every PR and on pushes to `develop` and `main`. The
push to `develop` exists to fill the Rust build cache that PRs restore (a cache
written inside a PR is visible to that PR only); docs-only pushes are skipped.
2. **cora-review.yml** — Cora Review on every PR (`pull_request_target`; the config comes
from the base branch, never from the PR).
3. **pr-checks.yml** — Branch Naming, Conventional Commits and PR Description.
4. **release.yml** — Triggered by `v*` tags; builds the 4 platform binaries with the code
model bundled, publishes to crates.io, signs the checksums and creates the GitHub Release.
5. **deploy-website.yml** — Deploys the project website and docs.
6. **project-sync.yml** — Moves linked issues to Done on the roadmap board.
7. **anthropic-wif-smoke.yml** — Smoke test of the Anthropic workload identity federation.

Required checks on a PR (13): Check, Format, Clippy, Test, Build, Security Audit (CVE),
Website Build, NPM Audit, Cargo Outdated, Cora Review, Branch Naming, Conventional
Commits, PR Description.

## Config System

Expand All @@ -166,6 +190,11 @@ API keys live in a separate `auth.toml` file (`~/.codecora/cora-code/auth.toml`)

## Design Decisions

- **Exit codes:** 0 success, 1 error, 2 quality gate failed.
- **`CORA_API_KEY`** is for CI; local use keeps the key in `~/.codecora/cora-code/auth.toml`.
- **The Marketplace action** lives in its own repository, `codecoradev/cora-review-action`,
not in this tree.
- **`merge_into()`** returns `Result<(), CoraError>`: an invalid profile config fails fast.
- **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
Expand Down Expand Up @@ -308,7 +337,6 @@ reality BEFORE version bump.
| `docs/code-intelligence.md` | Index, brain, trace, arch, multi-project DB, data directory |
| `docs/installation.md` | Version pin example uses latest. Platforms list accurate |
| `AGENT.md` | Code structure tree current. Test count current. Key files table current |
| `.agent.md` | Pre-release checklist current. CI checks count current. Module dependencies current |

### 3. Cross-Check

Expand All @@ -320,7 +348,7 @@ reality BEFORE version bump.

### 4. CI & Scanning

- [ ] CI: 10/10 checks green on develop branch
- [ ] CI: 13/13 checks green on the release PR
- [ ] Code Scanning: 0 open alerts (fix or dismiss each with reason)
- [ ] No open PRs blocking the release

Expand Down Expand Up @@ -360,7 +388,7 @@ Generate a comprehensive pre-release report covering:
✅ TESTS: N pass (unit + CLI + config)
✅ CLIPPY: Clean
✅ FORMAT: Clean
✅ CI: 10/10 green
✅ CI: 13/13 green
✅ CODE SCANNING: 0 open
✅ OPEN PRs: 0
✅ OPEN ISSUES: N (all post-release scope)
Expand Down Expand Up @@ -475,9 +503,9 @@ When submitting cora to directories, aggregators, or showcases (Trendshift, etc.

### Key Metrics to Mention

- Test count (708+)
- Lines of Rust code (26,400+)
- CI checks (10)
- Test count (1,500+)
- Lines of Rust code (67,000+)
- CI checks (13)
- GitHub Marketplace action published
- MCP server with 22 tools
- Apache-2.0 license
Expand Down
11 changes: 5 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- **`index-breaking-change` no longer reports a removal whose callers are deleted in the same change (#794).** The index predates the diff, so a helper removed together with its only caller was reported as "breaks 1 caller" and blocked the review; callers whose call site is one of the removed lines (or in a deleted file) are now ignored, and the finding stays for callers that remain.

### Changed
- **Documentation corrected against the code (#782).** The README's quick install now uses `install.sh`, which verifies the SHA-256 checksum and the Sigstore signature (the script it named before did neither, and the `CORA_VERSION` pin in the examples never reached the installer); the License section says Apache-2.0; the global config directory is `~/.codecora/cora-code/` everywhere (it said `~/.cora/`); Tree-sitter is no longer called opt-in; language, rule and pattern counts, the Rust badge, the Homebrew claim, the download URL and the release flow in CONTRIBUTING were wrong or stale.

- **Dead code removed (#790).** About 500 lines that nothing used are gone, among them the YAML agent-config path, an unused `IssueType` enum, unused graph helpers and five error variants that were never created, and the 60 `#[allow(dead_code)]` attributes that hid them. The compiler now reports unused code again; the few items that are written but not wired in yet carry a narrow, commented allow that points to #792. `cora install --yes` is still accepted but has no effect (`install` never asks questions), and its help says so.
- **A README and docs that are easier to read.** The README opens with a diagram of how cora works and a three-command quick start, groups the features (review, code intelligence, agents and CI), tucks upgrade and Gatekeeper details into a collapsed section and shows the timings as a chart next to the table. `docs/usage.md` shows how a review runs and `docs/agent-integration.md` how an agent uses cora, each with a diagram. The four SVG diagrams (`docs/public/diagrams/`) carry their own light and dark colors, a title and a description, and are checked by `tests/docs_drift.rs` (accessible, self-contained, used somewhere, and the chart matches the README table).
### Changed

### Fixed
- **One agent guide (#799).** `.agent.md` is merged into `AGENT.md` and deleted; the facts that only it had and are still true (module dependency rules, a few decisions) moved over, the wrong ones (the license, the number of required checks) did not, and the CI section lists all seven workflows, kept in step by a test.

- **Documentation corrected against the code (#782).** The README's quick install now uses `install.sh`, which verifies the SHA-256 checksum and the Sigstore signature (the script it named before did neither, and the `CORA_VERSION` pin in the examples never reached the installer); the License section says Apache-2.0; the global config directory is `~/.codecora/cora-code/` everywhere (it said `~/.cora/`); Tree-sitter is no longer called opt-in; language, rule and pattern counts, the Rust badge, the Homebrew claim, the download URL and the release flow in CONTRIBUTING were wrong or stale.
- **Dead code removed (#790).** About 500 lines that nothing used are gone, among them the YAML agent-config path, an unused `IssueType` enum, unused graph helpers and five error variants that were never created, and the 60 `#[allow(dead_code)]` attributes that hid them. The compiler now reports unused code again; the few items that are written but not wired in yet carry a narrow, commented allow that points to #792. `cora install --yes` is still accepted but has no effect (`install` never asks questions), and its help says so.

### Changed
- **A README and docs that are easier to read.** The README opens with a diagram of how cora works and a three-command quick start, groups the features (review, code intelligence, agents and CI), tucks upgrade and Gatekeeper details into a collapsed section and shows the timings as a chart next to the table. `docs/usage.md` shows how a review runs and `docs/agent-integration.md` how an agent uses cora, each with a diagram. The four SVG diagrams (`docs/public/diagrams/`) carry their own light and dark colors, a title and a description, and are checked by `tests/docs_drift.rs` (accessible, self-contained, used somewhere, and the chart matches the README table).

- **A shorter README and docs that cannot drift silently (#783).** Configuration, Commands and Environment Variables in the README are summaries that link to the single source in `docs/`. `tests/docs_drift.rs` fails CI when a document names the legacy config path, a version pin or the license differs from `Cargo.toml`, a tool or language count differs from the server or the language table, a default feature is called opt-in, a link or anchor is broken, the installer named in the docs does not verify its download, or the README misses a page of the docs site. `docs/changelog.md` is generated by the docs build and no longer committed.

Expand Down
35 changes: 24 additions & 11 deletions tests/docs_drift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,11 @@ fn read(rel: &str) -> String {
/// `docs/changelog.md` is generated from CHANGELOG.md by the docs build, and the
/// design notes and standards keep history, so they are not checked.
fn doc_files() -> Vec<String> {
let mut files: Vec<String> = [
"README.md",
"CONTRIBUTING.md",
"AGENT.md",
".agent.md",
"SECURITY.md",
]
.iter()
.filter(|f| root().join(f).exists())
.map(|f| f.to_string())
.collect();
let mut files: Vec<String> = ["README.md", "CONTRIBUTING.md", "AGENT.md", "SECURITY.md"]
.iter()
.filter(|f| root().join(f).exists())
.map(|f| f.to_string())
.collect();
let mut pages: Vec<String> = fs::read_dir(root().join("docs"))
.expect("docs/")
.filter_map(|e| e.ok())
Expand Down Expand Up @@ -539,3 +533,22 @@ fn the_performance_chart_shows_the_numbers_of_the_readme_table() {
}
assert_eq!(seen, 3, "the performance chart should label three bars");
}

#[test]
fn agent_md_names_every_workflow() {
// The CI/CD section of AGENT.md lists the workflows; a new or renamed one must show up there.
let agent = read("AGENT.md");
let dir = root().join(".github/workflows");
let mut seen = 0;
for entry in fs::read_dir(&dir).expect(".github/workflows") {
let name = entry.unwrap().file_name().to_string_lossy().to_string();
if name.ends_with(".yml") || name.ends_with(".yaml") {
seen += 1;
assert!(
agent.contains(&name),
"AGENT.md does not mention the workflow {name}"
);
}
}
assert!(seen >= 5, "found only {seen} workflows");
}
Loading