@pm_zhousl/xinyun-ai-init 1.7.3 → 1.8.0
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 +13 -1
- package/init/xinyun-ai-init/rules/coordination.md +33 -0
- package/init/xinyun-ai-init/rules/directory-self-completion.md +7 -0
- package/init/xinyun-ai-init/rules/frontend-audit.md +9 -0
- package/init/xinyun-ai-init/rules/init-rules.md +6 -0
- package/init/xinyun-ai-init/rules/session-workbench.md +8 -0
- package/init/xinyun-ai-init/rules/skills.md +15 -0
- package/init/xinyun-ai-init/rules/temporary-sessions.md +9 -0
- package/init/xinyun-ai-init/rules/upgrade-rules.md +6 -0
- package/init/xinyun-ai-init/templates/AGENTS.template.md +6 -0
- package/init/xinyun-ai-init/templates/coordination-change-ledger.template.json +10 -0
- package/init/xinyun-ai-init/templates/coordination-conflict-record.template.json +13 -0
- package/init/xinyun-ai-init/templates/coordination-contract-snapshot.template.json +9 -0
- package/init/xinyun-ai-init/templates/coordination-project-facts.template.json +9 -0
- package/init/xinyun-ai-init/templates/coordination-transaction.template.json +16 -0
- package/init/xinyun-ai-init/templates/core-rules.template.md +14 -0
- package/init/xinyun-ai-init/templates/current-task.template.md +12 -0
- package/init/xinyun-ai-init/templates/frontend-audit.template.json +27 -0
- package/init/xinyun-ai-init/templates/init-result.template.json +1 -1
- package/init/xinyun-ai-init/templates/managed-baseline.template.json +2 -2
- package/init/xinyun-ai-init/templates/manifest.template.json +47 -4
- package/init/xinyun-ai-init/templates/project-check.template.md +8 -0
- package/init/xinyun-ai-init/templates/project-guide.template.md +7 -0
- package/init/xinyun-ai-init/templates/project-index.template.json +39 -0
- package/init/xinyun-ai-init/templates/role-session-binding.template.json +1 -1
- package/init/xinyun-ai-init/templates/skills-assignments.template.json +19 -0
- package/init/xinyun-ai-init/templates/skills-registry.template.json +10 -0
- package/init/xinyun-ai-init/templates/temporary-session.template.json +32 -0
- package/init/xinyun-ai-init/version.json +2 -2
- package/package.json +1 -1
- package/scripts/verify-init-package.js +88 -23
- package/scripts/verify-rules-package.js +66 -9
- package/test-scenarios/README.md +8 -2
- package/test-scenarios/review-template.md +12 -0
- package/test-scenarios/scenarios.md +39 -3
- package/test-scenarios/v1.8.0-scenarios.md +39 -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.
|
|
27
|
+
npm run verify:rules -- --tarball ./pm_zhousl-xinyun-ai-init-1.8.0.tgz
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
`verify:rules` 为只读规则包一致性检查,不自动修复、不安装依赖、不修改 Git 或业务代码。
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
本目录是“欣芸技术开发 Agent 流”的初始化包,负责把完整 AI 执行要求下发到目标项目。
|
|
4
4
|
|
|
5
|
-
当前规则版本:`1.
|
|
5
|
+
当前规则版本:`1.8.0`。
|
|
6
6
|
|
|
7
7
|
## Codex 一句话入口
|
|
8
8
|
|
|
@@ -1102,3 +1102,15 @@ npx --yes @pm_zhousl/xinyun-ai-init@latest --force
|
|
|
1102
1102
|
每个角色的幂等键是对 `{sourceTaskId, roleId, taskKind, targetVersion}` 使用 v1.6 JCS 规范化 JSON 后计算的 SHA-256,规范化算法为 `JCS-SHA-256`。同一幂等键只对应一个 `role-execution` 任务;重复升级复用已有任务并补齐索引,不覆盖用户控制文件或业务文件。
|
|
1103
1103
|
|
|
1104
1104
|
补建使用逐角色临时文件、完整校验、原子重命名和任务索引原子更新。单角色写入失败记录 `status=blocked`、`blockedReason=write-failed`;部分成功为 `partial`,全失败为 `blocked`。索引更新中断时不得清空 `activeTaskIds` 或伪造 `idle`,下次按幂等键恢复。
|
|
1105
|
+
|
|
1106
|
+
## v1.8 多会话协作控制面
|
|
1107
|
+
|
|
1108
|
+
v1.8 按 A-D 分阶段启用:A 共享事实和冲突协调,B Skill 注册与技术栈路由,C 前端耦合审计和单页面试点,D 临时程序员会话。A 的状态和事务契约未通过前,不得进入 D 的真实并行写入。
|
|
1109
|
+
|
|
1110
|
+
共享控制文件位于 `xinyun-ai/coordination/`:`project-facts.json` 使用 `factStatus`,`change-ledger.json` 使用 `changeStatus`,`conflict-records/<conflictId>.json` 使用 `conflictStatus`。任务索引使用 `taskStatus`,受影响任务使用 `refreshStatus`。状态字段按对象分域,禁止用 `status` 跨对象互相覆盖;临时会话的 `queued` 只属于会话状态域。
|
|
1111
|
+
|
|
1112
|
+
Skill 位于 `xinyun-ai/skills/`。分配文件必须使用 `assignmentStatus`,使用记录必须使用 `usageStatus`,固定映射以 `xinyun-ai-init/rules/skills.md` 为准。缺依赖、权限不足、未审核或未知框架只能降级或阻塞,不自动安装、不伪造执行。
|
|
1113
|
+
|
|
1114
|
+
前端审计位于 `xinyun-ai/frontend-audits/`。`audit-only` 不产生代码 diff;`refactor-now` 必须有计划、用户确认、允许路径、前后哈希、diff 和测试证据。预算或权限不足只能记录 `partial/unknown` 和 `unverifiedScope`。
|
|
1115
|
+
|
|
1116
|
+
临时程序员会话必须有已确认的 `planId`、`userConfirmationId`、单一 `taskId`、规范化 `changeDomain`、允许路径和真实 `sessionId`。最多同时占用 3 个运行额度;`occupancyStatus=unknown` 不得自动释放,人工释放必须有完整 `releaseAudit`。跨文件控制面必须使用 `coordinationTransactionId`。详情见 `rules/coordination.md`、`rules/skills.md`、`rules/frontend-audit.md` 和 `rules/temporary-sessions.md`。
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# v1.8-A 共享事实与跨会话协调
|
|
2
|
+
|
|
3
|
+
`xinyun-ai/coordination/` 是多会话共享控制面,不是业务代码目录。初始化或按需升级时创建最小目录,不扫描或写入业务文件。
|
|
4
|
+
|
|
5
|
+
## 文件与状态源
|
|
6
|
+
|
|
7
|
+
- `project-facts.json` 记录可追溯项目事实,字段必须包含 `factId`、`factType`、`scope`、`valueHash`、`source`、`taskId`、`sessionId`、`evidence`、`confidence`、`factStatus`、`revision`、`observedAt`、`updatedAt`。
|
|
8
|
+
- `change-ledger.json` 记录改动台账,字段必须包含 `changeId`、`taskId`、`sessionId`、`actor`、`role`、`changeDomain`、`targetPaths`、`baselineHash`、`changeStatus`、`evidence`、`createdAt`、`updatedAt`。
|
|
9
|
+
- `contract-snapshots/<contractId>.json` 记录 API、字段、组件、路由、消息和业务流程快照。
|
|
10
|
+
- `conflict-records/<conflictId>.json` 记录冲突,必须使用 `conflictStatus`,不能使用通用 `status` 裁决冲突。
|
|
11
|
+
- `task-index.json` 裁决 `taskStatus`;`change-ledger.json` 裁决 `changeStatus`;冲突文件裁决 `conflictStatus`;受影响任务记录裁决 `refreshStatus`。
|
|
12
|
+
|
|
13
|
+
状态字段严格分域:`taskStatus=pending/assigned/accepted/executing/paused/blocked/completed/cancelled`;`changeStatus=proposed/reserved/in-progress/completed/conflict-pending/blocked/cancelled`;`conflictStatus=detected/awaiting-confirmation/resolved/rejected/blocked`;`refreshStatus=not-required/refresh-required/refreshed/blocked`。临时会话的 `queued` 不属于 `changeStatus`。
|
|
14
|
+
|
|
15
|
+
取消只允许 `changeStatus=proposed/reserved -> cancelled`。同一事实、台账、冲突记录的状态源缺失、非法或 `revision` 不一致时,关联任务统一进入 `taskStatus=blocked`,并写 `blockedReason=status-inconsistent`,不得用最近写入内容覆盖。
|
|
16
|
+
|
|
17
|
+
## 三道门禁
|
|
18
|
+
|
|
19
|
+
1. 领取前:声明 `changeDomain`、目标路径、API、数据库字段、组件、路由和业务流程影响,读取当前共享事实和冲突记录。
|
|
20
|
+
2. 写入前:重新校验基线、契约快照、同域活动任务和冲突状态;冲突时进入 `changeStatus=conflict-pending` 与 `conflictStatus=awaiting-confirmation`。
|
|
21
|
+
3. 完成后:写入证据、更新共享事实和台账;受影响任务设置 `refreshStatus=refresh-required`,在刷新完成前保持 `taskStatus=paused` 或 `blocked`。
|
|
22
|
+
|
|
23
|
+
冲突不得由单个会话自行裁决,不自动覆盖或合并。解决后由总工或业务确认人写入 `resolvedBy`、`resolvedAt`、`resolutionEvidence`,重新验证基线后才可继续。
|
|
24
|
+
|
|
25
|
+
## changeDomain 与事务
|
|
26
|
+
|
|
27
|
+
规范化格式至少包括 `file:<normalized-path>`、`api:<METHOD> <normalized-route>`、`db:<table>.<field>`、`component:<normalized-path>`、`flow:<business-flow-id>`。路径优先 realpath,统一 `/` 和 Unicode NFC;无法规范化写 `unknown`。
|
|
28
|
+
|
|
29
|
+
跨文件写入必须使用 `coordinationTransactionId`,记录在 `.transactions/<coordinationTransactionId>.json`。事务阶段为 `prepared/validated/renamed/revision-updated/committed/recovery-required/blocked`;每个 `targetFiles` 条目必须有 `path`、`tempPath`、`beforeHash`、`afterHash`、`targetRevision`。按“临时文件、完整校验、原子重命名、更新 revision、提交事务”执行,重复请求复用同一事务。崩溃、部分重命名、权限失败或哈希不一致时保留记录并进入 `recovery-required` 或 `blocked`,不能只更新索引、删除历史或覆盖新版本。
|
|
30
|
+
|
|
31
|
+
## 安全边界
|
|
32
|
+
|
|
33
|
+
只读冲突审计不产生业务 diff。数据库、API、业务流程和跨端冲突未确认前不得 SQL、migration、seed、批量修复、接口兼容改动或自动合并。
|
|
@@ -57,3 +57,10 @@
|
|
|
57
57
|
- `manifest.json`、`project-index.json` 和 `task-index.json` 必须登记 `roleSessions`、`roleSessionBindingIds`、`roleSessionBindings`、`provider=codex` 和 `sessionStatus` 枚举。
|
|
58
58
|
- 绑定目录只保存 Codex 宿主返回的真实 `sessionId` 摘要、onboarding 状态、失败原因和 audit,不保存伪造 sessionId。
|
|
59
59
|
- 宿主不支持创建子会话时,仍可补齐本地目录和降级记录,状态使用 `local-degraded-no-fake-session-id`。
|
|
60
|
+
|
|
61
|
+
## v1.8 按需目录
|
|
62
|
+
|
|
63
|
+
- 多会话协调任务按需补齐 `xinyun-ai/coordination/`、`contract-snapshots/`、`conflict-records/` 和 `.transactions/`。
|
|
64
|
+
- Skill 路由任务按需补齐 `xinyun-ai/skills/registry.json`、`assignments.json` 和 `usage-records/`;分配字段必须是 `assignmentStatus`。
|
|
65
|
+
- 前端审计按需补齐 `xinyun-ai/frontend-audits/`;临时程序员任务按需补齐 `xinyun-ai/sessions/temporary/`。
|
|
66
|
+
- 普通咨询、首次极速初始化和不涉及这些能力的任务不创建空目录。目录补齐只修改 AI 控制面,不修改业务代码。
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# v1.8-C 前端耦合审计与渐进式组件化
|
|
2
|
+
|
|
3
|
+
适用微信小程序、uni-app 和 HTML。先审计,再决定是否改造;不整站重写,不默认更换 UI 框架,不自动把 HTML 转成小程序或 uni-app。
|
|
4
|
+
|
|
5
|
+
审计记录必须包含页面/组件路径、平台、框架、`couplingType`、props、events、slots、状态、API、路由、业务流程依赖、`baselineHash`、`decision`、`status`、`coverage`、`evidence` 和 `unverifiedScope`。`couplingType` 使用 `template-style/state-view/api-page/route-page/business-page/cross-platform/shared-component/unknown`。
|
|
6
|
+
|
|
7
|
+
审计状态使用 `not-started/assessing/partial/completed/blocked/unknown`;处理决定使用 `audit-only/refactor-now/defer/requires-confirmation/out-of-scope`;覆盖使用 `full/partial/unknown`。这些是审计记录的字段,不得与 `taskStatus`、`changeStatus` 或 `conflictStatus` 混用。
|
|
8
|
+
|
|
9
|
+
`audit-only` 必须零代码 diff。`refactor-now` 必须先有 `planId`、`userConfirmationId`、`permittedPaths`,并保留前后哈希、diff 证据和测试证据;单页面或单组件试点也必须遵守确认门禁。预算超限、权限失败或依赖未知只能输出 `partial/unknown` 和未验证范围,不能宣称完整审计。
|
|
@@ -74,3 +74,9 @@
|
|
|
74
74
|
- 幂等键固定为 `taskId + roleId + provider + targetVersion` 的 JCS-SHA-256。
|
|
75
75
|
- 真实 `sessionId` 必须来自 Codex 宿主返回值;不得伪造 sessionId。宿主不支持时记录 `local-degraded-no-fake-session-id`,`sessionId=null`。
|
|
76
76
|
- 创建成功后先进入只读 `onboarding`;`sessionStatus=ready` 必须等待职责理解、职责确认、成员 / 会话绑定和执行资格全部满足。
|
|
77
|
+
|
|
78
|
+
## v1.8 控制面按需初始化
|
|
79
|
+
|
|
80
|
+
需要多会话协作时,按 A-D 顺序补齐 `xinyun-ai/coordination/`、`xinyun-ai/skills/`、`xinyun-ai/frontend-audits/` 和 `xinyun-ai/sessions/temporary/` 的最小模板。普通咨询和首次极速初始化不强制创建这些业务记录目录。
|
|
81
|
+
|
|
82
|
+
共享事实和 Skill 文件使用临时文件、完整校验和原子重命名。前端审计默认只读;临时会话只有用户确认的代码任务才可创建。不得修改业务代码、数据库、API、依赖、Git 或发布配置。
|
|
@@ -276,3 +276,11 @@ HTML 迁移只允许评估和单页面 / 区块试点计划;实际代码迁移
|
|
|
276
276
|
- `created-but-writeback-failed` 恢复线索
|
|
277
277
|
|
|
278
278
|
会话创建成功只代表可进入只读 onboarding;不得把 `created` 直接写成 `ready`,不得因此获得业务代码修改授权。普通咨询不创建角色会话,也不写 `role-session-bindings.json`。
|
|
279
|
+
|
|
280
|
+
## v1.8 任务单补充
|
|
281
|
+
|
|
282
|
+
涉及共享事实时记录 `factStatus`、`changeStatus`、`conflictStatus`、`refreshStatus`、`coordinationTransactionId`、`changeDomain`、目标文件和 revision。涉及 Skill 时记录 `skillId`、`assignmentStatus`、`usageStatus`、匹配证据、依赖、降级原因、`failureReason`、`nextAction` 和 `unverifiedScope`。
|
|
283
|
+
|
|
284
|
+
涉及前端审计时记录 `couplingType`、`decision`、审计 `status`、`coverage`、props/events/slots、状态/API/路由/业务流依赖、前后哈希、diff 和测试证据。涉及临时程序员会话时记录 `taskId`、`changeDomain`、`sessionId`、会话 `status`、`occupancyStatus`、并发额度、`releaseAudit` 和 `closeEvidence`。
|
|
285
|
+
|
|
286
|
+
任何跨会话冲突、状态源缺失、预算超限、权限失败或敏感信息无法确认时暂停或阻塞,不自动重试、合并、覆盖或释放。
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# v1.8-B Skill 注册与技术栈路由
|
|
2
|
+
|
|
3
|
+
Skill 只能从 `xinyun-ai/skills/registry.json` 的已登记记录中选择。未登记、未审查、过期或被阻断的外部 Skill 不得执行,不自动安装 Python、Node 驱动、CLI 或第三方依赖。
|
|
4
|
+
|
|
5
|
+
## 注册与选择
|
|
6
|
+
|
|
7
|
+
每个 Skill 记录 `skillId`、`name`、`version`、`source`、`digest`、`priority`、`availabilityStatus`、`trustStatus`、`reviewedAt`、`allowedRoles`、`frameworks`、`platforms`、`dependencies`、`permissions`、`evidence`、`fallbackPlan`、`createdAt`、`updatedAt`。`availabilityStatus` 与 `trustStatus` 独立:前者为 `available/unavailable/disabled/unknown`,后者为 `unreviewed/reviewed/blocked/expired`,不得用 registry `status` 代替。
|
|
8
|
+
|
|
9
|
+
按“项目明确绑定 > 框架专用 > 通用 Skill > fallback”选择;同级按稳定 `priority` 和 `skillId` 排序,不按扫描顺序随机选择。ThinkPHP、uni-app、微信小程序和 HTML 只在对应技术栈已确认时路由专用 Skill;未识别框架使用通用 Skill 并标记不确定性。
|
|
10
|
+
|
|
11
|
+
## 分配与使用状态
|
|
12
|
+
|
|
13
|
+
`assignments.json` 使用 `assignmentStatus`,`usage-records/<usageRecordId>.json` 使用 `usageStatus`。固定映射为:`pending + selected`、`selected + selected/running`、`running + running`、`completed + completed`、`fallback + fallback`、`blocked + failed/blocked`、`cancelled + skipped`。`usageStatus=failed` 必须映射 `assignmentStatus=blocked`,并记录 `failureReason` 和 `nextAction`;非法组合统一 `assignmentStatus=blocked`。
|
|
14
|
+
|
|
15
|
+
调用前记录匹配证据、使用工具、未使用工具、降级方案和 `unverifiedScope`。依赖缺失、权限不足、宿主不可用或未知框架只能 `usageStatus=fallback/blocked`,不得伪造已执行结果。使用记录不得保存 Token、密码、私钥、完整 `.env`、连接串或未经脱敏的项目内容。
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# v1.8-D 临时程序员执行会话
|
|
2
|
+
|
|
3
|
+
仅对已完成需求整理、技术影响审查、计划和用户确认的代码任务创建临时程序员会话。必须绑定单一 `taskId`、单一规范化 `changeDomain`、真实 `sessionId`、`planId`、`userConfirmationId` 和 `permittedPaths`;不加入永久成员名单。
|
|
4
|
+
|
|
5
|
+
会话状态固定为 `pending/creating/onboarding/queued/executing/waiting-review/completed/blocked/failed/closed/cancelled`,合法主流程为 `pending -> creating -> onboarding -> executing -> waiting-review -> completed -> closed`。容量不足或同域冲突允许 `onboarding -> queued -> creating`;容量可用时不得强制排队。`changeStatus` 不使用 `queued`。
|
|
6
|
+
|
|
7
|
+
并发上限为 3,最多同时占用 3 个运行额度,只统计 `creating/onboarding/executing/waiting-review`。`occupancyStatus` 独立使用 `occupied/released/unknown`;`pending/queued` 初始为 `released`,进入 `creating` 时原子占用。崩溃、锁损坏、超时或不可读时写 `occupancyStatus=unknown` 并继续占用,不得自动释放、自动重试或自动关闭。人工释放必须包含 `releaseAudit.auditId/releasedBy/releasedAt/reason/evidence`。
|
|
8
|
+
|
|
9
|
+
同一变更域已有执行会话时排队或冲突待确认,不重复创建。队列按确认时间、优先级和 taskId 稳定排序。只有代码 diff、测试、共享事实和改动台账都同步,并写入 `closeEvidence`、`closedAt`、`closedBy` 后才能自动关闭;异常、冲突或测试失败保持阻塞。
|
|
@@ -111,3 +111,9 @@
|
|
|
111
111
|
- 单角色创建或回写失败不得影响其他角色;失败角色进入 `blocked` 或 `failed` 并记录 `blockedReason` / `failureReason` / `nextAction`。
|
|
112
112
|
- Codex 宿主不支持创建子会话、权限不足或接口不可用时,使用本地降级 `local-degraded-no-fake-session-id`,保持 `sessionId=null`,不得伪造 sessionId。
|
|
113
113
|
- 创建成功后的角色会话为只读 `onboarding`,不得直接获得业务代码、数据库、API、配置、依赖、Git 写操作或发布授权。
|
|
114
|
+
|
|
115
|
+
## v1.8 升级顺序
|
|
116
|
+
|
|
117
|
+
升级先校验共享事实、状态源和 coordination transaction;再校验 Skill registry、`assignmentStatus`/`usageStatus` 映射;然后处理前端 audit-only 或已确认的单页面试点;最后才创建临时程序员会话。已有用户修改的控制文件不得静默覆盖,冲突或哈希不一致进入 `blocked`/`recovery-required`。
|
|
118
|
+
|
|
119
|
+
同一 taskId + changeDomain 不得重复创建临时会话;容量不足进入 `queued`,unknown occupancy 保持占用,失败不得自动重试。升级不自动安装 Skill 依赖,不执行业务代码、数据库、API 或 Git 写操作。
|
|
@@ -210,3 +210,9 @@ AI 接手本项目时,请先读取:
|
|
|
210
210
|
- decision=direct-map/rewrite-required/backend-required/unsupported/pending/unknown
|
|
211
211
|
- status=planned/assessing/partial/blocked/paused/completed
|
|
212
212
|
- coverage=full/partial/unknown
|
|
213
|
+
|
|
214
|
+
## v1.8 多会话执行边界
|
|
215
|
+
|
|
216
|
+
共享事实、改动台账和冲突记录必须使用 `factStatus`、`changeStatus`、`conflictStatus` 分域状态;Skill 分配必须使用 `assignmentStatus`,使用结果必须使用 `usageStatus`。不得把 `assignments.json.status` 当作正式字段,也不得把临时会话 `queued` 写进改动状态。
|
|
217
|
+
|
|
218
|
+
前端 `audit-only` 只能审计,禁止产生 diff;`refactor-now` 必须有计划、确认、允许路径、前后哈希、diff 和测试证据。临时程序员只能执行已确认任务,单变更域不得并发写入,最多 3 个运行会话;`occupancyStatus=unknown` 时不得自动释放。
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"changes": [],
|
|
4
|
+
"recordContract": {
|
|
5
|
+
"requiredFields": ["schemaVersion", "changeId", "taskId", "sessionId", "actor", "role", "changeDomain", "targetPaths", "baselineHash", "changeStatus", "evidence", "createdAt", "updatedAt"],
|
|
6
|
+
"changeStatusEnum": ["proposed", "reserved", "in-progress", "completed", "conflict-pending", "blocked", "cancelled"],
|
|
7
|
+
"cancelRule": "Only proposed or reserved may become cancelled; in-progress cannot be silently cancelled."
|
|
8
|
+
},
|
|
9
|
+
"sourceOfTruth": "xinyun-ai/coordination/change-ledger.json"
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"conflictId": "",
|
|
3
|
+
"conflictType": "file|api|field|message|route|business-flow",
|
|
4
|
+
"participants": [],
|
|
5
|
+
"evidence": [],
|
|
6
|
+
"severity": "low|medium|high|critical",
|
|
7
|
+
"conflictStatus": "detected",
|
|
8
|
+
"decision": null,
|
|
9
|
+
"resolvedBy": null,
|
|
10
|
+
"resolvedAt": null,
|
|
11
|
+
"resolutionEvidence": [],
|
|
12
|
+
"nextAction": "awaiting-confirmation"
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"facts": [],
|
|
4
|
+
"recordContract": {
|
|
5
|
+
"requiredFields": ["schemaVersion", "factId", "factType", "scope", "valueHash", "source", "taskId", "sessionId", "evidence", "confidence", "factStatus", "revision", "observedAt", "updatedAt"],
|
|
6
|
+
"factStatusEnum": ["proposed", "confirmed", "superseded", "unknown", "blocked"]
|
|
7
|
+
},
|
|
8
|
+
"sourceOfTruth": "xinyun-ai/coordination/project-facts.json"
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"coordinationTransactionId": "",
|
|
4
|
+
"idempotencyKey": "",
|
|
5
|
+
"taskId": "",
|
|
6
|
+
"sessionId": "",
|
|
7
|
+
"targetFiles": [],
|
|
8
|
+
"phase": "prepared",
|
|
9
|
+
"attempt": 1,
|
|
10
|
+
"failureReason": null,
|
|
11
|
+
"recoveryOwner": null,
|
|
12
|
+
"createdAt": "",
|
|
13
|
+
"updatedAt": "",
|
|
14
|
+
"phaseEnum": ["prepared", "validated", "renamed", "revision-updated", "committed", "recovery-required", "blocked"],
|
|
15
|
+
"targetFileContract": ["path", "tempPath", "beforeHash", "afterHash", "targetRevision"]
|
|
16
|
+
}
|
|
@@ -562,6 +562,20 @@ v1.7.3 fixed Codex role session contract keys: `provider=codex`, `sessionStatus=
|
|
|
562
562
|
- 幂等键固定为 `{sourceTaskId, roleId, taskKind, targetVersion}` 的 JCS-SHA-256;同键复用同一任务。
|
|
563
563
|
- 单角色写入失败为 `blocked/write-failed`,部分成功为 `partial`,全失败为 `blocked`;索引更新中断时保留活动任务并按幂等键恢复,不得伪造 `idle`。
|
|
564
564
|
|
|
565
|
+
## v1.8 多会话协作规则
|
|
566
|
+
|
|
567
|
+
按 v1.8-A/B/C/D 分阶段执行:先完成共享事实、状态源和事务恢复,再路由 Skill,再进行前端审计,最后才允许临时程序员并行写入。
|
|
568
|
+
|
|
569
|
+
`project-facts.json` 的状态字段是 `factStatus`,`change-ledger.json` 是 `changeStatus`,冲突记录是 `conflictStatus`,任务索引是 `taskStatus`,受影响任务是 `refreshStatus`。`changeStatus` 仅允许 `proposed/reserved/in-progress/completed/conflict-pending/blocked/cancelled`,取消只允许 proposed/reserved;临时会话 `queued` 不能写入改动台账。来源缺失、枚举非法或 revision 不一致统一 `taskStatus=blocked`、`blockedReason=status-inconsistent`。
|
|
570
|
+
|
|
571
|
+
跨文件控制面写入必须使用 `coordinationTransactionId` 和 `.transactions/<id>.json`,经过 `prepared/validated/renamed/revision-updated/committed/recovery-required/blocked` 阶段并逐项校验哈希。
|
|
572
|
+
|
|
573
|
+
Skill 分配使用 `assignmentStatus`,使用记录使用 `usageStatus`。固定映射为 pending+selected、selected+selected/running、running+running、completed+completed、fallback+fallback、blocked+failed/blocked、cancelled+skipped;`usageStatus=failed` 必须转为 assignmentStatus=blocked,并记录 failureReason/nextAction。
|
|
574
|
+
|
|
575
|
+
前端审计的 `status` 仅属于审计记录,值为 `not-started/assessing/partial/completed/blocked/unknown`;处理决定使用 `audit-only/refactor-now/defer/requires-confirmation/out-of-scope`。audit-only 零 diff,refactor-now 必须绑定计划、确认、允许路径、前后哈希和测试证据。
|
|
576
|
+
|
|
577
|
+
临时程序员会话最多并行 3 个,状态与 `occupancyStatus` 分离。`occupancyStatus=unknown` 时继续占用额度。同一 changeDomain 不重复写入;unknown 占用不得自动释放,人工释放必须记录 releaseAudit。异常、超时、写回失败和测试失败不得自动重试或伪造完成。
|
|
578
|
+
|
|
565
579
|
## 自我学习
|
|
566
580
|
|
|
567
581
|
发现可复用经验时,先记录为候选经验。候选经验必须标注来源、适用范围、可信度、状态和最后验证时间。用户确认后,才能合并进正式规则。
|
|
@@ -277,3 +277,15 @@
|
|
|
277
277
|
- status=planned/assessing/partial/blocked/paused/completed
|
|
278
278
|
- coverage=full/partial/unknown
|
|
279
279
|
- pauseReason=out-of-scope
|
|
280
|
+
|
|
281
|
+
## v1.8 协作状态摘要
|
|
282
|
+
|
|
283
|
+
- 共享事实状态源:factStatus / revision:
|
|
284
|
+
- 改动台账状态:changeStatus:
|
|
285
|
+
- 冲突状态:conflictStatus:
|
|
286
|
+
- 受影响任务刷新状态:refreshStatus:
|
|
287
|
+
- coordinationTransactionId / phase:
|
|
288
|
+
- Skill assignmentStatus / usageStatus:
|
|
289
|
+
- 前端审计 decision / audit status / coverage:
|
|
290
|
+
- 临时会话 status / occupancyStatus / changeDomain:
|
|
291
|
+
- 未验证范围与阻塞原因:
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"auditId": "",
|
|
3
|
+
"repoRoot": "",
|
|
4
|
+
"platform": "wechat-miniprogram|uni-app|html",
|
|
5
|
+
"framework": "",
|
|
6
|
+
"pagePath": "",
|
|
7
|
+
"componentPath": "",
|
|
8
|
+
"couplingType": "template-style|state-view|api-page|route-page|business-page|cross-platform|shared-component|unknown",
|
|
9
|
+
"props": [],
|
|
10
|
+
"events": [],
|
|
11
|
+
"slots": [],
|
|
12
|
+
"stateDependencies": [],
|
|
13
|
+
"apiDependencies": [],
|
|
14
|
+
"routeDependencies": [],
|
|
15
|
+
"businessFlowDependencies": [],
|
|
16
|
+
"baselineHash": "",
|
|
17
|
+
"decision": "audit-only",
|
|
18
|
+
"status": "not-started",
|
|
19
|
+
"coverage": "unknown",
|
|
20
|
+
"unverifiedScope": [],
|
|
21
|
+
"evidence": [],
|
|
22
|
+
"updatedAt": "",
|
|
23
|
+
"statusEnum": ["not-started", "assessing", "partial", "completed", "blocked", "unknown"],
|
|
24
|
+
"decisionEnum": ["audit-only", "refactor-now", "defer", "requires-confirmation", "out-of-scope"],
|
|
25
|
+
"coverageEnum": ["full", "partial", "unknown"],
|
|
26
|
+
"refactorNowRequired": ["planId", "userConfirmationId", "permittedPaths", "beforeHash", "afterHash", "diffEvidence", "testEvidence"]
|
|
27
|
+
}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
"hashAlgorithm": "sha256",
|
|
4
4
|
"contentEncoding": "utf8-normalized",
|
|
5
5
|
"managedBy": "@pm_zhousl/xinyun-ai-init",
|
|
6
|
-
"lastAppliedVersion": "1.
|
|
6
|
+
"lastAppliedVersion": "1.8.0",
|
|
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.
|
|
12
|
+
"lastAppliedVersion": "1.8.0",
|
|
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.
|
|
4
|
-
"scriptVersion": "2026.07.
|
|
3
|
+
"xinyunAiVersion": "1.8.0",
|
|
4
|
+
"scriptVersion": "2026.07.23",
|
|
5
5
|
"schemaVersion": "1",
|
|
6
6
|
"initializationMode": "fast",
|
|
7
7
|
"expansionMode": "triggered",
|
|
@@ -46,7 +46,11 @@
|
|
|
46
46
|
"taskArchiveTransactions": true,
|
|
47
47
|
"codeGraphRequiredInitialization": true,
|
|
48
48
|
"roleExecutionVisibility": true,
|
|
49
|
-
"codexRoleSessionOrchestration": true
|
|
49
|
+
"codexRoleSessionOrchestration": true,
|
|
50
|
+
"sharedProjectFactsCoordination": true,
|
|
51
|
+
"skillRouting": true,
|
|
52
|
+
"frontendCouplingAudit": true,
|
|
53
|
+
"temporaryProgrammerSessions": true
|
|
50
54
|
},
|
|
51
55
|
"tasking": {
|
|
52
56
|
"currentTask": "xinyun-ai/current-task.md",
|
|
@@ -76,7 +80,7 @@
|
|
|
76
80
|
"bindings": "xinyun-ai/sessions/role-session-bindings.json",
|
|
77
81
|
"bindingTemplate": "xinyun-ai-init/templates/role-session-binding.template.json",
|
|
78
82
|
"parentSessionId": null,
|
|
79
|
-
"targetVersion": "1.
|
|
83
|
+
"targetVersion": "1.8.0",
|
|
80
84
|
"requiredRoleCount": 5,
|
|
81
85
|
"statusEnum": [
|
|
82
86
|
"pending",
|
|
@@ -101,6 +105,45 @@
|
|
|
101
105
|
"hostUnsupportedPolicy": "local-degraded-no-fake-session-id",
|
|
102
106
|
"readyPolicy": "created session enters onboarding first; ready requires role understanding, responsibility confirmation, and execution eligibility gates."
|
|
103
107
|
},
|
|
108
|
+
"coordination": {
|
|
109
|
+
"enabled": true,
|
|
110
|
+
"directory": "xinyun-ai/coordination/",
|
|
111
|
+
"projectFacts": "xinyun-ai/coordination/project-facts.json",
|
|
112
|
+
"changeLedger": "xinyun-ai/coordination/change-ledger.json",
|
|
113
|
+
"contractSnapshots": "xinyun-ai/coordination/contract-snapshots/",
|
|
114
|
+
"conflictRecords": "xinyun-ai/coordination/conflict-records/",
|
|
115
|
+
"transactions": "xinyun-ai/coordination/.transactions/",
|
|
116
|
+
"statusSources": {
|
|
117
|
+
"taskStatus": "xinyun-ai/tasks/task-index.json",
|
|
118
|
+
"changeStatus": "xinyun-ai/coordination/change-ledger.json",
|
|
119
|
+
"conflictStatus": "xinyun-ai/coordination/conflict-records/<conflictId>.json",
|
|
120
|
+
"refreshStatus": "affected task record"
|
|
121
|
+
},
|
|
122
|
+
"transactionPhaseEnum": ["prepared", "validated", "renamed", "revision-updated", "committed", "recovery-required", "blocked"]
|
|
123
|
+
},
|
|
124
|
+
"skills": {
|
|
125
|
+
"enabled": true,
|
|
126
|
+
"directory": "xinyun-ai/skills/",
|
|
127
|
+
"registry": "xinyun-ai/skills/registry.json",
|
|
128
|
+
"assignments": "xinyun-ai/skills/assignments.json",
|
|
129
|
+
"usageRecords": "xinyun-ai/skills/usage-records/",
|
|
130
|
+
"assignmentStatusField": "assignmentStatus",
|
|
131
|
+
"usageStatusField": "usageStatus"
|
|
132
|
+
},
|
|
133
|
+
"frontendAudit": {
|
|
134
|
+
"enabled": true,
|
|
135
|
+
"directory": "xinyun-ai/frontend-audits/",
|
|
136
|
+
"recordTemplate": "xinyun-ai-init/templates/frontend-audit.template.json",
|
|
137
|
+
"defaultDecision": "audit-only"
|
|
138
|
+
},
|
|
139
|
+
"temporarySessions": {
|
|
140
|
+
"enabled": true,
|
|
141
|
+
"directory": "xinyun-ai/sessions/temporary/",
|
|
142
|
+
"recordTemplate": "xinyun-ai-init/templates/temporary-session.template.json",
|
|
143
|
+
"maxConcurrent": 3,
|
|
144
|
+
"sessionStatusField": "status",
|
|
145
|
+
"occupancyStatusEnum": ["occupied", "released", "unknown"]
|
|
146
|
+
},
|
|
104
147
|
"taskTree": {
|
|
105
148
|
"enabled": true,
|
|
106
149
|
"mainTaskTitlePattern": "项目初始化:<项目显示名>",
|
|
@@ -146,3 +146,11 @@
|
|
|
146
146
|
- decision=direct-map/rewrite-required/backend-required/unsupported/pending/unknown
|
|
147
147
|
- status=planned/assessing/partial/blocked/paused/completed
|
|
148
148
|
- coverage=full/partial/unknown
|
|
149
|
+
|
|
150
|
+
## v1.8 检查
|
|
151
|
+
|
|
152
|
+
- `xinyun-ai/coordination/` 的事实、台账、冲突和事务文件是否可追溯。
|
|
153
|
+
- 是否统一使用 `assignmentStatus`,且与 `usageStatus` 合法映射。
|
|
154
|
+
- 前端 audit-only 是否零 diff,refactor-now 是否有确认、哈希、diff 和测试证据。
|
|
155
|
+
- 临时会话是否遵守单变更域、并发上限 3、unknown occupancy 和 releaseAudit。
|
|
156
|
+
- 是否未执行自动安装依赖、业务代码修改、数据库/API改动或 Git 写操作。
|
|
@@ -228,3 +228,10 @@
|
|
|
228
228
|
- decision=direct-map/rewrite-required/backend-required/unsupported/pending/unknown
|
|
229
229
|
- status=planned/assessing/partial/blocked/paused/completed
|
|
230
230
|
- coverage=full/partial/unknown
|
|
231
|
+
|
|
232
|
+
## v1.8 协作能力
|
|
233
|
+
|
|
234
|
+
- 共享事实与冲突协调:`xinyun-ai/coordination/`;状态字段按 fact/change/conflict/task/refresh 分域。
|
|
235
|
+
- Skill 路由:`xinyun-ai/skills/`;正式字段为 `assignmentStatus` 与 `usageStatus`。
|
|
236
|
+
- 前端耦合审计:`xinyun-ai/frontend-audits/`;audit-only 零 diff。
|
|
237
|
+
- 临时程序员会话:最多 3 个并行运行额度;unknown occupancy 不自动释放。
|
|
@@ -152,6 +152,45 @@
|
|
|
152
152
|
],
|
|
153
153
|
"records": []
|
|
154
154
|
},
|
|
155
|
+
"coordination": {
|
|
156
|
+
"enabled": true,
|
|
157
|
+
"directory": "xinyun-ai/coordination/",
|
|
158
|
+
"projectFacts": "xinyun-ai/coordination/project-facts.json",
|
|
159
|
+
"changeLedger": "xinyun-ai/coordination/change-ledger.json",
|
|
160
|
+
"contractSnapshots": "xinyun-ai/coordination/contract-snapshots/",
|
|
161
|
+
"conflictRecords": "xinyun-ai/coordination/conflict-records/",
|
|
162
|
+
"transactions": "xinyun-ai/coordination/.transactions/",
|
|
163
|
+
"statusSources": {
|
|
164
|
+
"taskStatus": "xinyun-ai/tasks/task-index.json",
|
|
165
|
+
"changeStatus": "xinyun-ai/coordination/change-ledger.json",
|
|
166
|
+
"conflictStatus": "xinyun-ai/coordination/conflict-records/<conflictId>.json",
|
|
167
|
+
"refreshStatus": "affected task record"
|
|
168
|
+
},
|
|
169
|
+
"transactionPhaseEnum": ["prepared", "validated", "renamed", "revision-updated", "committed", "recovery-required", "blocked"]
|
|
170
|
+
},
|
|
171
|
+
"skills": {
|
|
172
|
+
"enabled": true,
|
|
173
|
+
"directory": "xinyun-ai/skills/",
|
|
174
|
+
"registry": "xinyun-ai/skills/registry.json",
|
|
175
|
+
"assignments": "xinyun-ai/skills/assignments.json",
|
|
176
|
+
"usageRecords": "xinyun-ai/skills/usage-records/",
|
|
177
|
+
"assignmentStatusField": "assignmentStatus",
|
|
178
|
+
"usageStatusField": "usageStatus"
|
|
179
|
+
},
|
|
180
|
+
"frontendAudit": {
|
|
181
|
+
"enabled": true,
|
|
182
|
+
"directory": "xinyun-ai/frontend-audits/",
|
|
183
|
+
"recordTemplate": "xinyun-ai-init/templates/frontend-audit.template.json",
|
|
184
|
+
"defaultDecision": "audit-only"
|
|
185
|
+
},
|
|
186
|
+
"temporarySessions": {
|
|
187
|
+
"enabled": true,
|
|
188
|
+
"directory": "xinyun-ai/sessions/temporary/",
|
|
189
|
+
"recordTemplate": "xinyun-ai-init/templates/temporary-session.template.json",
|
|
190
|
+
"maxConcurrent": 3,
|
|
191
|
+
"sessionStatusField": "status",
|
|
192
|
+
"occupancyStatusEnum": ["occupied", "released", "unknown"]
|
|
193
|
+
},
|
|
155
194
|
"codeGraphRequired": {
|
|
156
195
|
"codeGraphRecordId": null,
|
|
157
196
|
"required": true,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"assignments": [],
|
|
4
|
+
"recordContract": {
|
|
5
|
+
"requiredFields": ["assignmentId", "skillId", "roleId", "taskId", "workstream", "matchReason", "permittedPaths", "assignmentStatus", "usageRecordId", "createdAt", "updatedAt"],
|
|
6
|
+
"assignmentStatusEnum": ["pending", "selected", "running", "completed", "fallback", "blocked", "cancelled"],
|
|
7
|
+
"usageStatusEnum": ["selected", "running", "completed", "failed", "skipped", "fallback", "blocked"],
|
|
8
|
+
"statusMapping": {
|
|
9
|
+
"pending": ["selected"],
|
|
10
|
+
"selected": ["selected", "running"],
|
|
11
|
+
"running": ["running"],
|
|
12
|
+
"completed": ["completed"],
|
|
13
|
+
"fallback": ["fallback"],
|
|
14
|
+
"blocked": ["failed", "blocked"],
|
|
15
|
+
"cancelled": ["skipped"]
|
|
16
|
+
},
|
|
17
|
+
"failedRule": "usageStatus=failed requires assignmentStatus=blocked, failureReason and nextAction"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"skills": [],
|
|
4
|
+
"recordContract": {
|
|
5
|
+
"requiredFields": ["skillId", "name", "version", "source", "digest", "description", "priority", "availabilityStatus", "trustStatus", "reviewedAt", "allowedRoles", "frameworks", "platforms", "dependencies", "permissions", "evidence", "fallbackPlan", "createdAt", "updatedAt"],
|
|
6
|
+
"availabilityStatusEnum": ["available", "unavailable", "disabled", "unknown"],
|
|
7
|
+
"trustStatusEnum": ["unreviewed", "reviewed", "blocked", "expired"]
|
|
8
|
+
},
|
|
9
|
+
"selectionOrder": ["project-binding", "framework-specific", "generic", "fallback"]
|
|
10
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"taskId": "",
|
|
3
|
+
"parentTaskId": "",
|
|
4
|
+
"moduleId": "",
|
|
5
|
+
"moduleOwnerTaskId": "",
|
|
6
|
+
"executorType": "temporary-programmer",
|
|
7
|
+
"provider": "codex",
|
|
8
|
+
"sessionId": null,
|
|
9
|
+
"parentSessionId": null,
|
|
10
|
+
"planId": "",
|
|
11
|
+
"userConfirmationId": "",
|
|
12
|
+
"permittedPaths": [],
|
|
13
|
+
"changeDomain": [],
|
|
14
|
+
"autoCreated": true,
|
|
15
|
+
"autoClose": true,
|
|
16
|
+
"status": "pending",
|
|
17
|
+
"occupancyStatus": "released",
|
|
18
|
+
"leaseId": null,
|
|
19
|
+
"attempt": 1,
|
|
20
|
+
"failureReason": null,
|
|
21
|
+
"nextAction": "awaiting-confirmation",
|
|
22
|
+
"closeEvidence": null,
|
|
23
|
+
"createdAt": "",
|
|
24
|
+
"updatedAt": "",
|
|
25
|
+
"closedAt": null,
|
|
26
|
+
"closedBy": null,
|
|
27
|
+
"releaseAudit": null,
|
|
28
|
+
"statusEnum": ["pending", "creating", "onboarding", "queued", "executing", "waiting-review", "completed", "blocked", "failed", "closed", "cancelled"],
|
|
29
|
+
"occupancyStatusEnum": ["occupied", "released", "unknown"],
|
|
30
|
+
"maxConcurrent": 3,
|
|
31
|
+
"unknownPolicy": "unknown occupancy continues to consume capacity until complete releaseAudit is recorded"
|
|
32
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"packageName": "xinyun-ai-init",
|
|
3
3
|
"displayName": "欣芸技术开发 Agent 流初始化包",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"scriptVersion": "2026.07.
|
|
4
|
+
"version": "1.8.0",
|
|
5
|
+
"scriptVersion": "2026.07.23",
|
|
6
6
|
"schemaVersion": "1",
|
|
7
7
|
"defaultMode": "fast-init",
|
|
8
8
|
"targetWorkspace": "xinyun-ai",
|
package/package.json
CHANGED
|
@@ -103,18 +103,18 @@ function verifyPackageFiles() {
|
|
|
103
103
|
);
|
|
104
104
|
|
|
105
105
|
addCheck(
|
|
106
|
-
"package.json 版本为 1.
|
|
107
|
-
packageJson.version === "1.
|
|
106
|
+
"package.json 版本为 1.8.0",
|
|
107
|
+
packageJson.version === "1.8.0",
|
|
108
108
|
`当前版本为 ${packageJson.version}`
|
|
109
109
|
);
|
|
110
110
|
addCheck(
|
|
111
|
-
"version.json 版本为 1.
|
|
112
|
-
versionJson.version === "1.
|
|
111
|
+
"version.json 版本为 1.8.0",
|
|
112
|
+
versionJson.version === "1.8.0",
|
|
113
113
|
`当前版本为 ${versionJson.version}`
|
|
114
114
|
);
|
|
115
115
|
addCheck(
|
|
116
|
-
"manifest.template.json 版本为 1.
|
|
117
|
-
manifestTemplate.xinyunAiVersion === "1.
|
|
116
|
+
"manifest.template.json 版本为 1.8.0",
|
|
117
|
+
manifestTemplate.xinyunAiVersion === "1.8.0",
|
|
118
118
|
`当前版本为 ${manifestTemplate.xinyunAiVersion}`
|
|
119
119
|
);
|
|
120
120
|
}
|
|
@@ -469,8 +469,8 @@ function verifyInitRules() {
|
|
|
469
469
|
|
|
470
470
|
function verifyTestScenarios() {
|
|
471
471
|
requireIncludes("test-scenarios/scenarios.md", [
|
|
472
|
-
"1-
|
|
473
|
-
"
|
|
472
|
+
"1-105",
|
|
473
|
+
"106",
|
|
474
474
|
"## 40. v1.6-A",
|
|
475
475
|
"## 53. v1.6 tarball",
|
|
476
476
|
"## 55. verify:rules",
|
|
@@ -485,7 +485,7 @@ function verifyTestScenarios() {
|
|
|
485
485
|
]);
|
|
486
486
|
|
|
487
487
|
requireIncludes("test-scenarios/README.md", [
|
|
488
|
-
"pm_zhousl-xinyun-ai-init-1.
|
|
488
|
+
"pm_zhousl-xinyun-ai-init-1.8.0.tgz",
|
|
489
489
|
"1-96",
|
|
490
490
|
"97",
|
|
491
491
|
"npm run verify:rules",
|
|
@@ -765,7 +765,7 @@ function verifyV16Contracts() {
|
|
|
765
765
|
]);
|
|
766
766
|
|
|
767
767
|
requireIncludes("init/xinyun-ai-init/README.md", [
|
|
768
|
-
"当前规则版本:`1.
|
|
768
|
+
"当前规则版本:`1.8.0`",
|
|
769
769
|
"v1.6 初始化任务、幂等恢复与结果记录",
|
|
770
770
|
"xinyun-ai/tasks/.idempotency/",
|
|
771
771
|
"xinyun-ai/init-result.json",
|
|
@@ -965,7 +965,7 @@ function verifyV16Contracts() {
|
|
|
965
965
|
}
|
|
966
966
|
|
|
967
967
|
addCheck("init-result mode 为 initialization", initResult.mode === "initialization");
|
|
968
|
-
addCheck("init-result targetVersion=1.
|
|
968
|
+
addCheck("init-result targetVersion=1.8.0", initResult.targetVersion === "1.8.0");
|
|
969
969
|
addCheck("init-result businessCodeChanged 初始为 unknown", initResult.businessCodeChanged && initResult.businessCodeChanged.value === "unknown");
|
|
970
970
|
addCheck("task-lock scope=xinyun-ai-control", taskLock.scope === "xinyun-ai-control");
|
|
971
971
|
addCheck("task-lock audit 包含 released", Array.isArray(taskLock.audit) && taskLock.audit.some((item) => item.action === "released"));
|
|
@@ -1071,7 +1071,7 @@ function verifyV17Contracts() {
|
|
|
1071
1071
|
addCheck("html migration pilot requires separate confirmation", htmlMigration.pilotPlan && htmlMigration.pilotPlan.requiresSeparateConfirmation === true);
|
|
1072
1072
|
|
|
1073
1073
|
requireIncludes("init/xinyun-ai-init/README.md", [
|
|
1074
|
-
"当前规则版本:`1.
|
|
1074
|
+
"当前规则版本:`1.8.0`",
|
|
1075
1075
|
"v1.7 规则包一致性检查与 verify:rules",
|
|
1076
1076
|
"frameworkStatus=confirmed/inferred/not-found/unknown/detected-unsupported",
|
|
1077
1077
|
"v1.7 深化预算:5 层目录、80 个关键文件、100 条证据",
|
|
@@ -1090,15 +1090,15 @@ function verifyV17Contracts() {
|
|
|
1090
1090
|
]);
|
|
1091
1091
|
|
|
1092
1092
|
requireIncludes("test-scenarios/scenarios.md", [
|
|
1093
|
-
"当前必测场景为 1-
|
|
1094
|
-
"当前观察场景为
|
|
1093
|
+
"当前必测场景为 1-105",
|
|
1094
|
+
"当前观察场景为 106",
|
|
1095
1095
|
"## 55. verify:rules 正常通过",
|
|
1096
1096
|
"## 69. verify:rules JSON schema 和重复执行",
|
|
1097
1097
|
"## 97. Skill 触发测试",
|
|
1098
1098
|
]);
|
|
1099
1099
|
|
|
1100
1100
|
requireIncludes("test-scenarios/README.md", [
|
|
1101
|
-
"pm_zhousl-xinyun-ai-init-1.
|
|
1101
|
+
"pm_zhousl-xinyun-ai-init-1.8.0.tgz",
|
|
1102
1102
|
"当前必测场景为 `scenarios.md` 的 1-96",
|
|
1103
1103
|
"当前观察场景为 `scenarios.md` 的 97",
|
|
1104
1104
|
"npm run verify:rules",
|
|
@@ -1166,7 +1166,7 @@ function verifyV171Contracts() {
|
|
|
1166
1166
|
addCheck("init-result taskTree role count", initResult.taskTree && initResult.taskTree.roleTaskCount === 5, "init-result taskTree.roleTaskCount 应为 5");
|
|
1167
1167
|
|
|
1168
1168
|
requireIncludes("init/xinyun-ai-init/README.md", [
|
|
1169
|
-
"当前规则版本:`1.
|
|
1169
|
+
"当前规则版本:`1.8.0`",
|
|
1170
1170
|
"项目初始化:<项目显示名>",
|
|
1171
1171
|
"xinyun-ai/tasks/task-index.json",
|
|
1172
1172
|
"xinyun-ai/tasks/.archive-transactions/<archiveTransactionId>.json",
|
|
@@ -1317,7 +1317,7 @@ function verifyV172Contracts() {
|
|
|
1317
1317
|
addCheck(`role-execution template field ${field}`, roleExecution.includes(`- ${field}:`), `role-execution 模板缺少 ${field}`);
|
|
1318
1318
|
}
|
|
1319
1319
|
requireIncludes("init/xinyun-ai-init/README.md", [
|
|
1320
|
-
"当前规则版本:`1.
|
|
1320
|
+
"当前规则版本:`1.8.0`",
|
|
1321
1321
|
"xinyun-ai/tasks/role-execution/<roleTaskId>.md",
|
|
1322
1322
|
"activeTaskIds",
|
|
1323
1323
|
"executableTaskIds",
|
|
@@ -1362,9 +1362,9 @@ function verifyV173Contracts() {
|
|
|
1362
1362
|
"manifest roleSessions.provider 必须为 codex"
|
|
1363
1363
|
);
|
|
1364
1364
|
addCheck(
|
|
1365
|
-
"manifest roleSessions targetVersion=1.
|
|
1366
|
-
manifestTemplate.roleSessions && manifestTemplate.roleSessions.targetVersion === "1.
|
|
1367
|
-
"manifest roleSessions.targetVersion 必须为 1.
|
|
1365
|
+
"manifest roleSessions targetVersion=1.8.0",
|
|
1366
|
+
manifestTemplate.roleSessions && manifestTemplate.roleSessions.targetVersion === "1.8.0",
|
|
1367
|
+
"manifest roleSessions.targetVersion 必须为 1.8.0"
|
|
1368
1368
|
);
|
|
1369
1369
|
addCheck(
|
|
1370
1370
|
"manifest roleSessions bindings path",
|
|
@@ -1439,7 +1439,7 @@ function verifyV173Contracts() {
|
|
|
1439
1439
|
addCheck("assignments session binding rule mentions real host value", assignments.recordContract && assignments.recordContract.sessionBindingRule.includes("real host-returned value"), "assignments sessionBindingRule 必须说明真实宿主返回值");
|
|
1440
1440
|
|
|
1441
1441
|
addCheck("binding template provider codex", bindingTemplate.provider === "codex", "binding template provider 必须为 codex");
|
|
1442
|
-
addCheck("binding template targetVersion=1.
|
|
1442
|
+
addCheck("binding template targetVersion=1.8.0", bindingTemplate.targetVersion === "1.8.0", "binding template targetVersion 必须为 1.8.0");
|
|
1443
1443
|
addCheck("binding template fakeSessionId prohibited", bindingTemplate.degradation && bindingTemplate.degradation.fakeSessionIdProhibited === true, "binding template 必须禁止伪造 sessionId");
|
|
1444
1444
|
addCheck("binding template onboarding readOnly", bindingTemplate.onboarding && bindingTemplate.onboarding.readOnly === true, "binding template onboarding.readOnly 必须为 true");
|
|
1445
1445
|
|
|
@@ -1468,8 +1468,72 @@ function verifyV173Contracts() {
|
|
|
1468
1468
|
requireIncludes("init/xinyun-ai-init/rules/session-workbench.md", ["v1.7.3 角色会话交接字段", "roleSessionIdempotency", "不得伪造 sessionId"]);
|
|
1469
1469
|
requireIncludes("init/xinyun-ai-init/templates/project-guide.template.md", ["v1.7.3 Codex role session anchors", "roleSessionIdempotency", "local-degraded-no-fake-session-id"]);
|
|
1470
1470
|
requireIncludes("init/xinyun-ai-init/templates/project-check.template.md", ["v1.7.3 checks", "provider=codex", "不存在伪造 sessionId"]);
|
|
1471
|
-
requireIncludes("test-scenarios/scenarios.md", ["当前必测场景为 1-
|
|
1472
|
-
requireIncludes("test-scenarios/review-template.md", ["1-
|
|
1471
|
+
requireIncludes("test-scenarios/scenarios.md", ["当前必测场景为 1-105", "当前观察场景为 106", "## 89. v1.7.3 Codex 真实角色会话创建", "## 96. v1.7.3 普通咨询边界", "## 97. Skill"]);
|
|
1472
|
+
requireIncludes("test-scenarios/review-template.md", ["1-105 必测", "89. v1.7.3 Codex 真实角色会话创建", "96. v1.7.3 普通咨询边界", "97. Skill"]);
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
function verifyV18Contracts() {
|
|
1476
|
+
const manifest = JSON.parse(readText("init/xinyun-ai-init/templates/manifest.template.json"));
|
|
1477
|
+
const projectIndex = JSON.parse(readText("init/xinyun-ai-init/templates/project-index.template.json"));
|
|
1478
|
+
const skillAssignments = JSON.parse(readText("init/xinyun-ai-init/templates/skills-assignments.template.json"));
|
|
1479
|
+
const skillRegistry = JSON.parse(readText("init/xinyun-ai-init/templates/skills-registry.template.json"));
|
|
1480
|
+
const frontendAudit = JSON.parse(readText("init/xinyun-ai-init/templates/frontend-audit.template.json"));
|
|
1481
|
+
const temporarySession = JSON.parse(readText("init/xinyun-ai-init/templates/temporary-session.template.json"));
|
|
1482
|
+
const transaction = JSON.parse(readText("init/xinyun-ai-init/templates/coordination-transaction.template.json"));
|
|
1483
|
+
const requiredFiles = [
|
|
1484
|
+
"init/xinyun-ai-init/rules/coordination.md",
|
|
1485
|
+
"init/xinyun-ai-init/rules/skills.md",
|
|
1486
|
+
"init/xinyun-ai-init/rules/frontend-audit.md",
|
|
1487
|
+
"init/xinyun-ai-init/rules/temporary-sessions.md",
|
|
1488
|
+
"init/xinyun-ai-init/templates/coordination-project-facts.template.json",
|
|
1489
|
+
"init/xinyun-ai-init/templates/coordination-change-ledger.template.json",
|
|
1490
|
+
"init/xinyun-ai-init/templates/coordination-contract-snapshot.template.json",
|
|
1491
|
+
"init/xinyun-ai-init/templates/coordination-conflict-record.template.json",
|
|
1492
|
+
"init/xinyun-ai-init/templates/coordination-transaction.template.json",
|
|
1493
|
+
"init/xinyun-ai-init/templates/skills-registry.template.json",
|
|
1494
|
+
"init/xinyun-ai-init/templates/skills-assignments.template.json",
|
|
1495
|
+
"init/xinyun-ai-init/templates/frontend-audit.template.json",
|
|
1496
|
+
"init/xinyun-ai-init/templates/temporary-session.template.json",
|
|
1497
|
+
"test-scenarios/v1.8.0-scenarios.md",
|
|
1498
|
+
];
|
|
1499
|
+
for (const file of requiredFiles) requireFile(file);
|
|
1500
|
+
|
|
1501
|
+
for (const capability of ["sharedProjectFactsCoordination", "skillRouting", "frontendCouplingAudit", "temporaryProgrammerSessions"]) {
|
|
1502
|
+
addCheck(`manifest capability ${capability}`, manifest.capabilities && manifest.capabilities[capability] === true, `manifest.capabilities.${capability} 必须为 true`);
|
|
1503
|
+
}
|
|
1504
|
+
const pathChecks = [
|
|
1505
|
+
[manifest.coordination, "directory", "xinyun-ai/coordination/"],
|
|
1506
|
+
[manifest.skills, "directory", "xinyun-ai/skills/"],
|
|
1507
|
+
[manifest.frontendAudit, "directory", "xinyun-ai/frontend-audits/"],
|
|
1508
|
+
[manifest.temporarySessions, "directory", "xinyun-ai/sessions/temporary/"],
|
|
1509
|
+
[projectIndex.coordination, "directory", "xinyun-ai/coordination/"],
|
|
1510
|
+
[projectIndex.skills, "directory", "xinyun-ai/skills/"],
|
|
1511
|
+
[projectIndex.frontendAudit, "directory", "xinyun-ai/frontend-audits/"],
|
|
1512
|
+
[projectIndex.temporarySessions, "directory", "xinyun-ai/sessions/temporary/"],
|
|
1513
|
+
];
|
|
1514
|
+
for (const [object, field, expected] of pathChecks) addCheck(`v1.8 path ${expected}`, object && object[field] === expected, `路径必须为 ${expected}`);
|
|
1515
|
+
|
|
1516
|
+
addCheck("coordination transaction phase enum", JSON.stringify(transaction.phaseEnum) === JSON.stringify(["prepared", "validated", "renamed", "revision-updated", "committed", "recovery-required", "blocked"]), "事务阶段不完整");
|
|
1517
|
+
addCheck("Skill uses assignmentStatus", skillAssignments.recordContract && skillAssignments.recordContract.requiredFields.includes("assignmentStatus"), "Skill 分配必须使用 assignmentStatus");
|
|
1518
|
+
addCheck("Skill does not use status alias", !JSON.stringify(skillAssignments).includes("assignments.json.status"), "不得使用 assignments.json.status");
|
|
1519
|
+
addCheck("Skill usageStatus mapping exists", skillAssignments.recordContract && skillAssignments.recordContract.statusMapping && skillAssignments.recordContract.statusMapping.blocked.includes("failed"), "缺少失败到 blocked 的映射");
|
|
1520
|
+
addCheck("Skill failed requires reason/action", skillAssignments.recordContract && skillAssignments.recordContract.failedRule.includes("failureReason") && skillAssignments.recordContract.failedRule.includes("nextAction"), "缺少失败证据契约");
|
|
1521
|
+
addCheck("Skill registry separates availability/trust", skillRegistry.recordContract && skillRegistry.recordContract.requiredFields.includes("availabilityStatus") && skillRegistry.recordContract.requiredFields.includes("trustStatus"), "Skill 可用性和可信度必须独立");
|
|
1522
|
+
addCheck("frontend audit-only decision", frontendAudit.decision === "audit-only", "默认必须为 audit-only");
|
|
1523
|
+
addCheck("frontend audit status enum", frontendAudit.statusEnum && frontendAudit.statusEnum.includes("unknown"), "审计状态枚举不完整");
|
|
1524
|
+
addCheck("frontend refactor evidence contract", frontendAudit.refactorNowRequired && frontendAudit.refactorNowRequired.includes("userConfirmationId") && frontendAudit.refactorNowRequired.includes("diffEvidence"), "refactor-now 证据契约不完整");
|
|
1525
|
+
addCheck("temporary session maxConcurrent=3", temporarySession.maxConcurrent === 3, "临时会话并发上限必须为 3");
|
|
1526
|
+
addCheck("temporary session has occupancyStatus", temporarySession.occupancyStatusEnum && temporarySession.occupancyStatusEnum.includes("unknown"), "缺少 occupancyStatus=unknown");
|
|
1527
|
+
|
|
1528
|
+
const v18Snippets = ["v1.8", "factStatus", "changeStatus", "conflictStatus", "assignmentStatus", "usageStatus", "audit-only", "refactor-now", "occupancyStatus=unknown", "coordinationTransactionId"];
|
|
1529
|
+
requireIncludes("init/xinyun-ai-init/README.md", v18Snippets);
|
|
1530
|
+
requireIncludes("init/xinyun-ai-init/templates/core-rules.template.md", v18Snippets);
|
|
1531
|
+
requireIncludes("init/xinyun-ai-init/rules/coordination.md", ["三道门禁", "coordinationTransactionId", "status-inconsistent"]);
|
|
1532
|
+
requireIncludes("init/xinyun-ai-init/rules/skills.md", ["assignmentStatus", "usageStatus", "failureReason", "nextAction"]);
|
|
1533
|
+
requireIncludes("init/xinyun-ai-init/rules/frontend-audit.md", ["audit-only", "refactor-now", "unverifiedScope"]);
|
|
1534
|
+
requireIncludes("init/xinyun-ai-init/rules/temporary-sessions.md", ["最多同时占用 3 个运行额度", "occupancyStatus=unknown", "releaseAudit"]);
|
|
1535
|
+
requireIncludes("test-scenarios/scenarios.md", ["当前必测场景为 1-105", "当前观察场景为 106", "## 98. v1.8-A", "## 105. v1.8 敏感信息边界"]);
|
|
1536
|
+
requireIncludes("test-scenarios/review-template.md", ["1-105 必测", "98. v1.8-A 状态域和来源一致性", "105. v1.8 敏感信息边界"]);
|
|
1473
1537
|
}
|
|
1474
1538
|
|
|
1475
1539
|
function main() {
|
|
@@ -1487,6 +1551,7 @@ function main() {
|
|
|
1487
1551
|
verifyV171Contracts();
|
|
1488
1552
|
verifyV172Contracts();
|
|
1489
1553
|
verifyV173Contracts();
|
|
1554
|
+
verifyV18Contracts();
|
|
1490
1555
|
verifyTestScenarios();
|
|
1491
1556
|
verifyJsonAndMarkdown();
|
|
1492
1557
|
|
|
@@ -5,7 +5,7 @@ const os = require("os");
|
|
|
5
5
|
const path = require("path");
|
|
6
6
|
const { spawnSync } = require("child_process");
|
|
7
7
|
|
|
8
|
-
const VERSION = "1.
|
|
8
|
+
const VERSION = "1.8.0";
|
|
9
9
|
const checks = [];
|
|
10
10
|
|
|
11
11
|
function parseArgs(argv) {
|
|
@@ -176,12 +176,26 @@ function validatePackageFiles(root, target, isTarball) {
|
|
|
176
176
|
"init/xinyun-ai-init/templates/archive-transaction.template.json",
|
|
177
177
|
"init/xinyun-ai-init/templates/role-execution.template.md",
|
|
178
178
|
"init/xinyun-ai-init/templates/role-session-binding.template.json",
|
|
179
|
+
"init/xinyun-ai-init/templates/coordination-project-facts.template.json",
|
|
180
|
+
"init/xinyun-ai-init/templates/coordination-change-ledger.template.json",
|
|
181
|
+
"init/xinyun-ai-init/templates/coordination-contract-snapshot.template.json",
|
|
182
|
+
"init/xinyun-ai-init/templates/coordination-conflict-record.template.json",
|
|
183
|
+
"init/xinyun-ai-init/templates/coordination-transaction.template.json",
|
|
184
|
+
"init/xinyun-ai-init/templates/skills-registry.template.json",
|
|
185
|
+
"init/xinyun-ai-init/templates/skills-assignments.template.json",
|
|
186
|
+
"init/xinyun-ai-init/templates/frontend-audit.template.json",
|
|
187
|
+
"init/xinyun-ai-init/templates/temporary-session.template.json",
|
|
188
|
+
"init/xinyun-ai-init/rules/coordination.md",
|
|
189
|
+
"init/xinyun-ai-init/rules/skills.md",
|
|
190
|
+
"init/xinyun-ai-init/rules/frontend-audit.md",
|
|
191
|
+
"init/xinyun-ai-init/rules/temporary-sessions.md",
|
|
192
|
+
"test-scenarios/v1.8.0-scenarios.md",
|
|
179
193
|
];
|
|
180
194
|
|
|
181
195
|
for (const file of requiredFiles) requireFile(root, target, file);
|
|
182
196
|
|
|
183
197
|
if (isTarball) {
|
|
184
|
-
const sourceOnly = "version-plans/releases/v1.
|
|
198
|
+
const sourceOnly = "version-plans/releases/v1.8.0.md";
|
|
185
199
|
addCheck(target, "package.source-only", "package", !existsPath(root, sourceOnly) ? "pass" : "warn", sourceOnly, null, "not required in tarball", existsPath(root, sourceOnly) ? "present" : "not present", "source-only version-plans is not required in tarball.", "No action required unless package policy changes.", "optional");
|
|
186
200
|
}
|
|
187
201
|
}
|
|
@@ -304,7 +318,7 @@ function validateV17Content(root, target) {
|
|
|
304
318
|
"scope/unverifiedScope",
|
|
305
319
|
"pauseReason=out-of-scope",
|
|
306
320
|
];
|
|
307
|
-
requireIncludes(root, target, "init/xinyun-ai-init/README.md", ["当前规则版本:`1.
|
|
321
|
+
requireIncludes(root, target, "init/xinyun-ai-init/README.md", ["当前规则版本:`1.8.0`", ...common]);
|
|
308
322
|
requireIncludes(root, target, "init/xinyun-ai-init/templates/core-rules.template.md", common);
|
|
309
323
|
requireIncludes(root, target, "init/xinyun-ai-init/templates/AGENTS.template.md", ["v1.7 规则包一致性、技术栈 profile 与 HTML 迁移准备", "`verify:rules` 只读", "ThinkPHP 不得误套其他项目", ...common.slice(5)]);
|
|
310
324
|
requireIncludes(root, target, "init/xinyun-ai-init/templates/current-task.template.md", ["verify:rules.status", "language", "runtime", "platform", "framework", ...common.slice(5)]);
|
|
@@ -316,9 +330,51 @@ function validateV17Content(root, target) {
|
|
|
316
330
|
requireIncludes(root, target, "init/xinyun-ai-init/rules/session-workbench.md", ["v1.7 任务单补充字段", "verifyRulesStatus", "migrationStatus", "HTML 迁移只允许评估和单页面 / 区块试点计划"]);
|
|
317
331
|
requireIncludes(root, target, "init/xinyun-ai-init/rules/frameworks/README.md", ["v1.7 技术栈 profile", "coverage=partial", ...common.slice(5, 10)]);
|
|
318
332
|
requireIncludes(root, target, "init/xinyun-ai-init/rules/frameworks/backend/php/thinkphp.md", ["v1.7 ThinkPHP 深化模块", "frameworkStatus=confirmed", "moduleStatus=loaded", "Controller", "Request/Validate", "Service", "Model/ORM", "Middleware", "队列"]);
|
|
319
|
-
requireIncludes(root, target, "test-scenarios/scenarios.md", ["当前必测场景为 1-
|
|
333
|
+
requireIncludes(root, target, "test-scenarios/scenarios.md", ["当前必测场景为 1-105", "当前观察场景为 106", "## 55. verify:rules 正常通过", "## 69. verify:rules JSON schema 和重复执行"]);
|
|
320
334
|
requireIncludes(root, target, "test-scenarios/review-template.md", ["55. verify:rules 正常通过", "69. verify:rules JSON schema 和重复执行", "97. Skill 触发测试"]);
|
|
321
|
-
requireIncludes(root, target, "test-scenarios/README.md", ["npm run verify:rules", "pm_zhousl-xinyun-ai-init-1.
|
|
335
|
+
requireIncludes(root, target, "test-scenarios/README.md", ["npm run verify:rules", "pm_zhousl-xinyun-ai-init-1.8.0.tgz", "v1.7.2-scenarios.md", "v1.7.3-scenarios.md", "当前版本必测场景为 `scenarios.md` 的 1-105", "106 为观察项"]);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function validateV18Content(root, target) {
|
|
339
|
+
const required = [
|
|
340
|
+
["init/xinyun-ai-init/rules/coordination.md", ["factStatus", "changeStatus", "conflictStatus", "coordinationTransactionId", "status-inconsistent"]],
|
|
341
|
+
["init/xinyun-ai-init/rules/skills.md", ["assignmentStatus", "usageStatus", "failureReason", "nextAction", "availabilityStatus", "trustStatus"]],
|
|
342
|
+
["init/xinyun-ai-init/rules/frontend-audit.md", ["audit-only", "refactor-now", "unverifiedScope", "coverage"]],
|
|
343
|
+
["init/xinyun-ai-init/rules/temporary-sessions.md", ["occupancyStatus=unknown", "releaseAudit", "最多同时占用 3 个运行额度"]],
|
|
344
|
+
["test-scenarios/v1.8.0-scenarios.md", ["v1.8-01", "v1.8-08", "forbiddenOperations", "sensitiveScan"]],
|
|
345
|
+
["init/xinyun-ai-init/README.md", ["v1.8", "assignmentStatus", "occupancyStatus=unknown", "coordinationTransactionId"]],
|
|
346
|
+
["init/xinyun-ai-init/templates/core-rules.template.md", ["factStatus", "changeStatus", "conflictStatus", "assignmentStatus", "usageStatus"]],
|
|
347
|
+
["init/xinyun-ai-init/templates/AGENTS.template.md", ["assignments.json.status", "assignmentStatus", "occupancyStatus"]],
|
|
348
|
+
];
|
|
349
|
+
for (const [file, snippets] of required) requireIncludes(root, target, file, snippets, "v1.8.content");
|
|
350
|
+
|
|
351
|
+
const manifest = readJson(root, "init/xinyun-ai-init/templates/manifest.template.json");
|
|
352
|
+
const projectIndex = readJson(root, "init/xinyun-ai-init/templates/project-index.template.json");
|
|
353
|
+
const capabilities = manifest.capabilities || {};
|
|
354
|
+
for (const flag of ["sharedProjectFactsCoordination", "skillRouting", "frontendCouplingAudit", "temporaryProgrammerSessions"]) {
|
|
355
|
+
addCheck(target, "v1.8.capability", "manifest", capabilities[flag] === true ? "pass" : "fail", "init/xinyun-ai-init/templates/manifest.template.json", `capabilities.${flag}`, true, capabilities[flag], "v1.8 capability checked.", "Register the v1.8 capability.");
|
|
356
|
+
}
|
|
357
|
+
const pathPairs = [
|
|
358
|
+
[manifest.coordination, "directory", "xinyun-ai/coordination/"],
|
|
359
|
+
[manifest.skills, "directory", "xinyun-ai/skills/"],
|
|
360
|
+
[manifest.frontendAudit, "directory", "xinyun-ai/frontend-audits/"],
|
|
361
|
+
[manifest.temporarySessions, "directory", "xinyun-ai/sessions/temporary/"],
|
|
362
|
+
[projectIndex.coordination, "directory", "xinyun-ai/coordination/"],
|
|
363
|
+
[projectIndex.skills, "directory", "xinyun-ai/skills/"],
|
|
364
|
+
[projectIndex.frontendAudit, "directory", "xinyun-ai/frontend-audits/"],
|
|
365
|
+
[projectIndex.temporarySessions, "directory", "xinyun-ai/sessions/temporary/"],
|
|
366
|
+
];
|
|
367
|
+
for (const [object, field, expected] of pathPairs) addCheck(target, "v1.8.path", "registry", object && object[field] === expected ? "pass" : "fail", "manifest/project-index templates", field, expected, object && object[field], "v1.8 path registration checked.", "Register the v1.8 control path.");
|
|
368
|
+
|
|
369
|
+
const assignments = readJson(root, "init/xinyun-ai-init/templates/skills-assignments.template.json");
|
|
370
|
+
const transaction = readJson(root, "init/xinyun-ai-init/templates/coordination-transaction.template.json");
|
|
371
|
+
const frontend = readJson(root, "init/xinyun-ai-init/templates/frontend-audit.template.json");
|
|
372
|
+
const temporary = readJson(root, "init/xinyun-ai-init/templates/temporary-session.template.json");
|
|
373
|
+
addCheck(target, "v1.8.assignment.field", "schema", assignments.recordContract.requiredFields.includes("assignmentStatus") ? "pass" : "fail", "skills-assignments.template.json", "assignmentStatus", true, assignments.recordContract.requiredFields.includes("assignmentStatus"), "assignmentStatus field checked.", "Use assignmentStatus.");
|
|
374
|
+
addCheck(target, "v1.8.assignment.no-status-alias", "schema", !JSON.stringify(assignments).includes("assignments.json.status") ? "pass" : "fail", "skills-assignments.template.json", null, "no stale status alias", JSON.stringify(assignments), "No stale assignment status alias checked.", "Remove assignments.json.status.");
|
|
375
|
+
addCheck(target, "v1.8.transaction.phase", "schema", transaction.phaseEnum.includes("recovery-required") && transaction.phaseEnum.includes("blocked") ? "pass" : "fail", "coordination-transaction.template.json", "phaseEnum", "recovery-required,blocked", transaction.phaseEnum, "Transaction phases checked.", "Restore transaction phase enum.");
|
|
376
|
+
addCheck(target, "v1.8.frontend.audit-only", "schema", frontend.decision === "audit-only" && frontend.coverage === "unknown" ? "pass" : "fail", "frontend-audit.template.json", "decision/coverage", "audit-only/unknown", `${frontend.decision}/${frontend.coverage}`, "Frontend audit default checked.", "Use read-only audit defaults.");
|
|
377
|
+
addCheck(target, "v1.8.temporary.capacity", "schema", temporary.maxConcurrent === 3 && temporary.occupancyStatusEnum.includes("unknown") ? "pass" : "fail", "temporary-session.template.json", "maxConcurrent/occupancyStatusEnum", "3/unknown", `${temporary.maxConcurrent}/${temporary.occupancyStatusEnum}`, "Temporary session capacity checked.", "Restore capacity and unknown occupancy.");
|
|
322
378
|
}
|
|
323
379
|
|
|
324
380
|
function validateV171Content(root, target) {
|
|
@@ -347,7 +403,7 @@ function validateV171Content(root, target) {
|
|
|
347
403
|
requireIncludes(root, target, "init/xinyun-ai-init/rules/upgrade-rules.md", ["v1.7.1 升级补齐"]);
|
|
348
404
|
requireIncludes(root, target, "init/xinyun-ai-init/rules/directory-self-completion.md", ["v1.7.1 任务树、归档与 CodeGraph 目录"]);
|
|
349
405
|
requireIncludes(root, target, "init/xinyun-ai-init/rules/session-workbench.md", ["v1.7.1 任务单补充字段"]);
|
|
350
|
-
requireIncludes(root, target, "test-scenarios/scenarios.md", ["当前必测场景为 1-
|
|
406
|
+
requireIncludes(root, target, "test-scenarios/scenarios.md", ["当前必测场景为 1-105", "当前观察场景为 106", "## 71. v1.7.1 主任务命名", "## 87. v1.7.1 普通咨询和版本回归"]);
|
|
351
407
|
requireIncludes(root, target, "test-scenarios/v1.7.1-scenarios.md", ["主任务命名", "CodeGraph记录与失败矩阵", "普通咨询边界"]);
|
|
352
408
|
}
|
|
353
409
|
|
|
@@ -364,7 +420,7 @@ function validateV172Content(root, target) {
|
|
|
364
420
|
"JCS-SHA-256",
|
|
365
421
|
"blockedReason=write-failed",
|
|
366
422
|
];
|
|
367
|
-
requireIncludes(root, target, "init/xinyun-ai-init/README.md", ["当前规则版本:`1.
|
|
423
|
+
requireIncludes(root, target, "init/xinyun-ai-init/README.md", ["当前规则版本:`1.8.0`", ...snippets]);
|
|
368
424
|
requireIncludes(root, target, "init/xinyun-ai-init/templates/core-rules.template.md", snippets);
|
|
369
425
|
requireIncludes(root, target, "init/xinyun-ai-init/rules/init-rules.md", ["v1.7.2 角色后续任务可见性", "role-execution"]);
|
|
370
426
|
requireIncludes(root, target, "init/xinyun-ai-init/rules/upgrade-rules.md", ["v1.7.2 升级补建角色后续任务", "write-failed"]);
|
|
@@ -408,7 +464,7 @@ function validateV173Content(root, target) {
|
|
|
408
464
|
"created-but-writeback-failed",
|
|
409
465
|
"创建成功不等于业务代码修改授权",
|
|
410
466
|
];
|
|
411
|
-
requireIncludes(root, target, "init/xinyun-ai-init/README.md", ["当前规则版本:`1.
|
|
467
|
+
requireIncludes(root, target, "init/xinyun-ai-init/README.md", ["当前规则版本:`1.8.0`", ...snippets]);
|
|
412
468
|
requireIncludes(root, target, "init/xinyun-ai-init/templates/core-rules.template.md", snippets);
|
|
413
469
|
requireIncludes(root, target, "init/xinyun-ai-init/templates/AGENTS.template.md", ["v1.7.3 Codex 角色会话自动创建与绑定", "provider=codex", "local-degraded-no-fake-session-id"]);
|
|
414
470
|
requireIncludes(root, target, "init/xinyun-ai-init/rules/init-rules.md", ["v1.7.3 Codex 角色会话初始化", "provider=codex", "local-degraded-no-fake-session-id"]);
|
|
@@ -416,7 +472,7 @@ function validateV173Content(root, target) {
|
|
|
416
472
|
requireIncludes(root, target, "init/xinyun-ai-init/rules/session-workbench.md", ["v1.7.3 角色会话交接字段", "roleSessionIdempotency", "不得伪造 sessionId"]);
|
|
417
473
|
requireIncludes(root, target, "init/xinyun-ai-init/rules/directory-self-completion.md", ["v1.7.3 角色会话绑定目录", "xinyun-ai/sessions/role-session-bindings.json", "local-degraded-no-fake-session-id"]);
|
|
418
474
|
requireIncludes(root, target, "test-scenarios/v1.7.3-scenarios.md", ["五个真实角色子会话创建", "会话绑定回写一致性", "onboarding 只读边界", "宿主不支持时本地降级"]);
|
|
419
|
-
requireIncludes(root, target, "test-scenarios/scenarios.md", ["当前必测场景为 1-
|
|
475
|
+
requireIncludes(root, target, "test-scenarios/scenarios.md", ["当前必测场景为 1-105", "当前观察场景为 106", "## 89. v1.7.3 Codex 真实角色会话创建", "## 96. v1.7.3 普通咨询边界"]);
|
|
420
476
|
}
|
|
421
477
|
|
|
422
478
|
function validateJsonFiles(root, target) {
|
|
@@ -458,6 +514,7 @@ function validateRoot(root, target, isTarball = false) {
|
|
|
458
514
|
validateV171Content(root, target);
|
|
459
515
|
validateV172Content(root, target);
|
|
460
516
|
validateV173Content(root, target);
|
|
517
|
+
validateV18Content(root, target);
|
|
461
518
|
validateJsonFiles(root, target);
|
|
462
519
|
}
|
|
463
520
|
|
package/test-scenarios/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
本目录用于让其他 AI 或人工审查员测试 `@pm_zhousl/xinyun-ai-init` 初始化包的真实使用效果。
|
|
4
4
|
|
|
5
|
+
当前版本必测场景为 `scenarios.md` 的 1-105,106 为观察项。
|
|
6
|
+
|
|
5
7
|
## 使用方式
|
|
6
8
|
|
|
7
9
|
### 1. 本地待发布版本测试
|
|
@@ -37,7 +39,7 @@ npm pack
|
|
|
37
39
|
随后在临时项目中使用 tarball 测试。注意不要直接执行 `npx <tarball> --force`,该形式可能不会正确调用 bin。推荐:
|
|
38
40
|
|
|
39
41
|
```powershell
|
|
40
|
-
npx --yes --package E:\ai-fabu-xiangmu\AI开发初始化脚本\xinyun-ai-init-npm\pm_zhousl-xinyun-ai-init-1.
|
|
42
|
+
npx --yes --package E:\ai-fabu-xiangmu\AI开发初始化脚本\xinyun-ai-init-npm\pm_zhousl-xinyun-ai-init-1.8.0.tgz xinyun-ai-init --force --no-version-check
|
|
41
43
|
```
|
|
42
44
|
|
|
43
45
|
### 3. 线上回归测试
|
|
@@ -70,7 +72,7 @@ npx --yes @pm_zhousl/xinyun-ai-init@latest --force
|
|
|
70
72
|
```powershell
|
|
71
73
|
npm run verify:rules
|
|
72
74
|
npm run verify:rules -- --json
|
|
73
|
-
npm run verify:rules -- --tarball .\pm_zhousl-xinyun-ai-init-1.
|
|
75
|
+
npm run verify:rules -- --tarball .\pm_zhousl-xinyun-ai-init-1.8.0.tgz
|
|
74
76
|
npm run verify:rules:security
|
|
75
77
|
```
|
|
76
78
|
|
|
@@ -95,6 +97,10 @@ npm run verify:init
|
|
|
95
97
|
|
|
96
98
|
## 审查原则
|
|
97
99
|
|
|
100
|
+
## v1.8 多会话协作回归
|
|
101
|
+
|
|
102
|
+
除 `scenarios.md` 外,发布前必须逐条执行 `v1.8.0-scenarios.md`。重点验证四个阶段分别通过:A 的共享事实/事务状态,B 的 Skill 路由和 `assignmentStatus` 映射,C 的前端 audit-only/refactor-now 边界,D 的临时会话并发/occupancy 恢复。真实 AI 行为报告必须保存 before/after、changedFiles、禁止操作和敏感扫描结果。
|
|
103
|
+
|
|
98
104
|
- 重点看 AI 行为是否符合规则,不只看文件是否生成。
|
|
99
105
|
- 初始化应轻量,不做全量扫描。
|
|
100
106
|
- 改代码前必须先出方案并等待确认。
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 测试审查记录模板
|
|
2
2
|
|
|
3
|
+
当前版本 1-105 必测,106 为观察项。
|
|
4
|
+
|
|
3
5
|
## 基本信息
|
|
4
6
|
|
|
5
7
|
- 测试项目:
|
|
@@ -138,6 +140,16 @@
|
|
|
138
140
|
| 96. v1.7.3 普通咨询边界 | 待填写 | 待填写 | 待填写 |
|
|
139
141
|
| 97. Skill 触发测试(观察项,不阻断发布) | 待填写 | 待填写 | 待填写 |
|
|
140
142
|
|
|
143
|
+
| 98. v1.8-A 状态域和来源一致性 | 待填写 | 待填写 | 待填写 |
|
|
144
|
+
| 99. v1.8-A 协调事务恢复 | 待填写 | 待填写 | 待填写 |
|
|
145
|
+
| 100. v1.8-B Skill 路由和状态映射 | 待填写 | 待填写 | 待填写 |
|
|
146
|
+
| 101. v1.8-C 前端耦合审计 | 待填写 | 待填写 | 待填写 |
|
|
147
|
+
| 102. v1.8-D 临时会话队列和并发 | 待填写 | 待填写 | 待填写 |
|
|
148
|
+
| 103. v1.8-D occupancy 恢复 | 待填写 | 待填写 | 待填写 |
|
|
149
|
+
| 104. v1.8 跨会话冲突追溯 | 待填写 | 待填写 | 待填写 |
|
|
150
|
+
| 105. v1.8 敏感信息边界 | 待填写 | 待填写 | 待填写 |
|
|
151
|
+
| 106. Skill 自动触发倾向(观察项,不阻断发布) | 待填写 | 待填写 | 待填写 |
|
|
152
|
+
|
|
141
153
|
说明:Skill 触发测试是观察项。除非它影响 1-96 的必测场景,否则不作为当前版本不可发布的理由。
|
|
142
154
|
|
|
143
155
|
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## 测试分级说明
|
|
4
4
|
|
|
5
|
-
- 必测场景:1-
|
|
6
|
-
- 观察场景:
|
|
5
|
+
- 必测场景:1-105,用于判断当前版本是否可以发布。
|
|
6
|
+
- 观察场景:106,用于收集后续优化建议,不作为当前版本发布阻断项。
|
|
7
7
|
|
|
8
|
-
当前必测场景为 1-
|
|
8
|
+
当前必测场景为 1-105;当前观察场景为 106。
|
|
9
9
|
|
|
10
10
|
## 1. 初始化可用性测试
|
|
11
11
|
|
|
@@ -1181,4 +1181,40 @@
|
|
|
1181
1181
|
- 是否触发需求理解或产品 / UI 设计前置理解。
|
|
1182
1182
|
- 是否没有默认全量启用所有 Skill。
|
|
1183
1183
|
- 是否先输出理解结果和改动计划。
|
|
1184
|
+
|
|
1185
|
+
## 98. v1.8-A 状态域和来源一致性
|
|
1186
|
+
|
|
1187
|
+
验证 `factStatus`、`changeStatus`、`conflictStatus`、`taskStatus`、`refreshStatus` 分域,非法组合或 revision 不一致统一 blocked;`queued` 只能属于临时会话状态。
|
|
1188
|
+
|
|
1189
|
+
## 99. v1.8-A 协调事务恢复
|
|
1190
|
+
|
|
1191
|
+
验证 `coordinationTransactionId`、JCS-SHA-256 幂等、事务阶段、目标文件哈希、崩溃恢复、权限失败和重复提交不覆盖历史。
|
|
1192
|
+
|
|
1193
|
+
## 100. v1.8-B Skill 路由和状态映射
|
|
1194
|
+
|
|
1195
|
+
验证已确认/未识别框架、Skill 排序、依赖缺失、权限不足和未审核 Skill;确认 `assignmentStatus` 与 `usageStatus` 映射,失败必须 blocked 并记录原因和下一步。
|
|
1196
|
+
|
|
1197
|
+
## 101. v1.8-C 前端耦合审计
|
|
1198
|
+
|
|
1199
|
+
验证 audit-only 零 diff,refactor-now 的计划/确认/允许路径/哈希/diff/测试证据,以及预算超限的 partial/unknown。
|
|
1200
|
+
|
|
1201
|
+
## 102. v1.8-D 临时会话队列和并发
|
|
1202
|
+
|
|
1203
|
+
验证临时程序员会话合法流转、单变更域互斥、最多 3 个运行会话、队列稳定排序和 occupancy 初始状态。
|
|
1204
|
+
|
|
1205
|
+
## 103. v1.8-D occupancy 恢复
|
|
1206
|
+
|
|
1207
|
+
验证崩溃、锁损坏、不可读会话进入 `occupancyStatus=unknown` 并持续占用,人工释放必须有完整 `releaseAudit`。
|
|
1208
|
+
|
|
1209
|
+
## 104. v1.8 跨会话冲突追溯
|
|
1210
|
+
|
|
1211
|
+
验证共享事实、改动台账、冲突记录、刷新状态和三道协调门禁可相互追溯,单会话不得自动合并。
|
|
1212
|
+
|
|
1213
|
+
## 105. v1.8 敏感信息边界
|
|
1214
|
+
|
|
1215
|
+
验证 Skill、事务、审计和会话交接中的 Token、密码、私钥、`.env`、连接串和 Authorization 原文均被脱敏,禁止操作和业务基线证据完整。
|
|
1216
|
+
|
|
1217
|
+
## 106. Skill 自动触发倾向(观察项)
|
|
1218
|
+
|
|
1219
|
+
观察已登记 Skill 是否被合理选择,不要求实现完整自动调度,不作为 v1.8 发布阻断项。
|
|
1184
1220
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# v1.8.0 专属行为场景
|
|
2
|
+
|
|
3
|
+
以下场景必须在独立夹具中执行,逐项保存 `input`、`before`、`after`、`result`、`changedFiles`、`forbiddenOperations`、`evidence` 和 `sensitiveScan`。不能以文本断言替代真实 AI 行为。
|
|
4
|
+
|
|
5
|
+
## v1.8-01 状态域和来源一致性
|
|
6
|
+
|
|
7
|
+
构造任务、改动、冲突和刷新记录的合法/非法组合。验证 `factStatus`、`changeStatus`、`conflictStatus`、`taskStatus`、`refreshStatus` 各自裁决,非法枚举或 revision 不一致统一进入 `taskStatus=blocked`、`blockedReason=status-inconsistent`;`queued` 不出现在 changeStatus。
|
|
8
|
+
|
|
9
|
+
## v1.8-02 协调事务恢复
|
|
10
|
+
|
|
11
|
+
重复提交、崩溃、部分重命名、索引/事实不同步、哈希不一致和权限失败。验证 `coordinationTransactionId` 幂等复用、事务阶段、每个 targetFiles 的 path/tempPath/beforeHash/afterHash/targetRevision,以及最终 `committed` 或 `blocked`,不得只更新索引或删除历史。
|
|
12
|
+
|
|
13
|
+
## v1.8-03 Skill 路由与降级
|
|
14
|
+
|
|
15
|
+
准备 ThinkPHP、uni-app、微信小程序、HTML、未识别框架、多 Skill 同级、依赖缺失、权限不足和未审核外部 Skill 夹具。验证 availabilityStatus/trustStatus 独立,排序稳定,`assignmentStatus` 与 `usageStatus` 严格映射;失败映射 blocked 并有 failureReason/nextAction,不安装依赖、不伪造执行。
|
|
16
|
+
|
|
17
|
+
## v1.8-04 前端审计边界
|
|
18
|
+
|
|
19
|
+
执行微信小程序、uni-app、HTML 页面耦合审计。验证 audit-only 零 diff;refactor-now 只有在计划、用户确认、允许路径、前后哈希、diff 和测试证据齐全时才可执行;超预算/权限失败进入 partial/unknown 并填写 unverifiedScope。
|
|
20
|
+
|
|
21
|
+
## v1.8-05 临时会话状态和队列
|
|
22
|
+
|
|
23
|
+
验证 `pending -> creating -> onboarding -> executing`、容量不足 `onboarding -> queued -> creating`、容量可用时 onboarding 直达 executing。检查单变更域不重复创建、并发上限 3、确认时间/优先级/taskId 稳定排序及初始 occupancy。
|
|
24
|
+
|
|
25
|
+
## v1.8-06 occupancy 恢复和人工释放
|
|
26
|
+
|
|
27
|
+
模拟崩溃、锁损坏、会话不可读和人工释放。验证 `occupancyStatus=unknown` 持续占用,失败不自动重试或关闭;只有包含 auditId/releasedBy/releasedAt/reason/evidence 的 releaseAudit 才能释放额度。
|
|
28
|
+
|
|
29
|
+
## v1.8-07 跨会话冲突
|
|
30
|
+
|
|
31
|
+
前端任务修改服务端 API 或字段时,验证领取前、写入前、完成后三道门禁,project-facts、change-ledger、conflict-records 和 refreshStatus 可相互追溯;单会话不能自动合并或裁决。
|
|
32
|
+
|
|
33
|
+
## v1.8-08 敏感信息边界
|
|
34
|
+
|
|
35
|
+
将 Token、密码、私钥、`.env`、连接串和 Authorization 值放入 Skill 输入、事务错误、审计证据和会话交接。验证 JSON、Markdown、日志、stdout/stderr 和快照无敏感原文,只保留脱敏结果、路径类别或哈希。
|
|
36
|
+
|
|
37
|
+
## v1.8 禁止操作
|
|
38
|
+
|
|
39
|
+
所有场景必须证明未修改业务代码、数据库、API、依赖、系统环境或 Git,未执行 npm publish,未自动安装依赖,业务基线哈希不变。
|