<nil>NILScript

Reference

Spec at a Glance

Every performative, tier, refusal code, and node type — the quick-reference card for the protocol and the DSL.

Performatives

A closed set of seven on the speaker plane, plus DECIDE on the owner plane. The kernel mnemonic is SEQRD-PC.

PerformativeEndpointSide effectsPurpose
PROPOSEYesNoneRequest a preview
PROPOSALresponseNonePreview or refusal
COMMITYesYes (idempotent)Execute a proposal
QUERYYesNoneRead
STATUSYesNoneCheck a prior op
EVENTYesSigned webhook
ROLLBACKYesNoneRequest a reversal
DECIDEowner planeAuthorizesApprove / reject

Consequence tiers

TierBehaviorCooling delay
LOWExecute immediately
MEDIUMExecute + notify owner
HIGHPark pending approval
CRITICALApprove + delay300 s

Reversibility tiers

TierMeaningExample
REVERSIBLEClean inverse existscreate ↔ delete
COMPENSABLEOffsetting forward actionpayment → refund
IRREVERSIBLENo reversal (default for unmarked)

Refusal codes

Returned with 200 OK — a refusal is an outcome, not an error.

CodeMeaning
AMBIGUOUSMultiple candidates (≤8) — ask, don’t guess
UNRESOLVEDNo match for the hint
INVALID_ARGSArgs fail the profile contract
POLICY_DENIEDGrant or policy forbids it
BUDGET_EXHAUSTEDGrant budget spent
QUOTA_EXHAUSTEDRate/quota limit reached
EXPIREDProposal or grant expired
SUSPENDEDSpeaker/workspace suspended
UNSUPPORTEDVerb/feature not supported here
IRREVERSIBLEVerb has no reversal
COMPENSATION_EXPIREDThe token is no longer valid

DSL node types

NodePurpose
actionPerform a verb (side effects)
queryRead data
conditionBranch on a side-effect-free guard
parallelRun branches concurrently (join all | any)
foreachIterate a bounded collection
await_approvalHuman-in-the-loop gate
notifySend a notification
waitDurable delay

Program envelope

program envelope
{
  "wosool": "0.1",
  "workspace": "<workspace-id>",
  "locale": "ar",
  "entry": "step_1",
  "pipeline": [ /* nodes */ ],
  "on_error": "halt"
}

Data references are backward-only: $.step_N.output.field, which guarantees a DAG. on_error is halt · continue · compensate.

Six Guarantees

Guarantee
G1Default-deny scoped grants
G2Two-phase: no direct-write
G3Out-of-band approval, credential-separated
G4Idempotency with outcome replay
G5Budgets before side effects, fail-closed
G6Append-only audit
Guarantees never weaken across versions
The spec is extracted from running code.

CLI & install

install & CLI
pip install nilscript            # core: schemas, docs, CLI — zero deps
pip install "nilscript[sdk]"     # + typed Python SDK (httpx + pydantic)
npm install nilscript            # spec + JSON Schemas (JS/TS)

nilscript verbs
nilscript profile <verb>
nilscript export-openapi [--format json|yaml] [-o file]

Versioning

SemVer: MAJOR = breaking, MINOR = new verbs/profiles, PATCH = editorial. Profiles version independently, with a deprecation overlap of at least one MINOR. Releases happen at most quarterly, and only from features already running in the reference implementation. Resources: GitHub · PyPI · npm.

NILScript is an open standard, stewarded by the Wosool project. The spec is extracted from running code.

Draft standard v0.3.0 · 0.x stage · NIL wire 0.1 · DSL 0.1