From 4ed65cd539793e179cdf55888fd90f4273d87418 Mon Sep 17 00:00:00 2001 From: jenya Date: Wed, 21 Oct 2026 15:02:21 +0400 Subject: [PATCH] Remove local tooling files from the repo; add project history to README --- .githooks/commit-msg | 11 -------- .github/workflows/ci.yml | 14 ---------- .gitignore | 3 +++ CLAUDE.md | 56 ---------------------------------------- README.md | 7 ++++- 5 files changed, 9 insertions(+), 82 deletions(-) delete mode 100755 .githooks/commit-msg delete mode 100644 CLAUDE.md diff --git a/.githooks/commit-msg b/.githooks/commit-msg deleted file mode 100755 index 1416766..0000000 --- a/.githooks/commit-msg +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Rejects commits that credit Claude / Anthropic as a co-author. -# Enable once per clone: git config core.hooksPath .githooks - -msg_file="$1" - -if grep -v '^#' "$msg_file" | grep -qiE 'co-authored-by:.*(claude|anthropic)|generated with .*claude|noreply@anthropic\.com'; then - echo "commit-msg: Claude / Anthropic attribution is not allowed in this repo." >&2 - echo "Remove the Co-Authored-By / 'Generated with Claude' lines and commit again." >&2 - exit 1 -fi diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b83260b..5c5c895 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,17 +126,3 @@ jobs: with: tool: cargo-semver-checks - run: cargo semver-checks check-release -p eigentrust --baseline-rev origin/${{ github.base_ref }} - - attribution: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: No Claude / Anthropic co-author trailers - run: | - if git log --format='%H%n%B' | grep -qiE 'co-authored-by:.*(claude|anthropic)|generated with .*claude|noreply@anthropic\.com'; then - echo "Found Claude / Anthropic attribution in commit history" >&2 - git log --format='%h %s' -i -E --grep='co-authored-by:.*(claude|anthropic)' --grep='noreply@anthropic\.com' >&2 - exit 1 - fi diff --git a/.gitignore b/.gitignore index 8240dcf..dc52e2b 100644 --- a/.gitignore +++ b/.gitignore @@ -147,3 +147,6 @@ pkg-parallel/ demo/pkg/ demo/pkg-parallel/ .vercel + +# Local agent notes +CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index 815e3f7..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,56 +0,0 @@ -# CLAUDE.md - -## Git: no Claude attribution, ever - -- NEVER add `Co-Authored-By: Claude ...`, `noreply@anthropic.com`, "Generated with Claude Code" - or any other Claude / Anthropic attribution to commit messages, PR titles or PR descriptions. - This project was written by its author before Claude was involved. Plain commit messages only. -- This is enforced by `.githooks/commit-msg` and by CI. Enable the hook once per clone: - `git config core.hooksPath .githooks` -- Never bypass it with `--no-verify`. -- PRs get squash-merged quickly: start follow-up work from a fresh branch off `main`. - -## Project - -EigenTrust in Rust. Cargo workspace: - -- `eigentrust` (root, `src/`) - the library. The only implementation of the algorithm. - - `lib.rs` - crate docs, the public API (`eigentrust`, `eigentrust_with_options`, re-exports) - - `types.rs` (`TrustEdge`, `PreTrust`), `options.rs`, `scores.rs` (`TrustScores`), `error.rs` - - `algorithm/` - private: input validation and normalization (`mod.rs`), CSR matrix, - power iteration (`power.rs`) - - `csv.rs` - `csv` feature: named peers from CSV (`csv::Network`), its own error type - - features: `csv`, `parallel` (rayon); default none -- `eigentrust-cli` (`cli/`) - binary `eigentrust`, uses only the public API -- `eigentrust-wasm` (`wasm/`) - JS bindings; `convert.rs` is plain Rust, `bindings.rs` wasm32 only; - `threads` feature for the multithreaded build; `publish = false` -- `demo/` - static web playground deployed to Vercel - -Keep the public surface small: modules private by default, export through `lib.rs`, -`#![warn(missing_docs)]` is on. - -## Commands - -- Test: `cargo test --workspace --all-features` (unit, integration, doc tests incl. README) -- Library alone: `cargo test -p eigentrust` -- WASM tests: `wasm-pack test --node --release wasm` -- Lint: `cargo fmt --all --check`, `cargo clippy --workspace --all-targets --all-features -- -D warnings`, - and `cargo clippy -p eigentrust -p eigentrust-wasm --target wasm32-unknown-unknown --all-targets -- -D warnings` -- Docs: `RUSTDOCFLAGS="--cfg docsrs -D warnings" cargo +nightly doc -p eigentrust --all-features --no-deps` -- Package: `cargo package -p eigentrust -p eigentrust-cli`, check `cargo package -p eigentrust --list` -- CLI: `cargo run --release -p eigentrust-cli -- ./example/localtrust.csv ./example/pretrust.csv [alpha]` -- WASM: `./build.sh` (builds `pkg/` and `pkg-parallel/` from `wasm/` and copies them into `demo/`) -- Demo locally: `python3 -m http.server -d demo` then open http://localhost:8000 -- Deploy: `vercel deploy --prod` from `demo/` - -## Notes - -- Results must stay bit-identical: compensated (KBN) sums in a fixed order in `power.rs`, plain - sums for normalization, stable sorts. Tests compare floats exactly. -- 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`. -- 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`. diff --git a/README.md b/README.md index 7c0c8bb..1173a6e 100644 --- a/README.md +++ b/README.md @@ -145,9 +145,14 @@ cargo test --workspace --all-features # tests, including doc tests cargo run --example basic # library example ./build.sh # WASM builds, copied into demo/ python3 -m http.server -d demo # run the playground locally -git config core.hooksPath .githooks # once per clone ``` +## History + +- **2024** — first version: power iteration, multithreading, WASM build running in a web worker, web playground. +- **2026** — rewritten as a library crate: input validation, typed errors, CSV input, CLI and WASM adapters, + stricter CI; published on crates.io. + ## License Licensed under either of [Apache License 2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT), at your option.