Skip to content

ci(release): dependency-ordered, checksum-verified kin-db publish + registry-only consumer smoke (FIR-1021)#29

Open
troyjr4103 wants to merge 2 commits into
mainfrom
harden/kin-db-fir-1021-release-publish
Open

ci(release): dependency-ordered, checksum-verified kin-db publish + registry-only consumer smoke (FIR-1021)#29
troyjr4103 wants to merge 2 commits into
mainfrom
harden/kin-db-fir-1021-release-publish

Conversation

@troyjr4103

Copy link
Copy Markdown
Contributor

FIR-1021 — dependency-ordered cargo publish + registry-only smoke

Linear: https://linear.app/firelock-ai/issue/FIR-1021 (child of FIR-1015) · Urgent

Hardens the first-cut auto-publish into a dependency-aware release flow.

scripts/publish-kinlab-crates.sh

  • Dependency-ordered preflight — reads kin-db's declared registry deps from cargo metadata (NOT the locally patched/resolved versions) and fails loudly if a required version is missing from the kin index. It enforces the pinned kin-model version: ^0.2.0 → requires 0.2.0 published. Optional/range deps (kin-infer >=0.1.1) checked for presence; the consumer smoke is the authoritative cross-check.
  • Checksum-identical idempotency — an existing version (HTTP 409) is accepted only when the index cksum is byte-identical to the freshly packaged crate. A version that already exists with different bytes fails loudly instead of being silently treated as success.
  • Post-publish proof — re-reads the index cksum, downloads the published .crate, and asserts download == index == locally-packaged checksum.
  • Reads the download URL template from the registry config.json; DRY_RUN / SKIP_REGISTRY_CHECKS escape hatches for local packaging.

ci/registry-smoke/ (new)

Standalone, out-of-tree consumer crate depending on kin-db only via registry = "kin" (default-features = false, features = ["vector"] — the set that broke in the version-skew incident). Building it proves the published crate is self-consistent and downloadable by a third party.

Workflows

  • registry_publish (push path) and publish_registry (tag path) pinned to a Troy-gated protected environment registry-publish (configure required reviewer = Troy + scope KINLAB_CARGO_TOKEN to it; the kin daemon also fails closed without the token).
  • New registry_consumer_smoke job on both paths: stages the consumer out-of-tree, writes a registry-only .cargo/config.toml (no [patch.*]), pins it to the just-published version, and builds with a fresh CARGO_HOME — fresh-cache, patches-disabled, post-publish.
  • Fixed release.yml's stale Publish kin-model and kin-db label (the script publishes kin-db only).

Acceptance mapping

  • ✅ Release publishes in dependency order + pins kin-model — preflight enforces the kin-model 0.2.0 pin.
  • ✅ Existing-version publish idempotent only when bytes identical, else fails loudly — 409 path compares index cksum to packaged cksum.
  • ✅ Fresh-cache registry-only smoke, patches disabled, after publish — registry_consumer_smoke.
  • ✅ Post-publish download checksum == index checksum — verify_published_matches.

Verification (non-GPU)

  • bash -n clean; DRY_RUN=1 packages kin-db@0.2.3 and computes sha256.
  • Dependency-parsing emits correct rows incl. the kin-model 0.2.0 pin.
  • Consumer main.rs compiles against kin-db (path-dep throwaway check).

⚠️ Troy-gated remainder

I cannot run the actual cargo publish (Troy holds KINLAB_CARGO_TOKEN). The publish job + the registry-resolving consumer smoke run only in CI behind the protected environment. Troy must: (1) create the registry-publish GitHub Environment with required reviewer, (2) scope KINLAB_CARGO_TOKEN to it. Everything else is implemented and locally verified.

@troyjr4103 troyjr4103 force-pushed the harden/kin-db-fir-1021-release-publish branch from 4be8ee9 to 4031805 Compare June 17, 2026 20:57
…egistry-only consumer smoke (FIR-1021)

Harden the first-cut auto-publish into a dependency-aware release flow.

scripts/publish-kinlab-crates.sh:
- Dependency-ordered preflight: reads kin-db's DECLARED registry deps from
  cargo metadata (not the locally patched/resolved versions) and fails loudly
  if a required version is missing from the kin index — in particular it
  enforces the pinned kin-model version (^0.2.0 -> requires 0.2.0 published).
- Checksum-identical idempotency: an existing version (HTTP 409) is accepted
  only when the index cksum is byte-identical to the freshly packaged crate;
  a version that exists with DIFFERENT bytes fails loudly.
- Post-publish proof: re-reads the index cksum, downloads the published .crate,
  and asserts download == index == locally-packaged checksum.
- Reads the registry download template from config.json; DRY_RUN /
  SKIP_REGISTRY_CHECKS escape hatches for local packaging.

ci/registry-smoke/: standalone out-of-tree consumer crate depending on kin-db
ONLY via registry = "kin" (default-features=false, features=["vector"] — the
set that broke in the version-skew incident). Building it proves the published
crate is self-consistent and downloadable.

Workflows: registry_publish / publish_registry pinned to a TROY-GATED protected
environment (registry-publish); added a post-publish registry_consumer_smoke
job that stages the consumer out-of-tree with a registry-only .cargo config
(no patches) + fresh CARGO_HOME and builds it. Fixed release.yml's stale
'kin-model and kin-db' label (the script publishes kin-db only).

Verified: bash -n + DRY_RUN package/checksum locally; dependency-parsing python
emits correct rows incl. the kin-model 0.2.0 pin; consumer main.rs compiles
against kin-db. Actual publish + registry resolution are Troy-gated (token).

Signed-off-by: Troy Fortin <troy@firelock.io>
…n-model from registry 0.2.0 (FIR-1021)

Signed-off-by: Troy Fortin <troy@firelock.io>
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