Add world.in.read stdin capability#185
Open
WalterGropius wants to merge 5 commits into
Open
Conversation
|
@WalterGropius is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
| bool proc; | ||
| bool web; | ||
| bool world; | ||
| bool stdin; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
world.in.read(buffer: MutSpan<u8>) -> usizeas the public process stdin surface on theWorldcapability.0signals EOF; the call is infallible (nocheckneeded).stdintarget capability so non-host targets cannot quietly inherit stdin. Host (darwin-arm64) and runnable cross host (linux-musl-x64) declare it; other targets rejectworld.in.readat check time withTAR002.zero_world_readruntime shim alongsidezero_world_writeso native exe emission can call into it once code-gen wiring follows.Source
Addresses P1-8; salvaged after a prior agent run was interrupted by usage limits; reproduced against main @ 999a46b. Acceptance is check-level per the orchestrator's CARRY-FORWARD note (native exe wiring deferred).
Changes
inadmitted after.soworld.in.read(...)parses without removinginas a loop keyword.is_world_stream_read_callee/is_world_stream_read_callpredicates,World.inresolves toWorldStream,readreturnsusize, singleMutSpan<u8>argument enforced, helpful diagnostics for arity and arg type.CapabilitySummary.stdinis set on any program that callsworld.in.read, surfaced inrequiresCapabilities, and gated byvalidate_target_capabilities(TAR002, repair idchoose-target-with-required-capability).stdinadded todarwin-arm64andlinux-musl-x64intargets.manifestand the matching fallback strings intarget.c; capability listings updated.zero_world_read(fd, buf, len)mirrorszero_world_write(EINTR-loop, byte count, no allocation); header +embedded_runtime_sources.incregenerated viascripts/embed-runtime-sources.mts.docs/articles/modules/io.mdlistsworld.in.read;docs/articles/target-capabilities.mddocuments thestdincapability and the rejection example for non-host targets.Conformance
conformance/native/pass/world-stdin.0— host check-level fixture (added to thezero checkloop inconformance/run.mjs).conformance/check/fail/target-stdin-unsupported.0— rejected onlinux-arm64(lacksstdin); new assertion inconformance/run.mjsmirrors the existingtarget-net-unsupported/target-proc-unsupportedpattern and matches theTAR002diagnostic with/lacks stdin/.Gates locally:
make -C native/zero-ccleanZERO_NATIVE_TEST_ALLOW_LOCAL=1 node conformance/run.mjs->conformance oknode scripts/snapshot-command-contracts.mts->command contract snapshots oknode scripts/provenance-guardrails.mts->provenance guardrails ok (29 surfaces)type-core-smoke,mir-verifier-smoke,row-syntax-smoke,native-smokeall greennative:test:localcross step omitted (environmental: zig / cross cc missing here, byte-identical against unmodifiedorigin/main).Capability gating verified:
zero check --target linux-musl-x64passes on the stdin fixture;zero check --target linux-arm64rejects with TAR002 andlacks stdin.Native exe wiring (lowering
world.in.readto the newzero_world_readsymbol in the macho64 / elf64 / coff backends) is deliberately not in this PR; check-level support and the runtime shim land first so the surface and gating can be reviewed before the codegen patches.Proposed CHANGELOG line
world.in.read(buffer)and thestdintarget capability for process input under explicit capability control.