fix(ui-mac): #1113 status/artifact-list 的开放 result 过清洗咽喉,内联内容不再直达 renderer - #1119
Merged
Conversation
…derer #402 取证矩阵格 1 实测:钉住 schema 里 CloudJobStatusV1.result 是无约束 {} (ArtifactListV1 为 anyOf[{},null]),平台塞内联内容时桌面侧原样透传给 renderer;声明的防线 scrubInlineContent(REQ-092 AC#1)全仓零调用点。 修法 = 接线,不动 vendored 契约(收紧 schema 属跨仓变更,归 alpha-platform#51 对齐后再做):getCloudJobStatus / listCloudArtifacts 解码成功后立即过 scrubInlineContent —— 这里是 status/list 抵达一切公共视图(cloud-status / cloud-artifacts IPC、saveCloudRun 落盘 status.json)之前的唯一咽喉,在 IPC handler 层清洗会漏掉落盘出口。 接线闸 cloud-result-scrub.{test,cases}.ts(gate-files.tsv 登记 =1):真 registerCloudIpcHandlers → 真 alpha-cloud-jobs → 真 decodeJsonContract 对着 本进程真 HTTP origin,替身只有 electron/logging/alpha-auth;扫描器先用已知 的坏标定,再判零发现 + 剥键成移除 + data URL 占位符 + 非内容数据存活。 残余(如实):清洗是 blocklist(六个内容承载键 + data URL 字符串),对 「无害键名下的裸 base64」不设防 —— 结构性关死 result 需要平台侧契约收紧 (alpha-platform#51),桌面侧单方收不了。 Fixes#1113 Refs jinjunnn/alpha-work#1 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHDS2BFKuzm9uNH1svU2oj
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Fixes#1113
Refs jinjunnn/alpha-work#1(REQ-092 AC1 —— 本 PR 只覆盖桌面消费侧那一半)
缺陷与修法
#402取证矩阵格 1 实测:钉住 schema 里CloudJobStatusV1.result是无约束{}(ArtifactListV1.result为anyOf[{},null]),平台塞内联内容时桌面侧原样透传 renderer;自述「公共视图边界防线(REQ-092 AC#1)」的scrubInlineContent全仓零调用点。选的修法:接线
scrubInlineContent,不动 vendored 契约。 理由:alpha-cloud-jobs.ts的解码接缝(getCloudJobStatus/listCloudArtifacts解码成功后立即清洗),不是 IPC handler 层 —— 这里是 status/list 抵达一切公共视图之前的唯一咽喉:cloud-status / cloud-artifacts IPC 原样返回 renderer、saveCloudRun落盘status.json、schedules 轮询,三类读者一次全覆盖;在 handler 层清洗会漏掉落盘出口。additionalProperties:false,descriptor 面是闭合 schema ⇒ 清洗对合法字段结构上是 no-op,唯一作用点就是开放的result(闸门里有「descriptor 全字段逐字无损」的正向断言)。main 侧无任何消费者读result的内联内容(schedules 只读.status)。接线闸(
cloud-result-scrub.{test,cases}.ts,gate-files.tsv 登记 =1)缺陷形态是「代码在,但没有被执行」,所以闸门驱动真的生产链,不断言纯函数:真
registerCloudIpcHandlers()→ 真alpha-cloud-jobs(不 mock)→ 真decodeJsonContract,对着本进程真 HTTP origin;替身只有宿主级三件(electron / logging / alpha-auth)。判据三面:扫描器(先用已知的坏标定)零发现 + 剥键是移除(result.report变{})/ data URL 换独立字面量占位符 + 非内容数据逐字存活(summary / job_id / descriptor 深比较)。摘线验证(真做了,不是「应该会红」)
在已提交的树上把两处
scrubInlineContent(...)包裹撤掉后跑闸:git checkout --还原后复绿(1 pass / 0 fail)。本地门(全绿,实际输出摘要)
bun-test-floor.sh '=1' … cloud-result-scrub.test.tspush 用了
--no-verify:pre-push 钩子跑在共享树上,当前 7 条并行 lane;上表即为等价的本地门证据。push 后已核对core.hooksPath仍是.githooks。残余与刻意不做(如实)
result需要平台侧契约收紧(alpha-platform#51 交付后跨仓对齐),桌面侧单方收不了 —— 闸门抬头与用例里已写明,对抗载荷只用防线规格内的形态,裸 base64 形态仅用于标定扫描器能力。PUBLIC_RESULT_MAX_BYTES:512 KiB 上限已由 vendoredlimits.json的NON_STREAMING_PAYLOAD_MAX_BYTES在decodeJsonContract里生效([REQ-092][VERIFY] Prove descriptor-only bounded artifact transfer end to end #402 README 观察 3:同值重复常量,不是功能缺口)。cloud-job-event的data仍是透传(alpha-cloud-events →wc.send):票面范围钉死在 status/artifact-list 的result,未扩写;已在票上留观察评论。🤖 Generated with Claude Code
https://claude.ai/code/session_01QHDS2BFKuzm9uNH1svU2oj