Repository navigation
fix(mcp,media-ops,crablaw-cn): 安全基线 v2 恢复第一方本机 sidecar + 媒体 0.4.4 主体注入 + 法律存储完整性(三仓根因修复 D-0(c) / P-M1 / P-L1 / P-L2) - #25
Merged
Conversation
RC-17/18:existing_name_records 返回覆盖状态(complete/partial + corrupt/refused/typeErrors), 扫描范围纳入 matters/_archived;每个文件 open 前经 safe_path 逐级链接校验(含 Windows junction reparse tag),拒读进入覆盖不完整;非 object 的 client.json 是类型错误不是崩溃。 RC-19:事项目录在 .matter-store.lock 内 os.mkdir 独占创建,.pending 完成标记, 同 ID 并发只允许一次创建、后者退出码 3。 RC-20:锁文件写 pid/host,陈旧锁按 pid 存活判定回收(Windows 用 OpenProcess, 不用会杀进程的 os.kill),绝不按文件年龄;命中记录带双方角色与关系分类。 RC-22(写侧最小):staleIssueIds 为既有 ∪ 新影响,只有重分析清除;sources.jsonl 逐条摘要进 manifest,被引用来源变化传播失效;--apply 的读改写整段在 .writer.lock 内。 RC-21(P-L2-a):[已核验-来源] 只接受 verified / lawyer-reviewed 的官方/案例来源, unknown / superseded / unreviewed / source-needs-check 一律不算。 RC-23(P-L2-c):PRACTICE.md 新增运行环境与退出码表(python3 别名)。 测试:tests/crablaw-cn/matter-store-integrity.test.ts 16 条真脚本反例(R01/R02/R03/X1–X5/X7 + 谓词三态 + .pending),共享夹具 matterFixture.ts;篡改对照 11 条全红后还原全绿。 workflow-skill-presentation-completeness 的模型内容指纹随两份 SKILL.md 路由文案更新。 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SckZkZw7wdyWSAFWNQFvLJ
…注入 local-editorial 主体 —— 裁决 D-0(c)
RC-01 / D-0(c):mcpSafeBaseline 由单一 html-video 允许项扩为 MCP_ALLOWED_LOCAL_SERVERS
(html-video + media-ops 两个随包 dist、本机 stdio 的第一方服务),其余 41 个连接器
继续暂停;mcpContractValidator 按允许表校验,并新增「.mcp.json 引用的 ${user_config.X}
必须在 plugin.json.userConfig 声明为 required」规则(宿主缺值替换抛错且不写 default)。
RC-13(P-M1-id):媒体插件恢复 .mcp.json,固定 MEDIAOPS_IDENTITY_MODE=local-editorial 与
ISSUER=crabcode-local-editorial,主体 ID / 显示名来自宿主 user_config(principal_id /
principal_name 均 required),角色清单 = POLICIES 全部角色去掉只由第二真人门要求的四个
(tests/mcp-config-roles.test.ts 从 identity.ts 推导比对防漂移);requiredMcpServers 恢复
["mediaops"] 让宿主安装后自动激活;版本 0.4.3 → 0.4.4(manifest/package/marketplace/
dist/SBOM 同步,dist/server.js 重建)。
RC-05[2.1]:envelope.toToolResult 对 success=false(error / blocked)带 isError:true,
业务失败不再以成功形态返回;JSON 正文不变。
RC-24(P-M1-a):QA 证据自带等级 —— static 模式写 status:'static' / mode:'static',未跑的
Chromium/Nu 检查记 skipped 而非 passed;readiness 只接受 mode='full' 的证据放行审批
(DELIVERY_QA_LEVEL_INSUFFICIENT),旧记录缺 mode 视为 legacy-unknown;完整性检查
只断言证据存在,等级判定单点留在 Media Gate。
证据:docs/audit/evidence/2026-09-12-mcp-restore/restore-inventory.json(新 .mcp.json
sha256 65c5afbf…179f);08-22 containment-inventory 原样保留为历史,
mcp-safe-baseline.test 以 removed == paused ∪ restored 的会计恒等式承接可追溯性。
主控实测(Windows,bun 1.3.11):重建 dist 走 stdio 直连,注入 ID/显示名后
mediaops.content.save 成功且无 isError;去掉 ID 后 capabilities 与 content.save 均
AUTHENTICATION_REQUIRED 且 isError:true。full QA 链路本机无 Chromium,由 CI Playwright
容器验证。
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SckZkZw7wdyWSAFWNQFvLJ
This was referenced Sep 12, 2026
Contributor
Author
|
CI(分支派发)run 34684792554 结果:verify ✅ · media-ops-plugin(Linux Playwright 容器,含 |
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.
目的
按「三仓根因修复统一实施方案 v2.1」(真源在私有源码仓
acosmi/crabcode-source)交付插件仓侧的 P0/P1 工作包:媒体线 D-0(c) + P-M1-id + RC-05[2.1] + P-M1-a,法律线 P-L1-a/b + P-L2-a + P-L2-c。基线c1c5dd9(main)。裁决(主控)
latest至今停在基线前的2e0b1266,用户机上 43 份.mcp.json一直在野可执行;发布 (c) 同时收缩了外部连接器面并让媒体可用,而 (a) 会让媒体转 inactive、(b) 让安全收缩继续停留在纸面。改动
媒体线(commit 2)
src/policy/mcpSafeBaseline.ts/mcpContractValidator.ts:允许表MCP_ALLOWED_LOCAL_SERVERS,新增${user_config.X}必须required: true规则。plugins/crabcode-media-ops/.mcp.json(新):MEDIAOPS_IDENTITY_MODE=local-editorial、ISSUER=crabcode-local-editorial、ID/显示名来自宿主user_config,角色 = POLICIES 全部角色去掉四个第二真人门角色(tests/mcp-config-roles.test.ts推导比对)。plugin.json:0.4.4、requiredMcpServers:["mediaops"]、userConfig.principal_id/principal_name。src/envelope.ts:success=false⇒isError:true。src/domain.ts/tools/delivery.ts/tools/readiness.ts:QA 证据自带mode,static 不再写 passed;Media Gate 要求mode='full'。dist/server.js重建、SBOM 同步、README / 0.4-migration 更新、restore-inventory.json证据。法律线(commit 1)
_matter_common.py/bootstrap_matter.py/sync_run_manifest.py/validate_run.py+ 三份 schema + PRACTICE.md:扫描覆盖状态、归档纳入、逐级链接校验(含 Windows junction)、锁内独占创建 +.pending、陈旧锁按 pid 回收、stale 集合保留、来源变化传播、[已核验-来源]谓词收紧、退出码表。tests/crablaw-cn/matter-store-integrity.test.ts:16 条真脚本反例。证据(主控亲跑,Windows / bun 1.3.11 / Python 3.11)
bun test ./tests/workflow-skill-presentation-completeness.test.ts ./tests/validators/ ./tests/analysis.test.ts ./tests/references.test.ts ./tests/ci-trigger-policy.test.ts ./tests/crablaw-cn/→179 pass / 0 fail;bun run validateexit 0;lint:mcp-contractall checks passed;bun test ./tests/crabaccount/13 pass。bun run typecheck0;bun run check:distributionstatus: passed, toolCount: 38;bun run validate对齐 0.4.4;bun run test113 pass / 5 fail —— 5 条为 Windows 既存红(3 条 package 的EPERM fsync、1 条 storage 的EBUSY rm,改动前基线同样红;1 条 readiness 为争用 flake,单跑两次 6/6 绿)。Linux 与 full QA 由本 PR 派发的 CI 覆盖(见下)。.mcp.json逐字解析 env):注入 ID/显示名 →identity.mode=local_editorial, authenticated=true,mediaops.content.save成功、无isError;去掉 ID →capabilities与content.save均AUTHENTICATION_REQUIRED且isError:true。tests/crabcode-security/*在 Windows 上因/bin/sh/python3banner hook 既存红(CI 的 ubuntu/macos 矩阵覆盖)。未验证 / 待 CI
MEDIAOPS_QA_MODE=full(Chromium/Nu/axe)链路只经 typecheck 与 fixture,本机无浏览器;由 CImedia-ops-pluginjob 验证。os.kill探活)只在 CI 跑到。中间提交说明
commit 1 单独检出时
workflow-skill-presentation-completeness的metadata.version断言为 0.4.4 而市场仍 0.4.3(该文件同时承载法律 SKILL.md 指纹与媒体版本两处更新,随 commit 2 一起绿);本 PR 以合并提交合入,不影响 main。🤖 Generated with Claude Code
https://claude.ai/code/session_01SckZkZw7wdyWSAFWNQFvLJ