# Pinned sing-box rule-set patch Upstream: sing-box **v1.14.3**, GPL-3.0-or-later; license copy in `docs/upstream/sing-box-LICENSE`. `rule_set_remote.go.txt` is the pinned source with MeshPort's small changes: - Match, merge, string rendering, cleanup and close synchronize rule-list access with the existing RWMutex. Upstream already locked replacement and metadata, but did not lock all readers/clear operations. The remote refresh integration test reproduced this with `go test -race`. - Remote downloads have a 30-second deadline, a 32 MiB response limit and at most five HTTPS redirects. HTTP downgrade and URL authentication are rejected. - Failed fetch or parsing leaves the last good rules intact. `sh scripts/go-local.sh ...` prepares an 11 MiB private module copy under ignored `work/singbox-patched`, verifies the original rule source hash, and uses an alternate modfile. The shared download cache, tracked `go.mod` and dependency checksums are unchanged. All project Go build/test scripts use this wrapper. Invoke it for development builds too; raw `go build` uses the unpatched upstream module. The `.txt` suffix prevents Go from treating the patch directory as a standalone package. Review and rebase this patch explicitly when updating the pinned version.