Skip to content

feat(http): add bounded HTTP and callable SSE clients - #26

Open
fffonion wants to merge 28 commits into
masterfrom
plan/callable-stream-integration
Open

fffonion wants to merge 28 commits into
masterfrom
plan/callable-stream-integration

Conversation

@fffonion

@fffonion fffonion commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add bounded buffered HTTP requests and callable-driven SSE streams
  • use the generic one-item host stream pump with explicit delivery, completion, stop, failure, and rollback semantics
  • enforce DNS and redirect revalidation, credential stripping, response budgets, absolute deadlines, cancellation, and exactly-once cleanup
  • target-gate the native transport while preserving runtime, no-std, and WASM compatibility boundaries

Stack

Validation

  • HTTP host: 23 tests
  • HTTP/SSE: 21 tests
  • IO/HTTP coexistence: 11 tests
  • SSE deadline scheduling case: 10 repeated passes
  • cargo test --workspace --all-targets --all-features
  • strict workspace Clippy
  • no-default/runtime/no-std/WASM checks
  • workspace release all-features build
  • architecture boundary tests

@fffonion
fffonion force-pushed the plan/callable-stream-integration branch from 06b37fd to efef9cc Compare August 17, 2026 10:47
@fffonion fffonion changed the title feat(http): add callable streaming clients feat(http): add bounded request and callable SSE clients Aug 17, 2026
@fffonion
fffonion changed the base branch from plan/wide-local-bytecode to fix/frame-aware-local-allocation August 17, 2026 10:53
@fffonion
fffonion force-pushed the plan/callable-stream-integration branch from efef9cc to f12b976 Compare August 17, 2026 11:02
@fffonion
fffonion force-pushed the plan/callable-stream-integration branch from f12b976 to 97e9a9c Compare August 17, 2026 11:21
@fffonion
fffonion force-pushed the plan/callable-stream-integration branch from 97e9a9c to 872bba2 Compare August 17, 2026 11:26
@fffonion
fffonion force-pushed the plan/callable-stream-integration branch from 872bba2 to eafbc05 Compare August 24, 2026 22:09
@fffonion
fffonion force-pushed the plan/callable-stream-integration branch from eafbc05 to e183e0c Compare August 26, 2026 10:45
@fffonion
fffonion force-pushed the plan/callable-stream-integration branch 2 times, most recently from 537a479 to 4b74986 Compare August 31, 2026 06:14
@fffonion fffonion changed the title feat(http): add bounded request and callable SSE clients feat(http): add bounded HTTP and callable SSE clients Aug 31, 2026
@fffonion
fffonion force-pushed the plan/callable-stream-integration branch from 4b74986 to f849714 Compare September 9, 2026 10:52
@fffonion
fffonion force-pushed the plan/callable-stream-integration branch from f849714 to acc6096 Compare September 9, 2026 10:53
@fffonion
fffonion force-pushed the plan/callable-stream-integration branch from acc6096 to 9147258 Compare September 9, 2026 13:18
Base automatically changed from fix/frame-aware-local-allocation to master September 9, 2026 13:23
@fffonion
fffonion force-pushed the plan/callable-stream-integration branch from 9147258 to 3aba65e Compare September 9, 2026 13:23
Introduce catalog-level HostStructSchema / HostTypeSchema::Named so host
functions can declare fixed-shape struct params and returns. Runtime values
stay maps; dynamic Map semantics are unchanged. Compiler mapping produces
TypeSchema::Named identity plus Object field definitions installed from the
catalog, enabling field access, object-literal call matching, nested
resources, and named hover/labels. Fingerprint format version is 2 with a
deterministic structs section.
Keep TypeSchema::Named as compile identity and Value::Map at runtime.
Walk catalog struct bodies at exact registration so resource-bearing
named params/returns are classified correctly, recurse Object/Callable
during named expansion, and validate nested Named structs without a
function reach.
Preserve extra callable parameters instead of dropping them via zip, so unequal arity cannot silently match.
…ration

Keep TypeSchema::Named as compile identity and Value::Map at runtime.
Install catalog named-struct bodies through catalog_import_schemas_into
and HostExtension::install_into so production registration uses the same
path as tests, without adding a public HostFunctionRegistry clone helper.
Register HttpRequest, HttpResponse, SseCallbackAction, and SseSummary
in the HTTP catalog so scripts can use field access and typed object
literals. Runtime values remain maps; headers and SSE inbound events
stay dynamic maps.
Cover string and bytes request bodies with optional unknown while
keeping runtime validation. Split SseRequest so buffered HttpRequest
does not expose timeout_ms. Treat Null optional headers and timeout as
omitted. Check SSE callbacks against SseCallbackAction named or object
results rather than arbitrary maps.
Register SqliteOpenOptions, SqliteLimits, SqliteExecuteResult,
SqliteQueryResult, and SqliteStatement so scripts can use field access
and typed object literals. Runtime values remain maps; positional params
and row arrays stay dynamic.
Treat present Null on optional sqlite fields as omitted, keep
next_cursor as a named optional that is Null when absent, and accept
the documented open-mode identifiers.
Compiler/VM consume jit_host_catalog() with a named JitConfig struct.
Runtime values remain maps; JIT positional overloads stay on the
generated builtin path.
Include JitConfig and both set_config overloads in standard_host_catalog
so default compile/LSP fingerprints match the runtime JIT surface.
HostTypeSchema::Named grew CatalogRegistrationError past Clippy's
result_large_err budget; box the mismatched schemas. Adapt remaining
JIT/HTTP tests to host_import_schemas and Result-returning async
bridge install.
Keep catalog HostTypeSchema::Named on ResolvedHostCall so VMBC sidecars
exact-bind instead of collapsing to map. Adapt HTTP/JIT/foundation tests
to compile against the standard catalog and register exact adapters.
Default bytecode compile omitted the host catalog, so SseCallbackAction
was unknown on compile_source even though http::client::sse was admitted.
Thread http_host_catalog through compile/REPL entry points and exact-register
that snapshot on the default host registry so SSE named structs and function
schemas resolve without converting io/sqlite/jit builtins into host imports.
Catalog-free dialect/import-scan/REPL fallback installed the full
standard_host_catalog, reserving JitConfig and SqliteLimits without host
functions. Install http_host_catalog only when the HTTP surface is on;
install nothing when HTTP is off. Explicit catalogs stay authoritative.
Use a pid/nanos unique file under std::env::temp_dir() and remove it
on Drop so the file frontend test cleans up after panics.
Typed-host scripts compiled sqlite::close(&db) against take_owned.
Keep execute/query/transaction as borrows, close by value, and exact-bind
sqlite from the standard catalog so runtime tests actually close.
Runtime TypeSchema::Named now looks up installed named_struct_schemas,
fails closed on unknown names, and walks nested resource/array/optional
fields with depth and complexity bounds. install_named_struct_schemas
merges identical bodies and rejects conflicts transactionally. Host
Named returns may omit Optional fields. callable_schema_matches matches
Named by name without accepting maps. Gate foundation tests on runtime.
TypeSchema::Named on callable prototypes previously resolved only against
the host named_struct_schemas catalog, so ordinary guest structs such as
LruCacheState failed closed as unknown.

Keep host catalog lookup fail-closed and field-strict. Attach compiler
StructDecl tables to Program, instantiate generic guest bodies at
validation time, and walk guest Named as objects (resource fields only)
so nested host resources stay enforced without treating unknown Named as
any map.
Keep catalog structs off Program.named_struct_decls, require resource-bearing
guest Named fields, make generic substitution load-bearing, and frame the
named-struct section behind ABI v13 so trailing zeros are not a valid table.
nostd skip_host_schema now walks v13 HostTypeSchema::Named (tag 13)
with the std name/field-count/nested-schema layout and existing
depth/count/blob budgets. Host Named lookup and callable schema match
fail closed on nonempty type args without changing guest generic lookup.
Generic stream rustdocs describe Named/Object results and SSE's exact
SseCallbackAction contract.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant