Skip to content

feat(autoresearch): 注册 autoresearch v0.1.0 自主实验循环插件 - #1

Open
luochang212 wants to merge 12 commits into
zai-org:mainfrom
luochang212:feat-autoresearch
Open

luochang212 wants to merge 12 commits into
zai-org:mainfrom
luochang212:feat-autoresearch

Conversation

@luochang212

@luochang212 luochang212 commented Aug 27, 2026 •

Copy link
Copy Markdown

Plugin type (required) / 插件类型(必填)

  • UI Plugin / 是 UI 插件 — provides MCP Apps interactive pages / 提供 MCP Apps 交互页面
  • Standard plugin / 普通插件(非 UI) — does not provide MCP Apps interactive pages / 不提供 MCP Apps 交互页面
  • Not applicable / 不适用 — repository-only changes; no plugin content changed / 仅仓库级改动,不涉及插件内容

Affected plugin name(s) / 涉及的插件名称:autoresearch

说明:本插件无任何 MCP Apps 声明(无 ui.surfaces、无 _meta.ui.resourceUri);dashboard 是由 MCP 工具启动、绑定 127.0.0.1 的本地 HTTP 页面,不属于 MCP Apps 交互页面。插件已按仓库目录约定放置于 external_plugins/autoresearch/。

What / 改动内容

新增 autoresearch v0.1.0:ZCode 的自主实验循环插件——设定目标与机械度量,让 coding agent 自主迭代「改代码 → 跑基准 → keep / discard → 循环」,并内置防作弊护栏。机制参考 karpathy/autoresearch 与 pi-autoresearch(README 已注明),为 ZCode 原生实现。

用户可见行为与测试方式

  • 5 个 MCP 工具:init_experiment / run_experiment / log_experiment / export_dashboard / clear_experiments
  • 5 个命令:autoresearch / export / clear / off / finalize;1 个 autoresearch skill(循环规程)
  • 5 个 hooks:Stop 续跑、PreToolUse 写保护(冻结基准)、权限门禁、UserPromptSubmit/SessionStart 记忆注入
  • 防作弊护栏四层:checks(输出正确)→ 审计不变量(账本自洽)→ 漂移检测(基准 hash)→ 次级度量约束
  • 插件自带 node --test 单测(96 用例全过);python3 scripts/validate.py 通过(46 插件)

版本与市场注册

  • .zcode-plugin/plugin.json 与根 marketplace.json 一致:name autoresearch、version 0.1.0、description / description_i18n(en + zh-CN)
  • source: ./external_plugins/autoresearch;category developer-tools;author luochang212
  • 图标登记于 assets/icon-sources.json,sha256 与现役 assets/autoresearch/icon.png 一致

依赖、网络、权限与副作用

  • 零第三方 npm 依赖:MCP server 与 hooks 均为 Node(≥22)标准库脚本;无模型 / 外部 API 依赖,无遥测
  • 副作用(README 已声明):执行用户编写的基准脚本(.auto/measure.sh)与正确性门禁(.auto/checks.sh);自动 git 操作(keep 提交、非 keep 回滚,.auto/ 豁免);export_dashboard 启动仅绑定本机回环的 HTTP 服务;写入项目目录下 .auto/ 会话状态

第三方来源与许可证

  • 插件以 MIT 许可发布;机制参考的上游项目在 README 中注明
  • 图标为原创 SVG(源文件在贡献者仓库 zcode-autoresearch 的 assets/icon.svg)

Self-check / 自查清单

注:scripts/build_dist.py 的全量本地构建因 Craft 系列 UI 插件需要 Rust 1.95 + wasm32 工具链而无法在本机完成(既有仓库环境要求,与本 PR 无关,发布 CI 会做全量构建)。本 PR 插件的构建已单独验证:validate.py 通过(46 插件);build_zip 对 autoresearch 打包正常(46 文件);插件自带单测 96 用例全过。

  • Plugin name is unique kebab-case; new external plugin directory is external_plugins/<name>/; existing fixes retain ownership / 插件名唯一且 kebab-case,外部新增插件位于 external_plugins/<name>/,已有插件修复保留原归属
  • Usage category is set independently of publisher ownership / 用途分类 category 已填写,与维护归属分开
  • Plugin type and affected names are declared above / 已在上方声明插件类型与涉及的插件名称
  • version bumped in BOTH plugin.json and marketplace.json (artifacts are immutable) / plugin.json 与 marketplace.json 两处版本号已同步升级(制品不可变)
  • README.md (EN) and README_CN.md (中文) both updated and equivalent / 中英文 README 均已更新且语义一致
  • description_i18n has both en and zh-CN / description_i18n 包含 en 与 zh-CN
  • No secrets, machine-specific paths, or private dependencies / 不含密钥、机器专属路径或私有依赖
  • Model/API/network dependencies documented / 模型、API、网络依赖已写明
  • python3 scripts/validate.py and python3 scripts/build_dist.py pass locally / 本地校验与构建均通过

- plugins/autoresearch/: 完整插件(MCP server + hooks + skills + commands,Node 标准库零依赖)
- marketplace.json: 注册条目(category developer-tools,author luochang212)
- assets/autoresearch/icon.png + icon-sources.json: 原创图标(源 SVG 见贡献者仓库 assets/icon.svg)
- 全部 .mjs → .ts:MCP server、lib(含新增 types.ts 领域类型)、hooks、测试
- 运行时零依赖不变:Node 原生剥离类型,无构建步骤
- README 同步更新(Node ≥24、目录结构、测试命令)
@luochang212

Copy link
Copy Markdown
Author

写给 zcode 的 autoresearch 插件

调研了市面上比较流行的 autoresearch 插件(主要是 pi、codex、claude code),分析它们的原理和生效机制,并让 AI(主要是 glm-5.3 和 deepseek-v4-flash)通过 spec-driven 的方式,开发新功能。为了保证开发出的能力适配 zcode,在开发之前还对 zcode 提供的能力做了调研,并实际调用 zcode 进行验证。目前 zcode-autoresearch 的版本是 v0.1.0。对于这一版,我用多个 AI 验核,确认已经实现主流 autoresearch 提供的功能。后续版本会根据在真实的环境中使用获得的反馈,持续提升 autoresearch 的效率和稳定性。

开源方式:MIT

GitHub: https://github.com/luochang212/zcode-autoresearch
Zread: https://zread.ai/luochang212/zcode-autoresearch

@panda920

Copy link
Copy Markdown
Collaborator

❌ Internal validation failed:

FAIL: 1 problem(s)
  - marketplace.json plugins[5] (autoresearch): plugin.json description_i18n does not match marketplace entry

Please fix it and push again; the check re-runs automatically.

🤖 Copy this prompt into Claude Code / Codex to fix it
You are updating my pull request #1 to github.com/zai-org/zcode-plugins (the ZCode plugin marketplace).
The maintainers' automated intake reported: `python scripts/validate.py` failed

Validator output:
FAIL: 1 problem(s)
  - marketplace.json plugins[5] (autoresearch): plugin.json description_i18n does not match marketplace entry

Fix it in this repository:
- Only change files under plugins/<my-plugin>/ and my plugin's entry in marketplace.json;
  never modify .github/, scripts/, tests/, .gitignore, .gitattributes or AGENTS.md.
- Follow CONTRIBUTING.md and AGENTS.md: the manifest lives at plugins/<name>/.zcode-plugin/plugin.json,
  its name/version must match marketplace.json, names are kebab-case, keep the required i18n fields.
- Fetch the latest main of zai-org/zcode-plugins and rebase onto it; if marketplace.json conflicts,
  keep every existing entry and re-add mine.
- Run `python scripts/validate.py` until it passes, then force-push my PR branch.

d8fc9db 的去 AI 味文案同步修改了 plugin.json 的 description 与
description_i18n,但遗漏了 marketplace.json 中的 autoresearch 条目。
内部校验(scripts/validate.py)要求两者 description_i18n 完全相等,
故校验失败。本提交将 marketplace 条目的 description 与
description_i18n 一并同步为 plugin.json 当前文案。

不涉及插件包内文件,版本保持 0.1.0。
@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; once merged it is published to the marketplace and this PR is closed automatically.

与上游 luochang212/zcode-autoresearch main 同步(96/96 测试绿):
- log_experiment 新增 revisit_nudge 与 asi.revisits_run 透传,
  dashboard 行渲染 ↻ Revisiting #N(有依据的重访可辨识)
- confidence 单源快照入账本 run 行(记录时刻可回溯)
- 记忆注入新增「弃用方向与理由」聚合行(旧 discard 的假设可复核)
- 无人值守有界续跑:unattended 规程、Stop hook 提示句、
  off/clear/finalize 清理步骤、README 边界改双层描述
  (无限 auto-resume 仍平台不可行;需用户明确授权)
- 测试 96/96;本地已跑 scripts/validate.py 通过(17 plugins)
@luochang212

Copy link
Copy Markdown
Author

已同步实现更新(1 commit,18 files):

  • discard 重访机制:log_experiment 新增 revisit_nudge 提示与 asi.revisits_run 透传;dashboard 对有依据的重访渲染 ↻ Revisiting #N 标注
  • confidence 快照:单源计算写入账本 run 行,记录时刻的置信度可事后回溯
  • 记忆注入增强:新增「弃用方向与理由」聚合行,旧 discard 的假设可被后续结果复核
  • 无人值守有界续跑:新增 unattended 规程(用户明确授权才创建、CronCreate interval+maxRuns 双参数有界、唤醒提示自包含)、Stop hook 提示句、off/clear/finalize 清理步骤;README 无人值守边界改为「Stop 3 次窗口 + 有界 cron 自唤醒」双层描述(无限 auto-resume 仍为平台不可行)
  • 测试:96/96 通过;本地 scripts/validate.py 已跑通(17 plugins validated)

版本号保持 0.1.0(首次上架,无已发布的旧版本需要区分)。

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; once merged it is published to the marketplace and this PR is closed automatically.

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; once merged it is published to the marketplace and this PR is closed automatically.

- 解决 assets/icon-sources.json 末尾追加冲突:上游新插件批次在前,autoresearch 条目收尾,合计 302 条(并集核对无丢失/重复)
- 顺手修正 autoresearch 条目 sha256:d990bd2 换正式 logo 后未同步清单,按现役 assets/autoresearch/icon.png 重算(1375e751…)
@panda920

Copy link
Copy Markdown
Collaborator

❌ Internal validation failed:

autoresearch: external submissions must use ./external_plugins/autoresearch

Please fix it and push again; the check re-runs automatically.

🤖 Copy this prompt into Claude Code / Codex to fix it
You are updating my pull request #1 to github.com/zai-org/zcode-plugins (the ZCode plugin marketplace).
The maintainers' automated intake reported: `python scripts/validate.py` failed

Validator output:
autoresearch: external submissions must use ./external_plugins/autoresearch

Fix it in this repository:
- New external plugins belong under external_plugins/<my-plugin>/; keep existing plugins in their current directory;
  never modify .github/, scripts/, tests/, .gitignore, .gitattributes or AGENTS.md.
- Follow CONTRIBUTING.md and AGENTS.md: the manifest lives at <plugin-directory>/.zcode-plugin/plugin.json,
  its name/version must match marketplace.json, names are kebab-case, keep the required i18n fields.
- Fetch the latest main of zai-org/zcode-plugins and rebase onto it; if marketplace.json conflicts,
  keep every existing entry and re-add mine.
- Run `python scripts/validate.py` until it passes, then force-push my PR branch.

- 遵循仓库目录约定:外部/社区新增插件放 external_plugins/<name>/(发布器据此生成 publisherType: community),存量插件才保留 plugins/
- marketplace.json source 同步改为 ./external_plugins/autoresearch
- 本地验证:validate.py 通过(46 插件);autoresearch zip 打包正常;插件 node --test 96 用例全过;test_mimosa_plugin 8 例失败为 main 历史遗留(干净 HEAD 复现),与迁移无关
@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

- marketplace.json:author.url(GitHub 主页)、examplePrompts / examplePrompts_i18n(对齐已合并外部插件 zcode-context 的展示字段模式)
- external_plugins/autoresearch/LICENSE:MIT 许可证文件(README 已声明 MIT,与 zcode-context 同样在插件目录内附 LICENSE)
@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants