Repository navigation
ci: review the rewrite branch with CodeRabbit, now greptile is retired - #1136
chappie-daemon wants to merge 1 commit into
Conversation
greptile was the factory's static reviewer and its CLI is no longer usable: a paid tier the OSS allowance does not cover, a key that came back revoked, and a diff cap that rejected a 1,454-line branch. CodeRabbit is already installed on this repository and free on public ones, but its auto review covers the default branch only, and every rewrite pull request targets rewrite/main. base_branches adds that branch by name. auto_pause_after_reviewed_commits rises from its default of 5, which a job with fix rounds would exhaust before its review rounds start.
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
[Medium impact] The PR appears safe to merge.
|
The last slice of #864 (closed): the rig that produces `docs/rewrite/benchmarks.md`, which the cutover gate (#869) reads before it can retire the TypeScript implementation. Filed as #1131 because 864 closed with the store slice. ## What is here - **`crates/nostream-storage/examples/bench.rs`** — one workload, held as named constants in the file and echoed into the artifact, run through `Arc<dyn EventRepository>` so the same call sites measure either backend: a deterministic corpus, bulk load, a per-call ingest, five read shapes, nearest-rank percentiles, and a JSON artifact whose deterministic part is identical across runs of a seed while every host- and run-dependent value lives in one `volatile` block. - **`--verify`** — the oracle. It asserts the corpus's exact expected totals per shape (200 / 20 000 / 99 602 / 20 000 / 1 020 000 at 50 000 events), non-empty windows per iteration, percentile ordering and repeat agreement. Timings are never asserted. - **`--repeats N`** — median/p10/p90 per shape and per rate, so a contended host is visible rather than hidden by a point estimate. - **`docs/rewrite/benchmarks.md`** + **`docs/rewrite/benchmarks/lmdb-50k-seed7.json`** — the recording, its conditions, its arithmetic and the decisions D1–D9 that define what it measures and what it does not. - **Two CI steps** in the existing `rust-checks` job: the benchmark unit tests (which `cargo test --workspace` does not run, measured) and the Postgres arm where a database exists. - One empty changeset, as `CLAUDE.md` requires, and the ADR 0012 amendment that retires "the benchmark rig, which does not exist". ## The recording, and what it is worth One host, four cores, `Intel i7-10700T @ 2.00GHz`, load 43.32 at the first of three repeats, release profile, 50 000 events, seed 7, `--repeats 3`, regenerated after the round-6 fixes (load 48.79). `create` (one write per call, the relay's own path) runs at a 256 ops/s median; `create_many` (500 per call) at 31.2 ms p95 per batch. The bands are in the document and in the artifact. **The band is the host.** The performance lens measured one repeat's 1 000 ingests at 125.5 s against 4.4 s and 6.3 s in the other two on this box; the document records the spreads and says a wider band is a busier host, not a slower store. ## What it does not measure, and why - **The Rust/Postgres column**: no database on the host that ran this. The harness has the arm and CI reaches it; `benchmarks.md` carries the column as `not measured` with the command. - **The TypeScript/Postgres column**: filed as #1132 — `src/` on this branch is 3.11.0 diverged from `origin/main`, and the job's member has no Docker, no `psql`, no `node_modules`. - **NIP-50 `search`**: both arms honour it only with `nip50.enabled`, and the harness opens either backend without settings, so a `search` row would time a plain filtered read with the query dropped. D9 says so, with the code. - Retention, transactions, concurrency above one and the wire: D9. ## Review history Four rounds, three reworks, on a job whose estimate was $2.40 and whose actual is stated below. | round | verdicts | what it found | |---|---|---| | 1 | code PASS, security PASS, ux/architecture/performance CHANGES | `count` timed an **empty range 49 times of 50** and `author_kind` 40 of 200; `--verify` asserted only `rows > 0`, so it passed both; `per_second` mixed batches/s with events/s, inverting a 69× ratio; the example's unit tests were run by no gate; `--out` failed after the whole measurement | | 2 | performance PASS, four CHANGES | `--store` with `--repeats > 1` **never refused a populated store** — the guard inspected `<dir>/lmdb/data.mdb` while the run opened `<dir>/repeat-<n>/lmdb/data.mdb`; without `--verify` a second run exited 0 with `create_many rows 0` | | 3 | security/ux/performance PASS, code/architecture CHANGES | four false or uncited sentences in the document: an uncited multiplier, a disk sentence contradicting its own arithmetic, NIP-50 as "not on the base", and a kind list missing 30000–39999 | | 4 | code/architecture CHANGES (docs-only delta) | the round-3 fix introduced two new false claims in D9; the operator authorised one micro-fix rather than an issue | | 5 | code PASS (single-lens confirmation) | both D9 sentences now name the dispatch arms they mean, verified line by line | | 6 | after the PR opened — Greptile, five findings | the P1: `--verify` failed **correct** runs through a `.max(1)` clamp; `--out` refused on the wrong path; profile-dependent seed arithmetic; repeat read-backs unchecked; a workload block that could not tell two by-id workloads apart | | 7 | docs-only | the regenerated document quoted two figures from the artifact it replaced (48/24416, absent from the JSON) and a stale date; both corrected against the committed artifact | The approver then **escalated on five citation anchors in the job record** — `recon.md` ×4 and `spec.md` ×1 — none of them in the branch: `EnvFlags::empty()` is `backend.rs:110`, not `:145`; `LmdbBackend` is declared in `lmdb/mod.rs`, not `backend.rs`; "The harness map" is `nip-parity.md:963`; the `maxLimit` refusal is `subscribe.rs:596-604`. Corrected against the tree and re-approved. The check is now filed as a script so it stops being an approver's habit: cameri/skills#302. **The pattern worth carrying:** every round's defect was a claim about *coverage* rather than a wrong answer — an oracle weaker than the defect it was written to catch, a guard validating a path the run did not use, an exclusion list hiding an unmeasurable shape. None of them was visible by reading the happy path. ## Rework after the automated review (round 6) The PR's automated reviewer found five things after the PR opened, one of them a P1. All five were verified against the code and all five were true: - **P1 — the oracle failed correct runs.** `--verify` compared `timing.per_second.max(1)` against the truth, so any shape whose integer rate rounds to 0 failed. It now asserts `ops > 0` as a boolean and treats a zero rounded rate as a measurement. **The oracle has now been wrong in both directions**: too weak in round 1 (`rows > 0` passed an empty range) and too strict here. - `--out` refused on its *parent* rather than its destination, so `--out /tmp` passed and failed after the whole run. Refused at the destination, with a writability probe that never truncates an existing artifact. - Seed arithmetic panicked in a debug build and wrapped in release, so the same seed chose different rows per profile. Now `wrapping_*`, with `u64::MAX` covered in both profiles. - Only the first repeat's read-back count was checked; every repeat's is now kept and compared, naming the repeat. - The workload block could not distinguish two by-id workloads; `by_id_stride` and `by_id_offset` are in `workload.reads` (**schema 2**), and **the committed artifact was regenerated by the document's own command** rather than edited. The regenerated run was taken at load 48.79 (the previous at 43.32): reads moved 10–21% slower, `create_many` 26% faster, every shape count unchanged. The document was rewritten to those figures and D4's "widest band" claim went with the artifact it described. ## Static stage Four rounds, the clippy provider `ran` clean each time over the repository's own CI commands — including `cargo check -p nostream-storage --no-default-features --all-targets` and the strict `-D clippy::unwrap_used -D clippy::expect_used -D clippy::panic` — the flags an earlier job's shim never ran. `Greptile Review` is `unavailable` for this job: the shared key is rejected, and the branch exceeds the service's diff cap in any case. `CodeRabbit` reviews `rewrite/main` PRs once #1136 lands. ## Known limits - One host, one profile, one seed, one corpus size. The document says so in its first screen. - The 200 000-event ceiling and the 4 KiB/event projection are the harness's policy, not a measurement; `--allow-large-corpus` lifts the first, the document prints the projection. - D9's exclusion prose has three known wording defects, each filed with its exact replacement: #1138 (28 935 listed as an exception to a predicate it satisfies), #1139 ("the same call with a different row" holds for `create`, not for delete/vanish's extra store work), #1140 ("Nothing else is cited" is contradicted by four later citations, each correctly labelled). - No Postgres run executed here; the CI step is written and not yet exercised. - No Postgres run was executed in this environment; the CI step is written and not yet exercised.
|
Closing: the premise is wrong. Greptile is not retired — only its CLI is unavailable to the factory's static stage. The GitHub app is live and reviewed this very PR, approving it at What remains true is narrower than the PR body claims, and it belongs in the factory, not in review policy:
CodeRabbit's base-branch expansion would have added a second reviewer on |
Why
The rewrite's independent reviewer was greptile, run by the factory's static stage. It cannot run any more: its CLI sits on a paid tier the OSS allowance does not cover, the stored key came back revoked, and the service refused a 1,454-line branch as too large to send. Both failures recorded as "provider unavailable", which at a glance reads like a clean round — worse than having no reviewer.
CodeRabbit is already installed on this repository, and its free tier covers public repositories. It reviewed a PR on
mainhere within seconds of being opened. It did not review the rewrite's PRs, because auto review covers the default branch and every rewrite PR targetsrewrite/main.What this adds
.coderabbit.yaml, with the default branch untouched:reviews.auto_review.base_branches: ["^rewrite/main$"]— the one line that gives the rewrite its reviewer back.auto_pause_after_reviewed_commits: 20(default 5) — a job with fix rounds pushes more than five commits before its review rounds start, and the default pauses exactly then.profile: chill, summaries and walkthroughs on; sequence diagrams and the poem off, since neither has been read.Notes
sequence_diagramsand auto-summaries in the PR description stay on their defaults except where named above.Summary by CodeRabbit