The Python host contract as DATA: resources/vis-contract/python-host.edn.
Everything the vis Python module can ask its host to do is one entry in that
document — the polyglot global the engine binds, how many positional arguments
the callable takes, and what the op does when there is no Vis host at all. The
engine derives the names it binds from here, the injected host is built from
here, and the package's outside-the-sandbox host derives its behavior from
here, so a new host call is added to the document and nowhere else.
This project is com.blockether/vis-contract and requires NO Vis namespace, so
an extension can compile against the declaration without the engine. Its PyPI
half ships package-document as vis_contract/contract.json.
The human-input vocabulary is the one part this project does not own:
internal.human-input.spec declares it and PASSES it to package-document,
because a closed vocabulary with two definitions is exactly the bug a contract
exists to prevent.
The document is validated the moment it is read: a malformed contract is a
broken build, not a runtime surprise inside somebody's extension.
contract.python-host-test is what fails when a reader drifts.
The Python host contract as DATA: `resources/vis-contract/python-host.edn`. Everything the `vis` Python module can ask its host to do is one entry in that document — the polyglot global the engine binds, how many positional arguments the callable takes, and what the op does when there is no Vis host at all. The engine derives the names it binds from here, the injected host is built from here, and the package's outside-the-sandbox host derives its behavior from here, so a new host call is added to the document and nowhere else. This project is `com.blockether/vis-contract` and requires NO Vis namespace, so an extension can compile against the declaration without the engine. Its PyPI half ships [[package-document]] as `vis_contract/contract.json`. The human-input vocabulary is the one part this project does not own: `internal.human-input.spec` declares it and PASSES it to [[package-document]], because a closed vocabulary with two definitions is exactly the bug a contract exists to prevent. The document is validated the moment it is read: a malformed contract is a broken build, not a runtime surprise inside somebody's extension. `contract.python-host-test` is what fails when a reader drifts.
(host-globals)The __vis_host_* polyglot globals the engine binds, in document order.
The `__vis_host_*` polyglot globals the engine binds, in document order.
(live-vocabulary)The live verb's lifecycle grammar: the op an options map without one means,
the op that MOUNTS a view, the ops that drive the view it answered, and the
window a handle may coalesce pushes inside.
The `live` verb's lifecycle grammar: the op an options map without one means, the op that MOUNTS a view, the ops that drive the view it answered, and the window a handle may coalesce pushes inside.
(op-names)The op names the packaged vis module's _host object answers, in document order.
The op names the packaged `vis` module's `_host` object answers, in document order.
(ops)Every declared host op, in document order.
Every declared host op, in document order.
(package-document human-input)The contract as vis_contract/contract.json: snake_case string keys, ops in
document order, and the closed human-input vocabulary the outside host prompts
with. human-input comes from the namespace that OWNS that vocabulary --
(com.blockether.vis.internal.human-input.spec/contract-vocabulary).
The contract as `vis_contract/contract.json`: snake_case string keys, ops in document order, and the closed human-input vocabulary the outside host prompts with. `human-input` comes from the namespace that OWNS that vocabulary -- `(com.blockether.vis.internal.human-input.spec/contract-vocabulary)`.
(package-document-json human-input)package-document as the checked-in file's exact bytes.
[[package-document]] as the checked-in file's exact bytes.
Where the rendered document is checked in, from the repository root.
Where the rendered document is checked in, from the repository root.
(shell-vocabulary)The shell verb's lifecycle grammar: the op an options map without one means,
the ops that SPAWN a process, and the ops that drive the handle one answered.
The `shell` verb's lifecycle grammar: the op an options map without one means, the ops that SPAWN a process, and the ops that drive the handle one answered.
(version)The contract version. Bumped when an op is added, removed or re-shaped.
The contract version. Bumped when an op is added, removed or re-shaped.
(write-package-document! human-input)(write-package-document! human-input path)Re-render package-document-path. Run me after changing the contract or the
human-input vocabulary; python_package_test is what notices you did not.
Re-render [[package-document-path]]. Run me after changing the contract or the human-input vocabulary; `python_package_test` is what notices you did not.
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 |