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
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,11 @@ jobs:
- name: Unused dependencies
run: cargo machete

# Reports public API changes that need a version bump, compared with main.
# Informational until the first crates.io release; then remove continue-on-error.
# Fails when a PR breaks the public API without bumping the version (0.2 -> 0.3).
# Additions pass.
semver:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,7 @@ Keep the public surface small: modules private by default, export through `lib.r
- Duplicate edges and duplicate pre-trust peers: the last one wins.
- Weights must be finite and non-negative; distrust (negative weights) is rejected.
- The iteration stops after `max_iterations` (default 10,000) with `EigenTrustError::NotConverged`.
- Version 0.2.0 is not on crates.io yet; the CI semver job is informational until it is.
- Published on crates.io as `eigentrust` and `eigentrust-cli`. The CI semver job fails on PRs
that break the public API without a version bump. Bump all three crates' versions (and the
`eigentrust = "x.y"` requirements in cli/ and wasm/) together.
- Release: `cargo publish -p eigentrust`, then `cargo publish -p eigentrust-cli`.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
</p>

<p align="center">
<a href="https://crates.io/crates/eigentrust"><img alt="crates.io" src="https://img.shields.io/crates/v/eigentrust"></a>
<a href="https://docs.rs/eigentrust"><img alt="docs.rs" src="https://img.shields.io/docsrs/eigentrust"></a>
<a href="https://github.com/hypnagonia/eigentrust-rust/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/hypnagonia/eigentrust-rust/actions/workflows/ci.yml/badge.svg"></a>
<a href="https://eigentrust.jenyadoesapps.com"><img alt="Live demo" src="https://img.shields.io/badge/demo-live-3a3fd0"></a>
<img alt="Rust" src="https://img.shields.io/badge/Rust-2021-b7410e?logo=rust&logoColor=white">
Expand All @@ -25,11 +27,20 @@ It is the algorithm from the [EigenTrust paper](https://nlp.stanford.edu/pubs/ei

**Try it: [eigentrust.jenyadoesapps.com](https://eigentrust.jenyadoesapps.com)**, a live playground in 10 languages that can also rank 250,000 peers in the browser.

Published on crates.io:

| Crate | What you get | Links |
| --- | --- | --- |
| [`eigentrust`](https://crates.io/crates/eigentrust) | the Rust library | [docs.rs](https://docs.rs/eigentrust) |
| [`eigentrust-cli`](https://crates.io/crates/eigentrust-cli) | the `eigentrust` command | [install](#command-line) |

## Rust library

The [`eigentrust`](https://crates.io/crates/eigentrust) crate on crates.io:

```toml
[dependencies]
eigentrust = { git = "https://github.com/hypnagonia/eigentrust-rust" }
eigentrust = "0.2"
```

```rust
Expand Down Expand Up @@ -60,12 +71,14 @@ fn main() -> Result<(), eigentrust::EigenTrustError> {
- `parallel` runs the iteration on all cores with rayon.
- There are no required dependencies beyond `log`, and the same code builds for `wasm32`.

The crate documentation (`cargo doc --open`) covers the exact input rules and convergence behavior. See also [`examples/`](examples).
The [documentation on docs.rs](https://docs.rs/eigentrust) covers the exact input rules and convergence behavior. See also [`examples/`](examples).

## Command line

The [`eigentrust-cli`](https://crates.io/crates/eigentrust-cli) crate on crates.io:

```sh
cargo install --git https://github.com/hypnagonia/eigentrust-rust eigentrust-cli
cargo install eigentrust-cli
eigentrust localtrust.csv pretrust.csv [alpha]
```

Expand Down
Loading