pi-lens 4.2.1 → 4.4.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 (671) hide show
  1. package/CHANGELOG.md +1562 -0
  2. package/README.md +157 -24
  3. package/config/dependency-cruiser-eager-allowlist.json +6 -2
  4. package/dist/chunk-22AVIGXS.js +560 -0
  5. package/dist/chunk-27BBHSZC.js +106 -0
  6. package/dist/chunk-2BEMIWEW.js +51 -0
  7. package/dist/chunk-2EECBNC5.js +89 -0
  8. package/dist/chunk-34U7PLGE.js +23 -0
  9. package/dist/chunk-3I5QFT3N.js +181 -0
  10. package/dist/chunk-3MED75HT.js +37 -0
  11. package/dist/chunk-47D2BO4S.js +87 -0
  12. package/dist/chunk-4RERDEXR.js +348 -0
  13. package/dist/chunk-4W2PLC4J.js +27 -0
  14. package/dist/chunk-52H5B5TC.js +202 -0
  15. package/dist/chunk-54B42YRX.js +27 -0
  16. package/dist/chunk-5RXBNSW2.js +266 -0
  17. package/dist/chunk-5THXD6X5.js +201 -0
  18. package/dist/chunk-5W3R6LFT.js +24 -0
  19. package/dist/chunk-5ZEJHV35.js +341 -0
  20. package/dist/chunk-6P62QVEA.js +118 -0
  21. package/dist/chunk-6QIUX4EP.js +459 -0
  22. package/dist/chunk-6VCD4VKZ.js +78 -0
  23. package/dist/chunk-7F72PXY2.js +326 -0
  24. package/dist/chunk-7FBF7NPR.js +998 -0
  25. package/dist/chunk-7U2IDNXN.js +37 -0
  26. package/dist/chunk-ABBOA7UD.js +157 -0
  27. package/dist/chunk-AHDW3GPE.js +50 -0
  28. package/dist/chunk-AJ3QXTRQ.js +756 -0
  29. package/dist/chunk-AJVLWNFN.js +1610 -0
  30. package/dist/chunk-AJXODZY6.js +112 -0
  31. package/dist/chunk-ARFCXG7S.js +84 -0
  32. package/dist/chunk-AS44CFQ4.js +708 -0
  33. package/dist/chunk-AWE5TMPO.js +38 -0
  34. package/dist/chunk-B3I2UUT4.js +4692 -0
  35. package/dist/chunk-BRJKOBZP.js +331 -0
  36. package/dist/chunk-BW5KFIQC.js +59 -0
  37. package/dist/chunk-C2AUYXQH.js +149 -0
  38. package/dist/chunk-CGGAIP7J.js +29 -0
  39. package/dist/chunk-D6QS3U6M.js +30 -0
  40. package/dist/chunk-DFVMIKMQ.js +349 -0
  41. package/dist/chunk-DIULIWKU.js +169 -0
  42. package/dist/chunk-DQ2NZ7C4.js +2317 -0
  43. package/dist/chunk-E2WFBRHM.js +213 -0
  44. package/dist/chunk-E4MAEDPM.js +50 -0
  45. package/dist/chunk-EOKRQ3SA.js +30 -0
  46. package/dist/chunk-F3AU2TMM.js +2626 -0
  47. package/dist/chunk-F3P7VQ7H.js +170 -0
  48. package/dist/chunk-FC4RP4I2.js +12 -0
  49. package/dist/chunk-FJNKANOS.js +32 -0
  50. package/dist/chunk-GUOGVTCQ.js +146 -0
  51. package/dist/chunk-GVXA6CCE.js +18 -0
  52. package/dist/chunk-HHYAELLJ.js +2334 -0
  53. package/dist/chunk-HMFXILPV.js +83 -0
  54. package/dist/chunk-HVUZXSWK.js +421 -0
  55. package/dist/chunk-HWBZIGMJ.js +62 -0
  56. package/dist/chunk-I3R7GKDR.js +17 -0
  57. package/dist/chunk-I7SPGOWI.js +55 -0
  58. package/dist/chunk-IIXOAGHR.js +38 -0
  59. package/dist/chunk-IVP5KAB7.js +2250 -0
  60. package/dist/chunk-IXEBJSUE.js +22 -0
  61. package/dist/chunk-JOLITGCC.js +27 -0
  62. package/dist/chunk-K6VYLB2U.js +145 -0
  63. package/dist/chunk-LJDODBBZ.js +78 -0
  64. package/dist/chunk-LNAKEO63.js +78 -0
  65. package/dist/chunk-LSMJ6KBE.js +4139 -0
  66. package/dist/chunk-LW6XKDZQ.js +5565 -0
  67. package/dist/chunk-N3YQJI6O.js +899 -0
  68. package/dist/chunk-NABLC7W3.js +148 -0
  69. package/dist/chunk-NKOUFPQF.js +659 -0
  70. package/dist/chunk-NL5GLMFI.js +211 -0
  71. package/dist/chunk-NMABWBZN.js +327 -0
  72. package/dist/chunk-NTHH2J74.js +27 -0
  73. package/dist/chunk-NTUJEGDZ.js +59 -0
  74. package/dist/chunk-NXL4FFQQ.js +47 -0
  75. package/dist/chunk-NXPS2L6U.js +466 -0
  76. package/dist/chunk-O5WILGMI.js +42 -0
  77. package/dist/chunk-O6TQT6RI.js +48 -0
  78. package/dist/chunk-OAXNDZJ7.js +323 -0
  79. package/dist/chunk-ODEEOXPH.js +44 -0
  80. package/dist/chunk-OQGFCZJ4.js +4533 -0
  81. package/dist/chunk-ORTMY4Q4.js +282 -0
  82. package/dist/chunk-OS32RNR2.js +442 -0
  83. package/dist/chunk-PAK6IDME.js +189 -0
  84. package/dist/chunk-PWFHBTSF.js +406 -0
  85. package/dist/chunk-Q5U6FMDI.js +2352 -0
  86. package/dist/chunk-QOZXJ4NA.js +3364 -0
  87. package/dist/chunk-QYF5S6P6.js +45 -0
  88. package/dist/chunk-RIISMHKN.js +36 -0
  89. package/dist/chunk-RPD4ZSB7.js +25 -0
  90. package/dist/chunk-RPD5K5NC.js +79 -0
  91. package/dist/chunk-RUOG5D2C.js +262 -0
  92. package/dist/chunk-T4ERT73Y.js +599 -0
  93. package/dist/chunk-T6D4Q4AQ.js +54 -0
  94. package/dist/chunk-TGPXLY2J.js +391 -0
  95. package/dist/chunk-TLGFBM3F.js +12116 -0
  96. package/dist/chunk-TO6WL3GM.js +88 -0
  97. package/dist/chunk-TT22N74J.js +517 -0
  98. package/dist/chunk-TVN5N6GY.js +21216 -0
  99. package/dist/chunk-U3VGR4VU.js +308 -0
  100. package/dist/chunk-UK3CMEAL.js +1250 -0
  101. package/dist/chunk-UOPVJQ4N.js +103 -0
  102. package/dist/chunk-UXVNL3D7.js +23 -0
  103. package/dist/chunk-UY752QSN.js +45 -0
  104. package/dist/chunk-V5PXFSZK.js +188 -0
  105. package/dist/chunk-V7R425XG.js +398 -0
  106. package/dist/chunk-VCSRSYLF.js +81 -0
  107. package/dist/chunk-VD4JQCQC.js +162 -0
  108. package/dist/chunk-VDBPVIKD.js +62 -0
  109. package/dist/chunk-VHQLPIRJ.js +114 -0
  110. package/dist/chunk-VN2AXLEX.js +5414 -0
  111. package/dist/chunk-VNMT7C64.js +478 -0
  112. package/dist/chunk-WONERJTP.js +309 -0
  113. package/dist/chunk-XECLWQZN.js +85 -0
  114. package/dist/chunk-XIMYZ3JA.js +27 -0
  115. package/dist/chunk-XK4CIILI.js +144 -0
  116. package/dist/chunk-Y4T27COV.js +562 -0
  117. package/dist/chunk-YGVYKNSN.js +1860 -0
  118. package/dist/chunk-YLF3PPT5.js +308 -0
  119. package/dist/chunk-YSNFMJKN.js +14 -0
  120. package/dist/chunk-Z3CCVDUB.js +76 -0
  121. package/dist/chunk-Z54ZSOBZ.js +61 -0
  122. package/dist/chunk-ZAWW3AF6.js +97 -0
  123. package/dist/chunk-ZMOL6RQC.js +167 -0
  124. package/dist/index.js +19039 -8956
  125. package/dist/mcp/analyze-cli.js +186 -228
  126. package/dist/mcp/cli.js +137 -98
  127. package/dist/mcp/server.js +22592 -1564
  128. package/dist/mcp/worker.js +97 -38
  129. package/dist/probes/installer.js +135 -0
  130. package/dist/workers/project-snapshot-persist-worker.js +22 -0
  131. package/dist/workers/review-graph-persist-worker.js +15 -0
  132. package/docs/adr/0001-stale-advisory-live-arm.md +29 -0
  133. package/docs/adr/0002-workspace-hash-rendezvous.md +30 -0
  134. package/docs/adr/0003-git-guard-latch-writer.md +203 -0
  135. package/docs/adr/0004-disposition-policy-seam.md +38 -0
  136. package/docs/adr/0005-tool-availability-enforcement-seam.md +29 -0
  137. package/docs/adr/0006-derived-state-benchmark-first.md +31 -0
  138. package/docs/adr/0007-end-to-end-witness-per-seam-slice.md +38 -0
  139. package/docs/adr/0008-turn-end-lane-interface.md +165 -0
  140. package/docs/adr/0009-reported-path-attribution.md +114 -0
  141. package/docs/adr/README.md +26 -0
  142. package/docs/agent-guide.md +13 -4
  143. package/docs/agent-tools.md +60 -1
  144. package/docs/ast-grep_rules_catalog.md +6 -4
  145. package/docs/configuration.md +75 -2
  146. package/docs/engineering-principles.md +202 -0
  147. package/docs/environment-variables.md +113 -6
  148. package/docs/features.md +10 -6
  149. package/docs/globalconfig.md +7 -1
  150. package/docs/io-bridge-v2-migration.md +94 -0
  151. package/docs/language-coverage.md +17 -0
  152. package/docs/lsp-capability-matrix.md +131 -32
  153. package/docs/lsp-idle-eviction.md +124 -0
  154. package/docs/mcp.md +21 -5
  155. package/docs/merge-queue-rollout.md +77 -0
  156. package/docs/pi-lens-fixer.md +161 -39
  157. package/docs/pi-lens-investigator.md +77 -20
  158. package/docs/pi-lens-merge-policy.md +694 -0
  159. package/docs/pi-lens-monitor.md +73 -7
  160. package/docs/pi-lens-retro.md +6 -4
  161. package/docs/pi-lens-reviewer.md +190 -34
  162. package/docs/pi-lens-subagent.md +247 -37
  163. package/docs/pi-lens-warden.md +18 -7
  164. package/docs/public-api-stability.md +56 -0
  165. package/docs/release-qa-baseline.md +86 -17
  166. package/docs/rfcs/3654-unified-io-bridge-v2.md +316 -0
  167. package/docs/servercapabilities.md +66 -52
  168. package/docs/settings.md +13 -3
  169. package/docs/subagent-compat.md +1 -1
  170. package/docs/usage.md +5 -1
  171. package/grammars/tree-sitter-bash.wasm +0 -0
  172. package/grammars/tree-sitter-bash.wasm.json +3 -3
  173. package/package.json +23 -9
  174. package/rules/ast-grep-rules/rule-tests/advisory-registry-subset-test.yml +41 -0
  175. package/rules/ast-grep-rules/rule-tests/no-assert-tuple-test.yml +13 -0
  176. package/rules/ast-grep-rules/rule-tests/no-boolean-in-except-test.yml +26 -0
  177. package/rules/ast-grep-rules/rule-tests/no-http-headers-bracket-access-test.yml +10 -0
  178. package/rules/ast-grep-rules/rule-tests/unchecked-numeric-parse-python-test.yml +18 -0
  179. package/rules/ast-grep-rules/rule-tests/unchecked-throwing-call-python-test.yml +4 -3
  180. package/rules/ast-grep-rules/rules/advisory-registry-subset.yml +50 -0
  181. package/rules/ast-grep-rules/rules/go-no-fmt-println.yml +2 -2
  182. package/rules/ast-grep-rules/rules/no-assert-tuple.yml +23 -13
  183. package/rules/ast-grep-rules/rules/no-boolean-in-except.yml +7 -3
  184. package/rules/ast-grep-rules/rules/no-console-except-error-js.yml +2 -2
  185. package/rules/ast-grep-rules/rules/no-console-except-error.yml +2 -2
  186. package/rules/ast-grep-rules/rules/no-http-headers-bracket-access.yml +12 -7
  187. package/rules/ast-grep-rules/rules/unchecked-numeric-parse-python.yml +44 -0
  188. package/rules/ast-grep-rules/rules/unchecked-throwing-call-python.yml +5 -3
  189. package/rules/tree-sitter-queries/typescript/console-statement.yml +2 -2
  190. package/scripts/analyze-pi-lens-logs.mjs +1275 -62
  191. package/scripts/download-grammars.js +5 -0
  192. package/scripts/grammars.lock.json +6 -1
  193. package/scripts/install-selftest.mjs +38 -35
  194. package/scripts/lib/host-provided-deps.mjs +13 -4
  195. package/scripts/lib/web-tree-sitter-dir.mjs +141 -0
  196. package/dist/clients/actionable-warnings-logger.js +0 -35
  197. package/dist/clients/actionable-warnings.js +0 -1594
  198. package/dist/clients/advisory-provenance.js +0 -457
  199. package/dist/clients/agent-behavior-client.js +0 -147
  200. package/dist/clients/agent-nudge.js +0 -325
  201. package/dist/clients/analysed-root.js +0 -1
  202. package/dist/clients/ast-grep-client.js +0 -731
  203. package/dist/clients/ast-grep-rule-manager.js +0 -146
  204. package/dist/clients/ast-grep-tool-logger.js +0 -118
  205. package/dist/clients/ast-grep-types.js +0 -10
  206. package/dist/clients/ast-grep-yaml-synth.js +0 -154
  207. package/dist/clients/atomic-write-staging.js +0 -75
  208. package/dist/clients/atomic-write.js +0 -189
  209. package/dist/clients/availability-probe-flight.js +0 -12
  210. package/dist/clients/bash-file-access.js +0 -1056
  211. package/dist/clients/biome-client.js +0 -357
  212. package/dist/clients/blocker-freshness.js +0 -837
  213. package/dist/clients/blocker-past-eof.js +0 -129
  214. package/dist/clients/bootstrap.js +0 -569
  215. package/dist/clients/bounded-cache.js +0 -190
  216. package/dist/clients/bounded-pid-file-lock.js +0 -202
  217. package/dist/clients/bounded-telemetry.js +0 -295
  218. package/dist/clients/build-identity.js +0 -95
  219. package/dist/clients/bundled-resource-health.js +0 -113
  220. package/dist/clients/bus-events-logger.js +0 -105
  221. package/dist/clients/bus-publish.js +0 -171
  222. package/dist/clients/cache/rule-cache.js +0 -190
  223. package/dist/clients/cache-manager.js +0 -465
  224. package/dist/clients/cache-observability.js +0 -1313
  225. package/dist/clients/call-graph.js +0 -852
  226. package/dist/clients/cargo-manifest.js +0 -422
  227. package/dist/clients/cascade-budget.js +0 -196
  228. package/dist/clients/cascade-format.js +0 -315
  229. package/dist/clients/cascade-logger.js +0 -31
  230. package/dist/clients/cascade-types.js +0 -9
  231. package/dist/clients/child-unref.js +0 -115
  232. package/dist/clients/code-quality-warnings.js +0 -286
  233. package/dist/clients/codebase-model.js +0 -173
  234. package/dist/clients/collateral-test-role.js +0 -40
  235. package/dist/clients/complexity-client.js +0 -462
  236. package/dist/clients/config-core/deny.js +0 -221
  237. package/dist/clients/config-core/index.js +0 -50
  238. package/dist/clients/config-core/merge.js +0 -357
  239. package/dist/clients/config-core/normalize.js +0 -340
  240. package/dist/clients/config-core/process-spec.js +0 -248
  241. package/dist/clients/config-core/provenance.js +0 -164
  242. package/dist/clients/config-core/records.js +0 -218
  243. package/dist/clients/config-core/resolve.js +0 -125
  244. package/dist/clients/config-core/safe-object.js +0 -78
  245. package/dist/clients/config-core/schema.js +0 -165
  246. package/dist/clients/config-diagnostic-codes.js +0 -283
  247. package/dist/clients/config-locations.js +0 -160
  248. package/dist/clients/config-resolve.js +0 -792
  249. package/dist/clients/config-schema.js +0 -251
  250. package/dist/clients/config-warn.js +0 -407
  251. package/dist/clients/console-guard-install.js +0 -26
  252. package/dist/clients/cooperative-budget.js +0 -42
  253. package/dist/clients/dead-code-client.js +0 -510
  254. package/dist/clients/dead-code-logger.js +0 -30
  255. package/dist/clients/deadline-utils.js +0 -280
  256. package/dist/clients/debug-handles.js +0 -211
  257. package/dist/clients/debug-heap.js +0 -174
  258. package/dist/clients/deferred-lsp-work.js +0 -106
  259. package/dist/clients/degradation-ledger.js +0 -396
  260. package/dist/clients/demoted-finding-render.js +0 -169
  261. package/dist/clients/dependency-checker.js +0 -862
  262. package/dist/clients/deps/ast-grep-napi.js +0 -22
  263. package/dist/clients/deps/js-yaml.js +0 -9
  264. package/dist/clients/deps/minimatch.js +0 -4
  265. package/dist/clients/deps/pi-tui.js +0 -14
  266. package/dist/clients/deps/typebox.js +0 -14
  267. package/dist/clients/deps/vscode-jsonrpc.js +0 -1
  268. package/dist/clients/deps/web-tree-sitter.js +0 -24
  269. package/dist/clients/diagnostic-dispositions.js +0 -594
  270. package/dist/clients/diagnostic-line-freshness.js +0 -305
  271. package/dist/clients/diagnostic-logger.js +0 -73
  272. package/dist/clients/diagnostic-tracker.js +0 -105
  273. package/dist/clients/diagnostics-publish.js +0 -230
  274. package/dist/clients/dispatch/ast-grep-catalog.js +0 -65
  275. package/dist/clients/dispatch/auxiliary-lsp.js +0 -343
  276. package/dist/clients/dispatch/collect-later-tier.js +0 -35
  277. package/dist/clients/dispatch/diagnostic-taxonomy.js +0 -66
  278. package/dist/clients/dispatch/dispatcher.js +0 -1269
  279. package/dist/clients/dispatch/fact-provider-types.js +0 -1
  280. package/dist/clients/dispatch/fact-rule-runner.js +0 -17
  281. package/dist/clients/dispatch/fact-runner.js +0 -30
  282. package/dist/clients/dispatch/fact-scheduler.js +0 -68
  283. package/dist/clients/dispatch/fact-store.js +0 -377
  284. package/dist/clients/dispatch/facts/comment-facts.js +0 -22
  285. package/dist/clients/dispatch/facts/file-content.js +0 -19
  286. package/dist/clients/dispatch/facts/function-facts.js +0 -348
  287. package/dist/clients/dispatch/facts/import-facts.js +0 -204
  288. package/dist/clients/dispatch/facts/tree-sitter-facts.js +0 -34
  289. package/dist/clients/dispatch/facts/try-catch-facts.js +0 -119
  290. package/dist/clients/dispatch/finding-policy.js +0 -222
  291. package/dist/clients/dispatch/indent-detect.js +0 -411
  292. package/dist/clients/dispatch/inline-suppressions.js +0 -70
  293. package/dist/clients/dispatch/integration.js +0 -2377
  294. package/dist/clients/dispatch/lazy.js +0 -11
  295. package/dist/clients/dispatch/pending-runner-findings.js +0 -87
  296. package/dist/clients/dispatch/plan.js +0 -278
  297. package/dist/clients/dispatch/priorities.js +0 -20
  298. package/dist/clients/dispatch/rule-id-normalize.js +0 -50
  299. package/dist/clients/dispatch/rule-ignores.js +0 -62
  300. package/dist/clients/dispatch/rule-policy.js +0 -135
  301. package/dist/clients/dispatch/rules/async-noise.js +0 -40
  302. package/dist/clients/dispatch/rules/async-unnecessary-wrapper.js +0 -27
  303. package/dist/clients/dispatch/rules/cors-wildcard.js +0 -54
  304. package/dist/clients/dispatch/rules/error-obscuring.js +0 -32
  305. package/dist/clients/dispatch/rules/error-swallowing.js +0 -31
  306. package/dist/clients/dispatch/rules/framework-call-noise.js +0 -67
  307. package/dist/clients/dispatch/rules/high-complexity.js +0 -72
  308. package/dist/clients/dispatch/rules/high-fan-out.js +0 -74
  309. package/dist/clients/dispatch/rules/high-import-coupling.js +0 -37
  310. package/dist/clients/dispatch/rules/missing-error-propagation.js +0 -62
  311. package/dist/clients/dispatch/rules/no-commented-credentials.js +0 -52
  312. package/dist/clients/dispatch/rules/pass-through-wrappers.js +0 -42
  313. package/dist/clients/dispatch/rules/placeholder-comments.js +0 -40
  314. package/dist/clients/dispatch/rules/unsafe-boundary.js +0 -126
  315. package/dist/clients/dispatch/runner-context.js +0 -52
  316. package/dist/clients/dispatch/runners/actionlint.js +0 -113
  317. package/dist/clients/dispatch/runners/ast-grep-napi.js +0 -1196
  318. package/dist/clients/dispatch/runners/biome-check.js +0 -283
  319. package/dist/clients/dispatch/runners/cpp-check.js +0 -236
  320. package/dist/clients/dispatch/runners/credo.js +0 -80
  321. package/dist/clients/dispatch/runners/cue-vet.js +0 -398
  322. package/dist/clients/dispatch/runners/dart-analyze.js +0 -202
  323. package/dist/clients/dispatch/runners/detekt.js +0 -169
  324. package/dist/clients/dispatch/runners/dotnet-build.js +0 -159
  325. package/dist/clients/dispatch/runners/elixir-check.js +0 -210
  326. package/dist/clients/dispatch/runners/eslint.js +0 -154
  327. package/dist/clients/dispatch/runners/fact-rules.js +0 -29
  328. package/dist/clients/dispatch/runners/fish-indent.js +0 -69
  329. package/dist/clients/dispatch/runners/gleam-check.js +0 -87
  330. package/dist/clients/dispatch/runners/go-vet.js +0 -90
  331. package/dist/clients/dispatch/runners/golangci-lint.js +0 -120
  332. package/dist/clients/dispatch/runners/hadolint.js +0 -79
  333. package/dist/clients/dispatch/runners/helm-lint.js +0 -171
  334. package/dist/clients/dispatch/runners/helm-render.js +0 -940
  335. package/dist/clients/dispatch/runners/htmlhint.js +0 -108
  336. package/dist/clients/dispatch/runners/index.js +0 -108
  337. package/dist/clients/dispatch/runners/javac.js +0 -89
  338. package/dist/clients/dispatch/runners/ktlint.js +0 -136
  339. package/dist/clients/dispatch/runners/lsp.js +0 -378
  340. package/dist/clients/dispatch/runners/markdownlint.js +0 -160
  341. package/dist/clients/dispatch/runners/mypy.js +0 -101
  342. package/dist/clients/dispatch/runners/oxlint.js +0 -398
  343. package/dist/clients/dispatch/runners/php-lint.js +0 -62
  344. package/dist/clients/dispatch/runners/phpstan.js +0 -120
  345. package/dist/clients/dispatch/runners/prisma-validate.js +0 -62
  346. package/dist/clients/dispatch/runners/psscriptanalyzer.js +0 -445
  347. package/dist/clients/dispatch/runners/pyright.js +0 -169
  348. package/dist/clients/dispatch/runners/rubocop.js +0 -90
  349. package/dist/clients/dispatch/runners/ruff.js +0 -89
  350. package/dist/clients/dispatch/runners/rust-clippy.js +0 -251
  351. package/dist/clients/dispatch/runners/shellcheck.js +0 -169
  352. package/dist/clients/dispatch/runners/shfmt.js +0 -102
  353. package/dist/clients/dispatch/runners/spellcheck.js +0 -121
  354. package/dist/clients/dispatch/runners/spotbugs.js +0 -259
  355. package/dist/clients/dispatch/runners/sqlfluff.js +0 -174
  356. package/dist/clients/dispatch/runners/stylelint.js +0 -158
  357. package/dist/clients/dispatch/runners/swiftlint.js +0 -154
  358. package/dist/clients/dispatch/runners/taplo.js +0 -168
  359. package/dist/clients/dispatch/runners/terragrunt.js +0 -168
  360. package/dist/clients/dispatch/runners/tflint.js +0 -110
  361. package/dist/clients/dispatch/runners/tree-sitter.js +0 -620
  362. package/dist/clients/dispatch/runners/trivy-config.js +0 -247
  363. package/dist/clients/dispatch/runners/utils/availability-policy.js +0 -496
  364. package/dist/clients/dispatch/runners/utils/candidate-probe.js +0 -90
  365. package/dist/clients/dispatch/runners/utils/diagnostic-parsers.js +0 -85
  366. package/dist/clients/dispatch/runners/utils/lazy-installer.js +0 -274
  367. package/dist/clients/dispatch/runners/utils/runner-helpers.js +0 -1701
  368. package/dist/clients/dispatch/runners/utils/spawn-outcome.js +0 -101
  369. package/dist/clients/dispatch/runners/utils/tool-failure.js +0 -235
  370. package/dist/clients/dispatch/runners/utils/toolchain-availability.js +0 -169
  371. package/dist/clients/dispatch/runners/utils.js +0 -15
  372. package/dist/clients/dispatch/runners/vale.js +0 -116
  373. package/dist/clients/dispatch/runners/yaml-rule-parser.js +0 -242
  374. package/dist/clients/dispatch/runners/yamllint.js +0 -85
  375. package/dist/clients/dispatch/runners/zig-check.js +0 -91
  376. package/dist/clients/dispatch/suppress-writer.js +0 -69
  377. package/dist/clients/dispatch/tool-profile.js +0 -30
  378. package/dist/clients/dispatch/types.js +0 -21
  379. package/dist/clients/dispatch/utils/format-utils.js +0 -45
  380. package/dist/clients/dispatch/utils/lsp-diagnostics.js +0 -35
  381. package/dist/clients/disposition-logger.js +0 -32
  382. package/dist/clients/disposition-publish.js +0 -124
  383. package/dist/clients/durable-store.js +0 -97
  384. package/dist/clients/effective-config.js +0 -413
  385. package/dist/clients/env-utils.js +0 -83
  386. package/dist/clients/error-class.js +0 -23
  387. package/dist/clients/eval-timestamp.js +0 -17
  388. package/dist/clients/event-loop-hold.js +0 -274
  389. package/dist/clients/event-loop-monitor.js +0 -250
  390. package/dist/clients/extension-log.js +0 -504
  391. package/dist/clients/extension-mode.js +0 -73
  392. package/dist/clients/feature-hints.js +0 -103
  393. package/dist/clients/file-kinds.js +0 -412
  394. package/dist/clients/file-role.js +0 -134
  395. package/dist/clients/file-time.js +0 -160
  396. package/dist/clients/file-utils.js +0 -1032
  397. package/dist/clients/finding-delivery-gate.js +0 -463
  398. package/dist/clients/finding-identity.js +0 -88
  399. package/dist/clients/fix-worklog.js +0 -103
  400. package/dist/clients/format-events-publish.js +0 -343
  401. package/dist/clients/format-service.js +0 -222
  402. package/dist/clients/formatters-lazy.js +0 -9
  403. package/dist/clients/formatters.js +0 -1994
  404. package/dist/clients/freshness-cadence.js +0 -17
  405. package/dist/clients/freshness.js +0 -38
  406. package/dist/clients/generated-artifacts.js +0 -394
  407. package/dist/clients/generation-guard.js +0 -215
  408. package/dist/clients/git-guard.js +0 -923
  409. package/dist/clients/git-tracked-ignore.js +0 -243
  410. package/dist/clients/gitleaks-client.js +0 -509
  411. package/dist/clients/go-client.js +0 -104
  412. package/dist/clients/govulncheck-client.js +0 -605
  413. package/dist/clients/gradle-ktfmt-style.js +0 -252
  414. package/dist/clients/grammar-source.js +0 -465
  415. package/dist/clients/gzip-stage-write.js +0 -135
  416. package/dist/clients/hashline-anchor.js +0 -424
  417. package/dist/clients/hook-budgets.js +0 -76
  418. package/dist/clients/host-edit-normalize.js +0 -140
  419. package/dist/clients/host-ports.js +0 -39
  420. package/dist/clients/indent-retarget.js +0 -154
  421. package/dist/clients/install-diagnostics.js +0 -143
  422. package/dist/clients/installer/index.js +0 -5167
  423. package/dist/clients/installer/managed-tool-refresh-session.js +0 -58
  424. package/dist/clients/installer/managed-tool-refresh.js +0 -783
  425. package/dist/clients/instance-reaper-state.js +0 -7
  426. package/dist/clients/instance-reaper.js +0 -1137
  427. package/dist/clients/instance-registry-lock.js +0 -145
  428. package/dist/clients/instance-registry.js +0 -773
  429. package/dist/clients/jscpd-client.js +0 -370
  430. package/dist/clients/json-cache-read.js +0 -65
  431. package/dist/clients/knip-client.js +0 -788
  432. package/dist/clients/language-policy.js +0 -252
  433. package/dist/clients/language-profile.js +0 -361
  434. package/dist/clients/language-registry.js +0 -603
  435. package/dist/clients/latency-logger.js +0 -719
  436. package/dist/clients/lazy-import.js +0 -21
  437. package/dist/clients/ledger-bounds.js +0 -54
  438. package/dist/clients/lens-config.js +0 -346
  439. package/dist/clients/lens-engine.js +0 -358
  440. package/dist/clients/lens-events.js +0 -125
  441. package/dist/clients/lens-flag-registry.js +0 -467
  442. package/dist/clients/lens-map.js +0 -1156
  443. package/dist/clients/live-bus-emitter.js +0 -74
  444. package/dist/clients/log-cleanup.js +0 -222
  445. package/dist/clients/lsp/aggregation.js +0 -178
  446. package/dist/clients/lsp/cascade-tier.js +0 -421
  447. package/dist/clients/lsp/client.js +0 -4465
  448. package/dist/clients/lsp/config.js +0 -689
  449. package/dist/clients/lsp/diagnostic-binding.js +0 -225
  450. package/dist/clients/lsp/document-drift.js +0 -467
  451. package/dist/clients/lsp/edits.js +0 -1219
  452. package/dist/clients/lsp/index.js +0 -8305
  453. package/dist/clients/lsp/inferred-project.js +0 -216
  454. package/dist/clients/lsp/jvm-runtime.js +0 -298
  455. package/dist/clients/lsp/language.js +0 -63
  456. package/dist/clients/lsp/launch.js +0 -725
  457. package/dist/clients/lsp/lombok.js +0 -158
  458. package/dist/clients/lsp/path-utils.js +0 -5
  459. package/dist/clients/lsp/pending-aux-coverage.js +0 -251
  460. package/dist/clients/lsp/position-encoding.js +0 -61
  461. package/dist/clients/lsp/ruby-drive-dirs.js +0 -83
  462. package/dist/clients/lsp/server.js +0 -3209
  463. package/dist/clients/lsp/session-roots.js +0 -192
  464. package/dist/clients/lsp/spawn-history.js +0 -17
  465. package/dist/clients/lsp/sync-kind.js +0 -42
  466. package/dist/clients/lsp/tsserver-sync.js +0 -332
  467. package/dist/clients/lsp/wait-policy/capability-snapshot.js +0 -1
  468. package/dist/clients/lsp/wait-policy/classification.js +0 -85
  469. package/dist/clients/lsp/wait-policy/index.js +0 -10
  470. package/dist/clients/lsp/wait-policy/strategies.js +0 -303
  471. package/dist/clients/lsp/watch-queue.js +0 -61
  472. package/dist/clients/lsp/workspace-diagnostics-cache.js +0 -639
  473. package/dist/clients/lsp/workspace-diagnostics-session.js +0 -30
  474. package/dist/clients/lsp/workspace-sweep-hold.js +0 -184
  475. package/dist/clients/lsp-budget.js +0 -186
  476. package/dist/clients/lsp-document-symbols.js +0 -110
  477. package/dist/clients/lsp-lazy.js +0 -9
  478. package/dist/clients/lsp-mutation.js +0 -396
  479. package/dist/clients/lsp-status.js +0 -59
  480. package/dist/clients/map-with-concurrency.js +0 -40
  481. package/dist/clients/mcp/analyze.js +0 -420
  482. package/dist/clients/mcp/host-shim.js +0 -31
  483. package/dist/clients/mcp/ipc.js +0 -335
  484. package/dist/clients/mcp/review.js +0 -151
  485. package/dist/clients/mcp/session.js +0 -412
  486. package/dist/clients/memory-sampler.js +0 -208
  487. package/dist/clients/message-end-attribution.js +0 -30
  488. package/dist/clients/metrics-client.js +0 -107
  489. package/dist/clients/metrics-history.js +0 -327
  490. package/dist/clients/middle-man-analysis.js +0 -263
  491. package/dist/clients/model-provider.js +0 -53
  492. package/dist/clients/module-report-lsp.js +0 -189
  493. package/dist/clients/module-report.js +0 -2150
  494. package/dist/clients/mutating-tool.js +0 -651
  495. package/dist/clients/mutation-attribution.js +0 -368
  496. package/dist/clients/mutation-bridge.js +0 -240
  497. package/dist/clients/ndjson-logger.js +0 -734
  498. package/dist/clients/observed-mutation-sources.js +0 -101
  499. package/dist/clients/observed-mutation.js +0 -1253
  500. package/dist/clients/oldtext-autopatch.js +0 -128
  501. package/dist/clients/opaque-mutation-scan.js +0 -496
  502. package/dist/clients/opengrep-client.js +0 -328
  503. package/dist/clients/opengrep-config.js +0 -76
  504. package/dist/clients/package-manager.js +0 -607
  505. package/dist/clients/package-root.js +0 -38
  506. package/dist/clients/partial-edit-apply.js +0 -439
  507. package/dist/clients/path-attribution-telemetry.js +0 -43
  508. package/dist/clients/path-keyed-map.js +0 -108
  509. package/dist/clients/path-utils.js +0 -1244
  510. package/dist/clients/performance-report.js +0 -331
  511. package/dist/clients/persist-debounce.js +0 -70
  512. package/dist/clients/persistent-reverify.js +0 -271
  513. package/dist/clients/php-cs-fixer-config.js +0 -119
  514. package/dist/clients/pipeline.js +0 -1425
  515. package/dist/clients/post-autofix-notice.js +0 -37
  516. package/dist/clients/print-mode.js +0 -21
  517. package/dist/clients/probe-home-state.js +0 -228
  518. package/dist/clients/process-bridge.js +0 -66
  519. package/dist/clients/process-singletons.js +0 -210
  520. package/dist/clients/process-snapshot.js +0 -68
  521. package/dist/clients/project-changes.js +0 -181
  522. package/dist/clients/project-conventions.js +0 -171
  523. package/dist/clients/project-diagnostics/cache.js +0 -137
  524. package/dist/clients/project-diagnostics/extractors.js +0 -109
  525. package/dist/clients/project-diagnostics/fresh-fetch.js +0 -650
  526. package/dist/clients/project-diagnostics/runner-adapters/call-graph-impact.js +0 -118
  527. package/dist/clients/project-diagnostics/runner-adapters/dead-code.js +0 -47
  528. package/dist/clients/project-diagnostics/runner-adapters/gitleaks.js +0 -40
  529. package/dist/clients/project-diagnostics/runner-adapters/govulncheck.js +0 -34
  530. package/dist/clients/project-diagnostics/runner-adapters/jscpd.js +0 -38
  531. package/dist/clients/project-diagnostics/runner-adapters/knip.js +0 -47
  532. package/dist/clients/project-diagnostics/runner-adapters/madge.js +0 -48
  533. package/dist/clients/project-diagnostics/runner-adapters/opengrep.js +0 -40
  534. package/dist/clients/project-diagnostics/runner-adapters/runner-findings.js +0 -127
  535. package/dist/clients/project-diagnostics/runner-adapters/trivy.js +0 -81
  536. package/dist/clients/project-diagnostics/scanner.js +0 -520
  537. package/dist/clients/project-diagnostics/types.js +0 -1
  538. package/dist/clients/project-lens-config.js +0 -799
  539. package/dist/clients/project-report.js +0 -701
  540. package/dist/clients/project-scale.js +0 -237
  541. package/dist/clients/project-scan-policy.js +0 -11
  542. package/dist/clients/project-snapshot-fingerprint.js +0 -48
  543. package/dist/clients/project-snapshot-persist-worker.js +0 -20
  544. package/dist/clients/project-snapshot.js +0 -1653
  545. package/dist/clients/project-trust.js +0 -181
  546. package/dist/clients/python-environment.js +0 -217
  547. package/dist/clients/python-provenance.js +0 -639
  548. package/dist/clients/quiet-window-config.js +0 -47
  549. package/dist/clients/quiet-window.js +0 -236
  550. package/dist/clients/read-bridge.js +0 -139
  551. package/dist/clients/read-expansion.js +0 -266
  552. package/dist/clients/read-guard-logger.js +0 -251
  553. package/dist/clients/read-guard-tool-lines.js +0 -1306
  554. package/dist/clients/read-guard.js +0 -1561
  555. package/dist/clients/recent-touches.js +0 -240
  556. package/dist/clients/redact/secrets.js +0 -449
  557. package/dist/clients/resource-sampler.js +0 -628
  558. package/dist/clients/reverse-deps.js +0 -270
  559. package/dist/clients/review-graph/builder.js +0 -5118
  560. package/dist/clients/review-graph/format.js +0 -33
  561. package/dist/clients/review-graph/git-identity.js +0 -157
  562. package/dist/clients/review-graph/import-resolvers.js +0 -481
  563. package/dist/clients/review-graph/persist-worker.js +0 -10
  564. package/dist/clients/review-graph/query.js +0 -244
  565. package/dist/clients/review-graph/revision-drift.js +0 -21
  566. package/dist/clients/review-graph/service.js +0 -96
  567. package/dist/clients/review-graph/shared-extraction-ir.js +0 -82
  568. package/dist/clients/review-graph/symbol-id.js +0 -103
  569. package/dist/clients/review-graph/tsconfig-paths.js +0 -299
  570. package/dist/clients/review-graph/types.js +0 -1
  571. package/dist/clients/review-graph/workspace-modules.js +0 -449
  572. package/dist/clients/review-graph-logger.js +0 -81
  573. package/dist/clients/ruff-client.js +0 -152
  574. package/dist/clients/rules-scanner.js +0 -131
  575. package/dist/clients/run-duration.js +0 -55
  576. package/dist/clients/runtime-agent-end.js +0 -746
  577. package/dist/clients/runtime-config.js +0 -77
  578. package/dist/clients/runtime-context.js +0 -211
  579. package/dist/clients/runtime-coordinator.js +0 -1290
  580. package/dist/clients/runtime-session.js +0 -2485
  581. package/dist/clients/runtime-tool-call.js +0 -1284
  582. package/dist/clients/runtime-tool-result.js +0 -2034
  583. package/dist/clients/runtime-turn.js +0 -3600
  584. package/dist/clients/rust-client.js +0 -97
  585. package/dist/clients/safe-spawn.js +0 -2166
  586. package/dist/clients/sanitize.js +0 -286
  587. package/dist/clients/scan-utils.js +0 -25
  588. package/dist/clients/scratch-tree-policy.js +0 -165
  589. package/dist/clients/search-read-registration.js +0 -94
  590. package/dist/clients/secret-findings.js +0 -114
  591. package/dist/clients/security-scan-client.js +0 -352
  592. package/dist/clients/session-event-guard.js +0 -297
  593. package/dist/clients/session-lifecycle.js +0 -484
  594. package/dist/clients/session-start-observability.js +0 -94
  595. package/dist/clients/session-state-store.js +0 -101
  596. package/dist/clients/session-summary.js +0 -15
  597. package/dist/clients/sessionstart-logger.js +0 -27
  598. package/dist/clients/sg-runner.js +0 -876
  599. package/dist/clients/sgconfig.js +0 -347
  600. package/dist/clients/shared-checkout-guard.js +0 -338
  601. package/dist/clients/single-flight.js +0 -158
  602. package/dist/clients/situational-tool-telemetry.js +0 -108
  603. package/dist/clients/skills-resolver.js +0 -141
  604. package/dist/clients/slow-fs.js +0 -138
  605. package/dist/clients/smells-rollup.js +0 -231
  606. package/dist/clients/source-filter.js +0 -596
  607. package/dist/clients/source-walker.js +0 -211
  608. package/dist/clients/spawn-output-cap.js +0 -37
  609. package/dist/clients/spawn-timeout-cooldown.js +0 -110
  610. package/dist/clients/stale-marker.js +0 -17
  611. package/dist/clients/startup-scan.js +0 -400
  612. package/dist/clients/startup-timing.js +0 -130
  613. package/dist/clients/string-utils.js +0 -33
  614. package/dist/clients/subagent-mode.js +0 -111
  615. package/dist/clients/symbol-containment.js +0 -24
  616. package/dist/clients/symbol-types.js +0 -5
  617. package/dist/clients/test-runner-client.js +0 -2507
  618. package/dist/clients/test-runner-delivery.js +0 -287
  619. package/dist/clients/todo-scanner.js +0 -229
  620. package/dist/clients/tool-agreement.js +0 -423
  621. package/dist/clients/tool-config.js +0 -249
  622. package/dist/clients/tool-cwd.js +0 -270
  623. package/dist/clients/tool-definition.js +0 -47
  624. package/dist/clients/tool-event.js +0 -105
  625. package/dist/clients/tool-policy.js +0 -2755
  626. package/dist/clients/tool-probe.js +0 -53
  627. package/dist/clients/tool-render.js +0 -156
  628. package/dist/clients/tool-set-policy.js +0 -118
  629. package/dist/clients/tree-sitter-cache.js +0 -364
  630. package/dist/clients/tree-sitter-client.js +0 -4134
  631. package/dist/clients/tree-sitter-logger.js +0 -100
  632. package/dist/clients/tree-sitter-navigator.js +0 -269
  633. package/dist/clients/tree-sitter-query-loader.js +0 -569
  634. package/dist/clients/tree-sitter-shared.js +0 -158
  635. package/dist/clients/tree-sitter-symbol-extractor.js +0 -1265
  636. package/dist/clients/trivy-client.js +0 -467
  637. package/dist/clients/tui-fit.js +0 -50
  638. package/dist/clients/turn-context.js +0 -52
  639. package/dist/clients/turn-summary-render.js +0 -72
  640. package/dist/clients/turn-summary.js +0 -132
  641. package/dist/clients/typos-config.js +0 -29
  642. package/dist/clients/user-notify.js +0 -51
  643. package/dist/clients/vanished-instance-marker.js +0 -57
  644. package/dist/clients/warm-attach.js +0 -246
  645. package/dist/clients/widget-state.js +0 -1677
  646. package/dist/clients/word-index-logger.js +0 -49
  647. package/dist/clients/word-index-store.js +0 -459
  648. package/dist/clients/word-index.js +0 -2080
  649. package/dist/clients/workspace-topology.js +0 -389
  650. package/dist/clients/write-ordering-guard.js +0 -65
  651. package/dist/clients/zizmor-config.js +0 -327
  652. package/dist/i18n.js +0 -69
  653. package/dist/mcp/build-staleness.js +0 -124
  654. package/dist/scripts/lib/process-scan.mjs +0 -583
  655. package/dist/scripts/lib/skills-predicate.mjs +0 -129
  656. package/dist/tools/activate-tools.js +0 -87
  657. package/dist/tools/ast-grep-outline.js +0 -137
  658. package/dist/tools/ast-grep-replace.js +0 -244
  659. package/dist/tools/ast-grep-search.js +0 -762
  660. package/dist/tools/effective-config.js +0 -90
  661. package/dist/tools/lens-diagnostic-mark.js +0 -375
  662. package/dist/tools/lens-diagnostics.js +0 -2544
  663. package/dist/tools/lsp-diagnostics.js +0 -1634
  664. package/dist/tools/lsp-navigation.js +0 -1367
  665. package/dist/tools/lsp-structured-output.js +0 -294
  666. package/dist/tools/module-report.js +0 -382
  667. package/dist/tools/project-report.js +0 -86
  668. package/dist/tools/render-compact.js +0 -374
  669. package/dist/tools/scan-progress.js +0 -53
  670. package/dist/tools/shared.js +0 -29
  671. package/dist/tools/symbol-search.js +0 -155
@@ -0,0 +1,694 @@
1
+ # pi-lens merge policy — role contract
2
+
3
+ Run the review → verify → merge policy over one or more open PRs: landing a
4
+ PR, babysitting the merge queue, processing a review backlog. It encodes the
5
+ standing quality gates so any session applies the same discipline.
6
+
7
+ > Source of truth for every rule below is `AGENTS.md` ("Orchestration and
8
+ > delegated work", plus the defect catalog). This file
9
+ > is the procedure and the record; on any conflict AGENTS.md wins. It replaces
10
+ > the former `merge-train` skill (#3837); the merge-train lane that skill also
11
+ > described is retired.
12
+
13
+ The policy that landed the 2026-08-17 arc (11 PRs, every one adversarially
14
+ reviewed, zero unreviewed merges). Apply it to each PR in the queue.
15
+
16
+ A fix to a CI lane or workflow is accepted only when that lane's own run on
17
+ the PR's exact head completes inside its `timeout-minutes`, with the
18
+ acceptance surface quoted from that run's log. Any self-bound inside the lane
19
+ must sit below the job cap by a stated margin so the loud-failure path is
20
+ reachable.
21
+
22
+ Every PR body starts with `## Why`, `## Notes for the reviewer`, and
23
+ `## Change outline`, followed by the existing `## Summary`, `## Tests`,
24
+ `## Blast radius`, `## Class sweep`, and `## Observability` sections. The
25
+ change outline is the changed symbol's caller/callee tree with `+`/`-` on
26
+ moved lines; include only structural views that changed.
27
+
28
+ ## The loop, per PR
29
+
30
+ 1. **Review.** Spawn `pi-lens-reviewer` (worktree isolation) with the PR
31
+ number, a one-paragraph summary of the claim, and any PR-specific attack
32
+ angles. Self-authored and small PRs get reviewed too — the depth follows
33
+ the review tier below, never the priority label.
34
+ 2. **Fix rounds.** Send findings back to the PR's original author agent when
35
+ its worktree survives (SendMessage — cheapest context); otherwise spawn
36
+ `pi-lens-fixer` on the branch with the findings inlined.
37
+ **Since #2486, `SubagentStop` REAPS the stopped agent's own worktree**
38
+ (maintainer decision, 2026-09-02, reversing the earlier "never removes
39
+ here" rule, which left ten stale trees in one afternoon). So by default an
40
+ agent's tree is gone the moment it finishes, and SendMessage to it lands on
41
+ a branch with no checkout. Its branch survives — a tree is never removed
42
+ unless its HEAD is already in an `origin/*` ref — so nothing committed is
43
+ lost and a fresh `pi-lens-fixer` on the branch always works. If this
44
+ session intends to resume fixers by SendMessage, export
45
+ `PILENS_HYGIENE_KEEP_AGENT_TREES=1` for the session (or add
46
+ `--keep-agent-tree` to the registered hook) and the reap is off.
47
+ Kept trees are then reaped by the `SessionStart` sweep —
48
+ which runs on `startup` and `resume` only, not on `/clear`, compaction or a
49
+ fork — once they have been idle ≥30m and are clean and pushed. Idle is
50
+ measured from the checkout directory and the worktree's HEAD (and its
51
+ reflog), never from the git index, so the sweep's own dirty check cannot
52
+ make a finished tree look busy.
53
+ A tree with uncommitted work, or with work not yet on an `origin/*` ref, is
54
+ never removed at any age, by any sweep — so a fix round in flight is safe by
55
+ its own state, not by the clock.
56
+ 3. **Verify.** The SAME reviewer verifies each fix round with its own probes.
57
+ Do not take the fixer's word; do not swap reviewers mid-PR. A reviewer's
58
+ worktree is an `agent-*` tree too, so once its report lands the tree is
59
+ clean+pushed and `SubagentStop` reaps it exactly like a fixer's — a
60
+ SendMessage resume finds no checkout, same as above. Recreate it: the
61
+ merge-train practice is a FRESH reviewer worktree per VERIFY round, not a
62
+ kept one. Continuity is the reviewer AGENT (SendMessage still reaches the
63
+ same identity, so the same judgment and probes carry over); the checkout
64
+ under it is expected to be rebuilt each round, not preserved. Do not set
65
+ `--keep-agent-tree` / `PILENS_HYGIENE_KEEP_AGENT_TREES=1` merely to dodge
66
+ this — that decision stays off by default (see step 2).
67
+ 4. **Merge gate.** Merge only when: verdict is merge-ready; every gating check
68
+ genuinely EXECUTED and passed on the exact head SHA
69
+ (`node scripts/ci-verdict.mjs <pr-number|sha>` — a DIRTY PR silently skips
70
+ them, absent is not green); every failing check
71
+ was read and judged (infra failures — codeload 429/503, SARIF-upload
72
+ errors, Initialize-CodeQL outages — may be waved through only with the
73
+ log read and the judgment recorded). A PR that is green on its head but
74
+ whose merge with `origin/master` was not tested against the exact-pin
75
+ sweeps is not green — run the sweep on the merge before merging. Apply
76
+ AGENTS.md's one mutation layer (#4005): new-guard proof and demonstrated
77
+ correctness gaps gate the merge. `ci-verdict` prints no mutation line, and
78
+ the nightly Stryker report is not a merge input.
79
+ 5. **Merge.** `gh pr merge <N> --merge` (merge commit, repo convention).
80
+ If "not up to date", `gh api -X PUT .../pulls/<N>/update-branch`, wait for
81
+ CI, re-gate, merge. On GitHub 503s: retry with backoff, never switch to
82
+ raw-API merge endpoints.
83
+ Alternative, once the verdict is in: arm GitHub auto-merge
84
+ (`gh pr merge <N> --auto --merge`) and let it land the PR when the required
85
+ checks are green on the current head. Steps 1 through 4 are unchanged: arm
86
+ it only after the review verdict and with the pushed SHA verified.
87
+ 6. **After each merge.** Master moved: check other open PRs for BEHIND/DIRTY,
88
+ check in-flight agents for file overlap with the merged diff and nudge
89
+ affected ones to merge origin/master before their next push.
90
+ Then prune the lane — and ONLY the lane: the merged-ness test is "this
91
+ tree's branch is the head of the PR just merged" (`gh pr view <n> --json
92
+ headRefName`), never `merge-base --is-ancestor`: a live fixer's branch
93
+ with no commits yet passes the ancestor test, and on 2026-09-06 that
94
+ removed #2358's tree with its uncommitted work. `git worktree remove` every tree on the merged
95
+ branch (fixer AND reviewer trees, wherever they were created) and delete
96
+ the merged local branch. A lane's tree lives until its PR merges, not
97
+ after — the orchestrator owns this step; the reaper only sees
98
+ `.claude/worktrees/agent-*`, and on 2026-09-06 twenty-one merged trees
99
+ were still standing at the regroup.
100
+
101
+ ## Merge queue (once the maintainer enables it, #3754)
102
+
103
+ The repository merges through GitHub's merge queue after the maintainer applies
104
+ the settings in `docs/merge-queue-rollout.md`. Until then every rule above is
105
+ unchanged. With the queue on:
106
+
107
+ - **Enqueue, do not merge.** `gh pr merge <N> --merge` (add `--auto` while
108
+ checks are still pending) enqueues the PR: `gh` routes through the queue when
109
+ the base branch requires one, and a direct merge is refused (step 5). The queue tests the PR merged onto the
110
+ LATEST master in a `gh-readonly-queue/master/pr-<N>-<sha>` ref via a
111
+ `merge_group` run of `ci.yml` and `lint.yml`, then merges it with a merge
112
+ commit.
113
+ - **In the queue is a state, not absent and not done.** `ci-verdict <pr>` on a
114
+ queued PR with a green head exits 3, kind `in-queue`, naming the queue state
115
+ and position (`--wait` keeps waiting). A PR that was ejected after a FAILED
116
+ queue run exits 1, kind `failed`, reason `merge queue run failed and ejected
117
+ the PR`, with the failing job, step and test lines read from the
118
+ `merge_group` run. Treat that exactly as a red PR run: fix, push, enqueue
119
+ again. A failure from before the head's last push is an earlier head's and is
120
+ ignored. The queue read is one GraphQL call each time a poll finds the head's
121
+ own checks green (a red or still-running head costs none); an in-queue PR
122
+ stays pending, so under `--wait` the queue is re-read once per poll until it
123
+ merges or ejects. Without a queue on master it is the only extra call.
124
+ - **Retire update-branch and BEHIND.** The queue tests against the latest
125
+ master itself, so `gh pr update-branch`, "not up to date" retries, and the
126
+ `gh run rerun` replays-the-old-merge-commit workaround are moot. Worse, any
127
+ push to a queued PR re-runs every check and EJECTS it;
128
+ ci-verdict's update-branch hint reads "do not update-branch" when master has a
129
+ queue. The pre-queue rules for retargeting (push to re-arm CI) still apply to
130
+ the PR's own `pull_request` run.
131
+ - **What still gates enqueueing.** The PR's own head must still be green:
132
+ the same exit-0 merge gate as step 4, then enqueue. The `merge_group` run
133
+ re-checks the same required checks on the merge commit; a check that is
134
+ required but never reports there (a workflow without a `merge_group`
135
+ trigger) stalls the queue, which `tests/config/merge-queue-workflows.test.ts`
136
+ pins.
137
+ - **No competing merge lane.** The `train:approved` lane that merged through
138
+ the REST merge API was retired (#3837); every merge now goes through
139
+ `gh pr merge` (auto-merge or direct), which the queue intercepts when the
140
+ base branch requires one.
141
+
142
+ ## Queue ordering
143
+
144
+ Order by dependency, not age: a PR whose schema/API another PR must consume
145
+ merges first (the consumer then rebases and wires the new surface). Two PRs
146
+ editing the same file get an explicit order decided up front. Log-schema
147
+ changes must extend exact-key pins (`BASELINE_KEYS`-style), never loosen them.
148
+
149
+ ## Quota gate (orchestrator)
150
+
151
+ Before ANY new dispatch (not a fix round on an open PR): know the account's
152
+ 5h and weekly usage. Above 75% of the 5h window or 85% of the weekly window,
153
+ no new work — finish in-flight lanes and merge on green. The numbers are
154
+ readable live: `GET https://api.anthropic.com/api/oauth/usage` with the OAuth
155
+ token from `~/.claude/.credentials.json` (`anthropic-beta: oauth-2025-04-20`)
156
+ returns `five_hour.utilization` / `seven_day.utilization` and reset times; the
157
+ `~/.claude/hooks/quota-gate.mjs` PreToolUse hook on `Agent` reads them and
158
+ blocks dispatch above the thresholds (no hand-written fallback;
159
+ `QUOTA_GATE_OVERRIDE=1` lifts it when the maintainer says so). Read the meters at session start and before
160
+ every refill; state them in the lane ledger. Standing rule from
161
+ 2026-09-03, lifted only when the maintainer says so.
162
+
163
+ ## Brief contract (orchestrator)
164
+
165
+ Before dispatching any issue that adds a shared helper or seam: grep for
166
+ same-shape siblings yourself and write the fold into the SAME slice, or write
167
+ the sibling list, the reason folding is unsafe in one PR, and the follow-up
168
+ issue into the brief. AGENTS.md's net-count rule binds the brief author; the
169
+ fixer and reviewer only enforce what the brief scoped. #2530 shipped a fifth
170
+ bound helper because the brief deferred the fold without a reason.
171
+
172
+ ## External reports (orchestrator)
173
+
174
+ The contract lives in AGENTS.md, "Issue triage (standing rule)" — assess the
175
+ report against the code before accepting or dispatching, ask the one or two
176
+ facts that would change the design, **do not dispatch work that depends on an
177
+ unanswered load-bearing question**, mirror the answer on the issue and point
178
+ the worker there rather than at a paraphrase, and cite the reporter's reasoning
179
+ as authority. Read it there; this section only points at it.
180
+
181
+ The train-specific consequence: an external lane's first dispatch is often
182
+ worth delaying by one exchange. On 2026-09-12 a fixer was dispatched on #3000
183
+ between asking the question and receiving the answer, and the answer invalidated
184
+ the brief's central premise — the correction cost a mid-flight `plegma_send` and
185
+ rework that waiting ten minutes would have avoided entirely.
186
+
187
+ ## Filing issues (orchestrator)
188
+
189
+ Every `gh issue create` carries one TYPE label, at least one `area:*`, and
190
+ exactly one `priority:p1|p2|p3` (AGENTS.md #1676 rubric). The priority labels
191
+ were found deleted from the repo on 2026-09-03 and recreated (#2553); an
192
+ issue filed without one is a triage defect, not a shortcut.
193
+
194
+ Every reviewer **follow-up issue** generalization verdict is filed and assigned
195
+ to a seam group on the tracking queue in the same turn. At each regroup, scan
196
+ merged PRs for subset-shaped changes that lack a generalization verdict.
197
+
198
+ Before filing a review follow-up, apply the standing fold rule: fold same-seam
199
+ or same-file items that are about one commit and need no maintainer decision
200
+ into the same PR. Contract-only folds are trailing commits with no
201
+ re-verification; small code folds carry a red-first test and return to the same
202
+ reviewer. File only different-seam, blocked, decision-dependent, untouched
203
+ pre-existing, or risk-class-changing items, as one consolidated issue per PR.
204
+
205
+ ## Round-count rail (orchestrator)
206
+
207
+ When a verify round reports that a fix round introduced a NEW defect on the
208
+ same record or seam (not merely left one), the next fix brief opens with
209
+ AGENTS.md's state-space step — invariants, writers × axes, the cell list —
210
+ written into the PR body BEFORE any edit, and the fixer is Opus. Never send a
211
+ third patch-only round: #2528 went r2 → r3 → r4 on one cache record, each
212
+ round fixing three findings and adding two, until the model was demanded.
213
+
214
+ ## Orchestrator invariants (any orchestrator, not only Claude)
215
+
216
+ These are the habits the train depends on. They live here, not in any one
217
+ operator's private notes, so a different orchestrator can run the same train.
218
+
219
+ - **Contracts move in the same session.** When a review or a dogfood finding
220
+ reveals a defect CLASS (not an instance), add a numbered shape to AGENTS.md's
221
+ catalog with the issue ref and a one-line screen, extend the fixer's screen
222
+ list, and cite the number in the next brief — before the next dispatch. "To
223
+ err twice is not the mark of a wise man." (2026-09-03: shapes 28–36 came out
224
+ of one day's reviews this way.)
225
+ - **Second instance of a catalogued shape opens the consolidation lane, not a
226
+ third instance fix (2026-09-09).** The trigger is the shape recurring at all,
227
+ not only twice in one session: when a review, an issue or a dogfood finding
228
+ is the second member of a shape already in AGENTS.md's catalog, the
229
+ orchestrator files the consolidation lane BEFORE the second instance merges,
230
+ with three fixed deliverables: one seam every consumer calls, one log line
231
+ per resolution (which value was chosen and why, throttled once per key per
232
+ session), and one bounded degradation record for the fallback path. The
233
+ record: #2691 (yamllint cwd) and #2756 (Prettier ignore cwd) were shape 40
234
+ twice in one week; each was fixed at its own seam with no log line, and the
235
+ maintainer had to ask for the seam (#2777). "Contracts move in the same
236
+ session" covers the catalog row; this rule covers the code.
237
+ - **An external bug's first round is the probe, not the fix (2026-09-09).**
238
+ For any bug reported from outside (or any bug whose symptom is a tool
239
+ verdict), the first delegation is an investigator or a fixer whose FIRST
240
+ deliverable is the reporter's symptom reproduced through the production
241
+ entry point (the tool handler / MCP tool, not a seam beneath it), red on
242
+ master, before any state-space table or edit. A fix brief that names a
243
+ suspected seam is a hypothesis and says so. The record: #2776 spent seven
244
+ fixer rounds on `clients/lsp/client.ts` (pull-vs-push classification) —
245
+ each internally consistent, each verified — before a premise probe through
246
+ `LSPService.touchFile` showed master already returned the pushed
247
+ diagnostic; one investigator round through `createLspDiagnosticsTool`
248
+ then found the real cause in `tools/lsp-diagnostics.ts` (primary/auxiliary
249
+ partition by `diagnostic.source`). Principles §1 "Premise first" already
250
+ said this; the train had been dispatching fixers on the orchestrator's guess.
251
+ - **Every "should have been caught by" names a nightly or smoke row, and
252
+ the row is filed the same day.** A detection retrospective that ends in
253
+ prose is not a retrospective. #2776 (emmylua_ls declares pull diagnostics
254
+ but only pushes → false "confirmed clean") was reachable by a
255
+ declared-vs-observed channel probe the capability matrix never ran, and by
256
+ the custom-`lsp.servers` population the matrix never covers.
257
+ - **Brief pre-flight by touched surface (2026-09-09).** Before dispatching a
258
+ fixer, read what the fix WILL touch and put the matching dependents into the
259
+ brief's required test set. Every row below cost at least one extra round
260
+ today because the fixer ran only "targeted files":
261
+
262
+ | Fix touches | Brief must name |
263
+ |---|---|
264
+ | a new export on a module that has `vi.mock` doubles | every test file that mocks that module (`grep -rl 'vi.mock(".*<module>' tests`), run them all — #2782 r1: 30 reds in 6 files |
265
+ | a field on a durable or shared record (cache entry, diagnostic, ledger row) | old-record parse proof, cache schema version, and every test that deep-equals or snapshots the record — #2783 r1/r3 |
266
+ | a test that spawns a real child (LSP fake server, tool smoke, installer) | the lane admission (header + `vitest.config.ts` project + coverage baseline) and `tests/config/` — #2783 r5 |
267
+ | a new fixture under `tests/fixtures/` | the fixture-contract sweeps for that directory (style-preserving, population guards) — #2782 r2 |
268
+ | a change that touches identifier uses of a glossary-retired synonym | run `tests/config/glossary-synonym-sweep.test.ts` on the head AND on the merge with `origin/master`, then re-pin in the PR from the sweep's own `UNPINNED`/`STALE` output — #3279, #3283, #3284, #3288 |
269
+ | a new `vi.mock` in a test file | run `tests/config/vi-mock-export-sweep.test.ts`; whole-module mocks of a production module must spread `importOriginal` — PR #3268's CI red, fixed by trailing commit `621d61c5c` |
270
+ | a changelog fragment | front matter `section: <Section>` plus `audience: user` or `audience: internal` and exactly one top-level `- **Title (refs #N)** —` entry, never `CHANGELOG.md`, validated by `node scripts/check-changelog-fragments.mjs` — PR #3268 r1 shipped `category:` and a paragraph |
271
+ | a PR body | the header gate: exactly one-sentence `## Why`, `## Notes for the reviewer`, `## Change outline`, plus Summary / Tests with `### Test assessment` / Blast radius / Class sweep / Observability; run `node scripts/check-pr-body.mjs --lint-local` before pushing — three PRs this week needed orchestrator body edits |
272
+ | a whole-tree docs restructure of `AGENTS.md` | every governance test that reads `AGENTS.md`, with markers on their own lines — PR #3265 r1 |
273
+ | a raw poll in a test | the flake-shape ratchet; the fix is the governed wait, never a header admission — #2781 r1 |
274
+ | a new, renamed or deleted rule file under `rules/` | `npm run docs:rule-catalogs` and commit the generated catalog; `tests/scripts/rule-catalogs.test.ts` is a strict consumer of every rule file, not of rule ids — #3214 r1 |
275
+
276
+ - **Sandbox by test shape (2026-09-09).** A lane whose tests spawn children
277
+ (LSP fake server, tool smoke, installer, formatter wire) is dispatched with
278
+ the runner's full-access mode from round 1. #2781 spent four rounds with a
279
+ fixer that could not run its own wire tests and reasoned about ordering
280
+ instead of observing it; the first full-access round found the cause in
281
+ one pass.
282
+ - **A CI-only red is reproduced in the job's shape before any fix.** Replicate
283
+ the job env (the `npm test` PATH prefix with `node_modules/.bin`, a pinned
284
+ `HOME`, no `PI_LENS_HOME`) and trace the leg that differs; a fix that only
285
+ passes under `node_modules/.bin/vitest run` is a guess. #2775 carried one
286
+ CI-only red through three rounds until round 5 traced it to the npm PATH
287
+ prefix resolving the dev-dependency `oxfmt` past the mocked `which`.
288
+ - **Follow-up rounds go to the same worker by send, not a fresh delegation,**
289
+ while its handle is alive: it keeps the diff and the reasoning, and the
290
+ brief shrinks to the findings. Release only when the lane moves to review.
291
+ A fresh worker on a resume loses uncommitted work.
292
+ - **Release a reviewer handle only after reading a merge-ready verdict.** A fix
293
+ round resumes the SAME reviewer via `resumeFrom` with the model pinned. Twice
294
+ this week (PRs #3263 r2 and #3261 r2), release ran in the same batch as the
295
+ read and continuity was lost.
296
+ - **Fleet inventory at every settlement.** A one-shot watch misses anything
297
+ that settles while it is disarmed: after each settlement,
298
+ list live workers and read every `done` handle not yet consumed. Two lanes
299
+ sat finished for 90 minutes today.
300
+ - **Keep a lane ledger.** One file, one row per lane: issue/PR, worker id,
301
+ round, state, head SHA, merge-order note, and for bug lanes
302
+ `caught by / should have been caught by`; a header line with the quota
303
+ reading and the merged list. Update it on every dispatch, report and merge.
304
+ It is what survives a context reset. `state` is one of exactly:
305
+ `not started`, `fixing rN`, `waiting on CI`, `waiting on review`,
306
+ `waiting on verify`, `blocked`, `ready to merge`, `merged`,
307
+ `needs user decision`, `held` — a fixed vocabulary so a resumed session
308
+ (or a different orchestrator) can build the status table without reading
309
+ the transcripts, and so "needs user decision" and "held" are visible as
310
+ rows rather than buried in prose. (Borrowed 2026-09-07 from the heartbeat
311
+ classification in aromanarguello/roman-skills `orchestrate-lane`.)
312
+ - **A lane's worktree lives until its PR merges.** Pruning it after a report
313
+ makes the owning worker un-resumable, so every fix round then costs a fresh
314
+ worker. Prune on merge, or when the lane is abandoned.
315
+ - **Scope changes are mirrored on the issue before they are sent.** A fixer
316
+ cannot verify a mid-task `SendMessage`; it CAN verify an issue comment.
317
+ Post the comment first, then send the message pointing at it
318
+ (`docs/pi-lens-subagent.md` tells every worker to check). Unmirrored
319
+ additions are declined by design.
320
+ - **Dependabot PRs merge on real checks, no issue needed (maintainer,
321
+ 2026-09-07).** The PR-title issue-ref gate is a policy check this train
322
+ applies to human PRs; a bump title can never carry a ref. Merge order: one
323
+ at a time (each merge dirties the rest; dependabot rebases them itself);
324
+ gate on Lint, Unit tests and every non-advisory check on the exact head;
325
+ pr-metadata.yml itself skips "PR title", "PR body (advisory)" and
326
+ "Close-keyword syntax" for dependabot (2026-09-09, refs #2714), so nothing
327
+ needs hand-ignoring; hold anything red on a real check
328
+ with a comment naming the check (2026-09-07: tsls 6 needs a Node-floor bump, biome
329
+ fails the install test, vitest 5 fails four gates; a bump whose install
330
+ script is pinned by `allowScripts` needs the pin moved in a maintainer
331
+ commit on the bump branch). A major bump with peers (vitest + coverage-v8)
332
+ lands together or not at all.
333
+ - **Detector, ratchet and governance-sweep authoring goes to Opus from
334
+ round 1.** Their correctness lives in parsing edge cases, exactly where the
335
+ smaller model loses: #2693 took two Sonnet rounds (~720k tokens) on a text
336
+ scanner before the rail sent round 3 to Opus, which rewrote it on the AST
337
+ and closed in two rounds.
338
+ - **Brief shape for a fixer.** Issue/PR number and head; the checked-out
339
+ branch; the exact findings with file:line, the reviewer's probe to reproduce
340
+ FIRST, and the remedy shape the maintainer chose; what to fold (net-count)
341
+ and what stays out; the suites to run (named files + the mechanical
342
+ governance selector + every tests/config file); the observability record to
343
+ name; "no agents, foreground runs, one CI read, no monitors". Brief a
344
+ reviewer with the PR number, the claims as the fixer stated them, and the
345
+ attack angles that matter for THIS diff; ask for a verdict first.
346
+ - **Round routing.** Fix rounds that only apply a reviewer-prescribed remedy
347
+ with quoted reds merge on green (CI read on the exact head, both required
348
+ checks, mergeable state). Rounds that add mechanism, touch session or
349
+ lifecycle semantics, or rewrite a guard get a fresh verify. Classify the
350
+ round by its worst finding, not its count: a round whose findings are all
351
+ contract (body text, docstrings, a record added WITH its test, a test
352
+ added for an existing behaviour) merges on green — #2647 r2 is that shape;
353
+ a round with one behaviour finding (a verdict, a guard direction, a
354
+ lifecycle hook, a failsafe) gets the same-reviewer verify — #2649 r2 and
355
+ #2654 r2. Say which in the fixer brief so the reviewer is not re-armed by
356
+ reflex. A verify that
357
+ reports a NEW defect triggers the round-count rail above.
358
+ - **Retargeting a PR's base does not re-arm CI.** `ci.yml` fires on
359
+ `opened`/`synchronize`/`reopened`; `gh pr edit --base` is an `edited`
360
+ event, so the required checks stay ABSENT and `ci-verdict` reports "absent,
361
+ treating as pending" — exit 3, not 0; the "exit 0" first recorded on #2664
362
+ was `$?` read after a `| tail`. After a retarget, push a commit or
363
+ close/reopen. Read the final `ci-verdict: exit <N> (<kind>)` stdout line,
364
+ never `$?` after a pipe (`; echo $?` on its own line, before any pipe, is
365
+ also fine). The merge loop is
366
+ `node scripts/ci-verdict.mjs <pr> --wait <seconds>` — read its final line:
367
+ 0 merge, 3 still pending (re-arm the wait), anything else read the table. Never
368
+ text-match the table for `failure`: advisory rows (PR body, Vale)
369
+ print `failure` while the verdict is green, and on 2026-09-07 that stopped
370
+ the #2692 loop on a green PR.
371
+ - **Maintainer trailing commits** are for intent-free deltas only (a literal
372
+ NUL byte, a false comment, a missing PR-body heading); anything that changes
373
+ what code MEANS goes through a fix round.
374
+ - **Mechanical-only verdict (2026-09-07).** When EVERY finding in a review or
375
+ verify is intent-free — a PR-body census the reviewer corrected, an inverted
376
+ body sentence, a heading, a literal, a comment — the orchestrator applies
377
+ them as trailing commits and merges on green: no fixer resume, no re-verify.
378
+ That is one resume saved per such PR. One finding that changes what code
379
+ means, however small, makes it a fix round; a fix round that exists anyway
380
+ carries the mechanical findings with it (#2693 r2 carried F3–F5). Borrowed
381
+ from the auto-fix-mechanical rule in aromanarguello/roman-skills
382
+ `final-review`; NOT borrowed from it: auto-fixing null checks, error
383
+ handling or cleanup hooks, which change meaning.
384
+ - **Allocate the catalog number at MERGE, not at dispatch (2026-09-15).**
385
+ AGENTS.md's defect-shape catalog is a markdownlint MD029 ordered list: the
386
+ number is the list position, so dispatch-time reservations create a gap on
387
+ branches whose holder has not merged. The orchestrator owns allocation; a
388
+ lane may draft a shape but must not claim a number. At merge, insert or
389
+ renumber the shape at the next valid sequential position and recheck the
390
+ whole catalog. This prevents concurrent lanes from colliding without
391
+ shipping a gap.
392
+ - **On a CROSS-REPOSITORY PR, `action_required` is not `absent` (2026-09-12).**
393
+ A fork PR's workflow runs sit unapproved until a maintainer approves them
394
+ (GitHub reports them as `status: completed`, `conclusion: action_required`,
395
+ with no CI check-run rows), so the required checks read as absent and the
396
+ verdict is pending. Absent because CI has not registered yet and absent
397
+ because nobody approved the run look identical in the verdict table and are
398
+ hours apart in remedy. `node scripts/ci-verdict.mjs <pr>` now tells them
399
+ apart (#3694): when the verdict is otherwise pending and required checks
400
+ are absent, it prints `awaiting fork approval` with one
401
+ `gh api -X POST repos/<owner>/<repo>/actions/runs/<id>/approve` per run. It
402
+ never approves; approving is the maintainer's call. A head that is green or
403
+ failing keeps that verdict whatever stale `action_required` runs it carries.
404
+ #2983 sat unapproved while the lane read it as a slow queue.
405
+ - **`ci-verdict` is the ONE CI reader; do not hand-roll `gh pr checks`,
406
+ `gh run view --log` or a `watch-*.sh` poller (#3700, 2026-09-30).** Every
407
+ read the orchestrator did by hand is a mode of `node scripts/ci-verdict.mjs`:
408
+ - `<pr|sha> [--wait N]` — the gating verdict (exit 0 / 1 / 2 / 3, see the
409
+ merge loop above). A failed gating job now also prints its failed STEP
410
+ (so `Ast-grep self-scan` or `Audit production dependencies` reads as what
411
+ it is, not as a test failure), its `FAIL` and assertion lines and the
412
+ `Tests` summary with the ANSI codes stripped, the gating and advisory
413
+ counts on separate lines (advisory reds never gate, and are read before
414
+ merging), and the remedy hint: `gh run rerun <run>` for a cancelled or
415
+ superseded run, the `gh api -X POST .../approve` command for fork
416
+ approval, `gh pr update-branch <pr>` when the failed merge's base is no
417
+ longer master's head (a rerun replays the old merge commit, #3660). A job
418
+ that failed with `couldn't find remote ref refs/pull/N/merge` on a MERGED
419
+ PR is reported as post-merge noise, exit 0, not a red lane.
420
+ - `--all` — one line per open PR (`#N <author> auto-merge=on|off head=<sha>
421
+ gating=<state> [first-failure=<check>]`) for status reports; it always
422
+ exits 0.
423
+ - `--watch-open [--wait N] [--state-file <path>]` — the notifying wait:
424
+ watches every open PR that has auto-merge armed or is authored by the
425
+ repository owner or the `gh` viewer (a PR in a fix round has no
426
+ auto-merge and still goes red), polls every 90 s, and exits 0 on the first
427
+ poll with an event, printing `#<pr> <event> @<sha>: <reason>` plus the
428
+ failure detail (events: `failed`, `fork-approval`, `absent-rearm`,
429
+ `merged`, `closed`; each PR reports on the TRANSITION from its last seen
430
+ state, keyed by head SHA). Exit 3 means the window ended with none.
431
+ `--state-file ~/.cache/pi-lens-orchestrator/watch-state.json` keeps the
432
+ last seen state across re-arms so the same red is not reported twice. Run
433
+ it with `run_in_background: true`; it replaces the session-local
434
+ `watch-automerge.sh`. Events also include `dirty` (merge-conflicted) and
435
+ `cancelled` (a superseded run nobody replaced, with its rerun command),
436
+ and a `merged` PR lists its closing issues' states.
437
+ - `--watch-open --stream` — does not exit on an event: it prints one line per
438
+ event per head (`FAIL #N@sha: ...` plus the failing test names,
439
+ `DIRTY #N@sha`, `CANCELLED-NOT-REPLACED #N@sha: ... (gh run rerun <id>)`,
440
+ `MERGED #N` plus `closes #M: <state>`, `CLOSED #N`) until the window ends
441
+ (exit 0 if any line was printed, 3 if none).
442
+ - `--rerun-cancelled` (with `--watch-open`, and REQUIRING `--state-file`:
443
+ without it every re-armed watch would re-run the same head, so it is a
444
+ usage error) re-runs a cancelled, unreplaced run itself
445
+ (`RERUN #N@sha: gh run rerun <id>`), once per head. A refused re-run is
446
+ retried on the next poll after a backoff (180 s, then 360 s), at most
447
+ three attempts per head, then left to you.
448
+ - `--sync-main <path>` (with `--watch-open`) fast-forwards that checkout after
449
+ a merge (`git pull --ff-only`) and prints `SYNCED <path>: <old> -> <new>`.
450
+ It refuses, saying why (git's own line, such as `Not possible to
451
+ fast-forward`), when the checkout is off master, has modified tracked
452
+ files, or cannot fast-forward, notes local commits not on origin, and prints `LOCKFILE CHANGED: run
453
+ npm ci when no worker is live` when `package-lock.json` moved. It never
454
+ runs `npm ci`: live workers share that install.
455
+ - `--approve-fork <PR>` approves that PR's `action_required` runs on its
456
+ current head (`gh api -X POST .../actions/runs/<id>/approve`). Explicit,
457
+ per PR, never part of any watch.
458
+ Apart from `--approve-fork`, `--rerun-cancelled` and `--sync-main`, which you
459
+ pass by name, it never approves, reruns or updates a branch: it prints the
460
+ command.
461
+ - **Read the advisory rows before merging, even though they never gate
462
+ (2026-09-12).** The exit-code rule above is right and stays: never text-match
463
+ the verdict table for `failure`, because advisory rows print `failure` on a
464
+ green PR. But "does not gate" is not "carries no information", and filtering
465
+ advisory rows out of your attention is a different mistake from filtering
466
+ them out of the gate. `typos (advisory)` found a real defect in #2955's
467
+ round-12 diff — a comment in which "reading" was misspelt — which the
468
+ gating checks had no opinion about and which would otherwise have reached
469
+ master. (The misspelling is described rather than reproduced here: quoting
470
+ it verbatim makes this file itself red the typos lane, which is the same
471
+ detector-versus-prose problem the testing rules already name.) Gate on the exit code; read the advisory failures on the exact head
472
+ before the merge and dispose of each one (fix as a trailing commit, or say
473
+ why it is noise).
474
+ - **`gh run rerun` replays the ORIGINAL merge commit; it does not pick up a
475
+ moved base (2026-09-12).** A pull-request CI run tests `refs/pull/N/merge`,
476
+ master merged into the branch. When master moves — say a fix for the very
477
+ failure that red the lane just landed — rerunning the failed job re-runs the
478
+ SAME merge commit, so the fix is not in the tree and the lane reds again
479
+ identically. The log's checkout line is the proof and is worth reading every
480
+ time: `HEAD is now at <sha> Merge <branch-sha> into <BASE-sha>`; if that base
481
+ is not current master, the run tells you nothing about current master. This
482
+ cost a false conclusion on 2026-09-12 — a lane red on `pi-lens-warmup-oneshot-*`
483
+ after its fix had merged looked like the fix not working, and the base was one
484
+ commit behind. Re-arm with
485
+ `gh api -X PUT repos/<o>/<r>/pulls/<N>/update-branch` (or a push), never a
486
+ rerun, whenever the reason to re-run is that the BASE changed. Same family as
487
+ the retarget rule above: the event that re-runs CI must be one that rebuilds
488
+ the merge ref.
489
+ - **A nondeterministic gate makes a green a sample, not a proof
490
+ (2026-09-12).** The fixture-hygiene ratchet reds only when a leaky family
491
+ actually loses the race, so two PRs on the SAME base can disagree: on
492
+ 2026-09-12 #2994 went green and #2997 red on identical master. Before merging
493
+ on a green whose base is stale, ask whether the gate that matters is
494
+ deterministic; if it is not, re-gate on a current base rather than bank the
495
+ sample. The merged result runs against master, not against the tree that
496
+ happened to pass.
497
+ - **Detection retrospective on every merged bug fix (2026-09-06).** The
498
+ catalog records the CODE lesson of a bug (a shape, a screen, a guard). Before
499
+ a bug-labelled lane's ledger row closes, the orchestrator also records the
500
+ DETECTION lesson in one line: which verification layer caught it (external
501
+ user, reviewer probe, CI job, governance sweep, install/compat/tool smoke,
502
+ dogfood, release gate) and which layer SHOULD have caught it earlier and at
503
+ what cost. If that layer does not exist, file it as an issue with the bug as
504
+ its named recurrence — the same standard shapes are held to. The ledger
505
+ carries a `caught by / should have been caught by` column. Record: #2587's
506
+ manifest entry escaped the package for four releases; a second registration
507
+ path masked it, so the shipped defect was foreign-tree adoption, not absence
508
+ — and no check ever asked a real pi which SOURCE a skill came from. The
509
+ shape lesson went into AGENTS.md the same day; the layer lesson (a witnessed
510
+ real-pi pass asserting source and path, #2606) surfaced only because the
511
+ maintainer brought an outside skill in, and the first runner's count-only
512
+ row would have passed the broken release.
513
+ - **Harvest every reviewer's "Could not verify" and "Named output".** Those
514
+ sections hold the structural insights the probes could not close (a
515
+ runIf-conditional guard, a smoke section that never ran on a real runner, a
516
+ detector's boundary map). Each entry becomes, before merge, one of: an
517
+ issue, a ledger note with a reason, or a line in the PR body. Silence is not
518
+ a disposition.
519
+ When a Named output becomes an issue the orchestrator declines or defers,
520
+ the ledger note names a DURABLE reason (a measured cost, a dependency, a
521
+ design decision with its date), never "not now"; otherwise the same
522
+ candidate is re-harvested at the next regroup rather than silently dropped.
523
+ - **Debt pass at the regroup (2026-09-07).** Before prioritising the next
524
+ cycle, run the repo's own dead-code and duplication tools over the files
525
+ changed since the last release tag (`git diff --name-only v<last>..origin/master`;
526
+ `npx knip` uses the config in package.json, Sonar's duplication gate is the
527
+ CI form): every reviewer's "Named output" that named a re-derived seam
528
+ (#2694: the call-site scan hand-rolled in three sweeps) is what this pass
529
+ finds across lanes that no single review can see. Findings become issues
530
+ with the file list, never release blockers, and test-seam duplication is
531
+ IN scope — "Test infrastructure — reuse before you write" in AGENTS.md is
532
+ the standing rule, so the borrowed skill's "test duplication is often
533
+ intentional" exclusion is not borrowed. (Shape from aromanarguello/roman-skills
534
+ `techdebt`.)
535
+ Within that changed-file list, weight candidates by commit frequency since
536
+ the last tag (`git log --since=<last-tag-date> --name-only --pretty=format: |
537
+ sort | uniq -c | sort -rn`) so the pass follows the real hot spots rather
538
+ than every touched file equally. A FULL-repo debt pass (not the diff-scoped
539
+ one) carries a coverage contract: one ledger row per subsystem (id, files,
540
+ status) and the pass is not closed until every row is filled or skipped with
541
+ a reason. A debt-pass subsystem worker reports at most TWO materially useful
542
+ simplifications, each with the deletion test answered, drawn from six
543
+ candidate shapes: scattered booleans or nullable fields that permit invalid
544
+ combinations (a state machine or discriminated union); repeated assumptions
545
+ about an object shape (one typed model); duplicated branching a small map,
546
+ registry or reducer would remove; unclear state or behaviour ownership (a
547
+ module boundary); repeated scans or lookups a better collection or index
548
+ would remove; lifecycle, concurrency or async state whose representation
549
+ permits stale or contradictory state. Never force an abstraction; boring
550
+ local code that is already clear stays. This cap is for
551
+ debt-pass dispatch only and never applies to PR review, where every finding
552
+ from CRITICAL to NITPICK is reported.
553
+ - **Session retrospective before the regroup.** One ledger block: what the
554
+ maintainer had to bring in from outside, why the process did not surface it,
555
+ and where the lesson was routed (contract, skill, issue). The
556
+ 2026-09-06 entry: the autoqa witness/reachability rules and the release-QA
557
+ layer came from a maintainer link, not from the train's own retrospective
558
+ on #2587.
559
+ - **Review tier follows what the diff touches, never the priority label
560
+ (2026-09-06).** The record: the two most dangerous regressions of that day
561
+ came from p3 follow-ups — #2595 (a 125 s stall on an awaited path, a latent
562
+ crash) and #2604 (broke offline installs in r2, broke `npm install` on
563
+ Windows in r3) — and both were caught only by full review; the p3s where
564
+ review found nothing were the ones touching no production code.
565
+ - **Tier A — full adversarial review, any priority:** anything under
566
+ `clients/`, `tools/`, `mcp/`, `scripts/`, `.github/`, or a package
567
+ manifest / lockfile.
568
+ - **Tier B — one scoped review pass, scope stated in the brief:** tests-only
569
+ diffs that are not governance sweeps or ratchets (those are Tier A: a
570
+ guard is production for the train).
571
+ - **Tier C — no reviewer agent:** docs, comments, rename-only, data files.
572
+ Orchestrator read plus CI on the exact head.
573
+ A prescribed-remedy fix round stays "merge on green" in every tier.
574
+ - **Same-seam siblings batch into the open PR (2026-09-06).** When a review
575
+ finds a sibling of the same shape on the same seam, it goes into the current
576
+ PR as another round — reusing the fixer's context and the reviewer's probes
577
+ — when all three hold: same dependent sweep, remedy prescribed rather than
578
+ designed, and the PR is not on the critical path of an external or p1 fix.
579
+ Otherwise file it with the sibling list and the reason. The record: #2598
580
+ out of #2599 and #2593 out of #2594 each cost a fresh fixer spin-up plus a
581
+ fresh review (and #2604 then needed three rounds under a review that was
582
+ already armed on that file); #2603 out of #2595 and #2592 out of #2585 were
583
+ rightly separate (a new matcher; seventeen per-seam reads). #2596 was filed
584
+ as a follow-up and closed as a duplicate — pure waste.
585
+ - **Refill order** when the quota gate is open: p1 first, then the queued
586
+ follow-ups in ledger order, then the program work (#2421 → #2416 → #2383/#195).
587
+
588
+ ## Disposition tables
589
+
590
+ Verify reports and fixer handoffs end with a per-finding disposition table
591
+ (defined in `docs/pi-lens-reviewer.md` "Findings and verdict");
592
+ read the worst cell to route the round.
593
+
594
+ ## Honesty rules
595
+
596
+ - A finding is real when a probe proves it; a fix is real when the same probe
597
+ passes and the regression test was red first.
598
+ - `closes` vs `refs` follows delivery, not optimism; leftovers get an issue
599
+ comment before anything closes.
600
+ - After merging a `refs #N` PR, VERIFY the issue: read `gh issue view N
601
+ --comments` and confirm a comment names the remainder. If the PR in fact
602
+ satisfied every acceptance criterion, close N crediting the PR; if a
603
+ remainder exists but is unnamed, post it. A `refs` PR with no remainder
604
+ comment is how #1968 and #2355 sat open for weeks after their fixes
605
+ landed (found 2026-09-02).
606
+ - Report what ran, what was skipped, and what CI must still confirm.
607
+
608
+ ## Common mistakes (scan at task start)
609
+
610
+ Each row cost a lane at least once; the prose above carries the record.
611
+
612
+ | Mistake | Fix |
613
+ |---------|-----|
614
+ | Reading a CI verdict without checking the SHA it judged | `ci-verdict --wait` returned exit 0 for the PREVIOUS head seconds after a push (#2878 trailing, 2026-09-10); compare the verdict's SHA with `gh pr view --json headRefOid` before merging |
615
+ | Reporting "pushed" before `git log -1` shows the commit | Two trailing commits failed the pre-commit hook (changelog one-entry rule, unused vars) and the ledger/body already said pushed; verify the head, then write the row |
616
+ | Folding a worker's extra changelog fragment into an existing one | One fragment = one top-level entry (`rollup-changelog --check`); keep a second fragment separate or drop it |
617
+ | Accepting a worker's "pre-existing red on master" | Run the file on origin/master in YOUR environment before believing it; four workers reported env-specific reds as master reds (2026-09-10) |
618
+ | Letting a fix round enumerate cases instead of deriving the rule | #2877 took 7 rounds; the brief for a rule fix demands derivation from the source of truth (grammar table, measured host sequence) |
619
+ | Accepting a state-space table on its claims | Grep every test id in the table before accepting the round; #2877 r3 and #2868 r3 (2026-09-10) shipped 48–72-cell tables with zero real ids |
620
+ | Believing a worker's "N suites red on origin/master" without auditing its probe ENV | #3026's fixer pinned `TMPDIR` to the harness `.probe-home` and reported 16 unrelated suites red; the tree was green (2026-09-15). Ask for the A/B with the variable held fixed; the `tmpdirCollision` deny rule in `scripts/hooks/guard-bash.mjs` blocks the command |
621
+ | Merging a PR before its own CI has been read on the exact head | #3051 landed 20:05Z with the gitignore negation commit missing; `gitignore-tracked-shadow` redded on every open lane for ~30 min (#3055). `node scripts/ci-verdict.mjs <sha>` before every merge, admin merges included |
622
+ | Hand-triggering attempt 3 after a second infra kill | `ci-infra-kill-rerun.yml`'s classify job was gated `run_attempt == 1`, so it never covered the second kill on one head; #3048 and #3040 each needed a manual rerun (2026-09-15). The gate now covers attempt 2; a third kill is a hand rerun by design |
623
+ | Merging a workflow edit whose only executing lane is master-only | #3033 edited install-smoke's `pnpm-global`/`mise-repro` steps, both gated `!= 'pull_request'`; six cells failed on every master push for a day (#3043). Give the edited lane a PR-eligible cell, or run `gh workflow run <file> --ref <branch>` and quote the run id |
624
+ | Sending a governance-sweep brief to a Sonnet fixer | Two rounds cost 765k tokens / 459 tool uses on #3066 and 587k on round 1 alone (2026-09-15). A brief that adds or edits a `tests/support/sweep-kit.ts` registered-or-fail sweep goes to the strongest available fixer |
625
+ | Dispatching into a backend session window that cannot hold the brief | commandcode's undocumented 5-hour cap killed #2928's worker after 42 turns with uncommitted work and no `COMMIT_MSG.txt`, and gave #3045 r2's worker 0 turns (2026-09-16 00:07Z). Check the backend's cap and reset time before dispatch; re-route on reset (plegma #436) |
626
+ | Accepting a derived guard whose mutations are all neutered-guard rows | #3045 r1's guard accepted a junk marker and a substring launcher with M3/M4/M6 green. Demand one negative-population row: an input the guard must reject (#3075) |
627
+ | Merging a fold PR without mutating what the deleted sibling used to back | Four folds in one session each shipped a newly-sole predicate that was untested (#3064 F1, #3065 F3, #3066 F3, #3068 F2). Mutate every predicate the fold promoted, not only the new code |
628
+ | Accepting a runtime test as red-first evidence for a type-only defect | #3026's case could never red — `tsc` erased both changed lines and the emitted JS was byte-identical. The compile transcript on both `tsconfig.build.json` and `tsconfig.json` is the evidence (#3074) |
629
+ | Admitting a real `git show <sha>` in a test to read historical content | #3066 r1 ran it at MODULE SCOPE; CI checks out at depth 1, so the file would have collected zero tests including three pre-existing #525 cases. Commit the content as a fixture under `tests/fixtures/` |
630
+ | Letting a heavy governance test land without a measured peak RSS | `bounded-container-guard` landed at 9.2 GB on 2026-09-14 and drove the CI kill rate 7.1% → 30.4% in five days (#3058). The `worker-peak-rss` gate (#3062) now fails a `default`-project file over budget; keep it gating, not advisory (#3067) |
631
+ | Arming `plegma watch --next` after the lane already settled | The watch only sees settlements newer than itself; check `plegma_status` by handle first and process a done lane directly (three lanes sat settled for hours, 2026-09-10) |
632
+ | Pruning trees with `merge-base --is-ancestor` | Prune only trees whose branch is the head of the PR just merged (#2358's tree, 2026-09-06) |
633
+ | Retargeting a PR base and waiting for CI | `edited` does not fire ci.yml; push a commit or close/reopen |
634
+ | Reading `$?` after a pipe | Read the final `ci-verdict: exit <N> (<kind>)` line (`; echo $?` on its own line, before any pipe, is also fine) |
635
+ | Text-matching the verdict table for `failure` | Key on the exit code; advisory rows print `failure` on green PRs (#2692) |
636
+ | Committing a worker tree with `git add -A` and a pathspec exclude | Check `git ls-files` for handoff files and scratch dirs before the commit; fold a second fragment (#2807, #2808, 2026-09-09) |
637
+ | Merging two green PRs that edit the same baseline or admission map in parallel | Serialise them and re-run that file's test on master between (#2816) |
638
+ | Reviewing a branch head that no longer carries master | Reviewer merges origin/master into the scratch checkout first; CONFLICTING is not reviewable (#2808 vs #2795) |
639
+ | Pushing docs, config or data straight to master without preflight | `npm run preflight` on the exact tree first; three master reds on 2026-09-09 |
640
+ | Nudging a capped small-model lane more than once | One continuation, then reassign to the strongest model (GLM lanes, 2026-09-09) |
641
+ | Waiting on CI for a bot-authored PR (github-actions nightly refresh) | A GITHUB_TOKEN push fires no `pull_request` run: required checks stay ABSENT forever; close/reopen the PR to fire them (#2801, 2026-09-09) |
642
+ | Leaving a design question to the fixer (where evidence comes from, which identity rule) | Decide it in the brief; #2900 oscillated three rounds (walker → findings → walker again) until round 4's brief fixed the evidence source (2026-09-10) |
643
+ | Guessing a lane's branch name when writing a brief | Read `gh pr view N --json headRefName` in the same command that builds the brief; plegma refused two dispatches on invented refs (#2908, #2898; 2026-09-10) |
644
+ | `git add -A -- . ':!<ignored file>'` in a chained command | The exclude pathspec on an IGNORED path makes `git add` exit 1 and the chain stops before the commit; use plain `git add -A` (ignored files never stage) and verify the index afterwards (2026-09-10, twice) |
645
+ | Treating a `ci-verdict --wait` exit as a CI verdict without reading it | Exit 70 = GitHub API unreachable; every armed wait died at once during two outages on 2026-09-10 — poll `https://api.github.com/` until 200, then re-arm one wait per PR |
646
+ | Merging a PR that arms a registry-membership guard without telling the other lanes | After #2924, every open PR that adds a formatter, LSP server or MCP tool needs a docs line in the same change; note it in the ledger and the next briefs (2026-09-10) |
647
+ | Judging master from the local checkout | `git fetch origin` and read `origin/master`; #2693 r1 reported a catalog row missing that had merged an hour earlier, and the orchestrator's own branch that morning was cut from a master six commits behind |
648
+ | Swapping reviewers between rounds | Same reviewer verifies; the probes and the mutation set are the continuity |
649
+ | Trusting the fixer's "CI green" | Read ci-verdict on the exact head SHA yourself; absent required checks are not green |
650
+ | A third patch-only round on one seam | Round-count rail: state-space table in the body first, Opus fixer |
651
+ | Merging a `refs` PR with no remainder comment | Post the remainder or close the issue crediting the PR |
652
+ | Dispatching independent agents one message at a time | All independent Agent calls in one message; the quota gate is read once before the batch |
653
+ | Resuming a fixer whose tree was reaped | Spawn a fresh fixer on the branch, or export `PILENS_HYGIENE_KEEP_AGENT_TREES=1` for the session up front |
654
+ | Sweeping a shape by grep-counting tokens | A ratchet reads the exact literal it governs (#2693: four sites counted, six real) |
655
+ | `npx <tool>@latest` inside the repo to measure something | It rewrote package-lock.json (108 deletions) on 2026-09-07; run one-off tools from a scratch prefix, and `git diff --stat` before every commit |
656
+ | `git add -A` in a worktree that links `node_modules` | The ignore rule `node_modules/` does not match a SYMLINK; #2703 committed one and broke the clean-clone install and the tracked-shadow test. `git add <paths>`, and `.gitignore` now says `node_modules` without the slash |
657
+ | `git worktree remove --force` on a tree whose `node_modules` is a symlink | Git follows the link and empties the shared checkout's install (twice on 2026-09-16, #2704 class; every other lane's build broke). `rm node_modules` first (unlink, never `rm -r`), then remove; mechanisation in the Bash hook is filed |
658
+ | Checking a branch out in the shared main tree for your own fix | Reviewers saw the checkout switch under them three times on 2026-09-07; use a throwaway `git worktree add` under `~/.local/share/pi-lens-orchestrator/tmp/<lane>` (never the scratchpad -- #3526: it is `/tmp` on this launcher, tmpfs, and `guard-bash.mjs` denies a checkout landing there), remove it after the push |
659
+ | `gh run rerun --failed` while the run is still in progress | GitHub refuses it; wait for the run to complete (poll `gh run view --json status`), then rerun, then re-read the verdict |
660
+ | Reading a failed job's log before its run completes | Empty output; the log is withheld until the whole run finishes |
661
+ | Treating a reviewer's prescription as the fix | It is a hypothesis: #2693 r2's blanked-slice remedy stayed green on `env: { PWD: cwd }`; the fixer's AST rule replaced it and the reviewer withdrew the prescription |
662
+ | `git add -A` from a worktree without the probe-home exclude | 978 `.probe-home/npm-cache` blobs reached master in a direct push (2026-09-09, #2843); the user-level `commit-index-check` hook now denies it — keep the exclude anyway |
663
+ | Ignoring a red advisory row on a PR that changes what the lane runs | #2833 merged with `Unit tests Windows (advisory)` red on its own head; master carried the red until #2842. Read that row like a gate when the diff touches the lane's script, step or executed files |
664
+ | Restarting the plegma daemon under systemd with the default PATH | Backend detection is a PATH walk in the daemon process; 5 of 10 backends vanished and every Luna/GLM brief was rejected `Unknown model` (plegma#375). Set `Environment=PATH=…npm-global/bin…` in a drop-in and read `daemon.out`'s `backends:` line after ANY restart |
665
+ | Polling `plegma_list` every turn | 68 calls, 194 KB of context in one session for no decision. Arm one background `plegma wait <handle>` per lane in the dispatch turn; `plegma_list` only at reconnect and to consume `done` handles |
666
+ | Running `node ../../scripts/<x>` from a worktree | The path resolves against the worktree's parent, not the repo; two CI waits exited at once with the wrapper's exit 0 (2026-09-10). Inside a worktree the scripts are at `scripts/`; read the wait's output file before trusting an exit code |
667
+ | Appending a worker's body section keyed on an exact heading level | The worker wrote `# Round 7`, the append keyed on `## Round 7`, and the PR body shipped without the round (#2846 v7). `grep` the published body for the section before reporting it landed |
668
+ | Pushing an orchestrator round without `npm run fmt:check` on the whole tree | #2853's merge round redded oxfmt on two trimmed lists (2026-09-10). fmt:check is the last command before any push, orchestrator rounds included |
669
+ | Running a governance suite in the main checkout after merges without rebuilding | Vitest loads compiled `.js`; a stale build makes the run fail closed (or worse, test old code). `npm run build` before any test run in a checkout that has moved |
670
+ | Accepting a lifecycle round on `-t`-only mutation reds | #2853 r6/r7 quoted reds that only reproduced under `-t`; nine awaits never returned whole-file (#2859). Whole-file mutation runs are the acceptance shape (AGENTS.md round-routing) |
671
+ | Sending a scope `note` to a worker about to finish | The #2854 r2 worker settled before the note was read; the round shipped without H2/M1. Check `plegma_status` first; a worker with no turns left gets a new round, not a note |
672
+ | Chaining a check and a commit or push with `;` or a pipe | Three times on 2026-09-25: a commit with `lint=1`, a push with the flake-shape ratchet red, and a push reported done by `echo $?` of a later `grep`. Gate with `&&`, or read the check in its own call; the guard is #3471. Recurred 2026-09-26 on #3492's pushes (a commit piped to `grep` then `;` push piped to `tail -1`, and a mutation `vitest` run `;`-chained to a commit) |
673
+ | Pushing with `npm run build >log 2>&1; echo build=$?; test "$(git rev-parse HEAD)" = SHA && git push …` | `guard-bash.mjs`'s `checkUngated` rule (#3471, landed in G12) denies this: the build's real exit code is thrown away by `;`, so a failed build still reaches the `git push` (case 1's own shape). Rewrite as `npm run build >log 2>&1 && test "$(git rev-parse HEAD)" = SHA && git push …`, or split the build and the push into two calls — never exempt `build` from the check |
674
+ | Opening a PR without `npm run preflight` | #3468 opened with a `build:` title that the title gate rejects; a hand-picked subset of checks (body lint only) left it out. Write `PR_BODY.md` and `COMMIT_MSG.txt` and run the preflight, which lints both |
675
+ | Adding real spawns or waits to a test without running the flake-shape ratchet | #3464's `git init` fixture raised a spawn count and pushed red (#3472); #3492's 60 s `setTimeout` reddened CI the next day, and that push's `clients/lsp/client.ts` change (it alone matches 71 test files) had capped the hook to build-only. `scripts/pre-push-targeted-tests.mjs` now arms `TEST_TREE_GOVERNANCE_TESTS` (the ratchet) on any `tests/` change and runs the armed registries past the cap |
676
+ | Carrying a field from a replaced queue entry into an entry of another kind | #3481 r1 kept the pending read stamp on an unstamped replacement; the queued rename close inherited a stale stamp and was dropped, reopening #3477 inside its own PR (#3491 verify round, fixed in `b937ff0a9`). Probe a review-round fix on every entry kind that shares the queue; AGENTS.md shape 55, model composition #3495 |
677
+ | Encoding a server's message order from the model instead of measuring it | #3484's first cut fenced every version-less server; docker-langserver publishes before the fence reply, so its only answer was dropped, and the fake server published after the reply (#3484 r1, found by the reviewer running the real server). Measure the order per server before the fixture encodes it; AGENTS.md shape 54 |
678
+ | Adding a second per-server strategy marker without a test that drives both | intelephense carried `emptyFirstPublish` when #3484 marked it `diagnosticsFence`; the fence dropped the first publish, the hold swallowed the answer, and three #3310 tests timed out in CI on `b937ff0a9`. `tests/config/strategy-marker-pair-coverage.test.ts` now reds an unregistered pair |
679
+ | Asserting on a record a production deadline can cut short | The dispatch-cap case needed all 33 files hashed inside the 50 ms settle deadline; a loaded runner cut one and master went red on `afea9074d` (#3493). Pin the bounds through a test seam (`_setObservedTimeBoundsForTests`, #3494); the load-simulation pass is #3496 |
680
+ | Reading a `check_suite.completed` wake as a green head | The wake excludes cancelled suites; #3491's run on `a16fb1f82` was cancelled and was reported "finished green" (2026-09-26). Read the run's conclusion on the exact SHA; `ci-verdict` needs `gh`, which cloud sessions lack (#3497) |
681
+ | Describing a guard in a contract line as if it runs | AGENTS.md shape 52 said stores were "pinned by name in the #1894 registry ratchet"; no such ratchet existed (2026-09-25 catalog retro). Name a guard by its path, and a planned one by its open issue |
682
+ | Rewriting a PR body's narrative without re-reading the `.changelog/` fragment | The fragment kept the retracted round-1 story after the body moved on to a different remedy (#3155 r2); re-read the fragment on every body rework, not just the body |
683
+ | Accepting a subset-shaped change without a generalization verdict | #3622 applied idle eviction to 4 of ~44 LSP servers; the maintainer caught the missing population screen by reading the PR. At each regroup, scan merged PRs and require the verdict. |
684
+ | Filing an issue mid-session without a seam group | Issues filed mid-session must be assigned to a seam group at filing (2026-09-30); do not leave the follow-up queue ungrouped. |
685
+ | Filing follow-up issues through the GitHub API without a TYPE or priority label | The orchestrator filed about a dozen issues this way on 2026-09-26 (#3543-#3546, #3548, #3549, #3552, #3556, #3558-#3560); the issue templates that would force a label are bypassed by API creation, and they stayed untriaged until the maintainer noticed by hand. `.github/workflows/untriaged-issues.yml` now fails a daily job listing any open issue still missing either (#3563) |
686
+ | Issuing a mid-flight order without naming the overridden brief clause | State which part of the original brief it overrides and post the order on the issue (#3695 handoff 6) |
687
+ | Explaining why an agent stopped without checking its status | Check the agent's status before attributing its stop (#3695 handoff 7) |
688
+ | Starting agents against an ambiguous target | Confirm the target before dispatching agents (#3695 handoff 8) |
689
+ | Letting strictness-ratchet and glossary pins collide on one change | Run both pin sweeps before pushing (#3455/#3643) |
690
+ | Re-running a `pull_request` job against the old merge SHA | Use `gh pr update-branch` to rebuild the merge ref (#3660; 2026-09-30) |
691
+ | Fixing a hooks or lint gate without sweeping older open branches | Sweep open branches committed before the fix (#3675; 2026-09-30) |
692
+ | Enabling auto-merge before local HEAD equals the pushed SHA | Verify the pushed SHA before enabling auto-merge (#3671) |
693
+ | Waiting for CI after retargeting a base without a push | Push after a base retarget to re-arm CI (#3679) |
694
+ | Leaving fork-PR `action_required` runs unapproved | Approve the runs after pushing to a fork PR (#3656) |