Files
vercel-labs--zerolang/docs/articles/target-capabilities.md
T
wehub-resource-sync e7738de6d2
CI / Deep Native Runtime Cases (1/6) (push) Has been skipped
CI / Native Preflight (push) Failing after 1s
CI / Native Runtime Cases (1/2) (push) Failing after 0s
CI / Native Runtime Cases (2/2) (push) Failing after 1s
CI / Native Metadata Reports (push) Failing after 0s
CI / Native Direct Backend Artifacts (push) Failing after 0s
CI / Native Sanitizer Smoke (push) Failing after 1s
CI / Command Contract Snapshots (push) Failing after 1s
CI / Deep Conformance Suite (push) Has been skipped
CI / Graph Build Perf (push) Failing after 1s
CI / Deep Native Preflight (push) Has been skipped
CI / Deep Native Runtime Cases (2/6) (push) Has been skipped
CI / Deep Native Runtime Cases (3/6) (push) Has been skipped
CI / Conformance Suite (push) Failing after 1s
CI / Workspace Checks (push) Failing after 0s
CI / Deep Native Runtime Cases (5/6) (push) Has been skipped
CI / Deep Native Runtime Cases (6/6) (push) Has been skipped
CI / Deep Native Runtime Cases (4/6) (push) Has been skipped
CI / Deep Graph Build Perf (push) Has been skipped
chore: import upstream snapshot with attribution
2026-07-13 12:29:30 +08:00

82 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## Capabilities Are Target Facts
In Zerolang, start with the user request. The agent should inspect target capability facts
before patching APIs that depend on hosted runtime support.
```json-render
{
"messages": [
{
"role": "user",
"text": "make this cli work on linux musl too"
},
{
"role": "assistant",
"text": "Ill check the target facts and call out anything that blocks the port."
},
{
"role": "tools",
"calls": [
{
"command": "zero check --json --target linux-musl-x64",
"output": "{\"ok\":false,\"diagnostics\":[{\"code\":\"TAR002\",\"message\":\"target does not provide required capability\"}]}"
}
]
}
]
}
```
## What This Means
Zero does not assume every target can do filesystem, network, process, time, or
random operations. Those are explicit target facts. Target JSON includes host
identity, aliases, object formats, C target mapping, capabilities, HTTP runtime
metadata, and `targetToolchains`.
## Inspect Targets
```sh
zero targets
zero targets --json
zero check --json --target linux-musl-x64 examples/memory-package
```
## Hosted Capabilities
The current hosted capability set includes:
- `args`
- `env`
- `fs`
- `memory`
- `net`
- `proc`
- `rand`
- `stdio`
- `time`
Non-host targets expose only the capabilities listed for that target. Network
support is intentionally target-gated. HTTP helpers that only parse or write
request/response envelopes are target-neutral; hosted fetch and listen require
network-capable host support.
## Capability Failure Is A Feature
If a graph input uses `std.fs` on a target that cannot provide filesystem
support, `zero check --target ...` should report a diagnostic instead of
silently changing behavior.
```sh
zero check --json --target linux-musl-x64 conformance/common/fail/unsupported-target-feature.graph
```
The diagnostic is `TAR002` and the repair id points at choosing a target with
the required capability.
## What To Remember
Capabilities are part of the graph contract. Standard library pages document
effects and target support so an agent can choose the right helper before it
patches the program.