Repository navigation
Conversation
Replace the Source and Artifact plugin frameworks with a few interfaces that PC Server calls through the Supervisor. Core keeps only Sources, Artifacts, collection targets, and consumption progress; plugins no longer have managed lifecycle state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nstrained writer Implements the Artifact side of RFC 2549: directory-loaded plugins, Worker execution through the existing Supervisor, a writer whose single transaction commits plugin writes with the cursor and acknowledgment, public reads and text search over plugin families, durable manual requests, and read-only plugin listing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reuses the built-in extraction and reconciliation contracts, writes memories, revisions, merges and lifecycle changes through the plugin writer, keeps a plugin-owned similarity index checked against core revisions, and accepts remember, edit, forget, restore and undo_merge commands as manual requests. Restoring a merge-frozen input now uses the shared restoration path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Register the generate operation in the base access contract, regenerate JS operation tables, record the plugin persistence review, and fix type diagnostics in the plugin modules and tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…act APIs
- plugin.py assigns an ArtifactPlugin declaration; plugin.yml, ${ENV}
substitution and the Config export are gone, settings come from the
environment inside create.
- User changes to plugin Artifacts run in core: replace_artifact accepts
plugin families, and generic lifecycle and undo-merge routes reuse the
plugin writer. The manual generate route and its request queue are removed.
- Core derives search text from the declared search_fields, so plugin and
user writes index identically.
- /v1/plugins drops in-memory call outcomes; /v1/plugins/{name}/scopes reads
per-Scope progress from intents and cursors.
- RFC 2549 is restructured around the overall design and the two plugin
kinds' interfaces and declarations.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…registered family Replace the plugin-only lifecycle and undo-merge routes with generic routes on the shared merge registry: governance reads, merges, forget and restorations now work for every family registered with ArtifactMergeApplication, including Experience, Atomic Memory and plugin families that Server registers at load. Plugin edits record a lineage-only content Source like built-in edits, tag routes accept plugin families, and plugin writers no longer sign previews with a per-process random key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g tag families in the client The Codex hook binds the current Scope for the four new generic Artifact operations, and the Python client recognizes legacy Memory tag queries now that TaggableArtifactFamily is a string model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dge collection Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Key owned bulk content by content digest so rolled-back revision numbers cannot collide, state the storage-agnostic requirements behind treating core's commit as the only point where owned data takes effect, and align unchanged writes with Atomic Memory and user edits with built-in replace. Also run the host factory once per process, check the code fingerprint before importing, return cascaded refs from revert and set_lifecycle, and make a removed plugin's family unreadable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move executor flows, internal class names, limit values, column lists, and observability field tables to the implementation design. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A host process is core runtime plus one plugin: spawned like a Worker, it
rebuilds the database connection and authorization from configuration,
so the Server only authenticates and forwards over a duplex Pipe. Edits,
merge, forget, and restoration of plugin families now call the plugin's
optional methods there; the writer enforces exactly the agreed write,
records lineage-only Sources, checks revisions read outside the
transaction, and reports cascaded groups. Plugins also get dedicated
SQLite storage, Server embedding models, Source Definitions submitted as
observations, and their own routes under /v1/plugins/{name}/api.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every knowledge base is a Scope the plugin creates and maps in its own storage, so callers see knowledge bases and documents only. Uploads keep their bytes by content digest and submit a Source recording the digest; generation chunks and embeds the text with the Server's model, or a deterministic hash embedding when none is configured, and writes the document Artifact. Search fuses keyword and vector rankings across the knowledge bases a caller can read. Plugin Source manifests now register with their schema aliases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…model Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and model generation
- POST /v1/scopes/{scope_id}/artifacts accepts any loaded plugin family through a
CreatePluginArtifactRequest branch; built-in names keep their discriminated
validation and the plugin's create_artifact writes revision one.
- POST /v1/scopes/{scope_id}/sources accepts Source types that plugins define; the
plugin host validates the input, resolves and stores it like a remote observation.
- ctx.models.generate calls the Server's generation model with chat messages.
- Plugin routes may declare max_body_bytes under the deployment ceiling
POWERCONTEXT_SERVER_PLUGIN_API_MAX_BODY_BYTES, which also replaces the general
HTTP body limit for plugin routes.
- Plugins may declare pages: the Dashboard frames them in a sandboxed iframe and
forwards only same-origin, session-bound requests to the plugin's own routes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…owledge base plugin Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… in the knowledge base plugin Uploads wait for a parser unless the knowledge base has a default; processing a batch submits one Source per document that records the file digest and parser. Chunk sets are content-addressed and keyed by parser profile; vectors are a derived index per embedding profile. Users can view chunks of any revision, edit them into a new revision, restore a revision, and reparse with another parser. PDF text is extracted page by page with pypdf, which joins the dev group. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… parser Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne click Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A chunk edit is now a kb-chunk-edit Source that records the editor, the edited revision, and the saved chunk set. Generation applies it only if the document is still at that revision, so the new revision's provenance names the edit. Uploads and edits share one request Projection, which moves kb-document to version 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Inputs keeps projection as the default for every Source type and adds projections to name a different Projection per type; every type needs one. The knowledge base example now receives uploads and chunk edits in their own Projections instead of a merged request model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the knowledge base example separate Plugin pages, page forwarding, route body limits, and model generation are now tested with a small test-owned plugin, so the framework does not depend on an example. The knowledge base example and its pypdf dev dependency move to their own branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e RFC states Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s, definitions, and host startup Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ilities The family registry is process-wide, so families registered by other plugin managers or by plugin tests in the same process leaked into /v1/capabilities. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Closing: superseded by oceanbase#2616 and oceanbase#2660, both merged upstream. The branch is kept. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这个 PR 是什么
插件框架的实现,对应 RFC oceanbase#2549(插件接口)中 Artifact 插件的部分,以及 RFC oceanbase#2579 中的插件接口与 Dashboard 页面。Source 插件(
collect)、端侧采集、热加载、版本快照、数据升级钩子、MCP 工具还没有实现,见文末。一个插件就是插件目录下的一个文件夹和其中的
plugin.py。它可以:/v1/plugins/{name}/api/...)和 Dashboard 页面;完整的知识库(RAG)插件示例在 #5,它以本分支为基础,差异里只有插件本身。
怎么读
docs/{zh,en}/docs/develop/plugins.md:插件开发者看到的样子,示例都在真实 Server 上跑通过。src/powercontext/plugins.py:插件声明(ArtifactPlugin、Inputs、Route、PluginApi、PluginPages)、上下文PluginContext、写入器与读取接口、用户修改的请求模型、接口请求与响应模型。builtin/plugins/manifest.py:在独立子进程中导入plugin.py、校验声明、计算代码指纹,得到可跨进程传递的PluginManifest。builtin/plugins/executor.py(Worker 中的一次调用:读窗口、按类型计算 Projection、调用generate、与游标一起提交)和builtin/plugins/writer.py(写入器:写事务、出处校验、用户修改的约定写入与lineage_only出处 Source)。builtin/plugins/host.py、host_protocol.py(子进程:core 运行时加上插件,自己建数据库连接和授权,执行用户修改、插件接口和插件 Source 的写入)与server/plugin_hosts.py(Server 端:spawn、双向 Pipe、超时终止、退避重启)。builtin/plugins/storage.py。server/plugins.py(插件管理:加载、注册 family 和 Source 定义、Supervisor binding、启动宿主进程)、server/app.py中的插件部分(通用创建 / 修改 / 合并 / 遗忘 / 恢复转给宿主进程、插件 Source 写入、插件路由挂载与请求体上限)、server/http_limits.py。server/dashboard/plugin_pages.py、templates/plugin.html(宿主页面与转发脚本)、static/plugin-client.js(插件页面使用的客户端)。tests/builtin/plugins/(写入器、Inputs校验)、tests/e2e/test_plugins.py(加载、生成、通用 Artifact 接口、通用创建、插件 Source 写入)、tests/e2e/test_plugin_pages.py(页面沙箱、转发、请求体上限、模型调用)。examples/plugins/atomic_memory是用插件方式重写的 Atomic Memory,只用于验证接口设计,不打算合入上游。接口变化
POST /v1/scopes/{scope_id}/artifacts:请求体增加插件分支{"family", "content"}。CreateArtifactRequest变为内置分支CreateBuiltinArtifactRequest与插件分支CreatePluginArtifactRequest二选一,按 family 名选择;内置 family 的校验不变。生成的 Python 客户端中内置请求多一层包装,ArtifactCreated.family改为字符串。POST /v1/scopes/{scope_id}/sources:source_type从只能为content的枚举改为字符串,可以是插件定义的类型;SourceType枚举保留。GET /v1/plugins、GET /v1/plugins/{name}、GET /v1/plugins/{name}/scopes,以及治理、合并、遗忘、恢复等通用接口(对所有登记的 family 生效)。/v1/plugins/{name}/api/...和 Dashboard 路径/dashboard/plugins/...不在 OpenAPI 契约中。POWERCONTEXT_SERVER_PLUGINS_DIR、POWERCONTEXT_SERVER_PLUGIN_API_MAX_BODY_BYTES。还没有做
collect)、采集目标与端侧采集模式;验证
tests/test_desktop_contract.py::test_bundled_desktop_contract_has_a_qualified_business_profile目前失败:本分支修改了 OpenAPI 契约,新的契约摘要需要一份 Desktop 资格记录(用本分支构建的 wheel 运行desktop/tests/real_server.py生成),合入上游前补上。完整测试集需要更大的机器运行。AI 使用说明
代码、测试、文档和本说明由 Claude Code(Claude Opus 5.5)在作者的指导下编写,作者审阅设计决定;测试与手动验证由 Claude Code 执行并核对结果。
🤖 Generated with Claude Code