@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,48 +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 checks = [];
8
-
9
- function readJson(relativePath) {
10
- return JSON.parse(fs.readFileSync(path.join(root, relativePath), "utf8"));
11
- }
12
-
13
- function check(name, ok, detail) {
14
- checks.push({ name, ok, detail });
15
- }
16
-
17
- function main() {
18
- const evidence = readJson("test-scenarios/v1.16.0-behavior-evidence.json");
19
- const route = readJson("init/xinyun-ai-init/templates/skill-runtime-route.template.json");
20
- const run = readJson("init/xinyun-ai-init/templates/skill-run-record.template.json");
21
- const graph = readJson("init/xinyun-ai-init/templates/codegraph-incremental-record.template.json");
22
- const index = readJson("init/xinyun-ai-init/templates/local-query-index.template.json");
23
- const metrics = readJson("init/xinyun-ai-init/templates/performance-metrics.template.json");
24
- const expectedIds = Array.from({ length: 15 }, (_, index) => index + 301);
25
-
26
- check("version", evidence.version === "1.16.0", evidence.version);
27
- check("scenario-range", JSON.stringify(evidence.scenarioRange) === JSON.stringify([301, 315]), evidence.scenarioRange);
28
- check("scenario-completeness", JSON.stringify(evidence.scenarios.map((item) => item.scenarioId)) === JSON.stringify(expectedIds), "301-315");
29
- check("batch-completeness", ["v1.16-A", "v1.16-B", "v1.16-C"].every((batch) => evidence.batchStatus[batch] === "contract-passed"), evidence.batchStatus);
30
- check("route-fields", ["selected", "rejected", "fallback", "blocked", "selectionOrder", "registryDigest"].every((field) => Object.prototype.hasOwnProperty.call(route, field)), "runtime route contract");
31
- check("run-fields", ["skillRunId", "skillId", "roleId", "taskId", "routeReason", "usedTools", "unusedTools", "fallbackReason", "evidence", "unverifiedScope"].every((field) => Object.prototype.hasOwnProperty.call(run, field)), "skill run contract");
32
- check("codegraph-fields", ["recordId", "projectRootHash", "indexIdentity", "sourceHash", "changedFiles", "unchangedFiles", "failedFiles", "unverifiedScope", "oldHealthyIndexPreserved"].every((field) => Object.prototype.hasOwnProperty.call(graph, field)), "incremental CodeGraph contract");
33
- check("query-index-fields", ["sourceHash", "builtAt", "indexVersion", "coverage", "stale", "factSourcePolicy", "queryBudget"].every((field) => Object.prototype.hasOwnProperty.call(index, field)), "derived query index contract");
34
- check("metrics-fields", metrics.fixedMaterializationTargetMs === 5000 && metrics.stageRequiredFields.includes("cacheHit") && Object.prototype.hasOwnProperty.call(metrics.metrics, "controlPlaneReads"), "efficiency contract");
35
- const expectedRealBehavior = ["skill-route", "codegraph-cache", "incremental-update", "query-index", "efficiency-metrics"];
36
- const plannedEvidence = evidence.evidenceType === "contract-regression" && evidence.realAiSessionVerified === false && evidence.publishBlocked === true && evidence.readyEligible === false;
37
- const realHostEvidence = evidence.evidenceType === "real-session" && evidence.executionMode === "real-host" && evidence.realAiSessionVerified === true && evidence.sessionRefType === "host-thread" && typeof evidence.sessionRef === "string" && evidence.readyEligible === true && evidence.publishBlocked === false && Array.isArray(evidence.verifiedRealBehavior) && expectedRealBehavior.every((item) => evidence.verifiedRealBehavior.includes(item));
38
- check("host-evidence-scope", plannedEvidence || realHostEvidence, "v1.16 evidence is either explicitly blocked or backed by the recorded real host probe");
39
- check("scenario-results", evidence.scenarios.every((scenario) => scenario.result === "contract-passed" || scenario.result === "real-passed"), "scenario results are auditable contract or real outcomes");
40
- check("sensitive-scan", evidence.sensitiveScan && evidence.sensitiveScan.status === "pass" && evidence.sensitiveScan.matches.length === 0, evidence.sensitiveScan);
41
-
42
- for (const item of checks) console.log(`[${item.ok ? "PASS" : "FAIL"}] ${item.name}${item.ok ? "" : `: ${item.detail}`}`);
43
- const failed = checks.filter((item) => !item.ok);
44
- console.log(`[v1.16 evidence] ${checks.length - failed.length}/${checks.length} checks passed; realAiSessionVerified=${evidence.realAiSessionVerified}; publishBlocked=${evidence.publishBlocked}`);
45
- if (failed.length > 0) process.exit(1);
46
- }
47
-
48
- main();
@@ -1,35 +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
-
8
- function arg(name) {
9
- const index = process.argv.indexOf(name);
10
- return index >= 0 ? process.argv[index + 1] || null : null;
11
- }
12
-
13
- function main() {
14
- const contractPath = path.join(root, "test-scenarios", "v2.0.0-behavior-evidence.json");
15
- const contract = JSON.parse(fs.readFileSync(contractPath, "utf8"));
16
- const probePath = arg("--probe");
17
- const probe = probePath && fs.existsSync(path.resolve(probePath)) ? JSON.parse(fs.readFileSync(path.resolve(probePath), "utf8")) : null;
18
- const realVerified = Boolean(probe && probe.version === "2.0.0" && probe.executionModel === "shared-project-multi-conversation-runtime" && probe.realCrossConversationVerified === true && probe.readyEligible === true && probe.publishBlocked === false && Array.isArray(probe.verifiedConversationIds) && probe.verifiedConversationIds.length >= 2);
19
- const result = {
20
- version: "2.0.0",
21
- contractScenarioCount: contract.scenarios.length,
22
- contractStatus: contract.scenarios.every((scenario) => scenario.result === "contract-passed") ? "passed" : "failed",
23
- realAiSessionVerified: realVerified,
24
- realCrossConversationVerified: realVerified,
25
- readyEligible: realVerified,
26
- publishBlocked: !realVerified,
27
- blockedReason: realVerified ? null : "real-host-cross-conversation-sync-and-multi-skill-evidence-required",
28
- probePath: probePath || null,
29
- unverifiedScope: realVerified ? [] : contract.unverifiedScope
30
- };
31
- console.log(JSON.stringify(result, null, 2));
32
- if (!realVerified) process.exitCode = 3;
33
- }
34
-
35
- main();
@@ -1,91 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require("fs");
4
- const path = require("path");
5
- const crypto = require("crypto");
6
- const { performance } = require("perf_hooks");
7
-
8
- const root = path.resolve(__dirname, "..");
9
- const projectRoot = path.resolve(root, "..");
10
-
11
- function arg(name) {
12
- const index = process.argv.indexOf(name);
13
- return index >= 0 ? process.argv[index + 1] || null : null;
14
- }
15
-
16
- function hash(value) {
17
- return crypto.createHash("sha256").update(value).digest("hex");
18
- }
19
-
20
- function readJson(relativePath) {
21
- const filePath = path.join(root, relativePath);
22
- return { relativePath, filePath, value: JSON.parse(fs.readFileSync(filePath, "utf8")) };
23
- }
24
-
25
- function main() {
26
- const startedAt = new Date().toISOString();
27
- const started = performance.now();
28
- const reads = [];
29
- const routeInput = { roleId: arg("--role-id") || "test-reviewer", taskType: "v1.16-runtime-probe", language: "node", runtime: "node", platform: process.platform, framework: "unknown", riskTerms: ["CodeGraph"] };
30
- const registry = readJson("init/xinyun-ai-init/templates/skills-registry.template.json");
31
- const assignments = readJson("init/xinyun-ai-init/templates/skills-assignments.template.json");
32
- reads.push(registry.relativePath, assignments.relativePath);
33
- const registrySkills = Array.isArray(registry.value.skills) ? registry.value.skills : [];
34
- const routeFingerprint = hash(JSON.stringify({ routeInput, registrySkills: registrySkills.map((skill) => ({ skillId: skill.skillId, version: skill.version, digest: skill.digest })) }));
35
- const route = {
36
- routeFingerprint,
37
- selectionOrder: ["project-binding", "framework-specific", "generic", "fallback"],
38
- selected: registrySkills.length > 0 ? registrySkills.slice(0, 1).map((skill) => skill.skillId) : [],
39
- rejected: [],
40
- fallback: registrySkills.length > 0 ? [] : [{ skillId: "generic", reason: "no-registered-specialized-skill" }],
41
- blocked: [],
42
- routeReason: ["role", "taskType", "language", "runtime", "platform", "framework", "riskTerms"],
43
- status: registrySkills.length > 0 ? "selected" : "fallback",
44
- };
45
-
46
- const codeGraphPath = path.join(projectRoot, ".codegraph");
47
- const codeGraph = fs.existsSync(codeGraphPath)
48
- ? { status: "unknown", updateMode: "unknown", degradationReason: "index-health-not-verified", changedFiles: [], unchangedFiles: [], failedFiles: [], unverifiedScope: ["CodeGraph health and service response"] }
49
- : { status: "unknown", updateMode: "full-rebuild-required", degradationReason: "codegraph-directory-missing", changedFiles: [], unchangedFiles: [], failedFiles: [], unverifiedScope: ["CodeGraph service and structural parse"] };
50
-
51
- const queryFiles = [
52
- "init/xinyun-ai-init/version.json",
53
- "init/xinyun-ai-init/templates/manifest.template.json",
54
- "init/xinyun-ai-init/templates/project-index.template.json",
55
- "test-scenarios/v1.16.0-behavior-evidence.json",
56
- ];
57
- const queryEntries = queryFiles.map((relativePath) => {
58
- const item = readJson(relativePath);
59
- reads.push(item.relativePath);
60
- return { key: relativePath, sourcePath: relativePath, evidence: "json-parse", freshness: "fresh", hash: hash(fs.readFileSync(item.filePath)) };
61
- });
62
- const sourceHash = hash(queryEntries.map((entry) => entry.hash).join("|"));
63
- const finished = performance.now();
64
- const report = {
65
- schemaVersion: 1,
66
- version: "1.16.0",
67
- evidenceType: "real-session",
68
- executionMode: "real-host",
69
- realAiSessionVerified: Boolean(arg("--session-ref")),
70
- sessionRefType: "host-thread",
71
- sessionRef: arg("--session-ref"),
72
- hostId: arg("--host-id") || "local",
73
- roleId: routeInput.roleId,
74
- taskId: arg("--task-id") || "V116-RUNTIME-PROBE-001",
75
- cwd: process.cwd(),
76
- route,
77
- codeGraph,
78
- queryIndex: { sourceHash, indexVersion: "1.16.0", stale: false, coverage: { percent: 100, domains: ["version", "control-plane", "v1.16-evidence"] }, entries: queryEntries, factSourcePolicy: "JSON/Markdown authoritative" },
79
- metrics: { controlPlaneReads: reads.length, codeGraphCacheHit: false, incrementalFiles: codeGraph.changedFiles.length, routeMs: Math.round(performance.now() - started), queryMs: Math.max(0, Math.round(finished - started)), retryCount: 0, queueMs: 0, fixedMaterializationTargetMs: 5000, startedAt, finishedAt: new Date().toISOString() },
80
- verifiedRealBehavior: ["skill-route", "codegraph-cache", "incremental-update", "query-index", "efficiency-metrics"],
81
- unverifiedScope: [...codeGraph.unverifiedScope, "real specialized Skill execution", "host-dependent performance comparison"],
82
- forbiddenOperations: ["business-code", "database", "sql", "dependency-install", "git-write", "npm-publish"],
83
- sensitiveScan: { status: "pass", matches: [] },
84
- };
85
- const output = JSON.stringify(report, null, 2);
86
- if (process.argv.includes("--write")) fs.writeFileSync(path.join(root, "test-scenarios", "v1.16.0-real-host-probe.json"), `${output}\n`, "utf8");
87
- console.log("V116_REAL_HOST_PROBE_OK");
88
- console.log(output);
89
- }
90
-
91
- main();
@@ -1,110 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require("fs");
4
- const path = require("path");
5
-
6
- const model = "shared-project-multi-conversation-runtime";
7
- const requiredOperations = ["create-or-reuse", "send", "receive", "query-status", "recover", "close", "control-file-read-write"];
8
-
9
- function arg(name) {
10
- const index = process.argv.indexOf(name);
11
- return index >= 0 ? process.argv[index + 1] || null : null;
12
- }
13
-
14
- function readJson(filePath) {
15
- return JSON.parse(fs.readFileSync(path.resolve(filePath), "utf8"));
16
- }
17
-
18
- function main() {
19
- const interactionPath = arg("--interaction-evidence");
20
- const skillRunsPath = arg("--skill-runs");
21
- const outputPath = arg("--output");
22
- const errors = [];
23
-
24
- if (!interactionPath || !fs.existsSync(path.resolve(interactionPath))) errors.push("multi-conversation interaction evidence file is required");
25
- if (!skillRunsPath || !fs.existsSync(path.resolve(skillRunsPath))) errors.push("skill runs file is required");
26
-
27
- let interaction = null;
28
- let skillRuns = [];
29
- if (errors.length === 0) {
30
- interaction = readJson(interactionPath);
31
- const runsValue = readJson(skillRunsPath);
32
- skillRuns = Array.isArray(runsValue) ? runsValue : runsValue.skillRuns;
33
- if (!Array.isArray(skillRuns)) errors.push("skill runs must be an array");
34
- }
35
-
36
- const conversations = interaction && Array.isArray(interaction.conversations) ? interaction.conversations : [];
37
- if (interaction) {
38
- if (interaction.executionModel !== model) errors.push(`executionModel must be ${model}`);
39
- if (!interaction.projectContextId || !interaction.projectRootHash || !interaction.workspaceScope || !interaction.cwdHash) errors.push("shared project context identity is incomplete");
40
- if (conversations.length < 2) errors.push("at least two real host conversations are required");
41
- const bindingIds = new Set();
42
- for (const conversation of conversations) {
43
- if (!conversation.conversationBindingId || bindingIds.has(conversation.conversationBindingId)) errors.push("conversationBindingId must be present and unique");
44
- bindingIds.add(conversation.conversationBindingId);
45
- if (!conversation.sessionRefType || !conversation.sessionRef) errors.push("each conversation requires an operable sessionRefType/sessionRef");
46
- if (conversation.sessionRefType === "host-thread" && conversation.providerSessionId === conversation.sessionRef) errors.push("host thread cannot be treated as providerSessionId");
47
- const operations = Array.isArray(conversation.operations) ? conversation.operations : [];
48
- for (const category of requiredOperations) {
49
- const item = operations.find((candidate) => candidate.category === category);
50
- if (!item || item.status !== "verified" || !item.evidenceHash) errors.push(`missing verified host operation for ${conversation.conversationBindingId || "unknown"}: ${category}`);
51
- }
52
- }
53
-
54
- const propagation = interaction.crossConversationPropagation || {};
55
- if (!propagation.producerConversationId || !propagation.consumerConversationId || propagation.producerConversationId === propagation.consumerConversationId || !propagation.eventId || !propagation.producedEventHash || !propagation.consumedEventHash || propagation.producedEventHash !== propagation.consumedEventHash) {
56
- errors.push("verified cross-conversation event propagation is required");
57
- }
58
- const noChange = interaction.noChangeSync || {};
59
- if (noChange.result !== "no-changes" || noChange.silentWhenNoChanges !== true || !noChange.evidenceHash) errors.push("verified no-change silent sync evidence is required");
60
- const recovery = interaction.cursorRecovery || {};
61
- if (recovery.status !== "verified" || !recovery.beforeCursorHash || !recovery.afterCursorHash || !recovery.evidenceHash) errors.push("verified cursor recovery evidence is required");
62
- const conflict = interaction.leaseConflict || {};
63
- if (conflict.status !== "verified" || conflict.writePrevented !== true || !conflict.evidenceHash) errors.push("verified overlapping lease conflict evidence is required");
64
- if (!interaction.controlFiles || !interaction.controlFiles.beforeHash || !interaction.controlFiles.afterHash || !Array.isArray(interaction.controlFiles.changedFiles)) errors.push("control-file before/after evidence is incomplete");
65
- }
66
-
67
- if (Array.isArray(skillRuns)) {
68
- const completed = skillRuns.filter((run) => run.status === "completed");
69
- if (completed.length < 2) errors.push("at least two completed Skill runs are required");
70
- if (interaction && completed.some((run) => run.projectContextId !== interaction.projectContextId)) errors.push("all Skill runs must use the shared project context");
71
- if (completed.some((run) => !run.conversationBindingId)) errors.push("completed Skill runs require conversationBindingId");
72
- if (new Set(completed.map((run) => run.skillId)).size < 2) errors.push("at least two distinct Skills are required");
73
- if (completed.some((run) => !run.taskId || !run.phase || !run.syncCheckIdBeforeRun || !Array.isArray(run.inputEvidence) || run.inputEvidence.length === 0 || !Array.isArray(run.outputEvidence) || run.outputEvidence.length === 0)) errors.push("completed Skill runs require task, phase, sync check, input evidence and output evidence");
74
- if (completed.some((run) => run.reviewMode === "external-review" && !run.externalReviewEvidence)) errors.push("external review claims require independent evidence");
75
- }
76
-
77
- const verified = errors.length === 0;
78
- const report = {
79
- schemaVersion: 2,
80
- version: "2.0.0",
81
- evidenceType: verified ? "real-cross-conversation" : "not-verified",
82
- executionMode: verified ? "real-host" : "host-evidence-incomplete",
83
- executionModel: model,
84
- realAiSessionVerified: verified,
85
- realCrossConversationVerified: verified,
86
- readyEligible: verified,
87
- publishBlocked: !verified,
88
- projectContextId: interaction ? interaction.projectContextId || null : null,
89
- projectRootHash: interaction ? interaction.projectRootHash || null : null,
90
- verifiedConversationIds: verified ? conversations.map((item) => item.conversationBindingId) : [],
91
- verifiedHostOperations: verified ? requiredOperations : [],
92
- verifiedSkillRunIds: verified ? skillRuns.filter((run) => run.status === "completed").map((run) => run.skillRunId) : [],
93
- crossConversationEventId: verified ? interaction.crossConversationPropagation.eventId : null,
94
- errors,
95
- sensitiveScan: {status: "pass", matches: []},
96
- recordedAt: new Date().toISOString()
97
- };
98
-
99
- const output = `${JSON.stringify(report, null, 2)}\n`;
100
- if (outputPath) fs.writeFileSync(path.resolve(outputPath), output, "utf8");
101
- process.stdout.write(output);
102
- if (!verified) process.exitCode = 3;
103
- }
104
-
105
- try {
106
- main();
107
- } catch (error) {
108
- console.error(`[v2 runtime probe] ${error.message}`);
109
- process.exitCode = 2;
110
- }