Skip to content

fix: keep the promises the 3.0 audit surfaced (air-gap, determinism, frozen-contract, secrets) - #174

Merged
sandstream merged 2 commits into
mainfrom
claude/headroom-kit-integration-cmjw7t
Jun 30, 2026
Merged

sandstream merged 2 commits into
mainfrom
claude/headroom-kit-integration-cmjw7t

Conversation

@sandstream

@sandstream sandstream commented Jun 30, 2026 •

Copy link
Copy Markdown
Owner

Description

This session's multi-agent promise audit found kit largely keeps its promises (honestly scoped). This PR closes all four gaps it surfaced — two AT-RISK, two hardenings.

1. Local-first / air-gap completeness (AT-RISK)

checkForUpdate — the only outbound call on a normal kit run — now short-circuits under KIT_AIRGAP (isAirGap()), alongside the existing CI suppressors. Air-gap mode no longer leaks a lone npm-registry beacon.

2. Deterministic gate (AT-RISK)

A clean supply-chain scan whose bumblebee threat-intel catalogs were >60 days old was a warn that failed kit ci --strict purely because the wall clock advanced. Catalog staleness is now advisory (status: pass, age noted); the gate verdict is a function of inputs only.

3. Frozen contracts — additive-only now test-enforced (hardening)

The byte-for-byte snapshot forced acknowledgement of drift but treated additive and breaking changes identically. A new invariant test compares the live surface to the committed contracts/public-surface.json baseline and fails on a removed stable command, a stable → experimental/deprecated downgrade, or a schemaVersion/adapter-sdk major regression.

4. Secrets — entropy backstop for the fail-closed shared-memory gate (hardening)

The kv-secret heuristic allowlists KIT_/GITHUB_/… env prefixes, so a real high-entropy credential under such a prefix slipped past kit memory share. findSecrets(text, { entropyBackstop }) now also flags an ALL-CAPS KEY=value whose value is long + high-entropy (Shannon ≥ 4.2 bits/char) regardless of prefix; shareEntry enables it. Catches base64/base62 secrets, clears hex hashes (~4.0) + dictionary words; the noisier code/diff scan path is unchanged.

Type of Change

  • Bug fix (non-breaking)
  • Security hardening

Testing

  • Added tests for all four (air-gap suppression, entropy backstop catch + no-FP, additive-only invariant, shannonEntropy).
  • All tests pass (npm test) — 1923 pass / 0 fail; run-security-check.mjs PASS (19 ok).

Breaking Changes

None / N/A.

🤖 Generated with Claude Code

https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg

…nistic gate)

A multi-agent promise audit flagged two genuine AT-RISK gaps; both fixed:

1. LOCAL-FIRST / air-gap completeness — checkForUpdate (the only outbound call
   on a normal `kit` run) now short-circuits under KIT_AIRGAP (isAirGap()),
   alongside the existing CI/KIT_NO_UPDATE_CHECK suppressors. Air-gap mode no
   longer leaks a lone npm-registry beacon; "no outbound network by default" is
   now a complete posture.

2. DETERMINISTIC GATE — bumblebee threat-intel catalog staleness (>60d) was a
   `warn` that failed `kit ci --strict` purely on wall-clock time (same repo +
   scanners, different verdict by date). Staleness is now ADVISORY: status stays
   `pass`, the age is surfaced in detail/suggestion, and the gate verdict is a
   function of inputs only.

Tests: checkForUpdate returns null under KIT_AIRGAP (other suppressors cleared,
proving the air-gap branch). Full suite 1918 pass; security-check PASS.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

3. FROZEN CONTRACTS — "additive-only across 2.x" is now TEST-enforced, not just
   review discipline. A new invariant test compares the live surface to the
   committed contracts/public-surface.json baseline and fails on a removed stable
   command, a stable→experimental/deprecated downgrade, or a schemaVersion/
   adapter-sdk major regression — so a breaking change can't be hidden by
   regenerating the byte-for-byte snapshot.

4. SECRETS — entropy backstop for the fail-closed shared-memory gate. The
   kv-secret heuristic allowlists KIT_/GITHUB_/… env prefixes, so a real
   high-entropy credential under such a prefix slipped past `kit memory share`.
   findSecrets(text, {entropyBackstop}) now also flags an ALL-CAPS KEY=value
   whose value is long + high-entropy (Shannon ≥ 4.2 bits/char) regardless of
   prefix; shareEntry enables it. Catches base64/base62 secrets, clears hex
   hashes (~4.0) + dictionary words; the code/diff scan path is unchanged.

Full suite 1923 pass; security-check PASS. Completes the four promise-keeping
fixes the 3.0 review surfaced.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
@sandstream sandstream changed the title fix: keep two promises the 3.0 audit found at-risk (air-gap + deterministic gate) fix: keep the promises the 3.0 audit surfaced (air-gap, determinism, frozen-contract, secrets) Jun 30, 2026
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit 409e6bc into main Jun 30, 2026
17 checks passed
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