Commit graph

7 commits

Author SHA1 Message Date
Virgil
dff3d576fa fix(cdp): resolve issue 2 audit findings
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-23 07:34:16 +00:00
Claude
2f9ff11204
chore: migrate to dappco.re vanity import path
All checks were successful
Security Scan / security (push) Successful in 8s
Test / test (push) Successful in 42s
Change module path from forge.lthn.ai/core/go-webview to
dappco.re/go/core/webview. Update all Go imports and documentation
references. The go-log dependency uses a replace directive to
resolve via the forge until the vanity redirect is configured.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 23:45:30 +00:00
Snider
900cb750cf fix(console): buffer trim panic when limit < 100, add unit tests
All checks were successful
Security Scan / security (pull_request) Successful in 10s
Test / test (pull_request) Successful in 30s
CLAUDE.md: update error wrapping guidance to reflect coreerr.E() convention.

Console buffer trimming in both Webview.addConsoleMessage and
ConsoleWatcher.addMessage panicked with slice bounds out of range
when consoleLimit was smaller than 100. Use min(100, len) for safe
batch trimming.

Added 22 unit tests covering pure functions (FormatConsoleOutput,
containsString, findString, formatJSValue, getString), ConsoleWatcher
filter/count/handler logic, ExceptionWatcher operations, WaitAction
context handling, and buffer limit enforcement. Coverage: 3.2% → 16.1%.

DX audit findings:
- Error handling: clean (all coreerr.E(), no fmt.Errorf)
- File I/O: clean (no os.ReadFile/os.WriteFile — package uses HTTP/WS only)

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 08:54:22 +00:00
Snider
ab77e922bd refactor: replace fmt.Errorf/errors.New with coreerr.E()
All checks were successful
Security Scan / security (push) Successful in 8s
Test / test (push) Successful in 1m14s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 21:10:49 +00:00
Snider
d0dd96d115 feat: modernise to Go 1.26 iterators and stdlib helpers
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 1m42s
Add iter.Seq iterators (MessagesAll, FilteredMessagesAll, ErrorsAll,
WarningsAll, ExceptionsAll, GetConsoleAll, QuerySelectorAllAll,
ListTargetsAll) for streaming. Use slices.Clone for handler copies,
range-over-int in findString.

Co-Authored-By: Gemini <noreply@google.com>
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-23 05:26:44 +00:00
Snider
095dada85c refactor: apply go fix modernizers for Go 1.26
Automated fixes: interface{} → any, range-over-int, t.Context(),
wg.Go(), strings.SplitSeq, strings.Builder, slices.Contains,
maps helpers, min/max builtins.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-22 21:00:17 +00:00
Snider
45f119b9ac feat: extract go-webview from core/go pkg/webview
Chrome DevTools Protocol client for browser automation.
Zero external dependencies (stdlib only).
Module: forge.lthn.ai/core/go-webview

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-19 16:09:11 +00:00