docs: rewrite the README with compile-checked examples - #30
Merged
Conversation
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>
64 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, claimedsetonly supports String/Int/Bool/Nil, never mentionedSNMP::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
test(examples): add compile-checked usage examples—examples/client.cr(high-level Client: get / multi-get / walks / typed set / notifications / v3),examples/v2c_raw.crandv3_raw.cr(raw sockets with response-id + error-status validation). Newdev:examplesmise task (crystal build --no-codegen), wired into the CI docs job.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 mirrorexamples/, so the CI keeps them honest.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 < PDUhierarchy smell) is deliberately deferred post-1.0.🤖 Generated with Claude Code