fix(#60): T2 list 快照红测+G1 清理+x-request-id+OIDC 失败态+r2 文本格式(fixer-c) - #63
Merged
Conversation
审核 T2:requires/capabilities 是 YAML list,旧逐行正则只读标量, 快照硬编码 ['identity']/['demo'] → 模块自定义 capabilities 时 token caps 授牌错误。 先写红测(非默认值 list manifest 全字段断言,修复前 3 条红), 再以最小解析(标量正则 + list 项归属最近空值顶层 key)修正,并让 description 进快照。 Ref #60 Signed-off-by: HandyWote <huangyinghui01@corp.netease.com>
审核 T4:wrangler v4 `r2 bucket list` 输出 formatLabelledValues 文本 (name: 对齐 + creation_date,无 --json),旧 fake 只喂 JSON → 真实解析分支零测试, 真机格式一变就重复 create(already exists)。 抽 parseR2BucketList 并直测文本/空/旧 JSON/去重/ANSI/CRLF,steps fake 同步改文本。 Ref #60 Signed-off-by: HandyWote <huangyinghui01@corp.netease.com>
审核 §2.2 G1: - ui.test.ts 删「导出存在性 + 版本号」恒真,改 vue/server-renderer 真渲染 (UButton 变体/disabled、UErrorCard requestId/详情折叠、UInput、UCard); - sdk.test.ts 无 window 用例不再只断言 not.toThrow,改为观测不得触达 parent, 装 window 后投递仍生效(证明守卫是运行时条件而非 no-op 桩); - hello.test.ts 身份行自证循环改为验签行为断言:正签 token 200、同签名篡改 payload → 401(claims 只能来自签发方签过的 token)。 Ref #60 Signed-off-by: HandyWote <huangyinghui01@corp.netease.com>
审核 D8/T6:壳侧三处消费响应头 x-request-id(ErrorCard 展示 request id), core-api 全源码零产出 → requestId 恒 undefined,死功能。 新增全局中间件每请求生成 req-<16hex> 并回写所有响应(含 401/403/503)。 审核 §2.3 OIDC 失败态:callback 换 token/验签抛错此前未捕获 → 500。 改为清流程 Cookie + 302 /login?error=<短码>(state 不匹配/过期/IdP error 各有码), Cookie 缺失/损坏仍 400;成功链路不变。 新增路由级用例:request-id.test.ts(auth/registry/setup/token 四类路由 + id 唯一/格式)、 oidc-callback-failures.test.ts(5 条失败态)。CORE_DB 复用共享 test-factory 真 sqlite。 Ref #60 Signed-off-by: HandyWote <huangyinghui01@corp.netease.com>
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.
概述
issue #60 的 P1 次项 + P2 一批(fixer-c 工作包),基于
origin/m0/dev@06ce90e(已含 fixer-a #59、fixer-b #62)线性叠加:buildManifestSnapshot读不了 YAML list,requires/capabilities硬编码 → 快照/token caps 授牌错误x-request-id全局中间件 + 四类路由响应头断言/login?error=<短码>+ 5 条路由级用例r2 bucket listfake 改 wrangler v4 真实文本格式 +parseR2BucketList直测提交(均为
-s,线性、无 merge commit):edef77392c230e23d4cabffc6eef验收对照(issue #60 标准)
app.request路由级;deploy 解析器留纯函数单测test-factory.createCoreDb()(真 sqlite + 真迁移),无手搓假 D1x-request-id(req-+16hex),4 类路由断言 + 唯一性/格式formatLabelledValues文本一致;解析分支有直测// SPDX-License-Identifier: AGPL-3.0-only验证(本机全绿)
发现与脱节(记录,部分超出本任务允许改动范围)
deploy/cloudflare/{src/registry.ts,src/provision.ts,test/*},而改动范围又写「勿碰 deploy/**」。按明确条目执行;本 PR 的 deploy 改动只落在registry.ts、provision.ts、test/{registry-manifest,provision-registry,steps}.test.ts,与 fixer-a 的assemble/smoke/steps(src)/README无文件重叠,rebase 后全绿。requires: [identity]/capabilities: [messaging](flow 式),真实manifest.yaml是 block 式;本次按任务书只实现最小 block 解析。若模块写 flow 式,capabilities会被当标量丢弃 → 静默变[](schema 无 min 不拦截)。建议后续补 flow 式或规范统一为 block 式。LoginView.vue注释过期:apps/shell/src/LoginView.vue仍写「core-api callback 失败时不会回本页(服务端直接报错)」;本 PR 后失败正是 302 回/login?error=。前端行为已对齐(只把 error 有无映射为人话卡片),注释属 shell 侧跟进。oidc.ts消息字符串耦合:oidc.ts不在本任务允许改动清单,分类只能按错误消息前缀匹配;若文案重构会安全降级为oidc_failed(fail-closed)。建议后续在oidc.ts引入带 code 的结构化错误。setup-api.test.ts仍把headers.get桩成恒 null(审核 T6 同项):本 PR 只补了 core-api 产出面;壳侧「响应头→ErrorCard requestId」的契约测试仍缺,建议后续在 shell 侧补(本任务改动范围不含apps/shell)。requires取值越界即整体失败:清单写requires: [superuser]时ModuleManifestSchema.parse抛错、部署中止(符合「当前必为 identity」契约的 fail-fast,未来扩枚举需同步)。manifest.entry恒被重写(§5.3 同域路径制设计使然):第三方模块声明独立域名 entry 会被静默忽略,属已知设计取舍,供产品侧知悉。不在本 PR 范围
deploy/**中 fixer-a 的三方一致性/装配改动(deploy: 回归 §5.3 路径制(B 方案)——zone 路径路由 + API Token + 三方一致性红测(含 hello 页 ESM 修复) #59,已在m0/dev)m0/dev)packages/module-sdk/test/storage.test.ts(fixer-b test(#60): 共享 test-factory(sqlite 真迁移替身)替换 core-api/module-sdk/hello 全部假 D1 #62,已在m0/dev)