Skip to content

feat(ar-runtime): Grok 并行领取就绪面,引擎逻辑不变 - #7

Open
johndpope wants to merge 3 commits into
EvoMap:mainfrom
johndpope:grok-scale
Open

johndpope wants to merge 3 commits into
EvoMap:mainfrom
johndpope:grok-scale

Conversation

@johndpope

@johndpope johndpope commented Sep 10, 2026

Copy link
Copy Markdown

这个 PR 做什么

ar-runtime 加一条 Grok Build 执行入口:同一套 workflow engine / MCP producer / 收据与两阶段实验协议,用 claim 池把就绪面一次性铺开,提高吞吐。Claude Code 路径和引擎状态机都不改。

为什么

Grok 的 agent() / parallel() 会阻塞到子任务结束,不必再走 ralph-loop「每轮一个 unit」。原先 Grok 侧如果串行 next-prompt,就绪面宽度 ≥ 2 时会白白排队。本 PR 让 coordinator 调已经存在的 ready + claimar-workflow-engine.py 里自组织抢占协议),按就绪面宽度 fan-out,不新增完成条件、不改 complete / after-* / execute-run 的语义。

保证(给审查者):

  • 不改引擎队列、租约、收据、盲审门槛、critic 双模型、pilot→main 两阶段。
  • 不改 MCP 写入 review.md / critic.md 的 producer 边界。
  • Claude Code 仍读 ar-runtime/.claude/;Grok 只新增 .grok/ar-runtime/.grok/config.toml
  • 吞吐来自「同一 DAG 上并行领取已就绪单元」,不是换一套研究逻辑。

怎么验证的

新增 tests/test_grok_runtime_port.py(4 个用例):Grok skills/agents/workflows 存在、coordinator 走 ready/claim/parallel 且不含 next-prompt、reviewer/critic 无 Write、MCP 配置指向现有 bun server。

维护者在 rebase 后的 head 上跑过全套离线检查(2026-09-14):

ruff check .                                   通过
python -m pytest tests/ ar-runtime/scripts/tests/ -q   959 passed
python scripts/check_model_references.py       通过
python scripts/render_env.py --check           通过
python scripts/secret_scan.py .                通过
python scripts/check_release_tree.py .         通过
python scripts/check_public_knowledge.py .     通过

Grok 的配置段、workflow 函数(agent / parallel / budget / fingerprint / json_encode / pause / complete)和 agent_type / capability_mode / output_schema 字段,对照 xai-org/grok-build 的 xai-workflow/src/engine.rshost.rs 核过,都存在。

没有在本机跑完整 GPU 实验,也没有装 grok CLI 做端到端;引擎契约测试仍以 ar-runtime/.claude/ 为 Claude 入口。

范围自查

  • 标题是单一关注点,没有用「、」「以及」串起不相干的改动
  • 每个 commit 单独能通过测试,可单独 revert
  • 没有夹带无关改动(顺手的重构、格式化、临时文件)
  • 声称"完成"的部分看过实际运行或渲染结果,不是只读了源码

未勾选「实际运行」,是因为只做了 canned-host 冒烟,没有端到端实验。

维护者改动记录

2026-09-14 由维护者 rebase 到当前 main 并 force-push 回本分支,原 head 是 b78b997

  • 去掉了分支上重放的 docs: 展示 Trendshift Python 日榜徽章 #3fix: render an empty dashboard when no projects exist #6 副本和两个作者字段填错的 quickstart 文案 commit,后者的两处 README 措辞改为由维护者本人提交。
  • 去掉了 en updates / ok 两个把 ar-runtime/.claude/ 译成英文的 commit:coordinator SKILL.md 只译了一半,且让 6 个按中文字符串断言的契约测试变红。翻译请另开 PR,并同步改 tests/test_run_stage_contract.pytest_coordinator_async_agent_contract.pytest_review_binding_producer.pytest_critic_binding_producer.pytest_coordinator_idea_provenance.py 里的断言。
  • Grok 相关的两个 commit 原样保留,作者不变。

关联

Mike-7777777 and others added 3 commits September 14, 2026 11:55
Add Grok-native agents and skills under .grok/, MCP config for both
repo-root and ar-runtime cwd, an engine-driven ar-coordinator workflow
as the ralph-loop stand-in, and ar-experiment-matrix for parallel seeds.
Claude Code copies in ar-runtime/.claude/ stay in place.
Replace the serial next-prompt loop and "do not spawn" leaf prompts with
waves of parallel engine claim workers over the ready-front. Subcoder and
experiment-matrix panels follow the same fan-out (up to 32). The parent
workflow/session is what scales; children stay leaves because Grok cannot
nest subagents.
@Mike-7777777

Copy link
Copy Markdown
Collaborator

感谢这个 PR。Grok 部分对照 xai-org/grok-build 源码核过,配置段、workflow 函数和 agent 选项字段都对得上,引擎一行没动,ready / claim / heartbeat / release 在 main 上本来就有。

我把分支 rebase 到当前 main 并 force-push 回了 grok-scale(原 head b78b997),改动见 PR 正文「维护者改动记录」:

  1. 去掉分支上重放的 docs: 展示 Trendshift Python 日榜徽章 #3fix: render an empty dashboard when no projects exist #6 副本,页面 diff 从 36 个文件收到 19 个。
  2. 去掉 en updates / ok 两个翻译 commit。coordinator SKILL.md 只译了一半(仍有 339 行中文),并且 6 个按中文字符串断言的契约测试在这条分支上是红的,只是 fork 的 CI 需要维护者批准才跑,页面上看不见。翻译欢迎另开 PR,同时改对应测试。
  3. 两处 quickstart README 措辞保留,改由我本人提交。

rebase 后全量 959 个测试和 ruff、secret scan、release tree、public knowledge 检查都过。

合并前还想请你补两样:

  • grok inspect --json 在仓库根的输出。Grok 默认开启 compat.claude.skillscompat.claude.agents,会连 ar-runtime/.claude/ 一起扫,.grok/.claude/ 里的 ar-coordinator、ar-coder 等同名,需要证据说明哪一份生效。
  • 那次 canned-host 冒烟的日志或截图。

本地拉最新分支前先 git fetch,再 git reset --hard origin/grok-scale

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