codebaseiq 0.1.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 (432) hide show
  1. package/CHANGELOG.md +481 -0
  2. package/LICENSE +202 -0
  3. package/README.md +349 -0
  4. package/dist/augment-vue-worker.js +2 -0
  5. package/dist/call-graph-evidence-gNsxjCW8.d.ts +16 -0
  6. package/dist/change-analysis-types-CCtoCHbC.d.ts +9 -0
  7. package/dist/chunk-2Q2LW5JW.js +14 -0
  8. package/dist/chunk-2X7V4HS4.js +88 -0
  9. package/dist/chunk-34WBMAYK.js +2 -0
  10. package/dist/chunk-35NLDRZC.js +2 -0
  11. package/dist/chunk-362QOSFD.js +3 -0
  12. package/dist/chunk-3IER7Q6H.js +12 -0
  13. package/dist/chunk-3JSXXYTZ.js +345 -0
  14. package/dist/chunk-3LCDIREB.js +4 -0
  15. package/dist/chunk-476NR5B7.js +2 -0
  16. package/dist/chunk-4FC325IF.js +30 -0
  17. package/dist/chunk-4WKDMDEW.js +9 -0
  18. package/dist/chunk-4XTAUQFD.js +2 -0
  19. package/dist/chunk-5PUWMSDU.js +26 -0
  20. package/dist/chunk-5VKBFZZU.js +3 -0
  21. package/dist/chunk-6BQ3DSPK.js +2 -0
  22. package/dist/chunk-6CS3UQTN.js +3 -0
  23. package/dist/chunk-6MUIJMVL.js +6 -0
  24. package/dist/chunk-6NW7MU72.js +40 -0
  25. package/dist/chunk-6OAHRI2D.js +6 -0
  26. package/dist/chunk-6YTSKJJ3.js +2 -0
  27. package/dist/chunk-7FND7D7N.js +2 -0
  28. package/dist/chunk-7MGU3HPH.js +2 -0
  29. package/dist/chunk-7NVGT435.js +2 -0
  30. package/dist/chunk-7XAN6GKB.js +2 -0
  31. package/dist/chunk-AAQQPKCU.js +2 -0
  32. package/dist/chunk-ADTBPVUZ.js +21 -0
  33. package/dist/chunk-AKB7V7TV.js +2 -0
  34. package/dist/chunk-ANFVSJWQ.js +11 -0
  35. package/dist/chunk-B2OB55RR.js +3 -0
  36. package/dist/chunk-B3UYV66Z.js +4 -0
  37. package/dist/chunk-B75HZHUP.js +2 -0
  38. package/dist/chunk-BFFZDZQV.js +2 -0
  39. package/dist/chunk-BGBBVSH4.js +2 -0
  40. package/dist/chunk-BH5F2Q4O.js +2 -0
  41. package/dist/chunk-BJ6SQAEN.js +2 -0
  42. package/dist/chunk-BMYOV5GP.js +77 -0
  43. package/dist/chunk-BVAJLC5A.js +7 -0
  44. package/dist/chunk-C6SBF2WH.js +4 -0
  45. package/dist/chunk-C74PPYLA.js +3 -0
  46. package/dist/chunk-C7QOQX32.js +8 -0
  47. package/dist/chunk-CAUCPUOF.js +7 -0
  48. package/dist/chunk-CO5R3UNA.js +2 -0
  49. package/dist/chunk-CQP3THUZ.js +7 -0
  50. package/dist/chunk-CVYSU6BX.js +16 -0
  51. package/dist/chunk-CWONGW6P.js +3 -0
  52. package/dist/chunk-DDZ7VHWV.js +20 -0
  53. package/dist/chunk-DGXRDLV5.js +2 -0
  54. package/dist/chunk-DO6WQD2T.js +3 -0
  55. package/dist/chunk-DQMDCD24.js +2 -0
  56. package/dist/chunk-DR2LURYU.js +3 -0
  57. package/dist/chunk-DRENNWRG.js +2 -0
  58. package/dist/chunk-ECQBG7PW.js +564 -0
  59. package/dist/chunk-EF2R3WNQ.js +2 -0
  60. package/dist/chunk-ELNRLMC5.js +29 -0
  61. package/dist/chunk-EMNIHCRB.js +18 -0
  62. package/dist/chunk-ENCCHKM6.js +5 -0
  63. package/dist/chunk-EZNMUY67.js +5 -0
  64. package/dist/chunk-FAJQ7LWY.js +3 -0
  65. package/dist/chunk-FDGD5AB5.js +2 -0
  66. package/dist/chunk-FETNQCFO.js +117 -0
  67. package/dist/chunk-FM5BPL4V.js +60 -0
  68. package/dist/chunk-FQKZWM4L.js +49 -0
  69. package/dist/chunk-FW53T7EB.js +2 -0
  70. package/dist/chunk-G6XFR4ZL.js +4 -0
  71. package/dist/chunk-GCHRX4YW.js +4 -0
  72. package/dist/chunk-GTIYTDRE.js +562 -0
  73. package/dist/chunk-GTXSJDCO.js +2 -0
  74. package/dist/chunk-GW6Z3WGY.js +2 -0
  75. package/dist/chunk-H3LGFZVK.js +2 -0
  76. package/dist/chunk-HKQUXIFO.js +2 -0
  77. package/dist/chunk-HOA5YGOH.js +3 -0
  78. package/dist/chunk-HPJRBHVT.js +3 -0
  79. package/dist/chunk-HRWGYWRJ.js +49 -0
  80. package/dist/chunk-I2T2LLK2.js +4 -0
  81. package/dist/chunk-ICFDQHAM.js +3 -0
  82. package/dist/chunk-ID63777H.js +4 -0
  83. package/dist/chunk-IJ4HMYBE.js +3 -0
  84. package/dist/chunk-ILMHV3KM.js +2 -0
  85. package/dist/chunk-IOP6FWIM.js +2 -0
  86. package/dist/chunk-IRQOAM5G.js +2 -0
  87. package/dist/chunk-J77SU6VA.js +38 -0
  88. package/dist/chunk-JE3WZ6II.js +2 -0
  89. package/dist/chunk-JEJLSICM.js +4 -0
  90. package/dist/chunk-JOIRNPPY.js +2 -0
  91. package/dist/chunk-JSOYNVWH.js +3 -0
  92. package/dist/chunk-KMITESMT.js +2 -0
  93. package/dist/chunk-KUW32IRO.js +2 -0
  94. package/dist/chunk-KWVHSKHK.js +31 -0
  95. package/dist/chunk-L4NRUAGJ.js +18 -0
  96. package/dist/chunk-L57ZKWVG.js +6 -0
  97. package/dist/chunk-LTA3BRZX.js +2 -0
  98. package/dist/chunk-LU3BMVH2.js +10 -0
  99. package/dist/chunk-LZYFLFEH.js +2 -0
  100. package/dist/chunk-MOVBWNIP.js +16 -0
  101. package/dist/chunk-MVB3DAEY.js +3 -0
  102. package/dist/chunk-N3IQCBCF.js +29 -0
  103. package/dist/chunk-NAUD7LCA.js +2 -0
  104. package/dist/chunk-NCZUNH3E.js +109 -0
  105. package/dist/chunk-NE6IU5ZD.js +5 -0
  106. package/dist/chunk-NEDP5RFQ.js +60 -0
  107. package/dist/chunk-NMTSZXCL.js +2 -0
  108. package/dist/chunk-NNJ2KZZG.js +4 -0
  109. package/dist/chunk-NNO6A2PO.js +2 -0
  110. package/dist/chunk-NNOKTMZT.js +20 -0
  111. package/dist/chunk-O6QTXQPJ.js +13 -0
  112. package/dist/chunk-OANDYLJQ.js +2 -0
  113. package/dist/chunk-OFBE4NGP.js +2 -0
  114. package/dist/chunk-OGTFJ3XD.js +2 -0
  115. package/dist/chunk-OL6KJP3N.js +16 -0
  116. package/dist/chunk-OLF4MA5W.js +8 -0
  117. package/dist/chunk-OTOKVOJ3.js +2 -0
  118. package/dist/chunk-OVTS4DKB.js +2 -0
  119. package/dist/chunk-OZYRSMSH.js +3 -0
  120. package/dist/chunk-P5XHIJHI.js +2 -0
  121. package/dist/chunk-PBI2LFKH.js +2 -0
  122. package/dist/chunk-PIOMTC27.js +2 -0
  123. package/dist/chunk-PTAWHLVJ.js +6 -0
  124. package/dist/chunk-PX4RYAAK.js +2 -0
  125. package/dist/chunk-PYAB5SM6.js +7 -0
  126. package/dist/chunk-Q5ELPRKQ.js +2 -0
  127. package/dist/chunk-Q65CQ4XL.js +2 -0
  128. package/dist/chunk-Q72QSKXC.js +308 -0
  129. package/dist/chunk-QCN62RTF.js +3 -0
  130. package/dist/chunk-QDCCHMVZ.js +2 -0
  131. package/dist/chunk-QHRNXP3C.js +3 -0
  132. package/dist/chunk-QKPLA6IC.js +2 -0
  133. package/dist/chunk-QOKYJ33H.js +2 -0
  134. package/dist/chunk-QW7EP6WI.js +21 -0
  135. package/dist/chunk-R2NOK63J.js +4 -0
  136. package/dist/chunk-RBAS5ZHI.js +2 -0
  137. package/dist/chunk-RDBI2RXU.js +9 -0
  138. package/dist/chunk-RKEJ6VTF.js +73 -0
  139. package/dist/chunk-RR7SX44N.js +35 -0
  140. package/dist/chunk-RU65DDUP.js +215 -0
  141. package/dist/chunk-SELM5MER.js +2 -0
  142. package/dist/chunk-SGX43S2L.js +2 -0
  143. package/dist/chunk-SMRBZ6EC.js +2 -0
  144. package/dist/chunk-SNNWPCN7.js +4 -0
  145. package/dist/chunk-ST7V3SKN.js +2 -0
  146. package/dist/chunk-SWHMHUKF.js +2 -0
  147. package/dist/chunk-SYDJMPES.js +2 -0
  148. package/dist/chunk-SZD2KF7Q.js +2 -0
  149. package/dist/chunk-T3DGWPXM.js +3 -0
  150. package/dist/chunk-TFZB6XTM.js +239 -0
  151. package/dist/chunk-TIIC3ZE7.js +2 -0
  152. package/dist/chunk-TRRC4ZJ7.js +2 -0
  153. package/dist/chunk-TXXOEMZJ.js +2 -0
  154. package/dist/chunk-UBGWN7I4.js +2 -0
  155. package/dist/chunk-UCD3H3UZ.js +5 -0
  156. package/dist/chunk-UDS562V4.js +5 -0
  157. package/dist/chunk-UNBY47BC.js +3 -0
  158. package/dist/chunk-UP3BUZR5.js +74 -0
  159. package/dist/chunk-UXM43C7T.js +3 -0
  160. package/dist/chunk-UZGZB3VB.js +3 -0
  161. package/dist/chunk-VE5AVNMP.js +2 -0
  162. package/dist/chunk-VEXUL62T.js +2 -0
  163. package/dist/chunk-VFY6Y2H6.js +61 -0
  164. package/dist/chunk-VUIYB2V3.js +2 -0
  165. package/dist/chunk-VXYS3FZD.js +23 -0
  166. package/dist/chunk-WE5RZHZ7.js +5 -0
  167. package/dist/chunk-WMPRTGH2.js +2 -0
  168. package/dist/chunk-WOQBZPIF.js +2 -0
  169. package/dist/chunk-XLQ3GLWZ.js +2 -0
  170. package/dist/chunk-XME3HPXZ.js +2 -0
  171. package/dist/chunk-XMQ23E27.js +2 -0
  172. package/dist/chunk-XWUOUWYI.js +2 -0
  173. package/dist/chunk-XZEE23VG.js +5 -0
  174. package/dist/chunk-Y6KHROC3.js +7 -0
  175. package/dist/chunk-YESXMKX3.js +3 -0
  176. package/dist/chunk-YMGZZEW4.js +2 -0
  177. package/dist/chunk-YSNONTJ2.js +2 -0
  178. package/dist/chunk-YUKYB54I.js +1 -0
  179. package/dist/chunk-YVCIMIOC.js +12 -0
  180. package/dist/chunk-Z54RD7VL.js +3 -0
  181. package/dist/chunk-ZKX2FRS6.js +15 -0
  182. package/dist/chunk-ZMI2JSX2.js +2 -0
  183. package/dist/chunk-ZV3JV5G5.js +8 -0
  184. package/dist/chunk-ZZ3MWF33.js +4 -0
  185. package/dist/chunk-ZZXSWSN6.js +2 -0
  186. package/dist/cli-context-3SNLDYBM.js +3 -0
  187. package/dist/cli-context-T3B7W6GG.js +2 -0
  188. package/dist/cli-program-YNOXO72B.js +7 -0
  189. package/dist/cli.js +3 -0
  190. package/dist/code-DlqpBDd0.d.ts +121 -0
  191. package/dist/command-descriptors-6AOUKWW7.js +346 -0
  192. package/dist/command-descriptors-ZFKJSRUP.js +344 -0
  193. package/dist/command-panels-SZONPMLJ.js +3 -0
  194. package/dist/config-types-BNoC96J3.d.ts +560 -0
  195. package/dist/db-D7sauVFH.d.ts +95 -0
  196. package/dist/direct-navigation-DP4LVMRX.js +3 -0
  197. package/dist/direct-navigation-FLUS3BT6.js +2 -0
  198. package/dist/exploration-topology-BG4v30HZ.d.ts +256 -0
  199. package/dist/file-dep-graph-Bqg3t3Px.d.ts +4 -0
  200. package/dist/file-kind-BKCVMNUf.d.ts +10 -0
  201. package/dist/frontend-behavior-evidence-EfM4_9bc.d.ts +4 -0
  202. package/dist/git-history-ChNHbfZQ.d.ts +13 -0
  203. package/dist/graph-evidence-BIFqyisO.d.ts +131 -0
  204. package/dist/health-DJaZXg8I.d.ts +340 -0
  205. package/dist/index.d.ts +183 -0
  206. package/dist/index.js +2 -0
  207. package/dist/invocation-command-descriptors-QT2JMY5J.js +3 -0
  208. package/dist/invocation-command-descriptors-YN4QJEAX.js +2 -0
  209. package/dist/next-anchor-candidates-BwMczMvX.d.ts +90 -0
  210. package/dist/output-continuation-command-2V2SL4TD.js +2 -0
  211. package/dist/output-continuation-command-65J5IP3O.js +3 -0
  212. package/dist/postinstall.js +3 -0
  213. package/dist/project-reindex-5JOKXAXT.js +2 -0
  214. package/dist/project-reindex-UQBIKO4M.js +3 -0
  215. package/dist/queries/affected.d.ts +40 -0
  216. package/dist/queries/affected.js +2 -0
  217. package/dist/queries/anchors.d.ts +123 -0
  218. package/dist/queries/anchors.js +2 -0
  219. package/dist/queries/architecture.d.ts +166 -0
  220. package/dist/queries/architecture.js +2 -0
  221. package/dist/queries/bottlenecks.d.ts +68 -0
  222. package/dist/queries/bottlenecks.js +2 -0
  223. package/dist/queries/by-kind.d.ts +27 -0
  224. package/dist/queries/by-kind.js +2 -0
  225. package/dist/queries/call-graph.d.ts +52 -0
  226. package/dist/queries/call-graph.js +2 -0
  227. package/dist/queries/change-surface.d.ts +55 -0
  228. package/dist/queries/change-surface.js +2 -0
  229. package/dist/queries/cleanup-plan.d.ts +66 -0
  230. package/dist/queries/cleanup-plan.js +2 -0
  231. package/dist/queries/co-change.d.ts +90 -0
  232. package/dist/queries/co-change.js +2 -0
  233. package/dist/queries/code.d.ts +6 -0
  234. package/dist/queries/code.js +2 -0
  235. package/dist/queries/complexity-hotspots.d.ts +61 -0
  236. package/dist/queries/complexity-hotspots.js +2 -0
  237. package/dist/queries/complexity.d.ts +74 -0
  238. package/dist/queries/complexity.js +2 -0
  239. package/dist/queries/context.d.ts +146 -0
  240. package/dist/queries/context.js +2 -0
  241. package/dist/queries/convergence.d.ts +33 -0
  242. package/dist/queries/convergence.js +2 -0
  243. package/dist/queries/coupling.d.ts +32 -0
  244. package/dist/queries/coupling.js +2 -0
  245. package/dist/queries/cycles.d.ts +66 -0
  246. package/dist/queries/cycles.js +2 -0
  247. package/dist/queries/dataflow.d.ts +77 -0
  248. package/dist/queries/dataflow.js +2 -0
  249. package/dist/queries/dead.d.ts +58 -0
  250. package/dist/queries/dead.js +2 -0
  251. package/dist/queries/decorative-checkers.d.ts +34 -0
  252. package/dist/queries/decorative-checkers.js +2 -0
  253. package/dist/queries/deep-chains.d.ts +5 -0
  254. package/dist/queries/deep-chains.js +2 -0
  255. package/dist/queries/dependence-slice.d.ts +46 -0
  256. package/dist/queries/dependence-slice.js +2 -0
  257. package/dist/queries/dependency-depth.d.ts +49 -0
  258. package/dist/queries/dependency-depth.js +2 -0
  259. package/dist/queries/deps.d.ts +15 -0
  260. package/dist/queries/deps.js +2 -0
  261. package/dist/queries/diff-impact.d.ts +165 -0
  262. package/dist/queries/diff-impact.js +2 -0
  263. package/dist/queries/doc-drift.d.ts +115 -0
  264. package/dist/queries/doc-drift.js +2 -0
  265. package/dist/queries/drift.d.ts +79 -0
  266. package/dist/queries/drift.js +2 -0
  267. package/dist/queries/duplicate-bodies.d.ts +55 -0
  268. package/dist/queries/duplicate-bodies.js +2 -0
  269. package/dist/queries/entry-map.d.ts +121 -0
  270. package/dist/queries/entry-map.js +2 -0
  271. package/dist/queries/evidence.d.ts +70 -0
  272. package/dist/queries/evidence.js +2 -0
  273. package/dist/queries/extract-candidates.d.ts +52 -0
  274. package/dist/queries/extract-candidates.js +2 -0
  275. package/dist/queries/fan.d.ts +53 -0
  276. package/dist/queries/fan.js +2 -0
  277. package/dist/queries/files.d.ts +20 -0
  278. package/dist/queries/files.js +2 -0
  279. package/dist/queries/health.d.ts +8 -0
  280. package/dist/queries/health.js +2 -0
  281. package/dist/queries/hierarchy.d.ts +21 -0
  282. package/dist/queries/hierarchy.js +2 -0
  283. package/dist/queries/hotspots.d.ts +42 -0
  284. package/dist/queries/hotspots.js +2 -0
  285. package/dist/queries/imports.d.ts +34 -0
  286. package/dist/queries/imports.js +2 -0
  287. package/dist/queries/incomplete-migration.d.ts +90 -0
  288. package/dist/queries/incomplete-migration.js +2 -0
  289. package/dist/queries/index.d.ts +180 -0
  290. package/dist/queries/index.js +2 -0
  291. package/dist/queries/isolated.d.ts +24 -0
  292. package/dist/queries/isolated.js +2 -0
  293. package/dist/queries/locality-candidates.d.ts +51 -0
  294. package/dist/queries/locality-candidates.js +2 -0
  295. package/dist/queries/members.d.ts +21 -0
  296. package/dist/queries/members.js +2 -0
  297. package/dist/queries/methods.d.ts +43 -0
  298. package/dist/queries/methods.js +2 -0
  299. package/dist/queries/not-implemented.d.ts +33 -0
  300. package/dist/queries/not-implemented.js +2 -0
  301. package/dist/queries/outline.d.ts +22 -0
  302. package/dist/queries/outline.js +2 -0
  303. package/dist/queries/passthrough-candidates.d.ts +41 -0
  304. package/dist/queries/passthrough-candidates.js +2 -0
  305. package/dist/queries/plan-context.d.ts +33 -0
  306. package/dist/queries/plan-context.js +2 -0
  307. package/dist/queries/react-component-duplicates.d.ts +39 -0
  308. package/dist/queries/react-component-duplicates.js +2 -0
  309. package/dist/queries/react-hook-candidates.d.ts +44 -0
  310. package/dist/queries/react-hook-candidates.js +2 -0
  311. package/dist/queries/react-large-component-pressure.d.ts +34 -0
  312. package/dist/queries/react-large-component-pressure.js +2 -0
  313. package/dist/queries/recent-duplicates.d.ts +79 -0
  314. package/dist/queries/recent-duplicates.js +2 -0
  315. package/dist/queries/redundant-reexports.d.ts +37 -0
  316. package/dist/queries/redundant-reexports.js +2 -0
  317. package/dist/queries/reference-neighborhood.d.ts +4 -0
  318. package/dist/queries/reference-neighborhood.js +2 -0
  319. package/dist/queries/reference-reachability.d.ts +48 -0
  320. package/dist/queries/reference-reachability.js +2 -0
  321. package/dist/queries/refs.d.ts +13 -0
  322. package/dist/queries/refs.js +2 -0
  323. package/dist/queries/self-audit.d.ts +65 -0
  324. package/dist/queries/self-audit.js +2 -0
  325. package/dist/queries/similar-chains.d.ts +48 -0
  326. package/dist/queries/similar-chains.js +2 -0
  327. package/dist/queries/similar-files.d.ts +35 -0
  328. package/dist/queries/similar-files.js +2 -0
  329. package/dist/queries/similar-signatures.d.ts +46 -0
  330. package/dist/queries/similar-signatures.js +2 -0
  331. package/dist/queries/similar.d.ts +187 -0
  332. package/dist/queries/similar.js +2 -0
  333. package/dist/queries/slice.d.ts +4 -0
  334. package/dist/queries/slice.js +2 -0
  335. package/dist/queries/source-inspection.d.ts +209 -0
  336. package/dist/queries/source-inspection.js +2 -0
  337. package/dist/queries/source-search.d.ts +85 -0
  338. package/dist/queries/source-search.js +2 -0
  339. package/dist/queries/stale-abstractions.d.ts +72 -0
  340. package/dist/queries/stale-abstractions.js +2 -0
  341. package/dist/queries/stats.d.ts +15 -0
  342. package/dist/queries/stats.js +2 -0
  343. package/dist/queries/surface.d.ts +22 -0
  344. package/dist/queries/surface.js +2 -0
  345. package/dist/queries/symbols.d.ts +14 -0
  346. package/dist/queries/symbols.js +2 -0
  347. package/dist/queries/system-map.d.ts +449 -0
  348. package/dist/queries/system-map.js +2 -0
  349. package/dist/queries/system.d.ts +21 -0
  350. package/dist/queries/system.js +2 -0
  351. package/dist/queries/test-quality.d.ts +56 -0
  352. package/dist/queries/test-quality.js +2 -0
  353. package/dist/queries/trace.d.ts +68 -0
  354. package/dist/queries/trace.js +2 -0
  355. package/dist/queries/twin-ab.d.ts +66 -0
  356. package/dist/queries/twin-ab.js +2 -0
  357. package/dist/queries/twin-drift.d.ts +119 -0
  358. package/dist/queries/twin-drift.js +2 -0
  359. package/dist/queries/unused-imports.d.ts +4 -0
  360. package/dist/queries/unused-imports.js +2 -0
  361. package/dist/queries/unused-params.d.ts +38 -0
  362. package/dist/queries/unused-params.js +2 -0
  363. package/dist/queries/value-flow.d.ts +42 -0
  364. package/dist/queries/value-flow.js +2 -0
  365. package/dist/queries/vue-component-duplicates.d.ts +43 -0
  366. package/dist/queries/vue-component-duplicates.js +2 -0
  367. package/dist/queries/vue-composable-candidates.d.ts +44 -0
  368. package/dist/queries/vue-composable-candidates.js +2 -0
  369. package/dist/queries/vue-large-view-pressure.d.ts +41 -0
  370. package/dist/queries/vue-large-view-pressure.js +2 -0
  371. package/dist/queries/wrapper-candidates.d.ts +34 -0
  372. package/dist/queries/wrapper-candidates.js +2 -0
  373. package/dist/reindex-worker.js +3 -0
  374. package/dist/reindex.d.ts +254 -0
  375. package/dist/reindex.js +298 -0
  376. package/dist/repository-text-C0Q8VYdN.d.ts +19 -0
  377. package/dist/runtime.d.ts +555 -0
  378. package/dist/runtime.js +4 -0
  379. package/dist/rust-semantic-session-server.js +2 -0
  380. package/dist/rust-semantic-session-worker.js +2 -0
  381. package/dist/rust-semantic-worker.js +2 -0
  382. package/dist/scip-cli-B7N3haxa.d.ts +67 -0
  383. package/dist/source-snippet-_wrcgmZc.d.ts +15 -0
  384. package/dist/symbol-types-BIQwfoAx.d.ts +74 -0
  385. package/dist/typescript-mailbox-worker.js +2 -0
  386. package/dist/watch-server.js +8 -0
  387. package/docs/AGENT_GUIDE.md +148 -0
  388. package/docs/AI_FAILURE_MODES.md +43 -0
  389. package/docs/API.md +40 -0
  390. package/docs/API_EVOLUTION.md +77 -0
  391. package/docs/CLI_JSON_OUTPUT.md +389 -0
  392. package/docs/COMMAND_REFERENCE.md +294 -0
  393. package/docs/CONFIGURATION_WRITE_SAFETY.md +131 -0
  394. package/docs/DETECTOR_GUIDE.md +46 -0
  395. package/docs/DURABILITY.md +159 -0
  396. package/docs/INDEX_GENERATIONS.md +167 -0
  397. package/docs/LOCK_PROTOCOL.md +133 -0
  398. package/docs/MAILBOX_LIFECYCLE.md +224 -0
  399. package/docs/REGEX_POLICY.md +36 -0
  400. package/docs/REINDEX_METADATA_COMPATIBILITY.md +104 -0
  401. package/docs/RUST_DURABLE_SESSION_PROTOCOL.md +126 -0
  402. package/docs/SECURITY_MODEL.md +125 -0
  403. package/docs/TELEMETRY_RETENTION.md +84 -0
  404. package/docs/TIME_SEMANTICS.md +77 -0
  405. package/docs/WATCH_REFRESH_REQUESTS.md +123 -0
  406. package/docs/WINDOWS_SIDECAR_RELEASE.md +424 -0
  407. package/docs/accuracy-audit-checklist.md +304 -0
  408. package/docs/accuracy-hardening-goal.md +500 -0
  409. package/docs/analyzer-inventory.md +78 -0
  410. package/docs/analyzer-validation-protocol.md +84 -0
  411. package/docs/architecture-coherence-vision.md +254 -0
  412. package/docs/assets/codebaseiq-logo-dark.svg +21 -0
  413. package/docs/assets/codebaseiq-logo.svg +24 -0
  414. package/docs/locality-analyzer-design.md +193 -0
  415. package/docs/schemas/cli-json-envelope.schema.json +237 -0
  416. package/docs/schemas/cli-output-page.schema.json +104 -0
  417. package/docs/schemas/npm-release-state.schema.json +146 -0
  418. package/docs/schemas/observation-receipt.schema.json +164 -0
  419. package/docs/schemas/project-config.schema.json +318 -0
  420. package/docs/schemas/suppression-record.schema.json +79 -0
  421. package/docs/schemas/windows-sidecar-provenance.schema.json +137 -0
  422. package/package.json +482 -0
  423. package/scripts/build-codebaseiq-windows.mjs +197 -0
  424. package/scripts/codebaseiq-windows-provenance.mjs +364 -0
  425. package/scripts/evidence-product-contract.mjs +197 -0
  426. package/scripts/verify-codebaseiq-windows.mjs +29 -0
  427. package/skills/codebaseiq/SKILL.md +75 -0
  428. package/skills/codebaseiq/agents/openai.yaml +4 -0
  429. package/skills/codebaseiq-explore/SKILL.md +34 -0
  430. package/skills/codebaseiq-explore/agents/openai.yaml +4 -0
  431. package/skills/concrete-plan/SKILL.md +79 -0
  432. package/skills/concrete-plan/agents/openai.yaml +4 -0
@@ -0,0 +1,159 @@
1
+ # Filesystem Publication and Durability
2
+
3
+ This document classifies codebaseiq's file-backed state by the guarantee a
4
+ writer must provide. The classification is part of the storage contract: a
5
+ caller must choose a writer whose failure semantics match the record's role.
6
+
7
+ ## Guarantees
8
+
9
+ A **visibility-atomic replacement** is a filesystem publication operation that
10
+ writes complete bytes to a private staging file and renames that file over the
11
+ target. The rename is the decisive characteristic: concurrent readers can
12
+ observe the old complete file or the new complete file, but never the
13
+ writer's partial staging bytes. It does not promise that the new bytes or
14
+ directory entry survive power loss.
15
+
16
+ A **crash-durable replacement** is a visibility-atomic replacement that also
17
+ flushes the complete staging file before rename and flushes the containing
18
+ directory after rename. When the writer creates a missing directory path, it
19
+ also creates each component from the nearest existing ancestor outward and
20
+ flushes the directory that names each new component. Those ordered flushes are
21
+ what make acknowledged file contents and the complete path that reaches them
22
+ recoverable after an operating-system or machine crash, subject to the host
23
+ filesystem and device honoring their flush contract.
24
+
25
+ An **authoritative record** is file-backed state whose loss can change which
26
+ generation, owner, policy, or accepted decision the program treats as current.
27
+ Its causal role in choosing later behavior makes silent rollback unsafe, so it
28
+ uses crash-durable replacement.
29
+
30
+ A **rebuildable record** is file-backed state whose loss can cost time,
31
+ diagnostics, or a retry but cannot make unverified facts authoritative. Because
32
+ another computation or bounded request can reconstruct it, complete
33
+ old-or-new visibility is sufficient.
34
+
35
+ A **directory flush** is a request to persist a directory entry—the mapping
36
+ from a filename to its file—after the file itself has been flushed. Flushing
37
+ only file contents is insufficient because a crash can otherwise lose the
38
+ rename that made those contents current.
39
+
40
+ An **achieved durability result** is the guarantee established by the
41
+ operations that actually completed, not the guarantee the caller requested.
42
+ `visibility` means only old-or-new complete process visibility;
43
+ `file-flushed` means the final file bytes were flushed but at least one
44
+ directory namespace could not be synchronized; and `directory-durable` means
45
+ the file plus every newly created ancestor and final directory entry crossed
46
+ the supported persistence frontier.
47
+
48
+ ## APIs
49
+
50
+ | API | Staging identity | File flush | Rename/link | New-ancestor flush | Final-directory flush |
51
+ | -------------------------------------------------------------------------- | ----------------------------------------------- | --------------------- | --------------------------------- | ------------------- | --------------------- |
52
+ | `writeJsonAtomic` / `replaceFileAtomic(..., { durability: "visibility" })` | Exclusive random token | No | Yes | No | No |
53
+ | `writeJsonDurable` / `replaceFileAtomic(..., { durability: "durable" })` | Exclusive random token | Yes | Yes | Yes where supported | Yes where supported |
54
+ | `createFileAtomicExclusive(..., { durability: "durable" })` | Exclusive random token | Yes | Exclusive hard link | Yes where supported | Yes where supported |
55
+ | `cloneFileDurable` | Final target inside an unpublished staging tree | Yes, after final mode | Caller publishes the staging tree | Yes where supported | Yes where supported |
56
+
57
+ `writeJsonAtomic` retains its original `void` return contract for compatibility.
58
+ `writeJsonDurable`, `replaceFileAtomic`, and `createFileAtomicExclusive`
59
+ return `requestedDurability`, `achievedDurability`, and `directorySync`.
60
+ Callers must use the achieved fields when logging or forwarding a durability
61
+ claim. Verified binary installation owns an equivalent platform-local
62
+ flush/rename sequence because the enforced architecture forbids dependencies
63
+ between the sibling `platform` and `storage` boundaries.
64
+
65
+ On Windows, Node can reject attempts to open or flush a directory handle.
66
+ Known Windows "directory handles unsupported" errors produce
67
+ `directorySync: "unsupported"` after the staged file itself has been flushed
68
+ and renamed. That result means complete visibility plus flushed file contents,
69
+ not the full POSIX directory-entry durability guarantee. Other directory-sync
70
+ errors remain failures. An API that returns only a path or value makes no
71
+ machine-crash claim; protocol APIs that acknowledge work expose the achieved
72
+ result explicitly.
73
+
74
+ ## Failure Outcomes
75
+
76
+ | Failure point | Target visible after return/throw | Owned staging file |
77
+ | ----------------------------------- | --------------------------------------------------------------- | -------------------------------- |
78
+ | Exclusive create | Previous target | No owned file was created |
79
+ | Write or short/invalid progress | Previous target | Closed and removed |
80
+ | File flush | Previous target | Closed and removed |
81
+ | Rename | Previous target | Removed by the writer |
82
+ | POSIX directory flush | New complete target; durability unconfirmed and the call throws | Already renamed; no staging path |
83
+ | Unsupported Windows directory flush | New complete target; result reports the limitation | Already renamed; no staging path |
84
+
85
+ When a parent chain is new, a failure while creating or flushing any ancestor
86
+ also throws before a durable result is returned. The incomplete path can be
87
+ visible to the running process, but recovery may discard every component that
88
+ has not yet been named by a flushed parent.
89
+
90
+ The post-rename failure row is deliberately explicit. Once rename succeeds,
91
+ rolling back would be another publication with its own crash window. The
92
+ writer therefore leaves the verified new value visible and reports that it
93
+ could not confirm the stronger durability guarantee.
94
+
95
+ ## Call-Site Classification
96
+
97
+ | Record | Contract | Reason |
98
+ | ---------------------------------------------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
99
+ | Reindex `meta.json` | Durable | Names the accepted index status, fingerprint, and generation metadata |
100
+ | SQLite generation manifest and `state.json` | Directory-durable where supported | Durably establishes the generation root, flushes final read-only artifact bytes and metadata, publishes the immutable directory, then selects it for new readers |
101
+ | Shared generation | Directory-durable where supported | Flushes every read-only artifact and manifest, the staging namespace, the final generation rename, and the shared `generations/` namespace |
102
+ | Worktree lease and local cache pointer | Durable | Protect generations from collection and bind a worktree to repository cache identity; generation changes, liveness touches, and cleanup serialize through the repository-cache lock |
103
+ | Watch service state | Durable | Publishes the process instance and index generation accepted as current |
104
+ | Rust semantic session `server.json` | Durable | Publishes the live server process and mailbox identity |
105
+ | Project `.codebaseiq.json` | Durable | Controls indexing, watch, architecture, and detector policy; versioned reads reject unsupported meaning before use, and authorized writes migrate legacy bytes without dropping unknown fields |
106
+ | Codex/Claude hook JSON | Durable | Controls whether and when agent hooks execute |
107
+ | Structured suppression file | Durable | Records an accepted finding and its reason |
108
+ | Health baseline | Durable | Acts as a committed regression policy |
109
+ | Verified binary cache promotion | Durable | Makes checksum-accepted executable or tool bytes current |
110
+ | TypeScript/Rust request and response mailboxes | Directory-durable where supported | Admission is acknowledged only after the pending name is flushed; a new owner directory is durably named before a request moves from pending to inflight; responses precede claim release |
111
+ | Watch activity | Visibility-atomic | A newer timestamp supersedes an older idle-lifetime observation; it carries no durable intent |
112
+ | Watch refresh request, claim, and completion records | Durable immutable admission and acknowledgement | Accepted intent survives activity replacement and owner crashes; exclusive claims may be recovered only by the next lock owner |
113
+ | Cache ownership credential | Directory-durable where supported | A complete file is flushed privately, hardening is revalidated, the public credential is linked exclusively, and its directory is flushed before detailed publication success |
114
+ | npm release state | Directory-durable where supported; file-flushed on bounded hosts | The registry is freshly reconciled and remains external authority; the local coordinate-pair recovery record reports its exact achieved guarantee |
115
+ | TypeScript fragment/overlay manifests | Visibility-atomic | Content-addressed cache artifacts are validated and rebuildable |
116
+ | Repository GC state | Visibility-atomic | Sweep history can be reconstructed conservatively |
117
+ | Affected-set shadow latest record | Visibility-atomic | Calibration telemetry does not control publication |
118
+
119
+ Process locks use exclusive descriptor creation rather than replacement. Their
120
+ durable token ownership, malformed-creation grace, guarded recovery, and
121
+ legacy compatibility are defined in
122
+ [Process Lock Ownership and Recovery](LOCK_PROTOCOL.md). Generation directories,
123
+ stable compatibility mirrors, and their crash ordering are defined in
124
+ [Local Index Generations](INDEX_GENERATIONS.md). Durable watch demand,
125
+ idempotency, claim recovery, and acknowledgement ordering are defined in
126
+ [Watch Refresh Requests](WATCH_REFRESH_REQUESTS.md).
127
+
128
+ The outcome-event journal was retired in version `0.20.0` together with
129
+ autonomous completion state. Current codebaseiq neither writes nor reads those
130
+ records and therefore makes no current durability claim for them. Git history
131
+ retains the removed repository records; deprecated record-shape types remain
132
+ temporarily available only for consumer-owned historical data. See
133
+ [Workflow API retirement compatibility](api/compatibility/2026-08-09-workflow-retirement.md).
134
+
135
+ ## Executable crash model
136
+
137
+ `tests/helpers/persistence-frontier.ts` models the two states a normal
138
+ filesystem test otherwise conflates. Writes, links, renames, and removals first
139
+ change process-visible state. File synchronization advances persisted inode
140
+ bytes and mode; directory synchronization advances persisted names. A modeled
141
+ power loss discards everything beyond those frontiers.
142
+
143
+ `tests/storage/atomic-file-crash.test.ts` replays replacement, exclusive
144
+ publication, new ancestor creation, and durable artifact cloning after every
145
+ relevant phase. Boundary-specific tests then hold the higher-level protocol
146
+ order:
147
+
148
+ - local generation stage and same-size corruption tests;
149
+ - shared-generation artifact, manifest, staging, rename, and final-directory
150
+ stage tests;
151
+ - watch admission, claim, completion, and retry tests;
152
+ - mailbox owner-directory, claim-transfer, response, and recovery tests;
153
+ - ownership short-write, unsupported-sync, and failed-sync tests; and
154
+ - release-state synchronized, unsupported, and failed-write tests.
155
+
156
+ The deterministic model proves the filesystem primitive’s persisted-state
157
+ semantics. The boundary tests prove each protocol invokes those primitives in
158
+ the required order. Neither an exception callback alone nor a successful live
159
+ filesystem read is described as a simulated power loss.
@@ -0,0 +1,167 @@
1
+ # Local Index Generations
2
+
3
+ `codebaseiq` treats `index.db`, `index.scip`, and `meta.json` as one local
4
+ index generation. A local index generation is an accepted set of compiler
5
+ artifacts whose database rows, SCIP occurrences, and metadata describe the
6
+ same indexing result. Keeping those files associated is what lets a query
7
+ attach one truthful identity to every row and downstream semantic request.
8
+
9
+ A generation handle is the storage-owned reference retained by one
10
+ `ScipDatabase`. It differs from a group of cache paths by resolving the
11
+ published pointer once, opening the database beneath that immutable
12
+ generation directory, and retaining the corresponding metadata bytes and SCIP
13
+ path for the connection's entire lifetime.
14
+
15
+ ## Layout
16
+
17
+ The worktree cache keeps this internal layout:
18
+
19
+ ```text
20
+ <cache>/
21
+ index.db compatibility mirror
22
+ index.scip compatibility mirror
23
+ meta.json compatibility mirror
24
+ .codebaseiq-generations/
25
+ state.json atomic current-generation pointer
26
+ gc.json last bounded-collection observation
27
+ gc.lock collection/reader-admission coordinator
28
+ readers/
29
+ <pid>-<token>.json live process-generation leases
30
+ <generation-sha256>/
31
+ manifest.json
32
+ index.db
33
+ index.scip
34
+ meta.json
35
+ ```
36
+
37
+ The files inside a named generation directory are immutable. Their final
38
+ read-only mode is applied before their final file synchronization, so the
39
+ persisted inode contains both the accepted bytes and the protection metadata.
40
+ The SHA-256
41
+ identity incorporates the database bytes, SCIP bytes when present, and the
42
+ generation-bearing metadata fields. `manifest.json` records the exact size and
43
+ digest of each stored artifact. `state.json` names the accepted directory and
44
+ is the only publication decision read by internal database consumers.
45
+ Opening a named generation authenticates the database, SCIP, and metadata
46
+ bytes against those digests; matching size alone is never sufficient. A
47
+ bounded process-local validation cache is keyed by manifest identity plus
48
+ stable device, inode, size, modification-time, and change-time evidence, so a
49
+ same-size mutation invalidates the cached proof and is rehashed.
50
+
51
+ The top-level files remain for the SCIP CLI, indexers, older codebaseiq
52
+ versions, and external inspection. They are derived mirrors, not the internal
53
+ read authority. A current codebaseiq process never combines rows from a
54
+ generation directory with metadata or SCIP bytes freshly reread through those
55
+ replaceable paths.
56
+
57
+ ## Publication and crash behavior
58
+
59
+ Publication proceeds in this order:
60
+
61
+ 1. Retain the previously published stable artifacts as an immutable
62
+ generation when upgrading a legacy cache.
63
+ 2. Durably establish `.codebaseiq-generations/` from its nearest existing
64
+ ancestor when this is the cache's first generation.
65
+ 3. Copy-on-write clone or copy every accepted candidate artifact into a
66
+ private staging directory, apply its final read-only mode, and flush the
67
+ resulting inode.
68
+ 4. Flush the manifest and staging namespace, rename the complete staging
69
+ directory into its content-derived identity, and flush the generation-root
70
+ directory entry.
71
+ 5. Establish the versioned query layout after augmentation: add the
72
+ definition-only covering index, remove known redundant indexes only when
73
+ schema inspection proves a retained equivalent, and run `ANALYZE` so the
74
+ planner sees the final row distribution. Query-plan tests hold those
75
+ proofs.
76
+ 6. Durably replace `state.json` so new internal readers select the complete
77
+ new directory.
78
+ 7. Replace the three compatibility mirrors and durably record their file
79
+ identities for drift diagnostics.
80
+
81
+ A crash before step 6 leaves the prior pointer authoritative. A crash after
82
+ the pointer step leaves the new immutable generation authoritative even if one or more
83
+ compatibility mirrors are old. `codebaseiq status` and freshness inspection
84
+ report that mirror drift and a later refresh repairs it; database-backed
85
+ queries remain generation-consistent throughout.
86
+
87
+ Metadata-only refreshes create a new immutable generation and switch the same
88
+ pointer. Old database handles retain their old metadata bytes. Result cursors
89
+ and TypeScript semantic mailbox requests carry the handle identity, so a
90
+ continuation or numeric symbol identifier from an older generation is rejected
91
+ when a service has moved to a newer one.
92
+
93
+ Current metadata also records `sqliteLayoutVersion`. A current-version
94
+ metadata record that predates this field remains readable and can reuse its
95
+ language SCIP shards, but it cannot take the whole-SQLite unchanged fast path.
96
+ The next refresh applies query-layout maintenance to the stable mirror,
97
+ publishes a new immutable generation and current layout metadata, and does not
98
+ rerun unchanged language indexers. Later unchanged refreshes resume the
99
+ ordinary whole-generation reuse path.
100
+
101
+ Mailbox protocol version 3 additionally binds that generation identity into a
102
+ content-derived logical-operation key. The deterministic request ID lets a
103
+ retry join an already pending, inflight, or retained completed operation,
104
+ while the service still recomputes the key and rejects a path, payload, or
105
+ generation mismatch. See
106
+ [`MAILBOX_LIFECYCLE.md`](MAILBOX_LIFECYCLE.md) for ownership, expiry, limits,
107
+ and legacy overlap.
108
+
109
+ ## Legacy overlap and retention
110
+
111
+ A cache without `state.json` remains readable through a bounded legacy
112
+ open-and-file-identity recheck. A state record written by the earlier local
113
+ generation implementation, which did not name an immutable artifact set, also
114
+ uses this compatibility path. New publications upgrade either layout without
115
+ deleting the stable files.
116
+
117
+ Published local generation directories are retained by a bounded,
118
+ reader-aware collector. Opening an immutable `ScipDatabase` first acquires the
119
+ generation GC lock, resolves the current pointer, and visibility-atomically
120
+ publishes a lease containing its random token, generation identity, PID, and
121
+ operating-system process-start identity when available. Closing the database
122
+ removes that exact lease idempotently.
123
+
124
+ Publication and collection use the same token-owned process lock. Collection
125
+ always protects the current generation, the named recovery generation, and
126
+ every live reader generation. It removes only oldest unprotected generations
127
+ until both default limits hold: at most eight retained generations and at most
128
+ 2 GiB of logical artifact bytes. A lease whose recorded process instance is
129
+ provably dead is reclaimed. A malformed lease protects every generation and
130
+ defers deletion; uncertainty cannot authorize reclamation.
131
+
132
+ `gc.json` is a visibility-atomic diagnostic containing retained counts, logical
133
+ bytes, protected/readers counts, removed counts, limits, state, time, and any
134
+ reason. `codebaseiq status` reports that observation together with the current
135
+ retained set and oldest generation age. Collection failure does not invalidate
136
+ the accepted index; it remains explicit bounded-storage debt for the operator.
137
+
138
+ The repository-wide shared generation store is a separate cache layer. It
139
+ warms a worktree from a complete content-addressed generation. Publication
140
+ flushes each final read-only artifact, the manifest, the staging namespace, the
141
+ rename into `generations/<identity>`, and `generations/` itself before
142
+ returning `directory-durable` on supported hosts. On a host without directory
143
+ sync, it returns `file-flushed`; readers still rehash every artifact and reject
144
+ an incomplete generation. The local publisher then creates the private
145
+ immutable directory and pointer described here. Later worktree writes cannot
146
+ mutate either the shared source or a retained local reader.
147
+
148
+ ## Shared worktree lease invariant
149
+
150
+ A worktree lease is a repository-cache reachability record whose generation
151
+ IDs keep an immutable shared generation from collection while that worktree
152
+ uses it. Its essential ownership fields bind the repository, worktree,
153
+ project path, and local cache path through a checksum; `lastSeenAt` is only a
154
+ liveness observation.
155
+
156
+ Generation attachment, lease liveness touches, and repository cleanup
157
+ serialize through one repository-cache lock. A touch may inspect the local
158
+ pointer before waiting only to identify that lock. Once it owns the lock, it
159
+ rereads the pointer and lease, validates the ownership checksum, current Git
160
+ tree, local metadata fingerprint, generation IDs, and source artifacts, then
161
+ merges only a newer `lastSeenAt`. It never writes a lease assembled from the
162
+ pre-lock observation.
163
+
164
+ Consequently, a touch waiting behind a new generation attaches to or rejects
165
+ the new lease; it cannot restore the old generation. A deleted lease stays
166
+ deleted, a recreated lease with different ownership stays intact, and a touch
167
+ whose clock is behind another completed touch cannot move liveness backward.
@@ -0,0 +1,133 @@
1
+ # Process Lock Ownership and Recovery
2
+
3
+ codebaseiq uses one process-lock protocol for watch ownership, reindex
4
+ publication, repository-cache garbage collection, shared-generation builds,
5
+ verified-binary fetches, and the durable Rust semantic server.
6
+
7
+ A **process lock** is a filesystem ownership record created exclusively at one
8
+ resource path. Exclusive creation makes competing processes observe one
9
+ winner; the recorded random token and operating-system process-start identity
10
+ distinguish that winner from later processes and later lock records that reuse
11
+ the same PID or pathname.
12
+
13
+ A **process instance** is one execution occupying an operating-system PID
14
+ slot. The PID locates the slot, while the process-start identity distinguishes
15
+ successive executions that occupy it. A PID by itself is therefore accepted
16
+ for conservative legacy inspection but never treated as proof that a live
17
+ process is the original owner.
18
+
19
+ A **reclaim guard** is a second exclusive, token-owned process lock at
20
+ `<lock>.reclaim`. It serializes recovery attempts so that only one process may
21
+ remove an unchanged abandoned record. The guard does not make an ambiguous
22
+ live owner safe to remove.
23
+
24
+ ## Current Record
25
+
26
+ New writers emit protocol version 1:
27
+
28
+ ```json
29
+ {
30
+ "protocol": "codebaseiq-process-lock",
31
+ "version": 1,
32
+ "kind": "reindex",
33
+ "pid": 41001,
34
+ "token": "random-owner-token",
35
+ "processIdentity": {
36
+ "version": 1,
37
+ "pid": 41001,
38
+ "platform": "linux",
39
+ "startToken": "9147752"
40
+ },
41
+ "startedAt": "2026-07-25T19:00:00.000Z",
42
+ "detail": {
43
+ "projectRoot": "/repo"
44
+ }
45
+ }
46
+ ```
47
+
48
+ `kind` identifies the resource protocol using the lock. `detail` carries only
49
+ that protocol's diagnostic metadata; it is not ownership evidence. Ownership
50
+ is the combination of PID, random token, and process identity when the host can
51
+ obtain one.
52
+
53
+ The creator writes the complete record to a token-unique private candidate,
54
+ flushes and closes that candidate, then publishes the complete inode under the
55
+ public lock name with an exclusive hard link. The link either creates the
56
+ public name or reports that another owner already has it; it never replaces an
57
+ owner. A crash before the link can leave a private candidate, but it cannot
58
+ expose an empty or truncated public lock. Successful publication removes the
59
+ private name and flushes the containing directory where supported.
60
+
61
+ ## Observation and Recovery
62
+
63
+ | Observed state | Recovery decision |
64
+ | ------------------------------------------------------------------ | ----------------------------------------------------------------------- |
65
+ | Current record; process instance is live and matches | Contended; never remove |
66
+ | Current record; PID is dead | Reclaim after guarded unchanged recheck |
67
+ | Current record; PID is live but its process-start identity differs | Reclaim the old record without signaling the new PID occupant |
68
+ | Current record; PID is live but identity cannot be read | Contended; fail closed |
69
+ | Supported legacy record; PID is live | Contended because the process instance cannot be verified |
70
+ | Supported legacy record; PID is dead | Reclaim after guarded unchanged recheck |
71
+ | Empty, truncated, or malformed public record | Contended; fail closed because civil-clock age cannot identify an owner |
72
+ | Record changes before the guarded recheck | Do not remove; report contention |
73
+ | Empty or malformed reclaim guard | Do not remove |
74
+ | Valid reclaim guard whose process instance is dead | Recover the guard, then retry once |
75
+
76
+ The unchanged recheck compares the original bytes, device, inode, size, and
77
+ modification time. Recovery is limited to one retry: persistent ambiguity
78
+ remains contention instead of becoming an unbounded delete loop.
79
+
80
+ Malformed public records from a legacy writer, external damage, or manual
81
+ editing require operator review. A civil timestamp is not causal ownership
82
+ evidence: moving the system clock forward cannot prove which process created
83
+ the bytes or whether that process still owns the resource.
84
+
85
+ ## Release
86
+
87
+ Release rereads the current record and removes it only when PID and token still
88
+ match the owner's retained record. When the owner recorded a process identity,
89
+ that identity must match as well. A missing path, malformed record, legacy
90
+ record, token mismatch, or successor record makes release a no-op. Successful
91
+ removal flushes the containing directory where supported so an acknowledged
92
+ release does not resurrect the prior directory entry after a crash.
93
+
94
+ This protocol does not expire live ownership and therefore does not require a
95
+ monotonically increasing fencing token. A **fencing token** is an ordered
96
+ ownership value checked by the protected resource before it accepts a write;
97
+ it is necessary when an old live owner can outlast a lease and attempt
98
+ publication after a newer owner. codebaseiq instead refuses to steal a
99
+ verifiably live lock.
100
+
101
+ ## Legacy Compatibility
102
+
103
+ Readers retain narrow decoders for the prior formats:
104
+
105
+ - watch and reindex JSON ownership records;
106
+ - generic repository-cache and shared-build `{ "pid": ... }` records;
107
+ - the durable Rust semantic server's numeric PID record.
108
+
109
+ New writers always emit the current common format. A live legacy owner remains
110
+ contended because its process instance cannot be proven. A dead legacy owner
111
+ can be reclaimed. Unsupported or malformed JSON is never guessed into a
112
+ legacy owner.
113
+
114
+ ## Diagnostics and Manual Recovery
115
+
116
+ Successful reindex recovery reports that it recovered an abandoned lock. A
117
+ manual refresh that encounters an already-stale
118
+ watcher-owned reindex record retains the existing “preempting watcher refresh”
119
+ diagnostic while stating that the prior owner was already stale.
120
+
121
+ For other lock users, normal recovery is silent and contention reports the
122
+ resource-specific lock path. If a lock remains contended:
123
+
124
+ 1. inspect the JSON without editing it;
125
+ 2. verify whether its PID and process-start identity name the current process;
126
+ 3. for a malformed record, establish ownership outside codebaseiq and move the
127
+ record aside rather than asking wall-clock age to authorize deletion;
128
+ 4. retry the operation so the guarded recovery path can run for attributable
129
+ dead owners.
130
+
131
+ Do not manually delete a valid lock whose process instance is live. If host
132
+ permissions prevent process-identity verification, stop the owning process or
133
+ move the record aside only after establishing ownership outside codebaseiq.