Skip to content

docs(ahti-emitter): sync Cargo.toml block to what actually shipped#107

Merged
yairfalse merged 1 commit into
mainfrom
docs/sync-ahti-emitter-doc
May 31, 2026
Merged

docs(ahti-emitter): sync Cargo.toml block to what actually shipped#107
yairfalse merged 1 commit into
mainfrom
docs/sync-ahti-emitter-doc

Conversation

@dimashev
Copy link
Copy Markdown
Collaborator

TL;DR

Closes the doc-vs-implementation drift you flagged in your polku#106 review ("docs/ahti-emitter.md is stale vs. the implementation: it shows `prost = "0.13"`, an `ahti-append-proto` path crate, `anyhow`, `fn name() -> &'static str`, and newtype configs..."). You caught up most of it during the review-fix commit; the Cargo.toml example block was the remaining gap.

Doc-only, +33/-7 in one file, no code touched.

What was stale

The doc's Cargo.toml block showed:

```toml
[package]
name = "polku-ahti-emitter"
version = "0.1.0"
edition = "2024"

[dependencies]
polku-core = { path = "../core" }
tonic = "0.14"
tonic-prost = "0.14"
prost = "0.14"
prost-types = "0.14"
async-trait = "0.1"
thiserror = "2"
tracing = "0.1"
```

The actual shipped `Cargo.toml` uses workspace inheritance for package metadata, strict `=0.14.5` pins on tonic / tonic-prost, includes `tokio` + `ulid`, and declares `tonic-prost-build` in `[build-dependencies]` — none of which the doc reflected.

What this PR does

Replaces the example with what actually shipped:

```toml
[package]
name = "polku-ahti-emitter"
version.workspace = true
edition.workspace = true
rust-version.workspace = true

[dependencies]
polku-core = { version = "0.1.0", path = "../core" }
tonic = "=0.14.5"
tonic-prost = "=0.14.5"
prost = "0.14"
prost-types = "0.14"
tokio = { version = "1", features = ["sync"] }
async-trait = "0.1"
ulid = "1"
thiserror = "2"
tracing = "0.1"

[build-dependencies]
tonic-prost-build = "=0.14.5"
```

Plus an in-doc note explaining the strict pin rationale (Rust 1.88 MSRV bump in 0.14.6 vs CI pinned to 1.85), and one sentence about the `.bytes(".")` prost configuration in `build.rs` — which is what lets `OccurrenceRecord.payload` accept a zero-copy `bytes::Bytes` clone rather than a `Vec` copy.

What was already accurate

Your earlier touch-ups during the review fix caught most of the drift. The Surface block (no `Arc<Mutex<...>>`, correct struct shape), the Batching / Backpressure / Mapping / Authentication / Worked-example sections, the "intentionally does not do" list, and the cross-references all match what's in `lib.rs`. Spot-checked each cited API (`with_failure_capture`, `with_default_retry`, etc.) — all exist in the gateway resilience layer.

Validation

  • `cargo fmt --check` — PASS (doc-only diff)
  • No clippy / test impact possible since no Rust changed.

🤖 Generated with Claude Code

Closes the doc-vs-implementation drift Yair flagged on polku#106
review (finding labeled "docs/ahti-emitter.md is stale vs. the
implementation"). The doc landed in the PR; the implementation
diverged during Yair's review-fix commit; the doc was partially
caught up to reflect the changes Yair made but the Cargo.toml
example block was not.

Concrete drift fixed:

  - Pins tightened to `=0.14.5` for tonic / tonic-prost (was `"0.14"`
    in the doc, but the actual crate uses `=0.14.5` because 0.14.6
    raises MSRV to Rust 1.88 while Polku CI is pinned to 1.85). The
    strict-pin rationale is now stated in-doc.

  - Cargo.toml block reformatted to show workspace inheritance
    (`version.workspace = true` etc.) which is how the package
    metadata is actually declared.

  - Added missing deps to the example: `tokio` (with `["sync"]`
    features), `ulid`, plus the `[build-dependencies]` section with
    `tonic-prost-build = "=0.14.5"`.

  - Added a sentence about the `.bytes(".")` prost configuration in
    `build.rs` — that's what lets `OccurrenceRecord.payload` accept a
    zero-copy `bytes::Bytes` clone rather than a `Vec<u8>` copy. The
    mapping table further down already says `payload: Bytes`; this
    fills in why.

  - Made the dual-version split with `polku-gateway`'s `tonic = "0.12"`
    / `prost = "0.13"` explicit (was implicit before).

The rest of the doc (the Surface block, the Batching / Backpressure /
Mapping / Authentication / Worked-example sections, the
"intentionally does not do" list, cross-references) already reflects
the shipped code thanks to Yair's earlier touch-ups. Verified by
spot-checking each cited API exists.

Doc-only; no code touched. `cargo fmt --check` passes. No clippy /
test impact possible since no Rust changed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@dimashev dimashev requested a review from yairfalse May 28, 2026 11:39
@yairfalse yairfalse merged commit 387a338 into main May 31, 2026
1 check passed
@yairfalse yairfalse deleted the docs/sync-ahti-emitter-doc branch May 31, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants