feat(plugin-protocol): define member upload contract - #47
Conversation
Signed-off-by: fmfsaisai <fmfsaisai@gmail.com>
Signed-off-by: fmfsaisai <fmfsaisai@gmail.com>
bb59341 to
749b82d
Compare
…rule - 抽出包内共享解析原语 internal/parse.ts(object/string/isoDate/sha256/ httpsUrl/nextCursor),delivery 与 memberUpload 不再各持一份副本 - 不透明分页游标统一为 1–4096 字符单一规则,消除同包两套游标约束 - isoDate 消除双重日期解析;memberUpload 枚举校验收敛为 enumValue - 删除被通用 failure 规则覆盖的 succeeded 冗余分支 - 注明成员上传限额仅约束成员通道,接线前 plugin-server 既有限额不变 Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: fmfsaisai <fmfsaisai@gmail.com>
|
| Filename | Overview |
|---|---|
| packages/plugin-protocol/src/memberUpload.ts | 新增成员上传协议的类型、限制、状态机约束及请求和响应运行时解析器。 |
| packages/plugin-protocol/src/internal/parse.ts | 抽取日期、哈希、HTTPS URL、不透明游标及基础值的共享解析逻辑。 |
| packages/plugin-protocol/src/delivery.ts | 改用共享解析原语,并将市场分页游标从 Plugin ID 放宽为有界不透明字符串。 |
| packages/plugin-protocol/src/tests/memberUpload.test.ts | 覆盖上传限制、请求字段约束、PUT ticket、状态组合、资源 ID、时间戳和游标解析。 |
| docs/plugin-protocol.md | 记录成员上传端点、DTO、幂等边界、状态语义、失败码、包限制及 rollout 要求。 |
Sequence Diagram
sequenceDiagram
participant P as 发布者插件
participant S as plugin-server
participant O as 对象存储
P->>S: POST /api/publisher/uploads
S-->>P: uploadId, putUrl, headers
P->>O: PUT .cindy archive
P->>S: POST /uploads/:uploadId/commit
S-->>P: 异步任务状态
loop 查询处理结果
P->>S: GET /uploads/:uploadId
S-->>P: status / release / failure
end
Reviews (4): Last reviewed commit: "fix(plugin-protocol): validate member up..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3331c354b0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Document the public member-upload contract, preserve nested parser paths, and validate upload ghost IDs with the manifest rule. Signed-off-by: fmfsaisai <fmfsaisai@gmail.com> Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: fmfsaisai <fmfsaisai@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c81235526d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: fmfsaisai <fmfsaisai@gmail.com> Co-Authored-By: Claude <noreply@anthropic.com>
Summary
Validation
pnpm typecheckpnpm testpnpm lintpnpm format:checkgit diff --checkDeployment