pi-lens 4.4.4 → 4.4.6

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 (191) hide show
  1. package/CHANGELOG.md +477 -0
  2. package/README.md +45 -3
  3. package/config/biome/core.jsonc +3 -3
  4. package/config/dependency-cruiser-eager-allowlist.json +1 -0
  5. package/dist/{chunk-UBOQLVT2.js → chunk-2DDDCJDL.js} +4 -4
  6. package/dist/{chunk-RKKOYPRA.js → chunk-2DMLM3ZO.js} +13 -15
  7. package/dist/chunk-2F47TQOA.js +73 -0
  8. package/dist/{chunk-O4NWQT6I.js → chunk-2PHMIAKO.js} +4 -4
  9. package/dist/{chunk-DGUKIYSI.js → chunk-2RLWJO5K.js} +8 -10
  10. package/dist/{chunk-S67KYG37.js → chunk-2X4VLOCC.js} +2 -2
  11. package/dist/{chunk-TIQ2PKDW.js → chunk-3MYEA7QD.js} +4 -4
  12. package/dist/{chunk-3DA2JDOL.js → chunk-3WEPUD2V.js} +551 -203
  13. package/dist/{chunk-AMERCH6V.js → chunk-4AVZ3TG7.js} +15 -16
  14. package/dist/{chunk-IYNJ6YPZ.js → chunk-4PCQCU47.js} +4 -4
  15. package/dist/chunk-4WX4CTUE.js +57 -0
  16. package/dist/{chunk-P63GXC37.js → chunk-5APMQ2IJ.js} +31 -4
  17. package/dist/{chunk-ZIVJBOO3.js → chunk-5CV5ITZF.js} +2 -2
  18. package/dist/{chunk-6DLWKFEX.js → chunk-5ZR3APIM.js} +41 -42
  19. package/dist/{chunk-XTBDCR27.js → chunk-63RIVFQI.js} +4 -4
  20. package/dist/{chunk-GSLNCYGG.js → chunk-75SY4F24.js} +13 -14
  21. package/dist/{chunk-U44DJXQP.js → chunk-7RQXA5GG.js} +15 -18
  22. package/dist/chunk-A3YNG5KP.js +45 -0
  23. package/dist/{chunk-5OFV52AM.js → chunk-AE37FEGH.js} +1 -1
  24. package/dist/{chunk-BWD5EPKO.js → chunk-AMXIUN2R.js} +4 -6
  25. package/dist/{chunk-3KAZU3VR.js → chunk-ARD426WI.js} +2 -2
  26. package/dist/{chunk-BW5KFIQC.js → chunk-AWQWXSW4.js} +1 -0
  27. package/dist/{chunk-YH5MVY2U.js → chunk-BHUWL2Y3.js} +7 -7
  28. package/dist/{chunk-CT4MN5IU.js → chunk-BI5LAQ3Y.js} +353 -359
  29. package/dist/{chunk-KAPJINKN.js → chunk-BM5GS6ZH.js} +2 -2
  30. package/dist/{chunk-TLX72JTG.js → chunk-BWYQUPOS.js} +1 -1
  31. package/dist/chunk-CFRQMBGP.js +49 -0
  32. package/dist/{chunk-RMLC67LF.js → chunk-CJYKEW2L.js} +2 -30
  33. package/dist/chunk-CKEQFGLT.js +32 -0
  34. package/dist/{chunk-IWDLU6K3.js → chunk-DC4CFXM5.js} +4 -6
  35. package/dist/{chunk-ZVUL7QYY.js → chunk-DMSLNKF7.js} +29 -32
  36. package/dist/{chunk-KN35K52N.js → chunk-DQXSPYRI.js} +3 -3
  37. package/dist/{chunk-HYGZEMX6.js → chunk-EVDGNG4F.js} +11 -5
  38. package/dist/{chunk-SRYEJNES.js → chunk-F5Z6URKM.js} +2 -2
  39. package/dist/{chunk-UMS2MFPZ.js → chunk-F6X3YJWD.js} +2 -3
  40. package/dist/{chunk-XYURS6EN.js → chunk-FA5LDARD.js} +15 -17
  41. package/dist/{chunk-24AKHFGP.js → chunk-FFL3A2VP.js} +6 -6
  42. package/dist/chunk-FJIVKLPH.js +31 -0
  43. package/dist/chunk-G2B7F6ZU.js +88 -0
  44. package/dist/{chunk-US7ECLD7.js → chunk-GAACZY6R.js} +131 -41
  45. package/dist/{chunk-MZGQNL3Y.js → chunk-GMTFDAOK.js} +12 -13
  46. package/dist/{chunk-VOOAPROD.js → chunk-GNSIWBAT.js} +3 -3
  47. package/dist/chunk-GTAI2J6U.js +27 -0
  48. package/dist/{chunk-RVK72CZX.js → chunk-GZE7WOI4.js} +1362 -459
  49. package/dist/{chunk-IUE7SSKV.js → chunk-H7HTEQUZ.js} +13 -7
  50. package/dist/{chunk-EUXZEFTV.js → chunk-HK6JVFZC.js} +3 -3
  51. package/dist/chunk-IPDG45G5.js +26 -0
  52. package/dist/{chunk-5HSRT26B.js → chunk-J6JP25XU.js} +16 -15
  53. package/dist/{chunk-HWCCCQNX.js → chunk-JL6CXUMW.js} +13 -6
  54. package/dist/{chunk-EBC36LNN.js → chunk-K2YGBXOA.js} +17 -17
  55. package/dist/{chunk-WMYE35PX.js → chunk-KLQVC3XC.js} +7 -5
  56. package/dist/{chunk-ATKJFDQN.js → chunk-KSR7RGQY.js} +12 -14
  57. package/dist/{chunk-POMLXPMY.js → chunk-KXF5R4UN.js} +1 -1
  58. package/dist/{chunk-LLJNQKQW.js → chunk-LEJOJDXL.js} +20 -13
  59. package/dist/{chunk-JUKMK5Y4.js → chunk-MA77RSFN.js} +10 -11
  60. package/dist/{chunk-GAQ7OQG6.js → chunk-MKVZQUEG.js} +85 -96
  61. package/dist/{chunk-2EECBNC5.js → chunk-MN7MHUXQ.js} +75 -0
  62. package/dist/{chunk-DEL2U6CM.js → chunk-MT6BVNFW.js} +16 -14
  63. package/dist/chunk-NDMCVUYK.js +507 -0
  64. package/dist/{chunk-HRNHZA3N.js → chunk-NIU2IPC5.js} +12 -16
  65. package/dist/{chunk-AGSS7277.js → chunk-NNKXDXXS.js} +7 -24
  66. package/dist/{chunk-V35JG4JB.js → chunk-OJLTLYHB.js} +152 -334
  67. package/dist/{chunk-J6MPGQTS.js → chunk-OLAWH5UQ.js} +81 -15
  68. package/dist/{chunk-T57LYLZT.js → chunk-OOU2WZZE.js} +1 -1
  69. package/dist/{chunk-CYRKQRPM.js → chunk-OSTKYB55.js} +2 -4
  70. package/dist/chunk-P4QNXS6I.js +27 -0
  71. package/dist/chunk-PKES3ISE.js +297 -0
  72. package/dist/{chunk-ROYSX2S5.js → chunk-PO45POGF.js} +2 -2
  73. package/dist/{chunk-T7FEBKXN.js → chunk-PPIBVH4R.js} +7 -9
  74. package/dist/{chunk-3RKP3FMS.js → chunk-PQJFG24Z.js} +295 -23
  75. package/dist/{chunk-KUA4OJ5Y.js → chunk-Q3UZHW6N.js} +846 -350
  76. package/dist/{chunk-N5FLEO7W.js → chunk-Q4EMRFNA.js} +37 -37
  77. package/dist/{chunk-5IUSNGOC.js → chunk-Q4FCYCRE.js} +28 -21
  78. package/dist/chunk-Q6D6VMI4.js +22 -0
  79. package/dist/{chunk-UZ2XCLYS.js → chunk-QGSTQH4D.js} +8 -8
  80. package/dist/{chunk-DUO2TU77.js → chunk-RZOXUSPC.js} +10 -4
  81. package/dist/{chunk-JMYYOTQG.js → chunk-S26LC76R.js} +13 -1
  82. package/dist/{chunk-GMX5OS7B.js → chunk-S67UJDGQ.js} +11 -12
  83. package/dist/chunk-SCIUNBPF.js +44 -0
  84. package/dist/{chunk-RKBXZN3A.js → chunk-SJJYRZB4.js} +2 -2
  85. package/dist/chunk-SXGD4ANG.js +25 -0
  86. package/dist/{chunk-YCWYO6TQ.js → chunk-T7FTXGS3.js} +48 -45
  87. package/dist/{chunk-FM4RDMKT.js → chunk-TIQJPRDD.js} +115 -61
  88. package/dist/{chunk-XHJBS436.js → chunk-TIYGSODX.js} +25 -25
  89. package/dist/{chunk-S2HEXIWI.js → chunk-U2SDMG7C.js} +10 -6
  90. package/dist/{chunk-2KXTHF3M.js → chunk-U6OC3QEM.js} +253 -33
  91. package/dist/{chunk-AWSCPCN2.js → chunk-UCGQT677.js} +19 -19
  92. package/dist/chunk-UHGF5UT5.js +32 -0
  93. package/dist/{chunk-JW3YWBVB.js → chunk-UN4TEBWN.js} +17 -19
  94. package/dist/{chunk-ZHH37KZL.js → chunk-V3APN3DY.js} +17 -17
  95. package/dist/{chunk-ED36RF6Y.js → chunk-V63BC55Q.js} +1 -1
  96. package/dist/{chunk-XBJVAEEO.js → chunk-VG5JS5SW.js} +3 -2
  97. package/dist/{chunk-W66O5E25.js → chunk-VPBIMOAQ.js} +13 -15
  98. package/dist/chunk-VQH24FIP.js +37 -0
  99. package/dist/{chunk-YNE3RP52.js → chunk-VSFLRN5Y.js} +8 -1
  100. package/dist/{chunk-7D6L4MTX.js → chunk-W2V54OCL.js} +3 -3
  101. package/dist/{chunk-2FN63LPV.js → chunk-W5LGKNET.js} +13 -14
  102. package/dist/{chunk-IQWN5JCP.js → chunk-W5R5SABV.js} +13 -14
  103. package/dist/{chunk-R3T7CLQ2.js → chunk-WIZWZR4C.js} +41 -41
  104. package/dist/{chunk-TOY6QKOH.js → chunk-WQOIR3QY.js} +17 -17
  105. package/dist/{chunk-Y6GZHWSJ.js → chunk-XAIT2YGS.js} +6 -6
  106. package/dist/chunk-XCUHKYCQ.js +23 -0
  107. package/dist/{chunk-GSM5UU7A.js → chunk-XQCSWV2G.js} +44 -35
  108. package/dist/{chunk-OHKJ7PQF.js → chunk-YBSONGSZ.js} +43 -39
  109. package/dist/{chunk-GXFV6MYU.js → chunk-YISME6ON.js} +72 -39
  110. package/dist/chunk-YRD4ISED.js +30 -0
  111. package/dist/{chunk-SD4I7ZO4.js → chunk-YSBHPOY6.js} +43 -53
  112. package/dist/{chunk-QBFBRV2B.js → chunk-Z2XAOKHK.js} +4 -2
  113. package/dist/{chunk-5VSF4UUQ.js → chunk-Z7IGUAXL.js} +34 -39
  114. package/dist/{chunk-MPNJLASA.js → chunk-ZKXQKGWZ.js} +10 -13
  115. package/dist/{chunk-J64T55EI.js → chunk-ZQ6NZZTB.js} +75 -9
  116. package/dist/chunk-ZUUI3ZSA.js +38 -0
  117. package/dist/{chunk-7HXE67BN.js → chunk-ZYNI26MI.js} +2 -2
  118. package/dist/index.js +32674 -27567
  119. package/dist/mcp/analyze-cli.js +11 -12
  120. package/dist/mcp/cli.js +46 -45
  121. package/dist/mcp/server.js +1210 -574
  122. package/dist/mcp/worker.js +65 -65
  123. package/dist/probes/installer.js +21 -23
  124. package/docs/adr/0010-trace-validation-session-lifecycle.md +390 -0
  125. package/docs/adr/README.md +1 -0
  126. package/docs/agent-tools.md +28 -7
  127. package/docs/ast-grep_rules_catalog.md +5 -3
  128. package/docs/configuration.md +12 -1
  129. package/docs/defect-shapes.md +738 -0
  130. package/docs/engineering-principles.md +12 -0
  131. package/docs/environment-variables.md +20 -0
  132. package/docs/features.md +16 -1
  133. package/docs/globalconfig.md +37 -8
  134. package/docs/invariants/caches-stores.md +30 -0
  135. package/docs/invariants/dispatch-runners.md +164 -0
  136. package/docs/invariants/git-guard-host.md +53 -0
  137. package/docs/invariants/language-config.md +31 -0
  138. package/docs/invariants/lsp-trust-exec.md +286 -0
  139. package/docs/invariants/paths-os.md +59 -0
  140. package/docs/invariants/session-telemetry.md +74 -0
  141. package/docs/lsp-capability-matrix.md +105 -12
  142. package/docs/lsp-idle-eviction.md +37 -18
  143. package/docs/pi-lens-fixer.md +24 -2
  144. package/docs/pi-lens-investigator.md +14 -0
  145. package/docs/pi-lens-merge-policy.md +32 -17
  146. package/docs/pi-lens-monitor.md +66 -10
  147. package/docs/pi-lens-orchestration.md +41 -0
  148. package/docs/pi-lens-release.md +20 -0
  149. package/docs/pi-lens-retro.md +5 -4
  150. package/docs/pi-lens-reviewer.md +54 -7
  151. package/docs/pi-lens-subagent.md +10 -3
  152. package/docs/release-qa-baseline.md +19 -7
  153. package/docs/servercapabilities.md +47 -47
  154. package/docs/settings.md +9 -5
  155. package/docs/subagent-compat.md +1 -1
  156. package/docs/usage.md +1 -0
  157. package/package.json +8 -5
  158. package/rules/ast-grep-rules/rule-tests/no-return-value-in-generator-test.yml +17 -0
  159. package/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-js-test.yml +86 -0
  160. package/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-test.yml +86 -0
  161. package/rules/ast-grep-rules/rule-tests/unchecked-numeric-parse-python-test.yml +15 -0
  162. package/rules/ast-grep-rules/rules/no-return-value-in-generator.yml +9 -4
  163. package/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +119 -0
  164. package/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +119 -0
  165. package/rules/ast-grep-rules/rules/unchecked-numeric-parse-python.yml +13 -2
  166. package/rules/rule-catalog.json +25 -1
  167. package/scripts/analyze-pi-lens-logs.mjs +15 -5
  168. package/scripts/lib/is-main-module.mjs +27 -0
  169. package/scripts/lib/scratch-home-env.mjs +21 -0
  170. package/scripts/rpc-load-check.mjs +4 -6
  171. package/scripts/warm-loader-cache.mjs +2 -5
  172. package/dist/chunk-3PTHXJXR.js +0 -28
  173. package/dist/chunk-3QED2P4V.js +0 -31
  174. package/dist/chunk-5WRPDP2A.js +0 -47
  175. package/dist/chunk-ABBOA7UD.js +0 -157
  176. package/dist/chunk-CUHSHSB6.js +0 -273
  177. package/dist/chunk-GL5LUMZE.js +0 -51
  178. package/dist/chunk-HAD7QRQI.js +0 -30
  179. package/dist/chunk-JORED7EX.js +0 -44
  180. package/dist/chunk-KYUB6QDC.js +0 -72
  181. package/dist/chunk-LZSEQW6A.js +0 -57
  182. package/dist/chunk-M2IFVFWU.js +0 -79
  183. package/dist/chunk-M2UD3LPU.js +0 -88
  184. package/dist/chunk-MBKQHGA7.js +0 -39
  185. package/dist/chunk-R7YOCSNV.js +0 -23
  186. package/dist/chunk-SKAMFC7A.js +0 -28
  187. package/dist/chunk-SYE6T2EB.js +0 -28
  188. package/dist/chunk-TRETHTQO.js +0 -26
  189. package/dist/chunk-UA7ZXYDR.js +0 -184
  190. package/dist/chunk-XTFDJI3T.js +0 -24
  191. package/dist/chunk-Z3CCVDUB.js +0 -76
@@ -2,83 +2,83 @@
2
2
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
3
3
  import {
4
4
  analyzeFile
5
- } from "../chunk-CT4MN5IU.js";
6
- import "../chunk-UBOQLVT2.js";
7
- import "../chunk-5OFV52AM.js";
8
- import "../chunk-RKBXZN3A.js";
9
- import "../chunk-6HWVI6MI.js";
10
- import "../chunk-S67KYG37.js";
11
- import "../chunk-KN35K52N.js";
12
- import "../chunk-ROYSX2S5.js";
13
- import "../chunk-YH5MVY2U.js";
14
- import "../chunk-ED36RF6Y.js";
15
- import "../chunk-BWD5EPKO.js";
16
- import "../chunk-TIQ2PKDW.js";
17
- import "../chunk-EBC36LNN.js";
18
- import "../chunk-HYGZEMX6.js";
19
- import "../chunk-UZ2XCLYS.js";
20
- import "../chunk-ZHH37KZL.js";
21
- import "../chunk-Y6GZHWSJ.js";
22
- import "../chunk-IYNJ6YPZ.js";
23
- import "../chunk-EUXZEFTV.js";
24
- import "../chunk-T57LYLZT.js";
25
- import "../chunk-XHJBS436.js";
5
+ } from "../chunk-BI5LAQ3Y.js";
6
+ import "../chunk-2DDDCJDL.js";
7
+ import "../chunk-AE37FEGH.js";
8
+ import "../chunk-SJJYRZB4.js";
9
+ import "../chunk-2X4VLOCC.js";
10
+ import "../chunk-DQXSPYRI.js";
11
+ import "../chunk-PO45POGF.js";
12
+ import "../chunk-BHUWL2Y3.js";
13
+ import "../chunk-V63BC55Q.js";
14
+ import "../chunk-AMXIUN2R.js";
15
+ import "../chunk-3MYEA7QD.js";
16
+ import "../chunk-K2YGBXOA.js";
17
+ import "../chunk-EVDGNG4F.js";
18
+ import "../chunk-QGSTQH4D.js";
19
+ import "../chunk-V3APN3DY.js";
20
+ import "../chunk-XAIT2YGS.js";
21
+ import "../chunk-4PCQCU47.js";
22
+ import "../chunk-HK6JVFZC.js";
23
+ import "../chunk-OOU2WZZE.js";
24
+ import "../chunk-TIYGSODX.js";
26
25
  import "../chunk-3MED75HT.js";
27
- import "../chunk-RVK72CZX.js";
28
- import "../chunk-IWDLU6K3.js";
26
+ import "../chunk-GZE7WOI4.js";
27
+ import "../chunk-DC4CFXM5.js";
29
28
  import "../chunk-XIMYZ3JA.js";
30
- import "../chunk-3DA2JDOL.js";
31
- import "../chunk-HWCCCQNX.js";
32
- import "../chunk-CUHSHSB6.js";
33
- import "../chunk-UA7ZXYDR.js";
34
- import "../chunk-T7FEBKXN.js";
35
- import "../chunk-SRYEJNES.js";
29
+ import "../chunk-3WEPUD2V.js";
30
+ import "../chunk-JL6CXUMW.js";
31
+ import "../chunk-NDMCVUYK.js";
32
+ import "../chunk-PPIBVH4R.js";
33
+ import "../chunk-F5Z6URKM.js";
36
34
  import "../chunk-5W3R6LFT.js";
37
- import "../chunk-V35JG4JB.js";
38
- import "../chunk-XTBDCR27.js";
39
- import "../chunk-MPNJLASA.js";
40
- import "../chunk-US7ECLD7.js";
35
+ import "../chunk-OJLTLYHB.js";
36
+ import "../chunk-63RIVFQI.js";
37
+ import "../chunk-PKES3ISE.js";
38
+ import "../chunk-ZKXQKGWZ.js";
39
+ import "../chunk-GAACZY6R.js";
41
40
  import "../chunk-Z54ZSOBZ.js";
42
- import "../chunk-GXFV6MYU.js";
43
- import "../chunk-FM4RDMKT.js";
44
- import "../chunk-RMLC67LF.js";
45
- import "../chunk-W66O5E25.js";
46
- import "../chunk-7HXE67BN.js";
47
- import "../chunk-Z3CCVDUB.js";
48
- import "../chunk-KAPJINKN.js";
49
- import "../chunk-AGSS7277.js";
41
+ import "../chunk-ZUUI3ZSA.js";
42
+ import "../chunk-TIQJPRDD.js";
43
+ import "../chunk-YISME6ON.js";
44
+ import "../chunk-6HWVI6MI.js";
45
+ import "../chunk-UHGF5UT5.js";
46
+ import "../chunk-CKEQFGLT.js";
47
+ import "../chunk-CJYKEW2L.js";
48
+ import "../chunk-VPBIMOAQ.js";
49
+ import "../chunk-ZYNI26MI.js";
50
+ import "../chunk-BM5GS6ZH.js";
51
+ import "../chunk-NNKXDXXS.js";
50
52
  import "../chunk-2BEMIWEW.js";
51
53
  import "../chunk-IJYGIDF4.js";
52
- import "../chunk-GAQ7OQG6.js";
53
- import "../chunk-DEL2U6CM.js";
54
- import "../chunk-5VSF4UUQ.js";
55
- import "../chunk-3KAZU3VR.js";
56
- import "../chunk-P63GXC37.js";
57
- import "../chunk-HRNHZA3N.js";
58
- import "../chunk-TLX72JTG.js";
59
- import "../chunk-DGUKIYSI.js";
60
- import "../chunk-XBJVAEEO.js";
61
- import "../chunk-KUA4OJ5Y.js";
62
- import "../chunk-BW5KFIQC.js";
54
+ import "../chunk-MKVZQUEG.js";
55
+ import "../chunk-MT6BVNFW.js";
56
+ import "../chunk-Z7IGUAXL.js";
57
+ import "../chunk-ARD426WI.js";
58
+ import "../chunk-5APMQ2IJ.js";
59
+ import "../chunk-NIU2IPC5.js";
60
+ import "../chunk-BWYQUPOS.js";
61
+ import "../chunk-2RLWJO5K.js";
62
+ import "../chunk-VG5JS5SW.js";
63
+ import "../chunk-Q3UZHW6N.js";
64
+ import "../chunk-AWQWXSW4.js";
63
65
  import "../chunk-QYF5S6P6.js";
64
- import "../chunk-DUO2TU77.js";
65
- import "../chunk-J6MPGQTS.js";
66
- import "../chunk-5HSRT26B.js";
66
+ import "../chunk-RZOXUSPC.js";
67
+ import "../chunk-OLAWH5UQ.js";
68
+ import "../chunk-J6JP25XU.js";
67
69
  import {
68
70
  setProjectTrustState
69
- } from "../chunk-M2IFVFWU.js";
70
- import "../chunk-2EECBNC5.js";
71
- import "../chunk-J64T55EI.js";
71
+ } from "../chunk-MN7MHUXQ.js";
72
+ import "../chunk-ZQ6NZZTB.js";
72
73
  import {
73
74
  logExtension
74
- } from "../chunk-POMLXPMY.js";
75
- import "../chunk-JMYYOTQG.js";
76
- import "../chunk-QBFBRV2B.js";
77
- import "../chunk-YNE3RP52.js";
75
+ } from "../chunk-KXF5R4UN.js";
76
+ import "../chunk-S26LC76R.js";
77
+ import "../chunk-Z2XAOKHK.js";
78
+ import "../chunk-VSFLRN5Y.js";
78
79
  import "../chunk-LJDODBBZ.js";
79
- import "../chunk-CYRKQRPM.js";
80
- import "../chunk-ABBOA7UD.js";
81
- import "../chunk-3RKP3FMS.js";
80
+ import "../chunk-OSTKYB55.js";
81
+ import "../chunk-PQJFG24Z.js";
82
82
  import "../chunk-NXL4FFQQ.js";
83
83
 
84
84
  // dist/mcp/worker.js
@@ -53,31 +53,29 @@ import {
53
53
  verifyNpmPackageEntry,
54
54
  verifyToolBinary,
55
55
  wasLastResolveTransient
56
- } from "../chunk-GAQ7OQG6.js";
57
- import "../chunk-DEL2U6CM.js";
58
- import "../chunk-5VSF4UUQ.js";
59
- import "../chunk-3KAZU3VR.js";
60
- import "../chunk-P63GXC37.js";
61
- import "../chunk-HRNHZA3N.js";
62
- import "../chunk-TLX72JTG.js";
63
- import "../chunk-DGUKIYSI.js";
64
- import "../chunk-XBJVAEEO.js";
65
- import "../chunk-KUA4OJ5Y.js";
66
- import "../chunk-BW5KFIQC.js";
56
+ } from "../chunk-MKVZQUEG.js";
57
+ import "../chunk-MT6BVNFW.js";
58
+ import "../chunk-Z7IGUAXL.js";
59
+ import "../chunk-ARD426WI.js";
60
+ import "../chunk-5APMQ2IJ.js";
61
+ import "../chunk-NIU2IPC5.js";
62
+ import "../chunk-BWYQUPOS.js";
63
+ import "../chunk-2RLWJO5K.js";
64
+ import "../chunk-VG5JS5SW.js";
65
+ import "../chunk-Q3UZHW6N.js";
66
+ import "../chunk-AWQWXSW4.js";
67
67
  import "../chunk-QYF5S6P6.js";
68
- import "../chunk-DUO2TU77.js";
69
- import "../chunk-J6MPGQTS.js";
70
- import "../chunk-5HSRT26B.js";
71
- import "../chunk-M2IFVFWU.js";
72
- import "../chunk-2EECBNC5.js";
73
- import "../chunk-J64T55EI.js";
74
- import "../chunk-POMLXPMY.js";
75
- import "../chunk-JMYYOTQG.js";
76
- import "../chunk-QBFBRV2B.js";
77
- import "../chunk-YNE3RP52.js";
68
+ import "../chunk-RZOXUSPC.js";
69
+ import "../chunk-OLAWH5UQ.js";
70
+ import "../chunk-J6JP25XU.js";
71
+ import "../chunk-MN7MHUXQ.js";
72
+ import "../chunk-ZQ6NZZTB.js";
73
+ import "../chunk-KXF5R4UN.js";
74
+ import "../chunk-S26LC76R.js";
75
+ import "../chunk-Z2XAOKHK.js";
76
+ import "../chunk-VSFLRN5Y.js";
78
77
  import "../chunk-LJDODBBZ.js";
79
- import "../chunk-ABBOA7UD.js";
80
- import "../chunk-3RKP3FMS.js";
78
+ import "../chunk-PQJFG24Z.js";
81
79
  import "../chunk-NXL4FFQQ.js";
82
80
  export {
83
81
  GITHUB_TOOLS,
@@ -0,0 +1,390 @@
1
+ # ADR 0010: trace validation for the session-lifecycle model (pilot)
2
+
3
+ ## Status
4
+
5
+ Accepted — 2026-10-25 (maintainer). The rollout is #4834: the CI job starts advisory and becomes required after a clean window; later slices follow section 11.
6
+
7
+ ## Context
8
+
9
+ Nothing binds a TLA+ model to the TypeScript it models. `TLA+ models` runs only
10
+ when a diff touches `formal/` or the checker (`.github/workflows/ci.yml:250`),
11
+ and `tests/clients/dispatch-pipeline-formal.test.ts` replays old counterexamples
12
+ only. Two drifts surfaced in one week, both found by a human:
13
+
14
+ - #4782's model never emptied its cache, so #4785's `answerStored` guard was
15
+ vacuous in the spec (fixed in PR #4820).
16
+ - #4815: a detached startup continuation read a stale host ctx after a reload.
17
+ The session models had no step in which work outlives its session and then
18
+ touches the host (fixed in PR #4818).
19
+
20
+ #3533 asks for the one mechanism that can catch this class: check what a real
21
+ run did against the spec. The scope fixed on the issue (2026-10-21): pick one
22
+ pilot family, choose between recording real sequences and generating tests from
23
+ TLC traces, state the per-PR and nightly cost, and measure it.
24
+
25
+ Related: #4632 (the real-pi harness lifecycle tests), #4709 (removing the
26
+ in-process mocks of seam-backed modules), #4815, #4782.
27
+
28
+ ## Decision
29
+
30
+ ### 1. Pilot family: `formal/session-lifecycle`
31
+
32
+ It is the most churned identity seam (132 configs; the other session families
33
+ compose onto it), its as-built config is `Merged.cfg`, and its host transitions
34
+ are already logged by production code. `SessionLifecycle.tla` is 2 088 lines
35
+ with a 40-disjunct `Next`.
36
+
37
+ ### 2. Direction: record real sequences, check them against `Next`
38
+
39
+ Not "generate tests from TLC traces". Measured on `Merged.cfg` (the smallest
40
+ as-built config that covers every host transition): 11 116 distinct states,
41
+ 17 379 generated transitions, search depth 11, 2.1 s of TLC. Covering the
42
+ transitions with generated real-pi scenarios needs at least 17 379 / 11 = 1 580
43
+ scenarios (arithmetic, not a measurement), at 3.3 to 4.6 s per scenario of the
44
+ real lifecycle witness: 1.4 hours at the lower bound, before the driver exists.
45
+ Of `Next`'s 40 disjuncts the RPC harness can drive about five (new, resume,
46
+ clone, reload, quit); the rest (interrupted starts, marker expiry, duplicate
47
+ starts, writer landings) have no RPC. Generation also tests the model against
48
+ itself: it adds no evidence about what the code does between the steps.
49
+
50
+ Recording needs no driver: the real tests already do the interesting
51
+ sequences, and the check says whether the model could have produced them.
52
+ Its limit is the corpus: it covers what tests do, not what the model allows.
53
+ That limit is the right split. The model checker owns "all behaviours satisfy
54
+ the invariants"; trace validation owns "the real behaviours are among them".
55
+
56
+ ### 3. Trace source and the mock rule
57
+
58
+ Record only from tests that do not mock the modelled seam. A trace taken
59
+ through a `vi.mock` records the mock. For the pilot:
60
+
61
+ | Test | Seam unmocked? | Use |
62
+ |---|---|---|
63
+ | `tests/real-harness/lifecycle.test.ts` "drives startup, reload, new, resume, fork, and quit" | yes: real pi, built extension | recorded (fixture below) |
64
+ | `tests/real-harness/bridge-reload.test.ts`, `bridge-reload-ts.test.ts` | yes | reload-only traces; the recorder is one call, not wired (no new evidence) |
65
+ | `tests/clients/runtime-session-stale-ctx-scans-4815.test.ts` | no: the host ctx and the bootstrap seam are doubled | not recorded. A trace from it records the double. Listed for #4709: a real-pi test that holds the analyzer bootstrap await open while a reload lands needs a gate in product code, which is the hook cost in section 11 |
66
+
67
+ Other in-process session tests (tier 2, `index-*.test.ts`) were not audited.
68
+
69
+ ### 4. Event schema
70
+
71
+ One event per spec action, from the rows production already writes.
72
+ `logScopeTransition` (`clients/session-scope.ts:306`) logs a
73
+ `session_scope_transition` row per scope start, retire, branch move, supersede
74
+ and demote, with `transition`, `reason`, `scopeId`, `parentScopeId`, `role`,
75
+ `branchEpoch`, `sessionId`, `coordinatorId` and `handoffSource`. The pilot needs
76
+ **no production hook**; the test-only recorder (`tests/support/trace-recorder.ts`,
77
+ off unless `REAL_PI_HARNESS_TRACE_DIR` is set) writes `{phase, pid, metadata}`
78
+ of those rows, without the cwd path a raw row carries.
79
+
80
+ | Row | Event | Spec action | What the check compares |
81
+ |---|---|---|---|
82
+ | `end:superseded` of a scope with no start row | none | outside the model | admitted only when no start of that scope exists; the scope id is then a known construction scope |
83
+ | first `start:startup` | none | `Init` (scope 1, primary, file `A`) | role primary, epoch 0 |
84
+ | `shutdown:<r>` primary | `retire(r, scope)` | `Retire(r)` | the live primary is that scope; `pend.k = r`; `why[scope] = r` |
85
+ | `start:<r>` primary | `begin(r, scope, parent, src, sameAs)` | `Begin` | the row carries a `handoffSource` in `slot`, `own-sidecar`, `parent-sidecar`, `none` and a safe-integer `parentScopeId` naming a started scope or a seen construction scope (otherwise the trace is refused); role; `predOf` equals the parent when it is a started scope; `handoffSource = slot` iff the step took the slot (`taken` grew); `sess` equal to a prior scope's iff the session ids are equal |
86
+ | anything else | refuses the trace | none | `tree`, `demote`, any secondary, an end of a started scope, a second startup, an unknown reason |
87
+
88
+ Real scope ids map to model tickets in order of start. `parentScopeId` is
89
+ coordinator-local: pi's jiti load re-creates the coordinator on `/reload`, and
90
+ the successor's parent is then its own construction scope (probed with
91
+ `bridge-reload-ts`'s entry, 2026-10-24), so a parent that is a seen construction scope checks nothing; any other unstarted or absent parent is refused.
92
+ `session_before_fork` is not a row; the generated module lets one hidden
93
+ `BeforeFork` step precede a fork or clone retire. pi sends `fork` for `/clone`,
94
+ so `clone` never appears in rows.
95
+
96
+ ### 5. Checker: TLC with the trace as a constraint
97
+
98
+ The generated `TraceSessionLifecycle` module `EXTENDS SessionLifecycle` and
99
+ steps the unchanged `Next` once per event, keeping only successors the
100
+ observation predicate `Obs` accepts. The trace is producible exactly when TLC
101
+ reports the invariant `NotDone == ti < Len(TR)` violated. `Obs` is the only
102
+ per-family TLA+ (15 lines); the extractor is the only per-family JS. Constants
103
+ are `Merged.cfg`'s own text with `Writers = {}` and `MaxSteps` sized to the
104
+ trace, so `formal/switch-pins.json` and its pin test cover them and no second
105
+ copy of the as-built switches exists.
106
+ `Writers = {}` is a consequence of the design, not a convenience. `Obs` is
107
+ checked against `Next` per event with no interleaving: between two events the
108
+ model can only stutter or take the hidden before-fork step. That makes the check
109
+ tight per event, and it means store writers are not merely unavailable. A
110
+ writer step between two events is a transition no row accounts for, so the
111
+ pilot cannot model one until rows carry writes (section 11).
112
+
113
+ Rejected: a per-spec JS replayer. It is a second implementation of a 40-way
114
+ next-state relation over 60 variables; every model edit would need the same
115
+ edit there, and its own drift from the spec is the problem being solved,
116
+ moved. TLC reuses `Next` as is. The price is a JVM per trace (section 9) and
117
+ that the job needs Java; the checker already pins and checksums `tla2tools.jar`
118
+ (`ensureJar`, now exported from `scripts/check-tla-models.mjs`).
119
+
120
+ ### 6. How a non-producible trace fails CI
121
+
122
+ `node scripts/trace-validate-session-lifecycle.mjs --rows <file>` prints one
123
+ line per process and exits non-zero on any of:
124
+
125
+ - `FAIL … not-producible (first unmatched event: N, <event>)`, exit 1: the
126
+ model has no step matching event N;
127
+ - `UNCHECKED … <row>: <why>`, exit 2: a row outside the admitted forms, never
128
+ skipped (principles: gates fail closed);
129
+ - `UNCHECKED <file>: <why>`, exit 2: the file holds no `session_scope_transition`
130
+ rows (empty, another phase, a renamed phase literal), no events, or
131
+ unparseable JSON. An empty population never passes, also under
132
+ `--expect not-producible`; an unknown event kind is an `UNCHECKED` trace;
133
+ - `UNCHECKED <label>: <why>`, exit 2, when the jar is missing or fails its
134
+ checksum (round 1 exited 1 with a stack for both). All output, the usage line
135
+ included, goes to stdout;
136
+ - `error (<why>)`, exit 2: TLC did not decide, or the trace is outside the
137
+ model's bounds. `RetireOk` allows each retire reason once per behaviour
138
+ (`k \notin used`, `SessionLifecycle.tla:646`), so a second `/reload` is
139
+ reported as unsupported, not as drift.
140
+
141
+ The remedy has two branches and no third: fix the code, or extend the model
142
+ under the TLA+ rule in `AGENTS.md`. There is no allowlist; an exemption would
143
+ be the next finding. During the pilot the job should be advisory, like the
144
+ `Hot-path latency (advisory)` lane, and become required after a clean window
145
+ (a rollout decision).
146
+
147
+ ### 7. State table: the identities of the seam
148
+
149
+ Read from `clients/session-scope.ts`, `clients/runtime-coordinator.ts` and
150
+ `clients/session-event-guard.ts`.
151
+
152
+ | Identity | Minted by | Valid for | Ends at | In the rows | In the model |
153
+ |---|---|---|---|---|---|
154
+ | session id | pi's session manager | one conversation file; unchanged by `/reload`; new on `/new` and fork; `resume` returns an old one | never | `sessionId` | `sess[t]` (file letter) |
155
+ | scope ticket = generation | `beginScope` from the process counter, at coordinator construction and at each `resetForSession` | the process; never reused | `retireScope` at shutdown or when the coordinator begins the next scope | `scopeId`, `parentScopeId`, `coordinatorId` | `st[t]`, `predOf[t]`, `nxt`, `primary`, `last` |
156
+ | branch epoch | `moveBranch` on `/tree` | one scope | `/tree` | `branchEpoch` | `ep[t]` |
157
+ | ctx liveness | the pi SDK: a captured ctx is valid until `newSession`, `fork`, `switchSession` or `reload` replaces the session | one host binding | the host's replacement, which can precede the successor's scope | no row; `extension-ctx-stale` appears only on the skip path | none (`LastMemberOwnership.tla` reads it for sibling teardown only) |
158
+
159
+ `sessionGeneration` is the scope ticket (`clients/runtime-coordinator.ts:1446`);
160
+ `isCurrentSession(generation)` is ticket equality and scope liveness
161
+ (`:1464`). It never reads ctx liveness, and ctx staleness is found by message
162
+ (`isStaleExtensionCtxError`), not by comparing identities. PR #4818's review
163
+ probes record the two as independent in reachable interleavings: P3 (stale ctx,
164
+ generation not bumped) and P4 (live ctx, bumped generation). That is why a
165
+ continuation step needs its own ctx-liveness variable and cannot be derived
166
+ from `st[t]`.
167
+
168
+ Writers by axis (who, which identity, when):
169
+
170
+ | Actor | Identity it holds | Timing | Modelled |
171
+ |---|---|---|---|
172
+ | `session_start` handler | the new scope, drawn by `resetForSession` | sync reset, then awaits | `Begin` |
173
+ | `session_shutdown` handler | the live primary | sync | `Retire` |
174
+ | store writer | a `LineageHandle` captured at hook entry | lands at any later step | `WriterBegin`, `Land*` (fenced) |
175
+ | detached continuation (`void (async …)`, timers) | a captured scope, plus the ctx it closes over | after one or more awaits; can outlive both | **no action** |
176
+ | pi host | invalidates the ctx | at replacement | not a variable |
177
+
178
+ The last two rows are the #4815 gap: the model has writers that outlive their
179
+ scope but no step that reads the host after the scope is gone.
180
+
181
+ ### 8. Acceptance case: the #4815 interleaving
182
+
183
+ Checked 2026-10-24 (fixtures `reload-no-continuation.events.json` and
184
+ `reload-ctx-continuation-4815.events.json`, transcript in the appendix):
185
+
186
+ - Transitions only (start, `shutdown:reload`, `start:reload`): **producible**.
187
+ The spec reaches the interleaving; `InterruptAt` already models a reload that
188
+ lands while a start is in flight. The rows of the buggy and the fixed code are
189
+ identical. The model did not forbid #4815; it had nowhere to say it.
190
+ - With the continuation event (`a: continue`, effect `ctx-read`, on the retired
191
+ scope): **not producible, first unmatched event 3**. `Obs` has no disjunct for
192
+ it because `SessionLifecycle` has no action that reads host ctx, so the
193
+ refusal is by vocabulary. That is the point of one event per spec action: an
194
+ event the spec cannot name is a missing step, not a pass.
195
+
196
+ This trace is **hand-authored in the event schema, not recorded**. A reload
197
+ cannot be landed deterministically inside the analyzer bootstrap await from the
198
+ real harness (the window is one await wide), and the in-process #4815 test
199
+ doubles the very seam under test. Closing the gap is model work for the
200
+ rollout: add a `Continue` action with a ctx-liveness variable and the invariant
201
+ that a continuation on a retired scope skips and records, then the same trace is
202
+ producible for the fixed code and refused for the pre-#4818 behaviour.
203
+
204
+ ### 9. Measured cost
205
+
206
+ Host: 32 cores, load average 17 to 31 from other lanes; wall seconds, not
207
+ isolated. TLC 1.7.4, JRE 21.0.12, one worker. Raw output is in the appendix.
208
+
209
+ | Quantity | Result |
210
+ |---|---|
211
+ | One trace, check only (n = 10) | 0.79 to 0.98 s wall; 1.05 to 1.31 s in later runs at load 31 |
212
+ | JVM + SANY floor (trivial module, n = 3) | 0.69 to 0.78 s |
213
+ | 3 events vs 9 events | no difference (0.88 to 0.99 s for 9): the JVM is the cost |
214
+ | The CLI, two traces in sequence | 1.81 s wall, 4.27 s user, 323 MB max RSS |
215
+ | The real lifecycle witness (existing test) | 3.6 to 4.6 s wall. Recording adds one JSON write: on 3.58 to 4.00 s (n = 3) against off 4.57 s (n = 1); at load 31, off 7.2 to 8.6 s (n = 3) against on 6.1 to 6.3 s (n = 3), so the spread is host noise, not the recorder |
216
+ | Whole real-harness suites registered in the pre-push route | 105 s of CI time (`scripts/pre-push-targeted-tests.mjs`) |
217
+ | Existing `TLA+ models` shards, run only on a `formal/` diff | 274 to 599 s per shard, 4 shards (run 40129286694) |
218
+ | Existing `Unit tests` shards | 392 to 514 s |
219
+
220
+ Per-PR versus nightly:
221
+
222
+ - **Per PR, advisory first.** The pilot's whole check is about 2 s of TLC for
223
+ the two recorded processes, about 4 s if the two reload-only bridge tests are
224
+ wired too.
225
+ It needs a recorded-rows artifact from the `Unit tests` shard that holds
226
+ `lifecycle.test.ts` and a small job with Java; the plumbing, not the TLC time,
227
+ is the cost. Gate it on the same classification that gates `TLA+ models`,
228
+ extended to the coverage-map rows of the family
229
+ (`clients/session-scope.ts`, `index.ts` lifecycle handlers).
230
+ - **Nightly** for the full real-harness corpus and for any family added later,
231
+ where traces are longer and more numerous. One JVM per trace is wasteful at
232
+ that point; check a set of traces per JVM then.
233
+ - The test lane stays hermetic. It does not carry the jar, so the TLC verdict
234
+ is not asserted in a vitest file; `tests/scripts/trace-validate-session-lifecycle.test.ts`
235
+ covers what decides WHAT TLC is asked (extraction, fail-closed rows, rendering,
236
+ config derivation, verdict parsing).
237
+
238
+ ### 10. Planted drift: the check goes red
239
+
240
+ | Plant | Existing behaviour witness | Trace check |
241
+ |---|---|---|
242
+ | Code: `SOURCES.fork` in `clients/session-scope.ts` loses `"slot"` (a fork adopts the parent sidecar only) | `lifecycle.test.ts` **passes** (1 passed): sidecar and slot carry equal state there | `FAIL … pid …: not-producible (first unmatched event: 2, begin fork … src other)`, exit 1 |
243
+ | Spec: `SlotReasons == {"fork"}` (the model stops handing off on `/reload`) | not applicable | `FAIL … not-producible (first unmatched event: 2, begin reload … src slot)` on the reload process; the fork process stays `ok` |
244
+ | Events: the reload start's `src` flipped to `other` (probe edit, not committed) | not applicable | `not-producible (first unmatched event: 2, begin reload)` |
245
+ | A second `/reload` in one trace | not applicable | `error (repeated retire reason "reload": the model allows each reason once per behaviour)` |
246
+
247
+ Both drifts are restored; the transcripts are in the appendix.
248
+
249
+ ### 11. What the pilot does not do (the rollout issue's scope)
250
+
251
+ Named, not built (principles: speculative robustness needs buy-in):
252
+
253
+ - **The CI job**, its artifact hand-off, its path gate and the advisory-to-
254
+ required decision.
255
+ - **Batching** several traces per JVM.
256
+ - **The full hook.** Rows carry transitions only. Not observed: store writers
257
+ landing (53 `guardedWrite(` call sites in 10 files, so a hook there is a
258
+ per-site edit or one choke point in `generation-guard.ts`), `session_before_fork`,
259
+ `/tree` with its branch contents (`Tree` needs a two-entry branch the rows do
260
+ not carry), subagent and secondary scopes, `Dup`/`Interrupt`, and detached
261
+ continuations (12 `void (async` sites). Each is a production emit behind a
262
+ bounded record, and needs its spec action first.
263
+ - **Bound relaxation.** `used` and `steps < MaxSteps` are state-space devices;
264
+ traces of production length need a trace-mode switch in the spec.
265
+ - **More families.** Each family needs its own extractor and `Obs`.
266
+ - **A model `Continue` step** for #4815 (section 8).
267
+ - **Resume of a non-startup session.** The model hardcodes `resume -> "A"`
268
+ (`TargetOf`, `SessionLifecycle.tla:642`; `Init` has `sess[1] = "A"`), and
269
+ `RetireOk` refuses a resume from a primary already in `A`. A recorded resume
270
+ is therefore checked only against the process's startup session. The
271
+ extractor maps the resumed session id to the earlier scopes with the same
272
+ id (`sameAs`): the startup scope's ticket for the startup session, which the
273
+ model can produce; no ticket for a session not seen before in the process
274
+ (empty `sameAs`); and that scope's own ticket, not the startup one, for a
275
+ non-startup session seen earlier. The model cannot produce the last two.
276
+ Pinned in `tests/scripts/trace-validate-session-lifecycle.test.ts`;
277
+ extending the model to resume arbitrary sessions is the rollout issue's call.
278
+ - **Store content.** `Obs` compares role, lineage, hand-off source and session
279
+ identity. It does not compare facts in the read guard, the turn counter, or
280
+ the advisory queue; content drift stays with the invariants and unit tests.
281
+
282
+ ## Consequences
283
+
284
+ - Drift in the transition structure of `session-lifecycle` (who hands off to
285
+ whom, which session continues which) is caught from tests that already run,
286
+ for about one second per trace and no production behaviour change.
287
+ - The check is only as wide as the event vocabulary. A step the spec cannot
288
+ name is refused, which turns each "the model had no word for it" finding into
289
+ a loud red instead of a human verify. It also means the first rollout PRs
290
+ are model PRs.
291
+ - The corpus decides coverage. A transition no test drives is never checked.
292
+ - The pilot adds one JS module (`scripts/trace-validate-session-lifecycle.mjs`
293
+ with its `.d.mts`), one test-only recorder (`tests/support/trace-recorder.ts`),
294
+ an `export` on `ensureJar` and one recorder call in `lifecycle.test.ts`; no
295
+ product file changes.
296
+
297
+ ## Links
298
+
299
+ - Issue: #3533 (maintainer scope, 2026-10-21).
300
+ - Evidence for the premise: #4782, #4785, PR #4820, #4815, PR #4818.
301
+ - Real-harness lane: #4632, `docs/real-harness.md`. Mock removal: #4709.
302
+ - Model: `formal/session-lifecycle/` (`README.md`, `Merged.cfg`),
303
+ `formal/switch-pins.json`.
304
+ - Code: `clients/session-scope.ts` (`logScopeTransition`),
305
+ `clients/runtime-coordinator.ts` (`isCurrentSession`),
306
+ `clients/session-event-guard.ts` (`isStaleExtensionCtxError`).
307
+ - Pilot: `scripts/trace-validate-session-lifecycle.mjs`,
308
+ `tests/support/trace-recorder.ts`, `tests/fixtures/trace-validation/session-lifecycle/`.
309
+
310
+ ## Appendix: raw output (2026-10-24)
311
+
312
+ Record one trace (the existing witness, recorder on):
313
+
314
+ ```text
315
+ $ REAL_PI_HARNESS_TRACE_DIR=<dir> vitest run tests/real-harness/lifecycle.test.ts --project real-harness -t "drives startup"
316
+ record run 1: 4.00 s wall, 5.33 s user
317
+ record run 2: 3.58 s wall, 4.86 s user
318
+ record run 3: 3.69 s wall, 4.92 s user
319
+ ```
320
+
321
+ Check it (five runs, two processes each):
322
+
323
+ ```text
324
+ $ node scripts/trace-validate-session-lifecycle.mjs --rows lifecycle-drive.rows.json --jar tla2tools.jar
325
+ ok …/lifecycle-drive.rows.json pid 1444401: producible, 5 events, 0.94s
326
+ ok …/lifecycle-drive.rows.json pid 1444894: producible, 3 events, 0.95s
327
+ ok …/lifecycle-drive.rows.json pid 1444401: producible, 5 events, 0.98s
328
+ ok …/lifecycle-drive.rows.json pid 1444894: producible, 3 events, 0.89s
329
+ ok …/lifecycle-drive.rows.json pid 1444401: producible, 5 events, 0.88s
330
+ ok …/lifecycle-drive.rows.json pid 1444894: producible, 3 events, 0.86s
331
+ ok …/lifecycle-drive.rows.json pid 1444401: producible, 5 events, 0.85s
332
+ ok …/lifecycle-drive.rows.json pid 1444894: producible, 3 events, 0.90s
333
+ ok …/lifecycle-drive.rows.json pid 1444401: producible, 5 events, 0.83s
334
+ ok …/lifecycle-drive.rows.json pid 1444894: producible, 3 events, 0.79s
335
+ whole CLI, 2 traces: 1.81 s wall, 4.27 s user, 323 MB max RSS
336
+ ```
337
+
338
+ JVM + SANY floor, and a nine-event trace (`reload, new, resume, fork, quit`).
339
+ The nine-event file is a hand-written `--events` file used for timing; it is not
340
+ what the rows path would emit for a resume, which needs a `sameAs` that contains
341
+ the startup ticket:
342
+
343
+ ```text
344
+ JVM+SANY floor (trivial module) run 1: 0.71 s wall
345
+ JVM+SANY floor (trivial module) run 2: 0.78 s wall
346
+ JVM+SANY floor (trivial module) run 3: 0.69 s wall
347
+ ok probe/events-long.json pid 0: producible, 9 events, 0.99s
348
+ ok probe/events-long.json pid 0: producible, 9 events, 0.91s
349
+ ok probe/events-long.json pid 0: producible, 9 events, 0.88s
350
+ ```
351
+
352
+ `Merged.cfg` on the same host:
353
+
354
+ ```text
355
+ Model checking completed. No error has been found.
356
+ 17379 states generated, 11116 distinct states found, 0 states left on queue.
357
+ The depth of the complete state graph search is 11.
358
+ Merged.cfg: 2.10 s wall, 4.88 s user, 921304 KB
359
+ ```
360
+
361
+ Planted code drift (witness stays green, the trace check reds):
362
+
363
+ ```text
364
+ $ sed -i … clients/session-scope.ts # SOURCES.fork: ["slot","parent-sidecar"] -> ["parent-sidecar"]
365
+ $ vitest run tests/real-harness/lifecycle.test.ts -t "drives startup"
366
+ Test Files 1 passed (1)
367
+ Tests 1 passed | 2 skipped (3)
368
+ $ node scripts/trace-validate-session-lifecycle.mjs --rows <recorded rows>
369
+ ok rec-drift2/lifecycle-drive.rows.json pid 1545878: producible, 5 events, 1.05s
370
+ FAIL rec-drift2/lifecycle-drive.rows.json pid 1546208: not-producible (first unmatched event: 2, {"a":"begin","k":"fork","scope":2,"role":"primary","parent":1,"src":"other","sameAs":[]}), 3 events, 1.05s
371
+ exit 1
372
+ ```
373
+
374
+ Planted spec drift (`SlotReasons == {"fork"}`):
375
+
376
+ ```text
377
+ FAIL rec-clean/lifecycle-drive.rows.json pid 1444401: not-producible (first unmatched event: 2, {"a":"begin","k":"reload","scope":2,"role":"primary","parent":1,"src":"slot","sameAs":[1]}), 5 events, 0.89s
378
+ ok rec-clean/lifecycle-drive.rows.json pid 1444894: producible, 3 events, 0.86s
379
+ exit 1
380
+ ```
381
+
382
+ The #4815 interleaving:
383
+
384
+ ```text
385
+ $ … --events reload-no-continuation.events.json
386
+ ok …/reload-no-continuation.events.json pid 0: producible, 2 events, 1.31s
387
+ $ … --events reload-ctx-continuation-4815.events.json
388
+ FAIL …/reload-ctx-continuation-4815.events.json pid 0: not-producible (first unmatched event: 3, {"a":"continue","scope":1,"effect":"ctx-read"}), 3 events, 1.16s
389
+ exit 1
390
+ ```
@@ -24,3 +24,4 @@ complete.
24
24
  | [0007](0007-end-to-end-witness-per-seam-slice.md) | Every seam slice commits an end-to-end host witness and degradation ledger artifact. | #1605 umbrella; #1892, #1816, #1193, #1894, #1844 | Accepted |
25
25
  | [0009](0009-reported-path-attribution.md) | Reported-path attribution is `pathsEqual` against the runner cwd, inline at each call site. | 2, 34, 38; #1193, #3278 | Accepted |
26
26
  | [0008](0008-turn-end-lane-interface.md) | One `TurnEndLane` interface; `handleTurnEnd` stays a thin orchestrator over lane modules. | #1892 umbrella; #3264, #3269 | Accepted |
27
+ | [0010](0010-trace-validation-session-lifecycle.md) | Real session-lifecycle runs are checked against `Next` with TLC, from the transition rows production already logs. | #3533; #4815, #4782, #4834 | Accepted |