feat: Stash 覆写产物(Stash.stoverride / MyStash.stoverride)+ 全局文案统一 - #283
Open
HotKids wants to merge 28 commits into
Open
feat: Stash 覆写产物(Stash.stoverride / MyStash.stoverride)+ 全局文案统一#283HotKids wants to merge 28 commits into
HotKids wants to merge 28 commits into
Conversation
Adapts Clash/Sample.yaml for the Stash client, based on the official Stash docs (config sample, DNS page, QUIC page, MRS support note). Two things the override actually fixes: - DNS: mihomo expresses "resolve through the proxy rules" as a per-nameserver "#RULES" URL suffix, which Stash does not have — its "#" fragment only carries options like "#h3=true". Stash's equivalent is the global dns.follow-rule switch, so the override sets it and replaces the nameserver array (via the #!replace marker) to drop the invalid suffix. The config already sets proxy-server-nameserver, which satisfies one of the three preconditions the docs require before enabling follow-rule. - nameserver-policy: General.yaml joins the NTP domains into a single comma-separated key (mihomo-only). Stash keys are exact / wildcard / geosite: only, so that key would be read as one literal domain and never match; the override re-adds them as separate keys. - QUIC: replaces the mihomo logic rule (AND/NOT/OR over NETWORK+DST-PORT+ GEOSITE/GEOIP) with Stash's documented script shortcut + SCRIPT rule. Documented in the file rather than silently fixed, because an override cannot express them: override rules are PREPENDED, so the QUIC SCRIPT rule cannot sit after the CN rules and therefore also rejects domestic UDP:443 (falls back to TCP); rule-providers carry a mihomo-only "format:" key whose handling by Stash needs a load test (the 8 .mrs sets are all domain/ipcidr, which Stash supports); proxy-groups "filter" is undocumented for Stash, which would leave the five region groups populated with every node rather than empty; and Mihomo.yaml should not be fed to Stash at all (YAML anchors, merge keys, a non-schema anchors: key, include-all-providers). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
The Stash override is now derived by sync-config.py instead of hand-written, so it tracks the source config automatically. It emits ONLY the deltas between Stash and mihomo — everything else is inherited from Clash/Sample.yaml: - dns.follow-rule: mihomo spells "resolve through the proxy rules" as a per-nameserver "#RULES" URL suffix; Stash has no such fragment (its "#" only carries options like h3=true) and uses a global follow-rule switch instead. The nameserver array is re-emitted under the #!replace marker so the invalid suffix is dropped rather than merged in. - nameserver-policy: General.yaml joins the NTP domains into one comma-separated key (mihomo-only). Stash keys are exact / wildcard / geosite: only, so that key would never match; it is split into separate keys. - QUIC: the AND/NOT/OR logic rule becomes Stash's script.shortcuts + SCRIPT rule. Policy name and ports are extracted from the source rule, not hardcoded. Override arrays are PREPENDED by Stash, which drives two design points: proxy-server-nameserver is emitted only when the base config lacks it (copying it verbatim would duplicate the entries), and the QUIC rule necessarily matches before the CN rules — so domestic UDP:443 is rejected too and falls back to TCP. That limitation is documented in the generated file rather than papered over. Declared as a "# Stash" platform block in sync-config.txt, added to the workflow's git add list (it would otherwise never be committed), and documented in both READMEs. Verified locally: generation is idempotent, output parses as YAML, and the #!replace marker survives. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
Reworks the generator so the override carries the full policy set instead of only the Stash-vs-mihomo deltas. Same role as Clash/Script/Script.js — apply the repo's groups, rule-sets and rules to ANY subscription — since Stash has no Enhance Script equivalent and uses .stoverride for this. Node membership no longer depends on this repo's own proxy-providers. Translation, all derived from the generated Clash config: - proxy-groups: use: [Server] becomes include-all: true so nodes come from the user's subscription; the region filters are kept verbatim to keep sorting by node name. REJECT-DROP is mapped to REJECT (Stash has no silent-drop builtin). - rule-providers: behavior + format are kept, which Stash requires explicitly. MRS is supported for domain/ipcidr, and all 8 .mrs sets here are exactly that. type/path are mihomo local-cache concerns and are dropped. - rules: emitted under "rules: #!replace" with the source comments and order intact. AND/OR/NOT logic rules become script.shortcuts plus SCRIPT rules, with network, port and policy read off the source rule (udp:443 -> quic, tcp:22 -> ssh). The two GEOSITE rules are dropped: Stash does not document that type and they duplicate the adjacent RULE-SET,China / RULE-SET,Global (geosite/cn.mrs and geolocation-!cn.mrs). - dns: unchanged from before — follow-rule for the #RULES suffix and the split nameserver-policy keys. The QUIC rule keeps a known semantic gap: mihomo excludes CN with NOT(GEOSITE,cn OR GEOIP,CN) and a Stash shortcut expression cannot express a geo test, so domestic UDP:443 is rejected too and falls back to TCP. Moving the rule below the CN rules would be worse — most foreign QUIC would be routed by an earlier service rule and never reach it, defeating the point of keeping QUIC off the proxy. The tradeoff is spelled out in the generated file. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
Read the official Stash docs (rule types, rule-set, proxy-groups, override) and four of the five assumptions the previous commit was built on turned out to be wrong — all in the direction of Stash supporting more than assumed: - AND / OR / NOT logic rules are documented, including nesting. The QUIC rule no longer becomes a script shortcut, so the semantic gap that commit described (domestic UDP:443 also rejected) is gone entirely — the CN carve-out NOT(GEOSITE,cn OR GEOIP,CN) is kept verbatim. - GEOSITE is a documented rule type (v2fly domain-list-community), so the two rules dropped as "redundant" are restored. - REJECT-DROP is a documented builtin alongside REJECT (silent drop vs immediate error), so mapping it to REJECT was a lossy rewrite; it is kept. - no-resolve is documented on GEOIP / IP-CIDR / IP-ASN and inside AND sub-rules. The rules block is now byte-identical to the source config — verified by comparing the parsed arrays, 36 == 36. The script/shortcuts section and the conversion helpers are gone. Also confirmed and reflected: rule-provider path is optional (Stash confines it to its own resource dir) so it stays omitted; include-all and filter are the documented way to build groups from a subscription; and the override merge semantics match what the generator relies on. The only remaining runtime caveat is that GEOSITE data is fetched from github.com on first use. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
Rewrites the generator so the override is what Mihomo.yaml is — a second-order rendering of Clash/Sample.yaml — instead of a file built around another repo's structure. Sample.yaml is transcribed line by line, comments and layout included, and only the points where Stash genuinely differs from mihomo are changed, so the result is a complete config that can be imported into Stash directly rather than a patch that only works on top of our own config. The differences it rewrites: - Drops mihomo-only top-level keys and blocks, together with their leading comments: the listener/control keys, ipv6, the geo-data source keys, unified-delay, tcp-concurrent, find-process-mode, global-ua, keep-alive-interval, profile, ntp, sniffer, tun and the empty proxies placeholder. Stash owns these itself or has no equivalent. - dns: keeps only the five sub-keys Stash documents, adds follow-rule (mihomo spells this as a #RULES suffix on each nameserver, Stash as a global switch) and re-emits nameserver under #!replace so the suffix is dropped rather than merged in. The comma-joined NTP policy key is split into one key per domain, since Stash keys are exact / wildcard / geosite: only. - providers: drops the mihomo-only "type" and renames proxy-providers "header" to "headers", which is the spelling Stash documents. Everything else — hosts, mode, log-level, all 23 groups, all 30 rule-providers and all 36 rules — is carried through untouched; verified by comparing the parsed structures against Sample.yaml. Generation is idempotent and the file header keeps the repo's # Date stamping convention. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
The generator was inserting name/desc/author YAML keys into the output. Those keys do not exist in Clash/Sample.yaml and are not a Stash-vs-mihomo difference, so adding them went beyond transcribing the source — and author: duplicated the existing "# Author: @HotKids" header comment. The override keeps only the source header plus the one generated-by notice; .stoverride name/desc are display-only and optional, so Stash falls back to the filename. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
Puts the override next to the other generated client artifacts. All four references follow: the sync-config.txt platform block output path, the sync-config workflow's git add list (Clash/Script/ already covers the new path, so the separate entry is dropped), and both READMEs. The stale platform-block comment describing the old diff-only model is rewritten to match what the generator now does. Safe to live there: the Script-directory prune in sync-config.py only globs *.js and only unlinks files carrying the generation marker, so a .stoverride is never touched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
…verride Dropping a mihomo-only key also drops its comment block, but the blank line before it and the blank line after it then landed next to each other, producing gaps the source does not have — most visibly right under "# 通用设置", where Sample.yaml has a single blank line and the override had two. The flush now discards leading blanks from the pending buffer when the output already ends on one, so blank runs that exist in Sample.yaml are preserved and only the ones created by a removal collapse. Output now has the same blank-line profile as the source. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
…ript.js Reuses Enhanced/myscript.overlay.json for the Stash side: an overlay that declares stash_output alongside output now also produces a Stash override with the same personal differences layered on. Only myscript.overlay.json declares it. The overlay's difference declarations are format-agnostic, but _apply_overlay works on parsed structures for Script.js while the Stash side is a text-level transcription that has to keep Sample.yaml's comments and layout, so the directives are re-implemented over text in _stash_apply_overlay. Anything not implemented there raises rather than being skipped, so a personal difference is never silently dropped. Two directives needed a decision because they have no static equivalent: - disabled_by_default is a Script.js runtime toggle; the group is pruned instead — its rules, the references to it in other groups' candidate lists, and any rule-provider left unreferenced afterwards all go with it. - extra_pool_groups are filled at runtime from config.proxies in Script.js; a static file needs an explicit node source, so they are emitted as use: [Server] + filter, matching how the base region groups are written. Result for myscript.overlay.json: 29 groups (23 - Telegram + 7 relay/region), 29 rule-providers (Telegram's pruned) and 42 rules (36 - 1 + 7 inserted), with the same blank-line profile as the source. Generation is idempotent. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
The overlay pass wrote its own YAML style: single-quoted group names and candidate entries, and its own field order, so inserted lines did not match the transcribed ones around them — visible as quoted '🇬🇧 England' sitting between unquoted neighbours in a proxies list. Now follows the source exactly: names double-quoted, candidate entries unquoted, filters single-quoted, fields ordered name → type → icon → hidden → use/proxies → benchmark params → filter (group_overrides inserts a new field at its correct slot rather than after type), and a blank line between groups. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
Per the override docs, same-named arrays are inserted BEFORE the base config's array rather than replacing it. Without a marker this override produced "our config plus the base config": our 36 rules ran first and left the base's rules unreachable behind our MATCH, and all of the base's own proxy-groups stayed in the list alongside ours. The two arrays that decide routing and policy now carry #!replace so they are authoritative. The dict-typed keys keep the documented recursive merge, which is what we want: rule-providers, proxy-providers, dns and hosts merge with the base, so an airport's own private DNS and rule-sets survive. Also fixes the span lookups the marker broke — proxy-groups:/rule-providers: are now matched by prefix instead of exact line, which the overlay pass needs to locate group and provider blocks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
The base config these overrides are applied to contains only proxies — no dns, proxy-groups or rules to merge with — so every marker was a no-op. Removing them also restores the transcription rule: apart from the Stash-vs-mihomo difference points, the output stays line-for-line identical to Sample.yaml, and #!replace was neither a difference point nor something the base config needed. The #RULES suffix is still stripped from the nameserver entries; that happens during generation, so the suffix never reaches the file and needed no marker to begin with. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
The override docs name these as the conventional fields for a .stoverride's title and description, both display-only. Each file gets its own so the two do not collide in Stash's override list: name comes from the output filename (Stash / MyStash) and desc says where the content comes from, with the overlay variant naming the overlay it layers on. Kept to those two fields on one line each — the earlier attempt also emitted an author key that duplicated the "# Author: @HotKids" header comment. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
Follows the shape of a published .stoverride: an emoji-prefixed name, a multi-line desc that says what the rule sources and the routing strategy are rather than describing the generator, and an author line. The overlay variant gets its own name and calls out the overlay it layers on plus the extra fallback/relay groups, so the two are distinguishable in Stash's override list. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
Restores the one-line name/desc and adds author, which was the field left out. The previous commit rewrote name/desc into a multi-line block modelled on another published override; that was not what was asked for. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
The header comments and the YAML metadata stated the same three things twice: "# Stash for Android" against name, "# Author: @HotKids" against author, and the generated-by notice against desc. The YAML fields win because Stash displays them, so the two duplicated comment lines are gone and the platform label moved into name ("Stash for Android" / "MyStash for Android"). What stays as comments is what the fields do not carry: "# Date:", which the stamping helper matches on, and the do-not-edit-here notice, which is aimed at someone reading the repo rather than at Stash's override list. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
Moves the timestamp into the metadata block under author, alongside name/desc, matching how a published .stoverride writes it. The shared _write_stamped_if_changed only recognises a "# Date:" comment, so the Stash outputs get their own writer with the same ignore-the-timestamp comparison against a YAML date field — without it every run would rewrite both files just because the clock moved. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
…header desc now carries the generated-by notice instead of repeating it as a comment line, and the header is down to a single "# Date:". The timestamp goes back to that comment, so the shared _write_stamped_if_changed handles it again and the Stash-specific writer added for a YAML date field is gone. The overlay variant's desc names the overlay it layers on, which is the only part that differs between the two files. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
…output "请勿手改" is not a real word, and "改内容请改 X" repeats 改 twice; the notice now reads 请勿手动修改;如需调整请修改 Surge/Profile.conf, matching how the root README already phrases it. Applied to the .stoverride desc, the generated Enhance Script headers and the four .js files already checked in, so no copy is left saying it the old way. Same pass over the comments added for the Stash transcription: 略去→省略, 剥掉→去除, 丢掉→舍弃/丢失, 剪掉→移除, 删掉→移除, 孤儿注释→无主注释, 永不命中→无法命中, 由 App 自身掌管→由客户端自身管理. Also drops a stale line in the scripts README claiming the nameserver array is replaced via #!replace — those markers were removed earlier; the suffix is stripped during transcription instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
…oups hosts, dns, proxy-providers, proxy-groups, rule-providers and rules now carry the marker so each block replaces the base config's rather than merging or prepending. Scalars (mode, log-level) need no marker — the docs already define same-named simple types as a direct overwrite. MyStash keeps proxy-groups unmarked, so its groups follow the default insert -before behaviour. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
The provider block was the only one arriving without per-field comments, since the source config has none there. The Stash outputs are read by whoever imports them, so the transform now adds a line for each field: cache path, subscription URL and refresh interval, why the fetch is pinned to DIRECT (the groups do not exist yet, so going through the proxy would be circular), what the User-Agent header is for, and each health-check parameter. Comments are keyed by (indent, key) because url and interval appear both on the provider and inside health-check. The dropped mihomo-only "type" gets none, and the comment for "header" avoids naming the key so it still reads correctly after the rename to "headers". Added in the transform rather than in clash.ini, so Sample.yaml and the other platform outputs are untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
The subscription provider is this repo's own and does not apply to someone else's config, so the block ships commented out — content preserved and already converted to Stash's spelling, so uncommenting is all it takes to enable. The #!replace marker is dropped while commented since the block is inactive. Also reverts the per-field comments added to that block a moment ago; they were a misreading of the request. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
…groups With proxy-providers commented out, the seven groups carrying use: [Server] referenced a provider that no longer exists. Stash treats a group containing no proxies as DIRECT, so those groups — the five region groups plus Speedtest and Server — would have silently gone direct, and since 🔰 Proxy is built from them the whole proxy path would have collapsed without any error. They now declare include-all: true, which is how Stash pulls in every proxy from the config, and the region filters keep working unchanged. The pool groups the overlay adds are emitted the same way. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
Both overrides now replace every block they declare, so applying either to a nodes-only config leaves exactly the base's proxies and takes everything else — hosts, dns, proxy-groups, rule-providers, rules — from the override. proxies is never emitted, so the base's node list is untouched, and proxy-providers ships commented out and stays out of the merge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
Points at Quantumult/X/Images/Want.png in this repo, served over jsDelivr; verified the file is present at that path. The override docs list icon among the display fields, so it sits with name/desc/author. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
…notes Wording pass over the hand-maintained sources; generated artefacts follow from their generators, and Mihomo.yaml's header is synced by hand since the full Clash sync cannot run offline. - coined/ungrammatical: 吃掉→去除, 打戳→写入时间戳 - colloquial verbs: 删掉→移除 (×3), 丢掉→丢弃, 剪掉→移除, 拿到→取得/一并纳入, 漏掉→遗漏, 顺手→并 - filler: 「也没关系,反正…仍然对」→「不影响判断:…仍然成立」, 方便→便于 - unified the overwrite warning as 直接修改…将在下次同步时被覆盖 (7 places across the root, scripts, sing-box READMEs and the generator) Domain terms stay as they are — 兜底, 看门狗, 机场 read naturally here and match the rest of the repo's voice. Also corrects three statements in the scripts README that the last few Stash changes left stale: the provider block is commented out rather than field-fixed, groups use include-all rather than use: [Server], and the #!replace markers were not documented at all. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012LPYq4FJhPgzP1eZnexyyT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
承接已合并的 #282,新增 Stash 平台产物并做了一次全局中文文案统一。所有改动均在源头(
sync-config.py/sync-config.txt/ overlay / README),产物由脚本生成。一、新增
Clash/Script/Stash.stoverride与
Clash/Mihomo.yaml同一定位——Clash/Sample.yaml的二次转换产物:整份配置逐行转录(含注释与排版),只改写 Stash 与 mihomo 真正有差异的点,可直接作为覆写文件导入 Stash。转译依据为 Stash 官方文档(配置示例、DNS、规则类型、规则集合、策略组、覆写、协议类型七页),差异点四类:
ipv6、geo 数据源、unified-delay/tcp-concurrent/find-process-mode/global-ua/keep-alive-interval,以及profile/ntp/sniffer/tun和空占位proxiesdefault-nameserver/nameserver/nameserver-policy/proxy-server-nameserver/fake-ip-filter),其余 14 个 mihomo 专属键省略#RULES后缀 → 全局dns.follow-rule(Stash 的#片段只承载h3=true这类选项);nameserver-policy里逗号拼接的多域名单键拆分为独立键(官方仅支持精确域名 / 通配域名 /geosite:<name>)proxy-providers整块注释停用(是本仓库自己的订阅);策略组use: [Server]→include-all: true,直接从基础配置的proxies按filter取节点规则部分与源配置逐条一致(36 == 36,解析后数组比对):Stash 的规则类型是 Clash Premium 超集,
RULE-SET/GEOIP/GEOSITE/MATCH/no-resolve、AND/OR/NOT逻辑规则(含嵌套)及内置策略REJECT/REJECT-DROP官方均明确支持,无需改写。hosts/dns/proxy-groups/rule-providers/rules均带#!replace,proxies不输出——套用到「只有节点」的配置上,效果是保留原有节点、其余全部以本文件为准。二、新增
Clash/Script/MyStash.stoverride复用
Enhanced/myscript.overlay.json:overlay 中除output外再声明stash_output即可产出对应的 Stash 定制版。overlay 的差异声明与输出格式无关,但_apply_overlay面向解析后的结构、供 Script.js 使用,而 Stash 侧为文本级转译(需保留注释与排版),因此指令在_stash_apply_overlay中按文本重新实现,遇到尚未实现的指令直接报错,避免私人差异被静默丢弃。两处无静态等价物、需要转换的:
disabled_by_default是 Script.js 的运行时开关,YAML 覆写没有「默认关但可开」这种状态 → 按声明整组移除(移除该组、以其为落点的规则、其余组候选中的引用,并清理因此不再被引用的规则集)extra_pool_groups在 Script.js 里靠运行时过滤config.proxies填充 → 静态 YAML 显式输出include-all: true+filter结果:29 个策略组(23 − Telegram + 7)、29 个规则集、42 条规则。
三、全局中文文案统一
对手工维护的源文件做了一次用词整理,共 21 处:生造词(
吃掉→去除、打戳→写入时间戳)、口语动词(删掉/剪掉→移除、丢掉→丢弃、拿到→取得、漏掉→遗漏、顺手→并)、语气词冗余,以及统一覆盖提示为「直接修改…将在下次同步时被覆盖」。领域术语(兜底/看门狗/机场)保持原样。同时修正了
.github/scripts/README.md中三处因近期改动而过时的描述。验证
py_compile通过;全部.jsnode --check通过;两份.stoverrideYAML 有效Sample.yaml解析后逐项比对一致尚未验证
我没有 Stash 客户端,这两份文件从未实际加载过,以下两项文档未写死、需实测确认:
format: mrs—— 文档确认支持 MRS(限behavior为domain/ipcidr,本仓库 8 个 mrs 规则集正好全在此范围内),但格式表只列了yaml/text,未说明 MRS 应填的format取值,目前沿用 mihomo 写法hidden与 url-test 的tolerance—— 策略组文档未列出,若不支持仅影响显示与切换策略,不影响分流另:
GEOSITE的 domain-list-community 数据不随 Stash 分发,首次使用时按需从 github.com 拉取。🤖 Generated with Claude Code
Generated by Claude Code