Modules
Cheat sheet · https://pcornel.dk/topic.php?topic=5218
Answer
Modules package reusable script code and dependencies. Operational reliability depends on version, provenance, load path, compatibility and the difference between successful import and correct runtime behavior.
Remember
- Module import ≠ compatible dependency; loading can succeed while an invoked function or API later fails.
- Module name ≠ trusted source; path precedence or package repositories can resolve an unintended implementation.
- Latest version ≠ safest version automatically; breaking changes and removed defaults can alter behavior.
- Dependency installed ≠ dependency active in this runtime; virtual environments, module paths and interpreter versions matter.
First checks
python3 -c 'import <module>'— import worksGet-Module -ListAvailable <name>— PowerShell modulessource lib.sh— Bash library
Verify in this order
shared module → imported by scripts
Where it usually breaks
Successful module loading proves only that a runtime resolved and initialized some dependency; it does not prove provenance, supported version or correct behavior for the intended target.
Script/input → command/module binding → local/remoting session → request accepted → command result → target object read-back → effective runtime state → workload. Preserve at least three independent checks: prerequisite/interface or identity/transport state; the owning control/service/policy state; then effective data-plane, backend or workload state. A healthy upstream boundary does not prove the downstream consumer or return path.
Modules scripting boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Input / runtime | Effective inputs, runtime, working context and dependency versions are explicit | Hidden defaults, stale environment, wrong interpreter/path or unvalidated input |
| Logic / execution | Branch/function/module decisions and external actions expose per-operation results | Swallowed failures, shell reinterpretation, blind retries or last-result-wins behavior |
| Result / proof | Exit/exception/log evidence is correlated with independent target read-back | Process success or printed output treated as target success |
| Recovery / troubleshooting | First failed boundary is preserved, changed minimally and retested | Random edits, catch-all suppression or evidence destroyed before diagnosis |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5218