Skip to content

Feat/v1 sweep - #1

Merged
roobie merged 71 commits into
mainfrom
feat/v1-sweep
Mar 8, 2026
Merged

Feat/v1 sweep#1
roobie merged 71 commits into
mainfrom
feat/v1-sweep

Conversation

@roobie

@roobie roobie commented Mar 8, 2026

Copy link
Copy Markdown
Owner

No description provided.

roobie added 30 commits March 4, 2026 02:18
Implemented all core modules for zfetch v1:
- limits.zig: protocol and resource limits
- errors.zig: error types and exit code mapping
- timeouts.zig: timer abstraction for connect/idle/overall timeouts
- url.zig: URL parsing and validation (http/https only)
- net/dial.zig: TCP connection with stub for DNS
- http/parse.zig: HTTP status line, headers, chunk size parsing
- http/body.zig: fixed/chunked/EOF body readers
- http/response.zig: response orchestration
- http/request.zig: request composition and writing
- tls/tls.zig: TLS abstraction (OpenSSL stub for now)
- root.zig: main Client API
- tests/http_server.zig: test harness with HTTP endpoints
- main.zig: CLI skeleton

Status: Core modules complete but needs Zig 0.15.2 API compatibility fixes
- std.io.AnyWriter doesn't exist; need to use generic anytype
- std.io.getStdOut/getStdErr need to use std.fs.File.stdout()
- ArrayList.writer() requires allocator parameter

Next: Fix type system compatibility and finish Day 4-5 integration testing
…needed; make writeRequest generic and robust across writer types
…s\n\n- Keep adaptToNewApi adapter temporaries in scope and call writer.new_interface by pointer so the adapter remains live while writing.\n- Flush std.io.Writer after composing request to ensure buffered data reaches underlying sink (fixes Managed ArrayList empty-sink test failures).\n- Make helper accept *const std.io.Writer and @constcast internally to minimize call-site changes.\n- Fix single-argument @ptrCast/@constcast usage in src/timeouts.zig to be compatible with Zig 0.15.2.\n- Add chronicle entries documenting fixes.
roobie and others added 28 commits March 6, 2026 16:12
- Add isSensitiveHeader for case-insensitive detection of Authorization, Cookie, Proxy-Authorization
- Add filterHeaders helper to strip sensitive headers into stack buffer
- Integrate into redirect loop: compare against original host to prevent re-attachment
- Remove duplicate host_changed TODO blocks, consolidate into single filter
- 9 new tests covering isSensitiveHeader and filterHeaders edge cases

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add fd field to Timers struct for socket file descriptor
- Extract doRead helper for reader dispatch logic
- Add poll() call before read in readWithIdleTimeout when timeout > 0 and fd >= 0
- Return IdleTimeout error when poll() times out (no data within deadline)
- Set timers.fd from tcp_stream.handle (plain) or tls_stream.fd (TLS) in Client.fetch
- 4 new tests using pipe fds to verify timeout, data read, and no-timeout bypass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ension

- CliArgs struct with stub parse() that returns missing_url
- 30+ unit tests covering all 14 CLI flag requirements
- Method enum extended with PUT, PATCH, DELETE plus fromStr() tests
- resolvedMethod() tests for -d implies POST logic

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- parse() handles -d, -H, -X, -o, -s, -v, -k, --verbose, --insecure,
  --fail, --connect-timeout, --max-time, --help, --version
- Error returns for unknown flags, missing values, missing URL, invalid headers
- resolvedMethod() implements -d implies POST with -X override
- Supports --long-flag=value form for timeout flags
- -d @- and -d - set stdin_body flag for deferred reading
- No heap allocation -- all slices reference argv memory
- All 41 tests pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- SUMMARY.md with execution results and metrics
- STATE.md updated to phase 2 position
- ROADMAP.md progress updated
- REQUIREMENTS.md: CLI-01 through CLI-14 marked complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace bare-bones arg parser with CliArgs.parseOrExit()
- Add --help with usage text and examples, --version printing
- Wire -d, -H, -X, -s, -o, -k, -v, --fail, --connect-timeout, --max-time
- Add -d @- stdin body reading via File.readToEndAlloc
- Add -o file output with exit 23 on file open failure
- Add --fail exit 22 on HTTP 4xx/5xx
- Add -k TLS warning to stderr (gated by -s)
- Add method field to Options struct and wire to Client.fetch()
- Fix dial.zig Zig 0.15 API compat (parseIp error union, poll slice, fcntl bitmask)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove pub from ErrorsMod, tls, cli in root.zig
- Add pub exitCode/errorMessage re-exports for library consumers
- Add cli as private module import in build.zig for exe
- Update main.zig to use @import("cli") and zfetch.exitCode/errorMessage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ICENSE

- Move BoringSSL linking from exe.root_module to mod for transparent consumer linking
- Remove duplicate BoringSSL linking from tls_integration_mod (inherits from mod)
- Update build.zig.zon version to 0.1.0 with complete .paths
- Add Apache-2.0 LICENSE file with copyright notice
- Fix cli.zig to import types through zfetch module (Zig module uniqueness)
- Keep pub tls in root.zig for integration test access (documented as non-stable)
- Give cli module zfetch as dependency to resolve cross-module file ownership

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add 03-01-SUMMARY.md with execution results
- Update STATE.md position, decisions, and metrics
- Update ROADMAP.md with plan progress
- Mark LIB-01, LIB-02, LIB-03 requirements complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…profiles

- Document what zfetch is, installation prerequisites, and build instructions
- CLI usage examples and complete options table from help_text
- Library usage with build.zig.zon dependency, build.zig wiring, and Client.fetch example
- Build profiles table with measured sizes: ReleaseSmall 2.5 MB, ReleaseSafe 26.4 MB

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add `main` binary to .gitignore. Include milestone audit report
confirming 23/23 requirements satisfied across all 3 phases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ziglang/setup-zig does not exist. Replace with mlugg/setup-zig@v2,
the community-standard GitHub Action for Zig setup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@roobie
roobie merged commit 85bf213 into main Mar 8, 2026
2 checks passed
roobie added a commit that referenced this pull request Mar 8, 2026
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