P3: API / SemVer cleanups before 1.0 - #26
Merged
Merged
Conversation
PDU#value / Message#value returned the VarBind, contradicting their own "shortcut for .varbinds[0].value" doc. Make them return the value BER and add #varbind for the VarBind itself. - pdu, message: value => varbinds[0].value; new varbind => varbinds[0] - client: walk uses msg.varbind.end_of_mib_view? (was msg.value) - spec: value_accessors_spec BREAKING: PDU#value / Message#value now return the ASN1::BER value, not the VarBind. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
In SNMPv3 the engine id plays the community's role; document that engine_id is the accessor to use and that community is only kept in sync for SNMP::Message compatibility. - v3/message: doc on engine_id / community Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
build_reply had no callers and its self.class.new signature does not match V3::Message.new, so it was broken for v3. Remove it; reintroduce properly if an agent-side reply API is ever needed. - message: remove build_reply Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
SNMP.parse (version-dispatching factory), Session#parse (v2c) and V3::Session#parse (v3, verifies + checks timeliness) are intentionally distinct; document each role and the security-parameter conventions. - snmp, session, v3/session: doc on parse Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- client: getter host : String / timeout : Int32 / port : Int32 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Both constructors and with_socket built and configured the UDP socket with the same three lines. Extract build_socket. - client: private build_socket; used by both initializers and with_socket 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 P3 (API / SemVer) group from the audit (#7) — small public-contract cleanups to settle before 1.0. One commit per item.
Commits
feat(pdu): value returns the value, add a varbind accessor—PDU#value/Message#valuereturned the VarBind, contradicting their# shortcut for .varbinds[0].valuedoc. They now return the value BER; new#varbindreturns the VarBind.docs(v3): clarify engine_id vs community— document thatengine_idis the v3 accessor andcommunityis only mirrored forSNMP::Messagecompatibility.refactor: drop the dead, v3-broken build_reply— it had no callers and itsself.class.newsignature never matchedV3::Message.new.docs: document the three parse entry points—SNMP.parse(factory),Session#parse(v2c),V3::Session#parse(v3); their signatures are already aligned, the differences are intentional and now documented.refactor(client): add return-type restrictions to host/timeout/port—getter host : String,timeout/port : Int32.refactor(client): extract build_socket, dedup socket setup— the two constructors andwith_socketshared the same socket-setup lines.Breaking changes (pre-1.0)
PDU#value/Message#valuenow return theASN1::BERvalue, not theVarBind(use#varbindfor that).Message#build_replyremoved.Tests
value_accessors_speccovers the newvalue/varbindsemantics; the rest are doc/refactor with no behaviour change, guarded by the full suite. Deterministic 82/82, multi-threaded 82/82, legacy 3/3, ameba clean, format clean; commits bisect-clean.Tracked in #7.
🤖 Generated with Claude Code