Repository navigation
feat(profile): plugin discovery closes the unaudited gap (Pillar 4 step 4a) - #299
Merged
Merged
Conversation
…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
|
✅ Docker image built successfully
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 sokit profile checkaudits plugin drift like it already does skills/mcp. Workflows remain honestly unaudited (no on-disk convention to reconcile against yet).Type of Change
Related Issues
kit-research/docs/research/pillar4-traveling-profile-5.0.md§5Changes Made
src/agent-sbom.ts—discoverPlugins(cwd): readskitPluginsfrompackage.json(the same listloadPluginAdaptersconsumes) and resolves each installed version fromnode_modules/<name>/package.json. Best-effort, never throws (missing/malformed →[]), matchingdiscoverAgentToolchain. Kept as a separate function sokit sbom --agent/kit insight(which calldiscoverAgentToolchain) are untouched.src/profile/reconcile.ts—discoverActualStatenow populatesplugins(no longernull) → plugin drift (added / removed / version) is audited. Workflows staynull— 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 freezenow snapshots discovered plugins alongside skills/mcp; operator-authoredworkflows/gates/scopeare still preserved verbatim.discoverPlugins(installed + uninstalled versions, empty/garbagepackage.json); reconcile audits plugin drift end-to-end;discoverActualStatediscovers plugins.Testing
Test Coverage
discoverActualStateassertion that plugins werenull)npm test) — full suite 2652 pass / 0 fail (2649 baseline + 3)Manual Testing
npx tsc --noEmit→ clean.npx eslint src→ 0 errors.npm run build && node scripts/test.mjs→ 2652 pass, 0 fail.npx prettier --check→ formatted.Breaking Changes
None / N/A — additive discovery;
discoverAgentToolchainand its consumers are unchanged.Checklist
npm test)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 (kitPluginsfor 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 leaveskit triage pluginand 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