@pm_zhousl/xinyun-ai-init 2.0.0 → 3.0.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.
Files changed (199) hide show
  1. package/README.md +29 -39
  2. package/bin/xinyun-ai-init.js +121 -175
  3. package/init/xinyun-ai-init/README.md +26 -144
  4. package/init/xinyun-ai-init/rules/v3-skill-runtime.md +45 -0
  5. package/init/xinyun-ai-init/runtime/migrate-v3.js +115 -0
  6. package/init/xinyun-ai-init/runtime/route-skill.js +69 -0
  7. package/init/xinyun-ai-init/runtime-manifest.json +26 -0
  8. package/init/xinyun-ai-init/skills/registry.json +112 -0
  9. package/init/xinyun-ai-init/templates/AGENTS.template.md +4 -27
  10. package/init/xinyun-ai-init/templates/README.template.md +3 -31
  11. package/init/xinyun-ai-init/templates/control-plane-index.template.json +5 -24
  12. package/init/xinyun-ai-init/templates/core-rules.template.md +9 -57
  13. package/init/xinyun-ai-init/templates/current-task.template.md +3 -19
  14. package/init/xinyun-ai-init/templates/manifest.template.json +13 -67
  15. package/init/xinyun-ai-init/templates/project-context.template.json +3 -11
  16. package/init/xinyun-ai-init/templates/project-index.template.json +5 -51
  17. package/init/xinyun-ai-init/templates/skill-run-record.template.json +4 -16
  18. package/init/xinyun-ai-init/templates/skill-runtime-route.template.json +3 -24
  19. package/init/xinyun-ai-init/templates/skills-assignments.template.json +3 -21
  20. package/init/xinyun-ai-init/templates/skills-registry.template.json +5 -29
  21. package/init/xinyun-ai-init/templates/task-graph.template.json +3 -5
  22. package/init/xinyun-ai-init/templates/task-index.template.json +3 -31
  23. package/init/xinyun-ai-init/version.json +8 -8
  24. package/package.json +8 -14
  25. package/scripts/run-v3-runtime-probe.js +8 -0
  26. package/scripts/verify-legacy-cleanup.js +24 -0
  27. package/scripts/verify-release-gate.js +10 -23
  28. package/scripts/verify-rules-tarball-security.js +1 -1
  29. package/scripts/verify-skill-runtime.js +33 -0
  30. package/scripts/verify-tarball.js +42 -0
  31. package/scripts/verify-v3-package.js +70 -0
  32. package/test-scenarios/v3.0.0-behavior-evidence.json +25 -0
  33. package/test-scenarios/v3.0.0-scenarios.md +41 -0
  34. package/init/xinyun-ai-init/prompt.md +0 -1
  35. package/init/xinyun-ai-init/rules/coordination.md +0 -43
  36. package/init/xinyun-ai-init/rules/directory-self-completion.md +0 -100
  37. package/init/xinyun-ai-init/rules/frameworks/README.md +0 -56
  38. package/init/xinyun-ai-init/rules/frameworks/backend/php/thinkphp.md +0 -42
  39. package/init/xinyun-ai-init/rules/frameworks/frontend/uni-app.md +0 -36
  40. package/init/xinyun-ai-init/rules/frameworks/frontend/wechat-miniprogram.md +0 -36
  41. package/init/xinyun-ai-init/rules/frontend-audit.md +0 -9
  42. package/init/xinyun-ai-init/rules/init-rules.md +0 -145
  43. package/init/xinyun-ai-init/rules/self-learning-rules.md +0 -16
  44. package/init/xinyun-ai-init/rules/session-workbench.md +0 -333
  45. package/init/xinyun-ai-init/rules/skills.md +0 -23
  46. package/init/xinyun-ai-init/rules/temporary-sessions.md +0 -13
  47. package/init/xinyun-ai-init/rules/upgrade-rules.md +0 -161
  48. package/init/xinyun-ai-init/rules/v1.10.2-contract.md +0 -30
  49. package/init/xinyun-ai-init/rules/v1.11.0-acceleration.md +0 -27
  50. package/init/xinyun-ai-init/rules/v1.12.0-recovery.md +0 -34
  51. package/init/xinyun-ai-init/rules/v1.12.1-provider-session-binding.md +0 -25
  52. package/init/xinyun-ai-init/rules/v1.13.0-host-adapter.md +0 -43
  53. package/init/xinyun-ai-init/rules/v1.14.0-agent-core.md +0 -35
  54. package/init/xinyun-ai-init/rules/v1.15.0-session-binding.md +0 -44
  55. package/init/xinyun-ai-init/rules/v1.16.0-capability-efficiency.md +0 -23
  56. package/init/xinyun-ai-init/rules/v2.0.0-shared-project-conversations.md +0 -68
  57. package/init/xinyun-ai-init/rules/v2.0.0-single-session-skills.md +0 -89
  58. package/init/xinyun-ai-init/scripts/README.md +0 -16
  59. package/init/xinyun-ai-init/templates/agent-capabilities.template.json +0 -27
  60. package/init/xinyun-ai-init/templates/agent-profile.template.json +0 -21
  61. package/init/xinyun-ai-init/templates/archive-transaction.template.json +0 -15
  62. package/init/xinyun-ai-init/templates/bootstrap-snapshot.template.json +0 -22
  63. package/init/xinyun-ai-init/templates/capabilities.template.json +0 -19
  64. package/init/xinyun-ai-init/templates/codegraph-incremental-record.template.json +0 -21
  65. package/init/xinyun-ai-init/templates/conversation-binding.template.json +0 -26
  66. package/init/xinyun-ai-init/templates/conversation-event.template.json +0 -24
  67. package/init/xinyun-ai-init/templates/conversation-registry.template.json +0 -15
  68. package/init/xinyun-ai-init/templates/conversation-stream-head.template.json +0 -14
  69. package/init/xinyun-ai-init/templates/conversation-sync-cursor.template.json +0 -13
  70. package/init/xinyun-ai-init/templates/coordination-change-ledger.template.json +0 -15
  71. package/init/xinyun-ai-init/templates/coordination-conflict-record.template.json +0 -18
  72. package/init/xinyun-ai-init/templates/coordination-contract-snapshot.template.json +0 -9
  73. package/init/xinyun-ai-init/templates/coordination-project-facts.template.json +0 -20
  74. package/init/xinyun-ai-init/templates/coordination-transaction.template.json +0 -16
  75. package/init/xinyun-ai-init/templates/database-authorization.template.json +0 -53
  76. package/init/xinyun-ai-init/templates/final-delivery.template.json +0 -22
  77. package/init/xinyun-ai-init/templates/fixed-materialization.template.json +0 -12
  78. package/init/xinyun-ai-init/templates/framework-profile.template.json +0 -48
  79. package/init/xinyun-ai-init/templates/framework-profile.template.md +0 -39
  80. package/init/xinyun-ai-init/templates/frontend-audit.template.json +0 -27
  81. package/init/xinyun-ai-init/templates/handoff.template.json +0 -27
  82. package/init/xinyun-ai-init/templates/host-capabilities.template.json +0 -37
  83. package/init/xinyun-ai-init/templates/host-preflight.template.json +0 -33
  84. package/init/xinyun-ai-init/templates/html-migration-asset-map.template.md +0 -6
  85. package/init/xinyun-ai-init/templates/html-migration-compatibility-matrix.template.md +0 -6
  86. package/init/xinyun-ai-init/templates/html-migration-open-issues.template.md +0 -12
  87. package/init/xinyun-ai-init/templates/html-migration-pilot-plan.template.md +0 -21
  88. package/init/xinyun-ai-init/templates/html-migration-record.template.json +0 -36
  89. package/init/xinyun-ai-init/templates/html-migration-route-map.template.md +0 -6
  90. package/init/xinyun-ai-init/templates/html-migration-scope.template.md +0 -28
  91. package/init/xinyun-ai-init/templates/init-result.template.json +0 -25
  92. package/init/xinyun-ai-init/templates/initialization-cache.template.json +0 -13
  93. package/init/xinyun-ai-init/templates/initialization-change-report.template.json +0 -14
  94. package/init/xinyun-ai-init/templates/initialization-recovery.template.json +0 -24
  95. package/init/xinyun-ai-init/templates/initialization-stages.template.json +0 -18
  96. package/init/xinyun-ai-init/templates/initialization-timing.template.json +0 -16
  97. package/init/xinyun-ai-init/templates/local-query-index.template.json +0 -15
  98. package/init/xinyun-ai-init/templates/managed-baseline.template.json +0 -17
  99. package/init/xinyun-ai-init/templates/manual-session-binding.template.json +0 -45
  100. package/init/xinyun-ai-init/templates/manual-session-recovery.template.json +0 -53
  101. package/init/xinyun-ai-init/templates/multi-conversation-migration.template.json +0 -24
  102. package/init/xinyun-ai-init/templates/onboarding-report.template.json +0 -30
  103. package/init/xinyun-ai-init/templates/orchestrator.template.json +0 -28
  104. package/init/xinyun-ai-init/templates/parallelism.template.json +0 -13
  105. package/init/xinyun-ai-init/templates/performance-metrics.template.json +0 -17
  106. package/init/xinyun-ai-init/templates/preflight-report.template.json +0 -25
  107. package/init/xinyun-ai-init/templates/project-check.template.md +0 -56
  108. package/init/xinyun-ai-init/templates/project-guide.template.md +0 -57
  109. package/init/xinyun-ai-init/templates/project-identity.template.json +0 -23
  110. package/init/xinyun-ai-init/templates/project-status.template.json +0 -28
  111. package/init/xinyun-ai-init/templates/provider-adapter.template.json +0 -25
  112. package/init/xinyun-ai-init/templates/provider-session-binding.template.json +0 -77
  113. package/init/xinyun-ai-init/templates/re-takeover-record.template.json +0 -37
  114. package/init/xinyun-ai-init/templates/requirement-packet.template.json +0 -23
  115. package/init/xinyun-ai-init/templates/role-execution.template.md +0 -72
  116. package/init/xinyun-ai-init/templates/role-session-binding.template.json +0 -105
  117. package/init/xinyun-ai-init/templates/role-subtask.template.md +0 -36
  118. package/init/xinyun-ai-init/templates/session-binding.template.json +0 -38
  119. package/init/xinyun-ai-init/templates/session-candidates.template.json +0 -19
  120. package/init/xinyun-ai-init/templates/shared-project-snapshot.template.json +0 -24
  121. package/init/xinyun-ai-init/templates/single-session-migration.template.json +0 -31
  122. package/init/xinyun-ai-init/templates/sync-check.template.json +0 -23
  123. package/init/xinyun-ai-init/templates/takeover-baseline.template.json +0 -17
  124. package/init/xinyun-ai-init/templates/takeover-gate.template.json +0 -22
  125. package/init/xinyun-ai-init/templates/task-history.template.md +0 -35
  126. package/init/xinyun-ai-init/templates/task-lease.template.json +0 -19
  127. package/init/xinyun-ai-init/templates/task-lock.template.json +0 -31
  128. package/init/xinyun-ai-init/templates/task-main.template.md +0 -38
  129. package/init/xinyun-ai-init/templates/task-result.template.json +0 -23
  130. package/init/xinyun-ai-init/templates/team/README.md +0 -51
  131. package/init/xinyun-ai-init/templates/team/assignments.json +0 -49
  132. package/init/xinyun-ai-init/templates/team/confirmations/chief-engineer.md +0 -24
  133. package/init/xinyun-ai-init/templates/team/confirmations/programmer.md +0 -24
  134. package/init/xinyun-ai-init/templates/team/confirmations/project-owner.md +0 -24
  135. package/init/xinyun-ai-init/templates/team/confirmations/project-product.md +0 -24
  136. package/init/xinyun-ai-init/templates/team/confirmations/test-reviewer.md +0 -24
  137. package/init/xinyun-ai-init/templates/team/file-ownership.json +0 -32
  138. package/init/xinyun-ai-init/templates/team/members.json +0 -61
  139. package/init/xinyun-ai-init/templates/team/responsibility-matrix.json +0 -81
  140. package/init/xinyun-ai-init/templates/team/roles.json +0 -71
  141. package/init/xinyun-ai-init/templates/team/understandings/chief-engineer.md +0 -23
  142. package/init/xinyun-ai-init/templates/team/understandings/programmer.md +0 -23
  143. package/init/xinyun-ai-init/templates/team/understandings/project-owner.md +0 -23
  144. package/init/xinyun-ai-init/templates/team/understandings/project-product.md +0 -23
  145. package/init/xinyun-ai-init/templates/team/understandings/test-reviewer.md +0 -23
  146. package/init/xinyun-ai-init/templates/technical-impact-packet.template.json +0 -31
  147. package/init/xinyun-ai-init/templates/technical-landscape.template.json +0 -41
  148. package/init/xinyun-ai-init/templates/temporary-session.template.json +0 -32
  149. package/init/xinyun-ai-init/templates/workstreams-readme.template.md +0 -36
  150. package/scripts/collect-v1.10-evidence.js +0 -159
  151. package/scripts/collect-v1.14-local-evidence.js +0 -66
  152. package/scripts/collect-v1.15-real-evidence.js +0 -114
  153. package/scripts/collect-v1.16-evidence.js +0 -48
  154. package/scripts/collect-v2-evidence.js +0 -35
  155. package/scripts/run-v1.16-runtime-probe.js +0 -91
  156. package/scripts/run-v2-runtime-probe.js +0 -110
  157. package/scripts/verify-init-package.js +0 -2297
  158. package/scripts/verify-multi-conversation-contract.js +0 -61
  159. package/scripts/verify-re-takeover-contract.js +0 -54
  160. package/scripts/verify-rules-package.js +0 -1287
  161. package/scripts/verify-v2-package.js +0 -210
  162. package/scripts/verify-v2-tarball.js +0 -73
  163. package/test-scenarios/README.md +0 -130
  164. package/test-scenarios/fixtures/v1.10.0-takeover-gate-fixture/README.md +0 -23
  165. package/test-scenarios/fixtures/v1.10.0-takeover-gate-fixture/after/project-status.json +0 -7
  166. package/test-scenarios/fixtures/v1.10.0-takeover-gate-fixture/before/project-status.json +0 -7
  167. package/test-scenarios/fixtures/v1.9.0-behavior-fixture/README.md +0 -9
  168. package/test-scenarios/multi-conversation-evidence.json +0 -26
  169. package/test-scenarios/multi-conversation-scenarios.md +0 -16
  170. package/test-scenarios/re-takeover-evidence.json +0 -20
  171. package/test-scenarios/re-takeover-scenarios.md +0 -33
  172. package/test-scenarios/review-template.md +0 -165
  173. package/test-scenarios/scenarios.md +0 -1273
  174. package/test-scenarios/v1.10.0-behavior-evidence.json +0 -31
  175. package/test-scenarios/v1.10.0-scenarios.md +0 -96
  176. package/test-scenarios/v1.10.2-scenarios.md +0 -38
  177. package/test-scenarios/v1.11.0-scenarios.md +0 -30
  178. package/test-scenarios/v1.12.0-behavior-evidence.json +0 -29
  179. package/test-scenarios/v1.12.0-scenarios.md +0 -51
  180. package/test-scenarios/v1.12.1-behavior-evidence.json +0 -27
  181. package/test-scenarios/v1.12.1-scenarios.md +0 -42
  182. package/test-scenarios/v1.13.0-behavior-evidence.json +0 -650
  183. package/test-scenarios/v1.13.0-scenarios.md +0 -94
  184. package/test-scenarios/v1.14.0-behavior-evidence.json +0 -780
  185. package/test-scenarios/v1.14.0-scenarios.md +0 -63
  186. package/test-scenarios/v1.15.0-behavior-evidence.json +0 -476
  187. package/test-scenarios/v1.15.0-scenarios.md +0 -57
  188. package/test-scenarios/v1.16.0-behavior-evidence.json +0 -46
  189. package/test-scenarios/v1.16.0-real-host-probe.json +0 -132
  190. package/test-scenarios/v1.16.0-scenarios.md +0 -19
  191. package/test-scenarios/v1.7.0-scenarios.md +0 -91
  192. package/test-scenarios/v1.7.1-scenarios.md +0 -130
  193. package/test-scenarios/v1.7.2-scenarios.md +0 -51
  194. package/test-scenarios/v1.7.3-scenarios.md +0 -79
  195. package/test-scenarios/v1.8.0-scenarios.md +0 -39
  196. package/test-scenarios/v1.9.0-behavior-evidence.json +0 -269
  197. package/test-scenarios/v1.9.0-scenarios.md +0 -55
  198. package/test-scenarios/v2.0.0-behavior-evidence.json +0 -40
  199. package/test-scenarios/v2.0.0-scenarios.md +0 -21
@@ -1,23 +0,0 @@
1
- # 角色理解记录:chief-engineer
2
-
3
- - recordId:understanding-chief-engineer
4
- - roleId:chief-engineer
5
- - memberId:null
6
- - status:pending
7
- - readScope:项目结构、端口、框架、接口、数据库、Git、构建线索
8
- - readBudget:按任务触发读取,不全量扫描业务代码
9
- - unreadablePaths:
10
- - confirmedFacts:
11
- - inferences:
12
- - pendingQuestions:
13
- - risks:
14
- - evidence:
15
- - coverage:
16
- - executionEligible:false
17
- - createdAt:2026-07-19T00:00:00.000Z
18
- - updatedAt:2026-07-19T00:00:00.000Z
19
-
20
- ## 后续动作
21
-
22
- - 绑定总工成员。
23
- - 完成技术范围理解和职责确认后才能技术确认。
@@ -1,23 +0,0 @@
1
- # 角色理解记录:programmer
2
-
3
- - recordId:understanding-programmer
4
- - roleId:programmer
5
- - memberId:null
6
- - status:pending
7
- - readScope:被分配端口、框架规则、入口文件、已有封装、测试方式
8
- - readBudget:仅读取确认任务范围内文件
9
- - unreadablePaths:
10
- - confirmedFacts:
11
- - inferences:
12
- - pendingQuestions:
13
- - risks:
14
- - evidence:
15
- - coverage:
16
- - executionEligible:false
17
- - createdAt:2026-07-19T00:00:00.000Z
18
- - updatedAt:2026-07-19T00:00:00.000Z
19
-
20
- ## 后续动作
21
-
22
- - 绑定执行成员。
23
- - 等待已确认任务单和允许修改范围。
@@ -1,23 +0,0 @@
1
- # 角色理解记录:project-owner
2
-
3
- - recordId:understanding-project-owner
4
- - roleId:project-owner
5
- - memberId:null
6
- - status:pending
7
- - readScope:审批流程、交付结论、发布授权规则
8
- - readBudget:首次初始化不全量扫描业务代码
9
- - unreadablePaths:
10
- - confirmedFacts:
11
- - inferences:
12
- - pendingQuestions:
13
- - risks:
14
- - evidence:
15
- - coverage:
16
- - executionEligible:false
17
- - createdAt:2026-07-19T00:00:00.000Z
18
- - updatedAt:2026-07-19T00:00:00.000Z
19
-
20
- ## 后续动作
21
-
22
- - 绑定实际确认成员。
23
- - 确认业务验收和发布授权边界。
@@ -1,23 +0,0 @@
1
- # 角色理解记录:project-product
2
-
3
- - recordId:understanding-project-product
4
- - roleId:project-product
5
- - memberId:null
6
- - status:pending
7
- - readScope:项目导读、需求沉淀、当前任务、业务说明
8
- - readBudget:首次初始化只读关键文档,不全量扫描业务代码
9
- - unreadablePaths:
10
- - confirmedFacts:
11
- - inferences:
12
- - pendingQuestions:
13
- - risks:
14
- - evidence:
15
- - coverage:
16
- - executionEligible:false
17
- - createdAt:2026-07-19T00:00:00.000Z
18
- - updatedAt:2026-07-19T00:00:00.000Z
19
-
20
- ## 后续动作
21
-
22
- - 绑定产品成员。
23
- - 梳理当前需求和产品验收建议。
@@ -1,23 +0,0 @@
1
- # 角色理解记录:test-reviewer
2
-
3
- - recordId:understanding-test-reviewer
4
- - roleId:test-reviewer
5
- - memberId:null
6
- - status:pending
7
- - readScope:测试场景、验收标准、权限边界、危险操作规则
8
- - readBudget:优先读取测试材料和交付证据
9
- - unreadablePaths:
10
- - confirmedFacts:
11
- - inferences:
12
- - pendingQuestions:
13
- - risks:
14
- - evidence:
15
- - coverage:
16
- - executionEligible:false
17
- - createdAt:2026-07-19T00:00:00.000Z
18
- - updatedAt:2026-07-19T00:00:00.000Z
19
-
20
- ## 后续动作
21
-
22
- - 绑定测试审查成员。
23
- - 独立复核测试结果和发布阻断项。
@@ -1,31 +0,0 @@
1
- {
2
- "schemaVersion": 1,
3
- "packetId": "technical-impact-packet-template",
4
- "requirementId": null,
5
- "taskId": null,
6
- "projectRootHash": null,
7
- "version": "1.11.0",
8
- "status": "not-started",
9
- "content": {
10
- "summary": null,
11
- "affectedPorts": [],
12
- "affectedRepositories": [],
13
- "affectedFiles": [],
14
- "affectedApis": [],
15
- "affectedFields": [],
16
- "affectedComponents": [],
17
- "affectedFlows": [],
18
- "dependencies": [],
19
- "conflicts": [],
20
- "risks": [],
21
- "expectedDiff": [],
22
- "testPlan": [],
23
- "unverifiedScope": [],
24
- "executionRecommendation": null
25
- },
26
- "evidence": [],
27
- "sourceRevision": null,
28
- "contentHash": null,
29
- "createdAt": "2026-07-24T00:00:00.000Z",
30
- "updatedAt": "2026-07-24T00:00:00.000Z"
31
- }
@@ -1,41 +0,0 @@
1
- {
2
- "schemaVersion": 1,
3
- "recordId": "technical-landscape-template",
4
- "projectIdentity": "xinyun-ai/project-identity.json",
5
- "coveredPorts": [],
6
- "coveredRepositories": [],
7
- "frameworks": [],
8
- "runtimes": [],
9
- "apiContracts": [],
10
- "databaseContracts": [],
11
- "components": [],
12
- "routes": [],
13
- "businessTechnicalFlows": [],
14
- "dependencies": [],
15
- "risks": [],
16
- "adoptedLegacyFindings": [],
17
- "pendingFindings": [],
18
- "conflicts": [],
19
- "unverifiedScope": [],
20
- "evidence": [],
21
- "coverage": {
22
- "plannedPorts": [],
23
- "actualPorts": [],
24
- "plannedRepositories": [],
25
- "actualRepositories": [],
26
- "plannedObjectTypes": [],
27
- "actualObjectCounts": {},
28
- "unverifiedScope": [],
29
- "coverageStatus": "unknown",
30
- "coverageEvidence": []
31
- },
32
- "status": "not-started",
33
- "landscapeVersion": "1.11.0",
34
- "contentHash": null,
35
- "sourceRevisions": [],
36
- "invalidatedBy": [],
37
- "refreshedAt": null,
38
- "refreshedBy": null,
39
- "createdAt": "2026-07-24T00:00:00.000Z",
40
- "updatedAt": "2026-07-24T00:00:00.000Z"
41
- }
@@ -1,32 +0,0 @@
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,36 +0,0 @@
1
- # workstreams
2
-
3
- 本目录用于按端或子系统沉淀技术执行说明。
4
-
5
- 首次初始化只记录识别到的端,不创建所有端目录。
6
-
7
- ## 理解深度状态
8
-
9
- - `unknown`:未识别
10
- - `quick`:首次快速识别
11
- - `expanded`:已按任务补全理解
12
- - `verified`:已结合代码或索引验证
13
- - `stale`:疑似过期
14
-
15
- ## 已识别端
16
-
17
- 待填写。
18
-
19
- ## 端口 Git 仓库
20
-
21
- 待填写。
22
-
23
- ## 端口轻量框架识别
24
-
25
- - 每个端口最多发现 3 层目录、读取 20 个关键文件。
26
- - 正向识别记录证据路径和证据类型。
27
- - 预算内无证据标注 `未在项目中发现`。
28
- - 超预算、权限不足或路径不可读标注 `状态未知` 和 `覆盖范围:部分`。
29
- - 不混用 uni-app 与原生微信小程序规则。
30
-
31
- ## 端口字段影响审视
32
-
33
- - 每个端口最多检查 300 个候选文件、1000 条匹配结果和 50 条证据记录。
34
- - 字段分类:数据库字段 / API 字段 / 前端展示字段 / 未确认。
35
- - 记录检索根目录、排除项、CodeGraph 状态、证据、覆盖范围、可能遗漏位置和兼容方案。
36
- - 未确认前不得执行 SQL、migration、seed、批量数据修复或接口兼容改动。
@@ -1,159 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require("fs");
4
- const path = require("path");
5
- const crypto = require("crypto");
6
-
7
- const root = path.resolve(__dirname, "..");
8
- const packageVersion = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8")).version;
9
- const expectedScenarioIds = Array.from({ length: 14 }, (_, index) => 120 + index);
10
- const roles = ["project-owner", "project-product", "chief-engineer", "programmer", "test-reviewer"];
11
-
12
- function parseArgs(argv) {
13
- const options = { sessionManifest: null, output: null, fixture: path.join(root, "test-scenarios", "fixtures", "v1.10.0-takeover-gate-fixture") };
14
- for (let index = 0; index < argv.length; index += 1) {
15
- const arg = argv[index];
16
- if (arg === "--session-manifest") options.sessionManifest = argv[++index];
17
- else if (arg === "--output") options.output = argv[++index];
18
- else if (arg === "--fixture") options.fixture = argv[++index];
19
- else if (arg === "--help" || arg === "-h") {
20
- console.log("Usage: node scripts/collect-v1.10-evidence.js [--session-manifest path] [--output path] [--fixture path]");
21
- process.exit(0);
22
- } else {
23
- throw new Error(`Unknown argument: ${arg}`);
24
- }
25
- }
26
- return options;
27
- }
28
-
29
- function sha256File(filePath) {
30
- return crypto.createHash("sha256").update(fs.readFileSync(filePath)).digest("hex");
31
- }
32
-
33
- function readJson(filePath) {
34
- return JSON.parse(fs.readFileSync(filePath, "utf8"));
35
- }
36
-
37
- function writeJson(filePath, value) {
38
- fs.mkdirSync(path.dirname(filePath), { recursive: true });
39
- fs.writeFileSync(filePath, `${JSON.stringify(value, null, 2)}\n`, "utf8");
40
- }
41
-
42
- function scanSensitive(value) {
43
- const text = JSON.stringify(value);
44
- const markers = [
45
- /-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/i,
46
- /(?:^|[^a-z])(?:password|passwd|secret|token|authorization|api[_-]?key)\s*[:=]\s*[^\s,}"']+/i,
47
- /(?:mysql|postgres(?:ql)?|mongodb(?:\+srv)?):\/\/[^\s"']+/i,
48
- ];
49
- return markers.filter((marker) => marker.test(text)).map((marker) => marker.toString());
50
- }
51
-
52
- function validHostSessionId(value) {
53
- return typeof value === "string" && value.trim() !== "" && !/^(null|unknown|fake|fixture|placeholder|session-fixture)/i.test(value);
54
- }
55
-
56
- function loadSessionManifest(filePath) {
57
- if (!filePath || !fs.existsSync(filePath)) return null;
58
- const manifest = readJson(filePath);
59
- if (manifest.source !== "codex-host-returned") return null;
60
- if (!Array.isArray(manifest.sessions)) return null;
61
- const byRole = new Map(manifest.sessions.map((entry) => [entry.roleId, entry]));
62
- const manifestDirectory = path.dirname(path.resolve(filePath));
63
- const entries = roles.map((roleId) => byRole.get(roleId) || null);
64
- if (entries.some((entry) => !entry || !validHostSessionId(entry.sessionId))) return null;
65
- if (entries.some((entry) => !Array.isArray(entry.scenarios) || entry.scenarios.length !== expectedScenarioIds.length)) return null;
66
- for (const entry of entries) {
67
- const scenarioIds = entry.scenarios.map((scenario) => scenario.scenarioId).sort((left, right) => left - right);
68
- if (JSON.stringify(scenarioIds) !== JSON.stringify(expectedScenarioIds)) return null;
69
- for (const scenario of entry.scenarios) {
70
- if (!expectedScenarioIds.includes(scenario.scenarioId) || typeof scenario.input !== "string" || typeof scenario.actualOutput !== "string") return null;
71
- for (const field of ["interactionLogPath", "beforeSnapshotPath", "afterSnapshotPath"]) {
72
- const filePathValue = scenario[field];
73
- if (typeof filePathValue !== "string") return null;
74
- const resolved = path.resolve(manifestDirectory, filePathValue);
75
- if (!fs.existsSync(resolved) || !fs.statSync(resolved).isFile()) return null;
76
- }
77
- const interactionPath = path.resolve(manifestDirectory, scenario.interactionLogPath);
78
- if (scanSensitive(fs.readFileSync(interactionPath, "utf8")).length > 0) return null;
79
- const beforeHash = sha256File(path.resolve(manifestDirectory, scenario.beforeSnapshotPath));
80
- const afterHash = sha256File(path.resolve(manifestDirectory, scenario.afterSnapshotPath));
81
- if (scenario.beforeSnapshotHash !== beforeHash || scenario.afterSnapshotHash !== afterHash) return null;
82
- }
83
- }
84
- return { entries, manifestDirectory };
85
- }
86
-
87
- function buildScenario(scenarioId, sessionId, source, fixtureBeforeHash, fixtureAfterHash, failureReason) {
88
- const hasSession = validHostSessionId(sessionId);
89
- const scenario = {
90
- scenarioId,
91
- sessionId: hasSession ? sessionId : null,
92
- input: hasSession ? source.input || `Host export input for scenario ${scenarioId}` : "not executed: no verified Codex host session export",
93
- expectedOutput: `v1.10 takeover gate scenario ${scenarioId}`,
94
- actualOutput: hasSession ? source.actualOutput || "host output supplied without a synthetic result" : "not-verified",
95
- beforeSnapshotHash: hasSession ? source.beforeSnapshotHash || fixtureBeforeHash : null,
96
- afterSnapshotHash: hasSession ? source.afterSnapshotHash || fixtureAfterHash : null,
97
- changedFiles: Array.isArray(source.changedFiles) ? source.changedFiles : [],
98
- forbiddenOperations: {
99
- databaseConnection: false,
100
- sqlExecution: false,
101
- gitWrite: false,
102
- businessCodeWrite: false,
103
- dependencyInstall: false,
104
- npmPublish: false,
105
- },
106
- evidence: hasSession ? [{ type: "real-session-export", sessionId }] : [],
107
- sensitiveScan: { status: "pass", matches: scanSensitive({ source, sessionId }) },
108
- result: hasSession ? "pending-review" : "not-verified",
109
- failureReason: hasSession ? null : failureReason,
110
- recordedAt: new Date().toISOString(),
111
- };
112
- const payload = JSON.stringify(scenario);
113
- scenario.recordHash = crypto.createHash("sha256").update(payload, "utf8").digest("hex");
114
- return scenario;
115
- }
116
-
117
- function main() {
118
- const options = parseArgs(process.argv.slice(2));
119
- const outputPath = path.resolve(options.output || path.join(root, "test-scenarios", "v1.10.0-behavior-evidence.generated.json"));
120
- const fixtureBefore = path.join(options.fixture, "before", "project-status.json");
121
- const fixtureAfter = path.join(options.fixture, "after", "project-status.json");
122
- if (!fs.existsSync(fixtureBefore) || !fs.existsSync(fixtureAfter)) throw new Error("Fixture must contain before/project-status.json and after/project-status.json");
123
-
124
- const fixtureBeforeHash = sha256File(fixtureBefore);
125
- const fixtureAfterHash = sha256File(fixtureAfter);
126
- const sessions = loadSessionManifest(options.sessionManifest);
127
- const missingHostExport = !sessions;
128
- const scenarios = expectedScenarioIds.map((scenarioId) => {
129
- const role = roles[scenarioId % roles.length];
130
- const entry = sessions ? sessions.entries.find((candidate) => candidate.roleId === role) : null;
131
- const source = entry ? entry.scenarios.find((candidate) => candidate.scenarioId === scenarioId) || {} : {};
132
- return buildScenario(scenarioId, entry && entry.sessionId, source, fixtureBeforeHash, fixtureAfterHash, missingHostExport ? "real-role-session-host-export-missing" : "real-role-session-not-verified");
133
- });
134
- const allReal = scenarios.every((scenario) => validHostSessionId(scenario.sessionId) && scenario.evidence.length > 0 && scenario.sensitiveScan.matches.length === 0);
135
- const report = {
136
- schemaVersion: 2,
137
- artifactVersion: packageVersion,
138
- evidenceType: allReal ? "real-session" : "not-verified",
139
- executionMode: allReal ? "codex-host-export" : "host-capability-unavailable",
140
- realAiSessionVerified: allReal,
141
- publishBlocked: true,
142
- blockedReason: allReal ? "awaiting-independent-test-review" : "real-role-session-host-unavailable",
143
- fixturePath: path.relative(root, options.fixture).replace(/\\/g, "/"),
144
- fixtureHashes: { before: fixtureBeforeHash, after: fixtureAfterHash },
145
- sessionManifestPath: options.sessionManifest ? path.relative(root, path.resolve(options.sessionManifest)).replace(/\\/g, "/") : null,
146
- forbiddenOperations: ["database-connection", "sql-execution", "git-write", "business-code-write", "dependency-install", "npm-publish"],
147
- scenarios,
148
- };
149
- writeJson(outputPath, report);
150
- console.log(JSON.stringify({ output: path.relative(root, outputPath).replace(/\\/g, "/"), realAiSessionVerified: allReal, scenarioCount: scenarios.length, publishBlocked: report.publishBlocked }, null, 2));
151
- process.exitCode = allReal ? 0 : 3;
152
- }
153
-
154
- try {
155
- main();
156
- } catch (error) {
157
- console.error(`[v1.10 evidence] ${error.message}`);
158
- process.exitCode = 2;
159
- }
@@ -1,66 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require("fs");
4
- const path = require("path");
5
- const crypto = require("crypto");
6
-
7
- const root = path.resolve(__dirname, "..");
8
- const evidencePath = path.join(root, "test-scenarios", "v1.14.0-behavior-evidence.json");
9
- const localSessionId = "local-v1.14.0-behavior-fixture";
10
-
11
- function hash(value) {
12
- return crypto.createHash("sha256").update(JSON.stringify(value), "utf8").digest("hex");
13
- }
14
-
15
- function main() {
16
- const report = JSON.parse(fs.readFileSync(evidencePath, "utf8"));
17
- if (report.version !== "1.14.0" || !Array.isArray(report.scenarios) || report.scenarios.length !== 20) {
18
- throw new Error("v1.14 behavior evidence must contain scenarios 186-205 before local conversion");
19
- }
20
-
21
- const recordedAt = new Date().toISOString();
22
- report.evidenceType = "local-session";
23
- report.executionMode = "local-degraded";
24
- report.sessionIdentityMode = "local-degraded";
25
- report.localSessionId = localSessionId;
26
- report.realAiSessionVerified = false;
27
- report.readyEligible = false;
28
- report.publishBlocked = false;
29
- report.blockedReason = "real-provider-session-required-for-ready";
30
- report.publishPolicy = "package-publish-allowed; project-ready-remains-blocked";
31
- report.requiredHostEvidence = ["local-session-allocation", "control-file-read-write"];
32
- report.scenarioRequiredFields = [...new Set([...(report.scenarioRequiredFields || []), "localSessionId"])]
33
-
34
- report.scenarios = report.scenarios.map((scenario) => {
35
- const next = {
36
- ...scenario,
37
- sessionId: null,
38
- providerSessionId: null,
39
- localSessionId,
40
- actualOutput: "local-degraded-verified",
41
- result: "local-passed",
42
- evidenceType: "local-session",
43
- evidence: [
44
- { operation: "local-session-allocation", source: "xinyun-ai control plane", localSessionId, recordedAt },
45
- { operation: "control-file-read-write", source: "isolated package fixture", summaryOrHash: hash({ scenarioId: scenario.scenarioId, localSessionId }), recordedAt },
46
- ],
47
- sensitiveScan: { status: "pass", matches: [] },
48
- recordedAt,
49
- };
50
- delete next.recordHash;
51
- next.recordHash = hash(next);
52
- return next;
53
- });
54
- report.recordedAt = recordedAt;
55
- delete report.recordHash;
56
- report.recordHash = hash(report);
57
- fs.writeFileSync(evidencePath, `${JSON.stringify(report, null, 2)}\n`, "utf8");
58
- console.log(JSON.stringify({ output: path.relative(root, evidencePath).replace(/\\/g, "/"), sessionIdentityMode: report.sessionIdentityMode, localSessionId, scenarioCount: report.scenarios.length, publishBlocked: report.publishBlocked, readyEligible: report.readyEligible }, null, 2));
59
- }
60
-
61
- try {
62
- main();
63
- } catch (error) {
64
- console.error(`[v1.14 local evidence] ${error.message}`);
65
- process.exitCode = 2;
66
- }
@@ -1,114 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require("fs");
4
- const path = require("path");
5
- const crypto = require("crypto");
6
-
7
- const root = path.resolve(__dirname, "..");
8
- const evidencePath = path.join(root, "test-scenarios", "v1.15.0-behavior-evidence.json");
9
- const requiredOperations = ["create-or-reuse", "send", "receive", "query-status", "recover", "close", "control-file-read-write"];
10
-
11
- function readText(relativePath) {
12
- return fs.readFileSync(path.join(root, relativePath), "utf8");
13
- }
14
-
15
- function readJson(relativePath) {
16
- return JSON.parse(readText(relativePath));
17
- }
18
-
19
- function hash(value) {
20
- return crypto.createHash("sha256").update(value).digest("hex");
21
- }
22
-
23
- function fileEvidence(relativePath, summary) {
24
- const content = readText(relativePath);
25
- const digest = hash(content);
26
- return {
27
- operation: "contract-check",
28
- source: relativePath,
29
- beforeHash: digest,
30
- afterHash: digest,
31
- summary,
32
- };
33
- }
34
-
35
- function assertCheck(checks, scenarioId, relativePath, summary, predicate) {
36
- checks.push({ scenarioId, relativePath, summary, passed: Boolean(predicate) });
37
- }
38
-
39
- function main() {
40
- const report = readJson("test-scenarios/v1.15.0-behavior-evidence.json");
41
- if (report.version !== "1.15.0" || report.sessionRefType !== "host-thread" || report.realAiSessionVerified !== true) {
42
- throw new Error("v1.15 real evidence requires a verified host-thread session first");
43
- }
44
-
45
- const binding = readJson("init/xinyun-ai-init/templates/session-binding.template.json");
46
- const manualBinding = readJson("init/xinyun-ai-init/templates/manual-session-binding.template.json");
47
- const recovery = readJson("init/xinyun-ai-init/templates/initialization-recovery.template.json");
48
- const ledger = readJson("init/xinyun-ai-init/templates/coordination-change-ledger.template.json");
49
- const conflict = readJson("init/xinyun-ai-init/templates/coordination-conflict-record.template.json");
50
- const frontendAudit = readJson("init/xinyun-ai-init/templates/frontend-audit.template.json");
51
- const requirementPacketText = readText("init/xinyun-ai-init/templates/requirement-packet.template.json");
52
- const taskResultText = readText("init/xinyun-ai-init/templates/task-result.template.json");
53
- const finalDeliveryText = readText("init/xinyun-ai-init/templates/final-delivery.template.json");
54
- const projectIndexText = readText("init/xinyun-ai-init/templates/project-index.template.json");
55
- const taskIndexText = readText("init/xinyun-ai-init/templates/task-index.template.json");
56
- const roleDeliveryText = readText("init/xinyun-ai-init/templates/role-execution.template.md");
57
- const currentTaskText = readText("init/xinyun-ai-init/templates/current-task.template.md");
58
- const capabilitiesText = readText("init/xinyun-ai-init/templates/host-capabilities.template.json");
59
- const ruleText = readText("init/xinyun-ai-init/rules/v1.15.0-session-binding.md");
60
- const checks = [];
61
-
62
- assertCheck(checks, 208, "init/xinyun-ai-init/templates/session-binding.template.json", "provider-session is compatibility-only and sessionRefType remains adapter-neutral", binding.sessionRefTypeEnum.includes("provider-session") && binding.legacyProviderCompatibility.includes("not the v1.15 canonical field"));
63
- assertCheck(checks, 209, "init/xinyun-ai-init/templates/manual-session-binding.template.json", "manual-reference stays pending/manual and requires seven evidence categories", manualBinding.sessionRefType === "manual-reference" && manualBinding.bindingMode === "manual" && manualBinding.executionEligible === false && manualBinding.v115EligibilityRule.includes("seven evidence"));
64
- assertCheck(checks, 210, "test-scenarios/v1.14.0-behavior-evidence.json", "local degraded evidence is non-ready", readJson("test-scenarios/v1.14.0-behavior-evidence.json").readyEligible === false && readJson("test-scenarios/v1.14.0-behavior-evidence.json").sessionIdentityMode === "local-degraded");
65
- assertCheck(checks, 211, "init/xinyun-ai-init/rules/v1.15.0-session-binding.md", "cross-project reuse requires project identity match", ruleText.includes("Cross-project") && ruleText.includes("projectRootHash"));
66
- assertCheck(checks, 212, "init/xinyun-ai-init/templates/session-binding.template.json", "task/title/history cannot impersonate sessionRef", ruleText.includes("taskId") && ruleText.includes("history") && ruleText.includes("sessionRef"));
67
- assertCheck(checks, 213, "init/xinyun-ai-init/templates/project-index.template.json", "cross-file session identity fields are registered", projectIndexText.includes("sessionIdentityFields") && projectIndexText.includes("sessionId") && taskIndexText.includes("sessionId"));
68
- assertCheck(checks, 214, "init/xinyun-ai-init/templates/requirement-packet.template.json", "requirement packet links requirement, task and evidence", requirementPacketText.includes("requirementId") && requirementPacketText.includes("taskId") && requirementPacketText.includes("evidence"));
69
- assertCheck(checks, 215, "init/xinyun-ai-init/templates/final-delivery.template.json", "delivery record has facts, risks, actions, results and evidence slots", ["completedItems", "unfinishedItems", "risks", "nextActions", "evidence"].every((term) => finalDeliveryText.includes(term)));
70
- assertCheck(checks, 216, "init/xinyun-ai-init/templates/current-task.template.md", "authorization confirmation gates execution eligibility", currentTaskText.includes("confirmationStatus") && currentTaskText.includes("executionEligible"));
71
- assertCheck(checks, 217, "init/xinyun-ai-init/templates/final-delivery.template.json", "quality gate requires tests and review results", finalDeliveryText.includes("tests") && finalDeliveryText.includes("reviewResults") && finalDeliveryText.includes("readyRule"));
72
- assertCheck(checks, 218, "init/xinyun-ai-init/templates/coordination-change-ledger.template.json", "shared change ledger records conflict domains and status", ledger.conflictKeys.includes("path") && ledger.conflictKeys.includes("api") && ledger.conflictKeys.includes("database-field") && ledger.recordContract.changeStatusEnum.includes("conflict-pending"));
73
- assertCheck(checks, 219, "init/xinyun-ai-init/templates/coordination-conflict-record.template.json", "conflict record pauses work pending coordination", conflict.conflictStatus === "detected" && conflict.nextAction === "awaiting-confirmation" && conflict.conflictType.includes("business-flow"));
74
- assertCheck(checks, 220, "init/xinyun-ai-init/templates/initialization-recovery.template.json", "recovery reuses task identity and increments attempt", recovery.reuseContract.reuseTaskId === true && recovery.reuseContract.reuseRoleTaskIds === true && recovery.reuseContract.incrementAttempt === true && recovery.reuseContract.createDuplicateTasks === false);
75
- assertCheck(checks, 221, "init/xinyun-ai-init/templates/initialization-recovery.template.json", "replanning preserves task identity and audit history", recovery.reuseContract.reuseTaskId === true && recovery.recoveryEvidence && recovery.attempt === 1);
76
- assertCheck(checks, 222, "init/xinyun-ai-init/templates/host-capabilities.template.json", "tool degradation records unavailable and fallback states", ["available", "unavailable", "not-verified", "fallback", "unverifiedScope"].every((term) => capabilitiesText.includes(term)));
77
- assertCheck(checks, 223, "init/xinyun-ai-init/templates/frontend-audit.template.json", "frontend audit records coupling and componentization decision", frontendAudit.couplingType.includes("shared-component") && frontendAudit.decisionEnum.includes("audit-only") && Array.isArray(frontendAudit.unverifiedScope));
78
-
79
- const recordedAt = new Date().toISOString();
80
- for (const check of checks) {
81
- const scenario = report.scenarios.find((item) => item.scenarioId === check.scenarioId);
82
- if (!scenario) throw new Error(`missing scenario ${check.scenarioId}`);
83
- if (!check.passed) throw new Error(`scenario ${check.scenarioId} contract check failed: ${check.summary}`);
84
- scenario.actualOutput = "contract-verified";
85
- scenario.result = "contract-passed";
86
- scenario.evidence = [fileEvidence(check.relativePath, check.summary)];
87
- scenario.recordedAt = recordedAt;
88
- }
89
-
90
- const negative = report.scenarios.find((item) => item.scenarioId === 207);
91
- negative.actualOutput = "blocked";
92
- negative.result = "real-negative-passed";
93
- negative.evidence = [
94
- { operation: "create-or-reuse", source: "codex_app__create_thread", sessionRefType: "host-thread", sessionRef: "019fb770-2c01-70b3-b2b5-ece70383d536", hostId: "local", recordedAt: "2026-07-31T17:10:09+08:00" },
95
- { operation: "query-status", source: "codex_app__read_thread", sessionRef: "019fb770-2c01-70b3-b2b5-ece70383d536", observedStatus: "idle", taskInteraction: false, recordedAt: "2026-07-31T17:10:16+08:00" },
96
- { operation: "close", source: "codex_app__set_thread_archived", sessionRef: "019fb770-2c01-70b3-b2b5-ece70383d536", archived: true, recordedAt: "2026-07-31T17:10:22+08:00" },
97
- ];
98
- negative.recordedAt = recordedAt;
99
-
100
- report.scenarioVerificationMode = "real-host-session-binding-plus-local-contract-tests";
101
- report.readyEligible = report.scenarios.every((scenario) => scenario.result === "real-passed" || scenario.result === "real-negative-passed" || scenario.result === "contract-passed");
102
- report.blockedReason = null;
103
- report.publishPolicy = "v1.15.0 package scope verified; project readiness follows role onboarding and user release authorization";
104
- report.recordedAt = recordedAt;
105
- fs.writeFileSync(evidencePath, `${JSON.stringify(report, null, 2)}\n`, "utf8");
106
- console.log(JSON.stringify({ version: report.version, scenarioCount: report.scenarios.length, readyEligible: report.readyEligible, realHostEvidence: report.requiredHostEvidence.length, contractChecks: checks.length }, null, 2));
107
- }
108
-
109
- try {
110
- main();
111
- } catch (error) {
112
- console.error(`[v1.15 real evidence] ${error.message}`);
113
- process.exitCode = 2;
114
- }