Discovery. A probe is a law stated as a tiny script with an expected stdout, run in the runtime under study.
printed exactly :expect -> :yes (law holds here) ran, printed anything else -> :no (law refuted here) never ran (launch error, timeout) -> :unknown prerequisite (:needs) not :yes -> :unknown, probe skipped
Every verdict becomes Evidence carrying the script, exit status and output, so any later choice can be traced back to what was observed. This namespace is pure: the runner is passed in.
Discovery. A probe is a law stated as a tiny script with an expected stdout, run in the runtime under study. printed exactly :expect -> :yes (law holds here) ran, printed anything else -> :no (law refuted here) never ran (launch error, timeout) -> :unknown prerequisite (:needs) not :yes -> :unknown, probe skipped Every verdict becomes Evidence carrying the script, exit status and output, so any later choice can be traced back to what was observed. This namespace is pure: the runner is passed in.
(discover runtime-id run!)(discover runtime-id run! probes)Run every probe through run! (fn [script] -> {:argv :exit :out :err} or {:argv :error}), in order, folding the evidence into a fresh profile.
Run every probe through run! (fn [script] -> {:argv :exit :out :err} or
{:argv :error}), in order, folding the evidence into a fresh profile.(judge {:keys [expect]} {:keys [out error]})Verdict of one probe run. A run that never happened proves nothing.
Verdict of one probe run. A run that never happened proves nothing.
(on-demand lang cap)Probe for a capability the fixed catalog cannot list ahead of time, in the runtime's language, or nil. :bin/<prog> exec finds prog: an executable file on PATH (or prog itself when it holds a slash). Builtins do not count. :sh.cmd/<prog> the shell resolves the word prog (command -v): PATH, builtins and applets all count. sh runtimes only.
Probe for a capability the fixed catalog cannot list ahead of time, in
the runtime's language, or nil.
:bin/<prog> exec finds prog: an executable file on PATH (or prog
itself when it holds a slash). Builtins do not count.
:sh.cmd/<prog> the shell resolves the word prog (command -v): PATH,
builtins and applets all count. sh runtimes only.Ordered so that every :needs is probed before the probes that rely on it. Probe scripts avoid output redirection on purpose: a restricted shell must still be able to answer every other question.
Ordered so that every :needs is probed before the probes that rely on it. Probe scripts avoid output redirection on purpose: a restricted shell must still be able to answer every other question.
(resolve-caps profile runtime-id lang run! caps)Probe every cap in caps that is still :unknown and has an on-demand probe in lang, folding the evidence into profile. Other caps are left as they are.
Probe every cap in caps that is still :unknown and has an on-demand probe in lang, folding the evidence into profile. Other caps are left as they are.
(run-evidence runtime-id {:keys [cap script expect] :as probe} result)Evidence for a probe that ran (or tried to).
Evidence for a probe that ran (or tried to).
(skip-evidence runtime-id {:keys [cap script expect]} profile unproven)Evidence for a probe not run because a prerequisite was not proven.
Evidence for a probe not run because a prerequisite was not proven.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |