Skip to content

Refactor CommandKnowledgeBase into a plugin architecture#1

Merged
gmpassos merged 1 commit into
masterfrom
feature/plugin-knowledge-base
Jun 4, 2026
Merged

Refactor CommandKnowledgeBase into a plugin architecture#1
gmpassos merged 1 commit into
masterfrom
feature/plugin-knowledge-base

Conversation

@gmpassos
Copy link
Copy Markdown
Contributor

@gmpassos gmpassos commented Jun 4, 2026

Replace the monolithic knowledge table + switch with composable CommandKnowledgePlugins (one per domain) producing declarative CommandKnowledge entries. Entries carry richer metadata (category, platforms, description) plus a SecurityLevel risk hint, sub-command and argument rules (ExactFlag/PrefixFlag/TokenPresent/ArgRegex/ArgPredicate), per-entry WrapperSpec and an optional refine hook.

  • analyze() returns a CommandKnowledgeResult (capabilities, risk, matched entry, notes); capabilitiesFor() kept as a convenience seam.
  • Opt-in KnowledgeRiskDetector + CommandAnalysis.knowledgeRisk surface risk without changing default security verdicts.
  • Sub-command matching uses the first non-flag argument.
  • Broader coverage: dart/flutter, archives, cloud CLIs, more git, etc.

BREAKING: removes extraExecutableCapabilities ctor param and the static wrapperCommands set; use plugins and WrapperSpec instead.

Replace the monolithic knowledge table + switch with composable
CommandKnowledgePlugins (one per domain) producing declarative
CommandKnowledge entries. Entries carry richer metadata (category,
platforms, description) plus a SecurityLevel risk hint, sub-command and
argument rules (ExactFlag/PrefixFlag/TokenPresent/ArgRegex/ArgPredicate),
per-entry WrapperSpec and an optional refine hook.

- analyze() returns a CommandKnowledgeResult (capabilities, risk, matched
  entry, notes); capabilitiesFor() kept as a convenience seam.
- Opt-in KnowledgeRiskDetector + CommandAnalysis.knowledgeRisk surface risk
  without changing default security verdicts.
- Sub-command matching uses the first non-flag argument.
- Broader coverage: dart/flutter, archives, cloud CLIs, more git, etc.

BREAKING: removes extraExecutableCapabilities ctor param and the static
wrapperCommands set; use plugins and WrapperSpec instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gmpassos gmpassos merged commit b571155 into master Jun 4, 2026
2 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

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