Skip to content
This repository was archived by the owner on Aug 11, 2026. It is now read-only.

feat(plugin-protocol): define member upload contract - #47

Merged
fmfsaisai merged 6 commits into
mainfrom
feat/member-upload-contract
Aug 9, 2026
Merged

feat(plugin-protocol): define member upload contract#47
fmfsaisai merged 6 commits into
mainfrom
feat/member-upload-contract

Conversation

@fmfsaisai

Copy link
Copy Markdown
Collaborator

Summary

  • accept opaque non-empty plugin market cursors and preserve them unchanged
  • define the organization member upload DTOs, task/review states and stable asynchronous failure codes
  • export the Forge-aligned 128 MiB archive, 256 MiB uncompressed and 2048-entry limits
  • add runtime parsers for prepare, commit, status and my-publishes responses

Validation

  • pnpm typecheck
  • pnpm test
  • pnpm lint
  • pnpm format:check
  • git diff --check

Deployment

  • shared protocol only; consumers must bump the submodule before using the new contract

Signed-off-by: fmfsaisai <fmfsaisai@gmail.com>
Signed-off-by: fmfsaisai <fmfsaisai@gmail.com>
@fmfsaisai
fmfsaisai force-pushed the feat/member-upload-contract branch from bb59341 to 749b82d Compare August 9, 2026 03:42
…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>
@fmfsaisai
fmfsaisai marked this pull request as ready for review August 9, 2026 06:18
@greptile-apps

greptile-apps Bot commented Aug 9, 2026

Copy link
Copy Markdown

Greptile Summary

此 PR 定义 organization 成员异步上传 Plugin 的共享协议,并使市场分页游标支持不透明字符串。

  • 新增 prepare、commit、status 与 my-publishes 的 DTO、运行时解析器和公共导出
  • 新增上传任务状态、审核状态、稳定失败码及 Forge 包大小和条目限制
  • 抽取共享解析原语与 Plugin 资源 ID 校验,并保持统一的 PluginProtocolError 类身份
  • 更新协议文档及覆盖请求、响应、状态约束和导出行为的测试

Confidence Score: 5/5

当前 HEAD 未发现仍需阻止合并的失败,PR 看起来可以安全合并。

未发现仍然存在的阻塞性失败。

Important Files Changed

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
Loading

Reviews (4): Last reviewed commit: "fix(plugin-protocol): validate member up..." | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/plugin-protocol/src/internal/parse.ts
Comment thread packages/plugin-protocol/package.json
Comment thread packages/plugin-protocol/src/memberUpload.ts Outdated
Comment thread packages/plugin-protocol/src/memberUpload.ts Outdated
fmfsaisai and others added 2 commits August 9, 2026 14:31
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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/plugin-protocol/src/memberUpload.ts Outdated
Comment thread packages/plugin-protocol/src/memberUpload.ts
Signed-off-by: fmfsaisai <fmfsaisai@gmail.com>

Co-Authored-By: Claude <noreply@anthropic.com>
@fmfsaisai
fmfsaisai merged commit 27ba054 into main Aug 9, 2026
6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant