Skip to content

feat: Chrome lifecycle, HAR recording, 99+ tests, docs#35

Merged
justrach merged 3 commits into
mainfrom
feature/20-chrome-lifecycle-management-launch-supervise-healt
Mar 4, 2026
Merged

feat: Chrome lifecycle, HAR recording, 99+ tests, docs#35
justrach merged 3 commits into
mainfrom
feature/20-chrome-lifecycle-management-launch-supervise-healt

Conversation

@justrach

@justrach justrach commented Mar 4, 2026

Copy link
Copy Markdown
Owner

Summary

Implements Chrome lifecycle management (#20), comprehensive test suite (#16), HAR recording, tab cleanup, and full documentation.

New Files

  • src/chrome/launcher.zig — Chrome launch, health-check, auto-restart, port detection
  • src/cdp/har.zig — HAR 1.2 recorder with CDP Network domain integration
  • src/test/integration.zig — 30+ integration tests
  • CHANGELOG.md — v0.1.0 release notes
  • CONTRIBUTORS.md — contributor guide

New Endpoints

  • /har/start, /har/stop, /har/status — HAR recording lifecycle
  • /close — tab cleanup with full resource deallocation

Memory Safety

  • removeTab now cleans up HAR recorders (was a leak)
  • Fixed double child.spawn() bug in launcher
  • Full cleanup chain: Launcher → Bridge → CDP → HAR → Snapshots → Tabs

Tests

  • 99+ tests all passing
  • Integration tests for config, bridge stress, diff edge cases, ref cache @en system, markdown, URL validation, JSON utils, launcher

Closes #20, #16

justrach and others added 3 commits March 4, 2026 15:59
…hot pipeline, crawler, and 20 passing tests

- build.zig + build.zig.zon for Zig 0.15.1
- HTTP server with /health and /tabs endpoints (std.http.Server)
- Bridge with thread-safe tab registry (RwLock)
- CDP client with JSON-RPC message building
- A11y snapshot pipeline: filter, depth, format, diff
- Crawler: URL validator (SSRF protection), rate limiter, HTML→Markdown converter
- Stealth mode: embedded stealth.js + UA rotation
- Storage stubs: local, Kafka, R2
- All 20 unit tests passing

Refs #1
…34)

- Add pure Zig WebSocket client (RFC 6455: handshake, masked frames, large msg alloc)
- Wire CDP client into Bridge with per-tab connections and string ownership
- Add HTTP routes: /discover, /navigate, /snapshot, /action, /text, /screenshot, /evaluate
- Add /browdie easter egg 🧁 (she browses different)
- Fix #30: /discover HTTP/1.1 + Content-Length + SO_RCVTIMEO
- Fix #31: WebSocket localhost -> 127.0.0.1 resolution
- Fix #32: Tab string lifetime (dupe into bridge allocator, fetchRemove old entries)
- Fix #34: CDP response ID correlation (skip events, match by command ID)
- Add test harness for agent-led browser testing (#33)
- Fix embedFile paths, i128->i64 cast, comptimePrint->runtime search
- 49 tests passing, full e2e verified against Chrome + merlionjs.com

Amp-Thread-ID: https://ampcode.com/threads/T-019cb7e2-d40c-7089-949c-dee9ad3ede19
Co-authored-by: Amp <amp@ampcode.com>
- Chrome launcher (launch, health-check, auto-restart, port detection)
- HAR recorder with /har/start, /har/stop, /har/status endpoints
- /close endpoint for tab cleanup with full resource deallocation
- HAR recorder cleanup in removeTab + Bridge.deinit (no memory leaks)
- 99+ tests: integration suite, bridge stress, diff, ref cache, markdown, validator
- Updated readme.md to reflect actual implemented state
- Added CHANGELOG.md and CONTRIBUTORS.md

Closes #20, #16

Refs #20
@justrach justrach merged commit eaac65c into main Mar 4, 2026
@justrach justrach deleted the feature/20-chrome-lifecycle-management-launch-supervise-healt branch March 31, 2026 22:27
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.

Chrome Lifecycle Management: launch, supervise, health-check

1 participant