artifactproof README

The project's README from github.com/MaxHu-xuan/artifactproof. As one markdown file: README.md.

ArtifactProof(PPTX 交付物验真)

CI

中文导航:中文说明 · 中文项目资料

English navigation: English overview · Technical reference

ArtifactProof · TaskStateGuard · ChatArchiveGuard

中文说明

检查通过的 PPTX,交付时还是同一份吗?

一份 PPTX 通过检查后,可能还要经历审批、重命名、上传、下载和转发。到了真正交付时, 文件名可能没变,文件内容却已经被替换;也可能拿着正确的质检报告,发出的却是另一版。

ArtifactProof 在本地为最终 PPTX 计算 SHA-256,执行基础结构检查,并把调用方选择的外部 质检证据一起绑定到 HMAC-SHA256 收据。交付前或接收后再次验证,可以确认当前 PPTX 与 提供的证据字节是否仍和该收据记录一致。

它不上传文件,也不依赖文件名和修改时间。它不是通用数字签名系统,不做完整 OOXML 语义 验证,也不判断设计美感;它专注于补上 PPTX 基础结构检查、外部 QA 证据与最终交付文件 之间的完整性缺口。

60 秒试跑

需要 Python 3.11 或更高版本。演示不需要安装、不访问网络,也不读取你的 PPTX 或密钥; 它只在临时目录生成一页合成演示稿,运行真实的 create 和 verify 命令,再确认文件被 改动后验证会失败。

Linux 或 macOS:

python3 examples/run_demo.py

Windows PowerShell:

py -3 examples\run_demo.py

预期输出:

{"evidence":"synthetic-review.json","ok":true,"operation":"generate","pptx":"synthetic-deck.pptx"}
{"ok":true,"operation":"create","qa":"pass","receipt_written":true}
{"ok":true,"operation":"verify","verified":true}
{"detected":true,"ok":true,"operation":"tamper-check"}

最后一行表示篡改已被发现,不表示演示稿通过了视觉审查或已经真实送达。演示输入的生成 方式和数据边界见 examples/README.md。生成器不会覆盖已有路径; 若生成中途失败,它可能保留已经创建的纯合成文件,避免误删被并发进程替换的同名内容。

三个项目怎么选?

你要解决的问题 项目
确认最终 PPTX 及随附验收证据仍匹配结构检查后生成的 HMAC 签名收据 ArtifactProof(PPTX 交付物验真)
重启后核对卡住任务、超时与待投递状态,不把未知结果猜成成功 TaskStateGuard(任务状态守护)
分享或迁移聊天导出前,本地检查疑似秘密、个人信息形态、格式、SQLite 与扫描盲区 ChatArchiveGuard(聊天归档守护)

适用场景

它怎样工作?

  1. create 在检查前后分别计算 PPTX 的 SHA-256;如果检查过程中有其他进程修改文件, 收据不会创建。
  2. 内置检查器验证 PPTX 的 ZIP、OOXML 基本结构和关键关系。提供 --evidence 时,外部 报告也会计算 SHA-256 并写入收据。
  3. 收据记录文件摘要、字节大小、检查结果和证据摘要,再使用调用方提供的共享密钥生成 HMAC-SHA256 签名。
  4. verify 重新读取 PPTX 和证据,核对摘要、签名与 key_id。任何不一致都会得到失败 结果,而不是继续把文件当作已验证版本。

最终得到的是一份小型 JSON 收据和适合自动化读取的成功或失败结果。收据不包含 PPTX 正文或证据正文。默认情况下,它会保存 PPTX 的源文件名;如果该名称包含客户名称或内部 标识,可以用 --artifact-name 改为由调用方选择的中性逻辑名称。工具会检查名称格式, 但调用方仍须确保名称不含敏感信息。证据逻辑名称和 key_id 也会写入收据,同样不应包含 敏感信息。

用于你自己的 PPTX

1. 安装并设置签名密钥

需要 Python 3.11 或更高版本。对于已经发布到 PyPI 的版本,建议在独立虚拟环境中安装。

Linux 或 macOS:

python3 -m venv .venv
. .venv/bin/activate
python -m pip install artifactproof
export ARTIFACTPROOF_SIGNING_KEY='base64:REPLACE_WITH_BASE64_KEY'

Windows PowerShell:

py -3 -m venv .venv
.\.venv\Scripts\python.exe -m pip install artifactproof
$env:ARTIFACTPROOF_SIGNING_KEY = 'base64:REPLACE_WITH_BASE64_KEY'

如果要测试开发版,请从已经审核的源码 checkout 根目录安装:Linux 或 macOS 使用 python -m pip install .,Windows 使用 .\.venv\Scripts\python.exe -m pip install .。

离线使用时,请从同一个 GitHub Release 下载 wheel 与 SHA256SUMS,并先核验 wheel。 在包含这两个文件的目录中,运行与你的平台对应的命令。

Linux:

grep '  artifactproof-0.1.0-py3-none-any.whl$' SHA256SUMS | sha256sum --check -

macOS:

grep '  artifactproof-0.1.0-py3-none-any.whl$' SHA256SUMS | shasum -a 256 --check

Windows PowerShell:

$wheel = '.\artifactproof-0.1.0-py3-none-any.whl'
$entry = @(Get-Content .\SHA256SUMS | Where-Object {
    $_ -match '^[0-9a-f]{64}  artifactproof-0\.1\.0-py3-none-any\.whl$'
})
if ($entry.Count -ne 1) { throw 'wheel checksum entry missing or duplicated' }
$expected = ($entry[0] -split '  ', 2)[0]
$actual = (Get-FileHash $wheel -Algorithm SHA256).Hash.ToLowerInvariant()
if ($actual -ne $expected) { throw 'wheel SHA-256 mismatch' }

核验通过后,再使用 --no-index --no-deps 安装该 wheel;不要安装未经核验或来源不明的 同名文件。

请将占位值换成由至少 32 个随机字节生成的密钥,并保存在操作系统、CI 密钥库或团队使用 的密钥管理工具中。不要把真实密钥写进代码、收据或命令参数。

2. 检查 PPTX 并创建收据

Linux 或 macOS:

artifactproof create deck.pptx \
  --artifact-name approved-deck.pptx \
  --evidence render=render-manifest.json \
  --receipt deck.receipt.json \
  --key-id local-ci

Windows PowerShell:

.\.venv\Scripts\python.exe -m artifactproof create deck.pptx --artifact-name approved-deck.pptx --evidence render=render-manifest.json --receipt deck.receipt.json --key-id local-ci

没有外部报告时可以省略 --evidence。如果创建收据时绑定了证据,验证时必须提供逻辑名称 相同、内容也相同的文件。--artifact-name 只控制收据公开的逻辑名称,不改变读取哪个 文件,也不参与路径匹配;验证仍以 SHA-256 和字节大小为准,因此复验时文件可以换一个 本地名称。

3. 在交付前或接收后复验

Linux 或 macOS:

artifactproof verify deck.pptx \
  --evidence render=render-manifest.json \
  --receipt deck.receipt.json \
  --expected-key-id local-ci

Windows PowerShell:

.\.venv\Scripts\python.exe -m artifactproof verify deck.pptx --evidence render=render-manifest.json --receipt deck.receipt.json --expected-key-id local-ci

创建与验证必须使用同一把签名密钥。成功时命令会返回简短的 JSON;PPTX、证据、签名或 预期的密钥标识不一致时会返回失败。

Linux、macOS 与 Windows 命令差异

收据格式和验证结论跨平台一致,主要差异在 Python 启动命令、虚拟环境激活、环境变量和 多行命令写法。

操作 Linux macOS Windows PowerShell
启动 Python python3 python3 py -3
创建虚拟环境 python3 -m venv .venv python3 -m venv .venv py -3 -m venv .venv
激活虚拟环境 source .venv/bin/activate source .venv/bin/activate .\.venv\Scripts\Activate.ps1
设置签名密钥 export ARTIFACTPROOF_SIGNING_KEY='…' export ARTIFACTPROOF_SIGNING_KEY='…' $env:ARTIFACTPROOF_SIGNING_KEY = '…'
拆分长命令 行末使用 \ 行末使用 \ 行末使用反引号,或使用单行命令

Linux 和 macOS 上,新收据使用 0600 权限。Windows 没有相同的 POSIX 权限位,收据继承 目标目录的 DACL;应将它保存到只允许预期账户访问的目录。路径分隔符只用于命令输入, 收据结构本身不保存源路径。

ArtifactProof 能验证什么,不能验证什么?

文件生成成功、基础结构检查通过、视觉验收通过、当前文件未被替换和文件真实送达,是 不同的结论。ArtifactProof 直接检查基础结构和当前字节是否匹配;外部视觉验收或交付报告 可以作为证据文件绑定,但 ArtifactProof 不会独立证明报告内容真实,也不会把报告存在 误写成已经交付。

HMAC 适合持有同一共享密钥的团队。它不能区分共享该密钥的不同成员,也不提供公开验证 或不可否认性。保守的 ZIP 安全限制可能拒绝体积异常大的合法 PPTX。0.1.0 是首个 alpha 版本,命令行和 Python API 在 1.0 前仍可能调整。

常见问题

如何确认交付的 PPTX 没有被替换?

在质检通过时运行 artifactproof create,保存 PPTX、收据和密钥;在发送前或接收后运行 artifactproof verify。验证通过表示当前文件、声明的证据和签名收据彼此一致。它不表示 文件永远不会再变化,因此应尽量在实际交付或使用前复验。

ArtifactProof 与单独保存 SHA-256 checksum 有什么区别?

单独的 checksum 需要另一个可信位置保存参考值。ArtifactProof 把 PPTX 摘要、证据摘要 和检查结果放进同一份结构化收据,并用 HMAC-SHA256 签名。验证方仍然需要通过安全渠道 获得正确的共享密钥;工具不会自动建立这层信任。

如何避免收据暴露原始 PPTX 文件名?

创建时加入 --artifact-name approved-deck.pptx。收据只保存这个逻辑名称,不保存源路径或 源文件名。逻辑名称会进入签名内容,验证时不能修改;但验证不要求本地文件继续使用 同一个名称。逻辑名称是公开元数据,不是文件路径;为减少跨平台误用,命令会拒绝路径 分隔符、首尾空格、结尾句点,以及 Windows 文件名保留字符和设备名。名称格式通过不代表 内容不敏感,因此不要填写客户名称、账号、项目代号或其他敏感信息。

文件会上传到网络吗?

不会。当前运行时代码只使用 Python 标准库,不包含网络客户端。PPTX、证据和收据都留在 调用方选择的本地存储位置。

Windows、macOS 和 Linux 都能使用吗?

可以,收据格式跨平台一致。Linux 和 macOS 上的新收据使用 0600 权限;Windows 上的 文件权限继承目标目录的 DACL,因此应把收据放在当前账户专用的目录中。

能直接检查 PDF、DOCX 或图片吗?

0.1.0 的内置检查器仅支持 PPTX。Python 调用方可以提供自定义 qa_runner,但其他格式 需要各自的威胁模型和测试,不能视为项目已经内置支持。

能判断 PPT 是否美观或内容是否正确吗?

不能。视觉审查、可访问性检查和事实核验需要其他工具或人工完成。可以把这些检查生成的 报告作为证据,让收据明确它们对应的是哪一份 PPTX。

中文项目资料

项目状态

0.1.0 是 ArtifactProof 的首个 alpha 版本。收据格式已有明确约定,但 Python API 与命令行 界面在 1.0 前仍可能调整。版本发布后可从 PyPI 安装;开发或离线使用时,请选择已经审核的 源码 checkout 或核验过的 Release wheel。

项目代码从头独立实现,测试夹具全部使用合成数据,并采用 Apache-2.0 许可证。项目来源 边界见 PROVENANCE.md, 许可正文见 LICENSE。

English Overview

Is the delivered PPTX still the file that passed review?

A PPTX may pass review and then move through approval, renaming, upload, download, and delivery. The filename may stay the same while the bytes change, or the correct QA report may be sent with a different revision.

ArtifactProof hashes the final PPTX locally, runs basic structural checks, and binds caller-selected external QA evidence into an HMAC-SHA256 receipt. Verify again before delivery or after receipt to confirm that the current PPTX and supplied evidence bytes still match that receipt.

It uploads nothing and does not rely on filenames or modification times. It is not a general digital-signature system, a complete OOXML semantic validator, or a judge of visual quality. Its scope is the integrity gap between basic PPTX structure checks, external QA evidence, and the final delivery file.

Try it in 60 seconds

Python 3.11 or newer is required. The demo needs no installation, network access, real PPTX, or private key. It generates a one-slide synthetic deck in a temporary directory, runs the real create and verify commands, changes the temporary file, and confirms that verification fails.

Linux or macOS:

python3 examples/run_demo.py

Windows PowerShell:

py -3 examples\run_demo.py

Expected output:

{"evidence":"synthetic-review.json","ok":true,"operation":"generate","pptx":"synthetic-deck.pptx"}
{"ok":true,"operation":"create","qa":"pass","receipt_written":true}
{"ok":true,"operation":"verify","verified":true}
{"detected":true,"ok":true,"operation":"tamper-check"}

The last line means that the byte change was detected. It does not claim that the demo deck passed visual review or reached a recipient. See examples/README.md for the generator and data boundary. The generator never overwrites an existing path. If generation fails partway, it may leave a synthetic output in place rather than risk deleting a path that another process replaced concurrently.

Which project should I use?

Your problem Project
Verify that a final PPTX and its supplied QA evidence still match the HMAC-signed receipt created after structural checks ArtifactProof
After a restart, reconcile stuck tasks, timeouts, and pending delivery without guessing success TaskStateGuard
Before sharing or migrating a chat export, locally audit potential secrets, personal-data patterns, format or SQLite issues, and scan gaps ChatArchiveGuard

When should you use it?

How does it work?

  1. create calculates the PPTX SHA-256 before and after QA. If another process changes the file while QA is running, no receipt is created.
  2. The built-in checker validates the PPTX ZIP package, basic OOXML structure, and key relationships. Each --evidence file is hashed and added to the receipt.
  3. The receipt records digests, byte sizes, QA results, and evidence, then signs that payload with an HMAC-SHA256 key supplied by the caller.
  4. verify reads the PPTX and evidence again and checks their digests, the receipt signature, and key_id. Any mismatch produces a failure instead of treating the file as verified.

The output is a small JSON receipt plus stable success or failure results for automation. It does not contain the presentation or evidence contents. By default, it stores the PPTX basename. Use --artifact-name to replace a source filename that contains a customer name or internal identifier with a neutral logical name chosen by the caller. The tool validates the name's format, but the caller remains responsible for keeping it non-sensitive. Logical evidence names and key_id are also stored in the receipt and should not contain sensitive information.

Use it with your own PPTX

1. Install and set a signing key

Python 3.11 or newer is required. After a release is published to PyPI, install it in an isolated virtual environment.

Linux or macOS:

python3 -m venv .venv
. .venv/bin/activate
python -m pip install artifactproof
export ARTIFACTPROOF_SIGNING_KEY='base64:REPLACE_WITH_BASE64_KEY'

Windows PowerShell:

py -3 -m venv .venv
.\.venv\Scripts\python.exe -m pip install artifactproof
$env:ARTIFACTPROOF_SIGNING_KEY = 'base64:REPLACE_WITH_BASE64_KEY'

To test a development version, install from the root of a reviewed source checkout: use python -m pip install . on Linux or macOS, or .\.venv\Scripts\python.exe -m pip install . on Windows.

For offline use, download the wheel and SHA256SUMS from the same GitHub Release. In the directory containing both files, verify the wheel with the command for your platform.

Linux:

grep '  artifactproof-0.1.0-py3-none-any.whl$' SHA256SUMS | sha256sum --check -

macOS:

grep '  artifactproof-0.1.0-py3-none-any.whl$' SHA256SUMS | shasum -a 256 --check

Windows PowerShell:

$wheel = '.\artifactproof-0.1.0-py3-none-any.whl'
$entry = @(Get-Content .\SHA256SUMS | Where-Object {
    $_ -match '^[0-9a-f]{64}  artifactproof-0\.1\.0-py3-none-any\.whl$'
})
if ($entry.Count -ne 1) { throw 'wheel checksum entry missing or duplicated' }
$expected = ($entry[0] -split '  ', 2)[0]
$actual = (Get-FileHash $wheel -Algorithm SHA256).Hash.ToLowerInvariant()
if ($actual -ne $expected) { throw 'wheel SHA-256 mismatch' }

After verification succeeds, install the wheel with --no-index --no-deps. Do not install an unverified file merely because it has the expected name.

Replace the placeholder with a key derived from at least 32 random bytes. Keep the real key in an operating-system or CI secret store, or another secret manager controlled by your team. Never place it in source cod

artifactproof (MaxHu-xuan/artifactproof)

Searching Database…

What is this?ArtifactProof is an offline, local command-line tool that hashes a final PPTX with SHA-256, runs basic structural checks, and binds caller-supplied QA evidence into a tamper-evident HMAC-SHA256 receipt, so you can reverify before delivery or after receipt that nothing was swapped.
Is this a signing system or a full OOXML validator?No - it is a narrow CLI utility that only checks the PPTX ZIP/OOXML structure and bytes; it is explicitly not a general digital-signature system, a complete OOXML semantic validator, or a judge of visual quality.
How do I create and verify a receipt for my PPTX?Install the package (Python 3.11+), set a shared signing key as an environment variable, run 'artifactproof create' right after QA to hash the PPTX and any --evidence files into a signed receipt, then run 'artifactproof verify' before delivery or after receipt using the same key.
Do I need anything besides Python to run this?Just Python 3.11 or newer - the tool's runtime code only uses the Python standard library, so there are no extra dependencies and no network access needed.
Can ArtifactProof tell me the PPTX actually reached the recipient or looks good?No. It only confirms that the current PPTX bytes and evidence still match a signed receipt; it cannot replace code signing, public-key signatures or trusted timestamps, and it cannot judge design, layout, accessibility, or whether the file was really received and opened.
Does the receipt work the same way on Windows as on Linux or macOS?The receipt format and verification results are identical across platforms, but file protection differs: Linux and macOS receipts get 0600 permissions, while Windows has no equivalent POSIX bit and relies on the target folder's ACL, so receipts should live in a restricted directory.
Does it upload my PPTX or send any data over the network?No - it uploads nothing, keeps the PPTX, evidence, and receipt entirely on local storage, and the runtime code only uses the Python standard library with no network client.
Why use HMAC instead of just keeping a separate SHA-256 checksum?A standalone checksum needs its own trusted storage for the reference value, while ArtifactProof bundles the PPTX digest, evidence digest, and QA result into one receipt and signs the whole payload with a shared HMAC-SHA256 key - though you still need a secure channel to share that key.
What happens if someone tampers with the PPTX after the receipt is made?'artifactproof verify' recomputes the hashes and returns a failure instead of treating the file as verified, which the project's 60-second demo proves by modifying the generated deck and showing verification fail.
Can I hide the real customer-specific filename from the receipt?Yes, pass --artifact-name with a neutral logical name at creation time; the tool rejects path separators and reserved characters, but you're still responsible for not putting sensitive text in that name.
Is this ready for production use yet?Not fully - 0.1.0 is the first alpha release; the receipt format is fairly settled, but the CLI and Python API may still change before a 1.0 release.
Creator
MaxHu-xuan
Size
0.1 MB
Stars
858
Age
1mo
Commits · 90 Days