Plugin introspection CLI and visualization #54
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Competitor
Kind/Documentation
Kind/Enhancement
Kind/Epic
Kind/Feature
Kind/Security
Kind/Story
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Scope/Core
Scope/Cross-Plugin
Scope/Plugin-System
Scope/Single-Plugin
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ultanio/cobot#54
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Cobot has 22 plugins with complex interdependencies (hard deps, extension point contracts, runtime coupling, capability provisions). There's no way to:
config?"plugin.pyto understand the structureAs the plugin count grows (vault, activity loop, etc.), this becomes unmanageable.
What We Have
PluginMetaalready contains everything needed:id,version,prioritycapabilities(what it provides)dependencies(what it requires)extension_points(contracts it defines)implements(contracts it fulfills)The data is there — we just need renderers.
Current Plugin Landscape (22 plugins)
By Layer (priority)
Edge Types
dependencyimplementscalls_extensioncapabilitySurface Coverage
loopis the central orchestrator — defines 11 extension points that most plugins implement.Proposed Solution
Phase 1:
cobot plugins inspectCLI commandOutputs the full plugin graph as JSON from the live registry:
JSON schema:
Phase 2: Web admin panel
Interactive D3.js force-directed graph in the web plugin:
Phase 3:
docs/architecture.mdAuto-generated Mermaid diagram + manually curated narrative. Regenerated on each release.
Acceptance Criteria
cobot plugins inspectoutputs valid JSON matching schema above--format mermaidproduces a renderable Mermaid graph🔌 Plugin Architecture Review — Issue #54
Issue: Plugin introspection CLI and visualization
Scope: 3 phases — CLI inspect command, D3 web visualization, auto-generated architecture docs
Architectural Assessment
1. Does it follow the plugin pattern? ✅
Phase 1 (CLI inspect): Should be a CLI extension point implementation —
implements: {"cli.commands": "register_commands"}. This is the correct pattern (same as wallet, nostr, tools CLI commands). The inspection logic should live in PluginRegistry, not in the CLI plugin itself — the CLI just wires the command.Phase 2 (D3 web viz): Already lives in the web plugin via
get_plugin_graph_data(). This is the right place — web plugin owns the visualization, registry owns the data.Phase 3 (auto docs): Should be a cron job or release script, not a plugin. Generates static Mermaid from the same graph data.
2. Does it conflict with existing plugins? ⚠️ Partial overlap
get_plugin_graph_data()already exists inweb/plugin.py(lines 189+). It generates nodes and edges (dependency, optional, implements). PR #88 addsconsumesedges.Concern: The issue proposes the inspection logic in a CLI command, but the graph data generation is currently embedded in the web plugin. This should be refactored to PluginRegistry so both CLI and web can use it. PR #77 ("move plugin graph inspection into PluginRegistry") was attempting exactly this but is currently not mergeable.
Recommendation: The correct architecture is:
PluginRegistry.get_graph_data()→ canonical source of truthweb/plugin.py→ callsregistry.get_graph_data()for visualizationcli inspect→ callsregistry.get_graph_data()for JSON/mermaid output3. Scope appropriate? ⚠️ Too broad for one ticket
The issue mixes 3 distinct concerns:
These should be separate stories with clear dependencies.
4. Alignment with Cobot philosophy? ✅
Self-sovereign introspection is very aligned — agents should be able to understand their own architecture. The JSON output for agents + visual output for humans is a good dual approach.
5. Missing from the proposal
consumesedge type — Not mentioned in the original issue but added in PR #88. The issue lists "capability" edges butconsumes(reverse direction: who aggregates what) is distinct and valuable. Should be in the spec.optional_dependenciesedges — Listed in PluginMeta but not in the issue's edge types table.surfacesfield on PluginMeta. How would this be detected? By inspecting which extension points a plugin implements? This needs design.calls_extensiondetection — The issue lists this edge type but there's no metadata for it. It would require static analysis or runtime tracing. Is this in scope?Verdict: APPROVE with revisions
The concept is sound and well-aligned. Before breaking into stories:
consumesandoptional_dependenciesto the edge type spec — Already implemented in code but missing from issuecalls_extensionandsurfacesdetection — No metadata support exists. Either add PluginMeta fields first, or defer to a future issueSuggested Story Breakdown (after revisions)
get_plugin_graph_data()to PluginRegistrycobot plugins inspect(JSON + mermaid + table)