@fateforge/archery-cli 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -134,6 +134,7 @@ Error codes and exit codes must align:
134
134
  - `E_CONFLICT` -> 6
135
135
  - `E_NETWORK` / `E_RATE_LIMITED` / `E_SERVER` -> 7
136
136
  - `E_TIMEOUT` -> 8
137
+ - `E_INTEGRITY` -> 1 (release integrity failure: missing/invalid signature or checksum mismatch; **non-retryable**, see §14)
137
138
  - `E_HUMAN_REQUIRED` -> 9 (optional, only when §16.3 is enabled)
138
139
 
139
140
  When the failure comes from an upstream HTTP call, map the status onto the
@@ -635,17 +636,31 @@ Version notification contract:
635
636
 
636
637
  Release verification baseline:
637
638
 
638
- - Verify the archive/package against `checksums.txt`; checksum mismatch, missing
639
- checksum file, or missing archive entry fails closed.
640
- - Signed releases should sign `checksums.txt` with Sigstore/Cosign keyless
641
- signing from the tagged GitHub Actions release workflow. Verifiers should
642
- validate the bundle against the expected repository workflow identity and the
643
- GitHub OIDC issuer.
644
- - Update results carry `signature_status` (a short string describing where
645
- release integrity verification happened: e.g. `verified`, `not_checked`,
646
- `handled_by_npm_installer`, `manual_release_verification_required`) and
647
- `signature_verified` (true only when local Sigstore verification actually
648
- ran and succeeded). Never imply checksum verification is a signature.
639
+ - **Mandatory signature verification, no skip path**: the binary self-update path
640
+ MUST verify the Sigstore signature on `checksums.txt` in-process, then verify
641
+ the archive SHA256 against it. A missing signature bundle, a signature that does
642
+ not verify, or a checksum mismatch all fail closed — there is no "can't verify,
643
+ proceed anyway" degradation. The whole chain surfaces `E_INTEGRITY` (exit 1,
644
+ non-retryable): a forged or corrupt release is not a transient blip to retry.
645
+ - **Verifier embedded, no user-environment dependency**: verification happens
646
+ inside the tool binary (Go via `sigstore-go`, Python inside the frozen binary
647
+ via `sigstore`) with **no external cosign** and nothing pre-installed on the
648
+ machine. The TUF trust root is bootstrapped from the library's embedded
649
+ `root.json`, not fetched on first-use trust (TOFU).
650
+ - **New bundle format**: the signing side produces a Sigstore protobuf bundle
651
+ (`checksums.txt.sigstore.json`) via `cosign sign-blob --new-bundle-format`, which
652
+ the in-process verifier consumes; the legacy cosign bundle format is not accepted.
653
+ - **Identity binding**: verifiers bind the certificate SAN to this repo's tagged
654
+ release workflow (`…/release.yml@refs/tags/v*`, anchored `^…$`) and validate the
655
+ GitHub OIDC issuer. When the target tag is known, pin the exact identity (stronger
656
+ than a regexp).
657
+ - **Cross-language parity**: Go binaries and Python frozen binaries follow the same
658
+ self-update contract — download archive → in-process signature verify → checksum
659
+ → replace binary. Package managers do not own integrity.
660
+ - Update results carry `signature_status` (`verified` on success; any failure exits
661
+ via the error envelope) and `signature_verified` (true only when in-process
662
+ Sigstore verification actually ran and succeeded). Never imply checksum
663
+ verification is a signature.
649
664
 
650
665
  - After `update --confirm <token>` succeeds, return `previous_version` and `current_version` in `data`.
651
666
  - Also hint in the result: `run "changelog --since <previous_version>" to see what changed`.
@@ -131,6 +131,7 @@
131
131
  - `E_CONFLICT` -> 6
132
132
  - `E_NETWORK` / `E_RATE_LIMITED` / `E_SERVER` -> 7
133
133
  - `E_TIMEOUT` -> 8
134
+ - `E_INTEGRITY` -> 1(发布完整性失败:签名缺失/无效或 checksum 不符;**非重试**,见 §14)
134
135
  - `E_HUMAN_REQUIRED` -> 9(可选,仅启用 §16.3 时)
135
136
 
136
137
  当错误来自上游 HTTP 调用时,按状态码映射到错误码,让 agent 能从 `error.code` +
@@ -583,9 +584,12 @@ update 必须遵守的契约:
583
584
 
584
585
  release 校验基线:
585
586
 
586
- - `checksums.txt` 校验归档/包;checksum 不匹配、缺失 checksum 文件、或缺少当前归档条目,都必须失败关闭。
587
- - 已签名 release 应由 tagged GitHub Actions release workflow 使用 Sigstore/Cosign keyless 模式签署 `checksums.txt`。验证端应绑定到预期仓库 workflow 身份和 GitHub OIDC issuer。
588
- - update 结果携带 `signature_status`(一个短字符串说明发布完整性在哪里被验证:如 `verified`、`not_checked`、`handled_by_npm_installer`、`manual_release_verification_required`)与 `signature_verified`(仅当本地 Sigstore 验证真实执行且成功时为 true)。不能把 checksum 校验伪装成签名校验。
587
+ - **强制签名验证,无跳过路径**:二进制自更新路径必须在进程内验证 `checksums.txt` Sigstore 签名,再用它校验归档 SHA256。签名 bundle 缺失、签名验不过、checksum 不符,一律**失败关闭**,不存在"验不了就放行"的降级。整条链对外返回 `E_INTEGRITY`(exit 1,非重试)——伪造或损坏的发布不该被当成可重试的瞬时错误。
588
+ - **验证器内置、不依赖用户环境**:验证在工具二进制内完成(Go `sigstore-go`,Python 冻结二进制内用 `sigstore`),**不外挂 cosign**,不依赖机器上预装任何东西。TUF 信任根从库内嵌的 `root.json` 引导(不是 TOFU 现拉现信)。
589
+ - **新版 bundle 格式**:签名侧用 `cosign sign-blob --new-bundle-format` 产出 Sigstore protobuf bundle(`checksums.txt.sigstore.json`),与进程内验证器对齐;旧版 cosign bundle 格式不被接受。
590
+ - **身份绑定**:验证端把证书 SAN 绑定到本仓库的 tagged release workflow(`…/release.yml@refs/tags/v*`,锚定 `^…$`)并校验 GitHub OIDC issuer。已知目标 tag 时可绑精确身份,强于正则。
591
+ - **跨语言统一**:Go 二进制与 Python 冻结二进制走同一套自更新契约——都是"下载归档 → 进程内验签 → checksum → 替换二进制",包管理器不参与完整性。
592
+ - update 结果携带 `signature_status`(成功即 `verified`;异常一律走 error envelope 中止)与 `signature_verified`(仅当进程内 Sigstore 验证真实执行且成功时为 true)。不能把 checksum 校验伪装成签名校验。
589
593
 
590
594
  - `update --confirm <token>` 成功后,结果 `data` 中返回 `previous_version` 与 `current_version`。
591
595
  - 同时在结果中提示:`run "changelog --since <previous_version>" to see what changed`。
@@ -97,15 +97,20 @@ Fallback and channel rules:
97
97
 
98
98
  ## 5. Supply chain (applies to anything distributed)
99
99
 
100
- - **Integrity verification**: install scripts and self-update commands pulling a
101
- binary must verify checksums, **hard-fail on mismatch**, and report signature
102
- verification status explicitly. A checksum proves bytes match a checksum file;
103
- it does not prove the checksum file came from the publisher.
104
- - **Signed release material**: release pipelines should sign `checksums.txt`
105
- with Sigstore/Cosign keyless signing from the tagged GitHub Actions release
106
- workflow, publishing the bundle alongside the checksum file. Verification must
107
- bind the signature to the expected repository workflow identity and GitHub OIDC
108
- issuer.
100
+ - **Integrity verification, mandatory and no-skip**: binary self-update MUST verify
101
+ the Sigstore signature on `checksums.txt` **in-process** (the verifier is embedded
102
+ in the tool binary Go via `sigstore-go`, Python inside the frozen binary via
103
+ `sigstore` with **no external cosign** and no user-environment dependency), then
104
+ verify the archive SHA256. A missing/invalid signature or a checksum mismatch
105
+ **fails closed** with no "can't verify, proceed anyway" degradation, surfacing
106
+ `E_INTEGRITY` (non-retryable). A checksum proves bytes match a checksum file; only
107
+ the signature proves the checksum file came from the publisher.
108
+ - **Signed release material**: release pipelines sign `checksums.txt` with
109
+ Sigstore/Cosign keyless signing from the tagged GitHub Actions release workflow
110
+ using `--new-bundle-format` (a Sigstore protobuf bundle the in-process verifier
111
+ consumes). Verification binds the signature to the expected repository workflow
112
+ identity (anchored `^…$`) and GitHub OIDC issuer; the TUF trust root is
113
+ bootstrapped from the library's embedded root, not TOFU.
109
114
  - **Dependency locking + audit**: commit a lockfile; CI runs `npm audit` / `pip-audit` and blocks high-severity dependencies.
110
115
  - **Traceable builds**: release artifacts are built by CI from tagged source, no hand-uploaded unknown binaries.
111
116
  - **No remote scripts in postinstall**: don't execute code freshly pulled from the network at install time.
@@ -88,8 +88,8 @@ Agent 侧约定(同时写进 SKILL-SPEC 的用法):
88
88
 
89
89
  ## 5. 供应链(凡分发即适用)
90
90
 
91
- - **完整性校验**:安装脚本和自更新命令拉取二进制时必须校验 checksum,**不匹配硬失败**,并显式返回签名校验状态。checksum 只能证明字节与 checksum 文件一致,不能证明 checksum 文件来自发布者。
92
- - **签名发布材料**:release pipeline 应由 tagged GitHub Actions release workflow 使用 Sigstore/Cosign keyless 模式签署 `checksums.txt`,并把 bundle checksum 一起发布。验证时必须绑定到预期仓库 workflow 身份和 GitHub OIDC issuer。
91
+ - **完整性校验,强制且无跳过**:二进制自更新必须**在进程内**验证 `checksums.txt` 的 Sigstore 签名(验证器内置工具二进制,Go 用 `sigstore-go`、Python 冻结二进制内用 `sigstore`,**不外挂 cosign**、不依赖用户环境),再用它校验归档 SHA256。签名缺失/验不过/checksum 不符一律**失败关闭**,没有"验不了就放行"的降级;对外返回 `E_INTEGRITY`(非重试)。checksum 只能证明字节与 checksum 文件一致,签名才能证明 checksum 文件来自发布者。
92
+ - **签名发布材料**:release pipeline tagged GitHub Actions release workflow Sigstore/Cosign keyless 模式以 `--new-bundle-format` 签署 `checksums.txt`(产出 Sigstore protobuf bundle),与进程内验证器对齐。验证时绑定到预期仓库 workflow 身份(锚定 `^…$`)和 GitHub OIDC issuer;TUF 信任根从库内嵌 root 引导,不 TOFU
93
93
  - **依赖锁定 + 审计**:提交 lockfile;CI 跑 `npm audit` / `pip-audit` 一类,高危依赖阻断。
94
94
  - **构建可追溯**:发布产物由 CI 从打了 tag 的源码构建,不手工上传不明二进制。
95
95
  - **不在 postinstall 跑远程脚本**:安装期不执行从网络现拉的代码。
package/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.6] - 2026-06-16
9
+
10
+ ### Changed
11
+
12
+ - `update` now verifies the release Sigstore signature on `checksums.txt` **in-process** (embedded `sigstore-go`, bootstrapped from the embedded TUF trust root) instead of shelling out to an external `cosign`. Verification is mandatory and fail-closed: a missing signature bundle, a signature that does not verify against this repo's tagged release-workflow identity, or a checksum mismatch all refuse the update — there is no skip path. Releases are now signed with `cosign sign-blob --new-bundle-format`.
13
+
14
+ ### Security
15
+
16
+ - Release-integrity failures (missing/invalid signature or checksum mismatch) now return the non-retryable `E_INTEGRITY` error code (exit 1) instead of a retryable network code, so an agent treats a possible supply-chain issue as a hard stop rather than retrying.
17
+
8
18
  ## [1.0.5] - 2026-06-16
9
19
 
10
20
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fateforge/archery-cli",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Archery SQL audit CLI for AI Agents - manage SQL workflows, queries, instances, diagnostics, and data dictionaries with a machine-readable contract",
5
5
  "keywords": [
6
6
  "archery",
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: archery-cli
3
- version: "1.0.5"
3
+ version: "1.0.6"
4
4
  description: "Archery SQL audit platform CLI for managing SQL workflows, queries, instances, diagnostics. Use when the user asks about SQL审核, database operations, Archery platform management, or needs to submit/review/execute SQL against database instances."
5
5
  license: MIT
6
6
  user-invocable: true
7
- metadata: {"requires":{"bins":["archery-cli"],"min_version":"1.0.5"}}
7
+ metadata: {"requires":{"bins":["archery-cli"],"min_version":"1.0.6"}}
8
8
  ---
9
9
 
10
10
  # archery-cli