Skip to content

Implement a lot of the remaining plugin-centric registries RFD - #270

Open
jackh726 wants to merge 4 commits into
mainfrom
pm-split
Open

Implement a lot of the remaining plugin-centric registries RFD#270
jackh726 wants to merge 4 commits into
mainfrom
pm-split

Conversation

@jackh726

Copy link
Copy Markdown
Contributor

What does this PR do?

Registry-centric plugin distribution (in-process core)

Implements the core of the registry-centric plugin distribution RFD:
a package-manager (PM) seam that plugins are discovered, fetched, and
activated through, with predicate-gated activation and dependency/user-driven
enablement.

Implemented

  • Plugin modelSYMPOSIUM.toml manifests, [defaults], unified predicates, chained [[plugins]] references, and dormancy (a gate-less registry plugin stays inactive until used).
  • PM layer (in-process)PackageId (pm, name, version), a PackageManager trait, and a flat, trust-marked PmRegistry. Three PMs: cargo (workspace deps + crates.io), path registries, and git registries.
  • Discovery + enablement — dependency-embedded plugins are discovered but gated behind the [plugins] consent axis (auto-enable / use / disable); the workspace and configured registries are trust roots, dependencies are not.
  • Commandsuse, search, status.
  • One active set — a worklist fixed-point resolves the active plugins (registry plus crate-sourced via chained refs / enablement); skills, MCP servers, hooks, and subcommands all dispatch over it.

Not yet (relative to the RFD)

  • PMs are in-process — the out-of-process JSON-RPC PM-binary protocol isn't built (PmRegistry is the seam for it).
  • Only cargo + path/git registries — no npm/pypi, no general git-repo plugin source, no plugin-defined PMs.
  • Custom predicates vended by crate-embedded plugins aren't dispatched yet (registry-defined ones are).
  • A chained edge's version requirement is recorded but not enforced (resolves against the workspace pin).
  • Policy plugins (deny-lists / approval gates) — future.
  • Predicate surface diverges by design: dropped workspace-dependency() / used() / workspace-directory(); renamed workspace()workspace-member() and file-existspath_exists (depends-on(...) + use enablement cover those cases).
Disclosure questions

AI disclosure.

  • The AI tool authored large parts of the code

jackh726 added 4 commits July 31, 2026 22:56
This is the core of the registry-centric plugin distribution RFD. It
replaces the ad-hoc plugin-source machinery with an in-process
package-manager (PM) seam and rebuilds plugin and skill resolution on top
of it.

PM layer (src/pm/):
- PackageId (pm, name, version), the PackageManager trait
  (active_plugins/load_plugin/list_deps/search/fetch, plus refresh — pull a
  registry's content, a no-op for local sources — and registry_source),
  PluginInfo, FetchedPackage, and PmRegistry — one flat set of PmInstances
  dispatched by id.pm, each carrying a `trusted` marker (registries +
  workspace are trust roots; the cargo transport over dependencies is not).
- CargoPm transport (pm/cargo/): holds an Arc<WorkspaceDeps> and drives
  the lazy, disk-cached `cargo metadata` resolution; builds crate-embedded
  plugins; searches crates.io.
- PathPm / GitPm + layout: registry instances over a local directory or a
  git repository. A GitPm delegates its reads to an inner PathPm over the
  cache dir and owns `refresh` (pulling the repo); config builds the
  registry instances directly (git -> GitPm, path -> PathPm).
- WorkspaceDeps and SymposiumDirs move out of symposium-sdk into the main
  crate (pm/cargo/workspace.rs, dirs.rs).

Plugin loading (plugins.rs):
- ParsedPlugin carries a canonical PackageId as its identity and no longer
  a manifest/base path; every source path is resolved to absolute at load.
- Registry loading goes through the trusted PM instances; crate manifests
  load leniently and merge; a bare SKILL.md and a bare crate each become a
  default plugin. A registry plugin with no dependency gate is dormant
  until `use`d.
- active_plugins — the worklist fixed-point that resolves the active plugin
  set (registry plugins plus crate-sourced ones reached through [[plugins]]
  chained references and dependency enablement) — lives here, since it's
  consumed by every facet (skills, MCP, hooks, subcommands), not just skills.

Skill resolution (skills.rs): collect_skills walks the active set; skill
identity is the hash of the on-disk SKILL.md path.

Discovery + enablement (discovery.rs, config.rs): the [plugins] enablement
axis, dependency discovery over the untrusted cargo transport, and the
sync-time consent prompt.

Predicates (predicate.rs): one unified Predicate enum + PredicateContext.

Consumers (hook, sync, subcommand_dispatch, help_render, crate_command,
crate_metadata, report, init, workspace_state, cli, bin) are migrated to
the new APIs. Fixtures are updated to the current manifest schema.

The user-facing enablement commands (use/search/status) and the design
docs follow in separate commits.
The user-facing surface over the [plugins] enablement axis and the
package-manager search, layered on the PM core:

- `cargo agents use <name>` / `--remove` / `--global`: records a durable
  enablement (workspace-scoped by default), resolving the name against a
  workspace dependency or a crates.io search first, then re-syncs.
- `cargo agents search <query>`: unions plugin-name matches from the loaded
  registry with PmRegistry::search across every instance (crates.io
  included), grouped by origin.
- `cargo agents status`: renders the enablement report — registry plugins
  (active / dormant), discovered dependency-embedded plugins by consent
  bucket, and used non-dependency crates.

Wires the three subcommands into cli.rs / the binary's logging and help
audience, and adds tests/enablement.rs plus the help snapshots that now
list them.
…layer

Rewrites the contributor docs to the shipped design: the package-manager
seam (active_plugins/load_plugin, flat trust-marked PmRegistry), the
worklist fixed-point over the PM set, absolute skill dirs and id-based
plugin identity, dependency discovery and the enablement axis. Aligns the
registry-centric-plugins RFD's predicate list and recommendations model
with what shipped and records the remaining out-of-process / plugin-defined
PM work.
Adds the cargo-agents use/search/status reference pages and updates the
configuration, plugin-definition, plugin-source, predicates, depends-on,
and crate-author guides for the [plugins] enablement axis and the
package-manager-backed registries. Updates SUMMARY.md with the new pages.
@jackh726 jackh726 changed the title Pm split Implement a lot of the remaining plugin-centric registries RFD Jul 31, 2026
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