Skip to content

docs: rewrite the README with compile-checked examples - #30

Merged
stakach merged 3 commits into
spider-gazelle:masterfrom
n-rodriguez:docs/readme
Jul 13, 2026
Merged

docs: rewrite the README with compile-checked examples#30
stakach merged 3 commits into
spider-gazelle:masterfrom
n-rodriguez:docs/readme

Conversation

@n-rodriguez

Copy link
Copy Markdown
Contributor

The last item of the audit (#7) — the README half of P7-4 (the CHANGELOG half landed in #19).

Problem

The README predated most of the audit work: it pointed at the defunct demo.snmplabs.com, claimed set only supports String/Int/Bool/Nil, never mentioned SNMP::Client, its raw examples skipped response-id validation, and none of the code blocks were compile-tested — so API changes could silently rot them.

Commits

  1. test(examples): add compile-checked usage examplesexamples/client.cr (high-level Client: get / multi-get / walks / typed set / notifications / v3), examples/v2c_raw.cr and v3_raw.cr (raw sockets with response-id + error-status validation). New dev:examples mise task (crystal build --no-codegen), wired into the CI docs job.
  2. docs: rewrite the README around the current API — capabilities list (SHA-2 / AES-256, GetBulk, typed SET values, notifications, typed errors), an Installation section, Client-first usage, Errors and Development sections. The code blocks mirror examples/, so the CI keeps them honest.
  3. docs(claude): document dev:snmpd and dev:examples.

Verification

Examples type-check (dev:examples), deterministic 92/92, ameba clean, format clean, docs build.

With this merged, the audit (#7) is complete: 63/64 items — the one remaining item (the V1Trap < Trap < PDU hierarchy smell) is deliberately deferred post-1.0.

🤖 Generated with Claude Code

n-rodriguez and others added 3 commits July 13, 2026 05:39
The README code blocks had no compile guarantee, so API changes could silently
rot them. Keep the examples as real files, type-checked in CI.

- examples/client.cr: high-level Client (get / multi-get / walks / typed set /
  notifications / v3)
- examples/v2c_raw.cr, v3_raw.cr: raw-socket exchanges with response-id and
  error-status validation
- mise: dev:examples runs crystal build --no-codegen on examples/*.cr
- ci: type-check the examples in the docs job

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The README predated most of the audit work: it pointed at the defunct
demo.snmplabs.com, claimed set only supports String/Int/Bool/Nil, never
mentioned SNMP::Client, and its raw examples skipped response validation.

- README: capabilities list (SHA-2 / AES-256, GetBulk, typed SET values,
  notifications, typed errors), an Installation section, Client-first usage,
  raw v2c/v3 examples with response-id + error-status checks, Errors and
  Development sections; code blocks mirror the compile-checked examples/

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- CLAUDE.md: add the two tasks to the mise task table

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@stakach
stakach merged commit 52082ca into spider-gazelle:master Jul 13, 2026
6 checks passed
@n-rodriguez
n-rodriguez deleted the docs/readme branch July 21, 2026 08:53
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