Plugin Dependency Tree Resolution #230
No reviewers
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ultanio/cobot!230
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "docs/prd-plugin-dependency-tree"
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?
Summary
BMad Method product brief for the plugin dependency tree resolution feature.
Problem
Flat plugin loading causes misconfiguration crashes (e.g. #227 — headless mode crash when no loop plugin loaded).
Proposed Solution
Dependency tree resolution from declared root plugins, leveraging existing
PluginMetafields.MVP Scope
rootsconfig keyReferences
Generated via BMad Method workflow
Review — PR #230: Product Brief for Plugin Dependency Tree Resolution
Reviewer: Doxios 🦊
Verdict: ✅ Approve
Well-structured product brief. The analysis of the current flat-loading problem is accurate — I just fixed #227 with PR #228 (headless mode), and this brief correctly identifies that as a bandaid rather than a structural fix.
Strengths:
PluginMetafields (dependencies,capabilities,consumes,optional_dependencies) — no new metadata neededrootsconfig concept is clean and intuitiveenabled/disabledlistsOne note: The brief references PR #228 as "Option C" (make everything optional). That's fair — it is a pragmatic fix for the immediate lurker use case, but the tree resolver described here is the proper architectural solution.
Docs-only, no code changes. Good to merge.
Quick Review — PR #230: Product Brief for Plugin Dependency Tree Resolution
Reviewer: Doxios 🦊
Verdict: ✅ Approve
Solid product brief. The analysis of the current flat-loading gap is accurate — I just shipped the bandaid fix in PR #228 (headless mode), so I can confirm the pain this addresses.
Strengths:
PluginMetaalready has the data model (dependencies, capabilities, consumes) — the resolution engine is the missing pieceOne note: The brief is in
_bmad-output/with BMad framework files (_bmad/bmm,_bmad/core,_bmad/state.json). These framework files probably shouldn't live in the repo long-term — consider.gitignore-ing the_bmad/directory and only keeping the output artifacts.Otherwise, this is well-researched and actionable. Ready to inform implementation.
🦊 PR Review: Plugin Dependency Tree Resolution
Summary
This PR adds a dependency tree resolver to Cobot's plugin system, replacing flat list filtering with topological sorting and transitive dependency resolution. It includes comprehensive documentation (product brief, PRD, architecture, epics) and a new
resolver.pymodule with 28 unit tests.Checks
ruff check— all passedruff format --check— all formattedpytest— 1004 passed, 1 skipped, 0 failures (including 28 new resolver tests)🔴 Major: Breaking Backward Compatibility with
enabledListThe old behavior:
enabled: [telegram, web, loop](nopolicykey) → only those plugins + core load.The new behavior: No
policykey defaults topolicy: enable→ ALL plugins load,enabledlist is ignored (with a warning).This is a silent breaking change for any existing
cobot.ymlthat usesenabledwithoutpolicy. The PRD and architecture docs explicitly promise "zero behavior change" for existing configs (DD5, Section 10.4), but the implementation breaks this promise.Fix options:
enabledlist is present and no explicitpolicykey, inferpolicy: disable(matching old behavior)This needs to be resolved before merge.
🔴 Major:
.gitignoreincludes unrelated BMad working directoriesThe
.gitignoreadditions (_bmad/,_bmad-output/) are tooling-specific artifacts from the BMad Method workflow used to generate the docs. These don't belong in the project's.gitignore— they should be in the author's global gitignore or a separate commit.🟡 Minor:
registry._load_orderset via private attributeIn
__init__.py, the lineregistry._load_order = result.load_orderdirectly sets a private attribute. Consider adding a publicset_load_order()method toPluginRegistry(the architecture doc itself suggests this).🟡 Minor:
resolver.pyusesqueue.pop(0)for BFSqueue.pop(0)is O(n) per pop. For 29 plugins this is negligible, but usingcollections.dequewould be more idiomatic and O(1). Minor nit.🟡 Minor: Architecture doc contains absolute paths
docs/decisions/plugin-dependency-tree/architecture.mdcontains absolute paths like/home/doxios/.openclaw/workspace-bmad/cobot/_bmad-output/...in the YAML frontmatter. These should be relative or removed.🟢 Good: Resolver is excellently designed
The
resolver.pymodule is a textbook implementation:🟢 Good: Comprehensive test suite
28 tests covering all major scenarios: transitive chains, diamonds, cycles, self-references, policy modes, provider selection, conflict detection, and a full 29-plugin audit. Well-structured with fixtures.
🟢 Good: Thorough documentation
The product brief, PRD, architecture doc, and epics form a complete decision record. The architecture doc's plugin dependency graph and scenario walkthroughs are particularly valuable.
🟢 Good: Registry cleanup
Removing the
_resolve_load_order()TODO and_check_dependencies()post-hoc check in favor of pre-registration resolver validation is the right call.Verdict: Request Changes
The backward compatibility break with the
enabledlist is a blocker. The.gitignoreadditions should also be removed. Once those are addressed, this is a high-quality PR ready to merge.docs: Product Brief for Plugin Dependency Tree Resolutionto Plugin Dependency Tree Resolutiondocs: Product Brief for Plugin Dependency Tree Resolutionto Plugin Dependency Tree Resolution