Skip to content

feat(cli): expose deterministic schema CRC - #16

Merged
RainLib merged 2 commits into
feature/pptx-slide-removal-parityfrom
feature/cli-schema-crc-parity
Jul 21, 2026
Merged

feat(cli): expose deterministic schema CRC#16
RainLib merged 2 commits into
feature/pptx-slide-removal-parityfrom
feature/cli-schema-crc-parity

Conversation

@RainLib

@RainLib RainLib commented Jul 21, 2026

Copy link
Copy Markdown
Owner

What changed

  • Embed every schemas/help/**/*.json file into the Rust binary at build time.
  • Canonicalize names to lowercase schemas/help/... paths with / separators and sort them deterministically.
  • Compute the C#-compatible CRC32 stream: canonical path bytes followed by each file's raw bytes.
  • Add exact one-argument early dispatch for officecli --output-schema-crc.
  • Add algorithm and real CLI regression tests, plus update the durable parity ledger.

Why

Downstream automation needs a stable fingerprint to decide whether the documented property surface changed between binary versions. Rust previously rejected the C# compatibility flag and did not embed the help schema tree.

Validation

  • Actual output: fbbccda7
  • Standard CRC32 check vector (123456789cbf43926)
  • Canonical path separator/case and ordering tests
  • Filename contribution test
  • Repeated real CLI invocation test
  • cargo fmt -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --workspace

Review stack

This PR targets feature/pptx-slide-removal-parity only because that branch introduces the durable parity ledger. The code change is format-independent and contains neither XLSX nor PPTX group-resize changes. Retarget it to main after PR #13 merges.

@RainLib

RainLib commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

验证完成:

  • cargo fmt -- --check:通过
  • cargo clippy --all-targets -- -D warnings:通过
  • cargo test --workspace:通过
  • CLI smoke:--output-schema-crc 连续输出稳定,结果为 fbbccda7
  • 独立 Build & Release 工作流:Lint/Test 与 7 个发布目标全部通过

CI: https://github.com/RainLib/OfficeCli-rust/actions/runs/29793787829

唯一注解是 actions/cache@v4 的 Node.js 20 弃用警告,不影响本 PR 的构建与验证结果。

@RainLib
RainLib merged commit d18c5dc into feature/pptx-slide-removal-parity Jul 21, 2026
@RainLib
RainLib deleted the feature/cli-schema-crc-parity branch July 21, 2026 02:49
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.

1 participant