docs: design third-party MIB catalogs - #171
Merged
Merged
Conversation
Contributor
Author
|
@greptileai review |
Contributor
Greptile SummaryImplements bounded SNMP GETNEXT walking and expands the third-party MIB catalog design.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/stdlib/netmon.rs | Adds the bounded SNMP WALK runtime, strict option parsing, transport handling, look-ahead semantics, and resource accounting. |
| src/stdlib/netmon_codec.rs | Adds canonical GETNEXT request encoding and correlated response decoding that can ignore stale request IDs. |
| tests/std_netmon_walk_tests.rs | Exercises successful walks, terminal conditions, limits, malformed responses, stale packets, retries, deadlines, and policy failures. |
| src/typechecker.rs | Registers the new snmp_walk signature while preserving the optional fourth argument for both SNMP functions. |
| design-docs/dd-047-std-netmon.md | Specifies immutable third-party MIB catalogs, recognition profiles, inventory plans, and the finalized WALK contract. |
| docs/STDLIB_REFERENCE.md | Publishes the generated reference entry for the new SNMP WALK API. |
| Cargo.toml | Advances the package version to 0.5.3 without changing dependencies. |
Sequence Diagram
sequenceDiagram
participant Program as ntnt program
participant Walk as snmp_walk
participant Policy as Target policy
participant Agent as SNMP agent
Program->>Walk: target, auth, root OID, options
Walk->>Policy: validate literal address and authority
Policy-->>Walk: allowed
loop Until terminal response or limit look-ahead
Walk->>Agent: GETNEXT(cursor)
alt stale request ID
Agent-->>Walk: stale response
Walk->>Walk: charge bytes and ignore
else ordinary value
Agent-->>Walk: correlated varbind
Walk->>Walk: validate increasing OID and budgets
else terminal exception or outside subtree
Agent-->>Walk: terminal response
Walk-->>Program: complete result
end
end
Walk-->>Program: bounded result or error
Reviews (4): Last reviewed commit: "Merge pull request #172 from ntntlang/fe..." | Re-trigger Greptile
Contributor
Author
|
@greptileai review |
feat: add bounded SNMP walk
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.
Summary
Extend DD-047 with the implementation, compatibility, and security contract for updateable third-party MIB-driven device inventory.
The design separates three typed layers and compiles them into one immutable catalog:
sysObjectIDrules plus bounded literal evidence)It also freezes the bounded GETNEXT WALK envelope and exact resource algebra before that API ships.
Key decisions
ntnt netmon mib compile; polling and ordinary stdlib calls never parse source text..ntntcartifact has exact framing, RFC 8785 canonical JSON, per-symbol/record/aggregate hashes, and a full-artifact SHA-256.Arc<CatalogSnapshot>.mib_load(path)API.snmp_get/snmp_walkremain numeric; named resolution occurs explicitly against one snapshot.std/jobssemantics remain application-owned. PR 2's optionaldevice_inventory.expectedfence returns a no-networkcatalog_mismatchenvelope for queued runs.WALK contract frozen here
max_resultsto distinguish exact completion from truncation.(max_results + 1) * (retries + 1) <= 4096.Inventory contract
Parser research
A throwaway
mib-rs 0.8.0spike verified SMIv1/SMIv2 imports, symbolic and instance OID resolution, andSend + Syncregistry state. Independent ecosystem review found it is the strongest Rust parser/resolver base, but too young and insufficiently budgeted to expose directly to untrusted runtime input.The design therefore requires an ntnt-controlled exact-source fork/vendor snapshot with implicit/system loaders removed, parser concurrency fixed to one by default, checked byte/token/node/import/depth/time/heap budgets, three-platform corpus tests, and an ntnt-owned canonical runtime reader independent of parser-native types.
Validation
git diff --checkcargo run --locked -- docs --validate4484a712a6058cd7a772cc31272fc907f76705318210277da3d1a3abe97aa3e2Delivery sequence