Commit Graph
85 Commits
Author SHA1 Message Date
Qiu Yuzhou 7cf04544ce feat(ng2): add Nushell and Windows proxy environment commands 2026-10-14 12:27:25 +08:00
Qiu Yuzhou 790e2a26fa feat(home): add target catalog and connectivity testing 2026-10-14 11:19:07 +08:00
Qiu Yuzhou 3a6d143b17 refactor(settings): separate LAN enablement from listener mode 2026-10-13 21:46:04 +08:00
Qiu Yuzhou 2f0c0d7676 feat: separate local and LAN proxy listeners 2026-10-13 03:58:03 +08:00
Qiu Yuzhou dc64349702 feat(plugins): bundle Cloak v2 client 2026-10-12 12:38:32 +08:00
Qiu Yuzhou f72c50dceb feat(plugins): configure plugin transport mode 2026-10-11 23:58:47 +08:00
Qiu Yuzhou 84c292eb7f feat(plugin): support aliases and local startup arguments 2026-10-11 21:04:59 +08:00
Qiu Yuzhou e50f671975 feat(servers): add ordered favorites 2026-10-09 23:20:11 +08:00
Qiu Yuzhou 7ad7edee3c refactor(servers): use HSplitView for three columns 2026-10-09 19:23:44 +08:00
Qiu Yuzhou 801348c5b6 refactor(servers): use three-column table navigation 2026-10-09 19:07:44 +08:00
Qiu Yuzhou f23a24f203 feat(servers): add node creation and modification timestamps
CatalogEntry gains createdAt/updatedAt and the catalog document moves to
v5 (reads v1-v5, writes v5). Modification time is structure-sensitive:
editing a node's own fields bumps the node, a group's direct child set
or order changes bump the group, and a moved node keeps its timestamps.
No-op writes and unchanged subscription refreshes bump nothing; the
refresh rebuild compares per node, so surviving leaves keep theirs. All
times are passed in by callers as now: Date - one moment per logical
commit, the domain layer stays clock-free. Legacy documents load with
nil (unknown, never backfilled); duplicates and imports stamp fresh
times at the moment of the operation.

Semantics are recorded as glossary term 节点时间戳 and ADR 0031. No UI
in this change.
2026-10-09 18:04:48 +08:00
Qiu Yuzhou d06c04246d feat: move diagnostics to a standalone window 2026-10-06 15:20:39 +08:00
Qiu Yuzhou bdcbc6cd60 feat(servers): separate details from edit forms 2026-10-06 12:25:13 +08:00
Qiu Yuzhou be30f64f9f docs(design): 移除 to-spec 产物,去掉 user-plugin 文档的 -spec 后缀
两类文档来源不同,处理方式也不同:

- system-proxy-runtime-control-spec.md、terminal-command-address-spec.md 是
  to-spec 技能的原样产物(英文模板小节标题,无标题与日期头)。其内容已发布为
  Issue #72 / #73,人类需要的信息已由同日提交的无后缀中文文档承载;在仓库里再
  存一份,等于同一份规格有两个事实来源。删除后仍可从 git 历史追回。
- user-plugin-*-spec.md 四份来自 improve-codebase-architecture 会话:该技能把
  报告写进 OS 临时目录、不写 docs/design/,因此这四份是模型模仿仓库既有
  -spec.md 旧例命名(“猜测旧例”而非技能指令)。去掉后缀后仓库不再有该样板,
  后续模型少了可模仿的命名来源。四份保留原名主体,内容不动。

影响面:这六份文件全仓库零入站引用(含 docs/ 内部),移除与改名都无需改写链接。
docs/design/ 现为 12 份,无一带 -spec 后缀,与 AGENTS.md 的定位一致。

有意不做:不加“docs/design/*.md 必须带可解析 日期:/状态: 头”的确定性检查。
AI 输出本就无法保证规范化;更关键的是这类文档的“状态”只描述某次改进上下文,
不跟踪现状,把它当可校验字段是假精确。日期是写作时点的事实,两回事。
2026-10-05 22:39:58 +08:00
Qiu Yuzhou a335e00a38 chore(agents): 同步 docs/agents 配置到当前 skills 并去掉仓库硬编码
对照 ~/.agents/skills/setup-matt-pocock-skills 的当前模板逐字节核对三份配置:

- triage-labels.md 与模板完全一致,无漂移,未改动。
- domain.md 同步标点(— 改为 :)与措辞(Single-context repo (this repo)
  改为 (most repos)),现与模板一致。
- issue-tracker.md 同步标点漂移,并把硬编码的
  --repo qiuyuzhou/ShadowsocksX-NG 换成从 clone 推导
  (gh repo view --json nameWithOwner)后显式 pin。保留「绝不写入其他仓库」的
  安全规则与那次误发事故的教训,但去掉仓库名,使该配置在合并进上游后仍然成立。
  AGENTS.md 的一行摘要同步去掉仓库名。

.scratch/ 加入 .gitignore 与 .zcodeignore:这是 setup-matt-pocock-skills 为
local-markdown tracker 约定的目录,切到本地 tracker 时 spec 文件不落进 git。

docs/design/ 与 docs/research/ 的去留尚未决定,本次不引入任何排除机制。
2026-10-05 22:25:42 +08:00
Qiu Yuzhou 7ab774fcfd chore(legacy): 移除 Legacy/ 旧版源码,归档到 legacy-v1 分支
旧版实现已由 shadowsocks/ShadowsocksX-NG 的 legacy-v1 分支跟踪,本仓库不再
保留同一份代码副本。删除 Legacy/ 下 603 个跟踪文件,被 gitignore 的
.DS_Store 一并清理。

删除前核对:Legacy/ShadowsocksX-NG/PACUtils.swift 的 blob hash 与
upstream/legacy-v1 的同名文件完全相同,且工作区在 Legacy/ 下无未提交改动。

配套改动:

- 根 README、AGENTS.md、ShadowsocksX-NG2/README.md:目录结构只留
  ShadowsocksX-NG2/;旧版说明改为指向 shadowsocks/ShadowsocksX-NG 的
  legacy-v1 分支(含其 README);pre-commit 说明去掉 Legacy/。
- codegraph.json 删除 "exclude": ["Legacy/"];.gitignore 与 .zcodeignore
  删除 Legacy 构建产物与依赖条目;.swiftlint.yml 删除 ../Legacy 排除项;
  .githooks/pre-commit 头部注释去掉冻结目录表述。
- docs/research 的 4 份历史研究报告(issue 7/11/12/17)中 129 处
  ../../Legacy/... 相对链接改写为 legacy-v1 的 GitHub blob 链接,正文未改;
  把新 URL 反替换回原相对路径后与 HEAD 版本逐字节相同,证明只动了链接。

验证:全仓库不再有指向 Legacy/ 的路径引用;剩余 Legacy 字样均为概念性用法
(Legacy 导入功能、ADR 与术语表、历史报告正文中的冻结陈述)。本次未改任何
NG2 源码或构建配置,暂存区无 NG2 .swift 文件,pre-commit 直接放行。
2026-10-05 21:39:06 +08:00
Qiu Yuzhou a31e2fa4bf docs(adr): 记录源码目录即分层与主题及守卫约定
App/ 按分层、Domain/ 按主题组织,两个根层只放子目录、不放平铺文件;边界由
Tests/SkeletonTests.swift 的守卫正面圈定断言,而不是禁令加豁免登记。

ADR-0029 只记录组织原则本身:分层与主题划分的依据(Domain 主题名取自
GLOSSARY.md 的章节划分)、四条被否决的备选(平铺加豁免登记、feature-first、
Domain 照搬分层、守卫锁定目录集合),以及两条在代码里不可见的 XcodeGen
约束和跨进程契约按文件引用的代价。

ADR 不维护目录与文件清单——清单由 ShadowsocksX-NG2/README.md 的工程结构
一节维护,避免记录随事实漂移。

project.yml 的两处分层注释与 README 的工程结构一节各加一处引用:前者按该
文件既有写法引用编号,后者用完整链接。
2026-10-05 20:27:11 +08:00
Qiu Yuzhou 0f2855f453 fix(ui): 关闭服务器表单密码框的系统密码自动填充
系统对 NSSecureTextField 默认提供钥匙串/密码 App 的自动填充入口,且不
取决于字段语义:实测底层字段 contentType 已是 nil,既有
.textContentType(nil) 不足以关掉它,AppKit 也没有公开开关。

改用字段级私有开关 _setPasswordAutofillEnabled:(responds(to:) 守卫,
方法消失时静默回退、不崩溃)。PasswordAutofillOptOut 以同帧背景探针
认领承载密码控件的文本框,只关密码列自己;明文/密文切换换成新实例后
重新认领。

新增 PasswordAutofillOptOutTests 固定认领范围与切换行为;全量单测
1022 通过,人工验证通过。取舍与后果记入 ADR-0028。
2026-10-05 19:23:55 +08:00
Qiu Yuzhou a6ebb69bbf feat(servers): add group sharing popover 2026-10-05 16:57:48 +08:00
Qiu Yuzhou bd68e45ea4 feat(servers): present sharing in a popover 2026-10-05 16:41:18 +08:00
Qiu Yuzhou fd6fa65a8d feat(share): rework server share as QR sheet
- Replace toolbar QR popover with a window sheet per sketch: top hint,
  280pt white-backed QR, copy-image / save-image / copy-ss:// actions
  and a Done button; all buttons share a 260pt min label width
- Freeze share payload and suggested file name at presentation time;
  transient "copied" feedback on copy actions
- Add ImageClipboard seam (PNG normative type + TIFF in AppKit adapter)
  and QrImageSaver seam (NSSavePanel PNG, sanitized suggested name)
- Register new typed failures in the presentation whitelist; extend
  platform-effects architecture guard and seam tests
- Record spec in docs/design/server-share-sheet.md; GLOSSARY server
  share now covers saved QR image files
2026-10-05 13:54:59 +08:00
Qiu Yuzhou 86779b63ee feat(plugins): add settings management UI 2026-10-05 12:03:52 +08:00
Qiu Yuzhou 3d8d56b8e1 test(plugins): cover mapping commit and runtime convergence 2026-10-05 11:13:42 +08:00
Qiu Yuzhou e74f8dfc01 refactor(plugins): derive server form facts from effective catalog 2026-10-05 00:46:43 +08:00
Qiu Yuzhou 128efcc0d6 feat(plugins): add user plugin catalog and runtime wiring 2026-10-05 00:28:16 +08:00
Qiu Yuzhou 4623dc78aa Merge commit 'a9a7aed' into develop 2026-10-04 22:26:20 +08:00
Qiu Yuzhou a9a7aedc0b fix(servers): restore direct creation buttons 2026-10-04 22:03:18 +08:00
Qiu Yuzhou 5968b1fd0b feat(import): 统一服务器导入入口并支持 SIP-008 文件导入
新增统一导入面板(拖放多文件/剪贴板 ss:// 一键/旧版直接导入),来源按内容
嗅探分派(位图→二维码、JSON→SIP-008、其余→文本行),逐来源独立事务与
结果。深模块集中在 CatalogWorkflow.importServers 单一接缝,凭据统一经
journal,退役 ss:// 文本框、二维码预览、Legacy 专属 sheet 与首启主动弹窗。
SIP-008 导入语义见 ADR-0027(文档 ID 只作装配键,目录身份全新生成)。
2026-10-04 21:45:20 +08:00
Qiu Yuzhou 535d62a28a fix(servers): support root creation and clearing selection
Add explicit current-group and root creation menus. Clear the management
tree selection on blank clicks or Escape while focused. Capture creation
parents, retain failed group drafts, and select/reveal created nodes.

Validation: 870 hostless tests (921 executions), 21 Python checks, unsigned
app build, format/lint/diff checks. Standards and spec reviews passed.
Native interaction and visual verification were not performed per request.
2026-10-04 21:36:51 +08:00
Qiu Yuzhou 7bb327ba1d docs(domain): CONTEXT.md 改名 GLOSSARY.md 并对齐引用
domain-modeling skill 升级后单上下文约定文件名为 GLOSSARY.md:
git mv 保历史、内容零改动;AGENTS.md、docs/agents/domain.md 及
NG2 源码注释中的活引用随之对齐。docs/design、docs/research、ADR
中的旧名引用属历史记录,不改写。
2026-10-04 15:06:41 +08:00
Qiu Yuzhou 2f670a4c6b refactor(rules): decouple saved intent from runtime application 2026-10-03 17:40:05 +08:00
Qiu Yuzhou 3aae39799a fix(rules): convert root URL paths to exact domains 2026-10-03 09:56:00 +08:00
Qiu Yuzhou 6e69d92449 feat(rules): convert pathless URL prefixes to exact domains 2026-10-03 09:52:42 +08:00
Qiu Yuzhou a5d96dc990 refactor(rules): keep one conversion path 2026-10-03 02:55:48 +08:00
Qiu Yuzhou fcd5645b68 refactor(rules): slim built-in snapshots 2026-10-03 02:34:04 +08:00
Qiu Yuzhou 59ba9dfeff feat(rules): enhance rule identity documentation and introduce offline testing explanation 2026-10-02 22:38:11 +08:00
Qiu Yuzhou cb5a535297 feat(rules): simplify details and open conversion reports in a window 2026-10-02 20:38:23 +08:00
Qiu Yuzhou 640ebf9f51 docs: record system proxy repair and suspension design (#73) 2026-10-02 10:28:22 +08:00
Qiu Yuzhou a7465154d2 ui(app): show selected address details as caption lines for #72
收起状态按钮只显示当前选中 IP;接口名称(接口:…)与地址类型
(地址类型:…)以说明行展示在按钮下方,与菜单项的 title/subtitle
结构对应。模型移除不再被呈现层使用的 label 组合字段。
2026-10-01 16:06:53 +08:00
Qiu Yuzhou 24666df4ac ui(app): command address menu items with native title/subtitle for #72
Picker(.menu) 的选项桥接会把多 Text 压平成独立菜单项(注记成了单独
item)。改为 Menu + adaptive-controls 桥接(Apple technote 文档化的
title/subtitle 机制):

- 菜单项主行 = IP,副标题 = 「注记 - 接口名称」(无注记时仅接口名称)
- 收起状态显示当前选中项的 {IP} - {name}(borderedButton 样式)
- 选择器下方的类型说明行保留,选中地址类型收起时也可见
2026-10-01 15:54:46 +08:00
Qiu Yuzhou 149cf39ea4 ui(app): render command address annotation as menu subtitle for #72
按 ifconfig 同源的 IPv6 类型注记改为次要文本行呈现:

- 菜单项用两个 Text 桥接 NSMenuItem 原生 subtitle(macOS 14+ 官方机制,
  Apple adaptive controls technote),主行 {IP} - {name} 不再内联注记
- 选择器下方新增说明行「地址类型:{注记}」——无论菜单桥接行为如何,
  当前选中地址的类型始终可见
- TerminalCommandAddress.label 收回纯主行,注记保持独立呈现事实;
  地址身份与命令内容不受影响
2026-10-01 15:43:31 +08:00
Qiu Yuzhou 111fa93131 feat(app): annotate and filter IPv6 command addresses by kernel flags for #72
经 SIOCGIFAFLAG_IN6 逐地址查询内核 IPv6 标志(与 ifconfig 的注记同源,
Darwin 模块不导出该 ioctl 请求宏,手工展开 _IOWR 编码):

- IN6_IFF_TEMPORARY(RFC 4941 隐私临时地址,会轮换)不进候选
- 其余 IPv6 候选在标签 IP 后附类型注记(位于中段):
  autoconf secured / autoconf / dynamic;标志查询失败不注记也不过滤
- 注记只进标签不进命令;地址身份仍为 BSD 接口名 + 规范化 IP

真实主机非视觉验证扩展:每 IPv6 地址标志查询非空、候选注记属 ifconfig
同源闭集、临时地址被过滤;替身用例覆盖 temporary 过滤与标签格式。
2026-10-01 15:19:26 +08:00
Qiu Yuzhou 5c1781c2b8 docs: revise terminal command loopback convention for #72
按 issue #72 设计同步修订:ADR-0015 命令地址段落改为「默认兼容回环 +
非本机方式会话内可选 Wi‑Fi/Ethernet 地址」,表格列名改默认命令地址;
CONTEXT.md 命令定义与监听约束同步;设计文档标记已实现。健康检查与系统
代理目标仍由监听方式确定。
2026-10-01 10:07:05 +08:00
Qiu Yuzhou 82411d92ea docs(design): publish terminal command address design for #72
grill-with-docs 会话产物:交互设计与测试边界定稿,spec 已发布为
issue #72;CONTEXT.md 增加 Terminal command address 词条。
2026-10-01 09:33:08 +08:00
Qiu Yuzhou ab5a153477 docs(adr): record hostless unit tests and the appBundle resource seam in ADR-0021 2026-09-30 20:45:04 +08:00
Qiu Yuzhou ba20e42f11 docs(adr): record BundleProgram key and throttled re-register in ADR-0020 2026-09-30 19:15:33 +08:00
Qiu Yuzhou d2a8d6105c feat(system-proxy): route writes through privileged LaunchDaemon helper
Implements issue #71 with ADR-0020 (supersedes ADR-0019's endpoint-signature
cleanup, startup cleanup, and health-gate cleanup).

- New ShadowsocksX-NG2SystemProxyHelper target: app-bundled root LaunchDaemon
  (SMAppService.daemon, on-demand via MachServices) that mechanically applies
  a closed typed configuration or executes an unconditional clear. Clients are
  accepted by code-signing bundle identifier only; requests run serially on a
  shared queue (last-writer-wins).
- SystemProxyConfiguration is now the closed typed apply payload (Codable over
  JSON XPC): explicit SOCKS/HTTP/HTTPS enable + endpoints, PAC and
  auto-discovery disabled with URL/JS removed, explicit simple-hostname
  exclusion, complete ExceptionsList. Unmodeled Proxies keys are preserved and
  equivalent values skip the commit.
- Cleanup is a side effect of a persisted system-proxy intent on-to-off
  transition only: the switch itself, or the agent-off cascade (persist both
  intents off, clear, then stop listeners; failed cascade persistence records
  no transition and clears nothing). Launch with the switch off, health-gate
  closure, invalid targets, and passive events never clear. Failed clears are
  surfaced without deferred retry.
- Endpoint-signature store, ownership migration, and direct Authorization
  Services writes are removed; old signature files stay inert. Helper
  unavailability or pending approval keeps an enabled intent pending and
  surfaces the Login Items approval path (HomeView button + menu label).
2026-09-30 12:26:40 +08:00
Qiu Yuzhou 08682724c9 fix(system-proxy): reconcile configuration across network changes 2026-09-29 23:39:25 +08:00
Qiu Yuzhou 9284b1c9a1 feat: export configuration groups as SIP-008 JSON 2026-09-29 20:16:05 +08:00
Qiu Yuzhou c50470dc89 refactor(settings): move silent-launch persistence to UserDefaults
Migrate SilentLaunchStore from its versioned JSON file to the app's
standard defaults domain (key `silentLaunch`), the platform's canonical
home for GUI-scalar preferences, so the GUI preference category stops
growing one file per item. Reads stay safe-side strict: a missing key
or a value not bridgeable to Bool loads as not silent (plain
bool(forKey:) would coerce "yes" to true). The file-form
persistence-failure naming path is dropped — UserDefaults.set reports
no failure — so SilentLaunchController keeps its persist-then-flip seam
while errorMessage and its SettingsView presentation go away.

The legacy file never shipped in any release; migrateLegacyFileIfPresent
runs in the production composition root only, preserves the value on
developer machines, and deletes the file (no-op when absent). The test
composition uses a dedicated suite cleared at assembly; unit tests use
per-test suites with removePersistentDomain teardown, never the
standard domain.

ADR-0017 carries a dated amendment (Status plus the affected
consequence line); the settings.json separation rationale stands
unchanged.
2026-09-29 16:06:52 +08:00