@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,210 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require("fs");
4
- const path = require("path");
5
-
6
- const root = path.resolve(__dirname, "..");
7
- const initRoot = path.join(root, "init", "xinyun-ai-init");
8
- const checks = [];
9
-
10
- function read(relativePath) {
11
- return fs.readFileSync(path.join(root, relativePath), "utf8");
12
- }
13
-
14
- function json(relativePath) {
15
- return JSON.parse(read(relativePath));
16
- }
17
-
18
- function check(name, ok, detail = "") {
19
- checks.push({ name, ok: Boolean(ok), detail });
20
- }
21
-
22
- function hasOwn(value, field) {
23
- return Object.prototype.hasOwnProperty.call(value, field);
24
- }
25
-
26
- function findForbiddenKeys(value, forbidden, location = "$") {
27
- const hits = [];
28
- if (Array.isArray(value)) {
29
- value.forEach((item, index) => hits.push(...findForbiddenKeys(item, forbidden, `${location}[${index}]`)));
30
- } else if (value && typeof value === "object") {
31
- for (const [key, item] of Object.entries(value)) {
32
- if (forbidden.has(key)) hits.push(`${location}.${key}`);
33
- hits.push(...findForbiddenKeys(item, forbidden, `${location}.${key}`));
34
- }
35
- }
36
- return hits;
37
- }
38
-
39
- function walk(dir) {
40
- const files = [];
41
- for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
42
- const full = path.join(dir, entry.name);
43
- if (entry.isDirectory()) files.push(...walk(full));
44
- else files.push(full);
45
- }
46
- return files;
47
- }
48
-
49
- function verifyFiles() {
50
- const required = [
51
- "package.json",
52
- "bin/xinyun-ai-init.js",
53
- "init/xinyun-ai-init/README.md",
54
- "init/xinyun-ai-init/version.json",
55
- "init/xinyun-ai-init/rules/v2.0.0-shared-project-conversations.md",
56
- "init/xinyun-ai-init/templates/manifest.template.json",
57
- "init/xinyun-ai-init/templates/project-index.template.json",
58
- "init/xinyun-ai-init/templates/current-task.template.md",
59
- "init/xinyun-ai-init/templates/task-main.template.md",
60
- "init/xinyun-ai-init/templates/task-index.template.json",
61
- "init/xinyun-ai-init/templates/task-graph.template.json",
62
- "init/xinyun-ai-init/templates/project-context.template.json",
63
- "init/xinyun-ai-init/templates/conversation-registry.template.json",
64
- "init/xinyun-ai-init/templates/conversation-binding.template.json",
65
- "init/xinyun-ai-init/templates/conversation-stream-head.template.json",
66
- "init/xinyun-ai-init/templates/conversation-event.template.json",
67
- "init/xinyun-ai-init/templates/conversation-sync-cursor.template.json",
68
- "init/xinyun-ai-init/templates/sync-check.template.json",
69
- "init/xinyun-ai-init/templates/task-lease.template.json",
70
- "init/xinyun-ai-init/templates/skill-runtime-route.template.json",
71
- "init/xinyun-ai-init/templates/skill-run-record.template.json",
72
- "init/xinyun-ai-init/templates/skills-assignments.template.json",
73
- "init/xinyun-ai-init/templates/multi-conversation-migration.template.json",
74
- "init/xinyun-ai-init/templates/project-status.template.json",
75
- "init/xinyun-ai-init/templates/takeover-gate.template.json",
76
- "init/xinyun-ai-init/templates/re-takeover-record.template.json",
77
- "init/xinyun-ai-init/templates/provider-adapter.template.json",
78
- "test-scenarios/v2.0.0-behavior-evidence.json",
79
- "test-scenarios/v2.0.0-scenarios.md",
80
- "test-scenarios/re-takeover-evidence.json",
81
- "test-scenarios/re-takeover-scenarios.md",
82
- "test-scenarios/multi-conversation-evidence.json",
83
- "test-scenarios/multi-conversation-scenarios.md",
84
- "scripts/verify-re-takeover-contract.js",
85
- "scripts/verify-multi-conversation-contract.js"
86
- ];
87
- for (const file of required) check(`required:${file}`, fs.existsSync(path.join(root, file)), "missing");
88
- }
89
-
90
- function verifyJsonAndMarkdown() {
91
- for (const file of walk(initRoot)) {
92
- const relative = path.relative(root, file).replace(/\\/g, "/");
93
- if (file.endsWith(".json")) {
94
- try {
95
- JSON.parse(fs.readFileSync(file, "utf8"));
96
- check(`json:${relative}`, true);
97
- } catch (error) {
98
- check(`json:${relative}`, false, error.message);
99
- }
100
- }
101
- if (file.endsWith(".md")) {
102
- const fences = (fs.readFileSync(file, "utf8").match(/```/g) || []).length;
103
- check(`markdown:${relative}`, fences % 2 === 0, "unbalanced code fence");
104
- }
105
- }
106
- }
107
-
108
- function verifyContracts() {
109
- const packageJson = json("package.json");
110
- const version = json("init/xinyun-ai-init/version.json");
111
- const manifest = json("init/xinyun-ai-init/templates/manifest.template.json");
112
- const projectIndex = json("init/xinyun-ai-init/templates/project-index.template.json");
113
- const taskIndex = json("init/xinyun-ai-init/templates/task-index.template.json");
114
- const taskGraph = json("init/xinyun-ai-init/templates/task-graph.template.json");
115
- const projectContext = json("init/xinyun-ai-init/templates/project-context.template.json");
116
- const conversationRegistry = json("init/xinyun-ai-init/templates/conversation-registry.template.json");
117
- const binding = json("init/xinyun-ai-init/templates/conversation-binding.template.json");
118
- const streamHead = json("init/xinyun-ai-init/templates/conversation-stream-head.template.json");
119
- const event = json("init/xinyun-ai-init/templates/conversation-event.template.json");
120
- const cursor = json("init/xinyun-ai-init/templates/conversation-sync-cursor.template.json");
121
- const syncCheck = json("init/xinyun-ai-init/templates/sync-check.template.json");
122
- const taskLease = json("init/xinyun-ai-init/templates/task-lease.template.json");
123
- const route = json("init/xinyun-ai-init/templates/skill-runtime-route.template.json");
124
- const run = json("init/xinyun-ai-init/templates/skill-run-record.template.json");
125
- const assignments = json("init/xinyun-ai-init/templates/skills-assignments.template.json");
126
- const skillRegistry = json("init/xinyun-ai-init/templates/skills-registry.template.json");
127
- const migration = json("init/xinyun-ai-init/templates/multi-conversation-migration.template.json");
128
- const projectStatus = json("init/xinyun-ai-init/templates/project-status.template.json");
129
- const takeoverGate = json("init/xinyun-ai-init/templates/takeover-gate.template.json");
130
- const reTakeover = json("init/xinyun-ai-init/templates/re-takeover-record.template.json");
131
- const providerAdapter = json("init/xinyun-ai-init/templates/provider-adapter.template.json");
132
- const agentProfile = json("init/xinyun-ai-init/templates/agent-profile.template.json");
133
- const handoff = json("init/xinyun-ai-init/templates/handoff.template.json");
134
- const initializationRecovery = json("init/xinyun-ai-init/templates/initialization-recovery.template.json");
135
- const initializationStages = json("init/xinyun-ai-init/templates/initialization-stages.template.json");
136
- const evidence = json("test-scenarios/v2.0.0-behavior-evidence.json");
137
- const multiConversationEvidence = json("test-scenarios/multi-conversation-evidence.json");
138
- const active = { manifest, projectIndex, taskIndex, taskGraph, projectContext, conversationRegistry, binding, streamHead, event, cursor, syncCheck, taskLease, route, run, assignments, skillRegistry, projectStatus, takeoverGate, reTakeover, providerAdapter, agentProfile, handoff, initializationRecovery, initializationStages };
139
- const forbidden = new Set(["roleId", "roleTaskId", "roleSessionId", "providerSessionId", "configuredRoles", "sessionId"]);
140
-
141
- check("package-version", packageJson.version === "2.0.0", packageJson.version);
142
- check("bundle-version", version.version === "2.0.0" && version.schemaVersion === "2", JSON.stringify(version));
143
- check("execution-model", Object.values(active).every((item) => item.executionModel === "shared-project-multi-conversation-runtime"));
144
- for (const [name, value] of Object.entries(active)) {
145
- const hits = findForbiddenKeys(value, forbidden);
146
- check(`role-free:${name}`, hits.length === 0, hits.join(", "));
147
- }
148
-
149
- check("one-project-context", manifest.projectContextPath === "xinyun-ai/project-context.json" && projectContext.projectContextId === null);
150
- check("multi-conversation", manifest.conversations.activeConversationLimit === null && conversationRegistry.conversationLimit === null);
151
- check("re-takeover-context-execution-separation", manifest.reTakeover && manifest.reTakeover.executionRequiresConversationBindingEvidence === true && manifest.reTakeover.threadIdPolicy === "host-thread-candidate-only" && takeoverGate.contextStatus === "blocked" && takeoverGate.executionEligible === false);
152
- check("fixed-role-routing-disabled", manifest.skills.fixedRoleRouting === false);
153
- check("legacy-read-only", manifest.migration.legacyMode === "read-only" && manifest.migration.deleteLegacyMaterials === false && projectIndex.legacy.activeRuntime === false);
154
- check("task-atomicity", manifest.tasking.atomicWriteRequired === true && taskIndex.consistency.writeMode === "transactional-atomic-replace");
155
- check("task-four-file-contract", taskIndex.consistency.requiredFiles.length === 4);
156
- check("task-idempotency", JSON.stringify(taskIndex.idempotency.keyFields) === JSON.stringify(["projectRootHash", "requestFingerprint", "parentTaskId", "taskType"]));
157
- check("task-graph", taskGraph.acyclic === true && taskGraph.orphanTasksAllowed === false && taskGraph.edgeTypeEnum.includes("parent-of"));
158
-
159
- const evidenceCategories = ["create-or-reuse", "send", "receive", "query-status", "recover", "close", "control-file-read-write"];
160
- check("conversation-evidence", JSON.stringify(manifest.conversations.requiredEvidenceCategories) === JSON.stringify(evidenceCategories));
161
- check("conversation-default-read-only", binding.bindingStatus === "pending" && binding.readOnlyEligible === true && binding.writeEligible === false);
162
- check("thread-not-provider", binding.legacyCompatibility.includes("never converted into a provider session id"));
163
- check("single-writer-events", streamHead.writeMode === "single-writer-atomic-replace" && manifest.coordination.eventWriteMode === "per-conversation-single-writer");
164
- check("vector-cursor", hasOwn(cursor, "streamPositions") && cursor.statusEnum.includes("recovery-required"));
165
- check("silent-sync", syncCheck.silentWhenNoChanges === true && syncCheck.userNotificationRequired === false && syncCheck.triggerEnum.includes("user-message-received"));
166
- check("task-lease", hasOwn(taskLease, "targetKeys") && hasOwn(taskLease, "baselineHashes") && taskLease.statusEnum.includes("conflict"));
167
-
168
- check("route-task-facts", hasOwn(route, "taskFacts") && hasOwn(route, "selected") && hasOwn(route, "rejected") && hasOwn(route, "fallback") && hasOwn(route, "blocked"));
169
- check("skill-run-fields", ["skillRunId", "skillId", "taskId", "projectContextId", "conversationBindingId", "syncCheckIdBeforeRun", "phase", "usedTools", "inputEvidence", "outputEvidence", "fallbackReason", "unverifiedScope", "startedAt", "finishedAt"].every((field) => hasOwn(run, field)));
170
- check("self-check-default", run.reviewMode === "self-check");
171
- check("assignment-role-free", !assignments.recordContract.requiredFields.includes("roleId"));
172
- check("registry-task-based", skillRegistry.recordContract.requiredFields.includes("supportedTaskTypes") && !skillRegistry.recordContract.requiredFields.includes("allowedRoles"));
173
-
174
- check("migration-transaction", ["beforeHash", "afterHash", "idempotencyKey", "legacyInventory", "preservedReadOnlyPaths", "rollbackPaths"].every((field) => hasOwn(migration, field)));
175
- check("migration-no-delete", migration.phaseEnum.includes("recovery-required") && migration.phaseEnum.includes("manual-required"));
176
- check("takeover-shared-context", projectStatus.requiredGates.includes("projectContext") && projectStatus.requiredGates.includes("incrementalSync") && takeoverGate.requiredGates.includes("sevenHostOperations"));
177
- check("adapter-neutral", providerAdapter.conversationBindingContract === "adapter-neutral-v2" && providerAdapter.legacyProviderSessionIdPolicy.includes("never derive from a host thread"));
178
- check("re-takeover-contract", reTakeover.contextStatusEnum.includes("context-ready") && reTakeover.conversationBindingDecisionEnum.includes("register-new") && reTakeover.executionEligible === false);
179
-
180
- check("contract-evidence-version", evidence.version === "2.0.0" && evidence.evidenceType === "contract-regression");
181
- check("contract-evidence-honest", evidence.realAiSessionVerified === false && evidence.readyEligible === false && evidence.publishBlocked === true);
182
- check("contract-scenarios", Array.isArray(evidence.scenarios) && evidence.scenarios.length === 15 && evidence.scenarios.every((item, index) => item.scenarioId === 401 + index && item.result === "contract-passed"));
183
- check("contract-sensitive-scan", evidence.sensitiveScan.status === "pass" && evidence.sensitiveScan.matches.length === 0);
184
- check("multi-conversation-evidence", multiConversationEvidence.executionModel === "shared-project-multi-conversation-runtime" && multiConversationEvidence.scenarios.length === 12 && multiConversationEvidence.realCrossConversationVerified === false);
185
-
186
- const readme = read("init/xinyun-ai-init/README.md");
187
- const rule = read("init/xinyun-ai-init/rules/v2.0.0-shared-project-conversations.md");
188
- const cli = read("bin/xinyun-ai-init.js");
189
- check("readme-current-model", readme.includes("shared-project-multi-conversation-runtime") && readme.includes("legacy/read-only"));
190
- check("rule-task-first", rule.includes("xinyun-ai/tasks/<taskId>.md") && rule.includes("control-file-read-write"));
191
- check("rule-publish-boundary", rule.includes("npm 发布必须由用户单独授权"));
192
- check("cli-boundary", cli.includes("This CLI only creates xinyun-ai-init/. It does not create xinyun-ai/ or modify business code."));
193
-
194
- for (const historical of ["v1.14.0", "v1.15.0", "v1.16.0"]) {
195
- const file = path.join(root, "test-scenarios", `${historical}-behavior-evidence.json`);
196
- check(`historical-evidence:${historical}`, fs.existsSync(file) && `v${JSON.parse(fs.readFileSync(file, "utf8")).version}` === historical);
197
- }
198
- }
199
-
200
- function main() {
201
- verifyFiles();
202
- verifyJsonAndMarkdown();
203
- verifyContracts();
204
- for (const item of checks) console.log(`[${item.ok ? "PASS" : "FAIL"}] ${item.name}${item.ok || !item.detail ? "" : `: ${item.detail}`}`);
205
- const failed = checks.filter((item) => !item.ok);
206
- console.log(`[v2 package] ${checks.length - failed.length}/${checks.length} checks passed`);
207
- if (failed.length > 0) process.exitCode = 1;
208
- }
209
-
210
- main();
@@ -1,73 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require("fs");
4
- const path = require("path");
5
- const zlib = require("zlib");
6
-
7
- function arg(name) {
8
- const index = process.argv.indexOf(name);
9
- return index >= 0 ? process.argv[index + 1] || null : null;
10
- }
11
-
12
- function fail(message) {
13
- const result = { status: "error", checks: [{ name: "tarball-entry-safety", actual: message }] };
14
- if (process.argv.includes("--json")) console.log(JSON.stringify(result));
15
- else console.error(`[v2 tarball] ${message}`);
16
- process.exitCode = 2;
17
- }
18
-
19
- function isZeroBlock(block) {
20
- return block.every((byte) => byte === 0);
21
- }
22
-
23
- function stringField(block, offset, length) {
24
- return block.subarray(offset, offset + length).toString("utf8").replace(/\0.*$/, "");
25
- }
26
-
27
- function octalField(block, offset, length) {
28
- const value = stringField(block, offset, length).trim();
29
- return value ? Number.parseInt(value, 8) : 0;
30
- }
31
-
32
- function validateEntry(name, type) {
33
- if (!name) throw new Error("Unsafe tarball entry: empty path");
34
- if (name.includes("\\")) throw new Error(`Unsafe tarball entry: backslash path ${name}`);
35
- if (name.startsWith("/") || /^[A-Za-z]:/.test(name)) throw new Error(`Unsafe tarball entry: absolute path ${name}`);
36
- const segments = name.split("/");
37
- if (segments.includes("..")) throw new Error(`Unsafe tarball entry: path traversal ${name}`);
38
- if (type === "1") throw new Error(`unsupported tar entry: hard link ${name}`);
39
- if (type === "2") throw new Error(`unsupported tar entry: symbolic link ${name}`);
40
- if (!["", "0", "5"].includes(type)) throw new Error(`unsupported tar entry type ${type} for ${name}`);
41
- }
42
-
43
- function main() {
44
- const tarballPath = arg("--tarball");
45
- if (!tarballPath || !fs.existsSync(path.resolve(tarballPath))) {
46
- fail("tarball path is required");
47
- return;
48
- }
49
- try {
50
- const buffer = zlib.gunzipSync(fs.readFileSync(path.resolve(tarballPath)));
51
- let offset = 0;
52
- let entries = 0;
53
- while (offset + 512 <= buffer.length) {
54
- const header = buffer.subarray(offset, offset + 512);
55
- if (isZeroBlock(header)) break;
56
- const name = stringField(header, 0, 100);
57
- const prefix = stringField(header, 345, 155);
58
- const fullName = prefix ? `${prefix}/${name}` : name;
59
- const type = String.fromCharCode(header[156] || 0).replace("\0", "");
60
- validateEntry(fullName, type);
61
- const size = octalField(header, 124, 12);
62
- offset += 512 + Math.ceil(size / 512) * 512;
63
- entries += 1;
64
- }
65
- const result = { status: "pass", checks: [{ name: "tarball-entry-safety", actual: `${entries} safe entries` }] };
66
- if (process.argv.includes("--json")) console.log(JSON.stringify(result));
67
- else console.log(`[v2 tarball] PASS: ${entries} safe entries`);
68
- } catch (error) {
69
- fail(error.message);
70
- }
71
- }
72
-
73
- main();
@@ -1,130 +0,0 @@
1
- # xinyun-ai-init 测试场景
2
-
3
- 本目录用于让其他 AI 或人工审查员测试 `@pm_zhousl/xinyun-ai-init` 初始化包的真实使用效果。
4
-
5
- 当前版本必测场景为 `scenarios.md` 的 1-133,106 和 119 为观察项;v1.10.0 新增接管门禁场景 120-133,详见 `v1.10.0-scenarios.md`。
6
-
7
- ## 使用方式
8
-
9
- ### 1. 本地待发布版本测试
10
-
11
- 用于测试当前工作区尚未发布到 npm 的包体。
12
-
13
- 1. 准备一个临时测试项目。
14
- 2. 在测试项目根目录执行:
15
-
16
- ```powershell
17
- node E:\ai-fabu-xiangmu\AI开发初始化脚本\xinyun-ai-init-npm\bin\xinyun-ai-init.js --force --no-version-check
18
- ```
19
-
20
- 3. 将以下一句话发给 AI:
21
-
22
- ```md
23
- 请执行 `node E:\ai-fabu-xiangmu\AI开发初始化脚本\xinyun-ai-init-npm\bin\xinyun-ai-init.js --force --no-version-check`,然后读取 `xinyun-ai-init/README.md`,按其中规则初始化或升级当前项目。
24
- ```
25
-
26
- 4. 按 `scenarios.md` 中的场景逐条测试。
27
- 5. 将结果填写到 `review-template.md`。
28
-
29
- ### 2. 打包版本测试
30
-
31
- 用于确认 `npm pack` 后的 tarball 是否包含完整文件。
32
-
33
- ```powershell
34
- cd E:\ai-fabu-xiangmu\AI开发初始化脚本\xinyun-ai-init-npm
35
- npm run verify:init
36
- npm pack
37
- ```
38
-
39
- 随后在临时项目中使用 tarball 测试。注意不要直接执行 `npx <tarball> --force`,该形式可能不会正确调用 bin。推荐:
40
-
41
- ```powershell
42
- npx --yes --package E:\ai-fabu-xiangmu\AI开发初始化脚本\xinyun-ai-init-npm\pm_zhousl-xinyun-ai-init-1.10.1.tgz xinyun-ai-init --force --no-version-check
43
- ```
44
-
45
- ### 3. 线上回归测试
46
-
47
- 发布后再测试 npm 线上最新版本。
48
-
49
- ```powershell
50
- npx --yes @pm_zhousl/xinyun-ai-init@latest --force
51
- ```
52
-
53
- 将以下一句话发给 AI:
54
-
55
- ```md
56
- 请执行 `npx --yes @pm_zhousl/xinyun-ai-init@latest --force`,然后读取 `xinyun-ai-init/README.md`,按其中规则初始化或升级当前项目。
57
- ```
58
-
59
- ## 测试分级
60
-
61
- - 必测场景:用于判断当前版本是否可以发布。
62
- - 观察场景:用于收集后续优化建议,不作为当前版本发布阻断项。
63
-
64
- 当前 v1.8 既有必测场景为 `scenarios.md` 的 1-105;v1.9 新增 107-118。
65
-
66
- 当前观察场景为 `scenarios.md` 的 106 和 119。Skill 触发机制仍在后续候选池中,不进入当前可发布范围。
67
-
68
- v1.9.0 的 107-118 行为证据必须保存在 `v1.9.0-behavior-evidence.json`,每项包含输入、期望与实际输出、控制面 before/after 快照及 hash、业务文件与控制文件变更分离、禁止操作证明和敏感扫描。该报告不能用 `verify:init` 或 `verify:rules` 的结构结果替代。
69
-
70
- ## v1.7 规则包一致性校验
71
-
72
- 发布前执行:
73
-
74
- ```powershell
75
- npm run verify:rules
76
- npm run verify:rules -- --json
77
- npm run verify:rules -- --tarball .\pm_zhousl-xinyun-ai-init-1.10.1.tgz
78
- npm run verify:rules:security
79
- ```
80
-
81
- ## 自动校验
82
-
83
- 发布前必须先执行:
84
-
85
- ```powershell
86
- cd E:\ai-fabu-xiangmu\AI开发初始化脚本\xinyun-ai-init-npm
87
- npm run verify:init
88
- ```
89
-
90
- 自动校验负责检查包体文件、模板关键规则、JSON 可解析、Markdown 代码块闭合和 CLI 边界。人工场景负责验证 AI 在真实项目里的行为。
91
-
92
- ## v1.7.2 角色任务可见性回归
93
-
94
- 除 `scenarios.md` 外,发布前必须逐条执行 `v1.7.2-scenarios.md`。重点验证已归档的 v1.7.1 项目能补建 5 个 `role-execution` 任务,活动任务不被错误显示为 idle,重复升级按逐角色幂等键复用,索引中断后可恢复。
95
-
96
- ## v1.7.3 Codex 角色会话回归
97
-
98
- 除 `scenarios.md` 外,发布前必须逐条执行 `v1.7.3-scenarios.md`。重点验证 Codex 主会话在 5 个 `role-execution` 本地任务之后创建或明确降级 5 个真实角色子会话,真实 `sessionId` 回写一致,创建后先进入只读 onboarding,重复升级复用,宿主不支持时使用 `local-degraded-no-fake-session-id` 且不得伪造 sessionId。
99
-
100
- ## v1.10.2 真实角色任务会话绑定回归
101
-
102
- 除 `scenarios.md` 外,发布前必须逐条执行 `v1.10.2-scenarios.md`。重点验证独立主调度会话、5 个真实角色任务会话、`hostThreadId`/`hostSessionId`/项目 `sessionId` 映射、v1.9 八字段项目隔离幂等键、授权门禁、真实请求/响应证据和失败恢复。只有五个角色均有完整真实证据时才能进入 `ready`;不能把宿主线程 ID、任务 ID 或回放材料当作项目 `sessionId`。
103
-
104
- ## v1.11.0 初始化加速回归
105
-
106
- 除 `scenarios.md` 外,发布前必须逐条执行 `v1.11.0-scenarios.md`。重点验证固定基础文件预置、模板哈希冲突保护、分阶段初始化、公共项目快照、最多 3 个角色会话并行、缓存复用、断点恢复、状态域隔离和最终门禁。主项目 `xinyun-ai/`、主项目任务和主项目会话不得进入 npm tarball。
107
-
108
- ## v1.14.0 智能体核心能力回归
109
-
110
- 除 `scenarios.md` 外,发布前必须逐条执行 `v1.14.0-scenarios.md` 的 186-205。重点验证智能体身份/能力声明、统一接管门禁、主会话总控和任务图、共享事实读写、冲突暂停、会话命名与安全复用、最终交付门禁和 v1.13.1 兼容性。真实 provider 行为不可用时,使用明确的 `local-degraded`/`localSessionId` 证据;该模式允许发布规则包,但项目状态必须保持 `partial`、`blocked` 或 `manual-required`,不得变为 `ready`。
111
-
112
- ## 审查原则
113
-
114
- ## v1.8 多会话协作回归
115
-
116
- 除 `scenarios.md` 外,发布前必须逐条执行 `v1.8.0-scenarios.md`。重点验证四个阶段分别通过:A 的共享事实/事务状态,B 的 Skill 路由和 `assignmentStatus` 映射,C 的前端 audit-only/refactor-now 边界,D 的临时会话并发/occupancy 恢复。真实 AI 行为报告必须保存 before/after、changedFiles、禁止操作和敏感扫描结果。
117
-
118
- - 重点看 AI 行为是否符合规则,不只看文件是否生成。
119
- - 初始化应轻量,不做全量扫描。
120
- - 改代码前必须先出方案并等待确认。
121
- - 旧 AI 沉淀只能先梳理、分类、待确认,不能直接当作项目事实。
122
- - 普通聊天、无关问题、被否定方向不能沉淀。
123
- - 观察场景可以记录问题和建议,但不要因为观察场景未完全满足而判定当前版本不可发布。
124
- - 本地待发布版本、打包版本、线上 `@latest` 要分开测试,避免把线上旧版本误判为本地整改结果。
125
-
126
- ## v1.9 项目会话与数据库回归
127
-
128
- 除 `scenarios.md` 外,发布前必须逐条执行 `v1.9.0-scenarios.md`。必须保留项目身份规范化、会话候选排序与复用、中文名称、技术全景 ready/partial、packet stale、数据库 sql-only 和授权审计证据;不得执行 npm publish、Git 写操作、数据库连接或真实业务修改。
129
-
130
-
@@ -1,23 +0,0 @@
1
- # v1.10.0 Takeover Gate Fixture
2
-
3
- This fixture is synthetic and isolated from any business project. It exists so
4
- the v1.10 behavior material has a real, packageable fixture boundary.
5
-
6
- It must only be used for rule replay and evidence-shape checks. It does not
7
- contain a real Codex role session, a database, SQL, Git metadata, credentials,
8
- or business source files. A replay result is never evidence of real AI
9
- acceptance.
10
-
11
- For real-session evidence, provide an external host export to
12
- `scripts/collect-v1.10-evidence.js`. The export must contain host-returned
13
- session IDs, interaction logs, and before/after control-plane snapshots. The
14
- collector rejects missing or synthetic session IDs and otherwise records
15
- `not-verified`.
16
-
17
- Expected synthetic control-plane states:
18
-
19
- - `before/project-status.json`: `blocked` with
20
- `required-role-session-not-created`.
21
- - `after/project-status.json`: remains `blocked` when any required role
22
- session is absent.
23
- - `before/after` contain no business files and no sensitive values.
@@ -1,7 +0,0 @@
1
- {
2
- "projectStatus": "blocked",
3
- "executionEligible": false,
4
- "blockedReason": "required-role-session-not-created",
5
- "roleSessionCount": 0,
6
- "businessCodeChanged": "unknown"
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "projectStatus": "blocked",
3
- "executionEligible": false,
4
- "blockedReason": "required-role-session-not-created",
5
- "roleSessionCount": 0,
6
- "businessCodeChanged": "unknown"
7
- }
@@ -1,9 +0,0 @@
1
- # v1.9.0 Behavior Fixture
2
-
3
- This fixture is isolated from real business projects. It contains only synthetic control-plane state used to record v1.9.0 AI behavior decisions.
4
-
5
- - Business files: none
6
- - Database connection: forbidden
7
- - SQL execution: forbidden
8
- - Git write operations: forbidden
9
- - Sensitive values: synthetic markers are excluded from persistent evidence
@@ -1,26 +0,0 @@
1
- {
2
- "schemaVersion": 1,
3
- "version": "2.0.0",
4
- "evidenceType": "multi-conversation-contract",
5
- "executionModel": "shared-project-multi-conversation-runtime",
6
- "realCrossConversationVerified": false,
7
- "readyEligible": false,
8
- "publishBlocked": true,
9
- "blockedReason": "real-host-cross-conversation-evidence-required",
10
- "scenarios": [
11
- {"scenarioId": 601, "name": "one-project-context-many-conversations", "result": "contract-passed"},
12
- {"scenarioId": 602, "name": "per-conversation-single-writer-stream", "result": "contract-passed"},
13
- {"scenarioId": 603, "name": "interaction-triggered-head-check", "result": "contract-passed"},
14
- {"scenarioId": 604, "name": "no-change-silent-path", "result": "contract-passed"},
15
- {"scenarioId": 605, "name": "incremental-event-consumption", "result": "contract-passed"},
16
- {"scenarioId": 606, "name": "meaningful-result-auto-writeback", "result": "contract-passed"},
17
- {"scenarioId": 607, "name": "vector-cursor-recovery", "result": "contract-passed"},
18
- {"scenarioId": 608, "name": "event-chain-corruption-blocked", "result": "contract-passed"},
19
- {"scenarioId": 609, "name": "target-lease-concurrency", "result": "contract-passed"},
20
- {"scenarioId": 610, "name": "baseline-change-blocked", "result": "contract-passed"},
21
- {"scenarioId": 611, "name": "thread-reference-not-provider-session", "result": "contract-passed"},
22
- {"scenarioId": 612, "name": "cross-project-isolation", "result": "contract-passed"}
23
- ],
24
- "sensitiveScan": {"status": "pass", "matches": []},
25
- "unverifiedScope": ["real host cross-conversation result propagation", "real no-change silent check", "real concurrent lease conflict and recovery"]
26
- }
@@ -1,16 +0,0 @@
1
- # v2.0.0 多对话共享合同场景
2
-
3
- - 601:一个项目只有一个 `projectContextId`,可以登记多个活动对话。
4
- - 602:每个对话只写自己的不可变事件流。
5
- - 603:收到用户消息时比较所有活动流 head 与本对话向量游标。
6
- - 604:没有新增事件时结果为 `no-changes`,不要求向用户提示。
7
- - 605:发现新增事件时只读取新增序号和受影响事实。
8
- - 606:对话完成有长期价值的任务结果后自动写入事件流和事实源。
9
- - 607:对话中断后可按各流序号恢复游标,不重复消费事件。
10
- - 608:事件缺失、哈希链断裂、head 倒退或游标超前时阻断。
11
- - 609:不同目标租约允许并行,重叠目标租约进入冲突。
12
- - 610:写入前基线哈希变化时阻断,不静默覆盖。
13
- - 611:thread ID 只作为 `host-thread` 引用,不成为 `providerSessionId`。
14
- - 612:跨项目绑定、事件、游标和租约均拒绝复用。
15
-
16
- 这些场景是静态合同证据。至少两个真实宿主对话之间的结果传播、静默检查和并发冲突仍需真实行为证据。
@@ -1,20 +0,0 @@
1
- {
2
- "version": "2.0.0",
3
- "evidenceType": "re-takeover-contract",
4
- "executionModel": "shared-project-multi-conversation-runtime",
5
- "contextAndExecutionSeparated": true,
6
- "threadIdNeverProviderSessionId": true,
7
- "scenarios": [
8
- {"scenarioId": 501, "name": "unchanged-project", "result": "contract-passed"},
9
- {"scenarioId": 502, "name": "source-changed-incremental", "result": "contract-passed"},
10
- {"scenarioId": 503, "name": "control-plane-conflict", "result": "contract-passed"},
11
- {"scenarioId": 504, "name": "new-thread-candidate", "result": "contract-passed"},
12
- {"scenarioId": 505, "name": "reuse-existing-main-session", "result": "contract-passed"},
13
- {"scenarioId": 506, "name": "project-scope-conflict", "result": "contract-passed"},
14
- {"scenarioId": 507, "name": "interrupted-takeover-recovery", "result": "contract-passed"},
15
- {"scenarioId": 508, "name": "sensitive-and-legacy-isolation", "result": "contract-passed"}
16
- ],
17
- "sensitiveScan": {"status": "pass", "matches": []},
18
- "realHostVerified": false,
19
- "unverifiedScope": ["real host re-takeover behavior", "real provider session reuse"]
20
- }
@@ -1,33 +0,0 @@
1
- # 新对话重新接管场景
2
-
3
- ## RT-001 未变化项目
4
-
5
- 新对话进入正确项目根目录,核心控制面和快照均存在且源哈希未变化。预期使用增量接管,`contextStatus=context-ready`,`understandingStatus` 保留或提升,不能因没有新宿主会话证据而伪造执行资格。
6
-
7
- ## RT-002 源码发生变化
8
-
9
- 项目源码或配置哈希发生变化。预期只扫描变化路径及其相关入口,记录 `changedPaths` 和新的快照哈希,并将理解状态标记为 `expanded` 或 `stale`,不能继续使用旧事实作为已验证事实。
10
-
11
- ## RT-003 控制面不一致
12
-
13
- `current-task.md`、任务索引和任务图对当前任务的描述不一致。预期接管状态为 `blocked`,只记录冲突和恢复动作,不选择 Skill,不修改业务文件。
14
-
15
- ## RT-004 新 thread 建立独立对话绑定
16
-
17
- 新对话拥有宿主 thread ID,但没有真实 provider 会话证据。预期创建独立 `conversationBindingId`,仅记录 `sessionRefType=host-thread` 和该 thread 引用,`providerSessionId` 保持 `null`。本地控制面读取和增量同步可以继续,依赖 provider canonical session 的操作保持不可用,不得伪造 provider 身份。
18
-
19
- ## RT-005 对话绑定复用与增量同步
20
-
21
- 同一 thread 的既有对话绑定、项目根哈希、cwd 和范围均匹配时,预期幂等复用原 `conversationBindingId` 和向量游标,不创建重复绑定。不同 thread 接入同一项目时创建新的独立绑定,比较所有事件流 head,并只消费游标之后的新事件。
22
-
23
- ## RT-006 项目范围错误
24
-
25
- 对话当前 cwd、项目根哈希或仓库范围与控制面不匹配。预期进入 `blocked` 或 `manual-required`,不得读取或写回其他项目事实。
26
-
27
- ## RT-007 接管中断恢复
28
-
29
- 接管记录在快照写回前中断。预期根据 `takeoverId`、旧快照哈希和阶段证据恢复,不产生半写入的项目索引,不丢失原有任务状态。
30
-
31
- ## RT-008 敏感信息和历史隔离
32
-
33
- 扫描发现敏感信息或旧角色历史材料。预期敏感扫描阻断交付;旧角色材料仅登记为 `legacy/read-only`,不进入新路由,也不复制其他项目事实。