Skip to content

feat(profile): plugin discovery closes the unaudited gap (Pillar 4 step 4a) - #299

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

Closes the honesty gap step 2 deliberately left open: plugins were reported unaudited (DiscoveredState.plugins = null) because discovery didn't exist. This adds plugin discovery so kit profile check audits plugin drift like it already does skills/mcp. Workflows remain honestly unaudited (no on-disk convention to reconcile against yet).

Type of Change

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

Related Issues

Changes Made

  • src/agent-sbom.ts — discoverPlugins(cwd): reads kitPlugins from package.json (the same list loadPluginAdapters consumes) and resolves each installed version from node_modules/<name>/package.json. Best-effort, never throws (missing/malformed → []), matching discoverAgentToolchain. Kept as a separate function so kit sbom --agent / kit insight (which call discoverAgentToolchain) are untouched.
  • src/profile/reconcile.ts — discoverActualState now populates plugins (no longer null) → plugin drift (added / removed / version) is audited. Workflows stay null — there's no on-disk workflow convention to reconcile against yet, so they remain honestly unaudited rather than faked.
  • src/commands/profile.ts — kit profile freeze now snapshots discovered plugins alongside skills/mcp; operator-authored workflows/gates/scope are still preserved verbatim.
  • Tests: discoverPlugins (installed + uninstalled versions, empty/garbage package.json); reconcile audits plugin drift end-to-end; discoverActualState discovers plugins.

Testing

Test Coverage

  • Added new tests
  • Updated existing tests (the discoverActualState assertion that plugins were null)
  • All tests pass (npm test) — full suite 2652 pass / 0 fail (2649 baseline + 3)

Manual Testing

  1. npx tsc --noEmit → clean.
  2. npx eslint src → 0 errors.
  3. npm run build && node scripts/test.mjs → 2652 pass, 0 fail.
  4. npx prettier --check → formatted.

Breaking Changes

None / N/A — additive discovery; discoverAgentToolchain and its consumers are unchanged.

Checklist

  • All new code has test coverage
  • All tests pass locally (npm test)
  • No new warnings or errors introduced
  • No hardcoded secrets or sensitive data
  • Code has been self-reviewed

Performance Impact

  • No performance impact

Reviewer Notes

The deliberate asymmetry — plugins now discovered, workflows still null — is the no-false-green stance: I only flip a kind from "unaudited" to audited when there is a real on-disk source of truth to compare against (kitPlugins for plugins). Inventing a workflow-file convention just to make workflows "audited" would fake a signal, so they stay honestly unaudited until such a convention exists. This leaves kit triage plugin and vault-config triage as the remaining step-4 items (separate PRs).

🤖 Generated with Claude Code

https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2


Generated by Claude Code

…ep 4a)

Step 2 deliberately reported plugins as UNAUDITED (DiscoveredState.plugins = null) because
discovery didn't exist. This adds it:

- agent-sbom.ts: discoverPlugins(cwd) reads kitPlugins from package.json (the same list
  loadPluginAdapters consumes) and resolves each installed version from
  node_modules/<name>/package.json. Best-effort, never throws (missing/malformed → []), matching
  discoverAgentToolchain. Kept separate so kit sbom --agent / kit insight are untouched.
- reconcile.ts: discoverActualState now populates plugins (no longer null) → plugin drift
  (added/removed/version) is audited by kit profile check. Workflows stay null (no on-disk
  workflow convention to reconcile against yet — honestly unaudited, not faked).
- commands/profile.ts: kit profile freeze now snapshots discovered plugins alongside skills/mcp;
  operator-authored workflows/gates/scope are still preserved verbatim.

Tests: discoverPlugins (installed+uninstalled versions, empty/garbage package.json); reconcile
now audits plugin drift end-to-end; discoverActualState discovers plugins.

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