Skip to content

test(interop): 消费样本集 n17-encrypt-missing-dek(29→30 条) - #30

Merged
im47cn merged 1 commit into
mainfrom
interop/n17
Sep 2, 2026
Merged

im47cn merged 1 commit into
mainfrom
interop/n17

Conversation

@im47cn-bot

@im47cn-bot im47cn-bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

变更

六仓 interop 样本集 v1 升级(29→30 条)的 Python 消费端,与 java(2c6dd7d)、dotnet(PR #33)、typescript(PR #22)同批次:

  • fixture 字节副本:tests/fixtures/interop-cases.json 从真源重拷(sha256 c920ca1a…,2026-09-02 冻结);仅新增 n17,SM2 build 两条 signatureSegment 重采样(opaque 合同内)
  • 哨兵升级:test_interop.py 计数哨兵 verify-negative 16→17;已知 id 登记 n17-encrypt-missing-dek
  • 引用面同步:README、docs/scenario-analysis.md 中的样本条数引用同步更新
  • n17 期望 errorClass=protocol(裸 L2 X-Wop-Encrypt 头缺 dek 段,协议结构类明确拒绝)——本仓分类现状合规

真源锚点

wop-platform/wop-specs main 6f359a1(n17 经 PR #12 入集;治理规则 6 经 PR #13/#14 落库)。

Sourcery 摘要

升级 Python 互操作样本集消费端,以覆盖缺失 DEK 的加密协议负向场景,并同步完整性与文档基线。

改进:

  • 升级 interop v1 样本集消费与完整性校验,纳入 n17-encrypt-missing-dek,并将样本总数更新至 30 条。
  • 同步 n17 的协议错误分类及样本集引用,确保跨语言互操作性基线一致。

文档:

  • 更新 README 和场景分析文档中的 interop 样本数量引用。

测试:

  • 扩展互操作性测试哨兵与已知样本登记,新增 n17 负向用例,并将负向验证数量更新至 17 条。
Original summary in English

Summary by Sourcery

升级 Python interop 样本集消费端以覆盖缺失 DEK 的加密协议负向场景,并同步完整性与文档基线。

Enhancements:

  • 升级 interop v1 样本集消费与完整性校验,纳入 n17-encrypt-missing-dek 并将样本总数更新至 30 条。
  • 同步 n17 的协议错误分类及样本集引用,确保跨语言互操作性基线一致。

Documentation:

  • 更新 README 和场景分析文档中的 interop 样本数量引用。

Tests:

  • 扩展互操作性测试哨兵与已知样本登记,新增 n17 负向用例并将负向验证数量更新至 17 条。

- fixture 从真源 wop-specs/interop/v1 字节重拷,sha256 哨兵更新为
  c920ca1a…353e;负向条数哨兵 16→17、总数 29→30,id 哨兵收编
  n17-encrypt-missing-dek
- n17(x-wop-encrypt 裸 L2 缺 ;dek=)期望 protocol:本仓
  client.py verify_response 解析层 startswith("L2;dek=") 前置检查
  已抛 ProtocolFormatError,分类现状合规,免改码;映射表注释收编
  裁决 0 号并登记 n17
- README/scenario-analysis 条数引用同步(24 verify / 30 总)

验证:python -m pytest --cov=wop_sdk --cov-branch --cov-fail-under=98
287 passed,行+分支覆盖 100%(门禁无回退)
@im47cn-bot
im47cn-bot requested a review from im47cn as a code owner September 2, 2026 14:35
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 70f47144-796f-4011-b59f-99847b18eed6


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8be4c9d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sourcery-ai

sourcery-ai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor
审查者指南(小型 PR 中折叠显示)

审查者指南

本 PR 将 Python interop 消费端从 29 条样本升级至真源冻结的 30 条,新增 n17 缺失 DEK 的协议级负向覆盖,并同步 fixture 完整性哨兵、错误分类映射及文档引用。

interop 样本验证时序图

sequenceDiagram
    participant Test as test_interop.py
    participant Fixture as interop-cases.json
    participant SDK as Python SDK

    Test->>Fixture: load n17-encrypt-missing-dek
    Test->>SDK: verify(sample)
    SDK-->>Test: reject with errorClass=protocol
    Test->>Test: assert verify-negative count 17
Loading

n17 缺失 DEK 协议案例流程图

flowchart LR
    A[裸 L2 X-Wop-Encrypt 头] --> B{dek 段存在?}
    B -->|否| C[协议结构拒绝]
    C --> D[errorClass=protocol]
Loading

文件级变更

变更 详细信息 文件
升级并固化 interop v1 fixture,使 Python 消费端覆盖新增的 n17 负向协议样本。
  • 从真源更新字节副本,新增 n17,并接受两条 SM2 opaque 签名段重采样;同步 SHA-256 哨兵。
  • 将 fixture 总数提升至 30,verify-negative 数量提升至 17,并登记 n17 已知 ID。
  • 将裸 L2 X-Wop-Encrypt 缺少 dek 段映射为 protocol,纳入 ProtocolFormatError 分类合同。
tests/fixtures/interop-cases.json
tests/test_interop.py
同步文档中的 interop 样本数量与验证范围说明。
  • 将 README 中 verify 冻结样本数从 23 条更新为 24 条。
  • 将场景分析中的 interop/v1 样本集数量从 29 条更新为 30 条。
README.md
docs/scenario-analysis.md

提示与命令

与 Sourcery 交互

  • 触发新的审查: 在拉取请求中评论 @sourcery-ai review。
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 根据审查评论生成 GitHub issue: 回复审查评论,请 Sourcery 根据该评论创建 issue。你也可以使用 @sourcery-ai issue 回复审查评论,以便从中创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title,以便随时生成或重新生成标题。
  • 生成拉取请求摘要: 在拉取请求正文中任意位置写入 @sourcery-ai summary,即可在指定位置随时生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary,以便随时生成或重新生成摘要。
  • 生成审查者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时生成或重新生成审查者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,此功能非常有用。
  • 忽略所有 Sourcery 审查: 在拉取请求中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。如果你想从头开始新的审查,此功能尤其有用——别忘了评论 @sourcery-ai review 以触发新的审查!

自定义体验

访问你的控制面板:

  • 启用或停用审查功能,例如 Sourcery 生成的拉取请求摘要、审查者指南等。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

本 PR 将 Python interop 消费端从 29 条样本升级至真源冻结的 30 条,新增 n17 缺失 DEK 的协议级负向覆盖,并同步 fixture 完整性哨兵、错误分类映射及文档引用。

Sequence diagram for interop sample verification

sequenceDiagram
    participant Test as test_interop.py
    participant Fixture as interop-cases.json
    participant SDK as Python SDK

    Test->>Fixture: load n17-encrypt-missing-dek
    Test->>SDK: verify(sample)
    SDK-->>Test: reject with errorClass=protocol
    Test->>Test: assert verify-negative count 17
Loading

Flow diagram for the n17 missing DEK protocol case

flowchart LR
    A[裸 L2 X-Wop-Encrypt 头] --> B{dek 段存在?}
    B -->|否| C[协议结构拒绝]
    C --> D[errorClass=protocol]
Loading

File-Level Changes

Change Details Files
升级并固化 interop v1 fixture,使 Python 消费端覆盖新增的 n17 负向协议样本。
  • 从真源更新字节副本,新增 n17,并接受两条 SM2 opaque 签名段重采样;同步 SHA-256 哨兵。
  • 将 fixture 总数提升至 30,verify-negative 数量提升至 17,并登记 n17 已知 ID。
  • 将裸 L2 X-Wop-Encrypt 缺少 dek 段映射为 protocol,纳入 ProtocolFormatError 分类合同。
tests/fixtures/interop-cases.json
tests/test_interop.py
同步文档中的 interop 样本数量与验证范围说明。
  • 将 README 中 verify 冻结样本数从 23 条更新为 24 条。
  • 将场景分析中的 interop/v1 样本集数量从 29 条更新为 30 条。
README.md
docs/scenario-analysis.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

你好——我已经审阅了你的更改,整体看起来很棒!

Sourcery 评估

已批准。


Sourcery 对开源项目免费——如果你喜欢我们的评审,请考虑分享它们 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会利用反馈来改进评审。
Original comment in English

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@im47cn
im47cn merged commit 6c28139 into main Sep 2, 2026
41 checks passed
@im47cn
im47cn deleted the interop/n17 branch September 2, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants