Examples and compatibility
Tested examples, implementation provenance, and the roadmap for libraries and SDKs.
A decision without a payment
This decimal example accepts positive amounts up to 100.00. It makes no state writes and emits no events. A true result is only the function’s decision, not approval to move money.
from hybrid import contract
from hybrid.decimal import Decimal
@contract.entrypoint
def review(ctx, payload):
amount = Decimal(payload["amount"])
if amount <= Decimal("0"):
return {"accepted": False}
return {"accepted": amount <= Decimal("100.00")}
Fixture and expected result
{
"manifest": {
"profile": "hybridscript-0.1-preview",
"entrypoints": [
"review"
],
"execution_limit": 50000,
"capabilities": {
"state": [],
"events": []
}
},
"input": {
"amount": "42.50"
},
"state": {},
"expectedOutput": {
"accepted": true
}
}Pin the profile, not just the manual version
Manual 0.1 documents hybridscript-0.1-preview, profile version 0.1.0. Language behavior is checked against source revision 2d9b1f51c001c02badd6cfad5951d2b40593c771. The inspected execution-node source pins that same runtime artifact. These are documentation provenance statements, not a claim that every deployed node runs that revision.
The two examples are validated, packaged, and simulated against that pinned source in the documentation acceptance check. Negative cases cover invalid imports, capability denial, budget exhaustion, and state rollback. Legacy Explorer reference examples are not conformance fixtures; use the examples in this manual for the documented profile.
Libraries and SDK releases are a separate milestone
This release publishes the reference manual and tested examples only. It does not publish a new SDK, package-manager installation command, or GitHub release download. Future supported tooling should provide versioned artifacts, checksums, provenance, compatibility information, and tested installation instructions. Until then, confirm access to maintained source tooling with engineering rather than installing an unrelated package with a similar name.
0.1 release notes
Initial language and runtime manual: admitted syntax and functions, JSON/TOML manifest correspondence, state rollback, resource accounting, receipt interpretation, and two executable example fixtures. Future revisions should name changed semantics and migration requirements rather than silently changing this version.