Skip to content

feat(profile): kit profile show|freeze|check command (Pillar 4 step 3) - #297

Merged
sandstream merged 1 commit into
mainfrom
claude/web-kit-status-sync-p6fg9a
Jul 9, 2026
Merged

sandstream merged 1 commit into
mainfrom
claude/web-kit-status-sync-p6fg9a

Conversation

@sandstream

Copy link
Copy Markdown
Owner

Description

Step 3 of the versioned, traveling project profile (Pillar 4). Wires the schema (#295) and drift core (#296) into a first-class CLI verb via COMMAND_REGISTRY, so the profile is now usable end-to-end. Zero-LLM, deterministic; never auto-mutates the toolchain.

Type of Change

  • New feature (non-breaking change that adds functionality)

Related Issues

Changes Made

  • src/commands/profile.ts — three subcommands:
    • show — render the declared profile with per-line reconciliation marks (✓ in sync / ⚠ DRIFT / ⚠ REMOVED / ⚠ ADDED), fingerprint, and an explicit note for kinds not yet auditable.
    • freeze — snapshot the discovered toolchain (skills/mcp via discoverAgentToolchain, vault store from .kit.toml) into .kit-profile.toml, preserving operator-authored name/workflows/plugins/gates/scope verbatim. A deliberate action, like kit baseline freeze.
    • check — report declared-vs-discovered drift; --gate turns any drift into a non-zero exit for CI (default is warn / exit 0). Honest skip (exit 0) when no profile is declared.
    • --json on every subcommand.
  • src/cli.ts — profile registry entry (experimental) + SUBCOMMAND_HELP for show/freeze/check.
  • contracts/public-surface.json — regenerated for the new verb (node scripts/gen-public-surface.mjs).
  • src/commands/profile.test.ts — 7 tests (skip when no profile; freeze snapshots skills/mcp/vault; freeze preserves scope/workflows; check clean after freeze round-trip; --gate exits non-zero on drift; warn exits 0; unknown subcommand rejected).

Testing

Test Coverage

  • Added new tests (7)
  • Updated existing tests (regenerated public-surface.json contract)
  • All tests pass (npm test) — full suite 2640 pass / 0 fail (2633 baseline + 7)

Manual Testing

  1. npx tsc --noEmit → clean.
  2. npx eslint src → 0 errors (pre-existing complexity/max-lines warnings only; eslint src has no --max-warnings).
  3. npm run build && node scripts/gen-public-surface.mjs && node scripts/test.mjs → 2640 pass, 0 fail (public-surface contract test green).
  4. npx prettier --check → formatted.

Breaking Changes

None / N/A — new verb; nothing else changes behavior.

Checklist

  • My code follows the project's style guidelines
  • All new code has test coverage
  • All tests pass locally (npm test)
  • No new warnings or errors introduced (no new errors; the two cli.ts warnings pre-date this change)
  • No hardcoded secrets or sensitive data — freeze records backend selection and key names only
  • Code has been self-reviewed

Performance Impact

  • No performance impact

Reviewer Notes

Two deliberate design points: (1) check defaults to warn (exit 0) and only gates with --gate — so adding the verb can't turn an existing CI red by surprise; net-new-drift gating (vs. this full-drift gate) is a later refinement noted in the design. (2) freeze is additive/preserving — it overwrites only the discoverable dimensions (skills/mcp/vault store) and copies operator-authored sections (workflows/plugins/scope/gates) through untouched, so a hand-written [scope]/RoE survives a re-freeze. Signing (.kit-profile.sig) and the plugin/workflow discovery that would make those kinds auditable are steps 4–5.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2


Generated by Claude Code

Wires the profile schema (#295) + drift core (#296) into a CLI verb via COMMAND_REGISTRY
(design: pillar4-traveling-profile-5.0.md). Adds src/commands/profile.ts:

- show   — render the declared profile with per-line reconciliation marks (✓/DRIFT/REMOVED/
           ADDED), fingerprint, and an unaudited note for kinds not yet discoverable.
- freeze — snapshot the DISCOVERED toolchain (skills/mcp via discoverAgentToolchain, vault
           store from .kit.toml) into .kit-profile.toml, PRESERVING operator-authored
           name/workflows/plugins/gates/scope verbatim. Deliberate action, like baseline freeze.
- check  — report declared-vs-discovered drift; --gate turns any drift into a non-zero exit
           for CI (default is warn/exit-0). Honest skip (exit 0) when no profile is declared.

--json on every subcommand. Zero-LLM, deterministic; never auto-mutates the toolchain.
Registry entry (experimental) + SUBCOMMAND_HELP; contracts/public-surface.json regenerated
for the new verb. 7 command tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

✅ Docker image built successfully

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

@sandstream
sandstream merged commit caa20d2 into main Jul 9, 2026
18 checks passed
@sandstream
sandstream deleted the claude/web-kit-status-sync-p6fg9a branch July 9, 2026 22:07
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