Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()
Expand All @@ -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"
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:
jobs:
windows-x64:
runs-on: windows-latest
timeout-minutes: 25
timeout-minutes: 60
env:
PYTHONDONTWRITEBYTECODE: "1"
steps:
Expand All @@ -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}$') {
Expand Down Expand Up @@ -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" }
Expand All @@ -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")) {
Expand Down
32 changes: 32 additions & 0 deletions .github/zig-release.json
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion .zig-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.16.0
0.17.0
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
17 changes: 16 additions & 1 deletion HANDOFF.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://github.com/technologylab-ai/baz>.
Expand Down
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) ·
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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/
```
Expand All @@ -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):
Expand All @@ -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).

Expand Down
Loading
Loading