The fork base for every NIL governed-action adapter. Every adapter built from this template speaks the NIL contract (propose -> approve -> commit, skeleton-bounded, earned reversibility): an agent proposes intent, the deterministic kernel is the only thing that commits, and a verb or target the backend never declared is unexpressible, not filtered.
Click "Use this template" to start a new adapter for your backend. You never fork the core (
nilscript) — you fork this.
This is a pristine nilscript scaffold-shim output: a complete, bootable NIL shim whose
edge / state / models / manifest loader are generic and finished, and whose three
fill-in files ship as NotImplementedError stubs. The bundled conformance proof is red
on day one — that is the point. As you fill the stubs, the write verbs flip green.
- Use this template → your repo
my-backend-nil-adapter. - Rename the package
src/nil_adapter_template/→src/my_backend_nil_adapter/and updatename/descriptioninpyproject.toml. - Fill the three files (see CONTRIBUTING.md):
src/<pkg>/system.py—RealSystemClient: the one place I/O happens. Implementcreate/list/update/deleteandexists(target),schema(target),get(target,id)— these light up discovery, the PROPOSE preflight, and generic reversibility.src/<pkg>/translate.py— map each active NIL verb to a native document, and back.src/<pkg>/compensation.py— declare reversible verbs + compensation tokens.
- Prove it.
You do not author these — the generic edge provides them once you implement the I/O above:
GET /nil/v0.1/describe— your skeleton ({system, verbs, targets:{name:{exists, fields[]}}}), the mandatory conformance row.- PROPOSE preflight — refuses (
UPSTREAM_UNAVAILABLE) when a target isn't provisioned. - Generic
resource.*CRUD (create/read/update/delete) over any target, with synthesized reversibility (before-image restore) and id-or-human-identifier resolution.
pip install -e ".[dev]"
pytest # offline conformance proof against the in-memory FakeSystem
On a fresh template pytest fails every active write verb (the stubs raise
NotImplementedError) — proving the harness detects non-conformance, not just conformance.
Fill the stubs until it is green.
Then, against a running shim:
nilscript conformance-test --url https://your-shim.example --verb services.create_invoice
nilscript manifest validate requirements-manifest.json
CI (.github/workflows/conformance.yml) wires all three — see CONTRIBUTING.md
for what each means and what "conformant" precisely is (and is not):
- Offline proof —
pytestgreen (every write verb reachesexecuted; rollback honesty holds). - Live proof —
nilscript conformance-testgreen per verb, across all three reversibility tiers. - Manifest honesty —
nilscript manifest validatepasses; tiers are earned, not asserted.
src/nil_adapter_template/
edge.py # generic NIL edge — do not edit
state.py # proposal/commit state machine — do not edit
models.py # generated request/response models — do not edit
manifest.py # reads requirements-manifest.json — do not edit
run.py # uvicorn entrypoint
system.py # <- FILL: RealSystemClient (the only I/O)
translate.py # <- FILL: verb -> native mapping
compensation.py # <- FILL: reversibility + compensation tokens
conformance/
test_conformance.py # the offline proof (red until you fill the stubs)
requirements-manifest.json
See the core standard at github.com/nilscript-org/nilscript.
This template is part of the NIL (Network Intent Layer) framework, described in a published paper archived on Zenodo with a permanent DOI: 10.5281/zenodo.20774491.
@misc{elkhider2026nil,
title = {Unexpressible, Not Filtered: A Structural Framework for Governing AI-Agent Actions --- the Network Intent Layer},
author = {Elkhider, ElBasheir A. M.},
year = {2026},
doi = {10.5281/zenodo.20774491},
url = {https://doi.org/10.5281/zenodo.20774491}
}