diff --git a/README.md b/README.md index 770e15d4c..693fd71c3 100644 --- a/README.md +++ b/README.md @@ -1013,7 +1013,7 @@ PicoClaw provides typed lifecycle hooks for observability, outbound filtering, a See runnable examples: [docs/hooks-plugin-examples.md](docs/hooks-plugin-examples.md) -Roadmap for plugin system evolution: [docs/design/plugin-system-roadmap.md](docs/design/plugin-system-roadmap.md) +Roadmap for plugin system evolution: [docs/plugin-system-roadmap.md](docs/plugin-system-roadmap.md)
Zhipu diff --git a/docs/design/plugin-code-plan-demo.md b/docs/design/plugin-code-plan-demo.md deleted file mode 100644 index 5617866ba..000000000 --- a/docs/design/plugin-code-plan-demo.md +++ /dev/null @@ -1,71 +0,0 @@ -# Plugin System Demo Code Plan - -## Goal -Build a minimal, executable demo to prove plugin value with measurable behavior (not conceptual discussion). - -## Why this demo -This demo validates runtime capabilities that skill text cannot reliably enforce: -- deterministic tool-call blocking at runtime -- deterministic outbound content rewrite at runtime -- reversible behavior (no plugin config => no effect) - -## Scope (1-day demo) -In scope: -- add one compile-time plugin: `policy-demo` -- add tests for: - - global tool block - - channel-specific tool allowlist - - outbound redaction - - outbound deny-pattern guard - - tool argument normalization (timeout clamp) - - hook-based audit counters - - no-config no-effect path -- provide a reviewer-friendly verification command - -Out of scope: -- dynamic plugin loading -- plugin marketplace/distribution -- UI/config schema work - -## Code Changes -1. `pkg/plugin/demoplugin/policy_demo.go` -- add `PolicyDemoPlugin` -- register `before_tool_call` hook to block configured tools -- support channel-specific tool allowlist -- normalize timeout-like tool args (`timeout`, `timeout_seconds`) -- register `message_sending` hook for redaction and deny-pattern guard -- register `session_start`, `session_end`, `after_tool_call` audit hooks -- expose `Snapshot()` for deterministic verification - -2. `pkg/plugin/demoplugin/policy_demo_test.go` -- `TestPolicyDemoPluginBlocksConfiguredTool` -- `TestPolicyDemoPluginRedactsOutboundContent` -- `TestPolicyDemoPluginChannelAllowlist` -- `TestPolicyDemoPluginOutboundGuard` -- `TestPolicyDemoPluginNormalizesTimeoutArg` -- `TestPolicyDemoPluginAuditHooks` -- `TestPolicyDemoPluginNoConfigNoEffect` - -## Verification -Run: - -```bash -go test ./pkg/plugin/... ./pkg/agent/... -``` - -Expected: -- all tests pass -- plugin test suite demonstrates deterministic runtime interception and rewrite - -## Acceptance Criteria -- plugin can enforce a hard runtime policy (`before_tool_call` cancel) -- plugin can enforce channel-level runtime policy without core code changes -- plugin can enforce outbound transformation (`message_sending` rewrite) -- plugin can enforce outbound hard-block (`message_sending` cancel) -- plugin can mutate tool args before execution in a deterministic way -- plugin can collect lifecycle audit counters -- empty plugin config causes zero behavior change -- behavior is covered by automated tests - -## Reviewer Notes -If this demo is accepted, next step is wiring a config-driven enable/disable path (Roadmap Phase 2), while keeping current compile-time contract (`pkg/plugin`) unchanged. diff --git a/docs/hooks-plugin-examples.md b/docs/hooks-plugin-examples.md index d78b5a1cb..1e9d427ae 100644 --- a/docs/hooks-plugin-examples.md +++ b/docs/hooks-plugin-examples.md @@ -2,7 +2,7 @@ This guide shows how to extend PicoClaw behavior with `pkg/hooks` without modifying core agent logic. -For future direction (beyond current hooks foundation), see [Plugin System Roadmap](design/plugin-system-roadmap.md). +For future direction (beyond current hooks foundation), see [Plugin System Roadmap](plugin-system-roadmap.md). Current model: - "Plugin-style" means registering Go handlers at startup. diff --git a/docs/design/plugin-system-roadmap.md b/docs/plugin-system-roadmap.md similarity index 100% rename from docs/design/plugin-system-roadmap.md rename to docs/plugin-system-roadmap.md