@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.
Files changed (28) hide show
  1. package/README.md +1 -1
  2. package/init/xinyun-ai-init/README.md +21 -1
  3. package/init/xinyun-ai-init/rules/directory-self-completion.md +8 -0
  4. package/init/xinyun-ai-init/rules/init-rules.md +11 -0
  5. package/init/xinyun-ai-init/rules/session-workbench.md +19 -0
  6. package/init/xinyun-ai-init/rules/upgrade-rules.md +10 -0
  7. package/init/xinyun-ai-init/templates/AGENTS.template.md +11 -0
  8. package/init/xinyun-ai-init/templates/core-rules.template.md +19 -0
  9. package/init/xinyun-ai-init/templates/current-task.template.md +25 -0
  10. package/init/xinyun-ai-init/templates/init-result.template.json +14 -1
  11. package/init/xinyun-ai-init/templates/managed-baseline.template.json +2 -2
  12. package/init/xinyun-ai-init/templates/manifest.template.json +42 -7
  13. package/init/xinyun-ai-init/templates/project-check.template.md +15 -0
  14. package/init/xinyun-ai-init/templates/project-guide.template.md +13 -0
  15. package/init/xinyun-ai-init/templates/project-index.template.json +19 -0
  16. package/init/xinyun-ai-init/templates/role-execution.template.md +18 -0
  17. package/init/xinyun-ai-init/templates/role-session-binding.template.json +43 -0
  18. package/init/xinyun-ai-init/templates/task-index.template.json +8 -0
  19. package/init/xinyun-ai-init/templates/team/README.md +10 -0
  20. package/init/xinyun-ai-init/templates/team/assignments.json +6 -1
  21. package/init/xinyun-ai-init/version.json +2 -2
  22. package/package.json +1 -1
  23. package/scripts/verify-init-package.js +172 -23
  24. package/scripts/verify-rules-package.js +62 -8
  25. package/test-scenarios/README.md +8 -4
  26. package/test-scenarios/review-template.md +11 -3
  27. package/test-scenarios/scenarios.md +76 -4
  28. package/test-scenarios/v1.7.3-scenarios.md +79 -0
@@ -103,18 +103,18 @@ function verifyPackageFiles() {
103
103
  );
104
104
 
105
105
  addCheck(
106
- "package.json 版本为 1.7.2",
107
- packageJson.version === "1.7.2",
106
+ "package.json 版本为 1.7.3",
107
+ packageJson.version === "1.7.3",
108
108
  `当前版本为 ${packageJson.version}`
109
109
  );
110
110
  addCheck(
111
- "version.json 版本为 1.7.2",
112
- versionJson.version === "1.7.2",
111
+ "version.json 版本为 1.7.3",
112
+ versionJson.version === "1.7.3",
113
113
  `当前版本为 ${versionJson.version}`
114
114
  );
115
115
  addCheck(
116
- "manifest.template.json 版本为 1.7.2",
117
- manifestTemplate.xinyunAiVersion === "1.7.2",
116
+ "manifest.template.json 版本为 1.7.3",
117
+ manifestTemplate.xinyunAiVersion === "1.7.3",
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-87",
473
- "88",
472
+ "1-96",
473
+ "97",
474
474
  "## 40. v1.6-A",
475
475
  "## 53. v1.6 tarball",
476
476
  "## 55. verify:rules",
@@ -479,15 +479,18 @@ function verifyTestScenarios() {
479
479
  "## 69. verify:rules JSON schema",
480
480
  "## 71. v1.7.1 主任务命名",
481
481
  "## 87. v1.7.1 普通咨询和版本回归",
482
- "## 88. Skill",
482
+ "## 89. v1.7.3 Codex 真实角色会话创建",
483
+ "## 96. v1.7.3 普通咨询边界",
484
+ "## 97. Skill",
483
485
  ]);
484
486
 
485
487
  requireIncludes("test-scenarios/README.md", [
486
- "pm_zhousl-xinyun-ai-init-1.7.2.tgz",
487
- "1-87",
488
- "88",
488
+ "pm_zhousl-xinyun-ai-init-1.7.3.tgz",
489
+ "1-96",
490
+ "97",
489
491
  "npm run verify:rules",
490
492
  "v1.7.2-scenarios.md",
493
+ "v1.7.3-scenarios.md",
491
494
  ]);
492
495
 
493
496
  requireIncludes("test-scenarios/v1.7.1-scenarios.md", [
@@ -507,6 +510,17 @@ function verifyTestScenarios() {
507
510
  "幂等补建",
508
511
  "补建失败和索引恢复",
509
512
  ]);
513
+
514
+ requireIncludes("test-scenarios/v1.7.3-scenarios.md", [
515
+ "真实角色子会话创建",
516
+ "provider=codex",
517
+ "sessionStatus=onboarding",
518
+ "taskId + roleId + provider + targetVersion",
519
+ "local-degraded-no-fake-session-id",
520
+ "created-but-writeback-failed",
521
+ "单角色失败不影响其他角色",
522
+ "普通咨询边界",
523
+ ]);
510
524
  }
511
525
  function verifyFrameworkRules() {
512
526
  const required = [
@@ -751,7 +765,7 @@ function verifyV16Contracts() {
751
765
  ]);
752
766
 
753
767
  requireIncludes("init/xinyun-ai-init/README.md", [
754
- "当前规则版本:`1.7.2`",
768
+ "当前规则版本:`1.7.3`",
755
769
  "v1.6 初始化任务、幂等恢复与结果记录",
756
770
  "xinyun-ai/tasks/.idempotency/",
757
771
  "xinyun-ai/init-result.json",
@@ -951,7 +965,7 @@ function verifyV16Contracts() {
951
965
  }
952
966
 
953
967
  addCheck("init-result mode 为 initialization", initResult.mode === "initialization");
954
- addCheck("init-result targetVersion=1.7.2", initResult.targetVersion === "1.7.2");
968
+ addCheck("init-result targetVersion=1.7.3", initResult.targetVersion === "1.7.3");
955
969
  addCheck("init-result businessCodeChanged 初始为 unknown", initResult.businessCodeChanged && initResult.businessCodeChanged.value === "unknown");
956
970
  addCheck("task-lock scope=xinyun-ai-control", taskLock.scope === "xinyun-ai-control");
957
971
  addCheck("task-lock audit 包含 released", Array.isArray(taskLock.audit) && taskLock.audit.some((item) => item.action === "released"));
@@ -1057,7 +1071,7 @@ function verifyV17Contracts() {
1057
1071
  addCheck("html migration pilot requires separate confirmation", htmlMigration.pilotPlan && htmlMigration.pilotPlan.requiresSeparateConfirmation === true);
1058
1072
 
1059
1073
  requireIncludes("init/xinyun-ai-init/README.md", [
1060
- "当前规则版本:`1.7.2`",
1074
+ "当前规则版本:`1.7.3`",
1061
1075
  "v1.7 规则包一致性检查与 verify:rules",
1062
1076
  "frameworkStatus=confirmed/inferred/not-found/unknown/detected-unsupported",
1063
1077
  "v1.7 深化预算:5 层目录、80 个关键文件、100 条证据",
@@ -1076,17 +1090,17 @@ function verifyV17Contracts() {
1076
1090
  ]);
1077
1091
 
1078
1092
  requireIncludes("test-scenarios/scenarios.md", [
1079
- "当前必测场景为 1-87",
1080
- "当前观察场景为 88",
1093
+ "当前必测场景为 1-96",
1094
+ "当前观察场景为 97",
1081
1095
  "## 55. verify:rules 正常通过",
1082
1096
  "## 69. verify:rules JSON schema 和重复执行",
1083
- "## 88. Skill 触发测试",
1097
+ "## 97. Skill 触发测试",
1084
1098
  ]);
1085
1099
 
1086
1100
  requireIncludes("test-scenarios/README.md", [
1087
- "pm_zhousl-xinyun-ai-init-1.7.2.tgz",
1088
- "当前必测场景为 `scenarios.md` 的 1-87",
1089
- "当前观察场景为 `scenarios.md` 的 88",
1101
+ "pm_zhousl-xinyun-ai-init-1.7.3.tgz",
1102
+ "当前必测场景为 `scenarios.md` 的 1-96",
1103
+ "当前观察场景为 `scenarios.md` 的 97",
1090
1104
  "npm run verify:rules",
1091
1105
  ]);
1092
1106
  }
@@ -1152,7 +1166,7 @@ function verifyV171Contracts() {
1152
1166
  addCheck("init-result taskTree role count", initResult.taskTree && initResult.taskTree.roleTaskCount === 5, "init-result taskTree.roleTaskCount 应为 5");
1153
1167
 
1154
1168
  requireIncludes("init/xinyun-ai-init/README.md", [
1155
- "当前规则版本:`1.7.2`",
1169
+ "当前规则版本:`1.7.3`",
1156
1170
  "项目初始化:<项目显示名>",
1157
1171
  "xinyun-ai/tasks/task-index.json",
1158
1172
  "xinyun-ai/tasks/.archive-transactions/<archiveTransactionId>.json",
@@ -1303,7 +1317,7 @@ function verifyV172Contracts() {
1303
1317
  addCheck(`role-execution template field ${field}`, roleExecution.includes(`- ${field}:`), `role-execution 模板缺少 ${field}`);
1304
1318
  }
1305
1319
  requireIncludes("init/xinyun-ai-init/README.md", [
1306
- "当前规则版本:`1.7.2`",
1320
+ "当前规则版本:`1.7.3`",
1307
1321
  "xinyun-ai/tasks/role-execution/<roleTaskId>.md",
1308
1322
  "activeTaskIds",
1309
1323
  "executableTaskIds",
@@ -1324,6 +1338,140 @@ function verifyV172Contracts() {
1324
1338
  requireIncludes("init/xinyun-ai-init/rules/session-workbench.md", ["v1.7.2 角色执行任务补充字段", "roleExecutionResult"]);
1325
1339
  }
1326
1340
 
1341
+ function verifyV173Contracts() {
1342
+ const manifestTemplate = JSON.parse(readText("init/xinyun-ai-init/templates/manifest.template.json"));
1343
+ const projectIndexTemplate = JSON.parse(readText("init/xinyun-ai-init/templates/project-index.template.json"));
1344
+ const taskIndex = JSON.parse(readText("init/xinyun-ai-init/templates/task-index.template.json"));
1345
+ const initResult = JSON.parse(readText("init/xinyun-ai-init/templates/init-result.template.json"));
1346
+ const assignments = JSON.parse(readText("init/xinyun-ai-init/templates/team/assignments.json"));
1347
+ const bindingTemplate = JSON.parse(readText("init/xinyun-ai-init/templates/role-session-binding.template.json"));
1348
+ const roleExecution = readText("init/xinyun-ai-init/templates/role-execution.template.md");
1349
+ const statusEnum = ["pending", "creating", "created", "onboarding", "ready", "blocked", "failed", "closed"];
1350
+
1351
+ requireFile("init/xinyun-ai-init/templates/role-session-binding.template.json");
1352
+ requireFile("test-scenarios/v1.7.3-scenarios.md");
1353
+
1354
+ addCheck(
1355
+ "manifest v1.7.3 codexRoleSessionOrchestration",
1356
+ manifestTemplate.capabilities && manifestTemplate.capabilities.codexRoleSessionOrchestration === true,
1357
+ "manifest 缺少 codexRoleSessionOrchestration 能力"
1358
+ );
1359
+ addCheck(
1360
+ "manifest roleSessions provider codex",
1361
+ manifestTemplate.roleSessions && manifestTemplate.roleSessions.provider === "codex",
1362
+ "manifest roleSessions.provider 必须为 codex"
1363
+ );
1364
+ addCheck(
1365
+ "manifest roleSessions targetVersion=1.7.3",
1366
+ manifestTemplate.roleSessions && manifestTemplate.roleSessions.targetVersion === "1.7.3",
1367
+ "manifest roleSessions.targetVersion 必须为 1.7.3"
1368
+ );
1369
+ addCheck(
1370
+ "manifest roleSessions bindings path",
1371
+ manifestTemplate.roleSessions && manifestTemplate.roleSessions.bindings === "xinyun-ai/sessions/role-session-bindings.json",
1372
+ "manifest roleSessions.bindings 不一致"
1373
+ );
1374
+ addCheck(
1375
+ "manifest roleSessions directory",
1376
+ manifestTemplate.roleSessions && manifestTemplate.roleSessions.directory === "xinyun-ai/sessions/roles/",
1377
+ "manifest roleSessions.directory 不一致"
1378
+ );
1379
+ addCheck(
1380
+ "manifest roleSessions bindingTemplate",
1381
+ manifestTemplate.roleSessions && manifestTemplate.roleSessions.bindingTemplate === "xinyun-ai-init/templates/role-session-binding.template.json",
1382
+ "manifest roleSessions.bindingTemplate 不一致"
1383
+ );
1384
+ addCheck(
1385
+ "manifest roleSessions requiredRoleCount=5",
1386
+ manifestTemplate.roleSessions && manifestTemplate.roleSessions.requiredRoleCount === 5,
1387
+ "manifest roleSessions.requiredRoleCount 必须为 5"
1388
+ );
1389
+ addCheck(
1390
+ "manifest roleSessions status enum",
1391
+ manifestTemplate.roleSessions && JSON.stringify(manifestTemplate.roleSessions.statusEnum) === JSON.stringify(statusEnum),
1392
+ "manifest roleSessions.statusEnum 不完整"
1393
+ );
1394
+ addCheck(
1395
+ "manifest roleSessions idempotency fields",
1396
+ manifestTemplate.roleSessions && manifestTemplate.roleSessions.idempotency && JSON.stringify(manifestTemplate.roleSessions.idempotency.keyFields) === JSON.stringify(["taskId", "roleId", "provider", "targetVersion"]),
1397
+ "manifest roleSessions.idempotency.keyFields 不一致"
1398
+ );
1399
+ addCheck(
1400
+ "manifest roleSessions host unsupported policy",
1401
+ manifestTemplate.roleSessions && manifestTemplate.roleSessions.hostUnsupportedPolicy === "local-degraded-no-fake-session-id",
1402
+ "manifest roleSessions.hostUnsupportedPolicy 不一致"
1403
+ );
1404
+
1405
+ addCheck(
1406
+ "project-index roleSessions path",
1407
+ projectIndexTemplate.roleSessions && projectIndexTemplate.roleSessions.bindings === "xinyun-ai/sessions/role-session-bindings.json",
1408
+ "project-index roleSessions.bindings 不一致"
1409
+ );
1410
+ addCheck(
1411
+ "project-index roleSessions status enum",
1412
+ projectIndexTemplate.roleSessions && JSON.stringify(projectIndexTemplate.roleSessions.statusEnum) === JSON.stringify(statusEnum),
1413
+ "project-index roleSessions.statusEnum 不完整"
1414
+ );
1415
+ addCheck("project-index roleSessions records array", projectIndexTemplate.roleSessions && Array.isArray(projectIndexTemplate.roleSessions.records), "project-index roleSessions.records 必须是数组");
1416
+
1417
+ addCheck("task-index roleSessionBindingIds array", Array.isArray(taskIndex.roleSessionBindingIds), "task-index roleSessionBindingIds 必须是数组");
1418
+ addCheck("task-index roleSessionBindings array", Array.isArray(taskIndex.roleSessionBindings), "task-index roleSessionBindings 必须是数组");
1419
+ addCheck(
1420
+ "task-index roleSession status enum",
1421
+ JSON.stringify(taskIndex.roleSessionStatusEnum) === JSON.stringify(statusEnum),
1422
+ "task-index roleSessionStatusEnum 不完整"
1423
+ );
1424
+ addCheck(
1425
+ "task-index roleSession idempotency fields",
1426
+ taskIndex.roleSessionIdempotency && JSON.stringify(taskIndex.roleSessionIdempotency.keyFields) === JSON.stringify(["taskId", "roleId", "provider", "targetVersion"]),
1427
+ "task-index roleSessionIdempotency.keyFields 不一致"
1428
+ );
1429
+
1430
+ addCheck("init-result roleSessions provider codex", initResult.roleSessions && initResult.roleSessions.provider === "codex", "init-result roleSessions.provider 必须为 codex");
1431
+ addCheck("init-result roleSessions requiredRoleCount=5", initResult.roleSessions && initResult.roleSessions.requiredRoleCount === 5, "init-result roleSessions.requiredRoleCount 必须为 5");
1432
+ for (const field of ["createdCount", "reusedCount", "failedCount", "blockedCount", "localDegradedCount"]) {
1433
+ addCheck(`init-result roleSessions ${field}`, initResult.roleSessions && typeof initResult.roleSessions[field] === "number", `init-result roleSessions.${field} 必须是数字`);
1434
+ }
1435
+
1436
+ for (const field of ["sessionId", "parentSessionId", "provider", "sessionStatus"]) {
1437
+ addCheck(`assignments required field ${field}`, assignments.recordContract && assignments.recordContract.requiredFields.includes(field), `assignments recordContract 缺少 ${field}`);
1438
+ }
1439
+ addCheck("assignments session binding rule mentions real host value", assignments.recordContract && assignments.recordContract.sessionBindingRule.includes("real host-returned value"), "assignments sessionBindingRule 必须说明真实宿主返回值");
1440
+
1441
+ addCheck("binding template provider codex", bindingTemplate.provider === "codex", "binding template provider 必须为 codex");
1442
+ addCheck("binding template targetVersion=1.7.3", bindingTemplate.targetVersion === "1.7.3", "binding template targetVersion 必须为 1.7.3");
1443
+ addCheck("binding template fakeSessionId prohibited", bindingTemplate.degradation && bindingTemplate.degradation.fakeSessionIdProhibited === true, "binding template 必须禁止伪造 sessionId");
1444
+ addCheck("binding template onboarding readOnly", bindingTemplate.onboarding && bindingTemplate.onboarding.readOnly === true, "binding template onboarding.readOnly 必须为 true");
1445
+
1446
+ for (const field of ["parentSessionId", "provider", "sessionStatus", "sessionBindingId", "sessionBindingPath", "sessionIdempotencyKey"]) {
1447
+ addCheck(`role-execution v1.7.3 field ${field}`, roleExecution.includes(`- ${field}:`), `role-execution 模板缺少 ${field}`);
1448
+ }
1449
+
1450
+ const snippets = [
1451
+ "v1.7.3 Codex 角色会话自动创建与绑定",
1452
+ "provider=codex",
1453
+ "sessionStatus=pending/creating/created/onboarding/ready/blocked/failed/closed",
1454
+ "taskId + roleId + provider + targetVersion",
1455
+ "真实 `sessionId`",
1456
+ "不得伪造 sessionId",
1457
+ "local-degraded-no-fake-session-id",
1458
+ "onboarding",
1459
+ "created-but-writeback-failed",
1460
+ "创建成功不等于业务代码修改授权",
1461
+ ];
1462
+ requireIncludes("init/xinyun-ai-init/README.md", snippets);
1463
+ requireIncludes("init/xinyun-ai-init/templates/core-rules.template.md", snippets);
1464
+ requireIncludes("init/xinyun-ai-init/templates/AGENTS.template.md", ["v1.7.3 Codex 角色会话自动创建与绑定", "provider=codex", "local-degraded-no-fake-session-id"]);
1465
+ requireIncludes("init/xinyun-ai-init/rules/init-rules.md", ["v1.7.3 Codex 角色会话初始化", "provider=codex", "local-degraded-no-fake-session-id"]);
1466
+ requireIncludes("init/xinyun-ai-init/rules/upgrade-rules.md", ["v1.7.3 升级创建和绑定真实角色会话", "created-but-writeback-failed", "不得伪造 sessionId"]);
1467
+ requireIncludes("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"]);
1468
+ requireIncludes("init/xinyun-ai-init/rules/session-workbench.md", ["v1.7.3 角色会话交接字段", "roleSessionIdempotency", "不得伪造 sessionId"]);
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
+ requireIncludes("init/xinyun-ai-init/templates/project-check.template.md", ["v1.7.3 checks", "provider=codex", "不存在伪造 sessionId"]);
1471
+ requireIncludes("test-scenarios/scenarios.md", ["当前必测场景为 1-96", "当前观察场景为 97", "## 89. v1.7.3 Codex 真实角色会话创建", "## 96. v1.7.3 普通咨询边界", "## 97. Skill"]);
1472
+ requireIncludes("test-scenarios/review-template.md", ["1-96 必测", "89. v1.7.3 Codex 真实角色会话创建", "96. v1.7.3 普通咨询边界", "97. Skill"]);
1473
+ }
1474
+
1327
1475
  function main() {
1328
1476
  requireFile("bin/xinyun-ai-init.js");
1329
1477
  requireFile("init/xinyun-ai-init/README.md");
@@ -1338,6 +1486,7 @@ function main() {
1338
1486
  verifyV17Contracts();
1339
1487
  verifyV171Contracts();
1340
1488
  verifyV172Contracts();
1489
+ verifyV173Contracts();
1341
1490
  verifyTestScenarios();
1342
1491
  verifyJsonAndMarkdown();
1343
1492
 
@@ -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.7.2";
8
+ const VERSION = "1.7.3";
9
9
  const checks = [];
10
10
 
11
11
  function parseArgs(argv) {
@@ -150,6 +150,7 @@ function validatePackageFiles(root, target, isTarball) {
150
150
  "test-scenarios/scenarios.md",
151
151
  "test-scenarios/v1.7.1-scenarios.md",
152
152
  "test-scenarios/v1.7.2-scenarios.md",
153
+ "test-scenarios/v1.7.3-scenarios.md",
153
154
  "init/xinyun-ai-init/README.md",
154
155
  "init/xinyun-ai-init/rules/frameworks/README.md",
155
156
  "init/xinyun-ai-init/rules/frameworks/backend/php/thinkphp.md",
@@ -174,12 +175,13 @@ function validatePackageFiles(root, target, isTarball) {
174
175
  "init/xinyun-ai-init/templates/role-subtask.template.md",
175
176
  "init/xinyun-ai-init/templates/archive-transaction.template.json",
176
177
  "init/xinyun-ai-init/templates/role-execution.template.md",
178
+ "init/xinyun-ai-init/templates/role-session-binding.template.json",
177
179
  ];
178
180
 
179
181
  for (const file of requiredFiles) requireFile(root, target, file);
180
182
 
181
183
  if (isTarball) {
182
- const sourceOnly = "version-plans/releases/v1.7.2.md";
184
+ const sourceOnly = "version-plans/releases/v1.7.3.md";
183
185
  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");
184
186
  }
185
187
  }
@@ -216,6 +218,7 @@ function validateRegistries(root, target) {
216
218
  "taskArchiveTransactions",
217
219
  "codeGraphRequiredInitialization",
218
220
  "roleExecutionVisibility",
221
+ "codexRoleSessionOrchestration",
219
222
  ]) {
220
223
  addCheck(target, "registry.manifest", "manifest", capabilities[flag] === true ? "pass" : "fail", "init/xinyun-ai-init/templates/manifest.template.json", `capabilities.${flag}`, true, capabilities[flag], "Manifest capability registered.", "Register the missing capability.");
221
224
  }
@@ -277,6 +280,9 @@ function validateRegistries(root, target) {
277
280
  }
278
281
  addCheck(target, "registry.manifest", "manifest", manifest.taskTree && manifest.taskTree.roleExecutionPathPattern === "xinyun-ai/tasks/role-execution/<roleTaskId>.md" ? "pass" : "fail", "init/xinyun-ai-init/templates/manifest.template.json", "taskTree.roleExecutionPathPattern", "xinyun-ai/tasks/role-execution/<roleTaskId>.md", manifest.taskTree && manifest.taskTree.roleExecutionPathPattern, "Manifest role execution path checked.", "Register the role execution path.");
279
282
  addCheck(target, "registry.project-index", "project-index", projectIndex.taskTree && projectIndex.taskTree.roleExecutionPathPattern === "xinyun-ai/tasks/role-execution/<roleTaskId>.md" ? "pass" : "fail", "init/xinyun-ai-init/templates/project-index.template.json", "taskTree.roleExecutionPathPattern", "xinyun-ai/tasks/role-execution/<roleTaskId>.md", projectIndex.taskTree && projectIndex.taskTree.roleExecutionPathPattern, "Project-index role execution path checked.", "Register the role execution path.");
283
+ addCheck(target, "registry.manifest", "manifest", manifest.roleSessions && manifest.roleSessions.bindings === "xinyun-ai/sessions/role-session-bindings.json" ? "pass" : "fail", "init/xinyun-ai-init/templates/manifest.template.json", "roleSessions.bindings", "xinyun-ai/sessions/role-session-bindings.json", manifest.roleSessions && manifest.roleSessions.bindings, "Manifest role session bindings checked.", "Register roleSessions.bindings.");
284
+ addCheck(target, "registry.project-index", "project-index", projectIndex.roleSessions && projectIndex.roleSessions.bindings === "xinyun-ai/sessions/role-session-bindings.json" ? "pass" : "fail", "init/xinyun-ai-init/templates/project-index.template.json", "roleSessions.bindings", "xinyun-ai/sessions/role-session-bindings.json", projectIndex.roleSessions && projectIndex.roleSessions.bindings, "Project-index role session bindings checked.", "Register roleSessions.bindings.");
285
+ addCheck(target, "registry.manifest", "manifest", manifest.roleSessions && manifest.roleSessions.provider === "codex" ? "pass" : "fail", "init/xinyun-ai-init/templates/manifest.template.json", "roleSessions.provider", "codex", manifest.roleSessions && manifest.roleSessions.provider, "Manifest role session provider checked.", "Register roleSessions.provider.");
280
286
  }
281
287
 
282
288
  function validateV17Content(root, target) {
@@ -298,7 +304,7 @@ function validateV17Content(root, target) {
298
304
  "scope/unverifiedScope",
299
305
  "pauseReason=out-of-scope",
300
306
  ];
301
- requireIncludes(root, target, "init/xinyun-ai-init/README.md", ["当前规则版本:`1.7.2`", ...common]);
307
+ requireIncludes(root, target, "init/xinyun-ai-init/README.md", ["当前规则版本:`1.7.3`", ...common]);
302
308
  requireIncludes(root, target, "init/xinyun-ai-init/templates/core-rules.template.md", common);
303
309
  requireIncludes(root, target, "init/xinyun-ai-init/templates/AGENTS.template.md", ["v1.7 规则包一致性、技术栈 profile 与 HTML 迁移准备", "`verify:rules` 只读", "ThinkPHP 不得误套其他项目", ...common.slice(5)]);
304
310
  requireIncludes(root, target, "init/xinyun-ai-init/templates/current-task.template.md", ["verify:rules.status", "language", "runtime", "platform", "framework", ...common.slice(5)]);
@@ -310,9 +316,9 @@ function validateV17Content(root, target) {
310
316
  requireIncludes(root, target, "init/xinyun-ai-init/rules/session-workbench.md", ["v1.7 任务单补充字段", "verifyRulesStatus", "migrationStatus", "HTML 迁移只允许评估和单页面 / 区块试点计划"]);
311
317
  requireIncludes(root, target, "init/xinyun-ai-init/rules/frameworks/README.md", ["v1.7 技术栈 profile", "coverage=partial", ...common.slice(5, 10)]);
312
318
  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", "队列"]);
313
- requireIncludes(root, target, "test-scenarios/scenarios.md", ["当前必测场景为 1-87", "当前观察场景为 88", "## 55. verify:rules 正常通过", "## 69. verify:rules JSON schema 和重复执行"]);
314
- requireIncludes(root, target, "test-scenarios/review-template.md", ["55. verify:rules 正常通过", "69. verify:rules JSON schema 和重复执行", "88. Skill 触发测试"]);
315
- requireIncludes(root, target, "test-scenarios/README.md", ["npm run verify:rules", "pm_zhousl-xinyun-ai-init-1.7.2.tgz", "v1.7.2-scenarios.md", "当前必测场景为 `scenarios.md` 的 1-87", "当前观察场景为 `scenarios.md` 的 88"]);
319
+ requireIncludes(root, target, "test-scenarios/scenarios.md", ["当前必测场景为 1-96", "当前观察场景为 97", "## 55. verify:rules 正常通过", "## 69. verify:rules JSON schema 和重复执行"]);
320
+ 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.7.3.tgz", "v1.7.2-scenarios.md", "v1.7.3-scenarios.md", "当前必测场景为 `scenarios.md` 的 1-96", "当前观察场景为 `scenarios.md` 的 97"]);
316
322
  }
317
323
 
318
324
  function validateV171Content(root, target) {
@@ -341,7 +347,7 @@ function validateV171Content(root, target) {
341
347
  requireIncludes(root, target, "init/xinyun-ai-init/rules/upgrade-rules.md", ["v1.7.1 升级补齐"]);
342
348
  requireIncludes(root, target, "init/xinyun-ai-init/rules/directory-self-completion.md", ["v1.7.1 任务树、归档与 CodeGraph 目录"]);
343
349
  requireIncludes(root, target, "init/xinyun-ai-init/rules/session-workbench.md", ["v1.7.1 任务单补充字段"]);
344
- requireIncludes(root, target, "test-scenarios/scenarios.md", ["当前必测场景为 1-87", "当前观察场景为 88", "## 71. v1.7.1 主任务命名", "## 87. v1.7.1 普通咨询和版本回归"]);
350
+ requireIncludes(root, target, "test-scenarios/scenarios.md", ["当前必测场景为 1-96", "当前观察场景为 97", "## 71. v1.7.1 主任务命名", "## 87. v1.7.1 普通咨询和版本回归"]);
345
351
  requireIncludes(root, target, "test-scenarios/v1.7.1-scenarios.md", ["主任务命名", "CodeGraph记录与失败矩阵", "普通咨询边界"]);
346
352
  }
347
353
 
@@ -358,7 +364,7 @@ function validateV172Content(root, target) {
358
364
  "JCS-SHA-256",
359
365
  "blockedReason=write-failed",
360
366
  ];
361
- requireIncludes(root, target, "init/xinyun-ai-init/README.md", ["当前规则版本:`1.7.2`", ...snippets]);
367
+ requireIncludes(root, target, "init/xinyun-ai-init/README.md", ["当前规则版本:`1.7.3`", ...snippets]);
362
368
  requireIncludes(root, target, "init/xinyun-ai-init/templates/core-rules.template.md", snippets);
363
369
  requireIncludes(root, target, "init/xinyun-ai-init/rules/init-rules.md", ["v1.7.2 角色后续任务可见性", "role-execution"]);
364
370
  requireIncludes(root, target, "init/xinyun-ai-init/rules/upgrade-rules.md", ["v1.7.2 升级补建角色后续任务", "write-failed"]);
@@ -367,6 +373,52 @@ function validateV172Content(root, target) {
367
373
  requireIncludes(root, target, "test-scenarios/v1.7.2-scenarios.md", ["固定优先级", "幂等补建", "补建失败和索引恢复"]);
368
374
  }
369
375
 
376
+ function validateV173Content(root, target) {
377
+ const manifest = readJson(root, "init/xinyun-ai-init/templates/manifest.template.json");
378
+ const projectIndex = readJson(root, "init/xinyun-ai-init/templates/project-index.template.json");
379
+ const taskIndex = readJson(root, "init/xinyun-ai-init/templates/task-index.template.json");
380
+ const initResult = readJson(root, "init/xinyun-ai-init/templates/init-result.template.json");
381
+ const assignments = readJson(root, "init/xinyun-ai-init/templates/team/assignments.json");
382
+ const binding = readJson(root, "init/xinyun-ai-init/templates/role-session-binding.template.json");
383
+ const statusEnum = ["pending", "creating", "created", "onboarding", "ready", "blocked", "failed", "closed"];
384
+
385
+ addCheck(target, "registry.manifest", "manifest", manifest.capabilities && manifest.capabilities.codexRoleSessionOrchestration === true ? "pass" : "fail", "init/xinyun-ai-init/templates/manifest.template.json", "capabilities.codexRoleSessionOrchestration", true, manifest.capabilities && manifest.capabilities.codexRoleSessionOrchestration, "Codex role session capability checked.", "Register codexRoleSessionOrchestration.");
386
+ addCheck(target, "registry.manifest", "manifest", manifest.roleSessions && manifest.roleSessions.provider === "codex" ? "pass" : "fail", "init/xinyun-ai-init/templates/manifest.template.json", "roleSessions.provider", "codex", manifest.roleSessions && manifest.roleSessions.provider, "Role session provider checked.", "Set provider=codex.");
387
+ addCheck(target, "registry.manifest", "manifest", manifest.roleSessions && manifest.roleSessions.targetVersion === VERSION ? "pass" : "fail", "init/xinyun-ai-init/templates/manifest.template.json", "roleSessions.targetVersion", VERSION, manifest.roleSessions && manifest.roleSessions.targetVersion, "Role session target version checked.", "Set targetVersion.");
388
+ addCheck(target, "registry.manifest", "manifest", manifest.roleSessions && manifest.roleSessions.bindings === "xinyun-ai/sessions/role-session-bindings.json" ? "pass" : "fail", "init/xinyun-ai-init/templates/manifest.template.json", "roleSessions.bindings", "xinyun-ai/sessions/role-session-bindings.json", manifest.roleSessions && manifest.roleSessions.bindings, "Role session binding path checked.", "Register binding path.");
389
+ addCheck(target, "registry.manifest", "manifest", manifest.roleSessions && manifest.roleSessions.directory === "xinyun-ai/sessions/roles/" ? "pass" : "fail", "init/xinyun-ai-init/templates/manifest.template.json", "roleSessions.directory", "xinyun-ai/sessions/roles/", manifest.roleSessions && manifest.roleSessions.directory, "Role session directory checked.", "Register role session directory.");
390
+ addCheck(target, "registry.manifest", "manifest", manifest.roleSessions && JSON.stringify(manifest.roleSessions.statusEnum) === JSON.stringify(statusEnum) ? "pass" : "fail", "init/xinyun-ai-init/templates/manifest.template.json", "roleSessions.statusEnum", statusEnum, manifest.roleSessions && manifest.roleSessions.statusEnum, "Role session status enum checked.", "Use the fixed v1.7.3 enum.");
391
+ addCheck(target, "registry.manifest", "manifest", manifest.roleSessions && manifest.roleSessions.idempotency && JSON.stringify(manifest.roleSessions.idempotency.keyFields) === JSON.stringify(["taskId", "roleId", "provider", "targetVersion"]) ? "pass" : "fail", "init/xinyun-ai-init/templates/manifest.template.json", "roleSessions.idempotency.keyFields", ["taskId", "roleId", "provider", "targetVersion"], manifest.roleSessions && manifest.roleSessions.idempotency && manifest.roleSessions.idempotency.keyFields, "Role session idempotency fields checked.", "Use taskId + roleId + provider + targetVersion.");
392
+ addCheck(target, "registry.project-index", "project-index", projectIndex.roleSessions && projectIndex.roleSessions.provider === "codex" ? "pass" : "fail", "init/xinyun-ai-init/templates/project-index.template.json", "roleSessions.provider", "codex", projectIndex.roleSessions && projectIndex.roleSessions.provider, "Project-index role session provider checked.", "Set provider=codex.");
393
+ addCheck(target, "registry.project-index", "project-index", projectIndex.roleSessions && Array.isArray(projectIndex.roleSessions.records) ? "pass" : "fail", "init/xinyun-ai-init/templates/project-index.template.json", "roleSessions.records", "array", projectIndex.roleSessions && projectIndex.roleSessions.records, "Project-index role session records checked.", "Add records array.");
394
+ addCheck(target, "registry.task-index", "task-index", Array.isArray(taskIndex.roleSessionBindingIds) ? "pass" : "fail", "init/xinyun-ai-init/templates/task-index.template.json", "roleSessionBindingIds", "array", taskIndex.roleSessionBindingIds, "Task-index binding IDs checked.", "Add roleSessionBindingIds.");
395
+ addCheck(target, "registry.task-index", "task-index", Array.isArray(taskIndex.roleSessionBindings) ? "pass" : "fail", "init/xinyun-ai-init/templates/task-index.template.json", "roleSessionBindings", "array", taskIndex.roleSessionBindings, "Task-index bindings checked.", "Add roleSessionBindings.");
396
+ addCheck(target, "registry.task-index", "task-index", taskIndex.roleSessionIdempotency && JSON.stringify(taskIndex.roleSessionIdempotency.keyFields) === JSON.stringify(["taskId", "roleId", "provider", "targetVersion"]) ? "pass" : "fail", "init/xinyun-ai-init/templates/task-index.template.json", "roleSessionIdempotency.keyFields", ["taskId", "roleId", "provider", "targetVersion"], taskIndex.roleSessionIdempotency && taskIndex.roleSessionIdempotency.keyFields, "Task-index role session idempotency checked.", "Use fixed key fields.");
397
+ addCheck(target, "registry.init-result", "init-result", initResult.roleSessions && initResult.roleSessions.provider === "codex" ? "pass" : "fail", "init/xinyun-ai-init/templates/init-result.template.json", "roleSessions.provider", "codex", initResult.roleSessions && initResult.roleSessions.provider, "Init-result role session provider checked.", "Set provider=codex.");
398
+ addCheck(target, "registry.assignments", "assignments", assignments.recordContract && assignments.recordContract.requiredFields.includes("sessionStatus") ? "pass" : "fail", "init/xinyun-ai-init/templates/team/assignments.json", "recordContract.requiredFields", "sessionStatus", assignments.recordContract && assignments.recordContract.requiredFields, "Assignments sessionStatus checked.", "Add sessionStatus to assignments contract.");
399
+ addCheck(target, "registry.binding-template", "template", binding.provider === "codex" && binding.targetVersion === VERSION && binding.degradation && binding.degradation.fakeSessionIdProhibited === true ? "pass" : "fail", "init/xinyun-ai-init/templates/role-session-binding.template.json", "provider/targetVersion/degradation", "codex / version / fakeSessionIdProhibited", binding, "Role session binding template checked.", "Fix binding template.");
400
+
401
+ const snippets = [
402
+ "v1.7.3 Codex 角色会话自动创建与绑定",
403
+ "provider=codex",
404
+ "sessionStatus=pending/creating/created/onboarding/ready/blocked/failed/closed",
405
+ "taskId + roleId + provider + targetVersion",
406
+ "不得伪造 sessionId",
407
+ "local-degraded-no-fake-session-id",
408
+ "created-but-writeback-failed",
409
+ "创建成功不等于业务代码修改授权",
410
+ ];
411
+ requireIncludes(root, target, "init/xinyun-ai-init/README.md", ["当前规则版本:`1.7.3`", ...snippets]);
412
+ requireIncludes(root, target, "init/xinyun-ai-init/templates/core-rules.template.md", snippets);
413
+ requireIncludes(root, target, "init/xinyun-ai-init/templates/AGENTS.template.md", ["v1.7.3 Codex 角色会话自动创建与绑定", "provider=codex", "local-degraded-no-fake-session-id"]);
414
+ requireIncludes(root, target, "init/xinyun-ai-init/rules/init-rules.md", ["v1.7.3 Codex 角色会话初始化", "provider=codex", "local-degraded-no-fake-session-id"]);
415
+ requireIncludes(root, target, "init/xinyun-ai-init/rules/upgrade-rules.md", ["v1.7.3 升级创建和绑定真实角色会话", "created-but-writeback-failed", "不得伪造 sessionId"]);
416
+ requireIncludes(root, target, "init/xinyun-ai-init/rules/session-workbench.md", ["v1.7.3 角色会话交接字段", "roleSessionIdempotency", "不得伪造 sessionId"]);
417
+ 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
+ requireIncludes(root, target, "test-scenarios/v1.7.3-scenarios.md", ["五个真实角色子会话创建", "会话绑定回写一致性", "onboarding 只读边界", "宿主不支持时本地降级"]);
419
+ requireIncludes(root, target, "test-scenarios/scenarios.md", ["当前必测场景为 1-96", "当前观察场景为 97", "## 89. v1.7.3 Codex 真实角色会话创建", "## 96. v1.7.3 普通咨询边界"]);
420
+ }
421
+
370
422
  function validateJsonFiles(root, target) {
371
423
  const jsonFiles = [
372
424
  "package.json",
@@ -377,6 +429,7 @@ function validateJsonFiles(root, target) {
377
429
  "init/xinyun-ai-init/templates/html-migration-record.template.json",
378
430
  "init/xinyun-ai-init/templates/task-index.template.json",
379
431
  "init/xinyun-ai-init/templates/archive-transaction.template.json",
432
+ "init/xinyun-ai-init/templates/role-session-binding.template.json",
380
433
  ];
381
434
 
382
435
  for (const file of jsonFiles) {
@@ -404,6 +457,7 @@ function validateRoot(root, target, isTarball = false) {
404
457
  validateV17Content(root, target);
405
458
  validateV171Content(root, target);
406
459
  validateV172Content(root, target);
460
+ validateV173Content(root, target);
407
461
  validateJsonFiles(root, target);
408
462
  }
409
463
 
@@ -37,7 +37,7 @@ npm pack
37
37
  随后在临时项目中使用 tarball 测试。注意不要直接执行 `npx <tarball> --force`,该形式可能不会正确调用 bin。推荐:
38
38
 
39
39
  ```powershell
40
- npx --yes --package E:\ai-fabu-xiangmu\AI开发初始化脚本\xinyun-ai-init-npm\pm_zhousl-xinyun-ai-init-1.7.2.tgz xinyun-ai-init --force --no-version-check
40
+ npx --yes --package E:\ai-fabu-xiangmu\AI开发初始化脚本\xinyun-ai-init-npm\pm_zhousl-xinyun-ai-init-1.7.3.tgz xinyun-ai-init --force --no-version-check
41
41
  ```
42
42
 
43
43
  ### 3. 线上回归测试
@@ -59,9 +59,9 @@ npx --yes @pm_zhousl/xinyun-ai-init@latest --force
59
59
  - 必测场景:用于判断当前版本是否可以发布。
60
60
  - 观察场景:用于收集后续优化建议,不作为当前版本发布阻断项。
61
61
 
62
- 当前必测场景为 `scenarios.md` 的 1-87。
62
+ 当前必测场景为 `scenarios.md` 的 1-96。
63
63
 
64
- 当前观察场景为 `scenarios.md` 的 88。Skill 触发机制仍在后续候选池中,不进入当前可发布范围。
64
+ 当前观察场景为 `scenarios.md` 的 97。Skill 触发机制仍在后续候选池中,不进入当前可发布范围。
65
65
 
66
66
  ## v1.7 规则包一致性校验
67
67
 
@@ -70,7 +70,7 @@ npx --yes @pm_zhousl/xinyun-ai-init@latest --force
70
70
  ```powershell
71
71
  npm run verify:rules
72
72
  npm run verify:rules -- --json
73
- npm run verify:rules -- --tarball .\pm_zhousl-xinyun-ai-init-1.7.2.tgz
73
+ npm run verify:rules -- --tarball .\pm_zhousl-xinyun-ai-init-1.7.3.tgz
74
74
  npm run verify:rules:security
75
75
  ```
76
76
 
@@ -89,6 +89,10 @@ npm run verify:init
89
89
 
90
90
  除 `scenarios.md` 外,发布前必须逐条执行 `v1.7.2-scenarios.md`。重点验证已归档的 v1.7.1 项目能补建 5 个 `role-execution` 任务,活动任务不被错误显示为 idle,重复升级按逐角色幂等键复用,索引中断后可恢复。
91
91
 
92
+ ## v1.7.3 Codex 角色会话回归
93
+
94
+ 除 `scenarios.md` 外,发布前必须逐条执行 `v1.7.3-scenarios.md`。重点验证 Codex 主会话在 5 个 `role-execution` 本地任务之后创建或明确降级 5 个真实角色子会话,真实 `sessionId` 回写一致,创建后先进入只读 onboarding,重复升级复用,宿主不支持时使用 `local-degraded-no-fake-session-id` 且不得伪造 sessionId。
95
+
92
96
  ## 审查原则
93
97
 
94
98
  - 重点看 AI 行为是否符合规则,不只看文件是否生成。
@@ -91,7 +91,7 @@
91
91
  - 可以后续优化:
92
92
  - 不建议纳入本版本:
93
93
 
94
- 说明:历史 Skill 触发测试是观察项。当前版本发布阻断以 1-87 必测场景为准。
94
+ 说明:历史 Skill 触发测试是观察项。当前版本发布阻断以 1-96 必测场景为准。
95
95
  ## v1.7 审查增量行
96
96
 
97
97
  | 场景 | 结果 | 证据 | 是否阻断 |
@@ -128,8 +128,16 @@
128
128
  | 85. v1.7.1 CodeGraph 失败矩阵 | 待填写 | 待填写 | 待填写 |
129
129
  | 86. v1.7.1 CodeGraph 状态登记与去重 | 待填写 | 待填写 | 待填写 |
130
130
  | 87. v1.7.1 普通咨询和版本回归 | 待填写 | 待填写 | 待填写 |
131
- | 88. Skill 触发测试(观察项,不阻断发布) | 待填写 | 待填写 | 待填写 |
131
+ | 89. v1.7.3 Codex 真实角色会话创建 | 待填写 | 待填写 | 待填写 |
132
+ | 90. v1.7.3 会话绑定回写一致性 | 待填写 | 待填写 | 待填写 |
133
+ | 91. v1.7.3 onboarding 只读边界 | 待填写 | 待填写 | 待填写 |
134
+ | 92. v1.7.3 会话幂等复用 | 待填写 | 待填写 | 待填写 |
135
+ | 93. v1.7.3 宿主不支持本地降级 | 待填写 | 待填写 | 待填写 |
136
+ | 94. v1.7.3 创建成功但回写失败恢复 | 待填写 | 待填写 | 待填写 |
137
+ | 95. v1.7.3 单角色失败隔离 | 待填写 | 待填写 | 待填写 |
138
+ | 96. v1.7.3 普通咨询边界 | 待填写 | 待填写 | 待填写 |
139
+ | 97. Skill 触发测试(观察项,不阻断发布) | 待填写 | 待填写 | 待填写 |
132
140
 
133
- 说明:Skill 触发测试是观察项。除非它影响 1-87 的必测场景,否则不作为当前版本不可发布的理由。
141
+ 说明:Skill 触发测试是观察项。除非它影响 1-96 的必测场景,否则不作为当前版本不可发布的理由。
134
142
 
135
143
 
@@ -2,10 +2,10 @@
2
2
 
3
3
  ## 测试分级说明
4
4
 
5
- - 必测场景:1-87,用于判断当前版本是否可以发布。
6
- - 观察场景:88,用于收集后续优化建议,不作为当前版本发布阻断项。
5
+ - 必测场景:1-96,用于判断当前版本是否可以发布。
6
+ - 观察场景:97,用于收集后续优化建议,不作为当前版本发布阻断项。
7
7
 
8
- 当前必测场景为 1-87;当前观察场景为 88。
8
+ 当前必测场景为 1-96;当前观察场景为 97。
9
9
 
10
10
  ## 1. 初始化可用性测试
11
11
 
@@ -1092,7 +1092,79 @@
1092
1092
 
1093
1093
  验收:不修改业务代码、数据库、API、配置、依赖或 Git。
1094
1094
 
1095
- ## 88. Skill 触发测试(观察项)
1095
+ ## 89. v1.7.3 Codex 真实角色会话创建
1096
+
1097
+ 目标:验证 5 个 `role-execution` 本地任务存在后,Codex 主会话能创建或明确降级 5 个真实角色子会话。
1098
+
1099
+ 验收:
1100
+ - 覆盖 `project-owner`、`project-product`、`chief-engineer`、`programmer`、`test-reviewer`。
1101
+ - 真实 `sessionId` 来自 Codex 宿主返回值。
1102
+ - CLI 仍只创建 `xinyun-ai-init/`。
1103
+
1104
+ ## 90. v1.7.3 会话绑定回写一致性
1105
+
1106
+ 目标:验证角色会话绑定同步到所有控制文件。
1107
+
1108
+ 验收:
1109
+ - `xinyun-ai/sessions/role-session-bindings.json` 可解析。
1110
+ - 角色任务、assignments、task-index、manifest、project-index、init-result 引用同一 binding/session 摘要。
1111
+ - 包含 `provider=codex`、`parentSessionId` 和 `sessionStatus`。
1112
+
1113
+ ## 91. v1.7.3 onboarding 只读边界
1114
+
1115
+ 目标:验证新建角色会话不会直接获得执行授权。
1116
+
1117
+ 验收:
1118
+ - 创建成功后先进入 `sessionStatus=onboarding`。
1119
+ - 未完成职责理解、职责确认、成员 / 会话绑定和确认门禁前不得 `ready`。
1120
+ - 不修改业务代码、数据库、API、配置、依赖或 Git。
1121
+
1122
+ ## 92. v1.7.3 会话幂等复用
1123
+
1124
+ 目标:验证重复升级不会重复创建角色会话。
1125
+
1126
+ 验收:
1127
+ - 幂等键为 `taskId + roleId + provider + targetVersion`。
1128
+ - 已有真实 sessionId 和 binding 被复用。
1129
+ - 不出现重复 roleId/taskId/provider/targetVersion 绑定。
1130
+
1131
+ ## 93. v1.7.3 宿主不支持本地降级
1132
+
1133
+ 目标:验证无法创建子会话时不得伪造 sessionId。
1134
+
1135
+ 验收:
1136
+ - `sessionId=null`。
1137
+ - 写入 `local-degraded-no-fake-session-id`。
1138
+ - `sessionStatus=blocked` 或 failed,并记录 reason/nextAction。
1139
+
1140
+ ## 94. v1.7.3 创建成功但回写失败恢复
1141
+
1142
+ 目标:验证 created-but-writeback-failed 可追溯和可恢复。
1143
+
1144
+ 验收:
1145
+ - 记录真实 sessionId 来源、失败文件和 audit。
1146
+ - 下次按幂等键查询并恢复绑定。
1147
+ - 不重复创建同一角色会话。
1148
+
1149
+ ## 95. v1.7.3 单角色失败隔离
1150
+
1151
+ 目标:验证单角色失败不影响其他角色。
1152
+
1153
+ 验收:
1154
+ - 失败角色单独 blocked 或 failed。
1155
+ - 其他角色继续 created/onboarding/ready 流程。
1156
+ - init-result 统计 createdCount/reusedCount/failedCount/blockedCount/localDegradedCount。
1157
+
1158
+ ## 96. v1.7.3 普通咨询边界
1159
+
1160
+ 目标:验证普通咨询不触发角色会话链。
1161
+
1162
+ 验收:
1163
+ - 不创建角色会话。
1164
+ - 不写 `xinyun-ai/sessions/role-session-bindings.json`。
1165
+ - 不创建外部账号、第三个会话或业务任务链。
1166
+
1167
+ ## 97. Skill 触发测试(观察项)
1096
1168
 
1097
1169
  目标:观察 AI 是否具备按任务触发 Skill 的倾向。
1098
1170