trishul-snmp

Bundle Contract

tsnmp consumes compiled JSON artifacts only. It does not compile raw MIB files and it does not import trishul-smi at runtime.


Purpose

Bundles provide optional symbolic translation and display enrichment.

Core SNMP manager operations work without bundles. Bundles add:


Supported inputs

load_bundle(path) accepts:

A single module JSON file is a valid degenerate bundle.


Atomic contract

Artifact Required Role
Module JSON (IF-MIB.json) yes Source of truth for module, object, and type metadata
manifest.json no Optional inventory sidecar for deterministic directory discovery
oid_index.json no Optional reverse-OID lookup accelerator

The runtime must work when only a single compiled module JSON file is provided. Directory sidecars improve discovery or performance, but they do not define correctness.


Directory discovery rules

If manifest.json is present:

If manifest.json is absent:

If oid_index.json is present:

If oid_index.json is absent:


Validation

On load, tsnmp validates:

Malformed artifacts raise BundleValidationError.


Missing dependency modules

Bundles can still load even if referenced dependency modules are missing.

Effect:

This is deliberate. Missing compiled dependencies should not break the runtime core when the caller intentionally loads a narrow subset such as IF-MIB.json.


Relationship with tsmi

The split is intentional:

tsnmp consumes JSON artifacts only. It does not import or invoke trishul-smi at runtime.


Current compatibility window

Current v0.1 behavior targets the tested tsmi JSON shape.

Still intentionally limited:

If support for non-tsmi JSON schemas adds clear runtime value later, it should land as an explicit adapter contract rather than ambiguous best-effort ingestion.


Examples

Single module JSON:

from trishul_snmp import load_bundle

bundle = load_bundle("./IF-MIB.json")

Directory bundle:

from trishul_snmp import load_bundle

bundle = load_bundle("./mibs-json")

Notes for bundle producers