Repository navigation
Tags
Tags
chore: single-source shared blocks, golden snapshot, rules canary, ve… …rsioned assets Shared blocks (Script/shared, Script/tools/sync-shared.js) - 13 blocks (~940 lines, mostly the 735-line region table) that were already byte-identical in Script.js and mihomoScript.js now live once in Script/shared and are inlined between @shared:begin/@shared:end markers, so the scripts stay single-file. The check fails if a block is hand-edited in one script, if one script misses a marker, or if a marker has no source. - The refactor was proven behaviour-neutral: outputs are byte-identical before and after (Test/golden-output.test.js, 24 scenarios), and the golden test was mutation-checked to catch a one-character change inside a shared block. Versioned asset refs (Script/tools/bump-asset-tag.js) - Icons/ and Rules/ are referenced as dukangalex/HiClash@assets-v1/... instead of @main, so merging to main no longer changes what every user downloads at once. jsDelivr caches tags permanently: never move a tag, release with a new one. - 130 refs rewritten across scripts, configs and shared sources; the switch was verified to change only the URL tag (all 24 golden scenarios identical after mapping the tag back). A drift test caught that the tool initially missed the shared sources; it now covers them. Rules canary (Test/rules-canary.test.js) - Decodes the official meta-rules-dat cn / geolocation-!cn / geoip-cn sets with the real core and checks size vs. a committed baseline (+/-25%), landmark domains/IPs (baidu.com in cn, google.com not; 114.114.114.114 in cn, 8.8.8.8 not), and cn / !cn overlap. Exit 1 = ALARM, exit 2 = network/env problem. README documents the maintainer workflows. CI wiring for these tests and a scheduled canary workflow are provided separately (ci-workflow.patch) because the push token cannot modify .github/workflows.