Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
33 KiB
Protocol runtimes and original errors
The source layout on both platforms is documented in SOURCE_LAYOUT.md. The folder migration is complete; WG/AWG transport validation and the combined stable release are separate gates.
Architecture basis (owner decision 2026-11-04)
Each protocol runs on its own complete native core, so that everything works as correctly as possible. sing-box is only the intermediary gasket: the owner of TUN, routing, DNS and protected sockets, and the glue between the native cores and the system. Do not reimplement or approximate a protocol in sing-box or in app code when its native core exists. More native cores will be added over time, one per protocol that needs it; a new core is a new protocol owner behind the same gasket, not a replacement for sing-box. The Xray and Hysteria helper processes on Windows are deliberate.
The transport owner is fixed on both platforms: VLESS, VMess and Trojan go to the official Xray core (owner decision 2026-11-16: sing-box has no XHTTP for them and only approximated the rest), Hysteria2 to the official Hysteria core, WG/AWG to the official Amnezia device/netstack, and the remaining protocols to sing-box. Plain WG uses Amnezia with AWG extensions absent. The only routing, DNS and TUN owner on both platforms is sing-box. Its active native JSON owns domain rules and geosite-derived native .srs rule sets in both proxy and TUN modes. Xray and Hysteria implement only the selected proxy transport, never a second routing policy. Core selection is not a capability probe or an automatic fallback between protocol implementations.
Protocol adapters retain the original imported URI. Xray needs native JSON, so its adapter translates the URI at that boundary; it must not translate it through sing-box first. On Android the cores are embedded libraries behind the same outbound interface; sing-box owns the only TUN and protected sockets.
Legacy Windows Xray-front and tun2socks selections migrate to sing-box. Existing raw Xray configuration files are retained, not translated or overwritten. Auto connect is disabled during that migration: users must review their sing-box rules before explicitly reconnecting. Existing sing-box users keep auto connect.
NaiveProxy keys on the stock naive client (owner decision 2026-11-27)
The VPN bot sells NaiveProxy keys (naive+https://<client_id>:<secret>@<host>:<port>[?insecure-concurrency=<n>]#<name>, grammar in xray_fluent/engines/naive/key.py, owned by the bot's vpnbot_contracts/naive_link.py). Owner words: "use the stock naive instead of sing-box, to make the most of the original core's capabilities". naive is Chromium's network stack and is not a library, so it follows the Hysteria2 pattern: its own helper process, sing-box stays the gasket.
- Core:
core/naive.exeof the officialklzgrad/naiveproxyreleasev154.0.8037.49-5(the brief named a non-existent ownerklzgrmzybmc;klzgradis the real one). Pinned as the lock sourcenaiveinscripts/core-lock.windows-x64.json(SHA-256 of the zip, the file mappingnaive.exe), resolved byscripts/resolve_core_versions.pylike the other cores (select_stable_naive, tagvA.B.C.D-N), verified byscripts/verify_core_bundle.ps1(naive.exe --version). The zip has NO publisher signature (no Authenticode); the SHA-256 pin is the protection. The upstream release notes of -5 say all users must upgrade (forged eMudhra certificates), so this core is refreshed with the app, not left behind. - Protocol ownership:
ProtocolCore.NAIVE; a key is only ever started from the original line (node.link), never translated to a sing-box outbound (build_singbox_outboundrefuses it). The node'soutbounddict names the server and the concurrency and carries no credentials, so exports and diagnostics cannot leak the secret. - Runtime:
_plan_naive_sidecar_runtimereplacesproxywith a loopbacksocksoutbound (random user and password) and writes the stock client's ownconfig.json:{"listen": "socks://u:p@127.0.0.1:port", "proxy": "https://id:secret@host:port", "insecure-concurrency": n}(the key's concurrency is passed as issued; the bot issues 1..4, the app accepts 1..99 and the import warns above 4).NaiveManager(engines/naive/manager.py) starts the process, deletes the config file (it holds the secret) as soon as the loopback port is up, and requires one real HTTPS request through the tunnel before the session counts as started (a fresh key needs up to a minute on its node, so the check retries for 25 s). The server name goes to naive ashost-resolver-rules "MAP host ip"from the app's trusted DoH, like the Hysteria2 helper, With "IPv6 first" on (and IPv6 on the network) the trusted IPv6 address is pinned first; if no request got through within 4 s, naive is restarted on the IPv4 address, and the family memory (server_family.MEMORY) keeps the answer for 30 min (an IPv6 that failed is remembered only once IPv4 worked, so a wrong key never marks IPv6 dead). Off, the first IPv4 address is pinned as before. The family that carries the connection is read back from the OS table of TCP connections (or from the pinned address) and shown on the dashboard (network/connection_family.py). - Routing: a rule
process_path: naive.exe -> directat the top keeps the helper's own TCP out of the TUN; with the WARP entry on, that rule leads into the hop (TUN mode only; the proxy mode refuses like the other helpers). The WARP combination with naive is not proven on a real run. - Not supported (stated, not hidden): slots (a naive server cannot be a service slot), speed and latency probes (connection only), UDP (naive's SOCKS5 carries TCP; the QUIC block of the app makes browsers fall back to TCP).
- Secrets: the key line lives only in
node.link(encrypted state) and in the helper's short-lived config file; log lines passredact_runtime_log(secrets=...)and the manager never emits the config. - Tests:
tests/test_naive_core.py(grammar contract of the bot, importer, planner),tests/test_naive_live.py(real key, real planner, realsing-box.exefront, stocknaive.exe: real page through the whole chain; skips without the key~/.config/kvn-test-naive-key).
IPv6 to the VPN server first (owner decision 2026-11-22)
A server's IPv4 address is often blocked by address while its IPv6 address still works. With the setting «IPv6 к серверу первым» (Settings → network, on by default) and a native global IPv6 address on the PC's uplink (xray_fluent/network/server_family.py, adapter data only, no probe), each core gets IPv6 first in its own native way:
- sing-box native outbounds:
domain_resolver: {server, strategy: prefer_ipv6}(_ensure_proxy_server_bootstrap_contract); sing-box races IPv6, then IPv4 after 300 ms or at once on failure. WG endpoints are unchanged. - Xray (hybrid, dialed by sing-box through the protect inbound): app
resolverules on the protect inbound withnetwork: tcpandstrategy: prefer_ipv6for every server name; the direct outbound races the families. UDP keeps its previous order (one socket, no way back). - Core patch
core-patches/address-family-memory.patch(samecommon/familymemoryas Android 0020): the family that last worked for a server name starts first; cleared on a network change and after 30 minutes. - Hysteria2 (
hysteria.exewith a pinned address): IPv6 pinned first when the start verifies the server; no authentication within 4 s (or all probes failing earlier) restarts the attempt pinned to IPv4 and remembers the IPv6 failure inserver_family.MEMORY(reset on a network change). - Latency probes: one family per temporary core (Xray
UseIPused to pick at random among both families), with IPv6 first the native race (XrayhappyEyeballs, sing-boxprefer_ipv6); the Hysteria probe pins IPv6 only once IPv6 has worked for that server. - Amnezia (WG/AWG,
zapret-amnezia.exe, one peer): the app resolves the peer and passes the preferred family asaddress(fromserver_family.MEMORY, IPv6 when nothing is remembered) and the other family asrace_address. The helper's bind (runtime/amnezia/family_race.go, same code as Android patch 0021) sends the first handshake to both; the server answers one copy (the second is a replay for it) and the bind keeps that family for the session. Unanswered retries alternate families, so a family that loses only the replies cannot win every time. The helper reports only the family (address_familyevent, never the address) and the app remembers it. No added delay and no restart, unlike the Hysteria2 fallback. - Not changed: slot helper processes, Xray standalone mode (Go's own RFC 6555 dial with the system resolver order).
WARP as the entry hop to our server (owner decision 2026-11-25)
Device -> Cloudflare WARP -> our server -> internet. The provider sees only Cloudflare, never the server address (Hiddify's "Proxy unblocker", improved). Setting «Вход через Cloudflare WARP» (Settings -> network), off by default, applied at the next connect. The same design as Android (android/docs/ARCHITECTURE.md).
- Everything stays in sing-box, the gasket: WARP is the core's
warpendpoint. Core patchcore-patches/warp-entry-profile.patch(same code as Android 0022) gives it the tunnelmtu(the app uses 1330: Hysteria2 sends 1252 byte payloads, a 1300 byte packet over IPv6 that does not fit in 1280; packet arithmetic, not yet measured in the tunnel),profile.cache_path(a private file indata/with the Cloudflare account, reused on restart instead of registering a device) and the account's assigned address as the default peer (the host name resolves to a different edge address each time and some did not answer in field tests). xray_fluent/engines/singbox/warp_entry.pyedits only the runtime config, after planning (apply_warp_entryinruntime_planner.py, run again after the service slots are attached), without any change to a native core: sing-box native outbounds get adetourto the hop, including the connection pool's servers, which live in the provider file (plan.provider_payload) and not inoutbounds; the Xray protect-inbound rule-> directleads into the hop; under the TUN the process rules of the Hysteria helper and of the slot helpers (process_path: <exe> -> direct) lead into it as well. (The Hysteria rule is the 0.8.110 one; the slot helpers' rule,action: route, is unit-checked but not yet proven on a live run with a real server.) Hysteria and Xray stay official and unpatched.- Edge scan (core patch
core-patches/warp-entry-scan.patch, same code as Android 0035; owner request 2026-11-28): when the first candidate fails its probe, the core sends real WireGuard handshakes to about 1000 (address, port) pairs of the known WARP blocks once, at 400 datagrams per second, and tries the edges that answered before the fixed list. Nothing is sent on a network where the first candidate works. Seeandroid/docs/ARCHITECTURE.mdfor the measurements. - Local relays never enter the hop: the sing-box front reaches every helper process through a loopback SOCKS outbound (
127.0.0.1:<relay>); the helper behind it is the one that dials out. A loopbackserveris not chained (_is_loopback); chaining it sent the relay traffic to loopback on the far side of WARP (found in the real plan of 0.8.110, fixed in 0.8.111). - Owner rule: WARP is an ENTRY only, never an exit and never a server to pick. The guard
violationsallows exactly a server'sdetour(config and pool), the endpoint's own tag and the helper rules in their exact planner shape (process_path/inbound/outbound,action: routeonly); anything else (selector member, other rule,route.final, user JSON) stops the plan. Direct traffic never enters WARP. - Helpers that dial with their own sockets (owner request 2026-11-26: "everything works with Hysteria, AWG and the rest, on both systems"): Xray enters through the protect inbound, native outbounds through
detour, and the helpers that dial with their own UDP socket talk to a loopback relay of sing-box: adirectUDP inbound (__app_warp_udp_*,override_address/override_port= the real server) whose rule leads into the hop (runtime_planner._udp_relays). The main Hysteria2 helper uses it in the proxy mode (under the TUN its process rule leads into the hop as before; the server name stays in the TLS SNI, a port-hopping list keeps its first port), the AmneziaWG/WireGuard helper in both modes: its peer is 127.0.0.1:relay, it runsunbound(no IP_UNICAST_IF to the physical interface, helper configunbound), its tunnel is IPv4 only with an inner MTU of 1250 so that the packet fits the hop (MTU 1330), and it starts AFTER the sing-box front (its datagrams need the relay), never as a prepared replacement beside the old one. Separate servers for services (slot helpers) move between servers while connected, which a relay with a fixed target cannot follow: under the TUN their process rules lead into the hop, in the proxy mode the service follows the main server (note in the log). Verified on win10 with the real components: the real AmneziaWG server brings a real page through the hop in the proxy mode (5 s). The earlier attempt through the TUN with a process rule never completed the handshake (parked patch in the journal folder); the relay is what works. - Verified on real components (2026-11-25, win10): a pool-file outbound with
detourto the endpoint dials through the real WARP (endpoint/warp[kvn-warp-entry]: outbound connection to ..., Cloudflare answered). - App-side registration (0.8.113, owner decision 2026-11-25): on some networks the provider resets the registration request to the Cloudflare API (field report:
wsarecv: An existing connection was forcibly closed by the remote host), and without an account the hop never starts.xray_fluent/network/warp_registration.pyregisters the account itself before planning (_ensure_warp_account_steps, called first instart_proxy_stepsandstart_tun_steps) and writes the file the core reads (profile.cache_path), so the core never calls the API. Routes: the plain request, the same with the TLS ClientHello cut into two TCP segments inside the server name, and both for every other address of the API host. If all fail, this launch runs WITHOUT the hop (a visible message says the server address is seen once), and when the connection is up the account is registered through the local HTTP proxy of the running VPN (proxy_url), after which the app reconnects with the hop (_register_warp_via_vpn_steps). Verified on win10 with the real API: both direct routes, the through-proxy route (a real sing-box proxy inbound, Windows Python 3.12), and the real core starting WARP from the Python-written file with the API unreachable for it (5/5 DNS answers through WARP). Not verified: a network that really resets the request. - Server names resolve outside the tunnel (0.8.114, owner's diagnostics 2026-11-26): the hop's WireGuard endpoint resolves a domain destination ITSELF through the router's DNS rules (
dnsRouter.Lookupin the core), and the template's rules end at the proxied DNS, which waits for the very connection being opened:lookup <server>: context deadline exceeded.apply_entry_hoptherefore puts one DNS rule at the top ofdns.rules({domain: [every name the hop dials], action: route, server: bootstrap-dns}): the names of chained outbounds (config and pool) and the server names of the Xray sidecar. Verified on win10 with the real planner config,sing-box.exeandxray.exe: without the rule the hop's lookup hangs (curl 25 s), with it the log showsdns: match[0] domain=... => route(bootstrap-dns)and the lookup completes in milliseconds. When the app's IPv6-firstresolverule already resolves the name before the hop, the hop dials the address and the rule is not needed; it covers every other case. - What the app says about the hop (0.8.115, owner request 2026-11-26, "more logs"): per connect with the setting on,
[warp-entry] вход через WARP включён, аккаунт WARP готов(or the registration route and its time in ms), and 40 s after the connect one line[warp-entry] итог за 40 с ...with the handshake retries (ports only, never addresses), theendpoint not initializedcount, the address-lookup timeouts and the registration errors the real core reported (network/warp_hop_health.py, fed from_on_core_log). When the tunnel is clearly not coming up (5 refusals or 4 unanswered handshakes) the user is told once, in plain words, that the network may block the WARP UDP ports (2408, 500, 1701, 4500). Verified on win10 with the real controller and cores: the normal chain, and a tunnel pointed at an address nothing answers (tests/test_app_e2e_warp_entry.py). The reports service (docs/CLIENT_REPORTS.md) refuses unknown fields, so the same facts reach its database only after the receiver admits them (proposal sent to the reports chat 2026-11-26). - No naked WireGuard (0.8.116, owner request 2026-11-26): the hop endpoint carries client-side Amnezia noise,
WARP_ENTRY_NOISEinwarp_entry.py: three junk datagrams (10-30 bytes) and an I1 packet shaped like a DNS query to a Russian domain (the chain of the app's WireGuard masking,masking/wireguard.dns_chain("yandex.ru"), cross-checked by a test). Only the initiator sends them, so Cloudflare's plain WireGuard server ignores them: checked against the real WARP on win10 (plain, junk only, junk with I1 and the real controller e2e all got the handshake answered). H1-H4 and S1-S4 are not used: they must equal the server's. What the noise cannot do: the handshake packet itself is still WireGuard. MASQUE (0.8.124, core patchcore-patches/warp-entry-masque.patch, the same code as Android 0026; owner 2026-11-26, "WARP does not work on mobile data": the phone's tunnel answered the first handshake and then went silent): after the account's own WireGuard address and its second port thewarpendpoint tries Cloudflare's MASQUE tunnel over QUIC (UDP 443) and over HTTP/2 (TCP 443), with its own account kept inwarp-entry-profile.json.masque, and a running tunnel whose connections stop completing (a dial waiting longer than 6 s, twice in a row, none succeeded in the last 30 s) is replaced by the next candidate, the transport that failed going last; the working candidate is remembered in.edgefor 12 hours;no_masquekeeps WireGuard only. Verified on the host against the real Cloudflare with silently dropped packets (tc,nft ct packets): WireGuard blocked -> MASQUE over QUIC at 8 s, WireGuard and QUIC blocked -> MASQUE over HTTP/2 at 13 s, WireGuard dying after its handshake -> rotation to MASQUE; not proven on the owner's carrier. Field diagnostic of Android 0.6.62 (the owner's mobile carrier) found two defects, fixed in 0.8.125 with the same code as Android 0027 (core-patches/warp-entry-masque-timing.patch): the start probe counted as a recent success and the 30 s quiet period delayed the replacement of the dead tunnel to 37 s, and the core's own MASQUE registration was cancelled by the 7 s probe. The app now registers the MASQUE account itself on a worker thread beside the connect (network/warp_masque_account.py, the routes ofwarp_registration.routes, a cut ClientHello included,warp-entry-profile.json.masque); the key layout is checked by the real OpenSSL, the registration by the real API (KVN_REAL_WARP=1), and the file was accepted by the real core with WireGuard and QUIC dropped. Field diagnostic of Android 0.6.63 (mobile data, 0.8.126 carries the same fix): the app's own registration of the MASQUE account failed too, on all 16 routes (every direct address of the API host, plain and with the cut ClientHello, 25 s): that carrier blocks the API by its TLS name, and a decoy name does not help there (the API answers 403 to a name that is not its own, checked against the real API). So the account has to be registered once on a network that lets the API through (any Wi-Fi: the app does it at the next connect with the hop on, beside the connect) or through a server. The tunnel itself is another matter: the MASQUE edge authenticates by the client's key and answers ANY TLS server name (www.cloudflare.com, yandex.ru and example.com over QUIC and HTTP/2, checked against the real edge), so core patchcore-patches/warp-entry-masque-sni.patch(the same code as Android 0028) puts the decoy names before Cloudflare's ownconsumer-masque.cloudflareclient.comand HTTP/2 (TCP 443) before QUIC (UDP is what mobile networks throttle first): the candidates are h2www.cloudflare.com, quicwww.cloudflare.com, h2 and quic with the real name, h2yandex.ru; the one that answered is remembered with its name in.edge. Field diagnostics of Android 0.6.64 (mobile data, 2026-11-27) and the owner's "try to break through at least once and then reuse that account": a connect now uses the hop only when BOTH accounts exist (the MASQUE one is waited for 12 s at most,_WARP_MASQUE_BUDGET_S); when a registration is blocked this connect runs without the hop (the warning says so) and_register_warp_via_vpn_stepsregisters both accounts through the VPN's local HTTP port (warp_registration.ensure_account(proxy_url=...),warp_masque_account.ensure(proxy_url=...): one routevpn, PATCH with the device token included, no back-off) and reconnects with the hop; the files stay. Checked against the real API through a forwarding CONNECT proxy (KVN_REAL_WARP=1,RealRegistrationThroughProxyTests); the live e2e with the API blocked by a firewall rule isWarpEntryApiBlockedE2E(win10). Real WARP edge addresses that answered on every tried port from abroad: 162.159.192.1/.9 and 188.114.96-99.1 (2408, 500, 4500, 1701, 854, 934); 162.159.193.1 and 204.1 are not WARP edges. - The offer (0.8.116): when a connection fails and the entry is off, the dashboard says so and offers «Включить вход через WARP». The button opens the settings page and runs a one-step tour (
WARP_HINT_STEP) that highlights the switch; it marks nothing in the real tour, which has a WARP step of its own. - Candidates and edge memory (0.8.117, core patch
core-patches/warp-entry-candidates.patch, same code as Android 0025; owner request 2026-11-26: "changing IP addresses is simple"): the start recovery walks eight candidates, 3 s each: the account's own address (twice, then once more on a fresh socket) and then other WARP edges and ports: 188.114.97.1:2408, 162.159.192.1:500, 188.114.99.1:4500, 188.114.96.1:1701, 188.114.98.1:854 (real Cloudflare WARP answered the handshake on all of these, win10 sweep 2026-11-26; 162.159.193.1 and 204.1 are not WARP edges). The edge that answered is kept next to the account file (warp-entry-profile.json.edge, literal IP and port only) and tried first at the next start; the account's own address answering clears it. Verified against the real WARP on the host (account address blacked out: tunnel at attempt 4,warp=on; restart: remembered edge, 2 s), by the Go tests as a Windows exe on win10, and by the real-controller e2e with the patchedsing-box.exe(WarpEntryBlockedAddressE2E: a blocked account address still gets the tunnel). - Tests on real data (2026-11-26, owner rule 2026-11-25): the hop tests no longer use invented configs.
tests/real_subscription.pyfetches the live subscriptions of the vpnbot test person (file~/.config/kvn-test-subscription, on CT 201 and on win10; overrideKVN_TEST_SUBSCRIPTION; without it the tests skip) and parses them with the app's importer.test_warp_entry_planner.pyandtest_warp_entry_hop.pyrun the real planner on every real VLESS and Hysteria2 server; the AmneziaWG key is refused with the known reason.test_app_e2e_warp_entry.pyruns the real controller, cores and WARP (slots under the TUN too, with KVN_E2E_TUN=1: a real service slot reaches its own server through the hop): a real VLESS server brings a real web page through the hop (and still does when the account's own address is blocked), a real Hysteria2 server is refused in the proxy mode with the reason, and, only withKVN_E2E_TUN=1because it changes the routes of the machine, a real Hysteria2 server brings a page through the hop under the TUN (win10, 2026-11-26). The e2e shows the dial in the log by running with a copy of the shipped sing-box config whose only change islog.level: info. Not covered by real data: the detour of a native sing-box outbound (the test person has none) and WireGuard/AmneziaWG through the hop. - Timing log (owner request 2026-11-26, "taking too long, improve the logs"): every start logs
[perf] план runtime: N мс, outbound'ов M, вход через WARP да/нет(operations._log_plan_time), next to the registration line that already carries its milliseconds. An Android phone diagnostic showed a 5.6 s phase only with the hop on a 1448-server profile; the Windows planner has not shown it, and this line is how the next Windows diagnostic would. Same as Android 0.6.58 ("on PC it should be the same", owner 2026-11-26): the hop line also carries the time of the hop pass (проход входа N мс, ~5 ms for 1980 real-shaped pool servers), and the core's own words about the tunnel become[warp-entry]lines with the seconds since the connect (рукопожатие WARP не ответило на порту P ... (N с после подключения),туннель WARP ответил на порту P, попытка K ..., ports only,HopHealth.timeline; the second one is an INFO line of the core, visible only at the info log level). Measured on the real planner: 30 ms for a pool of 1980 servers with or without the hop, so the PC does not show the 5.6 s of the Android phone; the owner's Windows 0.8.118 diagnostic (1952 outbounds, proxy mode) connects in 5.0 s, of which Xray's own start is 1.4 s. - Registration: the account is registered by a plain Go HTTP request of sing-box.exe; with the TUN up it would be captured and routed back toward the hop that waits for it. The hop has
profile.detourto its own direct outboundkvn-warp-api, which leaves on the physical interface directly (same fix as Android, found there first). - Stalled starts: roughly one start in four never got a handshake answer for the same account (also on the Windows VM).
core-patches/warp-entry-recovery.patch(same code as Android 0023) probes the started tunnel once and, if it does not open within 4 s, rebuilds the endpoint with a fresh source port and the next of 4 candidates, all literal IPs (assigned v4 on its first port, its second, the first again, then162.159.192.1). Bounded, nothing runs afterwards; an explicit address is never rotated. - Network changes: the registered endpoint is the
warpwrapper, socore-patches/warp-entry-interface-update.patch(same code as Android 0024) forwards the network manager'sInterfaceUpdatedto the inner WireGuard endpoint; without it the tunnel kept its socket on the old network after a switch. - Log:
[warp-entry] вход через WARP: серверов через вход=N, правил помощников=Mat every start. - Requires the sing-box.exe built with the patch; the core bundle fingerprint covers
core-patches/so the next bundle rebuilds it.
Errors
xray_fluent/diagnostics/runtime-errors.json and Android's app/src/main/resources/runtime-errors.json are the same catalog. An error is evidence first: component, operation stage, original message, session generation and a target identity only when the producer can prove it. The catalog supplies classification, never replacement prose. Unknown messages remain visible.
The error journal is separate from bounded traffic/debug logs. It retains each distinct error during the application process lifetime and counts repeats. The UI and diagnostic export use this journal without the traffic-log limit. Passwords, private keys, tokens and credential-bearing URIs are redacted. Release verification must exercise real producer, observer, journal and UI/export boundaries; direct reducer tests alone do not verify this contract.
Loopback TCP resets/EOF are retained as LOCAL_CLIENT_CONNECTION_CLOSED with record_only policy. They cannot consume Hysteria recovery or turn successful HTTPS readiness into a server failure. A real process exit remains terminal; TLS/auth/pin failures retain their higher-priority security classification.
Source-built sing-box UDP fix
core-patches/sing-udp.json pins upstream sing module versions, zip/patch hashes and the packet regression test shared with Android. The private patched module receives complete UDP datagrams in both normal and low-memory builds, reserves transport header space in addition to payload, and uses packet-size buffers for connected UDP read waiters. TCP buffers are unchanged. UDP buffers grow to 64 KiB (plus required header space), so in-flight UDP memory use increases.
The Go cache is never patched in place. An unknown dependency version or changed cached source fails the build. Windows bundle cache keys include adapter source, patches, tests and build tools, not only upstream versions. Android AAR freshness includes CORE_UDP_PATCH_SHA256. Remove the patch only after the same full-chain packet tests pass against an upstream fix.
Coordinated stable preparation
Before validation and the final source commits, run from the Windows checkout:
python3 scripts/prepare_core_release.py --windows-version 0.5.8 --android-tag v0.3.27
Use the next actual unpublished versions. Each new pair checks official upstream tags (Amnezia prereleases allowed), updates the two pins and writes the identical core-release-freeze.json to both repositories. Repeating that pair validates the receipt offline, without selecting a newer tag. API/dependency incompatibility must be repaired and tested before committing or publishing; no old-core fallback.
Then run all platform gates, commit/push all ready source and use the existing Windows runner and Android stable publisher. The Windows runner reuses a matching freeze; the Android publisher requires its tagged source to match the freeze. Installed apps receive these built cores with the app update only.
Partial (delta) app updates
The release signer (sign_release in scripts/release_windows.py) puts every file of the release ZIP (path, size, SHA-256) into the signed update-manifest.json. xray_fluent/updates/delta_zip.py uses that list: the updater reads the ZIP central directory by HTTP Range, reuses installed files whose SHA-256 equals the signed one, downloads only the other entries and accepts each of them only if its size, CRC-32 and SHA-256 match the signed list. Any doubt (no Range, other file set, bad hash, more than 60% of the archive) falls back to the whole-ZIP download that is checked against the signed archive SHA-256 as before.
The patched sing-box.exe must stay byte-identical when its sources are unchanged, otherwise ~33 MB are downloaded in every update. build_singbox_front.py therefore passes the patched sing dependency to go mod edit -replace as a path relative to the source tree (Go writes that path into the executable) and refuses a binary that embeds its temporary build directory.
A replaced exe under a running app
PyInstaller reopens the exe by name for every lazy import (pyimod01_archive.ZlibArchiveReader.extract). When another file takes that name while the app runs, the next lazy import reads the new file at the old offsets and the app crashes: field check #3 (2026-11-23) found 15 such crashes on 0.8.102-0.8.107 (crash:error = zlib.error at extract:134, crash:OSError at extract:119), in start_metrics_worker and in the disconnect cleanup, often seconds from a failed update on the same install. main.py therefore calls xray_fluent/platform/frozen_archive.install right after the exception hooks: the archive reader keeps one descriptor to the original file, opened with FILE_SHARE_DELETE, so renaming or deleting the exe works as before and imports keep reading this build. The log line Module archive pinned to the running exe shows it acted; the first time the name points at another file the app logs [update] The program file was replaced while running and notes the app error update:exe_replaced, so the program that swaps files under a live app stays visible in the field. Proof: tests/test_frozen_archive.py (PyInstaller's own reader crashes unpinned and reads the original pinned; it runs where PyInstaller is installed, as on the build VM) and a frozen onedir probe built with PyInstaller 6.21 on win10 (unpinned: zlib.error after the exe was replaced; pinned: the lazy import worked).
Android audit observations
The existing Hysteria adapter emits server certificate SHA-256 mismatch but the old Android classifier required the substring pin. It therefore lost the security classification and could show the subsequent generic HTTPS failure as VPN-200. The shared catalog covers the adapter and official executable texts.
The protected domain UDP dialer returns a NAT wrapper that loses the numeric sender address (127.0.0.1:port becomes :port). A loopback boundary test reproduces this. A local official Hysteria plain handshake and TCP echo still pass through that wrapper, so this is not proof of the reported device failure. Android ADB is currently unavailable; no device reproduction has been claimed.