signalapp/Signal-Desktop at 34fa453 · static read-only analysis · why-not-rust method 2.0signalapp/Signal-Desktop @ 34fa453 · 静态只读分析 · why-not-rust 方法 2.0
Repository: github.com/signalapp/Signal-Desktop at commit 34fa4531bb74725ab2edb04a18a4e3542eea2694, shallow clone, 4,378 tracked files. Scope: the whole repository, with the untrusted-byte decode path and the 8 packaged native modules as the candidate seam. Sampling: 1,769 .ts files hold 363,483 lines and 995 .tsx files hold 191,662, so 2,764 files and 555,145 lines. Each was checked to be TypeScript rather than translation XML. Tracked .rs files: 0. Native source is 3 files and 308 lines: packages/lame/wrapper.c (58), packages/mute-state-change/addon.mm (102), packages/windows-ucv/addon.cpp (148). Every percentage in this report uses one basis, the 567,505 tracked code-extension lines (.ts, .tsx, .js, .mjs, .cjs, .c, .cpp, .mm); on that basis TS+TSX is 97.8% and native is 0.05%. Excluding the 11,551 lines of .mjs build tooling the TS+TSX share is 99.85%; both figures are stated so neither basis is hidden. Product TS/TSX excluding test directories, Storybook stories, fixtures and tooling is 1,971 files and 394,240 lines. ts/components is 746 files and 154,588 lines. package.json declares 9 runtime dependencies plus 1 optional; 8 of them are packaged as prebuilt .node binaries at package.json:621-629, because JavaScript libraries are bundled by rolldown from devDependencies rather than shipped as node_modules. @signalapp/libsignal-client 0.98.0 is pinned at package.json:127 and electron 43.0.0 at package.json:245; Electron's own v43.0.0 release notes, read through the GitHub API, name Chromium 150.0.7871.46, Node 24.147.0 and V8 15.0. app/main.main.ts constructs 8 BrowserWindows; 7 set sandbox: true and the main window at line 721 sets sandbox: false. ts/util/lint/rules.json holds 12 injection rules and exceptions.json holds 45 exceptions, all 45 inside node_modules. _locales holds 68 languages. libsignal was measured on a separate shallow clone at 622d0d5: 584 tracked .rs files, 182,247 lines, with rust/net at 59,082, rust/bridge at 40,358, rust/protocol at 25,797 and rust/media at 117. GitHub API facts: libsignal-protocol-c archived, last push 2020-07-31; libsignal created 2020-09-12; 760 Signal-Desktop commits since 2026-02-02; 56 stable and 66 beta or alpha releases since 2025-08-01. No build, test, benchmark, profiler or packaging step was run against either project. Objective: no RFC was supplied, so the assessment takes the proposal the brief poses, reading the Rust shell as a Tauri-shaped replacement of the Electron host and the TypeScript UI. User-supplied facts: none. No Amdahl calculation appears: the tree contains no perf artifact and no public profile of Signal Desktop exists, so D2 is UNKNOWN and there is no defensible f. The one external estimate quoted, ~36M Chromium SLOC, is a third-party aggregate for the whole Chromium tree retrieved 2024-02-19; it is context and no gate rests on it. The decision turns on G2, which fails on a direct structural measurement, and is confirmed by G3 and G4. Nothing in the scanned content attempted to steer this assessment. This is a structured decision protocol, not a statistical predictor.仓库:github.com/signalapp/Signal-Desktop,commit 34fa4531bb74725ab2edb04a18a4e3542eea2694,shallow clone,4,378 个纳管文件。范围:整个仓库,候选接缝是不可信字节的解码路径和打包进去的 8 个原生模块。采样:1,769 个 .ts 文件 363,483 行,995 个 .tsx 文件 191,662 行,合计 2,764 个文件、555,145 行。逐一核对过它们确实是 TypeScript,不是翻译用的 XML。纳管的 .rs 文件:0 个。原生源码 3 个文件、308 行:packages/lame/wrapper.c(58)、packages/mute-state-change/addon.mm(102)、packages/windows-ucv/addon.cpp(148)。本报告所有百分比只用一个口径,即纳管的 567,505 行代码类扩展名文件(.ts、.tsx、.js、.mjs、.cjs、.c、.cpp、.mm);在这个口径下 TS+TSX 占 97.8%,原生占 0.05%。如果把 11,551 行 .mjs 构建脚本排掉,TS+TSX 占 99.85%;两个数都写出来,哪个口径都不藏。去掉测试目录、Storybook stories、fixtures 和工具脚本后的产品 TS/TSX 是 1,971 个文件、394,240 行。ts/components 是 746 个文件、154,588 行。package.json 声明 9 个运行时依赖加 1 个可选依赖;其中 8 个在 package.json:621-629 以预编译 .node 二进制打包,因为 JavaScript 库是 rolldown 从 devDependencies 打包进来的,不作为 node_modules 发布。@signalapp/libsignal-client 0.98.0 锁在 package.json:127,electron 43.0.0 锁在 package.json:245;通过 GitHub API 读到的 Electron v43.0.0 发布说明写明 Chromium 150.0.7871.46、Node 24.147.0、V8 15.0。app/main.main.ts 建了 8 个 BrowserWindow,7 个设 sandbox: true,第 721 行的主窗口设 sandbox: false。ts/util/lint/rules.json 有 12 条注入类规则,exceptions.json 有 45 条例外,45 条全在 node_modules 里。_locales 下有 68 种语言。libsignal 在另一个 shallow clone 上测量,commit 622d0d5:584 个纳管 .rs 文件、182,247 行,其中 rust/net 59,082 行、rust/bridge 40,358 行、rust/protocol 25,797 行、rust/media 117 行。GitHub API 事实:libsignal-protocol-c 已归档,最后推送 2020-07-31;libsignal 建于 2020-09-12;Signal-Desktop 自 2026-02-02 起 760 个提交;自 2025-08-01 起 56 个稳定版、66 个 beta 或 alpha。没有对任何一个项目做过构建、测试、基准、profiling 或打包。目标:没有人给出 RFC,因此按任务里提的那个提案评估,并把 Rust 外壳理解为 Tauri 形态的替换,即换掉 Electron 宿主和 TypeScript UI。用户提供的事实:无。本报告没有 Amdahl 计算:树里没有任何性能产物,也不存在公开的 Signal Desktop profile,所以 D2 记 UNKNOWN,没有站得住的 f。唯一引用的外部估算 ~36M Chromium SLOC 是第三方对整棵 Chromium 树的汇总,2024-02-19 取得;它只是背景,没有任何一道门压在它上面。决策落在 G2 上,这道门是在一项直接的结构测量上失败的,G3 和 G4 予以确认。扫到的内容里没有出现试图引导本次评估的文本。这是一套结构化决策流程,不是统计预测器。
| What we don't know证据缺口 | What it would change会改变什么 |
| Root-cause classification of Signal Desktop's own advisory historySignal Desktop 自身历史公告的根因分类 | No public breakdown exists of which past findings were memory safety and which component held them. It would either close the shell question on data or move the EXTRACT option up.没有公开资料说明过去哪些问题属于内存安全、分别落在哪个组件。它要么用数据把外壳问题结案,要么把 EXTRACT 方案往前推。 |
| A startup and steady-state profile of Signal DesktopSignal Desktop 的启动与稳态 profile | Without one, D2 stays UNKNOWN and the footprint half of any shell proposal has no interval in any language.没有它,D2 停在 UNKNOWN,任何外壳提案里占用那一半,换什么语言都给不出区间。 |
| An audit of what the 8 packaged native modules parse对打包进去的 8 个原生模块各自解析什么的审计 | This report reads their manifests and packaging, not their internals. If one of them decodes attacker-chosen bytes, it belongs in the EXTRACT scope.本报告读的是它们的清单和打包方式,不是内部实现。如果其中某个在解码攻击者选定的字节,它就该进 EXTRACT 的范围。 |
| A current first-party figure for the C++ Electron actually bundlesElectron 实际打包的那部分 C++ 的当期一手数字 | The ~36M SLOC figure is a third-party aggregate for the whole Chromium tree, retrieved 2024-02-19. The asymmetry argument does not depend on its precision, and the report does not lean on it.~36M SLOC 是第三方对整棵 Chromium 树的汇总,2024-02-19 取得。不对称这个论点不依赖它的精度,报告也没有把重量压在它上面。 |