@pm_zhousl/xinyun-ai-init 1.7.2 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/init/xinyun-ai-init/README.md +21 -1
- package/init/xinyun-ai-init/rules/directory-self-completion.md +8 -0
- package/init/xinyun-ai-init/rules/init-rules.md +11 -0
- package/init/xinyun-ai-init/rules/session-workbench.md +19 -0
- package/init/xinyun-ai-init/rules/upgrade-rules.md +10 -0
- package/init/xinyun-ai-init/templates/AGENTS.template.md +11 -0
- package/init/xinyun-ai-init/templates/core-rules.template.md +19 -0
- package/init/xinyun-ai-init/templates/current-task.template.md +25 -0
- package/init/xinyun-ai-init/templates/init-result.template.json +14 -1
- package/init/xinyun-ai-init/templates/managed-baseline.template.json +2 -2
- package/init/xinyun-ai-init/templates/manifest.template.json +42 -7
- package/init/xinyun-ai-init/templates/project-check.template.md +15 -0
- package/init/xinyun-ai-init/templates/project-guide.template.md +13 -0
- package/init/xinyun-ai-init/templates/project-index.template.json +19 -0
- package/init/xinyun-ai-init/templates/role-execution.template.md +18 -0
- package/init/xinyun-ai-init/templates/role-session-binding.template.json +43 -0
- package/init/xinyun-ai-init/templates/task-index.template.json +8 -0
- package/init/xinyun-ai-init/templates/team/README.md +10 -0
- package/init/xinyun-ai-init/templates/team/assignments.json +6 -1
- package/init/xinyun-ai-init/version.json +2 -2
- package/package.json +1 -1
- package/scripts/verify-init-package.js +172 -23
- package/scripts/verify-rules-package.js +62 -8
- package/test-scenarios/README.md +8 -4
- package/test-scenarios/review-template.md +11 -3
- package/test-scenarios/scenarios.md +76 -4
- package/test-scenarios/v1.7.3-scenarios.md +79 -0
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ npx --yes @pm_zhousl/xinyun-ai-init@latest --force
|
|
|
24
24
|
npm run verify:init
|
|
25
25
|
npm run verify:rules
|
|
26
26
|
npm run verify:rules -- --json
|
|
27
|
-
npm run verify:rules -- --tarball ./pm_zhousl-xinyun-ai-init-1.7.
|
|
27
|
+
npm run verify:rules -- --tarball ./pm_zhousl-xinyun-ai-init-1.7.3.tgz
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
`verify:rules` 为只读规则包一致性检查,不自动修复、不安装依赖、不修改 Git 或业务代码。
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
本目录是“欣芸技术开发 Agent 流”的初始化包,负责把完整 AI 执行要求下发到目标项目。
|
|
4
4
|
|
|
5
|
-
当前规则版本:`1.7.
|
|
5
|
+
当前规则版本:`1.7.3`。
|
|
6
6
|
|
|
7
7
|
## Codex 一句话入口
|
|
8
8
|
|
|
@@ -19,6 +19,8 @@ npx --yes @pm_zhousl/xinyun-ai-init@latest --force
|
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
v1.7.2 fixed task contract keys: `taskKind=initialization-main`, `taskKind=initialization-record`, `taskKind=role-execution`.
|
|
22
|
+
v1.7.3 fixed Codex role session contract keys: `provider=codex`, `sessionStatus=pending/creating/created/onboarding/ready/blocked/failed/closed`, `roleSessionIdempotency={taskId,roleId,provider,targetVersion}`.
|
|
23
|
+
v1.7.3 Codex role session orchestration is host-level only; CLI still only creates `xinyun-ai-init/`.
|
|
22
24
|
|
|
23
25
|
执行上面的命令后,会生成 `xinyun-ai-init/`。随后让 AI 读取 `xinyun-ai-init/README.md` 即可。
|
|
24
26
|
|
|
@@ -1015,6 +1017,24 @@ CodeGraph 状态只能是 `initialized`、`healthy`、`missing`、`unavailable`
|
|
|
1015
1017
|
|
|
1016
1018
|
CodeGraph 失败时,不自动安装 CodeGraph,不修改系统环境,不修改业务代码、数据库、API、配置、依赖或 Git。相同项目、相同 `codeGraphRecordId` 和相同失败状态只提示一次;命令、权限、服务或索引状态变化后才允许再次提示或重试。
|
|
1017
1019
|
|
|
1020
|
+
## v1.7.3 Codex 角色会话自动创建与绑定
|
|
1021
|
+
|
|
1022
|
+
v1.7.3 在 v1.7.2 已创建或恢复 5 个 `role-execution` 本地任务之后,由 Codex 主会话尝试创建 5 个真实角色子会话:`project-owner`、`project-product`、`chief-engineer`、`programmer`、`test-reviewer`。这是 Codex 宿主编排规则,不是 npm CLI 行为;CLI 边界保持不变,只创建 `xinyun-ai-init/`。
|
|
1023
|
+
|
|
1024
|
+
会话绑定固定登记到 `xinyun-ai/sessions/role-session-bindings.json`,角色会话目录为 `xinyun-ai/sessions/roles/`,模板为 `xinyun-ai-init/templates/role-session-binding.template.json`。`manifest.json`、`project-index.json`、`task-index.json`、角色任务和 `assignments.json` 必须引用同一绑定记录。
|
|
1025
|
+
|
|
1026
|
+
每个绑定至少记录:`bindingId`、`taskId`、`roleId`、`sessionId`、`parentSessionId`、`provider`、`targetVersion`、`sessionStatus`、`understandingStatus`、`confirmationStatus`、`executionEligible`、`idempotencyKey`、`hostCapability`、`createdAt`、`updatedAt`、`failure`、`degradation` 和 `audit`。
|
|
1027
|
+
|
|
1028
|
+
`provider=codex`。`sessionStatus=pending/creating/created/onboarding/ready/blocked/failed/closed`。会话幂等键固定为 `taskId + roleId + provider + targetVersion` 的 JCS-SHA-256;重复升级或重复初始化必须优先复用已有真实会话和绑定,不得创建重复角色会话。
|
|
1029
|
+
|
|
1030
|
+
真实 `sessionId` 必须来自 Codex 宿主创建会话后的返回值;不得伪造 sessionId,不得用任务 ID、角色 ID、占位符或历史摘要冒充真实会话。Codex 宿主不支持创建子会话、创建接口不可用或权限不足时,只能记录 `local-degraded-no-fake-session-id`,保持 `sessionId=null`,并写入 `sessionStatus=blocked` 或 `failed`、`degradation.reason` 和 `nextAction`。
|
|
1031
|
+
|
|
1032
|
+
创建成功后角色会话先进入 `onboarding`,且只读读取入口规则、角色任务、职责确认和角色理解资料。`sessionStatus=ready` 只有在真实 sessionId 已回写、职责理解完成、职责确认完成、成员/会话绑定有效、确认门禁和执行资格全部满足后才允许写入。创建成功不等于业务代码修改授权。
|
|
1033
|
+
|
|
1034
|
+
会话创建成功但回写失败时,必须记录 `created-but-writeback-failed`、可查询恢复线索和真实 `sessionId` 来源;下次按幂等键查询并恢复绑定。单角色创建、回写或 onboarding 失败不得影响其他角色,失败角色单独进入 `blocked` 或 `failed`。
|
|
1035
|
+
|
|
1036
|
+
任务界面、`current-task.md`、`init-result.json` 和项目索引必须展示 5 个角色会话入口、`sessionId`、`sessionStatus`、理解进度和阻塞原因。普通咨询不创建角色会话,不写绑定文件,不创建外部账号或第三个会话。
|
|
1037
|
+
|
|
1018
1038
|
## 自我学习
|
|
1019
1039
|
|
|
1020
1040
|
AI 可以沉淀项目经验,但不能自己升级正式规则。
|
|
@@ -49,3 +49,11 @@
|
|
|
49
49
|
- 同步校验 `task-index.json`、`current-task.md`、`manifest.json` 和 `project-index.json` 的角色执行任务路径与索引。
|
|
50
50
|
- 活动角色任务不可执行时仍保留在 `activeTaskIds`;只有活动列表为空才允许 current-task 为 idle/null。
|
|
51
51
|
- 逐角色临时文件和索引必须原子写入;发现中断、冲突或写入失败时保留恢复记录,不清空活动任务。
|
|
52
|
+
|
|
53
|
+
## v1.7.3 角色会话绑定目录
|
|
54
|
+
|
|
55
|
+
- Codex 角色会话绑定触发后,按需补齐 `xinyun-ai/sessions/`、`xinyun-ai/sessions/roles/` 和 `xinyun-ai/sessions/role-session-bindings.json`。
|
|
56
|
+
- 绑定模板来源固定为 `xinyun-ai-init/templates/role-session-binding.template.json`。
|
|
57
|
+
- `manifest.json`、`project-index.json` 和 `task-index.json` 必须登记 `roleSessions`、`roleSessionBindingIds`、`roleSessionBindings`、`provider=codex` 和 `sessionStatus` 枚举。
|
|
58
|
+
- 绑定目录只保存 Codex 宿主返回的真实 `sessionId` 摘要、onboarding 状态、失败原因和 audit,不保存伪造 sessionId。
|
|
59
|
+
- 宿主不支持创建子会话时,仍可补齐本地目录和降级记录,状态使用 `local-degraded-no-fake-session-id`。
|
|
@@ -63,3 +63,14 @@
|
|
|
63
63
|
- `activeTaskIds` 包含未完成角色任务;`executableTaskIds` 只包含真正满足执行条件的任务。活动任务非空时不得写 `current-task.status=idle` 或 `taskId=null`。
|
|
64
64
|
- 任务选择按 priority、createdAt、roleId、taskId 稳定排序;角色默认 priority 为 10、20、30、40、50。
|
|
65
65
|
- 重复升级按逐角色 JCS-SHA-256 幂等键复用任务。写入失败记录 `blockedReason=write-failed`;部分成功为 `partial`,全失败为 `blocked`;索引失败时保留活动任务并在下次恢复。
|
|
66
|
+
|
|
67
|
+
## v1.7.3 Codex 角色会话初始化
|
|
68
|
+
|
|
69
|
+
- 只有 5 个 `role-execution` 本地任务已存在或已按幂等键恢复后,才允许 Codex 主会话尝试创建真实角色子会话。
|
|
70
|
+
- 角色会话固定为 `project-owner`、`project-product`、`chief-engineer`、`programmer`、`test-reviewer` 五个,不创建第三个类型的会话。
|
|
71
|
+
- 会话创建属于 Codex 宿主编排规则,CLI 仍只创建 `xinyun-ai-init/`。
|
|
72
|
+
- 创建或恢复绑定时写入 `xinyun-ai/sessions/role-session-bindings.json` 和 `xinyun-ai/sessions/roles/` 摘要,并同步 `manifest.json`、`project-index.json`、`task-index.json`、`assignments.json`、`current-task.md`、`init-result.json`。
|
|
73
|
+
- 绑定必须使用 `provider=codex`,`sessionStatus=pending/creating/created/onboarding/ready/blocked/failed/closed`。
|
|
74
|
+
- 幂等键固定为 `taskId + roleId + provider + targetVersion` 的 JCS-SHA-256。
|
|
75
|
+
- 真实 `sessionId` 必须来自 Codex 宿主返回值;不得伪造 sessionId。宿主不支持时记录 `local-degraded-no-fake-session-id`,`sessionId=null`。
|
|
76
|
+
- 创建成功后先进入只读 `onboarding`;`sessionStatus=ready` 必须等待职责理解、职责确认、成员 / 会话绑定和执行资格全部满足。
|
|
@@ -257,3 +257,22 @@ HTML 迁移只允许评估和单页面 / 区块试点计划;实际代码迁移
|
|
|
257
257
|
- `activeTaskIds`、`executableTaskIds`、`currentTaskId`
|
|
258
258
|
- `roleExecutionResult`:created / reused / blocked / write-failed
|
|
259
259
|
- 活动任务非空时,交接单必须说明不可执行原因和下一步,不得写成“暂无待执行任务”。
|
|
260
|
+
|
|
261
|
+
## v1.7.3 角色会话交接字段
|
|
262
|
+
|
|
263
|
+
涉及 Codex 真实角色会话创建、绑定、恢复或降级时,任务单、交接单和行为证据必须补充:
|
|
264
|
+
|
|
265
|
+
- `provider`:固定为 codex
|
|
266
|
+
- `parentSessionId`
|
|
267
|
+
- `sessionId`:必须为 Codex 宿主返回的真实值;不得伪造 sessionId
|
|
268
|
+
- `sessionStatus`:pending / creating / created / onboarding / ready / blocked / failed / closed
|
|
269
|
+
- `sessionBindingId`
|
|
270
|
+
- `sessionBindingPath`:xinyun-ai/sessions/role-session-bindings.json
|
|
271
|
+
- `roleSessionPath`:xinyun-ai/sessions/roles/<roleId>.md
|
|
272
|
+
- `roleSessionIdempotency`:taskId + roleId + provider + targetVersion
|
|
273
|
+
- `hostCapability`:available / unavailable / permission-denied / unknown / failed
|
|
274
|
+
- `degradationReason`:local-degraded-no-fake-session-id / none
|
|
275
|
+
- `onboardingStatus`
|
|
276
|
+
- `created-but-writeback-failed` 恢复线索
|
|
277
|
+
|
|
278
|
+
会话创建成功只代表可进入只读 onboarding;不得把 `created` 直接写成 `ready`,不得因此获得业务代码修改授权。普通咨询不创建角色会话,也不写 `role-session-bindings.json`。
|
|
@@ -101,3 +101,13 @@
|
|
|
101
101
|
- 已有任务直接复用,缺失任务逐角色补建;不得覆盖用户修改的控制文件、业务任务或业务代码。
|
|
102
102
|
- `activeTaskIds` 非空时,即使 `executableTaskIds=[]`,也必须让 `current-task.md` 指向最高优先级活动任务,不能显示 `idle`。
|
|
103
103
|
- 单角色写入失败为 `blocked/write-failed`,部分成功为 `partial`,全失败为 `blocked`;索引更新失败不得清空活动索引,下次按幂等键恢复。
|
|
104
|
+
|
|
105
|
+
## v1.7.3 升级创建和绑定真实角色会话
|
|
106
|
+
|
|
107
|
+
- 升级到 v1.7.3 时,先确认 5 个 `role-execution` 本地任务已存在;缺失时按 v1.7.2 幂等规则补齐,再处理真实会话创建。
|
|
108
|
+
- Codex 主会话可为 5 个角色任务创建真实角色子会话,并把真实 `sessionId` 回写到角色任务、`assignments.json`、`task-index.json`、`manifest.json`、`project-index.json` 和 `xinyun-ai/sessions/role-session-bindings.json`。
|
|
109
|
+
- 会话绑定幂等键固定为 `taskId + roleId + provider + targetVersion`;重复升级必须复用已有绑定和真实 `sessionId`。
|
|
110
|
+
- 如果会话已创建但回写失败,下一次升级必须先查询宿主已有会话并恢复绑定,记录 `created-but-writeback-failed` 和 audit,不得再次创建重复会话。
|
|
111
|
+
- 单角色创建或回写失败不得影响其他角色;失败角色进入 `blocked` 或 `failed` 并记录 `blockedReason` / `failureReason` / `nextAction`。
|
|
112
|
+
- Codex 宿主不支持创建子会话、权限不足或接口不可用时,使用本地降级 `local-degraded-no-fake-session-id`,保持 `sessionId=null`,不得伪造 sessionId。
|
|
113
|
+
- 创建成功后的角色会话为只读 `onboarding`,不得直接获得业务代码、数据库、API、配置、依赖、Git 写操作或发布授权。
|
|
@@ -185,6 +185,17 @@ CodeGraph 为必需能力时,只有 `initialized` 或 `healthy` 才能将结
|
|
|
185
185
|
- `activeTaskIds` 非空时不得把 `current-task.md` 写成 idle/null;不可执行任务使用 pending 或 blocked,并显示 blockedReason/nextAction。
|
|
186
186
|
- 重复升级按逐角色幂等键复用任务;写入或索引失败时保留活动任务并恢复,不得清空索引。
|
|
187
187
|
|
|
188
|
+
## v1.7.3 Codex 角色会话自动创建与绑定
|
|
189
|
+
|
|
190
|
+
- v1.7.3 在 5 个 `role-execution` 本地任务创建或恢复后,由 Codex 主会话尝试创建 5 个真实角色子会话;这是 Codex 宿主编排规则,不是 npm CLI 行为。
|
|
191
|
+
- CLI 仍只创建 `xinyun-ai-init/`,不得直接创建 `xinyun-ai/`、业务代码或真实角色会话。
|
|
192
|
+
- 绑定文件固定为 `xinyun-ai/sessions/role-session-bindings.json`,角色会话目录固定为 `xinyun-ai/sessions/roles/`,模板为 `xinyun-ai-init/templates/role-session-binding.template.json`。
|
|
193
|
+
- 每个角色绑定必须记录 `provider=codex`、`parentSessionId`、真实 `sessionId`、`sessionStatus=pending/creating/created/onboarding/ready/blocked/failed/closed`、理解进度、确认进度和阻塞原因。
|
|
194
|
+
- 会话幂等键固定为 `taskId + roleId + provider + targetVersion`;重复升级复用已有真实会话和绑定。
|
|
195
|
+
- 真实 `sessionId` 必须来自 Codex 宿主返回值;不得伪造 sessionId。宿主不支持时记录 `local-degraded-no-fake-session-id`,保持 `sessionId=null`。
|
|
196
|
+
- 创建后的角色会话先进入只读 `onboarding`;只有职责理解、职责确认、成员 / 会话绑定、确认门禁和执行资格都满足后才允许 `sessionStatus=ready`。
|
|
197
|
+
- 创建成功不等于业务代码修改授权;普通咨询不创建角色会话,不写绑定文件,不创建外部账号或第三个会话。
|
|
198
|
+
|
|
188
199
|
AI 接手本项目时,请先读取:
|
|
189
200
|
|
|
190
201
|
- `xinyun-ai/README.md`
|
|
@@ -428,6 +428,25 @@
|
|
|
428
428
|
v1.7.2 fixed task contract keys: `taskKind=initialization-main`, `taskKind=initialization-record`, `taskKind=role-execution`.
|
|
429
429
|
The fixed task ordering expression is `priority ASC`, followed by `createdAt ASC`, roleId Unicode order, and taskId order.
|
|
430
430
|
A single-role write failure records `status=blocked` and `blockedReason=write-failed`.
|
|
431
|
+
v1.7.3 Codex role session orchestration is host-level only; CLI still only creates `xinyun-ai-init/`.
|
|
432
|
+
v1.7.3 fixed Codex role session contract keys: `provider=codex`, `sessionStatus=pending/creating/created/onboarding/ready/blocked/failed/closed`, `roleSessionIdempotency={taskId,roleId,provider,targetVersion}`.
|
|
433
|
+
|
|
434
|
+
## v1.7.3 Codex 角色会话自动创建与绑定
|
|
435
|
+
|
|
436
|
+
- v1.7.3 只在 5 个 `role-execution` 本地任务已经创建或恢复后,才由 Codex 主会话尝试创建 5 个真实角色子会话:`project-owner`、`project-product`、`chief-engineer`、`programmer`、`test-reviewer`。
|
|
437
|
+
- 这是 Codex 宿主编排规则,不是 npm CLI 行为;CLI 边界保持不变,只创建 `xinyun-ai-init/`,不得直接创建 `xinyun-ai/`、业务代码或真实会话。
|
|
438
|
+
- 会话绑定固定登记到 `xinyun-ai/sessions/role-session-bindings.json`,角色会话目录为 `xinyun-ai/sessions/roles/`,绑定模板为 `xinyun-ai-init/templates/role-session-binding.template.json`。
|
|
439
|
+
- `manifest.json`、`project-index.json`、`task-index.json`、`role-execution` 任务、`assignments.json` 和 `init-result.json` 必须引用同一 `bindingId` / `sessionId` / `sessionStatus` 摘要。
|
|
440
|
+
- `provider=codex`;`sessionStatus=pending/creating/created/onboarding/ready/blocked/failed/closed`。
|
|
441
|
+
- 会话幂等键固定为 `taskId + roleId + provider + targetVersion` 的 JCS-SHA-256;重复升级必须复用已有真实会话和绑定,不得重复创建同一角色会话。
|
|
442
|
+
- 真实 `sessionId` 必须来自 Codex 宿主创建会话后的返回值;不得伪造 sessionId,不得用任务 ID、角色 ID、占位符或历史摘要冒充真实会话。
|
|
443
|
+
- Codex 宿主不支持创建子会话、创建接口不可用或权限不足时,只能记录 `local-degraded-no-fake-session-id`,保持 `sessionId=null`,并写入 `sessionStatus=blocked` 或 `failed`、`degradation.reason` 和 `nextAction`。
|
|
444
|
+
- 创建成功后角色会话先进入 `onboarding` 且只读读取入口规则、角色任务、职责确认和角色理解资料;`sessionStatus=ready` 必须等待真实 sessionId 回写、职责理解完成、职责确认完成、成员 / 会话绑定有效、确认门禁和执行资格全部满足。
|
|
445
|
+
- 创建成功不等于业务代码修改授权;任何业务代码、数据库、API、配置、依赖、Git 写操作或发布仍需独立计划和用户确认。
|
|
446
|
+
- 会话创建成功但回写失败时,必须记录 `created-but-writeback-failed`、真实 `sessionId` 来源、恢复线索和 audit;下次按幂等键查询并恢复绑定。
|
|
447
|
+
- 单角色创建、回写或 onboarding 失败不得影响其他角色;失败角色单独进入 `blocked` 或 `failed`。
|
|
448
|
+
- 任务界面、`current-task.md`、`init-result.json` 和项目索引必须展示 5 个角色会话入口、`sessionId`、`sessionStatus`、理解进度和阻塞原因。
|
|
449
|
+
- 普通咨询不创建角色会话,不写绑定文件,不创建外部账号,不创建第三个会话。
|
|
431
450
|
|
|
432
451
|
- `current-task.md`、`tasks/<taskId>.md`、`init-result.json` 和 `task-lock.json` 的 `taskId`、`executionId`、`attempt`、状态和时间必须一致。
|
|
433
452
|
- 任意文件出现不在表内的组合,主会话必须将任务改为 `blocked`,写入冲突原因并停止继续写入。
|
|
@@ -125,8 +125,33 @@
|
|
|
125
125
|
- executionEligible:false
|
|
126
126
|
- memberId:null
|
|
127
127
|
- sessionId:null
|
|
128
|
+
- parentSessionId:null
|
|
129
|
+
- provider:codex
|
|
130
|
+
- sessionStatus:pending / creating / created / onboarding / ready / blocked / failed / closed
|
|
131
|
+
- sessionBindingId:
|
|
132
|
+
- sessionBindingPath:xinyun-ai/sessions/role-session-bindings.json
|
|
128
133
|
- taskIndex:xinyun-ai/tasks/task-index.json
|
|
129
134
|
- currentTaskIdleStatus:status=idle, taskId=null, title=暂无待执行任务
|
|
135
|
+
- Codex 角色会话:
|
|
136
|
+
- provider:codex
|
|
137
|
+
- parentSessionId:
|
|
138
|
+
- requiredRoleCount:5
|
|
139
|
+
- createdCount:
|
|
140
|
+
- reusedCount:
|
|
141
|
+
- failedCount:
|
|
142
|
+
- blockedCount:
|
|
143
|
+
- localDegradedCount:
|
|
144
|
+
- bindingsPath:xinyun-ai/sessions/role-session-bindings.json
|
|
145
|
+
- sessionStatusEnum:pending / creating / created / onboarding / ready / blocked / failed / closed
|
|
146
|
+
- 角色会话入口:
|
|
147
|
+
- roleId:
|
|
148
|
+
- taskId:
|
|
149
|
+
- sessionId:
|
|
150
|
+
- sessionStatus:
|
|
151
|
+
- understandingStatus:
|
|
152
|
+
- blockedReason:
|
|
153
|
+
- 宿主能力:
|
|
154
|
+
- 降级原因:
|
|
130
155
|
- 任务归档:
|
|
131
156
|
- archiveTransactionId:
|
|
132
157
|
- archivePath:xinyun-ai/tasks/archive/<taskId>/
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"mode": "initialization",
|
|
8
8
|
"status": "pending",
|
|
9
9
|
"currentVersion": null,
|
|
10
|
-
"targetVersion": "1.7.
|
|
10
|
+
"targetVersion": "1.7.3",
|
|
11
11
|
"idempotencyKey": null,
|
|
12
12
|
"createdFiles": [],
|
|
13
13
|
"updatedFiles": [],
|
|
@@ -31,6 +31,19 @@
|
|
|
31
31
|
"archiveTransactionId": null,
|
|
32
32
|
"archiveStatus": "not-started"
|
|
33
33
|
},
|
|
34
|
+
"roleSessions": {
|
|
35
|
+
"provider": "codex",
|
|
36
|
+
"parentSessionId": null,
|
|
37
|
+
"requiredRoleCount": 5,
|
|
38
|
+
"createdCount": 0,
|
|
39
|
+
"reusedCount": 0,
|
|
40
|
+
"failedCount": 0,
|
|
41
|
+
"blockedCount": 0,
|
|
42
|
+
"localDegradedCount": 0,
|
|
43
|
+
"bindings": [],
|
|
44
|
+
"hostCapability": "unknown",
|
|
45
|
+
"degradationReason": null
|
|
46
|
+
},
|
|
34
47
|
"codeGraph": {
|
|
35
48
|
"codeGraphRecordId": null,
|
|
36
49
|
"required": true,
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
"hashAlgorithm": "sha256",
|
|
4
4
|
"contentEncoding": "utf8-normalized",
|
|
5
5
|
"managedBy": "@pm_zhousl/xinyun-ai-init",
|
|
6
|
-
"lastAppliedVersion": "1.7.
|
|
6
|
+
"lastAppliedVersion": "1.7.3",
|
|
7
7
|
"files": [
|
|
8
8
|
{
|
|
9
9
|
"path": "xinyun-ai/rules/core-rules.md",
|
|
10
10
|
"baselineHash": null,
|
|
11
11
|
"templateHash": null,
|
|
12
|
-
"lastAppliedVersion": "1.7.
|
|
12
|
+
"lastAppliedVersion": "1.7.3",
|
|
13
13
|
"managedBy": "@pm_zhousl/xinyun-ai-init",
|
|
14
14
|
"status": "unknown"
|
|
15
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"projectName": "",
|
|
3
|
-
"xinyunAiVersion": "1.7.
|
|
4
|
-
"scriptVersion": "2026.07.
|
|
3
|
+
"xinyunAiVersion": "1.7.3",
|
|
4
|
+
"scriptVersion": "2026.07.22",
|
|
5
5
|
"schemaVersion": "1",
|
|
6
6
|
"initializationMode": "fast",
|
|
7
7
|
"expansionMode": "triggered",
|
|
@@ -44,8 +44,9 @@
|
|
|
44
44
|
"htmlToClientMigrationPreparation": true,
|
|
45
45
|
"namedInitializationTaskTree": true,
|
|
46
46
|
"taskArchiveTransactions": true,
|
|
47
|
-
"codeGraphRequiredInitialization": true
|
|
48
|
-
|
|
47
|
+
"codeGraphRequiredInitialization": true,
|
|
48
|
+
"roleExecutionVisibility": true,
|
|
49
|
+
"codexRoleSessionOrchestration": true
|
|
49
50
|
},
|
|
50
51
|
"tasking": {
|
|
51
52
|
"currentTask": "xinyun-ai/current-task.md",
|
|
@@ -62,9 +63,43 @@
|
|
|
62
63
|
"mainTaskTemplate": "xinyun-ai-init/templates/task-main.template.md",
|
|
63
64
|
"roleSubtaskTemplate": "xinyun-ai-init/templates/role-subtask.template.md",
|
|
64
65
|
"taskIndexTemplate": "xinyun-ai-init/templates/task-index.template.json",
|
|
65
|
-
"archiveTransactionTemplate": "xinyun-ai-init/templates/archive-transaction.template.json"
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
"archiveTransactionTemplate": "xinyun-ai-init/templates/archive-transaction.template.json",
|
|
67
|
+
"roleExecutionDirectory": "xinyun-ai/tasks/role-execution/",
|
|
68
|
+
"roleExecutionTemplate": "xinyun-ai-init/templates/role-execution.template.md",
|
|
69
|
+
"roleSessionBindings": "xinyun-ai/sessions/role-session-bindings.json",
|
|
70
|
+
"roleSessionBindingTemplate": "xinyun-ai-init/templates/role-session-binding.template.json"
|
|
71
|
+
},
|
|
72
|
+
"roleSessions": {
|
|
73
|
+
"enabled": true,
|
|
74
|
+
"provider": "codex",
|
|
75
|
+
"directory": "xinyun-ai/sessions/roles/",
|
|
76
|
+
"bindings": "xinyun-ai/sessions/role-session-bindings.json",
|
|
77
|
+
"bindingTemplate": "xinyun-ai-init/templates/role-session-binding.template.json",
|
|
78
|
+
"parentSessionId": null,
|
|
79
|
+
"targetVersion": "1.7.3",
|
|
80
|
+
"requiredRoleCount": 5,
|
|
81
|
+
"statusEnum": [
|
|
82
|
+
"pending",
|
|
83
|
+
"creating",
|
|
84
|
+
"created",
|
|
85
|
+
"onboarding",
|
|
86
|
+
"ready",
|
|
87
|
+
"blocked",
|
|
88
|
+
"failed",
|
|
89
|
+
"closed"
|
|
90
|
+
],
|
|
91
|
+
"idempotency": {
|
|
92
|
+
"keyFields": [
|
|
93
|
+
"taskId",
|
|
94
|
+
"roleId",
|
|
95
|
+
"provider",
|
|
96
|
+
"targetVersion"
|
|
97
|
+
],
|
|
98
|
+
"algorithm": "JCS-SHA-256",
|
|
99
|
+
"duplicatePolicy": "reuse"
|
|
100
|
+
},
|
|
101
|
+
"hostUnsupportedPolicy": "local-degraded-no-fake-session-id",
|
|
102
|
+
"readyPolicy": "created session enters onboarding first; ready requires role understanding, responsibility confirmation, and execution eligibility gates."
|
|
68
103
|
},
|
|
69
104
|
"taskTree": {
|
|
70
105
|
"enabled": true,
|
|
@@ -124,6 +124,21 @@
|
|
|
124
124
|
- 重复升级是否按逐角色 JCS-SHA-256 幂等键复用:待填写
|
|
125
125
|
- 单角色失败是否为 blocked/write-failed,索引中断是否可恢复:待填写
|
|
126
126
|
|
|
127
|
+
## v1.7.3 checks
|
|
128
|
+
|
|
129
|
+
- 是否创建或复用 5 个 Codex 真实角色会话:待填写
|
|
130
|
+
- `provider=codex` 是否一致:待填写
|
|
131
|
+
- `xinyun-ai/sessions/role-session-bindings.json` 是否可解析:待填写
|
|
132
|
+
- `xinyun-ai/sessions/roles/` 是否登记五个角色入口:待填写
|
|
133
|
+
- `sessionStatus` 是否只使用 pending / creating / created / onboarding / ready / blocked / failed / closed:待填写
|
|
134
|
+
- `roleSessionIdempotency` 是否为 taskId + roleId + provider + targetVersion:待填写
|
|
135
|
+
- 真实 `sessionId` 是否来自宿主返回值:待填写
|
|
136
|
+
- 是否不存在伪造 sessionId:待填写
|
|
137
|
+
- 创建后是否先进入只读 onboarding,未直接 ready:待填写
|
|
138
|
+
- 宿主不支持时是否记录 local-degraded-no-fake-session-id 且 sessionId=null:待填写
|
|
139
|
+
- created-but-writeback-failed 是否可恢复:待填写
|
|
140
|
+
- 普通咨询是否未创建角色会话或第三个会话:待填写
|
|
141
|
+
|
|
127
142
|
- frameworkStatus=confirmed/inferred/not-found/unknown/detected-unsupported
|
|
128
143
|
- moduleStatus=loaded/not-loaded
|
|
129
144
|
- activation=loaded/not-loaded
|
|
@@ -209,6 +209,19 @@
|
|
|
209
209
|
- idempotencyKey:JCS-SHA-256(sourceTaskId, roleId, taskKind, targetVersion)
|
|
210
210
|
- activeTaskIds 非空时 current-task 不得为 idle/null
|
|
211
211
|
|
|
212
|
+
## v1.7.3 Codex role session anchors
|
|
213
|
+
|
|
214
|
+
- role session provider:provider=codex
|
|
215
|
+
- role session bindings:xinyun-ai/sessions/role-session-bindings.json
|
|
216
|
+
- role session directory:xinyun-ai/sessions/roles/
|
|
217
|
+
- sessionStatus:pending / creating / created / onboarding / ready / blocked / failed / closed
|
|
218
|
+
- roleSessionIdempotency:JCS-SHA-256(taskId, roleId, provider, targetVersion)
|
|
219
|
+
- parentSessionId:待填写
|
|
220
|
+
- real sessionId:待填写;不得伪造 sessionId
|
|
221
|
+
- onboarding:created 后先只读 onboarding,不能直接 ready
|
|
222
|
+
- host unsupported:local-degraded-no-fake-session-id
|
|
223
|
+
- created-but-writeback-failed:待填写恢复线索
|
|
224
|
+
|
|
212
225
|
- frameworkStatus=confirmed/inferred/not-found/unknown/detected-unsupported
|
|
213
226
|
- moduleStatus=loaded/not-loaded
|
|
214
227
|
- activation=loaded/not-loaded
|
|
@@ -133,6 +133,25 @@
|
|
|
133
133
|
"sortOrder": ["priority", "createdAt", "roleId", "taskId"]
|
|
134
134
|
}
|
|
135
135
|
},
|
|
136
|
+
"roleSessions": {
|
|
137
|
+
"enabled": true,
|
|
138
|
+
"provider": "codex",
|
|
139
|
+
"directory": "xinyun-ai/sessions/roles/",
|
|
140
|
+
"bindings": "xinyun-ai/sessions/role-session-bindings.json",
|
|
141
|
+
"bindingTemplate": "xinyun-ai-init/templates/role-session-binding.template.json",
|
|
142
|
+
"requiredRoleCount": 5,
|
|
143
|
+
"statusEnum": [
|
|
144
|
+
"pending",
|
|
145
|
+
"creating",
|
|
146
|
+
"created",
|
|
147
|
+
"onboarding",
|
|
148
|
+
"ready",
|
|
149
|
+
"blocked",
|
|
150
|
+
"failed",
|
|
151
|
+
"closed"
|
|
152
|
+
],
|
|
153
|
+
"records": []
|
|
154
|
+
},
|
|
136
155
|
"codeGraphRequired": {
|
|
137
156
|
"codeGraphRecordId": null,
|
|
138
157
|
"required": true,
|
|
@@ -13,11 +13,17 @@
|
|
|
13
13
|
- confirmationStatus:pending
|
|
14
14
|
- memberId:null
|
|
15
15
|
- sessionId:null
|
|
16
|
+
- parentSessionId:null
|
|
17
|
+
- provider:codex
|
|
18
|
+
- sessionStatus:pending
|
|
19
|
+
- sessionBindingId:
|
|
20
|
+
- sessionBindingPath:xinyun-ai/sessions/role-session-bindings.json
|
|
16
21
|
- executionEligible:false
|
|
17
22
|
- blockedReason:member-unassigned
|
|
18
23
|
- nextAction:绑定成员、完成职责确认和项目理解后再执行
|
|
19
24
|
- sourceTaskId:task-template
|
|
20
25
|
- idempotencyKey:
|
|
26
|
+
- sessionIdempotencyKey:
|
|
21
27
|
- createdAt:2026-07-21T00:00:00.000Z
|
|
22
28
|
- updatedAt:2026-07-21T00:00:00.000Z
|
|
23
29
|
|
|
@@ -29,7 +35,19 @@
|
|
|
29
35
|
- 待分配任务使用 `status=pending`;权限、冲突、写入失败或不可恢复错误使用 `status=blocked`,并填写 `blockedReason` 和 `nextAction`。
|
|
30
36
|
- `sourceTaskId` 指向已经归档的初始化主任务;角色任务完成前不得加入 `archivedTaskIds`。
|
|
31
37
|
|
|
38
|
+
## Codex 真实角色会话绑定
|
|
39
|
+
|
|
40
|
+
- v1.7.3 中,Codex 主会话在 5 个 `role-execution` 本地任务创建或恢复后,可以为 `project-owner`、`project-product`、`chief-engineer`、`programmer`、`test-reviewer` 固定创建 5 个真实角色子会话。
|
|
41
|
+
- 真实 `sessionId` 只能来自 Codex 宿主创建子会话后的返回值;不得使用 `taskId`、`roleTaskId`、随机占位字符串或本地模拟值冒充。
|
|
42
|
+
- 会话绑定字段至少包含 `taskId`、`roleId`、`sessionId`、`parentSessionId`、`provider`、`sessionStatus`、`createdAt`、`updatedAt`。
|
|
43
|
+
- 会话状态固定为 `pending/creating/created/onboarding/ready/blocked/failed/closed`。
|
|
44
|
+
- 会话创建成功后先进入 `sessionStatus=onboarding`,只读职责范围内资料并生成角色理解记录;不得因会话创建成功直接把任务标为 `ready` 或获得业务代码修改授权。
|
|
45
|
+
- 只有角色理解完成、职责确认完成、成员/会话绑定满足、确认人关系无冲突且执行门禁满足时,才允许 `sessionStatus=ready` 与 `executionEligible=true`。
|
|
46
|
+
- Codex 宿主不支持创建子会话、权限不足或创建失败时,必须保留 `sessionId=null`,记录 `sessionStatus=blocked/failed`、失败原因和本地降级说明,不得伪造会话。
|
|
47
|
+
|
|
32
48
|
## 幂等
|
|
33
49
|
|
|
34
50
|
- `idempotencyKey` 是对 `{sourceTaskId, roleId, taskKind, targetVersion}` 使用 v1.6 JCS 规范化 JSON 后计算的 SHA-256。
|
|
35
51
|
- 同一幂等键只允许对应一个角色后续任务;重复升级必须复用任务并补齐索引。
|
|
52
|
+
- `sessionIdempotencyKey` 是对 `{taskId, roleId, provider, targetVersion}` 使用 JCS 规范化 JSON 后计算的 SHA-256。
|
|
53
|
+
- 同一 `sessionIdempotencyKey` 只允许绑定一个有效真实角色会话;会话已创建但本地回写失败时,下次升级必须按该键查询并补齐绑定,不得创建第二个会话。
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"bindingId": "role-session-binding-template",
|
|
4
|
+
"taskId": "role-execution-task-template",
|
|
5
|
+
"roleId": "project-owner",
|
|
6
|
+
"sessionId": null,
|
|
7
|
+
"parentSessionId": null,
|
|
8
|
+
"provider": "codex",
|
|
9
|
+
"targetVersion": "1.7.3",
|
|
10
|
+
"sessionStatus": "pending",
|
|
11
|
+
"understandingStatus": "pending",
|
|
12
|
+
"confirmationStatus": "pending",
|
|
13
|
+
"executionEligible": false,
|
|
14
|
+
"idempotencyKey": null,
|
|
15
|
+
"hostCapability": "unknown",
|
|
16
|
+
"createdAt": "2026-07-22T00:00:00.000Z",
|
|
17
|
+
"updatedAt": "2026-07-22T00:00:00.000Z",
|
|
18
|
+
"createdBy": "main-session",
|
|
19
|
+
"onboarding": {
|
|
20
|
+
"readOnly": true,
|
|
21
|
+
"startedAt": null,
|
|
22
|
+
"completedAt": null,
|
|
23
|
+
"understandingRecord": null,
|
|
24
|
+
"readyRequires": [
|
|
25
|
+
"real sessionId returned by host",
|
|
26
|
+
"role understanding ready",
|
|
27
|
+
"responsibility confirmation confirmed",
|
|
28
|
+
"execution eligibility gates satisfied"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"failure": {
|
|
32
|
+
"blockedReason": null,
|
|
33
|
+
"failureReason": null,
|
|
34
|
+
"retryCount": 0,
|
|
35
|
+
"nextAction": null
|
|
36
|
+
},
|
|
37
|
+
"degradation": {
|
|
38
|
+
"localOnly": false,
|
|
39
|
+
"reason": null,
|
|
40
|
+
"fakeSessionIdProhibited": true
|
|
41
|
+
},
|
|
42
|
+
"audit": []
|
|
43
|
+
}
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
"currentTaskId": null,
|
|
7
7
|
"roleExecutionDirectory": "xinyun-ai/tasks/role-execution/",
|
|
8
8
|
"roleExecutionTaskIds": [],
|
|
9
|
+
"roleSessionBindingIds": [],
|
|
9
10
|
"roleExecutionStatusEnum": ["pending", "assigned", "accepted", "executing", "paused", "blocked", "completed", "cancelled"],
|
|
11
|
+
"roleSessionStatusEnum": ["pending", "creating", "created", "onboarding", "ready", "blocked", "failed", "closed"],
|
|
10
12
|
"roleExecutionPriority": {
|
|
11
13
|
"project-owner": 10,
|
|
12
14
|
"project-product": 20,
|
|
@@ -25,7 +27,13 @@
|
|
|
25
27
|
"algorithm": "JCS-SHA-256",
|
|
26
28
|
"duplicatePolicy": "reuse"
|
|
27
29
|
},
|
|
30
|
+
"roleSessionIdempotency": {
|
|
31
|
+
"keyFields": ["taskId", "roleId", "provider", "targetVersion"],
|
|
32
|
+
"algorithm": "JCS-SHA-256",
|
|
33
|
+
"duplicatePolicy": "reuse"
|
|
34
|
+
},
|
|
28
35
|
"tasks": [],
|
|
36
|
+
"roleSessionBindings": [],
|
|
29
37
|
"archiveTransactions": [],
|
|
30
38
|
"statusEnum": ["pending", "executing", "partial", "blocked", "completed", "cancelled"],
|
|
31
39
|
"idleCurrentTask": {
|
|
@@ -9,6 +9,16 @@
|
|
|
9
9
|
- `confirmations/<roleId>.md` 和 `understandings/<roleId>.md` 的 `createdAt`、`updatedAt` 必须存在且为 ISO 8601 时间;首次落盘可使用模板初始时间或替换为当前时间,但不得留空。
|
|
10
10
|
- `xinyun-ai/team/**` 属于 AI 工作区控制文件,不授权修改业务代码、数据库、API、依赖、构建脚本或执行发布操作。
|
|
11
11
|
|
|
12
|
+
## Codex 角色会话绑定
|
|
13
|
+
|
|
14
|
+
- v1.7.3 起,在 Codex 宿主支持创建子会话时,主会话可以为五个默认角色自动创建真实角色子会话,并把真实 `sessionId` 回写到角色任务、`assignments.json`、`task-index.json`、`manifest.json`、`project-index.json` 和 `xinyun-ai/sessions/role-session-bindings.json`。
|
|
15
|
+
- 固定角色为 `project-owner`、`project-product`、`chief-engineer`、`programmer`、`test-reviewer`,不得因为初始化或升级创建超过 5 个角色会话。
|
|
16
|
+
- `sessionId` 必须来自 Codex 宿主返回值,不得使用任务 ID、随机占位字符串、本地文件名或历史会话记忆冒充。
|
|
17
|
+
- 会话绑定最小字段为 `taskId`、`roleId`、`sessionId`、`parentSessionId`、`provider`、`sessionStatus`、`createdAt`、`updatedAt`。
|
|
18
|
+
- 会话状态固定为 `pending/creating/created/onboarding/ready/blocked/failed/closed`。
|
|
19
|
+
- 创建成功后先进入 `onboarding`,只允许只读理解职责范围和项目资料;职责理解、确认关系和执行门禁满足后才允许 `ready`。
|
|
20
|
+
- Codex 宿主不支持创建子会话、权限不足或创建失败时,必须进入本地降级:保留 `sessionId=null`,记录 `sessionStatus=blocked/failed`、失败原因和下一步动作,不得伪造会话。
|
|
21
|
+
|
|
12
22
|
## 默认角色
|
|
13
23
|
|
|
14
24
|
- `project-owner`:项目负责人,负责需求最终确认、业务验收和发布授权。
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
"assignmentId",
|
|
11
11
|
"taskId",
|
|
12
12
|
"roleId",
|
|
13
|
+
"sessionId",
|
|
14
|
+
"parentSessionId",
|
|
15
|
+
"provider",
|
|
16
|
+
"sessionStatus",
|
|
13
17
|
"memberId",
|
|
14
18
|
"workstream",
|
|
15
19
|
"scope",
|
|
@@ -27,7 +31,8 @@
|
|
|
27
31
|
],
|
|
28
32
|
"pausedRule": "status=paused requires pauseReason; other statuses require pauseReason=null.",
|
|
29
33
|
"blockedRule": "status=blocked requires blockedReason=approver-unavailable or member-conflict.",
|
|
30
|
-
"executionEligibility": "member bound, role ready, responsibility confirmed, understanding ready, and executor memberId not equal to final approver member IDs."
|
|
34
|
+
"executionEligibility": "member bound, role ready, sessionStatus=ready, responsibility confirmed, understanding ready, and executor memberId not equal to final approver member IDs.",
|
|
35
|
+
"sessionBindingRule": "sessionId must be a real host-returned value when provider=codex; if the host cannot create sessions, sessionId remains null and sessionStatus=blocked or failed with a local degradation reason."
|
|
31
36
|
},
|
|
32
37
|
"updatedAt": ""
|
|
33
38
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"packageName": "xinyun-ai-init",
|
|
3
3
|
"displayName": "欣芸技术开发 Agent 流初始化包",
|
|
4
|
-
"version": "1.7.
|
|
5
|
-
"scriptVersion": "2026.07.
|
|
4
|
+
"version": "1.7.3",
|
|
5
|
+
"scriptVersion": "2026.07.22",
|
|
6
6
|
"schemaVersion": "1",
|
|
7
7
|
"defaultMode": "fast-init",
|
|
8
8
|
"targetWorkspace": "xinyun-ai",
|