Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
1c5fa0e
Merge pull request #17 from AdamRickards/docs/16-user-svgs
AdamRickards Aug 28, 2026
3c052ae
Count YAML in GitHub language stats.
AdamRickards Aug 28, 2026
7bfcafe
Merge pull request #19 from AdamRickards/docs/18-yaml-linguist
AdamRickards Aug 28, 2026
5e79ec4
Add read-only sidecar as HTTP over release_matrix --inspect.
AdamRickards Aug 29, 2026
a15ec3e
fix(tests): cache wire YAML loads in audit_common
AdamRickards Aug 29, 2026
8d0984f
Merge pull request #23 from AdamRickards/fix/22-cache-wire-yaml
AdamRickards Aug 29, 2026
e1796cf
Merge pull request #21 from AdamRickards/sidecar/20-readonly
AdamRickards Aug 29, 2026
1278e41
fix(sidecar): return structured inspect results with YAML timeouts
AdamRickards Aug 29, 2026
e438811
Merge pull request #25 from AdamRickards/fix/24-inspect-result
AdamRickards Aug 29, 2026
ac5219a
fix(tests): hoist napalm get_network_driver for live inspect
AdamRickards Aug 29, 2026
68c6ce9
Merge pull request #27 from AdamRickards/fix/26-inspect-napalm-import
AdamRickards Aug 29, 2026
527428d
fix(harness): split inspect timeout into open_timeout_s/call_timeout_…
AdamRickards Aug 29, 2026
de1f830
refactor(harness): fan out inspect protocols as independent workers
AdamRickards Aug 29, 2026
8b0b9e8
Merge pull request #29 from AdamRickards/fix/28-inspect-open-call
AdamRickards Aug 29, 2026
b8f22c2
feat(sidecar): optional trace copies SSH show text onto inspect result
AdamRickards Aug 29, 2026
f92cf9f
Merge pull request #35 from AdamRickards/fix/34-sidecar-trace
AdamRickards Aug 29, 2026
2e6208b
feat(sidecar): POST /v1/sync pulls main, checks out an allowlisted PR…
AdamRickards Aug 29, 2026
d130ffb
Merge pull request #37 from AdamRickards/fix/36-sidecar-sync
AdamRickards Aug 29, 2026
e5f5886
fix(wire): SSH dns servers table keys by No. column, not row_num
AdamRickards Aug 29, 2026
553ec9b
Merge pull request #38 from AdamRickards/fix/33-ssh-dns-key-column
AdamRickards Aug 29, 2026
606b9ce
fix(wire): map HiDiscovery SSH CLI mode spelling to schema tokens (#77)
AdamRickards Aug 29, 2026
7027189
fix(schema): get_qos_mapping rows from accessible SNMP suffix (#78)
AdamRickards Aug 29, 2026
2695cdb
fix(schema): get_users rows from accessible SNMP implied-string suffi…
AdamRickards Aug 29, 2026
ebdc54e
fix(schema): get_vlans SNMP rows from StaticTable suffix (#80)
AdamRickards Aug 29, 2026
c72db8f
fix(schema): get_arp_table from ipNetToMediaTable (#81)
AdamRickards Aug 29, 2026
3424a6c
fix(schema): ipv6 neighbors from ipNetToMediaTable (#82)
AdamRickards Aug 29, 2026
3dbd72c
fix(schema): get_sflow_receiver SNMP rows from accessible suffix (#83)
AdamRickards Aug 29, 2026
8bc0c22
fix(schema): sflow sampler/poller SNMP from DataSource suffix (#84)
AdamRickards Aug 29, 2026
9ae08cb
fix(schema): get_lldp_neighbors SNMP from RemTable suffix (#85)
AdamRickards Aug 29, 2026
5c75d1c
fix(schema): get_snmp_trap_destinations from TAddress suffix (#86)
AdamRickards Aug 29, 2026
2b3df3e
fix(schema): get_devsec_history SNMP from TimeStamp suffix (#87)
AdamRickards Aug 29, 2026
e72870e
fix(schema): get_route_to SNMP dest from inetCidr suffix (#88)
AdamRickards Aug 29, 2026
33dead4
fix(test): parity-compare nested row fields that are not sub_tables (…
AdamRickards Aug 29, 2026
ddcc67b
fix(test): sidecar pick device by has_capable for named reads
AdamRickards Aug 30, 2026
30eac54
fix(schema): SSH sw_major captures only the major number
AdamRickards Aug 30, 2026
ce85379
Merge pull request #93 from AdamRickards/fix/91-pick-has-capable
AdamRickards Aug 30, 2026
4fc74cc
Merge pull request #94 from AdamRickards/fix/57-sw-major-ssh
AdamRickards Aug 30, 2026
862db48
docs: retarget base.py module docstring to crude-engine
AdamRickards Aug 30, 2026
f511073
docs: retarget ssh_driver.py module docstring to crude-engine
AdamRickards Aug 30, 2026
70291e7
docs: retarget offline_hios.py module docstring to crude-engine
AdamRickards Aug 30, 2026
d2d4ce7
docs: retarget snmp_transport.py module docstring to crude-engine
AdamRickards Aug 30, 2026
5979fd0
docs: retarget mops_transport.py module docstring to crude-engine
AdamRickards Aug 30, 2026
455d93e
docs: retarget mops_driver.py module docstring to crude-engine
AdamRickards Aug 30, 2026
00a34e9
docs: retarget snmp_driver.py module docstring to crude-engine
AdamRickards Aug 30, 2026
b032aac
docs: retarget mops_client.py module docstring to crude-engine
AdamRickards Aug 30, 2026
0c756a2
Merge pull request #95 from AdamRickards/docs/15-first-lines
AdamRickards Aug 30, 2026
f2c4748
docs: live authored leftovers no longer treat CLAUDE.md and adamr pat…
AdamRickards Aug 30, 2026
ecfc253
Merge pull request #100 from AdamRickards/docs/97-live-authored-lefto…
AdamRickards Aug 30, 2026
6a1d015
docs: mark leftover generator audits dead; retarget two read-only walks
AdamRickards Aug 30, 2026
0a08d49
Merge pull request #101 from AdamRickards/docs/98-generator-audit-paths
AdamRickards Aug 30, 2026
64a1aec
test: leftover capture/replay — retarget engine, keep shim honest
AdamRickards Aug 30, 2026
bcb73e9
Merge pull request #102 from AdamRickards/fix/99-replay-import
AdamRickards Aug 30, 2026
139fe69
fix(schema): point login-policy complexity at real usermgmt keys (#111)
AdamRickards Aug 30, 2026
5761086
docs: refresh SCHEMA_MODEL NAPALM hitlist to live canonical keys (#114)
AdamRickards Aug 30, 2026
77b7e07
docs: archive TODO.md / TODO-old.md / TODO_HITLIST.md — leftovers liv…
AdamRickards Aug 30, 2026
254f1ad
fix(test): --render must not recreate docs/TODO_HITLIST.md (#118)
AdamRickards Aug 30, 2026
fa39dd4
docs: DIAGNOSTIC_PROCESS tagged-loop flowcharts (fault detection + fi…
AdamRickards Aug 30, 2026
4532ca2
fix(schema): declare named getter defaults as attributes (#4) (#120)
AdamRickards Aug 30, 2026
9485c0a
docs: regen API_REFERENCE + METHOD_REFERENCE after #4 YAML (#121)
AdamRickards Aug 30, 2026
87aad8a
docs: SCHEMA_MODEL principle 2 — defaults keys must be attributes wit…
AdamRickards Aug 30, 2026
d58c2fb
docs(generator): leftover MIB emit matches hand-fixed keep-list (#103)
AdamRickards Aug 30, 2026
3095315
docs(generator): restore trailing newline on leftover MIB generator
AdamRickards Aug 30, 2026
fc21b15
docs(generator): restore trailing newline on overrides.yaml
AdamRickards Aug 30, 2026
d2c83cd
docs(generator): restore trailing newline on README.md
AdamRickards Aug 30, 2026
9de0c60
Merge pull request #126 from AdamRickards/docs/103-generator-emit-diff
AdamRickards Aug 30, 2026
4dd3ddd
fix(schema): split auto-disable intf table, reasons table, and reset …
AdamRickards Aug 30, 2026
871e0c9
docs: regen catalog + references after get_auto_disable_reasons
AdamRickards Aug 30, 2026
5854961
Merge pull request #127 from AdamRickards/fix/108-auto-disable-split-…
AdamRickards Aug 31, 2026
05062d9
fix(schema): add tracking.yaml for hm2TrackingConfigEntry (#107)
AdamRickards Aug 30, 2026
a161b83
docs: regen catalog + references after tracking.yaml (46 features).
AdamRickards Aug 31, 2026
b2a4bc1
Merge pull request #128 from AdamRickards/fix/107-tracking-schema-ont…
AdamRickards Aug 31, 2026
2d10797
fix(engine): key mapped tables by wire index, not primary_key value
AdamRickards Aug 31, 2026
c39932e
Merge pull request #130 from AdamRickards/fix/engine-keymap-idx
AdamRickards Aug 31, 2026
945c977
fix(driver): unwrap tag tuples before AGGREGATE_TAGS membership
AdamRickards Sep 1, 2026
c06ce79
Merge pull request #136 from AdamRickards/fix/ssh-tag-tuple
AdamRickards Sep 1, 2026
9aba4e5
fix(overlay): SSH table key_column + token maps (#137 #138 #139)
AdamRickards Sep 1, 2026
b15acd1
Merge pull request #140 from AdamRickards/fix/ssh-overlay-key-column-…
AdamRickards Sep 1, 2026
888ed4d
docs(diagnostic): point ladder at in-repo CLI/MIB/MOPS, not a v1 tree
AdamRickards Sep 1, 2026
5c1191e
Merge pull request #141 from AdamRickards/docs/diagnostic-step5
AdamRickards Sep 1, 2026
c899a05
Add local/agents as living bot-labour process law.
AdamRickards Sep 6, 2026
0735c67
Merge pull request #142 from AdamRickards/process/local-agents-law
AdamRickards Sep 6, 2026
90988d6
local/agents: decision trail on issues for glanceable audit.
AdamRickards Sep 6, 2026
ce2127a
Merge pull request #143 from AdamRickards/process/decision-trail
AdamRickards Sep 6, 2026
7820abb
local/agents: multi-hop decision trail on one issue.
AdamRickards Sep 6, 2026
e8adf8d
Merge pull request #144 from AdamRickards/process/multi-hop-trail
AdamRickards Sep 6, 2026
558d273
local/generator: drop machine-absolute path hardcodes.
AdamRickards Sep 6, 2026
df0a4fc
Merge pull request #145 from AdamRickards/fix/generator-no-machine-paths
AdamRickards Sep 6, 2026
53e78c2
chore: scrub remaining machine-path mentions from tracked docs.
AdamRickards Sep 6, 2026
b1f2adf
Merge pull request #146 from AdamRickards/chore/scrub-remaining-machi…
AdamRickards Sep 6, 2026
b83fe6b
docs: anchor compute egress-only vs assemble/set_format (#109).
Sep 9, 2026
d33a18c
Merge pull request #147 from AdamRickards/docs/compute-egress-only-109
AdamRickards Sep 9, 2026
a204a2b
docs: note compute.sort intent belongs in YAML registry (#116).
Sep 9, 2026
4b492a1
Merge pull request #148 from AdamRickards/docs/sort-registry-intent-116
AdamRickards Sep 9, 2026
b0a3559
docs: boolean in/out via matrix + Gate 2 (open #115).
Sep 9, 2026
8234ba6
Merge pull request #149 from AdamRickards/docs/bool-matrix-intent-115
AdamRickards Sep 9, 2026
ff60e97
docs: matrix round-trip test floor for open #115.
Sep 9, 2026
47853b7
Merge pull request #150 from AdamRickards/docs/matrix-roundtrip-floor…
AdamRickards Sep 9, 2026
f808473
process: name test_crude_matrix harness for #115.
Sep 9, 2026
bfc9e44
Merge pull request #151 from AdamRickards/process/matrix-harness-115
AdamRickards Sep 9, 2026
3b8acae
process: matrix inventory + validate_schemas type edges (#115).
Sep 10, 2026
225adfd
Merge pull request #152 from AdamRickards/process/matrix-schema-type-…
AdamRickards Sep 10, 2026
43b29c2
process: matrix allow-list beats schema into shape (#115).
Sep 10, 2026
03f2442
Merge pull request #153 from AdamRickards/process/matrix-beat-existin…
AdamRickards Sep 10, 2026
7e0eb9e
docs: matrix discover = completeness + compliance map (#115).
Sep 10, 2026
4396532
Merge pull request #154 from AdamRickards/process/matrix-completeness…
AdamRickards Sep 10, 2026
7468b56
docs: goal debug=foreign logs, trace=engine pipeline
Sep 10, 2026
7857efa
Merge pull request #155 from AdamRickards/docs/debug-vs-trace-goal
AdamRickards Sep 10, 2026
3546337
docs(agents): capture Architect orchestration checks
Sep 10, 2026
c0e23f8
docs(agents): require engine trace to locate pipeline misses
Sep 10, 2026
9cf7c9b
Merge pull request #157 from AdamRickards/docs/architect-orchestratio…
AdamRickards Sep 10, 2026
66394fd
docs(agents): prefer existing tools before new primitives
Sep 10, 2026
bc3d3cb
Merge pull request #161 from AdamRickards/docs/prefer-existing-tools-…
AdamRickards Sep 11, 2026
3415cd3
docs(agents): generator TEMP iterate + wire wrong-input loop (#163)
AdamRickards Sep 11, 2026
3469b51
fix(generator): named-TC teach for leftover MIB emit (#162) (#164)
AdamRickards Sep 11, 2026
26aaed9
test: offline vs gold read matrix (#165) (#166)
AdamRickards Sep 12, 2026
d86aeba
test: offline-vs-gold flow lane + expand floors (#167) (#168)
AdamRickards Sep 12, 2026
b88e60c
test: offline-gold catalogue draft + ntp/syslog/hidiscovery floors (#…
AdamRickards Sep 12, 2026
c0eacdc
docs(agents): CI-gate wide-sweep receipt + admin_status heuristic nit…
AdamRickards Sep 12, 2026
1a96b6c
fix(sidecar): /v1/run echoes picked pool label, sw_level, and feature…
AdamRickards Sep 12, 2026
c5e1adb
feat(sidecar): real op:clean + dirty/head detail on sync refusals (#174)
AdamRickards Sep 12, 2026
6029951
test: offline-gold floors login_policy + gvrp + gmrp (#169) (#175)
AdamRickards Sep 12, 2026
7cf4bf2
fix(wire): ExtNVM INDEX from status suffix (#39) (#176)
AdamRickards Sep 12, 2026
d678558
fix(overlay): pre-login banner text next-line regex (#41) (#177)
AdamRickards Sep 12, 2026
9e78c8e
fix(inspect): attribute timeouts to open or call, not one combined de…
AdamRickards Sep 12, 2026
fa588d0
test: offline-gold floors dai + dhcp_snooping + session_config (#169)…
AdamRickards Sep 12, 2026
8ef637a
test: offline-gold floors snmp_config + services + rstp (#169) (#181)
AdamRickards Sep 12, 2026
ebcd5d9
test: offline-gold floors loop + vlan_ingress + autodisable reasons (…
AdamRickards Sep 12, 2026
8e5dd9d
test: offline-gold floors snmp_information + qos + remote_auth (#169)…
AdamRickards Sep 12, 2026
f23ca89
test: offline-gold floors system_info + port_security + rstp_port (#1…
AdamRickards Sep 12, 2026
f846825
test: offline-gold floors config_remote + qos_mapping + storm_control…
AdamRickards Sep 12, 2026
a7dd0ea
test: offline-gold floors ip_restrict + arp_inspection + signal_conta…
AdamRickards Sep 12, 2026
956a64e
test: offline-gold floors config_status + management_priority + watch…
AdamRickards Sep 12, 2026
2fb10f8
test: offline-gold floors management + mrp_sub_ring + vrrp (#169) (#188)
AdamRickards Sep 12, 2026
680c0de
test: offline-gold floors ntp_servers + users + profiles (#169) (#189)
AdamRickards Sep 12, 2026
3d954c6
test: offline-gold floors snmp_trap_dest + vrrp_instances + config (#…
AdamRickards Sep 12, 2026
dcac745
test: offline-gold floors arp + mac_table + interfaces_ip (#169) (#191)
AdamRickards Sep 12, 2026
976d71e
test: offline-gold floors vrrp_tracking + ip_addresses + devsec_statu…
AdamRickards Sep 12, 2026
ead7e19
docs(agents): Effort objects for HITL→buzz→output (#194)
AdamRickards Sep 12, 2026
a4c816f
docs(agents): Effort board — Lane B poking RouterID teach (#196)
AdamRickards Sep 12, 2026
9bf1824
docs(generator): teach RouterID named-TC → string (#162) (#197)
AdamRickards Sep 12, 2026
8e5cf5e
docs(agents): Effort board — Lane B next poke AreaID (#198)
AdamRickards Sep 12, 2026
9934889
docs(generator): teach AreaID named-TC → string (#162) (#199)
AdamRickards Sep 12, 2026
5fb7d6c
docs(generator): teach VlanId named-TC → string (#162) (#201)
AdamRickards Sep 12, 2026
2734b4d
docs(agents): Effort board — Lane B next poke VlanId (#200)
AdamRickards Sep 12, 2026
74fd681
docs(generator): teach LacpKey named-TC → string (#162) (#203)
AdamRickards Sep 12, 2026
c4fa86d
docs(generator): teach Timeout named-TC → string (#162) (#207)
AdamRickards Sep 12, 2026
e17948c
docs(agents): Effort board — #162 named teaches done; residuals next …
AdamRickards Sep 12, 2026
dc3b8b4
fix(wire): hm2agentswitchipvlanid VlanId as string (#205) (#209)
AdamRickards Sep 12, 2026
0352975
fix(wire): InetAddressType/PrefixLength live-int → string (#205) (#210)
AdamRickards Sep 12, 2026
c29a3d9
fix(wire): INTEGER{enabled,disabled} live-int → boolean (#205) (#211)
AdamRickards Sep 12, 2026
0604cab
docs(agents): Effort board — overnight #205 delta (vd 105→63) (#212)
AdamRickards Sep 13, 2026
6724659
fix(inspect): headroom for open/call budgets after #179 (#92) (#215)
AdamRickards Sep 13, 2026
1609c36
docs(agents): Test-bot call-timeout resolution after phase attributio…
AdamRickards Sep 13, 2026
f4380b6
wire(ssh): drop get_port_security {index} read fanout (#56) (#219)
AdamRickards Sep 13, 2026
dfbffe8
fix(inspect): last_command heartbeat on phase=call timeout (#218) (#220)
AdamRickards Sep 13, 2026
8f2a7b4
fix(inspect): SSH session_log_tail on phase=call timeout (#222) (#223)
AdamRickards Sep 13, 2026
0cbe2cd
fix(inspect): SSH close logout Y/N ≠ phase=call (#224) (#225)
AdamRickards Sep 13, 2026
d4b74f3
docs(test): floor get_ip_addresses not get_interfaces_ip alias (#230)…
AdamRickards Sep 13, 2026
1209694
fix(wire): Lane B SNMP index keys for DAI/FDB/SigCon PS (#236)
AdamRickards Sep 13, 2026
bd52830
docs(agents): auto-park Engine/HITL NO_HOLE list (check 8) (#237)
AdamRickards Sep 13, 2026
8f78704
docs(agents): park SNMP last_oid heartbeat (#47) (#238)
AdamRickards Sep 13, 2026
e80e09c
fix(wire): drop get_interfaces SNMP fanout walks (#47) (#239)
AdamRickards Sep 13, 2026
48bde67
fix(schema): bind get_management_priority to netconfig wire (#240) (#…
AdamRickards Sep 13, 2026
3f532ce
fix(schema/wire): Offline shape for vlans, auto_disable, poe (#246)
AdamRickards Sep 13, 2026
b3095e2
fix(schema): Offline floors for vlans ports / auto_disable enabled (#…
AdamRickards Sep 13, 2026
098cb5b
fix(schema): coerce get_vlan_egress untagged_ports None/'None' → [] (…
AdamRickards Sep 13, 2026
88ea7ee
docs(agents): park #68 software INDEX collapse with Engine list (#256)
AdamRickards Sep 13, 2026
3ca9974
test: offline-gold floors get_vlans + get_vlan_egress + get_auto_disa…
AdamRickards Sep 13, 2026
9840a9a
docs(agents): reconcile Effort board to floors=52 / soft SSH (#259)
AdamRickards Sep 13, 2026
e31e196
docs(agents): fold open-issue orphans into Effort board / park (#260)
AdamRickards Sep 13, 2026
9440122
docs: clear leftover debug↔trace wording (#156) (#262)
AdamRickards Sep 13, 2026
fcbf968
docs(agents): park #156 Engine debug↔trace leftovers after Docs #262 …
AdamRickards Sep 13, 2026
31b8efe
docs(agents): Effort board — #264 fan-in + #129 inventory done (#265)
AdamRickards Sep 13, 2026
c36ddf0
fix(wire): SSH value_map for dhcp_snooping Location and management Pr…
AdamRickards Sep 13, 2026
547cb9f
fix(wire): drop get_interface_statistics SNMP fanout walks (#264) (#267)
AdamRickards Sep 13, 2026
afbfcd0
docs(agents): Effort board — #44/#54 closed after #266 prove (#268)
AdamRickards Sep 13, 2026
7c33e06
docs(agents): Effort board — #264 closed; #46 SSH remains (#270)
AdamRickards Sep 13, 2026
3025a12
fix(wire): SSH get_interface_statistics from show interface counters …
AdamRickards Sep 13, 2026
e77c06c
docs(agents): Effort board — #46 closed; #272 physical filter (#273)
AdamRickards Sep 13, 2026
5a7e0b0
fix(schema): get_optics keyed by detected SFP, SSH show sfp (#76)
AdamRickards Sep 13, 2026
1145769
docs(agents): park #272 egress physical filter NO_HOLE
AdamRickards Sep 13, 2026
806d697
docs(agents): Effort board — #272 parked Engine
AdamRickards Sep 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# YAML is the product (schema + wire). Linguist hides data languages by default.
*.yaml linguist-detectable=true
*.yml linguist-detectable=true
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ No feature-specific Python. Wire YAMLs (generated from MIB) declare device truth

## Installation

Not on PyPI yet (first publish is 2.10.0). From this repo:

```
pip install crude-engine
pip install -e .
```

For NAPALM integration: `pip install napalm-hios` (installs crude-engine as a dependency).
NAPALM integration is the separate `napalm-hios` 2.0 shim — not on PyPI yet.

## Usage

Expand Down Expand Up @@ -66,7 +68,7 @@ for operation in ['create', 'read', 'upsert', 'delete', 'execute']:
| [status.html](docs/status.html) | Program poster — where we are, next task, proofs |
| [SEED.md](docs/program/SEED.md) | Why + how work is allowed to happen |
| [ROADMAP.md](docs/ROADMAP.md) | Versions and exit criteria (2.10 = first PyPI) |
| [TODO.md](docs/TODO.md) | Current cycle tasks |
| [GitHub issues](https://github.com/AdamRickards/crude-engine/issues) | Leftover work (prove-then-file or comment-close) |
| [METHOD_REFERENCE.md](docs/METHOD_REFERENCE.md) | Quick reference — methods, return keys, one line each |
| [API_REFERENCE.md](docs/API_REFERENCE.md) | Full reference — return schemas, per-protocol sources, wire detail |
| [SCHEMA_MODEL.md](docs/SCHEMA_MODEL.md) | Canonical schema contract — structural rules + shape rules |
Expand Down
3 changes: 3 additions & 0 deletions crude_engine/drivers/SSH_state.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ levels:
user:
prompt_pattern: '[^#]>\s*$'
exit: {command: "logout", to: null}
# Gate detect strings are literal prompt fragments (not regex).
# ssh_transport.close() re.escapes them for Netmiko read_until_pattern
# so "(Y/N)" matches the live logout confirm (#224 / session_log).
gates:
- {detect: "Are you sure (Y/N)", response: "y", read_timeout: 2}
- {detect: "do you want to save", response: "n", read_timeout: 1}
Expand Down
7 changes: 6 additions & 1 deletion crude_engine/drivers/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
base.py — Base driver interface for napalm-hios.
base.py — Base driver interface for crude-engine.

Layer: Driver (abstract). The contract between engine and transport.
Engine calls gather() and set_values(). Driver calls transport. Nothing
Expand Down Expand Up @@ -72,6 +72,11 @@ def wire_type_defaults(self) -> Dict[str, str]:
"""Schema type → default tag from driver YAML."""
return self._driver_config.get("wire_type_defaults", {})

@staticmethod
def _tag_name(tag):
"""Bare registry function name from a _resolve_tag() result."""
return tag[0] if isinstance(tag, tuple) else tag

@property
def protocol_defaults(self) -> Dict[str, Any]:
"""Protocol-level source defaults (e.g. method: walk)."""
Expand Down
2 changes: 1 addition & 1 deletion crude_engine/drivers/mops_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- HTTP Basic auth (same credentials as SSH/SNMP)
- No net-snmp/pysnmp dependency — just requests + xml.etree

Adapted from Hirschy-MOPS/lib/mops.py for use as a napalm-hios transport.
Adapted from Hirschy-MOPS/lib/mops.py for use as a crude-engine transport.

Usage:
from crude_engine.drivers.mops_client import MOPSClient
Expand Down
2 changes: 1 addition & 1 deletion crude_engine/drivers/mops_driver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
MOPS.py — MOPS protocol driver for napalm-hios.
MOPS.py — MOPS protocol driver for crude-engine.

Layer: Driver. Translates wire YAML source dicts into MOPS operations.
Owns: get_multi batching, index keying, row filtering, tag dispatch.
Expand Down
2 changes: 1 addition & 1 deletion crude_engine/drivers/mops_transport.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
mops_transport.py — MOPS transport for napalm-hios.
mops_transport.py — MOPS transport for crude-engine.

Layer: Transport. Owns HTTPS session and raw MIB operations via XML.
Cannot: interpret data meaning, decide what to gather, know about features.
Expand Down
17 changes: 7 additions & 10 deletions crude_engine/drivers/offline_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,10 @@ def get(self, mib_name, node_name, attributes, decode_strings=True):
def get_multi(self, queries, decode_strings=True):
"""Multi-node lookup from in-memory data.

Returns: full parsed response dict (same as MOPSClient.get_multi)
Returns: dict keyed by MIB name, then node name: {mib: {node: [rows]}}
— same shape as MOPSClient.get_multi (parsed["mibs"]).
"""
result = {
"message_id": "0",
"mibs": {},
"errors": [],
}
mibs = {}

for mib_name, node_name, attrs in queries:
mib_data = self._data.get(mib_name)
Expand All @@ -354,11 +351,11 @@ def get_multi(self, queries, decode_strings=True):
filtered[attr] = value
filtered_entries.append(filtered)

if mib_name not in result["mibs"]:
result["mibs"][mib_name] = {}
result["mibs"][mib_name][node_name] = filtered_entries
if mib_name not in mibs:
mibs[mib_name] = {}
mibs[mib_name][node_name] = filtered_entries

return result
return mibs

# ------------------------------------------------------------------
# MOPSClient interface — write
Expand Down
2 changes: 1 addition & 1 deletion crude_engine/drivers/offline_hios.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
offline_hios.py — Offline transport for napalm-hios.
offline_hios.py — Offline transport for crude-engine.

Layer: Transport. Loads config XML files via MOPS interface.
Inherits MOPSHIOS — offline uses the same driver/engine path as MOPS.
Expand Down
2 changes: 1 addition & 1 deletion crude_engine/drivers/snmp_driver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
SNMP.py — SNMP protocol driver for napalm-hios.
SNMP.py — SNMP protocol driver for crude-engine.

Layer: Driver. Translates wire YAML source dicts into SNMP operations.
Owns: walk batching, scalar normalization, index decomposition, tag dispatch.
Expand Down
2 changes: 1 addition & 1 deletion crude_engine/drivers/snmp_transport.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
snmp_transport.py — SNMP transport for napalm-hios.
snmp_transport.py — SNMP transport for crude-engine.

Layer: Transport. Owns session, auth, and raw OID GET/SET/WALK.
Cannot: interpret data meaning, decide what to gather, know about features.
Expand Down
18 changes: 15 additions & 3 deletions crude_engine/drivers/ssh_driver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
SSH_gather.py — SSH protocol driver for napalm-hios.
SSH_gather.py — SSH protocol driver for crude-engine.

Layer: Driver. Translates wire YAML source dicts into SSH CLI operations.
Owns: command dedup, level navigation, CLI parsing, response caching.
Expand Down Expand Up @@ -84,6 +84,18 @@ def gather(self, sources: List[Tuple[str, Dict]],
logger.debug("SSH command failed: %s — %s", cmd, str(e)[:80])
ssh_cache[(cmd, level)] = ""

# Keep the command text for inspect/sidecar trace. Does not change
# parse or what was sent. Cap each blob so a poll body stays usable.
_cli = []
for (cmd, level), resp in ssh_cache.items():
text = resp if isinstance(resp, str) else str(resp)
if len(text) > 32768:
text = text[:32768] + "\n…truncated"
_cli.append({"command": cmd, "level": level, "response": text})
self.last_cli = _cli
if getattr(self, "transport", None) is not None:
self.transport.last_cli = _cli

# Phase 3: Each attribute parses from cached response
for name, source in sources:
if source.get("iterate_from"):
Expand All @@ -97,7 +109,7 @@ def gather(self, sources: List[Tuple[str, Dict]],
if val is None:
continue
tag = self._resolve_tag(source.get("tag", ""), source, attr_name=name)
if isinstance(val, dict) and tag in AGGREGATE_TAGS:
if isinstance(val, dict) and self._tag_name(tag) in AGGREGATE_TAGS:
# Aggregate tag: pass whole dict to transform
results[name] = self._apply_pipeline(val, source, tag, value_maps)
elif isinstance(val, dict):
Expand Down Expand Up @@ -177,7 +189,7 @@ def gather(self, sources: List[Tuple[str, Dict]],
resp = iterate_cache[cache_key]
val = self._parse_response(resp, source)
if val is not None:
if isinstance(val, dict) and tag in AGGREGATE_TAGS:
if isinstance(val, dict) and self._tag_name(tag) in AGGREGATE_TAGS:
val = self._apply_pipeline(val, source, tag, value_maps)
elif isinstance(val, dict):
val = {k: self._apply_pipeline(v, source, tag, value_maps)
Expand Down
Loading
Loading