Repository navigation
Expand file tree
/
Copy pathabi.schema.yaml
More file actions
66 lines (66 loc) · 3.1 KB
/
Copy pathabi.schema.yaml
File metadata and controls
66 lines (66 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
"type": "object",
"title": "WASM Guest ABI Manifest Schema",
"description": "Defines the structure of project.yaml's abi: block -- the contract between a WASM guest module and the relay host (CIC-Relay/core/cabinet/cicwasm.go). Checked against module/module.wasm's actual exports by module/abi_manifest_test.go (KB c689). See docs/contracts/en/wasm-abi.md. NOTE: this file is written in JSON syntax (a valid YAML subset) on purpose -- tools.infra.load_and_resolve_schema resolves project.schema.yaml's $ref to this file via jsonref's default jsonloader, which only accepts JSON (json.loads); YAML block syntax here would break that $ref (tools/infra.py:73-87, not modifiable in this job).",
"required": ["name", "version", "envelopeVersion", "exports", "operations"],
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "The name of the WASM guest module (cf. metadata.name)."
},
"version": {
"type": "string",
"description": "The semantic version of the ABI contract itself.",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
},
"envelopeVersion": {
"type": "integer",
"description": "Version of the JSON envelope format exchanged via Call (docs/contracts/en/envelope.md).",
"minimum": 1
},
"exports": {
"type": "array",
"description": "Functions module/module.wasm must export (cicwasm.go:243-247). Checked against the compiled binary by module/abi_manifest_test.go.",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1
}
},
"operations": {
"type": "array",
"description": "op-strings dispatched by module/abi.go's Call (KB c689).",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1
}
},
"imports": {
"type": "array",
"description": "Host functions the module REQUIRES from the relay -- its sign+send capability boundary. Declaration only: the module states what it needs; it does not define the host side. Not checked against the binary (WASI-off; the trust-flow is native-FFI today, not a wasm import), so this is the module's half of the contract, settled with the relay when the host surface lands (relay-requirements.md R1/R2). Mirrors capability_manifest reach.",
"items": {
"type": "object",
"required": ["module", "functions"],
"additionalProperties": false,
"properties": {
"module": {
"type": "string",
"minLength": 1,
"description": "The host module/namespace providing the functions (e.g. cic-flow). Provisional until settled with the relay."
},
"functions": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1
},
"description": "The required function names within that host module."
}
}
}
}
}
}