Commit Graph
810 Commits
Author SHA1 Message Date
Qiu Yuzhou dbb14dcb88 refactor(ui): 服务器分区活动目标标记收为平值入参
ServersView 不再观察 ProxyRuntimeController,与 SidebarRow/
ServerDetailView 的传参先例同法收 activeTargetID: NodeID?;外壳暂仍从
controller 取值,事实源切换随后一提交完成。
2026-10-03 11:44:28 +08:00
Qiu Yuzhou 14fdd493a3 fix(rules-smoke): adapt smoke fixtures to sourceless ProxyRule
fcd5645「slim built-in snapshots」移除了 ProxyRule 的 source 字段后 Smoke
target 未同步,构造器多传 source: 导致冒烟编译失败(先于收敛脊柱重构就
存在的破损)。移除冒烟夹具中的 source 实参与不再使用的 RuleSourceIdentity
局部值;来源身份属于浏览集合层,运行时文档与 ACL 只消费 action+match,
夹具语义不变。
2026-10-03 11:21:37 +08:00
Qiu Yuzhou 63845e487b style: swift-format leftover in convergence spine 2026-10-03 11:14:32 +08:00
Qiu Yuzhou cb39a13b76 docs: define Runtime convergence in the domain vocabulary
「运行时收敛」此前只以不变量描述(有效值未变的提交不做收敛工作)散见于
各条目,现在作为独立词条定义:GUI 侧把派生运行时定义落到部署的操作——
持久化 intent、重展开已提交目录、派生运行时文档、计划执行部署动作、验证
启动健康、失败整体回滚;派生字节未变且运行态健康时不做任何收敛工作。

顺带收录 pre-commit swift-format 对收敛脊柱文件的一处花括号重排。
2026-10-03 11:14:22 +08:00
Qiu Yuzhou 1fed58c903 refactor(rules): drop the dead rule-mode validation seam
ruleModeCandidateRules / ruleModeValidation 零生产调用者——生产校验经由
RulesWorkflow 预检与 RuleRuntimeCompiler.compile;控制器内这份薄复制删除。
相关测试断言改为直接调用领域层 RuleRuntimeCompiler.validation(与被删缝
同参同义),遮蔽关系与重排不变性断言原样保留。
2026-10-03 11:13:10 +08:00
Qiu Yuzhou d7169d9f01 refactor(runtime): route catalog sync through the convergence spine
- catalogDidCommit 的 deployed 分支体(派生 + 幂等跳过 + deployPrepared)
  与 deploy() 逐语义等价,改走 deploy();runtimeAlreadyConverged 独立机制
  删除,plan 空判定由 apply 层的 convergencePlanIsEmpty 统一承担。
- deploy/deployPrepared 返回 ConvergenceResult:被取代的派生按 .superseded
  呈现为 .revalidated,其余路径仍由状态面映射。
- reexpand 三-case 开关收敛为 convergeToReexpanded:convergeAgent /
  updateSettings / resyncOnLaunch 各变一行;catalogDidCommit 保留按 case
  的结构化 outcome 映射。
- 统一设置持久化 epilogue 为 persistSettings:setAgentEnabled /
  setSystemProxyEnabled / transitionMode 三处相同 save-fail 语义折叠
  (updateSettings 的 throw 变体与级联关闭的 return-nil 变体语义不同,
  保持原样)。
- SkeletonTests 运行时适配器豁免名单登记 +Convergence.swift。
2026-10-03 11:08:24 +08:00
Qiu Yuzhou 8587b2e80c refactor(runtime): unify apply/restore into the convergence spine
三份「执行 → 健康门 → 失败回滚」编排骨架(mode 切换 / rules 提交 /
deployPrepared)统一为收敛脊柱的 apply 层:

- apply:幂等跳过(派生契约与运行中运行时逐字节相同 → .unchanged,
  不闪 starting、不重走健康门)→ 计划执行 → 健康门(requiresReceipt /
  convergeProxyOnSuccess / preserveProxyOnFailure 逐路径参数照旧)→
  成功后按 proxyTail 收敛系统代理。
- restore:单一回滚例程 + RollbackPlan 两种载荷 policy(mode 的
  settings/mode 回退 + 意图变化强制重收敛;rules 的规则文档恢复)。
  restoreRuntimeDocument/relaunchPreviousInstance 删除——计划层对
  写契约/信号/注销重注的裁决与旧例程逐场景等价。
- 票据 inout 传参:execute 后的 flow 推进对调用方可见,rules 提交在
  apply 之后的时效检查使用推进过的票据。
- ModeTransitionSnapshotForRules 删除,rules 回滚计划在部署入口构建。

行为保持:.run 计划动作全部同步执行,starting 前置不可观测;mode/rules
路径到 apply 时计划必非空,幂等跳过只对 deploy 路径生效(与「有效值未
变的提交不做运行时收敛」不变量一致)。
2026-10-03 10:56:23 +08:00
Qiu Yuzhou dc35e70798 refactor(runtime): capture convergence tickets instead of hand-checked generations
execute 现在返回 RuntimeExecutionOutcome(成功与否 + 本次占用的并发流
代际),mode 与 rules 路径的 24 处手写代际 guard 收拢为 ConvergenceTicket
的 convergenceIsCurrent 检查;两处 flowGeneration + 1 手算随之消失。
行为逐字节保持:mode 路径的 mode 代际仍在派生前捕获、preparation 分量
在派生后推进;rules 路径四个代际事实全查不变。
2026-10-03 10:30:47 +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 44c56fe7f8 chore(workflow): replace deprecated String(cString:) with UTF-8 decoding
inet_ntop 写入 null 结尾缓冲区;按弃用提示先在终止符处截断,再经
String(bytes:encoding:) 解码,行为不变。
2026-10-03 03:40:31 +08:00
Qiu Yuzhou 619121a36c fix(route): decouple sidebar selection write-back from route publish
The same-value guard only stopped same-value selection re-syncs.
After an external navigation (add menu, rule editor dismissal,
manage-servers/show-runtime actions) the sidebar List still held
its stale cached selection and wrote it back into the custom
selection binding during a view update; the resulting publish
warned and would bounce the navigation back. Route the sidebar
selection through a SwiftUI-managed @State with onChange hops in
both directions (selection -> navigate, route -> backfill), anchor
the seed on WorkspaceRoute.initialDestination, and pin the
alignment with a regression test.
2026-10-03 03:38:07 +08:00
Qiu Yuzhou 9530af2a19 fix(helper): box XPC reply closure to cross @Sendable boundary
@objc 协议 SystemProxyHelperControlling 里 reply 参数无法标注 @Sendable,
直接被 queue.async 的 @Sendable 闭包捕获即产生并发警告。装箱为
@unchecked Sendable 后跨过边界:XPC 运行时生成的应答块线程安全且恰好
调用一次,引擎在串行工作队列上调用它本就是既有设计,行为不变。
2026-10-03 03:36:39 +08:00
Qiu Yuzhou 1ce96da710 ui: 状态栏图标改用系统 SF Symbol paperplane.fill
静态图标不随代理状态切换;StatusMenuLabel 不再观察
ProxyControlWorkflow(control 仅承载启动 resync),并删除
失去唯一引用的 MenuBarIcon.imageset。
2026-10-03 03:11:36 +08:00
Qiu Yuzhou a5d96dc990 refactor(rules): keep one conversion path 2026-10-03 02:55:48 +08:00
Qiu Yuzhou 842265a8e5 ui: enhance Custom Rule Editor layout with segmented pickers 2026-10-03 02:44:25 +08:00
Qiu Yuzhou fcd5645b68 refactor(rules): slim built-in snapshots 2026-10-03 02:34:04 +08:00
Qiu Yuzhou 5b7a522b7a fix(route): make same-destination navigation a no-op
The sidebar List selection binding can be written back during view
updates (macOS List/NavigationSplitView selection re-sync on row
content changes); publishing from the setter then triggered the
"Publishing changes from within view updates" runtime warning. Guard
navigate(to:) against same-value writes and pin the no-publish
invariant with a regression test.
2026-10-03 01:17:16 +08:00
Qiu Yuzhou 60cdfc0198 ui: app名称标题使用纸飞机图标 2026-10-03 01:13:53 +08:00
Qiu Yuzhou 589345f484 feat(rules): add batch custom rule deletion (#80) 2026-10-03 01:06:02 +08:00
Qiu Yuzhou 17672ff655 feat(rules): add custom rule editor (#79)
Add versioned sheet-local drafts, normalized previews, custom identity validation,
and explicit saves through the existing rule-document transaction. Preserve UUIDs,
builtin memberships, disabled identities, and deployment recovery outcomes.

Include approved Chinese and English editor copy. Verify public Workflow commands,
the production Controller adapter with hostless tests, and compiled bilingual
resources. Visual acceptance remains manual.
2026-10-03 00:47:06 +08:00
Qiu Yuzhou e345d772eb fix(runtime): make ACL deployment transactional 2026-10-03 00:09:42 +08:00
Qiu Yuzhou e5de11a5fe perf(rules): share snapshots and reuse commit results 2026-10-02 23:50:59 +08:00
Qiu Yuzhou 73f8358aa2 perf(rules): precompute collection sort keys 2026-10-02 23:04: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 63cb42da2a fix(rules): keep enablement feedback stable and accurate (#78)
Reserve one toolbar status area through saving, deployment, and collection
refresh. Show counted transient success and persistent actionable failures,
with distinct applied, unchanged-runtime, and deferred-save results.

Keep cached rows when collection reload fails. Require explicit refresh
and fresh selection after a version conflict.

Validation: 774 hostless tests passed with local ad-hoc signing. Format,
lint, two-axis review, and isolated Chinese/English view rendering checked.
2026-10-02 22:37:02 +08:00
Qiu Yuzhou 09686a80db feat(rules): persist cross-source enablement and recover deployments (#78) 2026-10-02 21:38:03 +08:00
Qiu Yuzhou beaa92781a feat(rules): add independent offline address tests
Implement #77 using the complete saved versioned rule collection. Normalize domain, IP, and URL hosts; preserve three outcomes and all deciding identities, source memberships, and other target-specific matches without DNS or runtime dependencies.

Invalidate results when the target changes or refresh starts, and reject late asynchronous publication. Add the native address test panel and approved Chinese/English copy.

Validation: 760 hostless tests and 2 fixed-sslocal semantics smoke tests passed; ad-hoc Debug build passed. Changed-file format/lint clean; existing repository warnings remain. Standards and Spec reviews found no issues. Visual acceptance remains manual.
2026-10-02 20:59:26 +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 b8958957f0 fix(rules): stabilize report expansion and window layout
Bound source metadata and conversion reports to a scrolling region so expansion does not compete with the native table for window constraints. Replace the nested split with a fixed source list and flexible table to keep the rules page inside the main window.

Defer native binding writes until after the current view update, merge filter edits into the latest query, and suppress unchanged query and selection publications.

Validated with 744 hostless tests, an unsigned Debug build, and isolated native window checks at 920x738 and 920x580, including real source selection and disclosure clicks.
2026-10-02 18:10:00 +08:00
Qiu Yuzhou 3db66f5fff feat(rules): add read-only rule browsing (#76) 2026-10-02 17:18:08 +08:00
Qiu Yuzhou 280a3fe6fe fix(rules): make validation and ACL order independent (#75)
Normalize source-independent match/action identities while preserving custom UUIDs. Analyze complete valid candidates for same-action coverage and full or partial opposite-action shadowing without dropping saved intent. Keep duplicate and fixed-local conflicts blocking, including mapped IPv6.

Canonicalize ACL entries without changing runtime source selection or proxy-default skeleton. Verify persistence and no-restart reordering through the Controller, collection permutations, and pinned sslocal loopback comparisons.

Validation: 728 hostless tests and 2 pinned-binary smoke tests passed with ad-hoc arm64 signing; format, lint (3 existing warnings, 0 errors), and diff checks passed. No real system-proxy writes or automatic visual checks.
2026-10-02 16:34:52 +08:00
Qiu Yuzhou e3ca886b9f docs: refine language for clarity in AGENTS.md 2026-10-02 10:55:45 +08:00
Qiu Yuzhou e9712a86c0 docs: clarify maintained documentation authority 2026-10-02 10:35:56 +08:00
Qiu Yuzhou 640ebf9f51 docs: record system proxy repair and suspension design (#73) 2026-10-02 10:28:22 +08:00
Qiu Yuzhou 4a0a72c6cf feat: observe and repair system proxy configuration (#73) 2026-10-01 23:29:56 +08:00
Qiu Yuzhou 7b24033a73 fix(app): restore manage-servers button on home server list card
The home server list card redesign in 1c706aa dropped the trailing
manage-servers button; restore it in the HomeCard trailing slot wired
to the existing onManageServers callback.
2026-10-01 20:19:57 +08:00
Qiu Yuzhou 4a296930fa ui(app): update labels for unmatched rule actions in Picker components 2026-10-01 19:18:59 +08:00
Qiu Yuzhou 1c706aa65f feat: redesign home server activation tree
Preserve catalog hierarchy and order, separate selection from activation, and mark active targets and ancestors. Persist independent home expansion preferences and support explicit locate and keyboard navigation.

Show server names only and surface activation eligibility, skipped members, and failures. Refine row status visibility and use semantic selection colors for outlined activation buttons, including hover, pressed, disabled, contrast, and inactive-window states.

Validation: 695 hostless macOS arm64 tests passed for the tree implementation; 7 focused tests and ad-hoc app compilation passed after the semantic button refinement. Format and lint checks passed. Native UI interactions and theme changes remain unverified.
2026-10-01 19:03:48 +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 d647a4a859 refactor(app): address code review for #72
- 回环候选清单上收到 ListenerMode.compatibleLoopbackAddresses(Domain
  单点),proxyLoopbackAddress 派生为首项;策略不再复刻 mode→回环映射
- refreshCommandAddresses 更名 refreshTerminalCommands(返回命令的语义)
- 监视创建失败注明为尽力而为增强(进入首页/复制前刷新兜底)
- HTTPExportCapability 注释与首页完整命令的地址选择划清边界
2026-10-01 10:16:00 +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 b26954dd20 feat(app): home terminal command address picker for #72
非「仅本机」监听方式下,首页命令卡在复制按钮上方提供单选 IP 下拉框:
候选仅含回环与当前启用 Wi‑Fi/Ethernet 接口单播地址(严格 SCNetworkInterface
类型白名单,排除 VPN/虚拟/未知类型),按监听地址族过滤(双栈含两个回环,
127.0.0.1 置顶;仅 IPv6 默认 ::1),标签 {IP} - {name}(本地化名称缺失回退
BSD 名)。两种 shell 的 HTTP/HTTPS/SOCKS 端点共用选中地址,端口取已保存
监听事实,IPv6 URL 方括号;选择会话内有效(跨首页返回保留、重启重置),
失效自动回退默认回环。进入首页、网络变化(SCDynamicStore 监视+去抖)与
复制前刷新。

- 新缝 LocalInterfaceFactsReading:原始接口事实(地址/类型/名称)+ 变化
  通知;生产适配器封装 getifaddrs/SCNetworkInterface/SCDynamicStore 细节
- 运行时缝以 listenFacts 替换 terminalProxyEnvironmentCommands;命令派生
  移至工作流层(监听事实 + 生效选择)
- 替身测试证明策略行为;真实主机非视觉验证证明系统适配器整合
  (回环识别/类型映射/地址规范化/链路本地判定)
2026-10-01 10:06:52 +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 020d7a62d9 ui(app): drop redundant mode badge from home mode card 2026-09-30 22:23:52 +08:00
Qiu Yuzhou 740bf567b8 ui(app): drop subtitles from home target tree items
Group and server rows in the home target tree carried redundant
subtitles (source labels and a per-group server count) duplicating
what the tree structure already shows. Remove them so each item is
a single-line title, bumped callout to body for a stronger title
presence. TargetGroupInfo loses the now-unused sourceLabel field.
2026-09-30 22:20:26 +08:00
Qiu Yuzhou d72ecaf21f chore(codegraph): init codegraph at root dir 2026-09-30 21:53:34 +08:00