Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Key modules

Symposium is a Rust crate with a library (src/lib.rs) and two command binaries, symposium (src/bin/symposium.rs) and cargo-agents (src/bin/cargo-agents.rs), plus the symposium-pm-cargo package manager binary. The library re-exports all modules so that integration tests can access internals.

binary.rs: the shared main

Both command binaries are thin wrappers over binary::main(Binary, args), so symposium <args> and cargo agents <args> run the same code. cargo-agents first drops the agents argument cargo inserts when it runs cargo agents. cli::Binary names the binary that was invoked and sets clap’s bin_name from it (Binary::command, Binary::parse), so usage lines, parse errors and the help renderer name symposium or cargo agents to match. Nothing else depends on which binary ran: hook commands written into agent configs are symposium hook ... whichever binary ran init or sync. An entry an earlier init wrote as cargo-agents hook ... still runs symposium, so registering rewrites it to symposium hook ... in place and unregistering removes it, rather than leaving every event to run twice.

symposium-sdk: the shared plugin vocabulary

Depended on by both Symposium and anything that extends it. Beyond the hook handler SDK, it carries what a package manager needs to speak:

  • manifest: the unvalidated Symposium.toml schema (the Raw* types), Serialize as well as Deserialize so a manifest can travel on the wire. Retired fields (crates, source.crate, git/path chained sources) still parse, so validation can reject them with a migration hint rather than an unknown-field error. MANIFEST_FILE names the file a manifest is written in (Symposium.toml), shared by core’s registry layout and the cargo PM.
  • pm: PackageId, PluginInfo, and UnvalidatedPlugin (what a package manager answers with: Symposium validates it into a Plugin), and the PackageManager trait every package manager implements, re-exported from Symposium’s pm module; plus pm::protocol (the wire format) and pm::server (the harness that puts a PackageManager on the wire as a PM binary).
  • predicate::syntax: the predicate tree and its parsing.
  • audits: the audits file schema (RawAuditFile, RawAudit, RawRevoked, the RevokeReason codes, non-exhaustive with an Unknown catch-all so a code newer than the client still revokes), the payload Digest type, and AUDITS_DIR. It is here so the tooling that maintains an audits list reads the same format the client does; reading it leniently is the client’s policy, in audits/.
  • hook::HookAgent, manifest::HookFormat, manifest::Audience: named by manifests, so they travel with the schema. Mapping a HookAgent to its wire-format handler needs Symposium’s agent modules, so that stays behind as hook_schema::agent_event.

What deliberately stays in Symposium is validation: defaults, inline-installation promotion, dormancy, trust. The schema says what a manifest can contain; Symposium decides what it means.

symposium-pm-cargo: the cargo package manager

Its own crate, because it is its own binary. It holds everything specific to the cargo ecosystem: CargoPm (the PM), workspace (WorkspaceDeps / WorkspaceCrate / LoadedWorkspace: the cargo metadata call and its disk cache), sources + probe (RustCrateFetch: path override, workspace pin, registry, crates.io), metadata (the [package.metadata.symposium] table), and manifest::merge (layering that table with a Symposium.toml, leniently). It depends on symposium-sdk and nothing else of Symposium’s, which is the check that the boundary is real, since it could not compile if it still needed policy.

It implements the SDK’s PackageManager trait, the same trait every package manager implements, and runs two ways:

  • In-process, the default: Symposium constructs it and calls the trait directly. The cargo PM is the one Symposium cannot do without, so it should not depend on finding a second binary, and the hook path should not pay a spawn.
  • Out-of-process, as the symposium-pm-cargo binary: pm::server::run over the same type, constructed by CargoPm::from_initialize from the initialize handshake. The binary ships from the main crate (src/bin/symposium-pm-cargo.rs) so cargo install symposium installs it alongside symposium and cargo-agents; a PM the user has to install separately would be a PM that is usually missing.

CargoPmConfig (cache dir + cargo override) is what WorkspaceDeps needs from its host, built either from Symposium’s SymposiumDirs or from the initialize handshake, so the resolver has no knowledge of Symposium’s directory layout.

config.rs — application context

Everything hangs off the Symposium struct, which wraps the parsed Config with resolved paths for config, cache, and log directories. Two constructors: from_environment() for production and from_dir() for tests. Agent relocation variables (CLAUDE_CONFIG_DIR, …) are read through env_dir, which consults the process environment only for a from_environment() instance, so a test can never reach a developer’s real agent directories; tests inject one with set_env.

Defines the user-wide Config (stored at ~/.symposium/config.toml) with [[agent]] entries, logging, [[registry]] entries, defaults, auto-update (off/warn/on, default on), and the [plugins] enablement section. User config is deserialized through RawConfig and validated into the runtime Config; runtime code does not deserialize Config directly. A config that exists but cannot be read or parsed loads as the defaults with auto-update off and is recorded in config_error, so save_config refuses to write over it and sync refuses to run (see configuration loading). [[package-manager]] entries (PackageManagerConfig: name, command, args) are the bootstrap channel for ecosystems Symposium does not know natively: each a binary speaking the PM protocol, spawned as a RemotePm. An entry named cargo replaces the built-in in-process instance rather than adding a second one, which is how even the cargo PM is run out of process. A configured PM is an ecosystem transport, so it is untrusted and its plugins are validated as packages: depending on an npm package should no more inject agent context than depending on a crate does. A spawned PM inherits Symposium’s environment. SYMPOSIUM_CARGO is set explicitly, since the override lives in Symposium’s directories rather than its process environment. Provides registry_instances() to build the effective registry PmInstances directly (the builtin recommendations entry, the builtin user-plugins entry, then the configured ones): a git [[registry]] entry becomes a GitPm, a path entry a PathPm, each a trust root named for its registry (that name is what its plugins are attributed to). There is no ResolvedRegistry/content_dir intermediate: a git registry’s cache directory and its refresh live on the GitPm itself. The builtin symposium-audits list ([defaults] symposium-audits, default off until the community list exists) is deliberately not a registry instance: it is no trust root and nothing in it loads as a plugin. audits_dir() is its cache directory, in the registries’ git cache, which the audits reader reads and audits::refresh_audits fetches. package_managers(deps) prepends the fixed cargo transport (a CargoPm built over the shared deps resolver) to those to make the active PmRegistry. detached_managers() is the workspace-independent form (registry listing, crates.io search); its cargo transport is built over a detached resolver that never runs cargo metadata. The workspace_deps(cwd) factory is the standard way to create a WorkspaceDeps: it wires in cargo_override and cache_dir so callers get both the SYMPOSIUM_CARGO override and cross-invocation disk caching, and returns it as an Arc so a CargoPm can hold one.

PluginsConfig (the [plugins] section) is the config surface of the enablement axis: auto-enable (dependency names pre-consented to, "*" for all), use (UseEntry::Global(name) or { name, workspace }: the durable record of a deliberate enablement, scoped to one workspace or to all), and disable (names pruned from enablement, which is also where a declined discovery is recorded). used_names_in(root) returns the applicable use names as written. is_auto_enabled, is_disabled and is_used_in ask whether an entry names a given PackageId; an entry carries no package manager of its own, so the one owning that id decides, through PmRegistry::identity (cargo folds - and _, a registry compares exactly). has_enablement_entries is the cheap “could enablement pull in a crate plugin?” check the hook path uses to decide whether to resolve the crate graph. The lists are plain Vecs so a later symposium use can add and remove entries and call save_config.

cargo workspace resolution (in symposium-pm-cargo)

The cargo-workspace resolution is CargoPm’s, so it lives in the cargo PM’s crate: cargo metadata is cargo’s ecosystem, not a generic concern. WorkspaceDeps is the lazy, cached resolver for the cargo dependency graph: the first load() reads a disk cache keyed on Cargo.lock mtime, and on miss runs cargo metadata (extracting root, direct crates, and member dirs into a LoadedWorkspace) and writes through. The result is memoized in a OnceLock, so every accessor reads through a shared &self — which is what lets one resolver be shared as an Arc: a CargoPm holds one and drives it (self.workspace.crates() runs the metadata call). Core reads none of it: what Symposium learns about the cargo workspace comes through the PM’s list_deps and project_info (its members as local packages; as inputs, Cargo.lock and battery-pack.toml plus root_candidate_manifests: the Cargo.toml of every directory from the starting directory up to the root, reported whether or not it exists, since a manifest appearing nearer the start puts a new workspace there and no lockfile would show it). WorkspaceCrate carries path (the local dir for a path dependency) and source_dir (the extracted source cargo metadata located, populated for registry crates too), so a workspace dependency’s source is served without a fresh probe. detached() is a resolver pre-set to “no workspace” for workspace-independent operations (registry listing, search). The types re-export at crate::pm for convenience. The config-level dirs.rs (SymposiumDirs: config/cache paths + the SYMPOSIUM_CARGO override) stays in core; Symposium::workspace_deps(cwd) is the factory that turns it into the CargoPmConfig the resolver takes.

Members are recorded as member_crates, each a WorkspaceCrate whose path is the member’s directory. They back workspace-plugin discovery and crate-info on a member, and stay out of crates, so a member never reaches depends-on or discovery as a dependency.

A failed cargo metadata is remembered with cargo’s error and logged. load() reads it as no workspace, so hooks, help and the package-manager layer carry on without one; require(), used by sync, status and use, reports cargo’s error, and keeps “not in a Rust workspace” for a directory with no Cargo.toml in it or above it.

agents.rs — agent abstraction

Centralizes agent-specific knowledge: hook registration file paths, skill installation directories, and hook registration logic for each supported agent (Antigravity CLI, Claude Code, GitHub Copilot, Codex CLI, Kiro, OpenCode, Goose). Handles the differences between agents, e.g. Claude Code uses .claude/skills/, Kiro .kiro/skills/ and OpenCode .opencode/skills/, while Antigravity, Copilot, Codex and Goose use the vendor-neutral .agents/skills/, which OpenCode reads as well (reads_vendor_neutral_skills). OpenCode and Goose are skills-only agents (no hook registration).

Plugin delivery is the third axis: Agent::deliver_user_plugins(sym, plugins) reconciles one agent’s user-level installation with the compiled plugins, an empty slice removing what symposium installed for it, and returns None when the agent keeps per-skill copies instead, or a Delivery: the plugins it delivered and the ones it installed or updated. Claude Code, Antigravity CLI and Goose each take a copy of the plugin directory in a folder they read, made by deliver_copies in agents/plugin_registration/mod.rs; Codex CLI’s delivery lives in codex.rs and the Copilot CLI’s in copilot.rs. The last two register the staging root as a marketplace in their own config, and sync_marketplace_index writes its .claude-plugin/marketplace.json after compiling while either of them is configured; every other agent returns None and keeps its per-skill copies. Agent::deliver_project_plugins(sym, project_root, plugins) is the same contract for the plugins that apply to the project only: Claude Code copies them into <project>/.claude/skills/ with deliver_copies and adds a .gitignore containing * inside each, and every other agent returns None.

Hook and MCP registration is scope-dispatched: the project and global locations are genuinely different files for some agents (Antigravity writes .agents/hooks.json but ~/.gemini/config/hooks.json; Copilot .github/hooks/ but ~/.copilot/settings.json), so sync calls the project-scoped functions at project scope rather than rooting the global path at the workspace.

MCP registration is its own axis, and the one place where guessing is expensive: an agent’s MCP file is usually not its hooks file, so a wrong target fails silently - symposium reports success for a file the agent never reads. Agent::mcp_config_path(scope, project_root, sym) is the single seam holding that per-agent truth (the table lives in agent details), with register_mcp_servers / unregister_mcp_servers as the only entry points. Registration returns the names it wrote (leaving out servers an agent cannot take, like SSE on Codex), which sync and init record in the MCP ledger; unregistration takes the file from that ledger rather than a scope, and removes only what it lists. There is no separate project/global pair of functions to keep in sync. McpScope is deliberately distinct from HookScope: Antigravity, Claude, OpenCode and Kiro have a project-level MCP file, while Codex, the Copilot CLI and Goose read only a user-level one, so supports_project_mcp_scope reports when project scope is downgraded rather than writing a file nobody reads. Entry shape varies too - OpenCode needs {type, command: [bin, ...args], enabled} and rejects its whole config file otherwise, which is why it has its own serializer (opencode_server_to_json) instead of the shared {command, args} one.

Every JSON agent config goes through save_json, which replaces the file atomically (temp file plus rename, since Claude Code rewrites ~/.claude.json mid-session). The rename would replace whatever the path names, so it resolves a symlink first and replaces the target, and gives the temp file the target’s mode before writing: the file stays a link into the user’s dotfiles, and a 0600 file holding tokens stays 0600. A dangling link is an error and is left alone. The Codex and Goose files are edited in place, which keeps both without the rename, and only when an entry’s values differ from the ones the file holds: both sides are compared parsed rather than as text, so the layout an entry has in the file never reads as a change. It also keeps the user’s layout, so a committed config only shows the entry that changed: it reuses the file’s indentation and ends it with a newline, and serde_json is built with preserve_order so keys stay in the user’s order. Removing a key from a JSON config uses shift_remove, since remove would move the last key into its slot.

init.rs — initialization command

Implements symposium init. Prompts for agents (or accepts --add-agent/--remove-agent flags), hook scope, auto-update behavior, and opt-in telemetry; writes user config; and registers global hooks. Removing an agent re-runs sync in the current workspace, if any, so that agent’s installed skills are reaped there.

sync.rs — synchronization command

Implements symposium sync. Scans workspace dependencies, finds applicable skills from plugin sources, and synchronizes them into each configured agent’s skill directory. The core primitive is sync_skill_dir(source_dir, dest_dir, project_root). It copies the entire source directory (not just SKILL.md) and is change-aware: it compares source and destination content, only copying into a staging directory and swapping it in when files actually differ, so the disk shows no modifications when nothing changed and a failed copy leaves the installed one in place. Copying and comparing share one traversal, walk_tree: they have to agree entry for entry, since a comparison scan that omitted something the copier writes would see a difference on every run and turn each sync into a full recopy. That traversal follows symlinks (see dir_walk.rs), so a linked file installs as a real file and a linked directory as its contents; a broken link and a link back into the tree being copied are reported and skipped rather than failing the sync. It leaves out the git cache’s bookkeeping file (symposium_install::git::CACHE_META_FILENAME) at the root of the tree it walks: a source.git group whose URL names a skill directory is read in place from the cache entry, and that file records the last freshness check, not skill content. Per-skill copies and compiled plugins both go through this walk, so neither carries it. A configurable debounce (sync-debounce-secs, default 5s, keyed on the .symposium marker’s mtime) skips even the comparison for recently-synced skills. On each sync, scans every agent’s skills parent directory and reaps any marker-bearing subdirectory it didn’t install this time, leaving user-managed skills (which lack the marker) and symlinks untouched; installed and scanned paths are compared resolved, so a skills directory linked to another agent’s is not reaped through the link. Writes a .gitignore with * only into individual skill directories (not parent directories like .claude/ or .claude/skills/). Also provides register_hooks() for use by init, which registers only symposium’s own global hook handler; individual plugin hooks are never written into agent configs, and MCP servers are left to sync, since init has no workspace to evaluate a plugin’s gate against.

While PluginRegistry::unreadable_registries is not empty, or any package manager failed (Workspace::failed), sync skips that reap, compile keeps the plugins already staged and hands them to every agent again, and agents no longer configured keep theirs; sync warns once per registry or package manager: what could not be read offered nothing, so everything installed from it would look stale. The same one decision also holds back MCP removal, so a source that went quiet keeps its skills and its MCP entries; computing it twice is what let the two disagree (see common issues). A revocation overrides that hold-back for skills: sync resolves the active set through plugins::resolve_active_plugins, which also returns the packages withheld as revoked, and the install directories of their skills (plain and hash-suffixed names) are reaped even while the rest is held back. Those skills are listed by skills::skills_on_disk, which runs nothing from the revoked crate: it evaluates none of its plugin, group or skill predicates (a shell or custom predicate would run the crate’s code) and reads a source.git group from the git cache only, never fetching it. Their MCP servers come off the same way: the names their manifests declare (no predicate evaluated), minus any name an active plugin still declares, are unregistered from every ledger entry (state.rs), for every agent and file, user scope included, whatever the hold-back says. unregister_withdrawn_mcp_servers does that, and does it too for the MCP servers of the plugins use --remove just disabled or plugin try --remove just discarded, whose names (declared_mcp_servers reads them from a manifest) sync_disabling (the body of sync) and sync_user_plugins take as a parameter: their names come off the user-level files and this workspace’s files only, and only while cleanup is not held back, since the user-level files are the ones no project cleanup reaches.

Installs (plugins compiled and delivered for every workspace included), the reap, and agent config writes run under a blocking lock on <cache>/sync.lock, taken after resolution, so concurrent syncs (two agent sessions starting together) run one after the other instead of reaping each other’s installs. See sync concurrency.

One entry point, sync(sym, deps, update), which returns a Synced: the plugins it installed or updated for each agent, the skills it copied into or updated in each agent’s skill directory (a copy into a directory several agents share, such as .agents/skills/ or a skills directory linked to another agent’s, counts for each of them, whichever agent’s turn made it, since the directories are compared resolved), and the origin hashes of the skills it installed, per project or in a plugin enabled for every workspace. The caller supplies the WorkspaceDeps, so the hook pipeline hands over the resolver its other stages already used rather than resolving the workspace a second time. Callers: the CLI’s sync arm (after the consent prompt), use_command once an enablement is recorded, and the hook pipeline’s auto-sync. sync fails outside a workspace; sync_user_plugins(sym, ws, update) is the part of it that needs none, compiling and delivering the plugins enabled for every workspace and, with hook-scope = "global", registering their MCP servers at user level, and is what use --global runs there. The two share ensure_config_readable, resolve_custom_predicate_entries, cleanup_held_back (the hold-back rule above), reap_revoked_plugins, unregister_withdrawn_mcp_servers (a revoked package’s MCP servers), applicable_mcp_servers and register_mcp_servers (which records what it wrote in the ledger) rather than each spelling them out. Only sync attaches the on-disk predicate cache, which is kept per workspace.

sync takes an UpdateLevel that it threads into skill resolution (skills::collect_skills), controlling how aggressively source.git skill groups are re-fetched. Callers choose: the auto-sync path passes Check on SessionStart (refresh) and None otherwise (debounced); the binary’s global --update flag feeds manual symposium sync.

sync also compiles the plugins enabled with use --global for the user and, while Claude Code is configured, every other applicable plugin for the project, and hands them to each agent’s deliver_user_plugins and deliver_project_plugins; an agent gets no per-skill copies of the skills of the plugins its Delivery lists (Compiled::skill_origins_of), and unregister_user_plugins (also called by init) and unregister_project_plugins empty the deliveries of every agent no longer configured. has_symposium_marker is true only for a .symposium file, so a project’s .symposium/ staging directory never marks the project, and ignore_in_git writes a .gitignore containing * unless one exists. sync_tree, sync_plugin_dir and reap_unlisted are the directory helpers compiling and delivery share; sync_tree rewrites a directory in place only when its content differs and refuses one without the marker. An entry the copy skips is reported once per sync.

compile.rs: compiled plugins

Turns the plugins a use --global entry names (installs_globally: the package PmRegistry::identify resolves each such entry to, never a workspace member) into Agent Plugins directories under <config dir>/installed/. global_plugins collects their skills in a second pass in which every predicate holds (PredicateContext::set_conditions_met), so what they carry does not depend on the workspace that syncs, and groups them by SkillWithGroupContext::plugin_index. compile names each directory with normalize_name (lowercase [a-z0-9-], at most 64 characters, which every agent’s loader accepts, with a hash suffix when two plugins normalize alike), writes plugin.json, .claude-plugin/plugin.json, the marker and skills/<skill>/, and reaps the marked directories it did not compile. The manifest’s version comes from plugin_version: the manifest’s own version, else the version in Plugin::canonical (the release a package manager resolved, so a crate compiles under its crate version), each used only when it parses as a semantic version, else 0.0.0, which is what a registry or workspace plugin with no declared version gets, since its id carries no version. compiled_version reads it back from a compiled directory, for the one delivery that names a directory after it (Codex’s). A directory synced within sync-debounce-secs is skipped only while skill_dir_names shows the same skills, and delivery applies the same rule to each copy. project_plugins groups the applicable skills no global plugin carries by the same index, and compile_project compiles them under <project>/.symposium/plugins/ (project_plugins_root), first making sure <project>/.symposium/.gitignore exists and compiling nothing when it cannot be written. While a sync holds cleanup back, it first reaps the staged plugin of a revoked package, so compile does not hand it to the agents again.

plugins.rs — plugin registry

Loads plugin manifests from the configured registries and validates them into Plugins. Loading goes through the package-manager layer: load_registry asks each trusted PmRegistry instance (the configured registries: the cargo transport is not a trust root) for its plugins via active_plugins. A PathPm returns each entry through entry_plugin: a Symposium.toml manifest read as-is, an Agent Plugins plugin.json translated into one (see below), or a bare SKILL.md synthesized into a manifest (standalone_skill_manifest); dependency-embedded crate plugins never load here. Refreshing a git registry’s content is the GitPm’s refresh operation, driven by ensure_registries (startup) and sync_registries (plugin sync). scan_source_dir remains as the offline form used by the plugin validate CLI, which points at an arbitrary directory rather than a configured registry; it walks the same layout rules and synthesizes bare skills the same way, except that a root holding a plugin.json is read as that one package. validate_source_dir adds portability warnings (portability_warnings: a . in the name, a package without version, a hook event with only agent-format hooks) and, per skill, what sync::unfollowed_entries says the install would leave out, using the same walk the copy uses.

load_registry reads each registry through PmInstance::registry_plugins, which returns None when the registry’s active_plugins fails because the source cannot be read (a PathPm whose directory cannot be listed or is itself an entry, and a GitPm that has not been fetched). Such a registry is reported and recorded in PluginRegistry::unreadable_registries (see common issues). The answer is a PluginListing, which also carries each entry that failed to load, so a registry with an entry that fails to parse or validate is recorded there too, while its other plugins still load. plugin list and plugin show read through the same call.

plugin validate reads a directory that is itself a plugin or skill entry as that one entry, and names an entry that fails to load by its subpath. A directory whose Cargo.toml has a [package] is read as that crate instead, through CargoPm::plugin_from_fetched and PluginKind::Package like a dependency, except that a malformed manifest layer is an error rather than dropped, and a default skills/ group whose directory is absent is left out so it raises no warning.

Validation here turns the raw TOML (parsed into the SDK’s RawPluginManifest) into:

  • Installation entries (optional source, optional executable/script, optional args, plus requirements and install_commands) collected on PluginManifest.installations. Inline installation references on hooks or other installations are promoted into synthetic Installation entries with derived names (<hook> for an inline command, <owner>__req_<i> for an inline requirement), so all references in the validated form are plain names.
  • Hook entries with command: String (the name of an Installation) plus optional hook-level executable / script / args. Validation guarantees at most one of executable/script is set across hook + installation, at most one layer sets args, and a matcher other than * compiles as a regex.
  • SkillGroup and PluginMcpServer entries whose depends-on sugar and predicates list are merged into one runtime PredicateSet. Skill group source syntax is deserialized as raw string/table forms, then validated into PluginSource.
  • ChainedPlugin entries from [[plugins]]: a per-edge PredicateSet plus a source.cargo reference (dependency-atom string "widget>=1" or { name, version } table) naming the crate that carries the referenced plugin. This is the “package ≡ plugin” edge — how one plugin (e.g. a recommendations manifest) names another plugin by its package. Validation rejects git/path sources and the retired dependency-table form with hints. Expansion is wired in skills.rs: when the owning plugin is active and the edge predicates hold, the referenced crate is loaded (see important flows) — as a first-class plugin from its own Symposium.toml if it ships one, otherwise from the crate’s metadata / default-skills/ path. The recorded version requirement is not yet enforced at resolution — the crate resolves against the workspace.

The cargo PM’s manifest::merge(metadata, file, crate_name) builds a crate’s unvalidated manifest. It parses each source (the [package.metadata.symposium] table and a Symposium.toml file, both in the ordinary plugin-manifest schema) independently and leniently (a malformed layer is logged and dropped), merges them (RawPluginManifest::merge: list fields append, scalar/keyed fields take the later layer, gates AND together). When the plugin reaches validate_plugin, the result runs through the same validate_manifest pipeline under ManifestOrigin::Crate: the name defaults to the crate, the dormancy rule does not apply (the reference that reached the crate is the gate), [defaults] is accepted, and the default skills/ group is appended (but not the workspace-only .agents/skills group). A crate with neither source and no plugin.json still yields that default group. Plugin carries a required canonical: PackageId: the resolved crate id for a crate-sourced plugin, or a placeholder id tagged with the source name (registry) / "local" (workspace) for plugins with no real package identity. It keys chained-plugin cycle/diamond detection on its package identity (PmRegistry::identity); it does not affect skill identity, which is the SKILL.md path hash (see skills.rs). Every loader (load_plugin_as, workspace_plugin_for_dir, and validate_plugin) runs resolve_plugin_paths before returning, so each [[skills]] source.path group carries an absolute directory plus a display source_label, and each no-source relative script, and each relative executable with more than one component (./tool), is joined onto the manifest’s directory, while a bare executable name such as rustc stays a $PATH lookup. A joined path that cannot be written as UTF-8 fails the plugin’s load rather than keeping the relative path. So a Plugin needs no base/manifest dir, and a plugin’s own hook script runs wherever the hook is dispatched from. A Plugin carries no manifest file path: its identity is its canonical id. It also keeps the directory it was loaded from as root, read only by hook dispatch, which passes it to format = "claude" hooks as CLAUDE_PLUGIN_ROOT. plugin show renders a plugin’s effective config keyed by that id (not a re-read manifest file); plugin validate reports each item by its id/name (a failed load’s error message still carries the file it came from).

There is no separate “standalone skill” concept: a registry directory holding only a SKILL.md (no Symposium.toml) is synthesized by standalone_skill_manifest into a manifest with default values, which ordinary registry validation turns into a plugin — named for the skill’s own frontmatter name (falling back to the directory), carrying a single source.path = "." skill group that rediscovers that SKILL.md, and with the skill’s frontmatter depends-on/predicates hoisted to the plugin gate so the ordinary dormancy rule applies (a bare skill that names no dependency is dormant until used). This mirrors how a crate with no manifest still yields a plugin with the default skills/ group. So PluginRegistry holds only plugins; the plugin validate CLI likewise reports a bare skill as its synthesized plugin, whose one child is the skill. Returns a PluginRegistry — a table of contents that doesn’t load skill content.

A registry manifest that references no dependency anywhere (plugin, [[skills]], [[hooks]], [[mcp_servers]], or [[plugins]] chain edge, via depends-on, a depends-on(...) predicate, or a custom predicate) is not an error: it validates and loads with PluginManifest::requires_use = true, i.e. dormant. Plugin::applies short-circuits to false for a dormant plugin unless PredicateContext::is_used lists its canonical id, so every activation path (skills, hooks, MCP, subcommands, help) agrees. That list comes from discovery::used_plugins: the plugins an applicable [plugins] use entry names, each by its manifest name under its own package manager’s rule, so use = ["my-plugin"] wakes a registry plugin my-plugin and use = ["my_plugin"] does not. depends-on = ["*"] remains the explicit always-active spelling, and plugin validate reports dormancy as a warning. So a recommendations-registry entry, an ordinary flat plugin, stays out of dormancy by declaring its own depends-on (the crates it advises, or ["*"]). The positional origins never go dormant, because where they were found supplies the gate.

Workspace-scoped callers use load_registry_with_workspace, which additionally loads workspace plugins (workspace_plugins): the workspace root and every member the package managers report inside it (Workspace::info) each define a plugin when they carry a Symposium.toml (validated with ManifestOrigin::WorkspaceMember, under which name defaults to the directory name, membership is the gate so dormancy never applies, and the default groups are appended unless [defaults] skills = false: [[skills]] source.path = "skills" plus, when the agents-syncing config is on, a workspace-member()-gated [[skills]] source.path = ".agents/skills" (the maintainer-skills convention, unified into the ordinary pipeline)), an Agent Plugins plugin.json (translated, with its own groups in place of the default skills/ group and the .agents/skills group added back when agents-syncing is on; one that fails to translate is reported and ignored when the directory also has a bare skills folder, since the file may belong to another tool), or a bare skills/ or .agents/skills/ directory (an all-defaults manifest-less plugin). Workspace plugins are stamped workspace_member = true (the producer of the workspace-member() predicate) and attributed to the "(workspace)" source with skill paths relative to the workspace root.

plugins/agent_plugin.rs: reading Agent Plugins packages

agent_plugin_manifest(dir) translates an Agent Plugins package into an ordinary unvalidated manifest, the same move standalone_skill_manifest makes for a bare SKILL.md: one [[skills]] source.path = "skills/<child>" group per immediate child of skills/ holding a SKILL.md (the format’s one-level discovery, with no depth field in the schema), and the dev.symposium gate as the manifest’s depends-on and predicates. It checks plugin.json by hand (see common issues), keeps plugin.json, the skills folder and each SKILL.md inside the canonical package root, and reports what it ignores as warnings when the package loads; the hook path installs no report layer, so there they only reach the log. fill_from_agent_plugin gives a Symposium.toml or crate metadata beside a plugin.json the name, version and description it omits; every reader of a Symposium.toml applies it, plugin validate on the file included. For the same reason scan_source_dir reads a folder holding a plugin.json as one package even when a Symposium.toml beside it wins, rather than as a plugin source.

The callers decide what is positional: a registry entry is translated as-is, so a gate-less package is dormant, while a workspace member and a crate turn the default skills/ group off and the member adds the .agents/skills group back. A crate whose plugin.json is invalid offers no plugin, which is reported. The PM flags the result on the wire (UnvalidatedPlugin::agent_plugin), validation keeps the canonical package root as Plugin::agent_plugin_root, and Plugin::format turns it into the agent plugin label of plugin validate, search and status.

mcp.json becomes the manifest’s [[mcp_servers]], checked by hand like plugin.json: a file that breaks the format drops only the servers, a server that breaks it drops only itself, and a ./ command is resolved against the canonical package root. The ${PLUGIN_ROOT} and ${PLUGIN_DATA} placeholders stay in the manifest, because the data directory belongs to the installation rather than the package: sync passes each package’s servers through with_plugin_vars on the way to the agents, with a data directory under plugin-data/ keyed on the plugin’s canonical id, so it survives an update of the package. On Unix launched_from then wraps each stdio server in /bin/sh -c 'cd "$0" && exec "$@"', by absolute path since a server’s own PATH may leave sh out, so it starts in the package folder as the format asks, whatever the agent. The script stays clear of ${...}, which Claude Code expands in .mcp.json arguments. Windows keeps the agent’s working directory.

The two rules every source-tree walk needs once symlinks are followed, in one place.

It lives in symposium-sdk (symposium_sdk::dir_walk, re-exported in core as crate::dir_walk): the cargo PM’s crate walks package content too, and depends on the SDK alone. Any package manager scanning a source tree needs the same guard.

A live source tree (a workspace member, a path or git dependency, a [[registry]] path entry, ~/.symposium/plugins/, a git-cloned registry cache) can contain symlinks, and what sits behind them is skill content like any other. Such a tree is dereferenced rather than copied link-for-link: the destination is a different tree, so a preserved relative link pointing outside the skill directory would dangle there. Dereferencing also makes a source-tree install agree with a crates.io install, which already delivers real files (cargo package follows links, including ones escaping the package root). Links are followed wherever they point, with no containment check against the source root, except in an Agent Plugins package: sync passes Plugin::agent_plugin_root to the walk its copy and comparison share, and plugin compilation (compile::plugin_contents) to the same walk, which skips and reports every entry that resolves outside it. The skill reference records that decision and its rationale.

  • resolved_kind(path, file_type) classifies a directory entry with links resolved. DirEntry::file_type reports the link, which is neither a directory nor a regular file, and DirEntry::metadata does not follow it either; fs::metadata does. Err can only come from that follow, so it means a broken link.
  • Ancestors records the directories a walk is currently inside, by canonical path, and refuses to enter one twice. A tree of real directories cannot contain itself, so this only fires once a directory link has been followed — but every directory on the way down is recorded, since the link that closes the loop may sit several real directories below the one it names.

walk(root) is the full traversal built on both: every directory and regular file under root, relative and sorted, plus what it refused (Refused::BrokenLink, Loop, Special), so each caller decides what a refusal means. The copy/compare traversal in sync.rs skips refusals with a warning, and goes through walk_where to leave out what resolves outside an Agent Plugins package; the payload digest turns them into ineligibility. Three more walks use the cycle guard alone in skill discovery (skills::find_skill_files_recursive), registry enumeration (pm::layout::walk), and crate content detection (contains_skill_md in symposium-pm-cargo) — those three already followed directory links through Path::is_dir.

audits/ — the audits list and the payload digest

Reads what the community audits list says about a dependency plugin’s payload. The list is the builtin symposium-audits git repository, and its cache directory (Symposium::audits_dir) is the only place audits are read from: one file per package at audits/<pm>/<name>.toml (the reference has the format). AuditIndex::configured(sym) points at that directory, or at nothing while the list is off; building it reads nothing, and a lookup reads only the one file for the package asked about, cache-only. The package managers stay ignorant of audits.

The list is not a registry: it is no PmInstance and no trust root, so nothing in it loads as a plugin and it never reaches unreadable_registries. refresh_audits(sym, update) fetches it into the registries’ git cache, the same fetch GitPm::refresh does, from plugins::ensure_registries (startup) and plugins::sync_registries (plugin sync, all sources or symposium-audits by name). A failed or never-done fetch means no list: every lookup answers “not audited”, and reap and MCP removal are unaffected. The git cache debounces checks of a cached list; for a list it has never held, a failed fetch leaves a <cache-key>.fetch-failed marker beside the cache directory, and under UpdateLevel::None the fetch is not retried until the marker is older than the git cache’s DEBOUNCE_DURATION (60 s).

  • AuditIndex::lookup(pm, name, version, digest) is the lookup itself and gives exactly one Answer: Revoked(Revocation) (a [[revoked]] entry matches the version or the digest) or Verdict(Verdict) otherwise, where a Verdict is Audited (an [[audit]] digest matches), NotAudited (anything else, including no digest), or Ineligible(why) (only from AuditIndex::answer: the list audits the package but the loaded payload cannot be digested). Only a verdict has the Display wording the prompt, the hint and status show, so none of them can show a revocation in its place.
  • AuditIndex::revocation(pms, id) is the check every load route makes for a package the PMs loaded. It matches version revocations first, and digests the payload only when the file holds a digest revocation, so the hook path pays for hashing only for crates with one. AuditIndex::answer(pms, id) is the full answer for a loaded package, for discovery and status. Both find the loaded payload by fetching the id cache-only, by name first (which is how it was loaded, so a workspace dependency resolves to its overridden source), and cover cargo packages only. The digest is memoized per invocation in PmRegistry::payload_digests (an audits::DigestMemo, keyed by the loaded id and its payload directory), so the several routes one SessionStart takes (auto-sync, prewarm, the discovery and consent hints, dispatch) hash a payload once; nothing is kept on disk.
  • digest.rs computes the payload digest: the manifest sources (Symposium.toml bytes, [package.metadata.symposium] as canonical JSON) plus every file in the skill directories the manifest names inside the package, sorted and framed, under a size cap. Entries are named from each group’s source.path as written, lexically normalized (a .. or absolute path is refused), so a group that is a link digests like the materialized directory a published crate holds; the canonical path is used only for containment and traversal. What it cannot pin (a source.git group, a path leaving the package, a skill file reached through a link that leaves it, a broken link or loop, an unreadable file) is Ineligible, never a digest. It walks each group with dir_walk::walk, the walk sync copies with, but refuses what that walk reports (a broken link or loop anywhere in the group, a special file in a skill directory), since hidden content must not pass as “no skills”. The metadata’s canonical JSON is a serde_json::Value built with sorted keys. The manifest’s skill groups come from plugins::package_manifest, the same validation a crate’s plugin gets.
  • digest_command.rs is symposium plugin digest, which reports a PayloadDigest event from the same function the lookup uses.

The reader is lenient: unknown keys are ignored, a malformed entry is dropped with a warning naming it, and a file with a missing or unknown format is ignored whole. Warnings go to the log only, since it runs on the hook path.

installation.rs — sources and acquisition

Defines Source (the source = "..."-tagged enum: cargo, github) and acquire_source, which downloads / installs / clones the source and returns an AcquiredSource whose resolve_executable / resolve_script methods turn a relative executable/script name into a concrete path. The Runnable enum (Exec(PathBuf) or Script(PathBuf)) is the final form a hook command resolves to. The git submodule handles GitHub tarball acquisition and caching.

acquire_source (and the main-crate acquire_installation wrapper) take an UpdateLevel. None serves the cache without touching the network; Check/Fetch re-resolve. Hook dispatch acquires with None; the SessionStart prewarm uses Check. The three source kinds:

  • crates.io cargo: the resolved version is recorded in a current pointer (<cache>/binaries/<crate>/current). None reads the pointer and serves that version with no crates.io query — so a per-event dispatch never hits the registry. Check/Fetch query for the newest matching version, install into its version-keyed dir, and rewrite the pointer (so newly published versions are picked up at session start, not on every event). Only Fetch forces a same-version reinstall.
  • cargo + git: the cache key folds in only the URL + user version, never the resolved commit, so a moved branch never invalidates it on its own. Check/Fetch resolve the remote HEAD with a cheap git ls-remote and compare against the commit recorded in a .commit-sha file in the cache dir; the binary is reinstalled (cargo install --force) only when the SHA changed (or Fetch, or the binary is missing). None never resolves the remote.
  • github (script/subtree sources): honors the level directly via the git cache manager (freshness checks debounced to a 60s window under None).

GitCacheManager derives a github-v1-<sha256> directory name from the owner, repository, ref, and subpath. Each UTF-8 field is prefixed with its decimal byte length and a colon before hashing, preserving field boundaries and case-sensitive paths without putting source text into Windows filenames. The lowercase digest has a fixed length; metadata still records the original URL for inspection. The previous readable names were ambiguous (a/b and a--b shared a slug), so they are neither reused nor migrated. Existing directories are left untouched, but sources cached only under the old naming scheme must be fetched again; offline acquisition cannot reuse those entries. Scoped Cargo installation keeps older version directories until the replacement installer succeeds and its expected executable is a file. A successful exit without the executable falls back from binstall to Cargo, or fails acquisition if Cargo also omits it. Only a validated installation triggers removal of older directories; cleanup attempts each old directory independently and logs failures with the affected path without rejecting the new installation, since Windows may still have an older executable open. A failed or cancelled attempt to install another version leaves the previous cached version available and still reports the replacement failure. This does not make a forced reinstall into the same version directory transactional; global Cargo installs are also outside this cache cleanup policy.

Validates skill group source constraints during manifest validation: a group must set exactly one of source.path or source.git — a missing source (or an empty source = {}) is rejected, as are both together. A crate is not a skill-group source — source = "crate" (and the legacy source.crate table) is rejected with a hint to use a [[plugins]] source.cargo chained reference instead.

On the hook path acquire_installation also takes the dispatch deadline: source acquisition stops at it, killing the cargo binstall / cargo install and git ls-remote it started (symposium-install runs them through process_tree::output, not on a blocking worker), and an install_commands entry still running then is killed with its process group. Other callers pass None, wait as before, and acquire through InstallContext::in_foreground, which keeps the installers in symposium’s process group so Ctrl-C and terminal prompts reach them.

symposium_install::process_tree: stopping a command with everything it started

own_group puts a command in its own process group on Unix (a no-op elsewhere), and kill stops that group, or on Windows the process tree through taskkill /T. Hook dispatch uses both for plugin hooks and for install_commands, so a timeout cannot leave a child running that changes the workspace or holds symposium’s stderr open. output is the async counterpart of Command::output for the installers and the git probe: it captures output through temporary files, polls for exit instead of holding a thread, and when its future is dropped it kills the group or tree and reaps the direct child, so a cancelled acquisition leaves nothing running and nothing for runtime shutdown to wait on. symposium-install gives those commands a group of their own unless the InstallContext is in_foreground.

pm/ — package managers

The seam from the registry-centric plugin distribution RFD. An instance may run in-process (PathPm, GitPm, CargoPm) or as a separate binary (RemotePm, speaking newline-delimited JSON-RPC over stdio; see pm/remote.rs below). Both implement the same trait, so nothing above pm/ knows which it is talking to. A PackageId is the canonical (pm, name, version) tuple; version may still be a requirement (a semver range, or * for “no requirement”), and fetch canonicalizes it — a FetchedPackage carries the exact resolved id plus the content directory. A PluginInfo (id plus optional description) is the lightweight result of search.

The PackageManager trait is the RFD’s operation set, defined once in the SDK (symposium_sdk::pm) and re-exported here: the same trait whoever implements a PM writes against. Plugin loading has two forms, active_plugins(deps) (the plugins a PM activates for the workspace deps, as a PluginListing that also carries the entries it could not read) and load_plugin(id, update) (the plugin(s) a specific id maps to, served only from disk under UpdateLevel::None), both returning UnvalidatedPlugins; plus list_deps, project_info (the project the PM finds from the starting directory: its root, its local packages, and the files whose change means its answers may have changed), search, fetch, and refresh (pull a registry’s content; a no-op default for local/dependency sources). Every operation returns a Result. PmInstance turns a failure into an empty answer for its caller and records it (PmInstance::has_failed, collected by PmRegistry::failed and Workspace::failed), so a failure never reads as “nothing here” to the code that removes what is no longer offered. load_plugin is the exception: it is a question about one package, so a package that cannot be loaded is logged and contributes nothing, rather than stopping cleanup for its whole ecosystem. The git-vs-path descriptor plugin list shows is PmInstance::source, set by the config that built the instance rather than asked of the PM. A PM value is an instance, not just an ecosystem: a transport can fetch/load_plugin any id of its ecosystem because the id carries the source, while a registry instance fronts one configured source and enumerates its packages via active_plugins. A registry instance’s name() is the configured registry name (user-plugins, symposium-recommendations, …), which is also the pm component of every id it mints and the name its plugins are attributed to. A PM is self-contained: it holds whatever it needs to resolve its own ecosystem, so operations take no ambient context, mirroring the out-of-process shape, where a PM spawned for a workspace answers from its own state. CargoPm holds an Arc<WorkspaceDeps> and drives it (lazy, cached); PathPm holds its directory. PmRegistry is one flat set of instances: fetch / load_plugin dispatch by PackageId::pm, and list_deps / search union across all, an instance that fails contributing nothing. An answer carrying an id that names a different PM than the instance that gave it is dropped (a plugin, a dependency, a search hit) or refused (a fetch), since ids route by that component and consent and disable are keyed on it. So is a relative path, which would resolve against wherever Symposium happens to run: in a project_info (the instance’s answer fails), a plugin’s root or label_root (the plugin is dropped), or a fetched package’s root (the fetch fails). An UnvalidatedPlugin is the resolved id, the content root, and an unvalidated RawPluginManifest (plus an optional label_root, the directory resolved skill paths are displayed relative to, so a registry entry reads as path:<entry>/skills). The manifest is the point: a PM may have parsed it from a Symposium.toml, translated another ecosystem’s manifest, or synthesized one for a package that describes itself not at all, and Symposium cannot tell. The exception is an Agent Plugins package, which the PM flags (agent_plugin, omitted from the wire when false): a registry’s PathPm translates its plugin.json itself, while a package manager’s package arrives untranslated and validate_plugin translates it, since a package manager running as its own process cannot run Symposium’s translator or reach the user’s report with its warnings.

A dependency listing containing IDs owned by another package manager is incomplete: core drops those IDs and records the offering PM as failed, preserving cleanup safety while retaining valid dependencies from the other PMs.

Whether two names are the same package is the PM’s rule too: asynchronous canonical_names normalizes a batch, delegating to the synchronous canonical_name default for in-process implementations. CargoPm folds - into _, as cargo does; a registry (PathPm, and GitPm through it) keeps the default and compares names exactly. PmRegistry::identity awaits that normalization and maps an id to that form with the version dropped. PmRegistry::find resolves a name typed into [plugins] or symposium use to the package it names, under the name its package manager has it (the crate widget-lib for widget_lib): a registry plugin of that name under its registry’s rule wins; otherwise each PM is asked through PmInstance::find whether it has a package of that name, and the first that does answers. PmRegistry::identify is the identity of what find answers. find is built from the operations every PM has, so no PM implements it and the protocol has no request for it: a dependency of that name (list_deps), otherwise a package already on disk (a cache-only fetch; for CargoPm, a crate in cargo’s extracted sources, probe::find_cached), and, above UpdateLevel::None, otherwise one its search turns up. A registry’s packages are the plugins it lists, which find already holds, so a trusted instance has none to find. find takes that level from its caller, following the same split as crate loading: hook dispatch, --help, subcommand dispatch and status pass None, so they never search crates.io or spawn cargo, while use, use --remove and sync pass Check, which reads the cargo cache first and searches only for a crate that is not cached. A name no PM has is an error (no package named ...), never a crate assumed to exist. use, use --remove, status and enabled_dependencies compare and dedupe these identities rather than raw names, while use and enabled_dependencies load what find answers, since an identity’s folded name is not one cargo can fetch.

Turning an UnvalidatedPlugin into a Plugin is PmInstance’s job, via plugins::validate_plugin: schema validation, inline-installation promotion, default content, dormancy, and resolving source.path groups against the plugin’s root all happen there. Each PmInstance carries two flags, both Symposium’s to set and neither anything a PM says about itself:

  • trusted: whether consent is needed. Registries and the workspace are trust roots; the cargo transport (over dependencies) is not. This is the distinction consumers branch on (registry loading takes only trusted instances; discover takes only the untrusted cargo transport).
  • kind: PluginKind: which validation policy applies. Registry (must name itself, [defaults] rejected, dormant with no gate) or Package (id supplies the name, the reference that reached it supplies the gate, default skills/ group appended).

So a package manager cannot make itself trusted or wake a dormant plugin by what it returns. A package’s manifest can still turn off the default skills/ group with [defaults] skills = false, since that is part of the package schema. A registry plugin that fails validation is reported, naming its directory, since fixing it is the user’s job; a package’s failure is only logged, since it is its author’s, and a report on the hook path would land next to the agent’s JSON. Symposium::package_managers(deps) builds the set: the cargo instance (trusted = false, in-process unless a [[package-manager]] entry named cargo displaces it), then any other configured [[package-manager]] (trusted = false, spawned), then one registry instance per configured registry (trusted = true: a GitPm for a git entry, a PathPm for a path entry). Names are what ids route by and [plugins] entries are keyed on, so a [[package-manager]] name must be a plain identifier no other package manager or registry has, or the config is rejected at load (RawConfig::check_package_manager_names). detached_managers() uses a detached resolver for workspace-independent work. workspace_dep_ids(sym, deps) unions list_deps and degrades to empty on failure. CargoPm (symposium-pm-cargo, in-process by default): fetch delegates to sources::RustCrateFetch (path override, workspace pin, registry); list_deps reads self.workspace.crates() as cargo ids, failing (rather than answering empty) when a Cargo.toml is present but cargo metadata failed; active_plugins(deps) returns (via the shared plugin_from_fetched) each dependency whose source embeds plugin content (a Symposium.toml, [package.metadata.symposium], a plugin.json, or the default skills/), served from the source cargo metadata already extracted (no probe); these are dependency-embedded, so the caller applies consent; load_plugin(id) returns the named crate whatever it embeds (any fetchable crate yields a plugin, except one whose only manifest is an invalid plugin.json), fetching a crate outside the workspace through cargo the first time and from cargo’s cache after that; search queries crates.io (crates_io_api, capped at SEARCH_PAGE_SIZE) so use/search can name a crate the workspace doesn’t depend on. CargoPm also owns crate-to-plugin resolution:

  • plugin_from_fetched(fetched) -> UnvalidatedPlugin builds the unvalidated plugin for a fetched crate from its manifest sources ([package.metadata.symposium] in Cargo.toml and a Symposium.toml at the source root) layered by manifest::merge (see important flows), or, with neither source but a plugin.json, an empty manifest flagged agent_plugin, which validation translates from that Agent Plugins package. The plugin’s id is the resolved crate. A crate with no manifest sources and no plugin.json still yields one carrying an empty manifest, which validation turns into a plugin whose only content is the default skills/ group, so load_plugin returns a plugin for any fetchable crate (a failed fetch is an error, recorded against the instance). The default group is appended by validation, not by the PM: defaults are policy.

Workspace is the per-invocation handle threaded above pm/: the PM set plus the two facts about the workspace everything needs, both the package managers’ answers, each resolved once and cached. info() is where the workspace is: the project the package managers find from the starting directory (for a hook, the payload’s cwd, see hook flow), as root, members and inputs. Where a project is rooted is each ecosystem’s own rule, so only a package manager can say; every one that finds a project must report the same root, and a disagreement is an error (require_info) rather than a choice. Members outside the root are dropped, since their plugins would be trusted. dep_ids() (from list_deps) is what it depends on. A package manager that fails to answer is recorded (failed()): its silence is not an empty answer, so sync skips its cleanup. reuse takes the workspace and dependencies recorded at the last sync instead of asking, which is how a hook event with nothing changed avoids asking (or spawning) any package manager. Symposium::workspace(cwd) is the single construction point, so one invocation shares one PM set; that matters little when every PM is in-process and rebuilding the set is nearly free, and a great deal when one is a subprocess and rebuilding means respawning.

A package manager that fails to describe the project is left out, and the others decide where the workspace is. Failing the workspace instead would let one broken package manager (a missing binary, a Cargo.toml mid-edit) stop syncing for every ecosystem. The cost is accepted knowingly. Had the failed one answered, it might have disagreed about the root, which is an error; while it is down, skills install where the others put the root, and because its failure skips cleanup, they stay there once it recovers and the disagreement stops syncing. That needs a failure and a disagreement at once, and it leaves extra skills behind rather than removing wanted ones. The sync is still recorded, so the failed package manager is asked again at the next SessionStart, a manual sync, or a change to another input, rather than on every event, where a hung one would cost its timeout each time.

Callers stay ignorant of crates: skills.rs hands over a dependency name and gets back a parsed plugin. Consumers: chained-reference expansion in skills.rs calls load_plugin; crate_command.rs builds ids with CargoPm::id_for and fetches through PmRegistry; every dependency-list site (hook dispatch, sync, help rendering, subcommand dispatch, skill matching) gets its PredicateContext deps from workspace_dep_ids. Sync helpers that used to take &[WorkspaceCrate] and resolve deps themselves (help_render::render, subcommand_dispatch::find_subcommand) now take an already-resolved &[PackageId], so only the async entry points touch the PM layer.

One registry-instance PM exists today, reading content that is already on disk:

  • pm/layout.rs, the packaging convention it reads: classify(dir) (a directory with a Symposium.toml is a plugin entry, one with a plugin.json an agent plugin entry, one with a SKILL.md a bare-skill entry loaded as a default plugin, in that order of precedence) and enumerate(root) (recursive walk that does not descend into a claimed directory, sorted, erroring when the root is itself an entry, and skipping a directory holding the .symposium marker file, so an installed copy is never read back as a source). A directory holding a Claude Code plugin’s .claude-plugin/plugin.json and nothing classify claims is skipped with a warning and not descended into: walking it would read .claude-plugin/plugin.json as a broken Agent Plugins package, which leaves the registry incomplete and so stops sync’s cleanup for all of it, and would load the plugin’s skills as unrelated plugins. The layout carries no dependency information: an entry declares which dependencies activate it through its own manifest depends-on. Interpreting an entry’s manifest stays in plugins.rs.
  • pm/path.rs — PathPm — one local directory in the flat layout: ~/.symposium/plugins/, a [[registry]] path entry, or the git cache directory a git registry unpacks into (serving as a GitPm’s inner reader). Its ids name the entry’s subpath within the source. active_plugins returns every entry (via plugins::entry_plugin), load_plugin(id) the entry an id names, fetch joins the subpath back onto the directory, and search substring-matches entry names. Its source() is the Path descriptor its instance carries. A registry is a trust root, so its plugins activate without consent; entry-load failures surface as report warnings.
  • pm/git.rs — GitPm — one [[registry]] git entry. Once fetched, a git repo is just a directory, so the reads (active_plugins / load_plugin / search / fetch) delegate to an inner PathPm over the cache directory; the git-specific part is refresh, which pulls the repository (Symposium skips it for an entry whose auto-update is off unless the user names it), and its source() is the Git descriptor. Its active_plugins fails until the repository has been fetched, so an unfetched registry is unreadable rather than empty. The builtin symposium-recommendations repo is such a registry (an ordinary flat registry — each entry names the crates it advises with its own depends-on, so no namespacing or dedicated convention is involved).

pm/remote.rs: out-of-process package managers

RemotePm implements PackageManager by spawning a PM binary and speaking the SDK’s protocol to it over stdio. Two properties it exists to hold:

  • Lazy spawn. The process starts on the first operation that needs it, not at construction, so a configured PM that nothing asks about costs nothing. On the hook path, an event whose package-manager inputs are unchanged since the last sync asks no PM where the workspace is or what it depends on, so no PM is spawned unless a package it owns has to be loaded; and when one is asked, the cargo PM’s Cargo.lock-keyed disk cache lives inside it, so it holds either side of the boundary. A spawn is not free, which is why the cargo PM runs in-process by default.
  • Degrade, never abort. Failing to spawn, failing the handshake, dying mid-request, timing out, or answering with garbage all fail the operation, which PmInstance records and turns into an empty answer: one broken PM never breaks a sync or a hook, and its silence is never mistaken for an empty answer. A PM that failed this way is killed and marked unavailable rather than respawned per call, and a dropped connection terminates its whole process tree (a Unix process group or Windows job object, managed with process-wrap) and schedules reaping, so a PM stuck mid-answer never outlives the invocation. The connection is marked unavailable before initialization or a request starts, so either future abandoned midway (dropped) leaves the PM unavailable rather than a connection whose next read is the abandoned answer. An error response is different: it is the PM answering, so the call fails and the connection stays up. Transport failures carry a typed Unavailable context that PmInstance records even during package lookup and load_plugin, so a PM that dies after listing dependencies still prevents stale-skill and MCP cleanup. A valid package-specific error response does not block that cleanup. One plugin in an answer that does not decode is dropped on its own.

RemotePm sends canonical_names batches to the owning PM and caches the returned name mappings for its connection’s lifetime. Every PM must implement this operation; the SDK’s default returns names unchanged for exact comparison. Both returned package names and user/configuration entries go through the same rule. A failed or malformed normalization marks the PM failed, prevents cleanup, and cannot bypass a disable entry. A name mismatch at handshake is a hard failure, not a warning: ids route by their pm component, so a PM answering to a different name than it was registered under would silently misroute every id. Protocol-version negotiation is strict for the same reason.

Remote requests normally allow thirty seconds. During execute_hook, all PMs share one two-second absolute deadline, including initialization and later calls, so failed remote work leaves time for healthy local plugins and output serialization within ten-second agent deadlines. Expiry follows the PM failure path; it does not discard the entire hook response.

The wire format and the server harness live in the SDK, since a PM author needs them: symposium_sdk::pm::protocol (JSON-RPC 2.0, newline-delimited, initialize / canonical_names / active_plugins / load_plugin / list_deps / project_info / search / fetch / refresh, one request at a time) and symposium_sdk::pm::server (implement the trait, call run with a factory that builds the PM from the initialize parameters). initialize carries the per-invocation context (workspace, cache dir) so no later method takes ambient context. With a long-lived process the workspace is fixed for the connection, which is why list_deps has no parameters. A PM’s stderr is logged at debug level rather than passed through, since on the hook path Symposium’s own stderr reaches the agent. tests/remote_pm.rs drives real subprocesses, including the failure modes.

plugin_import.rs: Claude Code plugin import

Backs symposium plugin import. import_claude_plugin(source, out) writes <out>/<name>/ as an Agent Plugins package: a plugin.json built from .claude-plugin/plugin.json (name normalized to the package name rule), the plugin’s other files copied with sync’s copy_dir_recursive, each commands/*.md rewritten as skills/<name>/SKILL.md, and a Symposium.toml only when hooks/hooks.json or .mcp.json yield entries. Hooks keep Claude’s wire format (format = "claude") and run their original shell command through sh -c; they rely on hook dispatch setting CLAUDE_PLUGIN_ROOT from Plugin::root, so nothing is rewritten at import time. Whatever cannot be carried over is reported as a warning rather than failing the import. The binary then validates the result with validate_source_dir, which treats a root that is itself an entry as that entry.

crate metadata (in symposium-pm-cargo)

metadata.rs extracts the [package.metadata.symposium] table from a crate Cargo.toml and returns it verbatim as a toml::Table. That table uses the same schema as a Symposium.toml plugin manifest — a crate can define its plugin inline in Cargo.toml instead of (or in addition to) shipping a file. manifest::merge deserializes the table and merges it with any Symposium.toml; validation happens later, on the other side of the PM boundary, when the resulting plugin reaches plugins::validate_plugin. There is no longer a separate crate-metadata skill schema: the old path = "..." / crate = {..} redirect forms are now ordinary [[skills]] source.path groups and [[plugins]] source.cargo chained references.

predicate.rs: predicate evaluation

The predicate syntax (the Predicate tree, both surface spellings, parsing, Display, and serde) lives in symposium_sdk::predicate::syntax and is re-exported here, so crate::predicate::Predicate still names the same type. The split lets a manifest carry predicates without linking evaluation. Evaluation is the PredicateEval extension trait, an extension trait because the types are foreign.

The syntax covers both dependency-graph matching and runtime/environment gating: one Predicate enum, PredicateSet (a list ANDed together), and this module’s PredicateContext (the workspace dependency list it evaluates against, PackageIds from the package-manager layer’s list_deps, plus the canonical ids of the use-enabled plugins that wake dormant ones, threaded in with with_used and read by is_used, plus the directory shell and a relative path_exists run in, set with with_cwd from the workspace’s starting directory). Two surface syntaxes lower to the same tree:

  • The depends-on field uses dependency-atom syntax (serde, serde>=1.0, *) and lowers, via DependsOnList, to depends-on(...) / depends-on(*) predicates OR-combined into a single any(...) that is appended to the same list. So depends-on is sugar — there is no separate dependency-predicate type.
  • The predicates field uses function-call syntax: depends-on(<atom>), shell(<cmd>) (verbatim arg, sh -c, exit 0 holds), path_exists(<arg>) (disk, then $PATH for bare names), env(<name>[=<value>]), workspace-member() (the plugin is defined by a member of the active workspace — provenance stamped per plugin into PredicateContext via Plugin::applies; registry loading stamps false, workspace-plugin loading stamps true), and the combinators not(<p>), any(<p>, …), all(<p>, …). The retired crate(...) spelling is rejected with a migration hint, as are the old crates fields.

Each gated struct (plugin, skill group, skill, hook, MCP server, subcommand) stores a single merged predicates: PredicateSet. Evaluation is PredicateSet::evaluate(ctx) -> bool — a predicate is purely a boolean gate. A depends-on atom matches a dependency by exact name; a version requirement is checked when the dependency id’s version component parses as semver. collect_dep_names (crates.io validation) walks all positions regardless. Plugin/group/skill/MCP predicates are evaluated at sync time; hook dispatch evaluates the plugin-level set (so a plugin’s depends-on now gates its hooks) plus the hook-level set. Hook dispatch threads in the workspace crate list, but resolves it (running cargo) only when some plugin- or hook-level predicate references a concrete depends-on(...), or there is crate-plugin expansion to perform — a chained [[plugins]] edge or a [plugins] enablement entry (hook_dispatch_needs_deps) — since expansion evaluates predicates against the crate graph too. A workspace whose plugins have none of these dispatches without a cargo query. See the predicates reference.

skills.rs — skill resolution and matching

Given a PluginRegistry and workspace dependencies, this module resolves skill group sources, discovers SKILL.md files, and evaluates dependency predicates at each level (plugin, group, skill) to determine which skills apply. It also owns active_plugins — the crate-expansion walk that produces the shared active plugin set every facet resolves over (see below) — so the same seam that resolves skills also feeds MCP-server, hook, and subcommand dispatch. Every source funnels through one seam: resolve_group_dirs turns a group into a list of ResolvedSkillDir (a base directory + report labels), then collect_skills_from_dirs scans each base for SKILL.md files. PluginSource has exactly two variants — Path (already on disk, relative to the plugin’s source dir) and Git (fetched via the git cache); a source is required, so there is no “no source” state.

The single seam every facet resolves over is active_plugins: it returns the full active set: every registry plugin whose gate holds (cloned), followed by the crate-sourced plugins transitively reached through [[plugins]] chained references and dependency enablement. Skills, MCP servers, hooks, and subcommands all iterate this one list, so a crate-sourced plugin’s extensions dispatch exactly like a registry plugin’s. Crate loading takes an UpdateLevel: on the per-invocation paths (--help, subcommand dispatch, hook dispatch) it is None, under which CargoPm reads a crate that is not a workspace dependency only from cargo’s extracted sources, so building the set never spawns cargo on the per-event hook path. sync passes Check and crate-info fetches with Check, so those two download a crate that is not cached yet.

active_plugins is a worklist fixed-point over the PM set (pms). It seeds the active set with the trust-root plugins the registry loaded (registry.plugins, each gated by record_active), then works a queue of PackageIds: each active plugin’s [[plugins]] chained source.cargo references (edges whose predicates hold, evaluated against the owning plugin’s provenance) plus the consented enabled-dependency ids (below). For each id it calls pms.load_plugin(id), dispatched to the owning PM (the cargo transport builds the crate as a first-class Plugin from [package.metadata.symposium] + Symposium.toml + defaults), drops it when the audits list revokes it (plugins::withheld, the one place a revocation is enforced at activation, since every package reaches the active set through this loop), gates each result, records it, and enqueues its own edges. A visited set keyed on the package identity (PmRegistry::identity, so the owning PM decides which spellings are one package) collapses diamonds (a crate reached two ways loads once, so its hooks don’t double-fire and its subcommands aren’t a false conflict) and breaks cycles; the finite crate universe bounds termination, so there is no depth cap. collect_skills then walks the active set and runs each plugin’s skill groups through the ordinary load_skills_for_group pipeline; each discovered skill’s install identity is the hash of its on-disk SKILL.md path (below), so a crate reached two ways dedupes to one install. A crate plugin’s custom predicate definitions are the one facet not yet wired in: warn_undispatched_crate_features logs when a crate declares one.

The enabled-dependency ids seed the same worklist: discovery::enabled_dependencies names the packages covered by [plugins] auto-enable or an applicable use entry (both the workspace deps it enables and the used packages that aren’t deps at all), and each is pushed as the id of the package manager that has it, so a crate’s skills/ (or manifest) installs with no plugin manifest anywhere pointing at it. A use entry naming a plugin a configured registry provides (including a dormant one it wakes) counts for that plugin alone: it neither enables a dependency of the same name nor fetches one from crates.io. This is where consent lands: enabled_dependencies reads the [plugins] config, so only consented crates enter the worklist. workspace_root is a parameter because both this and the use-name context are scoped per workspace.

Production sync shares one PredicateContext across the skill and MCP passes, so it calls active_plugins then collect_skills directly rather than the skills_applicable_to convenience wrapper (which builds its own context and is test-only).

Each applicable skill carries an origin hash (a String) describing where its bytes live, used at sync time for dedup and install-path disambiguation. skill_origin_hash computes it as an 8-hex-char prefix of SHA-256 over the SKILL.md’s canonical on-disk path — nothing else. Identity is the file’s location, not which plugin manifest pointed at it: two references that resolve to the same file (the same crate reached through two chained plugins, or two source.path groups landing on the same bundle) produce the same hash and dedupe; skills at different paths stay distinct. Canonicalizing inside the hash is what makes that hold across discovery paths, since group scan dirs are canonicalized inconsistently — so on a platform whose temp prefix is a symlink (macOS /var → /private/var) the same file would otherwise hash two ways and install twice.

Because the hash is the dedup key itself, a 32-bit collision between two genuinely distinct paths would silently drop one skill (rather than clashing loudly at install time) — a deliberate trade for carrying only a string, not a structured origin, to the sync layer.

sync prefers the plain <agent-skills-dir>/<skill-name>/ and only falls back to <skill-name>-<origin-hash>/ when needed: when more than one of the skills copied into that directory claims the same name, or when the unsuffixed slot is already occupied by a user-managed directory (one without the .symposium marker). The suffix is an 8-hex SHA-256 prefix for every origin kind. The .symposium marker, wildcard .gitignore, and stale-cleanup walk all key on the marker file rather than directory name shape, so transitions between unsuffixed and suffixed names self-heal across syncs.

The skill name comes from plugin content and becomes that directory name, so it is untrusted input: load_skill rejects any name is_safe_dir_name refuses (one that could resolve outside the skills directory), and the skill fails to load instead of being installed. Agent::project_skill_dir and global_skill_dir assert the same check before joining the name.

discovery.rs — dependency discovery and enablement

Enablement is the second axis alongside activation predicates: predicates say when a plugin applies, enablement says whether it may run at all. The workspace and the configured registries are trust roots; a dependency deliberately is not, since depending on a crate should not let its author inject agent context. So a plugin embedded in a dependency runs only with consent, and a registry plugin with no gate to infer stays dormant until named. The two trust roots are loaded and gated directly (registry plugins by load_registry + Plugin::applies, workspace plugins the same way), so they never reach discovery. What discover classifies is exactly the untrusted offers: the dependency-embedded plugins a transport (CargoPm) surfaces. The trust boundary is structural: a positional registry entry (an offer with a subpath) is loaded directly, while a dependency-embedded offer (no subpath) is the consent path’s concern.

discover(sym, ws, registry) takes the workspace root from the handle (nothing to discover outside a workspace) and asks the untrusted instances (the ecosystem transports) for their active_plugins(dep_ids): the plugins embedded in the workspace’s dependencies (fetched cache-only into the already-extracted source, no probe). Each offer’s audit answer is looked up once (AuditIndex::answer, cache-only: it digests the payload only when an audits file names the crate) and split: a revocation goes to decide, a verdict is kept on the DiscoveredPlugin as audit (None for a revoked offer, declined or not, and for every offer when no list was read, AuditIndex::is_read: the list off or never fetched, so a “not audited” would claim a check that never happened), so the prompt, the hint and status all show it without a second lookup. Each is then classified by decide against [plugins] on its crate name and that revocation (Used, Declined, AutoEnabled, Revoked, or Candidate) and lands in the matching field of the returned Discovery (active / auto_enabled / candidates / declined / revoked). disable is tested first, then a revocation, which outranks use and auto-enable, so a revoked offer is never a candidate and the SessionStart hint never names it. An audit does not change the classification: an audited offer nobody consented to is a candidate. A use entry counts as Used only for the package it resolves to (resolve_used, through PmRegistry::identify), so one naming a plugin in registry leaves a dependency of the same name undecided. Explicit decisions outrank standing ones, so a declined name stays declined. Discovery writes nothing; the trusted registries are skipped, since their plugins are trust roots and never need consent.

enabled_dependencies(sym, pms, registry, dep_ids, workspace_root, update) is the activation side, consumed by plugins::active_plugins and status_command.rs: the package ids to load, that is, workspace deps from every configured ecosystem that auto-enable or an applicable use entry enables, plus the packages use entries name that aren’t deps at all (so symposium use <crate> pulls a plugin from crates.io whether or not you depend on it), minus the disabled ones. Each use name goes through PmRegistry::find at update, which gives the id to load, and a dependency counts as used only when an entry resolves to it: one naming a plugin in registry is left out, since that plugin is loaded already and used_plugins wakes it, and enables no dependency of the same name; one no package manager has is skipped with a warning in the log. Under None that includes a crate cargo has not cached yet, which the next sync downloads. status lists such an entry as dormant. auto-enable contributes only deps: it is consent for what a dependency carries, not a way to add crates. It reads config rather than the offer list, so a name works even before its source has been fetched.

On top of that read side sits the consent write side. prompt_for_consent(sym, deps, out) asks one question per candidate (from pending_candidates, so one per name) (enable / ask me later / never ask again). The question (consent_question) names what the plugin provides and its audit answer, in the Display words of audits::Verdict that status and the hint use too: audited by the `symposium-audits` list, not audited, or, when the list audits the crate but this payload cannot be digested, not audited: ... because it <reason> (Ineligible::brief). The answer changes neither the choices nor what they record. apply_consent records the answers — approvals into auto-enable, declines into disable, saved to the user config. Each decision keeps its discovered PackageId until recording compares it with existing entries through that workspace’s PM registry; the owning PM’s name rules determine duplicates. The config stores the name. Only explicit answers are recorded: the default (“ask me later”) and Escape write nothing, so reflexively hitting Enter never permanently declines anything.

The prompt is inert unless out.is_interactive() — a non-quiet, non-capturing Output attached to a terminal on both ends. That is the whole safety property: hook dispatch and anything an agent triggers run with a quiet output, and the library test harness runs with a capturing one, so neither can reach stdin. A bare TTY check would not do, since cargo test inherits the developer’s terminal. The only caller is the Commands::Sync arm in cli.rs — the hook-triggered auto-sync path calls sync::sync directly and never passes through it. pending_candidates is the non-interactive counterpart: it returns the candidates themselves, one per name, so hook.rs’s consent_hint renders each with its audit answer into SessionStart context and the agent can tell the user, without symposium ever blocking.

use_command.rs / search_command.rs / status_command.rs — the enablement commands

The user-facing surface over discovery and [plugins].

use_command records enablement. use_plugin resolves the name with PmRegistry::find, so a name no package manager has (not a registry plugin, a workspace dependency, or a crate in the cargo cache or on crates.io) is refused with no package named ... and nothing is written. A name a configured registry offers is a no-op, since registries are trust roots, with dormant plugins the exception, since use is exactly how they wake. A disabled name is refused, and so is a crate the audits list revokes (AuditIndex::revocation on what pms.load_plugin loads at Check), since either would outrank the entry and load nothing. That load, and the entry it then records, take the package PmRegistry::find answers with, under the name its package manager has it, and not the identity identify returns: an identity carries the name folded for comparison, and cargo fetches a crate from the registry only under the name it is published as. So use widget_lib records widget-lib, which the per-event paths, which never search, find in the cargo cache. Otherwise it pushes a UseEntry (workspace-scoped by default, Global with --global) and saves. Both it and remove_plugin re-run sync::sync afterward, so skills install or are reaped immediately; outside a workspace, where only a --global entry can be recorded or removed, they run sync::sync_user_plugins, so the plugin is installed for the user, or removed, there too. remove_plugin first takes the plugin the removed entry names, from the loaded registry when a configured registry offers it and otherwise loaded cache-only by its package manager, and hands the MCP server names it declares to that sync (sync_disabling in a workspace), which unregisters them. Both compare existing entries by the identity each resolves to, falling back to the exact spelling for a name no package manager has. remove_plugin matches on scope and errors when nothing matched rather than silently succeeding. It also drops the auto-enable and disable entries naming the plugin, in either scope, which is how a consent prompt answer is undone: each is compared the way PluginsConfig compares it, against the package the name resolved to and every workspace dependency the name names, each under its own package manager, so a registry plugin of the same name does not hide the dependency the answer was about, and those dependencies’ MCP servers are withdrawn too. A "*" entry is never dropped. Nothing matched means none of the three lists names it. use on a disabled name points at use --remove, unless a "*" entry disables it. A global entry it removes also leaves trial-use, so plugin try --remove never takes an entry the user wrote again.

search_command unions two arms: plugin names in the loaded PluginRegistry (bare skills included, since they are now plugins) and PmRegistry::search across every instance (which matches registry entry subpaths, e.g. a skill’s directory name). A PM without a searchable registry returns an empty list and a failing instance is skipped, so an offline registry degrades the results instead of failing the command. Hits are grouped by originating instance for display; the SearchMatch report event carries the origin for the JSON form. A second-arm hit with the same origin and name as a first-arm one is dropped. A first-arm hit takes its version, description and format label from the plugin.

status_command renders the enablement report. workspace_status walks the registry plugins (root: workspace membership, use, or the registry name; state from Plugin::applies plus the requires_use gate), which is where every recommendations-registry plugin appears, then every Discovery bucket of dependency-embedded plugins (Used / AutoEnabled -> active with that root, Candidate -> awaiting consent, Declined), then the used crates that aren’t dependency offers (from enabled_dependencies, e.g. use-ing a crate the workspace doesn’t depend on, otherwise invisible to discovery; a workspace dependency there offers no plugin, so it is shown only when a use entry names it, as dormant), then, as dormant, any use name no package manager has at UpdateLevel::None, then any [plugins] disable name discovery never saw. Status resolves names at None, so it never searches crates.io. The five StatusState values (Active, Dormant, Candidate, Declined, Revoked) are the report’s vocabulary; a revoked line’s root is the Revocation sentence (the list and the reason), and every other dependency plugin carries the verdict discovery looked up in StatusEntry::audit (a Verdict, so never a revocation) (rendered after the root, and in JSON as audit, in the same words as the prompt). A used crate that is not a dependency is looked up after a cache-only fetch, so it can show as revoked or audited too; like discovery, status shows no verdict when no list was read. A registry or workspace row carries the manifest’s version and format; a dependency row carries its format too.

try_command.rs: trying a local plugin

symposium plugin try installs a plugin an author is writing through the ordinary delivery, so it holds whatever sync delivers. try_plugin loads the directory as one registry entry (plugins::entry_plugin + validate_plugin), links it into the builtin user-plugins registry as ~/.symposium/plugins/<name>, records a UseEntry::Global for the name when the plugin is dormant and has none, noting in state.toml that the trial added it, records there the MCP servers it declares, and syncs: the current workspace through sync, or outside one the user level alone through sync_user_plugins, as use --global does there. A gated plugin gets no entry, so it activates exactly where it would for its users; report_gate names its dependencies. A plugin with a global use entry, the trial’s or the user’s own, skips that step and is reported as tried in every workspace, since sync installs it whatever its gate. The link is the trial: only a symlink in that directory counts as one (Slot), so a user’s own plugin directory is never replaced or removed. remove_trial finds the link by the directory it points at or by name, loads the plugin through it, removes it (and ~/.symposium/plugins/ when that leaves it empty), drops the global use entry only when state.toml says the trial added it, whatever the manifest says by then, and syncs the same way, handing the MCP server names the loaded plugin declares and those state.toml recorded to sync_disabling or sync_user_plugins so its MCP servers come off with what it installed for the user and in the current workspace, even when its directory is gone and the load fails; other workspaces are reaped by their next sync. After syncing in a workspace, report_loaded keeps the plugin’s skills (skills::skills_on_disk) whose origin is among the ones sync installed (Synced::skill_origins), so try never evaluates a gate itself and cannot disagree with sync about one. With none left it warns that nothing is installed here; otherwise it runs each configured agent’s own read-only listing (listing, parsed by listed, which for Codex accepts a skill both bare and as <plugin>:<skill>, the form it lists a delivered plugin’s skills in, under the name compile::normalize_name gives the plugin) through Symposium::agent_command, which in the test constructor resolves binaries only from <root>/bin, so tests never start a real agent. Plugin commands otherwise run in the binary; try runs through cli::run so the test harness can drive it.

subcommand_dispatch.rs — plugin-vended subcommands

Routes the Commands::External arm of clap’s allow_external_subcommands. dispatch_external first resolves the active plugin set (skills::active_plugins), so crate-sourced subcommands dispatch too; find_subcommand walks that set, applying plugin-level and subcommand-level dependency predicates against the workspace (with the applicable use names, so a dormant plugin’s subcommands appear once it is enabled), and returns the matched (Plugin, Subcommand) (or an error if more than one plugin claims the name). dispatch_external then looks up the named Installation, resolves it via installation::resolve_runnable, and spawns the child with stdio inherited — propagating the exit code as a u8 so callers can convert to ExitCode (binary) or treat non-zero as an error (library). applicable_subcommands is the shared iterator over the active set’s applicable subcommands, taking an already-resolved &[Plugin] so help rendering and the SessionStart discovery hint reuse it.

help_render.rs — --help rendering

Renders symposium --help as two audience-grouped sections, “Commands for humans” and “Commands for agents”, mixing built-in subcommands with plugin-vended ones filtered by the active workspace. Built-in audience comes from cli::builtin_audience; plugin subcommands come from subcommand_dispatch::applicable_subcommands over the resolved active plugin set (skills::active_plugins), so crate-sourced subcommands appear in help too.

help_text is the single help decision, shared by the binary and the test harness. clap’s own help flag and help subcommand are disabled (in cli::Cli), --help/-h is a manual global bool, and the entry points parse with try_parse_from — so help is decided after parsing and argument order (--help --quiet) is irrelevant. It returns the top-level grouped help for no subcommand / --help / -h / the bare help keyword; for <built-in> --help it re-renders clap’s own per-command help by walking clap’s command tree (so required-arg commands like crate-info, required-subcommand groups like plugin, and nested commands like plugin list all work); a plugin <name> --help returns None so dispatch forwards --help to the child.

render builds the grouped text by slicing clap’s rendered help — keeping the header (before Commands:) and the options block (from Options: on) and hand-rendering only the two section headings between them. If a slice marker is missing (clap format drift), it falls back to clap’s unmodified help rather than panicking.

hook.rs — hook handling

Handles the hook pipeline: parse agent wire-format input -> auto-sync -> builtin dispatch -> plugin hook dispatch -> respond. The response is a HookResponse (stdout, stderr, exit code), since some decisions travel only through the exit code: a plugin hook’s exit 2 on PreToolUse becomes a canonical deny (blocked_response), and Kiro receives any denial as exit 2. A single Workspace, found from the payload’s cwd (the process’s working directory when the payload has none), is threaded through all stages: run_auto_sync, dispatch_builtin, dispatch_plugin_hooks, and the SessionStart prewarm. So each package manager is asked each question at most once per hook call, and an out-of-process PM is spawned at most once. Across invocations, per-directory state (workspace_state.rs, keyed on that directory, since knowing the root would mean asking) records the workspace the last sync found and its inputs’ modification times, plus the pending dependency plugins already named to the agent (surfaced) and, per agent, the plugins and skills a sync installed or updated that its session has not been told to load (pending_reloads); while none of those files has changed, an event asks no package manager where the workspace is or what it depends on, the common case for PreToolUse hooks. A workspace that names no inputs is never fresh. Loading a package a plugin chains to, or one use enables, still asks its package manager.

run_auto_sync takes a session_start flag: on SessionStart it skips the freshness gate and syncs with UpdateLevel::Check (so upstream skill/source changes land once per session); every other event keeps the gated, UpdateLevel::None path. The matching ensure_registries refresh level is decided in the binary entry point from the same event. SessionStart additionally runs prewarm_hook_sources (best-effort, gated by auto-sync): it walks every applicable plugin’s hooks and refreshes each installation’s already-cached source via refresh_installation_if_present (UpdateLevel::Check). This is what keeps hook binaries/scripts (not just manifests) current once per session — in particular the only path that re-pulls a cargo + git hook binary whose branch moved — so the dispatch path can keep acquiring with None (cache/debounced) and pay no per-event network cost. It is refresh-only: a source that was never acquired is left alone (it installs lazily on first dispatch), so SessionStart never eagerly installs a tool a hook may never use.

On SessionStart, handle_session_start composes four independently-computed additionalContext fragments: a discovery_hint (suggests symposium --help when the workspace exposes applicable plugin subcommands, reusing subcommand_dispatch::applicable_subcommands), a consent_hint (names the dependency plugins awaiting consent, each with its audit answer, via discovery::pending_candidates; a hook must never block on stdin, so the candidates are reported as context pointing at symposium sync / symposium use rather than asked about), an update_nudge (the throttled self-update warning), and a reload notice (take_reload_notice: the plugins a sync installed or updated for the hook’s agent, and how that agent loads them now (plugin_load_now), /reload-plugins for Claude Code, /skills reload for Antigravity CLI, a new session for Codex CLI and /restart for the Copilot CLI; for the Copilot CLI also the per-skill copies a sync made, with /skills reload (skill_load_now)); only the nudge is gated behind the update-check throttle. mid_session_sync_notices gives PostToolUse and UserPromptSubmit the same consent notice when run_auto_sync reports that it re-synced because Cargo.lock changed (so a dependency that ships no plugin, or one auto-enable or use already covers, adds nothing), plus the reload notice for the plugins a sync installed or updated for the hook’s agent and, for Codex CLI and the Copilot CLI, for the per-skill copies it installed or updated there: Codex stops seeing new copies once .agents/skills/ was created after its session started, and Copilot offers the skills it read at start until /skills reload. Copilot gets it on SessionStart too; Codex does not, since it lists what that sync copies from the next turn. The consent notice names only the candidates not yet in the per-directory state’s surfaced set, and dispatch_builtin returns the ones its output names (SessionStart returns every one it names). execute_hook_inner adds them to that set only when plugin dispatch succeeds and the response, parsed back with the agent’s parse_output, exits 0, does not block (AgentHookOutput::blocks: a canonical deny, or an agent’s own block decision on an event whose canonical output has none), and still carries the builtin context, so a notice never repeats a package and version already surfaced, and one a blocked event or the agent’s format dropped is given again. The reload notice follows the same rule through the per-directory state’s pending_reloads: take_reload_notice adds what the sync, if one ran, installed or updated for every agent that takes the notice (a SessionStart first drops its own agent’s entry, since a new session loads it), builds the notice from the hook agent’s entry, and forget_reloads removes those names only after that same check. So the notice is not lost to an event that cannot carry it (PreToolUse, Stop), to a blocking hook, or to the claude invocation the Copilot CLI also runs, which syncs for Copilot but answers as Claude Code. The plugin dispatch path matches plugin Hooks against the event over the active plugin set (skills::active_plugins, so crate-sourced hooks fire too), selects one format per plugin and runs every matching hook in it (native format > symposium format; a hook in another agent’s format never fires), builds a ResolvedHook per match (looking up the named installations on the plugin), then for each ResolvedHook: acquires its requirements (best-effort), runs install_commands after the source step, picks a Runnable from (hook-or-install) executable/script, and spawns it (binary directly for Exec, via sh <path> for Script). Input is delivered in the selected format; output is converted back to the agent’s wire format before returning.

state.rs — persistent state

Agent selection provenance is stored as explicit-agents alongside detected-agents. record_agent_choices preserves the other state fields; see agent choices for migration and selection rules.

Manages state.toml in the config directory. Deserializes through RawState and validates into the runtime State. Tracks the semver of the binary that last touched the directory (for future migration hooks) the timestamp of the last update check (to throttle crates.io queries to once per 24 hours), and the MCP server ledger: the (agent, file, name) of every MCP entry symposium wrote, so removal never touches an entry the user wrote under the same name, plus the use entries plugin try added (trial-use), for the same reason, and the MCP servers each tried plugin declares (trial-mcp-servers, recorded by record_trial_mcp_servers and read and forgotten by take_trial_mcp_servers), so plugin try --remove unregisters them once the plugin’s directory is gone. ensure_current() is called on startup to silently stamp the current version. should_check_for_update() / record_update_check() gate the auto-update flow.

telemetry/ — opt-in usage telemetry

Implements the local, opt-in telemetry event log under <config-dir>/telemetry/, one JSONL file per UTC day. Off by default; gated by [telemetry] enabled. A TelemetryEvent is an at timestamp plus a kind-tagged EventKind (session_start / user_prompt / tool_use), serialized one per line. record / record_kind append an event; roll_off deletes files older than RETENTION_DAYS (30); read_events / recent_events read them back; usage + status_text back telemetry status; recent_events backs telemetry show. Events are anonymous by construction — no prompt text, command lines, or file paths. Every write path is best-effort — failures are logged and swallowed so a hook is never broken. The recording entry points are not yet called from the hook pipeline, so no events are produced today even when telemetry is enabled.

The replacement recording contract is being built behind private schema, identity, and state submodules before it is connected to production callers. Within schema, mod.rs owns shared row primitives and version dispatch, macros.rs owns strict versioned-row boilerplate for rows with and without cross-field validation while each row module keeps its validation rules, metrics.rs owns the fixed latency histogram and complete-session validation shared by hook aggregate rows, and hook.rs owns the strict hook-metrics row and read-side validation. Its hook/surface.rs, hook/outcome.rs, hook/key.rs, and hook/update.rs children keep SDK surface mapping, outcome accounting, the typed hook_subject dimension and aggregate key, and atomic write updates with their respective tests. plugin_hook.rs owns the strict plugin-hook aggregate row and read-side validation. Its plugin_hook/outcome.rs, plugin_hook/bucket.rs, and plugin_hook/update.rs children keep outcome accounting, validated public identity and pre-admission attribution, and atomic write updates with their respective tests. name.rs owns validation shared by public name types, agent.rs owns agent vocabulary and agent-originated rows, command.rs owns eligible built-in and public plugin-command coordinates and exhaustively maps parsed CLI commands into the recorded built-in set, extension.rs owns validated public extension coordinates and vocabulary shared across event kinds, and resolution.rs owns resolution summaries and shared resolution vocabulary. Package-resolution vocabulary and validated public coordinates live in resolution/package.rs; resolution/extension.rs owns the strict recursive node vocabulary, the validated path wrapper that enforces whole-path depth, leaf-count, and encoded-size limits, the skill-only attribution persisted by the installation index, and the versioned row that derives extension_subject from its target and path. Timestamped rows validate during deserialization that day is the UTC calendar day containing at; the later archive reader separately validates that the row belongs to its daily file. Private state binds its key and identifier-window or return-cohort anchor into distinct identity scopes. Each identifier domain accepts only its contract-selected scope. Row constructors take a bound recording context, derive identifiers from their own source fields, and take their day from the context: package resolution derives package_subject from its coordinate, agent configuration derives agent_subject from its agent, command derives command_subject from its coordinate, and a full resolution reuses one context for its summary, package, and extension rows. Session start extends that context with a return-cohort scope and derives its timestamp, both subjects, and cohort_day from one bound session transition. Within state, mod.rs owns the versioned private-state file shape, state/lifecycle.rs owns the identifier-window transition for every recording plus return-cohort and identifier-reset transitions, state/open_day.rs centralizes the monotonic day transition used by daily state while persistence remains responsible for sourcing it from the one latest-opened-day high-water mark, state/session_pair.rs owns the bounded two-set storage and permanent-incompleteness rule shared by aggregate trackers, state/session_counts.rs owns hook-specific contribution classification and count reconciliation, state/hook.rs owns the deterministic daily map that selects those trackers by aggregate key, and state/plugin_hook.rs keeps each plugin-hook row’s admitted identity, stable event ID, and session tracker behind one key-checked selection. Its state/plugin_hook/admission.rs child owns the deterministic daily map and the separate 128-public-row allowance for this aggregate family. Only this private-state boundary can create an overflow bucket; row constructors receive the coupled identity from the selected entry rather than accepting its scope, coordinate, and subject separately. A completed recording transition is a single-use value; a session transition extends it with the return-cohort selection. Binding either transition against unchanged anchors exposes only the identity scopes valid for that operation. Each hook row and private tracker share a key made from the UTC day and hook_subject, so equally sized trackers for different aggregates cannot be exchanged. Hook-metrics updates derive their row and session identities from one bound recording, reject impossible per-observation plugin counts, stage every row counter before changing private session state, and publish the two objects only after every checked update succeeds. The private storage submodule owns the new contract’s canonical paths and exclusive filesystem access: StoragePaths keeps inspectable data and its permanent .lock under <config-dir>/telemetry/ while keeping telemetry-state.toml beside that directory, and TelemetryLock makes one non-blocking acquisition whose file handle releases the lock on drop or unwind. The eventual recorder will stage rows and aggregate changes in memory, successfully replace the private state containing their anchors and entries, and only then expose those rows for publication. Their tests remain beside the responsibility they exercise.

Hook, plugin-hook, and extension-invocation aggregate keys retain their validated source dimensions. Each key can therefore be rebuilt from a stored identifier-window scope without trusting persisted subject bytes.

storage/metrics/recovery.rs indexes every surviving public row for allowance reconciliation separately from subject-matched rows that private state may adopt. Duplicate matches choose the lowest event_id deterministically.

state/staged_entries.rs provides a per-entry copy-on-write overlay for aggregate maps. The hook store applies day rollover and tracker edits through that overlay. Plugin-hook and extension-invocation admission also stage their open day, public-row spend, and every recovered or newly admitted entry. Dropping a stage leaves its real store unchanged, while a selection error poisons the stage so commit discards all of its edits. state/aggregate.rs owns the three stores as disjoint fields and exposes the borrow seam that lets the recording coordinator keep all three stages live together. state/aggregate/recording.rs owns the complete invocation input, derives its plugin totals, and returns an unpublished staged snapshot. Its stages.rs child opens all three private stages, checks the snapshot day, applies one staged unit, and performs the shared poison preflight; rows.rs selects and mutates each family’s row against the owned snapshot; and error.rs keeps the content-free failure vocabulary. state/recording.rs owns the opaque change for one accepted operation. It schedules maintenance, binds the operation once when rows need identity, and keeps private state, an optional event request, the staged or deliberately absent metric half, and the maintenance token together until locked storage consumes them through its persistence access value.

state/aggregate/persistence.rs wraps the three family wire shapes and owns cross-family row-identifier uniqueness plus agreement between every store day and the identity high-water day. Its sessions.rs child is the private wire bridge for the shared session pair. It preserves permanent incompleteness, rejects malformed or oversized raw sets, and checks the family-specific subset and contribution relationships without giving runtime trackers general-purpose serialization. Its hook.rs sibling defines the strict borrowed and owned hook-store wire shapes, re-derives hook subjects from the document’s identity scope, and runs the same store validator before encoding and after reconstruction. plugin_hook.rs adds the plugin-hook row identifier, strict public, unnamed, and overflow bucket shapes, and persisted public-row spend. It re-derives public plugin subjects from the document scope and rejects duplicate keys, row identifiers, inconsistent spend, and mismatched entry identity. extension_invocation.rs persists the analogous extension store while keeping each public bucket’s validated skill target and complete safe resolution path together. It revalidates recursive paths during decoding and re-derives both agent and extension subjects from the document scope instead of trusting stored subjects.

state/codec.rs owns canonical private-state serialization, version dispatch, schema decoding, and secret-safe diagnostics. It is the only bridge between the runtime state and the strict aggregate wire adapters, so aggregate invariant failures remain typed without giving identity-bearing runtime types general-purpose serialization. state/lifecycle.rs advances all three aggregate-store days before mutating identity state on every accepted operation. Day rollover clears entries and resets public-row spend, while an identifier-window rollover or identifier reset clears entries and preserves same-day spend. The private storage module owns the bounded file I/O that calls the codec.

Resolution summaries derive an optional session_id from a paired agent and raw vendor session identifier rather than accepting a loose scoped identifier. state/codec.rs owns canonical private-state encoding and content-free decode errors, so malformed state can never expose the identity key in diagnostics.

schema/extension_invocation.rs is the extension-invocation aggregate boundary. Its extension_invocation/vocabulary.rs child keeps the closed version 1 agent, phase, target-scope, and unnamed-reason vocabulary; extension_invocation/bucket.rs accepts only safe public attribution or a fixed unnamed reason, leaving overflow assignment to private state; and extension_invocation/row.rs owns the strict versioned row and its read-side scope, counter, and session validation. The row’s update.rs child applies one phase observation atomically from a bound recording and an admitted private-state selection, so the event id, agent, target identity, identifier epoch, and session tracker cannot be supplied independently. The independent attempted/completed session-count validator lives with the other aggregate primitives in schema/metrics.rs. state/extension_invocation.rs owns phase-specific contribution counts and reconciles them with the stored row over the shared bounded session pair. Failed observations add no session id, but still perform this reconciliation so a lost snapshot row cannot leave published counts inconsistent with private state. Its extension_invocation/admission.rs child derives coupled row identity, keeps the stable row identifier and session tracker behind one epoch-aware aggregate key, and sends new public targets beyond the daily allowance to overflow. state/public_row_budget.rs owns the shared 128-row daily allowance used independently by each named aggregate family: day rollover and clear restore it, while identifier reset does not.

Storage acquisition also tightens a pre-existing telemetry directory and lock file to owner-only modes on Unix instead of relying only on their creation modes. storage/atomic.rs writes a complete byte buffer through a temporary file in the telemetry directory before atomically replacing its destination. This keeps both private-state and snapshot temporaries under the locked cleanup root and requires the config and telemetry directories to share a filesystem. Replacement does not fsync, and callers must finish serialization before it starts. Every telemetry-owned temporary uses the shared .telemetry-tmp- prefix.

storage/maintenance.rs consumes a due token released only after private state has persisted and publication has been attempted. One non-recursive scan removes D31 event and metric files plus abandoned replacement temporaries, ignores directories, symlinks, and unknown names, and continues after individual inspection or removal failures. Private state records the last accepted day on which maintenance was attempted, limiting the scan to once per accepted day; the marker records an attempt rather than success. Activating the replacement recorder must remove the legacy record and roll_off paths in the same change, so two schemas and retention policies never share the telemetry directory.

LockedStorage owns both the canonical paths and TelemetryLock, so private state cannot be loaded or replaced outside the lock. It is generic over a complete-write adapter, while the production Storage alias uses FsWrites. Its writes.rs child keeps the storage-private RecordingWrites seam over complete private-state replacements, event-batch appends, and metric-snapshot replacements. Only LockedStorage can split its writer from an access value that borrows the same storage’s canonical paths and held lock, so the access cannot name another destination or outlive the lock. The recording transaction owns the write ordering. Its recorder.rs child is the operation facade: it makes the non-waiting lock attempt, loads and observes private state, loads the accepted day’s snapshot without turning unsafe content into an empty one, and sends the opaque state-produced change through the locked transaction. A change with no public half is dropped before persistence, including its unpersisted maintenance token. The returned outcome says whether nothing was recorded or private state persisted, then carries publication and maintenance results without retaining serializer errors that could contain private data. There is not yet a production caller for this facade. Its recording.rs child prepares one complete state-produced change, persists private state first, and mints a receipt tied to that held lock. A change with no aggregate rows carries a typed NotRequested reason instead of inventing an empty snapshot. The receipt attempts event publication before remeasuring and publishing staged metrics, reports both outcomes independently, and makes an unattempted publication loud on drop. Its private_state.rs child performs a bounded byte read, distinguishes TOML syntax errors, invalid state content, and unsupported versions without retaining parser source text, serializes the complete state before replacement, and requires mutable access to replace it. Its daily_files.rs sibling recognizes only canonical event and metric filenames. Its events.rs sibling validates one-day low-volume batches, serializes every row before filesystem access, and appends them in one write after closing any partial final line left by an earlier failure. storage/limits.rs measures the two daily files, performs a bounded final-line inspection, reserves the largest version 1 storage-limit marker, and makes the all-or-marker decision with saturating arithmetic. Inspection or marker- preparation failure suppresses only the current event append, while a stored or surviving final marker closes low-volume recording for that UTC day without stopping aggregates. Its metrics.rs sibling loads the 512 KiB aggregate snapshot as one fail-closed unit, retains each validated row’s original physical bytes, exposes event-id-only insert and replace operations, sorts prepared rows by canonical wire labels, and atomically replaces only a fully prepared snapshot that fits both storage ceilings. Its empty-snapshot constructor is loader-private, so unsafe content cannot be rebuilt as an empty snapshot, and load failures project into a bounded, content-free MetricSnapshotUnavailable reason. Unsafe snapshot content therefore stops aggregate updates for that day without stopping event appends. When private state is absent, storage initializes the high-water mark and identifier-window anchor from the later of the current UTC day and the newest surviving daily filename; malformed and unsupported state remain errors rather than entering this path.

report.rs — structured report layer

Provides user-facing output for all commands via a custom tracing layer. Commands emit tracing::info! or tracing::debug! events with a report = %ReportEvent::Variant { ... } field; the ReportLayer intercepts these and renders them based on mode:

  • Normal — prints format_human() to stdout (default for most commands)
  • Verbose (-v) — prints all events (info + debug) to stderr
  • Json (--json) — accumulates events in a buffer, drained as a JSON array at the end

The ReportEvent enum is the stable schema — #[derive(Serialize, Deserialize)] with #[serde(tag = "kind")]. Each variant carries the fields needed to render both human and JSON forms. The Display impl serializes to JSON (for passing through tracing’s % formatter), and format_human() renders the pretty-printed form.

The layer is always installed by the binary. Commands that want output simply emit report events at the appropriate tracing level (info for actions, debug for decision trace). A warning repeated within one command is rendered once. The --json flag also suppresses the Output-based messages and drains the JSON buffer at exit.

self_update.rs — self-update

Implements symposium self-update. Queries the registry for the latest published version via cargo search, then installs it via cargo install symposium --force. Also provides re_exec() which replaces the current process with the newly installed binary (Unix exec, spawn-and-exit on Windows), used by the auto-update = "on" startup path. Contains maybe_warn_for_update() (sync, for the warn library path) and maybe_check_for_update() (async, for the binary on + re-exec path).

crate_command.rs — crate source lookup

Contains dispatch_crate(), which resolves a crate’s version and fetches its source code. Called by the CLI’s crate-info command. Path dependencies are resolved to their local source directory via WorkspaceCrate.path. Without --version, a workspace member is looked up in member_crates first and resolves to its own directory.