diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5669a93..aff0806 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} - timeout-minutes: 25 + timeout-minutes: 60 env: PYTHONDONTWRITEBYTECODE: "1" steps: @@ -32,11 +32,12 @@ jobs: python3 - <<'PYTHON' import hashlib, json, os, pathlib, platform, tarfile, urllib.request version = pathlib.Path('.zig-version').read_text().strip() - assert version == '0.16.0', 'Expected exact Zig 0.16.0' + assert version == '0.17.0', 'Expected exact Zig 0.17.0' architecture = {'x86_64': 'x86_64', 'arm64': 'aarch64', 'aarch64': 'aarch64'}[platform.machine()] system = {'Linux': 'linux', 'Darwin': 'macos'}[platform.system()] - with urllib.request.urlopen('https://ziglang.org/download/index.json', timeout=30) as response: - artifact = json.load(response)[version][f'{architecture}-{system}'] + metadata = json.loads(pathlib.Path('.github/zig-release.json').read_text()) + assert metadata['version'] == version + artifact = metadata['artifacts'][f'{architecture}-{system}'] assert artifact['tarball'].startswith('https://ziglang.org/') directory = pathlib.Path(os.environ['RUNNER_TEMP']) / 'baz-zig' directory.mkdir() @@ -58,9 +59,9 @@ jobs: packet="$RUNNER_TEMP/baz-ci" mkdir -p "$packet" { git rev-parse HEAD; uname -a; zig version; python3 --version; } > "$packet/environment.log" - zig build verify -Doptimize=Debug -j2 --summary all 2>&1 | tee "$packet/debug.log" - zig build verify -Doptimize=ReleaseSafe -j2 --summary all 2>&1 | tee "$packet/release-safe.log" - zig build install examples -Doptimize=ReleaseSafe -j2 2>&1 | tee "$packet/install.log" + zig build verify -Doptimize=debug -j2 --summary all 2>&1 | tee "$packet/debug.log" + zig build verify -Doptimize=safe -j2 --summary all 2>&1 | tee "$packet/release-safe.log" + zig build install examples -Doptimize=safe -j2 2>&1 | tee "$packet/install.log" python3 tests/cli_integration.py --json "$packet/cli.json" 2>&1 | tee "$packet/cli.log" python3 tests/app_integration.py 2>&1 | tee "$packet/app.log" python3 tests/examples_integration.py 2>&1 | tee "$packet/examples.log" diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 57862ac..3f4a303 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -27,11 +27,12 @@ jobs: python3 - <<'PYTHON' import hashlib, json, os, pathlib, platform, tarfile, urllib.request version = pathlib.Path('.zig-version').read_text().strip() - assert version == '0.16.0', 'Expected exact Zig 0.16.0' + assert version == '0.17.0', 'Expected exact Zig 0.17.0' architecture = {'x86_64': 'x86_64', 'arm64': 'aarch64', 'aarch64': 'aarch64'}[platform.machine()] system = {'Linux': 'linux', 'Darwin': 'macos'}[platform.system()] - with urllib.request.urlopen('https://ziglang.org/download/index.json', timeout=30) as response: - artifact = json.load(response)[version][f'{architecture}-{system}'] + metadata = json.loads(pathlib.Path('.github/zig-release.json').read_text()) + assert metadata['version'] == version + artifact = metadata['artifacts'][f'{architecture}-{system}'] assert artifact['tarball'].startswith('https://ziglang.org/') directory = pathlib.Path(os.environ['RUNNER_TEMP']) / 'baz-zig' directory.mkdir() diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 56aea59..3855d67 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -15,7 +15,7 @@ concurrency: jobs: windows-x64: runs-on: windows-latest - timeout-minutes: 25 + timeout-minutes: 60 env: PYTHONDONTWRITEBYTECODE: "1" steps: @@ -26,9 +26,10 @@ jobs: run: | $ErrorActionPreference = "Stop" $version = (Get-Content -Raw .zig-version).Trim() - if ($version -cne "0.16.0") { throw "Expected the exact Zig 0.16.0 baseline" } - $index = Invoke-RestMethod https://ziglang.org/download/index.json -TimeoutSec 30 - $artifact = $index.PSObject.Properties[$version].Value.PSObject.Properties["x86_64-windows"].Value + if ($version -cne "0.17.0") { throw "Expected the exact Zig 0.17.0 baseline" } + $metadata = Get-Content -Raw .github/zig-release.json | ConvertFrom-Json + if ($metadata.version -cne $version) { throw 'Compiler metadata version mismatch' } + $artifact = $metadata.artifacts.PSObject.Properties["x86_64-windows"].Value $url = [string] $artifact.tarball $expected = ([string] $artifact.shasum).ToLowerInvariant() if ($url -notmatch '^https://ziglang\.org/' -or $expected -notmatch '^[0-9a-f]{64}$') { @@ -61,7 +62,7 @@ jobs: Set-Content "$env:RUNNER_TEMP/baz-windows-logs/environment.txt" Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, BuildNumber, OSArchitecture | ConvertTo-Json | Add-Content "$env:RUNNER_TEMP/baz-windows-logs/environment.txt" - foreach ($mode in @("Debug", "ReleaseSafe")) { + foreach ($mode in @("debug", "safe")) { & zig build verify "-Doptimize=$mode" -j2 --summary all 2>&1 | Tee-Object "$env:RUNNER_TEMP/baz-windows-logs/$mode.log" if ($LASTEXITCODE -ne 0) { throw "$mode verification failed" } @@ -71,7 +72,7 @@ jobs: shell: pwsh run: | $ErrorActionPreference = "Stop" - & zig build install examples -Doptimize=ReleaseSafe -j2 --summary all 2>&1 | + & zig build install examples -Doptimize=safe -j2 --summary all 2>&1 | Tee-Object "$env:RUNNER_TEMP/baz-windows-logs/install.log" if ($LASTEXITCODE -ne 0) { throw "ReleaseSafe example installation failed" } foreach ($suite in @("cli_integration", "app_integration", "examples_integration", "streaming_integration", "borrow_integration", "mustache_integration", "cookies_integration", "middleware_integration", "session_integration", "continuations_integration", "jobs_integration", "windows_smoke")) { diff --git a/.github/zig-release.json b/.github/zig-release.json new file mode 100644 index 0000000..917433a --- /dev/null +++ b/.github/zig-release.json @@ -0,0 +1,32 @@ +{ + "artifacts": { + "aarch64-linux": { + "shasum": "9e8d11661d4ae3bd57702a3832781e23ad151dde5798e16a5ccd503f65234ff8", + "size": "52877280", + "tarball": "https://ziglang.org/download/0.17.0/zig-aarch64-linux-0.17.0.tar.xz" + }, + "aarch64-macos": { + "shasum": "b607e9b9234790a008116ae5bdb71c6243b84b9fb42a53a9e70fde41c06c536a", + "size": "53985220", + "tarball": "https://ziglang.org/download/0.17.0/zig-aarch64-macos-0.17.0.tar.xz" + }, + "x86_64-linux": { + "shasum": "1cbe9df9f27e6b78d14ccbca43b6703a404ef79ef1c463de901d7f088d4e2026", + "size": "57332648", + "tarball": "https://ziglang.org/download/0.17.0/zig-x86_64-linux-0.17.0.tar.xz" + }, + "x86_64-macos": { + "shasum": "4f9a1c5269aa17ebda5e6d3c2b89d6cbf36f7d2b22a0306e9ab98f25f95529c6", + "size": "59317572", + "tarball": "https://ziglang.org/download/0.17.0/zig-x86_64-macos-0.17.0.tar.xz" + }, + "x86_64-windows": { + "shasum": "b5663f69581dcf391293fbf16c06cb80d81d806545ce618b4d0bab7f0eb8c428", + "size": "100268137", + "tarball": "https://ziglang.org/download/0.17.0/zig-x86_64-windows-0.17.0.zip" + } + }, + "signature_verification": "Ed25519 prehashed minisign archive and trusted-comment signatures verified against the official download-page public key", + "signing_key": "RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U", + "version": "0.17.0" +} diff --git a/.zig-version b/.zig-version index 04a373e..c5523bd 100644 --- a/.zig-version +++ b/.zig-version @@ -1 +1 @@ -0.16.0 +0.17.0 diff --git a/AGENTS.md b/AGENTS.md index 614b2ec..aef2eb7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,6 @@ # Baz — Bounded Async Zap -Use exact Zig 0.16.0 from `.zig-version`. Baz consumes the separate [bounded/http](https://technologylab-ai.github.io/bounded-http/) +Use exact Zig 0.17.0 from `.zig-version`. Baz consumes the separate [bounded/http](https://technologylab-ai.github.io/bounded-http/) engine through its exported `bounded_http` module. Keep engine parser, transport and scheduler changes in that dependency and submit an upstream PR. This repository owns App, routing, request/form views, responses, examples and their tests. The [Zig wiki](https://github.com/technologylab-ai/zigllmwiki) diff --git a/HANDOFF.md b/HANDOFF.md index e536dd3..ec2eba2 100644 --- a/HANDOFF.md +++ b/HANDOFF.md @@ -23,7 +23,22 @@ before Baz #6 once their final checks pass. The user explicitly deferred the custom `std.Io` prototype on 2026-09-07. Standard caller `std.Io` and the engine's existing native backends remain in use. -# Baz handoff — 2026-09-06 +# Baz handoff — Zig 0.17 migration, 2026-10-04 + +The `feat/zig-0.17` branch now requires exact Zig 0.17.0. +Its manifest pins matching engine, Mustache, and zli ports to immutable URL hashes. +Engine parser and transport changes are upstream in the separate engine branch. +The migration preserves preallocation, borrowing, cancellation, and assertion requirements. +Public endpoint and state-cleanup hooks are explicit under the new `@hasDecl` visibility rule. + +Local macOS and native `omarx1` gates passed Debug/Safe verification and all maintained Python wire suites. +The final URL graph has separate package-consumer checks. +Hosted native CI records the published branch's Linux, Mac, and Windows results. +Earlier receipts in this file retain their original compiler, revision, and platform scope. +No performance measurement was performed for this migration. +The user also authorized the separate Zig wiki's full 0.17.0 upgrade and agent migration guide. + +## Earlier baseline — 2026-09-06 Work from the independent `baz` repository, primary branch `main`. Public repository: . diff --git a/README.md b/README.md index e1cedb1..56a742f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [Website & documentation](https://technologylab-ai.github.io/baz/) · [API reference](https://technologylab-ai.github.io/baz/api/) · [All guides](docs/GUIDES.md) · [API guide](docs/APP-API.md) · [27 examples](examples/README.md) -A **pure Zig** successor to [Zap](https://github.com/zigzap/zap), built in **Zig 0.16.0** +A **pure Zig** successor to [Zap](https://github.com/zigzap/zap), built in **Zig 0.17.0** on [bounded/http](https://technologylab-ai.github.io/bounded-http/). It keeps Zap's typed App and endpoint ergonomics, with explicit memory ownership and simpler request data. @@ -41,7 +41,7 @@ The first implementation provides: - **Mustache templates:** parse once at startup, render typed data directly into reserved HTML response storage. See the [guide](docs/MUSTACHE.md) and [greeting form and user-card example](examples/mustache.zig). - [Verified natively on Linux, macOS, and Windows](reports/2026-09-06-mustache.md). + [Earlier Zig 0.16 native evidence](reports/2026-09-06-mustache.md). - **SSE and producer notifications:** encode events into a standard writer, wake retained callbacks, and choose explicit queue and replay limits. [SSE guide](docs/SSE.md) · [complete job application](docs/JOBS.md) · @@ -73,6 +73,11 @@ See the [repository record](docs/REPOSITORY.md) for branches, history, CI, and p ## Platform support +The Zig 0.17 migration pins the engine, Mustache, and zli to their matching ports. +Local macOS and native `omarx1` checks cover Debug/Safe verification and the Python wire suites. +The earlier feature receipts below retain their original Zig 0.16 compiler scope. +Use this branch's native CI results for the current compiler and dependency graph. + **Linux, macOS, and native Windows x64 are supported.** Baz adds native Windows support beyond [Zap’s facil.io-based platform support](https://github.com/zigzap/zap/blob/master/README.md). Both the framework and its [bounded/http](https://technologylab-ai.github.io/bounded-http/) engine are written in Zig. @@ -88,7 +93,7 @@ direct system calls unless your application links libc, so a Baz application bui static executable with no interpreter and no shared libraries, for the native target, `-Dtarget=x86_64-linux-musl` or `-linux-none`. macOS links libSystem; Windows uses Win32. -All three platforms passed Debug and ReleaseSafe verification, the independent +The earlier Zig 0.16 baseline passed Debug and ReleaseSafe verification on all three platforms, the independent package consumer, all 14 App groups, all 20 ported-example groups, and all 14 streaming groups—including the runnable example—plus nine large-borrow groups. Windows also passed three @@ -102,7 +107,7 @@ experimental status; this is correctness coverage, not production qualification. Watch a response arrive incrementally: ```sh -zig build run-streaming -Doptimize=ReleaseSafe -- --port 8080 +zig build run-streaming -Doptimize=safe -- --port 8080 # In another terminal; use curl.exe on Windows: curl -N http://127.0.0.1:8080/ ``` @@ -118,10 +123,10 @@ retained memory, bounded by the total response limit rather than staging capacit It selects the whole body; inserting a borrowed image between streaming writes is [currently unsupported](docs/STREAMING.md#current-limit-borrowed-bodies-cannot-be-inserted-into-a-stream). -Use exact Zig 0.16.0 from [.zig-version](.zig-version), with Python 3 installed: +Use exact Zig 0.17.0 from [.zig-version](.zig-version), with Python 3 installed: ```sh -zig build run-app -Doptimize=ReleaseSafe -- --port 8080 +zig build run-app -Doptimize=safe -- --port 8080 ``` In another terminal (use `curl.exe` on Windows): @@ -137,12 +142,12 @@ There are [21 ports of Zap's examples](examples/README.md), including endpoints, authentication, middleware, sessions, Mustache, JSON, query/form data and uploads: ```sh -zig build examples -Doptimize=ReleaseSafe +zig build examples -Doptimize=safe ./zig-out/bin/hello --port 8080 -zig build run-http_params -Doptimize=ReleaseSafe -- --port 8080 +zig build run-http_params -Doptimize=safe -- --port 8080 ``` -All examples use [zli](https://github.com/renerocksai/zli) with Zig 0.16 +All examples use [zli](https://github.com/renerocksai/zli) with Zig 0.17 `std.process.Init` for typed startup options and `--help`. Both `--port 8080` and `--port=8080` work. See the [CLI guide](examples/README.md#typed-cli-options-with-process-initialization). diff --git a/build.zig b/build.zig index 7565d2c..98dbd50 100644 --- a/build.zig +++ b/build.zig @@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void { @panic("Use exactly the Zig release in .zig-version"); const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); - if (optimize == .ReleaseFast or optimize == .ReleaseSmall) { + if (optimize == .fast or optimize == .small) { @panic("This MVP requires Debug or ReleaseSafe so its invariants remain enabled"); } const engine = b.dependency("bounded_http", .{ @@ -28,15 +28,15 @@ pub fn build(b: *std.Build) void { docs_module.addImport("zli", zli); const docs_object = b.addObject(.{ .name = "baz", .root_module = docs_module }); const prepare_docs = b.addSystemCommand(&.{"python3"}); - prepare_docs.addFileArg(b.path("tools/prepare_api_docs.py")); - prepare_docs.addDirectoryArg(docs_object.getEmittedDocs()); - const prepared_docs = prepare_docs.addOutputDirectoryArg("api"); + prepare_docs.addFileArg2(b.path("tools/prepare_api_docs.py"), .{}); + prepare_docs.addDirectoryArg2(docs_object.getEmittedDocs(), .{}); + const prepared_docs = prepare_docs.addOutputDirectoryArg2("api", .{}); prepare_docs.addArgs(&.{ - b.fmt("baz/{s}", .{std.fs.path.basename(module.root_source_file.?.getPath(b))}), + "baz/baz.zig", "std/std.zig", - b.fmt("bounded_http/{s}", .{std.fs.path.basename(engine.root_source_file.?.getPath(b))}), - b.fmt("mustache_engine/{s}", .{std.fs.path.basename(mustache.root_source_file.?.getPath(b))}), - b.fmt("zli/{s}", .{std.fs.path.basename(zli.root_source_file.?.getPath(b))}), + "bounded_http/server.zig", + "mustache_engine/mustache.zig", + "zli/zli.zig", }); const install_docs = b.addInstallDirectory(.{ .source_dir = prepared_docs, @@ -51,8 +51,8 @@ pub fn build(b: *std.Build) void { // for Linux Debug only. ReleaseSafe uses its default toolchain selection. const app_exe = b.addExecutable(.{ .name = "baz", - .use_llvm = if (target.result.os.tag == .linux and optimize == .Debug) true else null, - .use_lld = if (target.result.os.tag == .linux and optimize == .Debug) true else null, + .use_llvm = if (target.result.os.tag == .linux and optimize == .debug) true else null, + .use_lld = if (target.result.os.tag == .linux and optimize == .debug) true else null, .root_module = b.createModule(.{ .root_source_file = b.path("src/app_demo.zig"), .target = target, @@ -62,15 +62,15 @@ pub fn build(b: *std.Build) void { }); b.installArtifact(app_exe); const app_run = b.addRunArtifact(app_exe); - if (b.args) |args| app_run.addArgs(args); + app_run.addPassthruArgs(); b.step("run-app", "Run the application API example").dependOn(&app_run.step); b.step("run", "Run the application API example").dependOn(&app_run.step); const verify = b.step("verify", "Compile and test the exact-version MVP"); const check = b.step("check", "Compile all framework tests and examples without executing target binaries"); const stream_fixture = b.addExecutable(.{ .name = "baz-streaming", - .use_llvm = if (target.result.os.tag == .linux and optimize == .Debug) true else null, - .use_lld = if (target.result.os.tag == .linux and optimize == .Debug) true else null, + .use_llvm = if (target.result.os.tag == .linux and optimize == .debug) true else null, + .use_lld = if (target.result.os.tag == .linux and optimize == .debug) true else null, .root_module = b.createModule(.{ .root_source_file = b.path("src/streaming_demo.zig"), .target = target, @@ -91,8 +91,8 @@ pub fn build(b: *std.Build) void { }); const borrow_fixture = b.addExecutable(.{ .name = "baz-borrow", - .use_llvm = if (target.result.os.tag == .linux and optimize == .Debug) true else null, - .use_lld = if (target.result.os.tag == .linux and optimize == .Debug) true else null, + .use_llvm = if (target.result.os.tag == .linux and optimize == .debug) true else null, + .use_lld = if (target.result.os.tag == .linux and optimize == .debug) true else null, .root_module = b.createModule(.{ .root_source_file = b.path("src/borrow_demo.zig"), .target = target, @@ -105,8 +105,8 @@ pub fn build(b: *std.Build) void { verify.dependOn(&borrow_fixture.step); const cookie_fixture = b.addExecutable(.{ .name = "baz-cookies", - .use_llvm = if (target.result.os.tag == .linux and optimize == .Debug) true else null, - .use_lld = if (target.result.os.tag == .linux and optimize == .Debug) true else null, + .use_llvm = if (target.result.os.tag == .linux and optimize == .debug) true else null, + .use_lld = if (target.result.os.tag == .linux and optimize == .debug) true else null, .root_module = b.createModule(.{ .root_source_file = b.path("examples/cookie_fixture.zig"), .target = target, @@ -119,8 +119,8 @@ pub fn build(b: *std.Build) void { verify.dependOn(&cookie_fixture.step); const middleware_fixture = b.addExecutable(.{ .name = "baz-middleware", - .use_llvm = if (target.result.os.tag == .linux and optimize == .Debug) true else null, - .use_lld = if (target.result.os.tag == .linux and optimize == .Debug) true else null, + .use_llvm = if (target.result.os.tag == .linux and optimize == .debug) true else null, + .use_lld = if (target.result.os.tag == .linux and optimize == .debug) true else null, .root_module = b.createModule(.{ .root_source_file = b.path("examples/middleware_fixture.zig"), .target = target, @@ -135,8 +135,8 @@ pub fn build(b: *std.Build) void { for ([_][]const u8{ "hello", "hello2", "hello_json", "simple_router", "routes", "serve", "sendfile", "senderror", "accept", "app_basic", "app_auth", "app_errors", "endpoint", "endpoint_auth", "middleware", "middleware_with_endpoint", "userpass_session", "cookies", "http_params", "bindataformpost", "streaming", "mustache", "continuations", "jobs", "runtime_file", "decoded_forms", "tailscale_https" }) |name| { const example = b.addExecutable(.{ .name = name, - .use_llvm = if (target.result.os.tag == .linux and optimize == .Debug) true else null, - .use_lld = if (target.result.os.tag == .linux and optimize == .Debug) true else null, + .use_llvm = if (target.result.os.tag == .linux and optimize == .debug) true else null, + .use_lld = if (target.result.os.tag == .linux and optimize == .debug) true else null, .root_module = b.createModule(.{ .root_source_file = b.path(b.fmt("examples/{s}.zig", .{name})), .target = target, @@ -148,12 +148,12 @@ pub fn build(b: *std.Build) void { examples.dependOn(&install_example.step); b.step(name, b.fmt("Build and install {s}", .{name})).dependOn(&install_example.step); const run_example = b.addRunArtifact(example); - if (b.args) |args| run_example.addArgs(args); + run_example.addPassthruArgs(); b.step(b.fmt("run-{s}", .{name}), b.fmt("Run {s}", .{name})).dependOn(&run_example.step); verify.dependOn(&example.step); check.dependOn(&example.step); } - const format = b.addFmt(.{ .paths = &.{ "build.zig", "build.zig.zon", "src", "examples" }, .check = true }); + const format = b.addFmt(.{ .paths = b.pathList(&.{ "build.zig", "build.zig.zon", "src", "examples" }), .check = true }); verify.dependOn(&format.step); check.dependOn(&format.step); const version = b.addSystemCommand(&.{ "python3", "tools/check_version.py" }); @@ -167,8 +167,8 @@ pub fn build(b: *std.Build) void { if (std.mem.eql(u8, step, "test")) verify.dependOn(&consumer.step) else check.dependOn(&consumer.step); } const test_step = b.step("test", "Run framework unit tests"); - for ([_][]const u8{ "examples/endpoint/session_store.zig", "examples/endpoint/session_options.zig", "src/continuation.zig", "src/mailbox.zig", "src/sse.zig", "examples/endpoint/job_store.zig", "examples/jobs.zig", "src/params.zig", "src/form.zig", "src/cookies.zig", "src/request.zig", "src/multipart.zig", "src/response.zig", "src/router.zig", "src/mustache.zig", "src/App.zig", "src/baz.zig" }) |path| { - const tests = b.addTest(.{ .use_llvm = if (target.result.os.tag == .linux and optimize == .Debug) true else null, .use_lld = if (target.result.os.tag == .linux and optimize == .Debug) true else null, .root_module = b.createModule(.{ + for ([_][]const u8{ "examples/endpoint/session_store.zig", "examples/endpoint/session_options.zig", "src/static_bytes.zig", "src/continuation.zig", "src/mailbox.zig", "src/sse.zig", "examples/endpoint/job_store.zig", "examples/jobs.zig", "src/params.zig", "src/form.zig", "src/cookies.zig", "src/request.zig", "src/multipart.zig", "src/response.zig", "src/router.zig", "src/mustache.zig", "src/App.zig", "src/baz.zig" }) |path| { + const tests = b.addTest(.{ .use_llvm = if (target.result.os.tag == .linux and optimize == .debug) true else null, .use_lld = if (target.result.os.tag == .linux and optimize == .debug) true else null, .root_module = b.createModule(.{ .root_source_file = b.path(path), .target = target, .optimize = optimize, diff --git a/build.zig.zon b/build.zig.zon index 3bd2695..332cfa9 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -2,19 +2,19 @@ .name = .baz, .version = "0.1.0", .fingerprint = 0x78240498d30be4ab, - .minimum_zig_version = "0.16.0", + .minimum_zig_version = "0.17.0", .dependencies = .{ .mustache = .{ - .url = "https://github.com/technologylab-ai/mustache-zig/archive/22487e4082537aa5b707dd902def866d990fdea1.tar.gz", - .hash = "mustache-0.0.1-bbBABwAsCgDDzOEicjx4peKWHmhxxwbzAzhf-UC7wJp1", + .url = "https://github.com/technologylab-ai/mustache-zig/archive/f46006f04a6bb4374a34250fb01fe72daf6a39c1.tar.gz", + .hash = "mustache-0.0.1-bbBABzcvCgC4WuanXnXQ_2MQniNbAeM3FDOWUwntUJgF", }, .zli = .{ - .url = "https://github.com/renerocksai/zli/archive/4f17b1f1eacda7b87c49461e34b1520c392788b2.tar.gz", - .hash = "zli-0.1.1-pechgr4WAQBsw7p7JPU-GHHZ5xsBpEdfCRNpNtnQYnBz", + .url = "https://github.com/renerocksai/zli/archive/36dfe7c506117af0e52533feb549282362b77e2a.tar.gz", + .hash = "zli-0.1.1-pechguIfAQBpzPujkkvs6_TK5FtWmXb3t0TUsswftHvP", }, .bounded_http = .{ - .url = "https://github.com/technologylab-ai/bounded-http/archive/bb9a5bf04802a15026f967b4e50ff843a91516a3.tar.gz", - .hash = "bounded_http-0.1.0-N3A1uHecEgAYkfUAZIw5m5MTTQmP6YmoVSod6onLNWkJ", + .url = "https://github.com/technologylab-ai/bounded-http/archive/65d584bf1a00451577235281a290303b10d0ae3b.tar.gz", + .hash = "bounded_http-0.1.0-N3A1uK6sEgBOVsAkQaEi3SYqOUfcF6SDDli1N6ELCyhL", }, }, .paths = .{ "build.zig", "build.zig.zon", ".zig-version", "src", "tests", "tools", "examples", "docs", "reports", ".github", "LICENSE", "README.md", "ROADMAP.md", "HANDOFF.md", "AGENTS.md" }, diff --git a/docs/APP-API-ROADMAP.md b/docs/APP-API-ROADMAP.md index ba8c69c..163c2be 100644 --- a/docs/APP-API-ROADMAP.md +++ b/docs/APP-API-ROADMAP.md @@ -2,7 +2,7 @@ Status: composition MVP merged and natively qualified; bounded notifications, SSE and a complete application are natively qualified candidates, 2026-09-07. -Exact target: Zig 0.16.0. See the [implemented API](APP-API.md), +Exact target: Zig 0.17.0. See the [implemented API](APP-API.md), [21 example ports](../examples/README.md), and [composition native receipt](../reports/2026-09-07-composition.md) for exact evidence and limits. @@ -56,7 +56,7 @@ Inspect Git state before editing; do not overwrite another session's work. | Topic | Working decision | | --- | --- | | Product | Baz (Bounded Async Zap), package/import `baz`, external dependency/import `bounded_http`. Repository: [technologylab-ai/baz](https://github.com/technologylab-ai/baz), with its [Pages documentation](https://technologylab-ai.github.io/baz/). [bounded/http](https://technologylab-ai.github.io/bounded-http/) stays independently usable. No Zap source-compatibility layer. | -| Platform/version | Exact Zig 0.16.0; plain HTTP/1.1 on Linux, macOS, and native Windows x64. Public bind addresses need later qualification. TLS is out of scope. | +| Platform/version | Exact Zig 0.17.0; plain HTTP/1.1 on Linux, macOS, and native Windows x64. Public bind addresses need later qualification. TLS is out of scope. | | Windows | Supported natively on x64 with CI: Debug/ReleaseSafe verification, 14 App groups, 20 ported-example groups, 14 streaming groups, and three shard/shutdown cases. Windows performance remains deferred; Baz remains experimental. | | App | Real instances; typed Shared; borrowed endpoint instances; startup-only registration; one routing/context model. | | Input | Raw immutable slices, ordered duplicates, no coercion, no bracket-array syntax, no merged query/body/JSON bag. | @@ -385,9 +385,9 @@ Baseline commands once the host is reserved and exact compiler is selected: ```sh zig version -zig build verify -Doptimize=Debug -zig build verify -Doptimize=ReleaseSafe -zig build install examples -Doptimize=ReleaseSafe +zig build verify -Doptimize=debug +zig build verify -Doptimize=safe +zig build install examples -Doptimize=safe python3 tests/app_integration.py python3 tests/examples_integration.py python3 tests/streaming_integration.py diff --git a/docs/APP-API.md b/docs/APP-API.md index 9083dab..f1e8d7e 100644 --- a/docs/APP-API.md +++ b/docs/APP-API.md @@ -8,14 +8,14 @@ The engine's [GitHub Pages documentation](https://technologylab-ai.github.io/bou covers architecture, embedding, and ownership. Baz consumes a pinned external engine package; it does not contain engine sources. See the [dependency boundary](DEPENDENCY.md) and [extraction plan](APP-API-ROADMAP.md#api-08--migration-examples-and-successor-mvp-qualification). -This experimental API uses exact Zig **0.16.0**, the Linux io_uring / +This experimental API uses exact Zig **0.17.0**, the Linux io_uring / macOS kqueue / Windows IOCP HTTP engine, caller-supplied `std.Io`, and bounded standard memory readers/writers. An owned `std.Io` provider is deferred until after the API MVP. Run the maintained, compiled [example](../src/app_demo.zig): ```sh -zig build -Doptimize=ReleaseSafe +zig build -Doptimize=safe ./zig-out/bin/baz --port 8080 curl 'http://127.0.0.1:8080/hello?name=Hello%20Zig' curl 'http://127.0.0.1:8080/users/a%2Fb' diff --git a/docs/APPLICATION-RECIPES.md b/docs/APPLICATION-RECIPES.md index 185739a..473e485 100644 --- a/docs/APPLICATION-RECIPES.md +++ b/docs/APPLICATION-RECIPES.md @@ -2,7 +2,7 @@ Serve LAN clients, download runtime files, decode ordered form fields, and keep Baz's error classifications in a custom hook. These conveniences keep resource -ownership explicit. Use exact Zig 0.16.0. +ownership explicit. Use exact Zig 0.17.0. ## Reach your application from the LAN @@ -25,7 +25,7 @@ is involved. Connection limits and [backpressure](LIMITS.md) still apply. Try the hello example: ```sh -zig build hello -Doptimize=ReleaseSafe +zig build hello -Doptimize=safe ./zig-out/bin/hello --bind-address 0.0.0.0 --port 8080 --connections 16 ``` @@ -39,7 +39,7 @@ An embedded asset is useful when the file is known at compilation. For a file created later, run the [runtime download example](../examples/runtime_file.zig): ```sh -zig build runtime_file -Doptimize=ReleaseSafe +zig build runtime_file -Doptimize=safe ./zig-out/bin/runtime_file --file ./export.zip --port 8080 curl --output downloaded.zip http://127.0.0.1:8080/download curl --head http://127.0.0.1:8080/download @@ -67,7 +67,7 @@ staging buffer waits for transport progress. This is not an OS zero-copy operati The raw stream writer has no writable destination buffer. Consequently, `file_reader.interface.streamRemaining(stream.writer())` can fail with -`WriterBufferUnavailable` in Zig 0.16.0's file-reader fallback. Use `copyFrom` for +`WriterBufferUnavailable` in Zig 0.17.0's file-reader fallback. Use `copyFrom` for that transfer. Standard writer `writeAll`, `print`, and `flush` remain available. Source and sink failures are sticky: [`stream.failure()`](https://technologylab-ai.github.io/baz/api/#baz.Stream.failure) retains the error, and @@ -127,7 +127,7 @@ matching the original encoded names. Try the [decoded form example](../examples/decoded_forms.zig): ```sh -zig build decoded_forms -Doptimize=ReleaseSafe +zig build decoded_forms -Doptimize=safe ./zig-out/bin/decoded_forms --port 8080 curl --data 'name=Alice+Smith&%6eame=Bob%2BJones&flag&empty=' http://127.0.0.1:8080/ ``` diff --git a/docs/CONNECTION-LIMIT-WALKTHROUGH.md b/docs/CONNECTION-LIMIT-WALKTHROUGH.md index 2ed11e7..f46fc2c 100644 --- a/docs/CONNECTION-LIMIT-WALKTHROUGH.md +++ b/docs/CONNECTION-LIMIT-WALKTHROUGH.md @@ -3,7 +3,7 @@ See Baz's connection limit for yourself. Open two connections, try a third, then release a slot and try again. You control each step from your terminal. -**Allow about five minutes.** You need two terminals, exact Zig 0.16.0, Python 3, +**Allow about five minutes.** You need two terminals, exact Zig 0.17.0, Python 3, and a checkout of Baz. The client uses Python's standard library; there are no Python packages to install. The website is your guide; the server and clients run locally on your machine. @@ -22,12 +22,12 @@ cd baz ``` If you already have a checkout, open it in your terminal and run `git pull --ff-only` -to get this walkthrough. Check `zig version`: it must print `0.16.0`. +to get this walkthrough. Check `zig version`: it must print `0.17.0`. In **terminal 1**, from the Baz directory, run: ```sh -zig build run-app -Doptimize=ReleaseSafe -- --port 8080 --connections 2 --shards 1 --timeout-ms 300000 +zig build run-app -Doptimize=safe -- --port 8080 --connections 2 --shards 1 --timeout-ms 300000 ``` Wait for a line beginning `READY port=8080`. Leave this terminal running. @@ -38,7 +38,7 @@ The first build may take longer while Zig fetches dependencies and compiles. | `--connections 2` | Reserve two admitted connection slots. | | `--shards 1` | Use one I/O owner for this small exercise. | | `--timeout-ms 300000` | Give yourself five minutes between actions before idle connections expire. This is a walkthrough setting, not a deployment recommendation. | -| `-Doptimize=ReleaseSafe` | Keep runtime safety checks enabled. This exercise measures no performance. | +| `-Doptimize=safe` | Keep runtime safety checks enabled. This exercise measures no performance. | Use only the walkthrough client against this port during the exercise. Browser tabs can open their own connections, which would also count toward the two slots. diff --git a/docs/CONTINUATIONS.md b/docs/CONTINUATIONS.md index fe6158c..cfe504d 100644 --- a/docs/CONTINUATIONS.md +++ b/docs/CONTINUATIONS.md @@ -34,7 +34,7 @@ try app.routeContinuation("GET", "/stream", State, start, advance, .{}); Run [the complete example](../examples/continuations.zig): ```sh -zig build run-continuations -Doptimize=ReleaseSafe -- --port 8080 --execution workers --workers 1 +zig build run-continuations -Doptimize=safe -- --port 8080 --execution workers --workers 1 curl -N http://localhost:8080/stream ``` diff --git a/docs/COOKIES.md b/docs/COOKIES.md index 037cba3..3ac5010 100644 --- a/docs/COOKIES.md +++ b/docs/COOKIES.md @@ -154,7 +154,7 @@ cookie value, just like an opaque token. Baz does not verify signatures or inter claims; JWT verification and expiry policy belong to the application or a separately chosen library. Merely reading a cookie never authenticates it. -Run `zig build run-userpass_session -Doptimize=ReleaseSafe -- --port 8080`, then open +Run `zig build run-userpass_session -Doptimize=safe -- --port 8080`, then open `http://localhost:8080/login`. The public demo credentials are `zap` / `awesome`. The styled [login](../examples/assets/session_login.html) and [protected page](../examples/assets/session_home.html) are separate embedded assets. diff --git a/docs/DEPENDENCY.md b/docs/DEPENDENCY.md index bc23580..ec8509d 100644 --- a/docs/DEPENDENCY.md +++ b/docs/DEPENDENCY.md @@ -101,7 +101,7 @@ No throughput comparison is rerun solely for package naming or documentation. The [zli fork](https://github.com/renerocksai/zli), pinned to `4f17b1f1eacda7b87c49461e34b1520c392788b2` from its [Init adapter PR](https://github.com/renerocksai/zli/pull/1), supplies typed command-line parsing for all public examples and the App/streaming/borrow fixture executables. -Its [`parseInit(init, Options)`](https://technologylab-ai.github.io/baz/api/#zli.parseInit) entry point consumes Zig 0.16 `std.process.Init`, +Its [`parseInit(init, Options)`](https://technologylab-ai.github.io/baz/api/#zli.parseInit) entry point consumes Zig 0.17 `std.process.Init`, using the supplied I/O and process arena. The [example guide](../examples/README.md#typed-cli-options-with-process-initialization) records syntax, ownership, and startup behavior. @@ -117,7 +117,7 @@ Baz build graph. No zli code runs on the request I/O loop. Baz's public [`web.mustache`](https://technologylab-ai.github.io/baz/api/#baz.mustache) adapter consumes the immutable URL/hash-pinned [pure Zig Mustache fork](https://github.com/technologylab-ai/mustache-zig). The module is imported internally as `mustache_engine`; consumers use Baz's wrapper. -The library is MIT licensed and requires exact Zig 0.16.0. We maintain this fork +The library is MIT licensed and requires exact Zig 0.17.0. We maintain this fork for Baz's requirements; upstream is not required to adopt those constraints. No upstream PR is planned for these changes. Its parser/runtime changes and core-spec tests belong in that separate repository. Baz owns startup diff --git a/docs/INTERFACES.md b/docs/INTERFACES.md index 8d5f328..d216460 100644 --- a/docs/INTERFACES.md +++ b/docs/INTERFACES.md @@ -1,6 +1,6 @@ # Baz module contracts -Use exact Zig 0.16.0. +Use exact Zig 0.17.0. The public `baz` module exports App, Request, Response, response limits, and parsing helpers. The [API guide](APP-API.md) describes those contracts. The [ownership guide](OWNERSHIP.md) describes their lifetimes. diff --git a/docs/JOBS.md b/docs/JOBS.md index f730105..7ba7ee8 100644 --- a/docs/JOBS.md +++ b/docs/JOBS.md @@ -4,7 +4,7 @@ Run a small application that combines Baz's Mustache templates, cookie sessions, and notification-driven server-sent events: ```sh -zig build run-jobs -Doptimize=ReleaseSafe -- --port 8080 --execution workers --workers 1 +zig build run-jobs -Doptimize=safe -- --port 8080 --execution workers --workers 1 ``` Open `http://localhost:8080`. Sign in as **zap / awesome** or **baz / awesome**, diff --git a/docs/MUSTACHE.md b/docs/MUSTACHE.md index 0c8c9bf..c40f4e5 100644 --- a/docs/MUSTACHE.md +++ b/docs/MUSTACHE.md @@ -1,7 +1,7 @@ # Mustache templates Baz renders Mustache with a [pure Zig, MIT-licensed library](https://github.com/technologylab-ai/mustache-zig), -ported to exact Zig 0.16.0 and extended with explicit rendering limits. +ported to exact Zig 0.17.0 and extended with explicit rendering limits. Parse templates once at startup. Pass ordinary typed Zig data to a handler; render directly into its reserved response storage. @@ -13,7 +13,7 @@ This is a preview of the rendered page. Run the [complete example](../examples/m locally to use the greeting form: ```sh -zig build run-mustache -Doptimize=ReleaseSafe -- --port 8080 +zig build run-mustache -Doptimize=safe -- --port 8080 # Open http://127.0.0.1:8080/ in your browser. ``` @@ -123,7 +123,7 @@ are excluded explicitly. Those compatibility checks are independent of the framework's HTTP ownership tests. `zig build verify` checks Baz and its independent package consumer in Debug or -ReleaseSafe. After `zig build install examples -Doptimize=ReleaseSafe`, run +ReleaseSafe. After `zig build install examples -Doptimize=safe`, run `python3 tests/mustache_integration.py` for 12 HTTP groups: inline and fixed workers, HTML/HEAD, explicit decoding and escaping, partials, malformed raw targets with connection close, application input errors with keep-alive recovery, diff --git a/docs/REPOSITORY.md b/docs/REPOSITORY.md index a121686..f4d0037 100644 --- a/docs/REPOSITORY.md +++ b/docs/REPOSITORY.md @@ -36,7 +36,7 @@ sharding revision. Read [HANDOFF.md](../HANDOFF.md) for the next API work. ## CI and publication -[CI](../.github/workflows/ci.yml) installs exact Zig 0.16.0 from the official download index and verifies the archive checksum. +[CI](../.github/workflows/ci.yml) installs exact Zig 0.17.0 using signature-verified archive checksums in `.github/zig-release.json`. It runs Debug and ReleaseSafe verification on GitHub-hosted Linux and macOS runners. It also builds and exercises all supported examples with ReleaseSafe binaries. Hosted logs are retained for 14 days; preserve material runtime evidence in dated reports. diff --git a/docs/STREAMING.md b/docs/STREAMING.md index c4ff2c6..0bcc1c6 100644 --- a/docs/STREAMING.md +++ b/docs/STREAMING.md @@ -9,7 +9,7 @@ standard `std.Io.Writer`, flush, do finite work or sleep, then write again. The [runnable example](../examples/streaming.zig) sends three updates: ```sh -zig build run-streaming -Doptimize=ReleaseSafe -- --port 8080 +zig build run-streaming -Doptimize=safe -- --port 8080 curl -N http://127.0.0.1:8080/ ``` diff --git a/docs/WEBSITE.md b/docs/WEBSITE.md index db1fb65..12df9c9 100644 --- a/docs/WEBSITE.md +++ b/docs/WEBSITE.md @@ -8,7 +8,7 @@ The overview, guides, diagrams, examples, and measurements are specific to Baz. ## Build and preview -Use Python 3 and exact Zig 0.16.0 from `.zig-version`. The first build fetches +Use Python 3 and exact Zig 0.17.0 from `.zig-version`. The first build fetches checksum-pinned Zig dependencies; no Node package installation is needed: ```sh @@ -146,14 +146,14 @@ runtime or performance evidence. Windows platform claims are backed by [Baz’s ## Generated API reference -`zig build docs -Doptimize=ReleaseSafe` installs standalone Zig Autodoc at +`zig build docs -Doptimize=safe` installs standalone Zig Autodoc at `zig-out/docs/api/`. The website builder runs this step before publishing the viewer at `api/index.html`, including its JavaScript, WebAssembly, and source archive. The documentation module shares the public module’s source and build options, with an additional docs-only zli import for the example CLI reference. `src/baz.zig` is the documented package entry point; `@import("baz")` is unchanged. -Zig 0.16.0's `std.Build.Step.Compile.getEmittedDocs()` emits the viewer. Autodoc +Zig 0.17.0's `std.Build.Step.Compile.getEmittedDocs()` emits the viewer. Autodoc recognizes `root.zig` or a file matching the module name; otherwise it uses the first source archive member for that module (`lib/docs/wasm/main.zig`, `unpack`). Baz now follows the name convention. The imported engine and Mustache modules diff --git a/docs/api-packages.template.html b/docs/api-packages.template.html index c328e42..2240d9d 100644 --- a/docs/api-packages.template.html +++ b/docs/api-packages.template.html @@ -1,6 +1,6 @@
Related package APIs -

These references use the versions in Baz’s dependency pins and Zig 0.16.0.

+

These references use the versions in Baz’s dependency pins and Zig 0.17.0.