Repository navigation
feat(plugin): add explicit review workflow plugins - #1764
Closed
Qiyuanqiii wants to merge 21 commits into
Closed
Qiyuanqiii wants to merge 21 commits into
Qiyuanqiii wants to merge 21 commits into
Conversation
Support reusable rules, MCP servers, explicit review workflows, and local, catalog, and URL installation with confined package snapshots. Include protocol diagnostics and upstream completion integration.
Prefer tar.gz for plugin distribution and GitHub downloads while retaining ZIP compatibility. Preserve executable bits during installation. Co-authored-by: wu21-web <[email protected]>
Require acceptance for execution declaration changes, pin GitHub sources, check host requirements, and distinguish archive and content digests. Co-authored-by: Andrew C. Oliver <[email protected]>
Co-authored-by: Andrew C. Oliver <[email protected]>
Co-authored-by: Andrew C. Oliver <[email protected]>
Co-authored-by: MeiSiristhebest <[email protected]>
Co-authored-by: chaojixinren <[email protected]>
Co-authored-by: Andrew C. Oliver <[email protected]> Co-authored-by: MeiSiristhebest <[email protected]> Co-authored-by: chaojixinren <[email protected]>
1 task done
Contributor
|
🔍 OpenCodeReview found 9 issue(s) in this PR.
|
Co-authored-by: wu21-web <[email protected]>
Co-authored-by: wu21-web <[email protected]>
Contributor
Author
|
pr过大,我目前的计划是拆分,所以暂时关闭 |
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.
Custom review stages
ocr review --review-plugin IDruns an explicitly selected package's review workflow. A workflow can inspect a change, verify candidate findings in a later stage, and require a structured completion report before publishing results. The package supplies stages, instructions and validation; OCR supplies diffs, rules, model/tool execution, budgets and saved results.Without the flag, OCR uses its existing review flow. Installing or enabling a package does not select its workflow.
Draft; depends on #1738. That PR provides installation, rules/MCP and project locks. This PR targets upstream
main, so Files changed includes that unmerged dependency. Review the Workflow-only changes. After #1738 merges, this branch will be rebased to remove the dependency from the diff and consolidate its history.Try it
From this checkout, with Python 3 available as
python, a configured model provider and working-tree changes to review:Preview inspects the selected package without starting its executable or contacting the model. The final command runs the bundled one-stage example. Inspect
review_plugininreview.jsonfor completion and the saved report.Repositories declaring project plugins must select from their locked, installed and locally authorized packages. See the workflow guide for project setup and the full protocol.
Execution and review order
sequenceDiagram participant OCR as OCR agent participant Plugin as Workflow process participant Runner as Model/tool loop participant Output as Session/output OCR->>Plugin: Start for one file group loop Each declared stage OCR->>Plugin: begin(stage, paths, classifications) Plugin-->>OCR: Instructions, input and completion schema OCR->>Runner: Run with diff, rules, tools and budget Runner->>Plugin: submit(completion) Plugin-->>Runner: Accepted result or repair feedback Runner-->>OCR: Completion, stop or failure OCR->>Output: Save report and process accepted findings end OCR->>Plugin: Close processinternal/config/rules/plugin_rules.go, manifest and project-plugin codeinternal/plugin/review.go,examples/ocr-plugins/single-pass/review.pyinternal/agent/review_plugin.go,internal/llmloop/task_options.go, loop/compression changesBoundaries
stdio-v1protocol is experimental. Workflows require a fresh invocation;--resumedoes not restore process state.Update a plugin from a replacement source
ocr plugin update my-plugin --source "https://plugins.example.com/download.php?token=NEW_TOKEN"--sourceaccepts the same HTTPS/GitHub URLs and local directory/ZIP/tar.gz sources asinstall. It selects the installed plugin ID, including from multi-plugin archives. A successful update records the new source for laterupdate IDcalls and preserves the enabled state. Download, validation and unaccepted execution-declaration failures preserve the previous package and source. The full URL is stored locally; management output hides query parameters. Project dependencies continue to useplugin addandplugin lock.The native-plugin guide and CLI reference cover this behavior in English, Simplified Chinese, Japanese, Korean and Russian.
Follow-up fixes and validation
Latest source-replacement follow-up (Windows, Go 1.26.9):
make checkand race-enabledmake testforinternal/pluginandcmd/opencodereviewpassed. CLI package tests used an isolated user home.--sourceagain.Earlier branch validation:
The earlier Workflow follow-ups are addressed:
Verified on Windows with Go 1.26.9:
make check, CLI build and race-enabledmake testforinternal/plugin,internal/config/rules,internal/agent,internal/llmloop,internal/toolandcmd/opencodereviewpassed. The final dispatch-warning adjustment also passed focused Workflow and ordinary-budget tests.The additional OCR/DeepSeek run hit its configured aggregate token budget before completing any of its nine selected files. It is recorded as incomplete, not as a clean review. The independent Delegate review covers the final patch, including the later dispatch adjustment.
The native-plugin and Workflow guides are available in English, Simplified Chinese, Japanese, Korean and Russian, including source formats, URL input, CLI commands and protocol behavior.
Credits and AI assistance
The dependency retains its original credits, including @wu21-web for tar.gz packaging and replacement-source updates. Workflow work credits @acoliver for compatibility and project-policy proposals, @MeiSiristhebest for execution/identity and platform feedback, and @chaojixinren for management-output integration.
OpenAI Codex was used for implementation, tests and documentation, with GPT-6 Astra and delegated GPT-6.1 Sol agents at xhigh. Reviews used OCR Delegate and OCR with DeepSeek.
Follow-up commit:
1ee2f033.