spec 12 §1 manifest format with strict TOML subset, [package] entry, [capabilities] by parameter name, [metadata]; aji run --manifest with operator precedence of --grant; spec 05 §10.2 and capabilities.md updated.
3.2 KiB
12. Packages and Build
1. Manifest
A package contains an aji.toml manifest. Decision record for capability grants: RFC 0010.
- A manifest requests; the operator grants. The author of a package writes
[capabilities]. Authority is granted only when someone explicitly runs the program with that manifest (aji run --manifest). Building, verifying or installing never grants anything (spec 05 §6). - Same model as
--grant. One entry per@maincapability parameter:parameter = "kind[:scope]". All instantiation rules apply unchanged (missing, mismatched, unknown, invalid scope; mandatorymem.allocbudget in the deterministic profile). - The operator has the last word. A command-line
--grant P=…replaces the manifest entry forP, for example to point a scope at another directory. It never silently adds parameters: an unknown parameter is stillunknown_parameter. - Strict parsing. Unknown sections, unknown keys and duplicate keys are errors, so a typo cannot silently drop or misplace authority.
1.1 Format
[package]
name = "file-copy"
version = "0.1.0"
entry = "src/main.air" # path relative to the manifest
[capabilities]
src = "fs.read:/var/data"
dst = "fs.write:/var/out"
heap = "mem.alloc:67108864"
out = "io.write"
[metadata] # optional, free-form strings; no semantics
purpose = "example"
[package]:nameandversion(strings) are required;entry(string) is required foraji run --manifest.[capabilities]: keys are@mainparameter names; values are stringskind[:scope]exactly as for--grant.[metadata]: optional table of string values for documentation.- The accepted syntax is a TOML subset: comments with
#,[section]headers,key = "string". Strings use"with the escapes\",\\,\n. Anything else is a manifest error.
Further sections (targets, dependencies, build extensions) are added by later phases; until then they are unknown sections and therefore errors.
1.2 Running from a manifest
aji run --manifest aji.toml [--grant P=KIND[:SCOPE]]... [other run options]
- The module is the manifest's
entry; a file argument is not allowed together with--manifest. - Grants are the manifest's
[capabilities]entries, each replaced by a--grantfor the same parameter if given. aji checkandaji reportdo not read manifests.
Manifest errors (unreadable file, syntax, unknown section or key, duplicate key, missing name/version/entry, malformed grant string) are reported before verification as a usage error (exit code 2) with a message naming the line. Structured manifest diagnostics belong to the package tooling of Phase 8.
2. Reproducibility
Given the same:
- source;
- compiler version;
- dependency lock;
- target;
- feature set;
build graph evaluation must be deterministic.
3. Build scripts
Packages cannot execute arbitrary host code merely because they are dependencies.
Any build extension must be explicitly declared, sandboxed and capability-limited.
4. Dependencies
Dependencies should be content-addressed or lockfile-pinned.
The package system should record unsafe/runtime dependencies separately from ordinary safe source dependencies.