Skip to content

Commit 81ab00c

Browse files
committed
feat(cli): default init/update to all five hosts
Bare init/update now use cmdInit with includeExtended so Gemini and Grok are deployed by default (including Grok user plugin sync), without routing through cmdInitHost(all) collision. Document and registry tests updated.
1 parent 0878b60 commit 81ab00c

9 files changed

Lines changed: 40 additions & 23 deletions

File tree

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DevCodex
22

3-
> AI 开发规范注入器 — 从 Copilot / Claude Code 双主支持升级为 Copilot / Claude Code / Codex 三宿主支持(Hook-First / Instruction-Fallback)
3+
> AI 开发规范注入器 — 默认五宿主:Copilot / Claude Code / Codex / Gemini / Grok(Hook-First / Instruction-Fallback)
44
55
[![npm](https://img.shields.io/badge/npm-%40vextjs%2Fdevcodex-blue)](https://github.com/vextjs/devcodex)
66
[![License](https://img.shields.io/badge/license-AGPL--3.0-green)](LICENSE)
@@ -169,7 +169,7 @@ export NODE_AUTH_TOKEN=YOUR_GITHUB_PAT
169169

170170
```bash
171171
npm install @vextjs/devcodex@1.15.3
172-
npx @vextjs/devcodex init # 默认三宿主部署:Copilot + Claude Code adapter + Codex adapter
172+
npx @vextjs/devcodex init # 默认五宿主部署:Copilot + Claude + Codex + Gemini + Grok
173173
npx @vextjs/devcodex init --claude # 仅 Claude Code adapter
174174
npx @vextjs/devcodex init --codex # 仅 Codex adapter
175175
```
@@ -584,7 +584,7 @@ README / 用户使用文档当前补充四类专项 Skill:`user-manual-authori
584584
| **OpenAI Codex app/CLI** | `AGENTS.md` + `.agents/skills/` + `.codex/hooks.json`(含 `PreCompact` compaction guardrail) | ⚠️ Codex hook guardrail;阻断输出按事件契约分为顶层 `decision`、`continue:false` 与工具级 `permissionDecision` | ⚠️ Hook + 文本确认 | ✅ `init/update --codex` 向 `.codex/config.toml` merge `devcodex-memory` + `devcodex-profile`(复用 `.claude/mcp/*`);可手工覆盖 | 🟡 Beta |
585585
| **ChatGPT 普通对话** | 不读取本地工作区 `AGENTS.md` / `.agents/` / `.codex/`;可手工粘贴规则 | ❌ | ⚠️ 文本 | ❌ | 🔴 Unsupported |
586586

587-
> **安装命令**:v1.15.3 默认三宿主部署 → `npx @vextjs/devcodex init`;仅 Claude Code adapter → `npx @vextjs/devcodex init --claude`;仅 Codex adapter → `npx @vextjs/devcodex init --codex`。需要显式增加 Gemini / Grok 时使用 `npx @vextjs/devcodex init --host <gemini|grok|all>` 或本地源码 `node index.js init --host <gemini|grok|all>`,默认面仍保持三宿主兼容行为。
587+
> **安装命令**:默认**五宿主**部署 → `npx @vextjs/devcodex init` / `update`(copilot+claude+codex+gemini+grok;Grok 含用户级 plugin 同步)。单宿主 → `npx @vextjs/devcodex init --host <copilot|claude|codex|gemini|grok>` 或 `--claude` / `--codex` 等别名。本地源码可用 `node index.js init|update`。缩范围请用单宿主命令循环,不支持逗号多 host 语法。
588588
>
589589
> **Grok workspace 插件**:在 `workspace-namespace` 的工作区或任一子项目执行 `update --host grok`,CLI 都把 kernel、Skills、薄插件和 managed manifest 写到同一工作区 owner。薄插件 source 位于 `.grok/devcodex/plugins/devcodex-workspace`,不会被 project auto-discovery 再发现,只由 Grok 官方本地插件登记形成一个 user identity。旧 `.grok/plugins/devcodex-workspace` 登记会先通过官方 CLI 迁移,新安装 digest 验证后旧 source 才可逆移动到 `.tmp/backups`;失败走旧 source/registration/config 回滚。用户 Grok 配置只维护 DevCodex enabled 项和新旧受管 path 清理,其他设置、注释和插件保持不变,重复执行幂等。`uninstall --host grok` 只解除当前官方登记与受管配置,保留 canonical workspace source。工作区根可直接运行 `grok`;子 Git 项目要获得完整 kernel 保证时运行 `devcodex grok [原 Grok 参数]`。launcher 先消费官方 `--cwd` 决定真实 owner,校验 root kernel,且只在子 Git 边界追加官方 `--rules`;用户额外 rules 会合并,system prompt override 与重复 cwd 会因破坏保证而拒绝。root native、plain child 与 launcher 证据严格分开。
590590
> `doctor/status` 诊断将 workspace plugin 的 source+registration 可用性与 installed digest 新鲜度分开:digest drift 只作为 warning 和刷新建议,不再把已登记且可用的 adapter 误报为未安装。

‎changelogs/unreleased.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
## 当前未发布实现候选
77

8+
- **CLI 默认五宿主(A2)**:bare `devcodex init` / `update` 经 `cmdInit({ includeExtended: true })` 部署 copilot+claude+codex+gemini+grok(含 Grok `installed-plugins` digest 同步);**不**绑 `cmdInitHost('all')`(避免 bare init 触发 `HOST_INSTRUCTION_COLLISION`)。`--host copilot` 显式 `includeExtended: false`。`test-cli-command-registry` 断言第二参 opts。help/README/host-instruction-projection 文案同步。需求:`Grok插件随update自动同步` CP1 A2 / CP2 v0.3。
89
- **C16 TTFV + WorkspaceRootScanBan(PI-20260724-01)**:GrokTurnChecklist 增加 `scan-hygiene` / `ttfv-first-delivery`;Hook `neverApprove` 拦截 monorepo/workspace 根递归 inventory(绝对根路径、`dir /s`、cwd=根时的相对 `-Recurse`/`-Depth`);SC16 与 `17-compliance`/`01-common`/website 消费者对齐;探针与 Hook 一级子路径一致;`test:host-parity` 纳入回归矩阵。
910
- **意图驱动五宿主能力映射**:新增 active `host-capability-routing`、`CapabilityIntentDecisionV1`、`HostLeverCatalogV1`、`OriginalInstructionRefV1`、8-row local catalog 与纯校验器;薄 Rule 保留原指令权威、portable-first、CP/Auto/S01~S07 边界,5 个逻辑宿主/8 个 variant 在证据未知、过期、重复或 MCP absent 时 fail closed。当前 canonical native eligible=0,Phase 1 不新增 MCP primitive;README/website 明确收益、catalog/证据/消费者维护代价与 MCP Tool 升级阈值。
1011
- **运行态产物分层存储与索引**:新增内容寻址 partition / immutable manifest / 原子 pointer 公共契约,以及 memory、runtime-state、report 三个 domain adapter;旧 Markdown/files 与 reader 保持,stale/corrupt 自动回退且 query 零写入。memory 10 Tools 不变,仅 additive `indexReceipt/coverage`;status/doctor 使用 compact projection;report 只扫描 allowlisted roots、默认 primary metadata,宽分页通过 `snapshotCursor` 固定 manifest,正文按 pointer/batch lazy hydrate,metadata-only 可用 compact projection。真实 3 进程 ×(5 warmup + 30 measurement)benchmark 的 W1/W3/W4 总读取量减少 91.45% / 90.76% / 98.98%,公共投影 mismatch=0;W2 延迟为观测项。W5 宽查询 smoke accepted:W5A/W5B 总读取下降 81.22% / 82.42%,W5C 全文 0 截断且总读取下降 48.88%,W5D compact 响应体下降 41.92%;token telemetry 不可见,结论仅声明 bytes/latency。

‎scripts/lib/cli-command-registry.js‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,24 @@ function runCliCommand({ cmd, argv, registry, runMigrateLayout, process, c, cons
8080
}
8181

8282
if (cmd === 'init') {
83-
if (selection.host) registry.cmdInitHost(selection.host,
84-
selection.host === 'codex' && argv.includes('--codex') ? ['--force', ...selection.cleanedArgv] : selection.cleanedArgv)
85-
else registry.cmdInit(argv)
83+
if (selection.host) {
84+
registry.cmdInitHost(selection.host,
85+
selection.host === 'codex' && argv.includes('--codex')
86+
? ['--force', ...selection.cleanedArgv]
87+
: selection.cleanedArgv)
88+
} else {
89+
// A2: default five hosts via includeExtended. Do NOT use cmdInitHost('all') —
90+
// that path runs hostEntryCollision and hard-fails bare init on kernel drift.
91+
registry.cmdInit(selection.cleanedArgv, { includeExtended: true })
92+
}
8693
return 'init'
8794
}
8895
if (cmd === 'update') {
89-
if (selection.host) registry.cmdInitHost(selection.host, ['--force', ...selection.cleanedArgv])
90-
else registry.cmdInit(['--force', ...argv])
96+
if (selection.host) {
97+
registry.cmdInitHost(selection.host, ['--force', ...selection.cleanedArgv])
98+
} else {
99+
registry.cmdInit(['--force', ...selection.cleanedArgv], { includeExtended: true })
100+
}
91101
return 'update'
92102
}
93103
if (cmd === 'uninstall') {

‎scripts/lib/cli-install-commands.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,8 @@ function buildCliInstallCommands(ctx) {
10511051
if (normalized === 'grok') return cmdInitGrok(argv)
10521052
const scopedOperation = () => {
10531053
if (normalized === 'all') return cmdInit(argv, { includeExtended: true, ownerResolved: true })
1054-
if (normalized === 'copilot') return cmdInit(argv, { copilotOnly: true, ownerResolved: true })
1054+
// Explicit includeExtended:false — never inherit a future default of true (copilot isolation).
1055+
if (normalized === 'copilot') return cmdInit(argv, { copilotOnly: true, includeExtended: false, ownerResolved: true })
10551056
if (normalized === 'claude') return cmdInitClaude(argv)
10561057
if (normalized === 'codex') return cmdInitCodex(argv)
10571058
return cmdInitGemini(argv)

‎scripts/lib/cli-maintenance-commands.js‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -794,11 +794,11 @@ function buildCliMaintenanceCommands(ctx) {
794794
npx @vextjs/devcodex <command> [options] ${c.dim('(without npm link)')}
795795
796796
${c.bold('Commands:')}
797-
${c.cyan('init')} Install Copilot files, then deploy Claude Code and Codex adapters
797+
${c.cyan('init')} Install all five hosts (copilot+claude+codex+gemini+grok)
798798
${c.cyan('init --claude')} Install Claude Code adapter only
799799
${c.cyan('init --codex')} Install Codex adapter only
800800
${c.cyan('init --host <id>')} Install copilot|claude|codex|gemini|grok|all
801-
${c.cyan('update')} Overwrite Copilot files, then deploy Claude Code and Codex adapters
801+
${c.cyan('update')} Refresh all five hosts (force; includes Grok user plugin sync)
802802
${c.cyan('update --claude')} Overwrite Claude Code adapter only
803803
${c.cyan('update --codex')} Overwrite Codex adapter only
804804
${c.cyan('update --host <id>')} Refresh one host or all five hosts
@@ -830,12 +830,13 @@ function buildCliMaintenanceCommands(ctx) {
830830
${c.dim('--json')} Emit one DevCodexCliEnvelopeV1 document for supported commands
831831
832832
${c.bold('Examples:')}
833-
devcodex init # First-time three-host install
833+
devcodex init # First-time five-host install
834834
devcodex init --claude # Claude Code adapter only
835835
devcodex init --codex # Codex adapter only
836-
devcodex init --host gemini # Gemini CLI adapter only
836+
devcodex init --host gemini # Gemini CLI adapter only (same hosts as bare when using --host all)
837837
devcodex init --host grok # Grok Build adapter only
838-
devcodex update --host all # Refresh all five host adapters
838+
devcodex update # Refresh all five hosts (default)
839+
devcodex update --host all # Explicit five-host refresh (same host set as bare update)
839840
devcodex uninstall --host grok --dry-run # Preview safe Grok deregistration
840841
devcodex grok # Full-evidence Grok launcher for workspace child projects
841842
devcodex grok -p "Review this diff" --output-format json

‎scripts/test-cli-command-registry.js‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ const { createCliCommandRegistry, parseHostSelection, runCliCommand } = require(
66

77
const calls = []
88
const handlers = Object.fromEntries([
9-
'cmdInit', 'cmdInitClaude', 'cmdInitCodex', 'cmdGrok', 'cmdStatus',
9+
'cmdInitClaude', 'cmdInitCodex', 'cmdGrok', 'cmdStatus',
1010
'cmdProfileInit', 'cmdDoctor', 'cmdProbe', 'cmdTrace', 'cmdSkill', 'cmdTask', 'cmdHelp'
1111
].map(name => [name, argv => calls.push([name, argv])]))
12+
// Capture opts so bare five-host routing cannot silently drop includeExtended (V-registry).
13+
handlers.cmdInit = (argv, opts) => calls.push(['cmdInit', argv, opts])
1214
handlers.cmdInitHost = (host, argv) => calls.push(['cmdInitHost', host, argv])
1315
handlers.cmdUninstallHost = (host, argv) => calls.push(['cmdUninstallHost', host, argv])
1416
const registry = createCliCommandRegistry(handlers)
@@ -27,7 +29,9 @@ assert.deepStrictEqual(calls.pop(), ['cmdInitHost', 'gemini', ['--dry-run']])
2729
assert.strictEqual(runCliCommand({ cmd: 'update', argv: ['--grok'], registry, runMigrateLayout: migrate, process: fakeProcess, c, console: logger }), 'update')
2830
assert.deepStrictEqual(calls.pop(), ['cmdInitHost', 'grok', ['--force']])
2931
assert.strictEqual(runCliCommand({ cmd: 'init', argv: [], registry, runMigrateLayout: migrate, process: fakeProcess, c, console: logger }), 'init')
30-
assert.deepStrictEqual(calls.pop(), ['cmdInit', []])
32+
assert.deepStrictEqual(calls.pop(), ['cmdInit', [], { includeExtended: true }])
33+
assert.strictEqual(runCliCommand({ cmd: 'update', argv: ['--dry-run'], registry, runMigrateLayout: migrate, process: fakeProcess, c, console: logger }), 'update')
34+
assert.deepStrictEqual(calls.pop(), ['cmdInit', ['--force', '--dry-run'], { includeExtended: true }])
3135
assert.strictEqual(runCliCommand({ cmd: 'profile', argv: ['init', '--prod'], registry, runMigrateLayout: migrate, process: fakeProcess, c, console: logger }), 'profile-init')
3236
assert.deepStrictEqual(calls.pop(), ['cmdProfileInit', ['--prod']])
3337
assert.strictEqual(runCliCommand({ cmd: 'profile', argv: ['plan', '--tier', 'profile-standard'], registry, runMigrateLayout: migrate, process: fakeProcess, c, console: logger }), 'profile-plan')

‎skills/host-instruction-projection/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ full fallback 是兼容/故障路径,不得与 kernel 同时作为两个 alway
108108

109109
- 公共选择器:`--host <copilot|claude|codex|gemini|grok|all>`。
110110
- 旧 `--claude`、`--codex` 保留;`--gemini`、`--grok` 为等价 alias。
111-
- 无 selector 的 init/update 继续部署 Copilot+Claude+Codex;只有 `--host all` 部署五宿主。
111+
- 无 selector 的 init/update **默认部署五宿主**(copilot+claude+codex+gemini+grok,经 `cmdInit({ includeExtended: true })`);`--host all` 显式全量(init 无 force 时仍可能 `HOST_INSTRUCTION_COLLISION`,与 bare init 的 soft-skip 路径不同)。
112112
- 重复或冲突 selector 使用 `CLI_HOST_SELECTION_CONFLICT`;未知 host 使用 `CLI_HOST_UNSUPPORTED`。
113113
- managed manifest 必须记录 projection source/content digest,并保证规范化物理 destination 单一 current owner;dry-run 零写入;从 source cwd 与目标项目 cwd 分别验证边界。
114114
- workspace-namespace 从 child project 调用默认、单宿主或 `--host all` install/update 时,所有非 portable target/manifest owner 必须解析为 workspace root;Grok uninstall 与 status/doctor 也消费相同 scope identity。uninstall 不删除 workspace source。

‎website/docs/index.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pageType: home
44
hero:
55
name: DevCodex
66
text: AI 开发工作流规范注入器
7-
tagline: 默认适配 Copilot / Claude Code / Codex,并可显式扩展 Gemini / Grok 的统一开发工作流
7+
tagline: 默认适配 Copilot / Claude Code / Codex / Gemini / Grok 五宿主的统一开发工作流
88
actions:
99
- theme: brand
1010
text: 开始使用
@@ -18,8 +18,8 @@ features:
1818
details: 8 种工作流(dev/fix/audit/analyze/self-fix/resume/plan/chat),执行流程骨架已冻结
1919
- title: 🛠️ 83 个 Skills
2020
details: 当前源码维护 80 active + 3 gray;新增 active `host-capability-routing`,以 portable-first 方式把用户意图映射到五宿主 8 个 surface variant,证据不足时不冒充 native;另有 `requirement-parallel-orchestration`,用于多需求并行前的独立性判定、共享面锁图、LaunchCard 与汇合协议;active `repair-prevention-assessment` 负责所有 repair 的完成门禁,gray `rework-prevention-engineering` 只负责长期效果试验,gray `brand-visual-quality` 承接品牌视觉资产质量,其余覆盖开发、修复、审计、规范吸纳执行、跨仓消费者验证、用户侧文档 review 聚合、`expert-output-quality` 专家型产物质量与 21 个专家 Owner Skill,以及宿主契约验证、真相源-消费者同步
21-
- title: 🧩 默认三宿主、可选五宿主
22-
details: Copilot、Claude Code、Codex 默认部署;v1.15.3 可显式增加 Gemini / Grok。五宿主共用精简 kernel、按需 Skills 与完整回退,Hook 能力按宿主/事件降级并受 direct/fixture/instruction-backed 证据上限约束
21+
- title: 🧩 默认五宿主
22+
details: `init` / `update` 默认部署 Copilot、Claude Code、Codex、Gemini 与 Grok(含 Grok 用户级 plugin 同步);也可用 `--host <id>` 只刷单宿主。五宿主共用精简 kernel、按需 Skills 与完整回退,Hook 能力按宿主/事件降级并受 direct/fixture/instruction-backed 证据上限约束
2323
- title: 🔒 四层合规检查
2424
details: FC(形式合规)→ SC(实质合规)→ RC(恢复性检查)→ T(任务完成验证);chat 仅保留记忆与 dev 预检查
2525
- title: 🧠 跨会话记忆

‎website/docs/intro/index.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## DevCodex 是什么
88

9-
DevCodex 是通过 npm 包和 CLI 分发的 AI 开发规范注入器。默认安装适配 Copilot、Claude Code 与 Codex;v1.15.3 还可显式增加 Gemini CLI / Grok Build adapter。所有宿主从同一真相源生成精简入口,按意图读取 Skills,证据不足时回退完整规范。
9+
DevCodex 是通过 npm 包和 CLI 分发的 AI 开发规范注入器。默认 `init` / `update` 部署五宿主:Copilot、Claude Code、Codex、Gemini CLI 与 Grok Build(Grok 含用户级 plugin 同步);也可用 `--host <id>` 只安装或刷新单宿主。所有宿主从同一真相源生成精简入口,按意图读取 Skills,证据不足时回退完整规范。
1010

1111
站点同时保留稳定规范和版本化维护资料;历史版本目录中的旧需求页只代表当时基线,不等同于当前实现。当前安装、命令和宿主支持以仓库 [README](https://github.com/vextjs/devcodex#安装) 与当前发布版本为准。
1212

@@ -17,7 +17,7 @@ DevCodex 是通过 npm 包和 CLI 分发的 AI 开发规范注入器。默认安
1717
> 版本语义:npm package 当前发布版本是 **v1.15.3**;站内 **1.0.1** 是活动需求文档版本。当前版本仅发布到 GitHub Packages,安装需要 `read:packages` 认证;Gemini / Grok 通用宿主选择器随 v1.15.3 发布。
1818
1919
1. 确认 Node.js >=18;按 [安装说明](https://github.com/vextjs/devcodex#5-分钟快速开始) 配置 `@vextjs:registry=https://npm.pkg.github.com` 与当前 shell 的 `NODE_AUTH_TOKEN`。
20-
2. 安装并从目标项目初始化三宿主规范,然后执行 status:
20+
2. 安装并从目标项目初始化五宿主规范,然后执行 status:
2121

2222
```bash
2323
npm install @vextjs/devcodex
@@ -47,7 +47,7 @@ npx @vextjs/devcodex init --codex
4747
| 工作流行为可审计 | 通过报告、audit-state 与合规检查形成可追溯闭环 |
4848
| 规范随代码版本化 | 用版本文档管理规范演进与实现边界 |
4949
| 跨项目复用 | 普通仓库安装到项目根;workspace-namespace 安装到共享 owner 根,并用 `update` 同步受管规范 |
50-
| 多宿主一致入口 | 默认 Copilot、Claude Code 与 Codex,显式选择时增加 Gemini / Grok;五宿主共用同一规范源与精简投影,Hook 能力按宿主/事件降级,并按官方输出契约区分顶层 block、`continue:false` 与工具级 deny |
50+
| 多宿主一致入口 | 默认五宿主(Copilot / Claude Code / Codex / Gemini / Grok);可用 `--host` 缩到单宿主;共用同一规范源与精简投影,Hook 能力按宿主/事件降级,并按官方输出契约区分顶层 block、`continue:false` 与工具级 deny |
5151
| 上下文成本可控 | always-on 入口使用有 coverage 与预算约束的精简 kernel;Claude / Gemini 仅保留薄 wrapper,具体流程按意图加载 Skills,完整规范作为 fail-closed fallback |
5252
| 长任务停滞可诊断 | `TurnLivenessRecoveryGate` 区分运行、等待续接、可疑、可恢复停滞与终态,记录工具租约、continuation ACK 和 checkpoint;Hook 只在事件到达时观察,不承诺自行唤醒宿主或自动重放写操作 |
5353
| 文件真相源优先 | `MemoryCannotSatisfyBootstrapGate` 要求宿主 Memories、模型长期偏好或交接卡只作为 `navigation-hint`,新线程 / resume / summary 恢复仍读取 Profile、tasks、reports 和源码 / 文档真相源 |

0 commit comments

Comments
 (0)