Commit graph

36 commits

Author SHA1 Message Date
google-labs-jules[bot]
e878ea9db4 feat(wasm): Improve WASM error handling and loader
This commit introduces a comprehensive set of improvements to the error handling and loading mechanism of the WebAssembly (WASM) module.

The key changes include:

- **Structured Error Handling:** Replaced generic string-based errors with a structured `WasmError` type in the Go WASM wrapper. This provides standardized error codes (`bad_request`, `not_found`, `conflict`) and clear messages, allowing JavaScript clients to handle errors programmatically.

- **Isomorphic WASM Loader:** Refactored the JavaScript loader (`loader.js`) to be isomorphic, enabling it to run seamlessly in both browser and Node.js environments. The loader now detects the environment and uses the appropriate mechanism for loading the WASM binary and `wasm_exec.js`.

- **Type Conversion Fix:** Resolved a panic (`panic: ValueOf: invalid value`) that occurred when returning `[]float64` slices from Go to JavaScript. A new `pointToJS` helper function now correctly converts these slices to `[]any`, ensuring proper data marshalling.

- **Improved Smoke Test:** Enhanced the WASM smoke test (`smoke.mjs`) to verify the new structured error handling and to correctly handle the API's response format.

- **Configuration Updates:** Updated the `.golangci.yml` configuration to be compatible with the latest version of `golangci-lint`.

In addition to these changes, this commit also includes a new `AUDIT-ERROR-HANDLING.md` file, which documents the findings of a thorough audit of the project's error handling and logging practices.

Co-authored-by: Snider <631881+Snider@users.noreply.github.com>
2026-02-02 01:27:55 +00:00
Snider
91146b212a feat: Add CLAUDE.md for project guidance and documentation 2026-01-04 20:04:22 +00:00
Snider
e182d4f497
Merge pull request #4 from Snider/claude/expose-networking-analytics-LNUmx
feat: Expose networking analytics for KD-Tree NAT routing
2025-12-29 18:32:16 +00:00
Claude
298791ef95
feat: Add extended DNS record types (ClouDNS compatible)
- Add support for 13 additional record types: ALIAS, RP, SSHFP, TLSA,
  DS, DNSKEY, NAPTR, LOC, HINFO, CERT, SMIMEA, WR (Web Redirect), SPF
- Add GetDNSRecordTypeInfo() for metadata with RFC references
- Add GetCommonDNSRecordTypes() for commonly used types
- Add structured types for CAA, SSHFP, TLSA, DS, DNSKEY, NAPTR, RP,
  LOC, ALIAS, and WebRedirect records
- Export new functions in WASM bindings
- Update TypeScript definitions and loader.js
- Add comprehensive tests for new record types
2025-12-25 12:38:32 +00:00
Claude
d96c9f266c
feat: Add DNS tools with lookup, RDAP, and external tool links
Add comprehensive DNS tools module for network analysis:

DNS Lookup functionality:
- Support for A, AAAA, MX, TXT, NS, CNAME, SOA, PTR, SRV, CAA records
- DNSLookup() and DNSLookupAll() for single/complete lookups
- Configurable timeouts
- Structured result types for all record types

RDAP (new-style WHOIS) support:
- RDAPLookupDomain() for domain registration data
- RDAPLookupIP() for IP address information
- RDAPLookupASN() for autonomous system info
- Built-in server registry for common TLDs and RIRs
- ParseRDAPResponse() for extracting key domain info

External tool link generators:
- GetExternalToolLinks() - 20+ links for domain analysis
- GetExternalToolLinksIP() - IP-specific analysis tools
- GetExternalToolLinksEmail() - Email/domain verification

Tools include: MXToolbox (DNS, MX, SPF, DMARC, DKIM, blacklist),
DNSChecker, ViewDNS, IntoDNS, DNSViz, SecurityTrails, SSL Labs,
Shodan, Censys, IPInfo, AbuseIPDB, VirusTotal, and more.

WASM bindings expose link generators and RDAP URL builders
for use in TypeScript/browser environments.
2025-12-25 12:26:06 +00:00
Claude
4609b7b2bf
feat: Expose networking analytics for KD-Tree NAT routing
Add comprehensive networking analytics to support peer selection based
on performance and trust metrics for KD-Tree based NAT routing:

- Add kdtree_analytics.go with TreeAnalytics, PeerAnalytics,
  DistributionStats, NATRoutingMetrics, TrustMetrics, and
  QualityWeights structures
- Track query/insert/delete operations with timing statistics
- Track per-peer selection frequency and average distances
- Add PeerQualityScore() for composite peer ranking
- Add ComputeTrustScore() for reputation-based selection
- Add distribution statistics (min, max, mean, median, percentiles)
- Add feature normalization helpers for multi-dimensional peer data

WASM/TypeScript integration:
- Expose all analytics via WASM bindings
- Update TypeScript definitions with full type coverage
- Update loader.js with new API methods
- Update TypeScript demo to showcase analytics features

Includes comprehensive test coverage for all analytics functionality.
2025-12-25 12:18:18 +00:00
299b01ec73
Remove sample results and notes from perf.md
Removed sample benchmark results and notes from performance documentation.
2025-11-04 13:25:45 +00:00
1a6ab5bf49
Merge pull request #2 from Snider/kd-tree-peer-finding
Kd tree peer finding
2025-11-04 10:51:22 +00:00
fa42914681
Merge pull request #3 from Snider/increase-test-coverage
feat: Increase test coverage to over 90%
2025-11-04 10:47:09 +00:00
google-labs-jules[bot]
590dd7e019 feat: Increase test coverage to over 90%
This commit introduces a comprehensive test suite for the `gonum` backend, which was previously untested. It also adds tests for the `kdtree_helpers` package, specifically for the `ComputeNormStats3D` and `BuildND` functions.

The new tests cover a wide range of scenarios, including:
- Basic functionality of `Nearest`, `KNearest`, and `Radius`
- Edge cases such as empty trees, zero/negative inputs, and mismatched dimensions
- Various data configurations, including collinear points and negative coordinates

This commit also includes minor fixes to the existing tests to improve their robustness and accuracy.

As a result of these changes, the overall test coverage of the project has been increased from 80% to over 90%.
2025-11-04 10:37:52 +00:00
Snider
38a6c6aad3 Add KDTree normalization helpers and TypeScript demo with Vite 2025-11-04 02:15:04 +00:00
Snider
3c83fc38e4 Add dual-backend support for KDTree with benchmarks and documentation updates 2025-11-04 01:44:16 +00:00
Snider
5d1ee3f0ea Refactor CI configuration and documentation; improve error handling in KDTree functions 2025-11-04 00:38:18 +00:00
Snider
8e62b4e51d Update golangci-lint installation to use version 2 in CI configuration 2025-11-03 20:26:30 +00:00
Snider
b876c31881 WebAssembly build and add TypeScript definitions for KDTree API 2025-11-03 20:15:55 +00:00
Snider
c54a6ccd3a Fix fuzz testing command in Makefile to correctly match fuzz targets 2025-11-03 19:54:37 +00:00
Snider
34101cf686 Enhance CI workflow with coverage options and add tests for KDTree functionality 2025-11-03 19:50:05 +00:00
Snider
054c9af39e Enhance CI workflow with coverage options and add tests for KDTree functionality 2025-11-03 19:46:38 +00:00
Snider
3a67ba031b Add maintainer Makefile for local CI parity and update .gitignore and CI configuration 2025-11-03 19:33:28 +00:00
Snider
6f63ef9cc4 Add fuzz testing step to CI workflow 2025-11-03 19:09:40 +00:00
Snider
4ccccc97f5 Fix example function names, stabilize tests, and relax floating-point comparisons 2025-11-03 19:07:08 +00:00
Snider
6247c3de83 Add GoReleaser configuration for GitHub Releases and update CI workflow 2025-11-03 18:58:44 +00:00
Snider
3886724129 Add Cosine and Weighted Cosine distance metrics, enhance KDTree helpers, and update version to 0.3.0 2025-11-03 18:51:23 +00:00
Snider
ca6f89a99c Add examples for KDTree and enable errcheck linter in CI 2025-11-03 18:41:28 +00:00
Snider
3ba2b4fce3 Add normalization stats helpers and builders for KDTree 2025-11-03 18:36:09 +00:00
Snider
f106261216 Enhance CI workflow with coverage and benchmark reporting for KDTree 2025-11-03 18:26:40 +00:00
Snider
dad508de31 Add lint configuration, benchmarks, and documentation for KDTree 2025-11-03 18:19:12 +00:00
Snider
ec61d6afde Add CI workflow and update documentation for KDTree version 2025-11-03 18:10:49 +00:00
Snider
43c37f900f document KDTree helper functions for building normalised, weighted multidimensional points (performance weighted route discovery) 2025-11-03 18:00:33 +00:00
Snider
5da17d8b61 Add multi-dimensional KDTree example and update documentation 2025-11-03 17:33:37 +00:00
Snider
736ce911e0 Add KDTree implementation and example for finding the best DHT peer by ping 2025-11-03 16:49:31 +00:00
Snider
dbcad82d6b
Merge pull request #1 from Snider/copilot/fix-631881-1088881000-1ebcc534-1620-4cc1-a3b4-d4aabc78c0dc
Bootstrap Go library with EUPL-1.2, goreleaser, mkdocs-material, and sorting utilities
2025-11-03 15:53:11 +00:00
copilot-swe-agent[bot]
94aeaf4730 Fix GitHub Actions permissions for test workflow
Co-authored-by: Snider <631881+Snider@users.noreply.github.com>
2025-11-03 15:40:12 +00:00
copilot-swe-agent[bot]
195924fb9e Bootstrap Go library with EUPL-1.2, goreleaser, mkdocs, and sorting functions
Co-authored-by: Snider <631881+Snider@users.noreply.github.com>
2025-11-03 15:37:45 +00:00
copilot-swe-agent[bot]
fc74550e7c Initial plan 2025-11-03 15:29:57 +00:00
Snider
b8fe1a9eea
Initial commit 2025-11-03 15:29:53 +00:00