p-dev-harness 0.3.1 → 0.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 (1862) hide show
  1. package/README.md +12 -4
  2. package/dist/agents/cursor-provider.d.ts.map +1 -1
  3. package/dist/agents/cursor-provider.js +9 -8
  4. package/dist/agents/cursor-provider.js.map +1 -1
  5. package/dist/agents/index.d.ts +3 -4
  6. package/dist/agents/index.d.ts.map +1 -1
  7. package/dist/agents/index.js +2 -5
  8. package/dist/agents/index.js.map +1 -1
  9. package/dist/agents/types.d.ts +36 -2
  10. package/dist/agents/types.d.ts.map +1 -1
  11. package/dist/artifacts/redact.d.ts +2 -0
  12. package/dist/artifacts/redact.d.ts.map +1 -1
  13. package/dist/artifacts/redact.js +15 -1
  14. package/dist/artifacts/redact.js.map +1 -1
  15. package/dist/artifacts/write-json-out-manifest.d.ts +17 -0
  16. package/dist/artifacts/write-json-out-manifest.d.ts.map +1 -0
  17. package/dist/artifacts/write-json-out-manifest.js +68 -0
  18. package/dist/artifacts/write-json-out-manifest.js.map +1 -0
  19. package/dist/cli/commands/canary-runner-config.d.ts +2 -0
  20. package/dist/cli/commands/canary-runner-config.d.ts.map +1 -0
  21. package/dist/cli/commands/canary-runner-config.js +6 -0
  22. package/dist/cli/commands/canary-runner-config.js.map +1 -0
  23. package/dist/cli/commands/doctor.d.ts.map +1 -1
  24. package/dist/cli/commands/doctor.js +129 -0
  25. package/dist/cli/commands/doctor.js.map +1 -1
  26. package/dist/cli/commands/resolve-route.d.ts.map +1 -1
  27. package/dist/cli/commands/resolve-route.js +5 -0
  28. package/dist/cli/commands/resolve-route.js.map +1 -1
  29. package/dist/cli/commands/run.d.ts +1 -0
  30. package/dist/cli/commands/run.d.ts.map +1 -1
  31. package/dist/cli/commands/run.js +54 -12
  32. package/dist/cli/commands/run.js.map +1 -1
  33. package/dist/cli/commands/sync-managed-runner.d.ts +7 -0
  34. package/dist/cli/commands/sync-managed-runner.d.ts.map +1 -0
  35. package/dist/cli/commands/sync-managed-runner.js +89 -0
  36. package/dist/cli/commands/sync-managed-runner.js.map +1 -0
  37. package/dist/cli/program.d.ts.map +1 -1
  38. package/dist/cli/program.js +27 -0
  39. package/dist/cli/program.js.map +1 -1
  40. package/dist/config/assert-cloud-config-fingerprint.d.ts +10 -0
  41. package/dist/config/assert-cloud-config-fingerprint.d.ts.map +1 -0
  42. package/dist/config/assert-cloud-config-fingerprint.js +26 -0
  43. package/dist/config/assert-cloud-config-fingerprint.js.map +1 -0
  44. package/dist/config/cloud-config-fingerprint.d.ts +26 -0
  45. package/dist/config/cloud-config-fingerprint.d.ts.map +1 -0
  46. package/dist/config/cloud-config-fingerprint.js +64 -0
  47. package/dist/config/cloud-config-fingerprint.js.map +1 -0
  48. package/dist/config/legacy-linear-top-level.d.ts +16 -0
  49. package/dist/config/legacy-linear-top-level.d.ts.map +1 -0
  50. package/dist/config/legacy-linear-top-level.js +42 -0
  51. package/dist/config/legacy-linear-top-level.js.map +1 -0
  52. package/dist/config/linear-association-gate.d.ts +26 -0
  53. package/dist/config/linear-association-gate.d.ts.map +1 -0
  54. package/dist/config/linear-association-gate.js +46 -0
  55. package/dist/config/linear-association-gate.js.map +1 -0
  56. package/dist/config/resolve-linear-team.d.ts +10 -0
  57. package/dist/config/resolve-linear-team.d.ts.map +1 -0
  58. package/dist/config/resolve-linear-team.js +24 -0
  59. package/dist/config/resolve-linear-team.js.map +1 -0
  60. package/dist/config/resolve-linear-workspace.d.ts +83 -0
  61. package/dist/config/resolve-linear-workspace.d.ts.map +1 -0
  62. package/dist/config/resolve-linear-workspace.js +244 -0
  63. package/dist/config/resolve-linear-workspace.js.map +1 -0
  64. package/dist/config/role-models.d.ts +160 -0
  65. package/dist/config/role-models.d.ts.map +1 -0
  66. package/dist/config/role-models.js +31 -0
  67. package/dist/config/role-models.js.map +1 -0
  68. package/dist/config/runner-upgrade-sync-gate.d.ts +10 -0
  69. package/dist/config/runner-upgrade-sync-gate.d.ts.map +1 -0
  70. package/dist/config/runner-upgrade-sync-gate.js +24 -0
  71. package/dist/config/runner-upgrade-sync-gate.js.map +1 -0
  72. package/dist/config/schema.d.ts +266 -0
  73. package/dist/config/schema.d.ts.map +1 -1
  74. package/dist/config/schema.js +14 -0
  75. package/dist/config/schema.js.map +1 -1
  76. package/dist/config/types.d.ts +1 -1
  77. package/dist/config/types.d.ts.map +1 -1
  78. package/dist/config/workspace-root.d.ts +7 -0
  79. package/dist/config/workspace-root.d.ts.map +1 -0
  80. package/dist/config/workspace-root.js +21 -0
  81. package/dist/config/workspace-root.js.map +1 -0
  82. package/dist/cursor/agent-factory.d.ts +8 -0
  83. package/dist/cursor/agent-factory.d.ts.map +1 -1
  84. package/dist/cursor/agent-factory.js +34 -5
  85. package/dist/cursor/agent-factory.js.map +1 -1
  86. package/dist/cursor/builder-resume-errors.d.ts +3 -0
  87. package/dist/cursor/builder-resume-errors.d.ts.map +1 -0
  88. package/dist/cursor/builder-resume-errors.js +32 -0
  89. package/dist/cursor/builder-resume-errors.js.map +1 -0
  90. package/dist/cursor/model.d.ts +18 -22
  91. package/dist/cursor/model.d.ts.map +1 -1
  92. package/dist/cursor/model.js +73 -25
  93. package/dist/cursor/model.js.map +1 -1
  94. package/dist/cursor/run-observer.d.ts +8 -1
  95. package/dist/cursor/run-observer.d.ts.map +1 -1
  96. package/dist/cursor/run-observer.js +9 -1
  97. package/dist/cursor/run-observer.js.map +1 -1
  98. package/dist/github/auth-verification-retry.d.ts +12 -0
  99. package/dist/github/auth-verification-retry.d.ts.map +1 -0
  100. package/dist/github/auth-verification-retry.js +47 -0
  101. package/dist/github/auth-verification-retry.js.map +1 -0
  102. package/dist/github/client.d.ts +53 -4
  103. package/dist/github/client.d.ts.map +1 -1
  104. package/dist/github/client.js +108 -7
  105. package/dist/github/client.js.map +1 -1
  106. package/dist/gui/configure-health.js +2 -2
  107. package/dist/gui/configure-health.js.map +1 -1
  108. package/dist/gui/repo-root.d.ts +3 -0
  109. package/dist/gui/repo-root.d.ts.map +1 -1
  110. package/dist/gui/repo-root.js +16 -1
  111. package/dist/gui/repo-root.js.map +1 -1
  112. package/dist/gui/start-configure-stable.js +6 -2
  113. package/dist/gui/start-configure-stable.js.map +1 -1
  114. package/dist/gui/start-gui.js +7 -3
  115. package/dist/gui/start-gui.js.map +1 -1
  116. package/dist/linear/client.d.ts +4 -0
  117. package/dist/linear/client.d.ts.map +1 -1
  118. package/dist/linear/client.js +7 -0
  119. package/dist/linear/client.js.map +1 -1
  120. package/dist/linear/comments.d.ts +9 -0
  121. package/dist/linear/comments.d.ts.map +1 -1
  122. package/dist/linear/comments.js +34 -0
  123. package/dist/linear/comments.js.map +1 -1
  124. package/dist/linear/issue-query.d.ts +1 -0
  125. package/dist/linear/issue-query.d.ts.map +1 -1
  126. package/dist/linear/issue-query.js +3 -0
  127. package/dist/linear/issue-query.js.map +1 -1
  128. package/dist/linear/markers.d.ts +7 -0
  129. package/dist/linear/markers.d.ts.map +1 -1
  130. package/dist/linear/markers.js +21 -0
  131. package/dist/linear/markers.js.map +1 -1
  132. package/dist/linear/parser.d.ts +2 -1
  133. package/dist/linear/parser.d.ts.map +1 -1
  134. package/dist/linear/parser.js +46 -0
  135. package/dist/linear/parser.js.map +1 -1
  136. package/dist/linear/project-harness-metadata.d.ts +10 -0
  137. package/dist/linear/project-harness-metadata.d.ts.map +1 -0
  138. package/dist/linear/project-harness-metadata.js +109 -0
  139. package/dist/linear/project-harness-metadata.js.map +1 -0
  140. package/dist/linear/project-metadata-sync.d.ts +29 -0
  141. package/dist/linear/project-metadata-sync.d.ts.map +1 -0
  142. package/dist/linear/project-metadata-sync.js +64 -0
  143. package/dist/linear/project-metadata-sync.js.map +1 -0
  144. package/dist/linear/run-status-comment.d.ts +49 -0
  145. package/dist/linear/run-status-comment.d.ts.map +1 -0
  146. package/dist/linear/run-status-comment.js +118 -0
  147. package/dist/linear/run-status-comment.js.map +1 -0
  148. package/dist/linear/writer.d.ts +8 -0
  149. package/dist/linear/writer.d.ts.map +1 -1
  150. package/dist/linear/writer.js +13 -0
  151. package/dist/linear/writer.js.map +1 -1
  152. package/dist/observability/adapters/fake.d.ts +17 -0
  153. package/dist/observability/adapters/fake.d.ts.map +1 -0
  154. package/dist/observability/adapters/fake.js +205 -0
  155. package/dist/observability/adapters/fake.js.map +1 -0
  156. package/dist/observability/adapters/noop.d.ts +5 -0
  157. package/dist/observability/adapters/noop.d.ts.map +1 -0
  158. package/dist/observability/adapters/noop.js +51 -0
  159. package/dist/observability/adapters/noop.js.map +1 -0
  160. package/dist/observability/adapters/posthog.d.ts +12 -0
  161. package/dist/observability/adapters/posthog.d.ts.map +1 -0
  162. package/dist/observability/adapters/posthog.js +142 -0
  163. package/dist/observability/adapters/posthog.js.map +1 -0
  164. package/dist/observability/adapters/sentry.d.ts +12 -0
  165. package/dist/observability/adapters/sentry.d.ts.map +1 -0
  166. package/dist/observability/adapters/sentry.js +217 -0
  167. package/dist/observability/adapters/sentry.js.map +1 -0
  168. package/dist/observability/analytics-schemas.d.ts +59 -0
  169. package/dist/observability/analytics-schemas.d.ts.map +1 -0
  170. package/dist/observability/analytics-schemas.js +119 -0
  171. package/dist/observability/analytics-schemas.js.map +1 -0
  172. package/dist/observability/consent.d.ts +14 -0
  173. package/dist/observability/consent.d.ts.map +1 -0
  174. package/dist/observability/consent.js +35 -0
  175. package/dist/observability/consent.js.map +1 -0
  176. package/dist/observability/constants.d.ts +18 -0
  177. package/dist/observability/constants.d.ts.map +1 -0
  178. package/dist/observability/constants.js +18 -0
  179. package/dist/observability/constants.js.map +1 -0
  180. package/dist/observability/context.d.ts +21 -0
  181. package/dist/observability/context.d.ts.map +1 -0
  182. package/dist/observability/context.js +105 -0
  183. package/dist/observability/context.js.map +1 -0
  184. package/dist/observability/facade-runtime-state.d.ts +17 -0
  185. package/dist/observability/facade-runtime-state.d.ts.map +1 -0
  186. package/dist/observability/facade-runtime-state.js +23 -0
  187. package/dist/observability/facade-runtime-state.js.map +1 -0
  188. package/dist/observability/facade.d.ts +44 -0
  189. package/dist/observability/facade.d.ts.map +1 -0
  190. package/dist/observability/facade.js +432 -0
  191. package/dist/observability/facade.js.map +1 -0
  192. package/dist/observability/fatal-handlers.d.ts +4 -0
  193. package/dist/observability/fatal-handlers.d.ts.map +1 -0
  194. package/dist/observability/fatal-handlers.js +54 -0
  195. package/dist/observability/fatal-handlers.js.map +1 -0
  196. package/dist/observability/identity.d.ts +4 -0
  197. package/dist/observability/identity.d.ts.map +1 -0
  198. package/dist/observability/identity.js +11 -0
  199. package/dist/observability/identity.js.map +1 -0
  200. package/dist/observability/index.d.ts +9 -0
  201. package/dist/observability/index.d.ts.map +1 -0
  202. package/dist/observability/index.js +6 -0
  203. package/dist/observability/index.js.map +1 -0
  204. package/dist/observability/local-state.d.ts +14 -0
  205. package/dist/observability/local-state.d.ts.map +1 -0
  206. package/dist/observability/local-state.js +107 -0
  207. package/dist/observability/local-state.js.map +1 -0
  208. package/dist/observability/package-config.d.ts +11 -0
  209. package/dist/observability/package-config.d.ts.map +1 -0
  210. package/dist/observability/package-config.js +117 -0
  211. package/dist/observability/package-config.js.map +1 -0
  212. package/dist/observability/posthog-dashboard-contract.d.ts +46 -0
  213. package/dist/observability/posthog-dashboard-contract.d.ts.map +1 -0
  214. package/dist/observability/posthog-dashboard-contract.js +200 -0
  215. package/dist/observability/posthog-dashboard-contract.js.map +1 -0
  216. package/dist/observability/privacy-schema.d.ts +13 -0
  217. package/dist/observability/privacy-schema.d.ts.map +1 -0
  218. package/dist/observability/privacy-schema.js +204 -0
  219. package/dist/observability/privacy-schema.js.map +1 -0
  220. package/dist/observability/product-error-messages.d.ts +2 -0
  221. package/dist/observability/product-error-messages.d.ts.map +1 -0
  222. package/dist/observability/product-error-messages.js +15 -0
  223. package/dist/observability/product-error-messages.js.map +1 -0
  224. package/dist/observability/product-errors.d.ts +12 -0
  225. package/dist/observability/product-errors.d.ts.map +1 -0
  226. package/dist/observability/product-errors.js +109 -0
  227. package/dist/observability/product-errors.js.map +1 -0
  228. package/dist/observability/provisioning-analytics.d.ts +12 -0
  229. package/dist/observability/provisioning-analytics.d.ts.map +1 -0
  230. package/dist/observability/provisioning-analytics.js +11 -0
  231. package/dist/observability/provisioning-analytics.js.map +1 -0
  232. package/dist/observability/redaction.d.ts +10 -0
  233. package/dist/observability/redaction.d.ts.map +1 -0
  234. package/dist/observability/redaction.js +72 -0
  235. package/dist/observability/redaction.js.map +1 -0
  236. package/dist/observability/runtime-eligibility.d.ts +6 -0
  237. package/dist/observability/runtime-eligibility.d.ts.map +1 -0
  238. package/dist/observability/runtime-eligibility.js +33 -0
  239. package/dist/observability/runtime-eligibility.js.map +1 -0
  240. package/dist/observability/sentry-outbound-privacy.d.ts +12 -0
  241. package/dist/observability/sentry-outbound-privacy.d.ts.map +1 -0
  242. package/dist/observability/sentry-outbound-privacy.js +168 -0
  243. package/dist/observability/sentry-outbound-privacy.js.map +1 -0
  244. package/dist/observability/session-dedupe.d.ts +8 -0
  245. package/dist/observability/session-dedupe.d.ts.map +1 -0
  246. package/dist/observability/session-dedupe.js +42 -0
  247. package/dist/observability/session-dedupe.js.map +1 -0
  248. package/dist/observability/session-handoff.d.ts +10 -0
  249. package/dist/observability/session-handoff.d.ts.map +1 -0
  250. package/dist/observability/session-handoff.js +25 -0
  251. package/dist/observability/session-handoff.js.map +1 -0
  252. package/dist/observability/transport-lifecycle.d.ts +20 -0
  253. package/dist/observability/transport-lifecycle.d.ts.map +1 -0
  254. package/dist/observability/transport-lifecycle.js +69 -0
  255. package/dist/observability/transport-lifecycle.js.map +1 -0
  256. package/dist/observability/types.d.ts +189 -0
  257. package/dist/observability/types.d.ts.map +1 -0
  258. package/dist/observability/types.js +2 -0
  259. package/dist/observability/types.js.map +1 -0
  260. package/dist/p-dev/cli.d.ts +1 -1
  261. package/dist/p-dev/cli.d.ts.map +1 -1
  262. package/dist/p-dev/cli.js +1 -1
  263. package/dist/p-dev/cli.js.map +1 -1
  264. package/dist/p-dev/git-object-plumbing.d.ts +20 -0
  265. package/dist/p-dev/git-object-plumbing.d.ts.map +1 -1
  266. package/dist/p-dev/git-object-plumbing.js +106 -13
  267. package/dist/p-dev/git-object-plumbing.js.map +1 -1
  268. package/dist/p-dev/launch.d.ts.map +1 -1
  269. package/dist/p-dev/launch.js +77 -15
  270. package/dist/p-dev/launch.js.map +1 -1
  271. package/dist/p-dev/main.js +9 -1
  272. package/dist/p-dev/main.js.map +1 -1
  273. package/dist/p-dev/package-paths.d.ts +12 -0
  274. package/dist/p-dev/package-paths.d.ts.map +1 -1
  275. package/dist/p-dev/package-paths.js +48 -2
  276. package/dist/p-dev/package-paths.js.map +1 -1
  277. package/dist/p-dev/workspace-snapshot-generator.d.ts.map +1 -1
  278. package/dist/p-dev/workspace-snapshot-generator.js +18 -0
  279. package/dist/p-dev/workspace-snapshot-generator.js.map +1 -1
  280. package/dist/p-dev/workspace-snapshot-manifest.d.ts.map +1 -1
  281. package/dist/p-dev/workspace-snapshot-manifest.js +48 -0
  282. package/dist/p-dev/workspace-snapshot-manifest.js.map +1 -1
  283. package/dist/p-dev/workspace-snapshot-types.d.ts +8 -0
  284. package/dist/p-dev/workspace-snapshot-types.d.ts.map +1 -1
  285. package/dist/preview/preview-capability.d.ts +9 -0
  286. package/dist/preview/preview-capability.d.ts.map +1 -0
  287. package/dist/preview/preview-capability.js +15 -0
  288. package/dist/preview/preview-capability.js.map +1 -0
  289. package/dist/product/initialization-state.d.ts +15 -0
  290. package/dist/product/initialization-state.d.ts.map +1 -0
  291. package/dist/product/initialization-state.js +37 -0
  292. package/dist/product/initialization-state.js.map +1 -0
  293. package/dist/product/product-marker.d.ts +77 -0
  294. package/dist/product/product-marker.d.ts.map +1 -0
  295. package/dist/product/product-marker.js +62 -0
  296. package/dist/product/product-marker.js.map +1 -0
  297. package/dist/product/read-product-marker.d.ts +15 -0
  298. package/dist/product/read-product-marker.d.ts.map +1 -0
  299. package/dist/product/read-product-marker.js +28 -0
  300. package/dist/product/read-product-marker.js.map +1 -0
  301. package/dist/prompts/builder.d.ts +10 -1
  302. package/dist/prompts/builder.d.ts.map +1 -1
  303. package/dist/prompts/builder.js +16 -2
  304. package/dist/prompts/builder.js.map +1 -1
  305. package/dist/resolver/errors.d.ts +1 -1
  306. package/dist/resolver/errors.d.ts.map +1 -1
  307. package/dist/resolver/errors.js.map +1 -1
  308. package/dist/resolver/target-repo.d.ts +4 -1
  309. package/dist/resolver/target-repo.d.ts.map +1 -1
  310. package/dist/resolver/target-repo.js +40 -0
  311. package/dist/resolver/target-repo.js.map +1 -1
  312. package/dist/runner/builder-thread-acquire.d.ts +41 -0
  313. package/dist/runner/builder-thread-acquire.d.ts.map +1 -0
  314. package/dist/runner/builder-thread-acquire.js +224 -0
  315. package/dist/runner/builder-thread-acquire.js.map +1 -0
  316. package/dist/runner/builder-thread-evidence.d.ts +13 -0
  317. package/dist/runner/builder-thread-evidence.d.ts.map +1 -0
  318. package/dist/runner/builder-thread-evidence.js +23 -0
  319. package/dist/runner/builder-thread-evidence.js.map +1 -0
  320. package/dist/runner/builder-thread-idempotency.d.ts +17 -0
  321. package/dist/runner/builder-thread-idempotency.d.ts.map +1 -0
  322. package/dist/runner/builder-thread-idempotency.js +12 -0
  323. package/dist/runner/builder-thread-idempotency.js.map +1 -0
  324. package/dist/runner/builder-thread-lineage-errors.d.ts +7 -0
  325. package/dist/runner/builder-thread-lineage-errors.d.ts.map +1 -0
  326. package/dist/runner/builder-thread-lineage-errors.js +11 -0
  327. package/dist/runner/builder-thread-lineage-errors.js.map +1 -0
  328. package/dist/runner/builder-thread-lineage.d.ts +18 -0
  329. package/dist/runner/builder-thread-lineage.d.ts.map +1 -0
  330. package/dist/runner/builder-thread-lineage.js +342 -0
  331. package/dist/runner/builder-thread-lineage.js.map +1 -0
  332. package/dist/runner/builder-thread-types.d.ts +30 -0
  333. package/dist/runner/builder-thread-types.d.ts.map +1 -0
  334. package/dist/runner/builder-thread-types.js +2 -0
  335. package/dist/runner/builder-thread-types.js.map +1 -0
  336. package/dist/runner/delivery-dedup.d.ts +26 -0
  337. package/dist/runner/delivery-dedup.d.ts.map +1 -0
  338. package/dist/runner/delivery-dedup.js +44 -0
  339. package/dist/runner/delivery-dedup.js.map +1 -0
  340. package/dist/runner/failure-finalization.d.ts +34 -0
  341. package/dist/runner/failure-finalization.d.ts.map +1 -0
  342. package/dist/runner/failure-finalization.js +154 -0
  343. package/dist/runner/failure-finalization.js.map +1 -0
  344. package/dist/runner/fixture.d.ts +1 -1
  345. package/dist/runner/fixture.d.ts.map +1 -1
  346. package/dist/runner/fixture.js +3 -0
  347. package/dist/runner/fixture.js.map +1 -1
  348. package/dist/runner/phases/handoff.d.ts.map +1 -1
  349. package/dist/runner/phases/handoff.js +59 -32
  350. package/dist/runner/phases/handoff.js.map +1 -1
  351. package/dist/runner/phases/implementation.d.ts.map +1 -1
  352. package/dist/runner/phases/implementation.js +147 -24
  353. package/dist/runner/phases/implementation.js.map +1 -1
  354. package/dist/runner/phases/integration-repair.d.ts +18 -0
  355. package/dist/runner/phases/integration-repair.d.ts.map +1 -1
  356. package/dist/runner/phases/integration-repair.js +93 -7
  357. package/dist/runner/phases/integration-repair.js.map +1 -1
  358. package/dist/runner/phases/merge.d.ts.map +1 -1
  359. package/dist/runner/phases/merge.js +129 -51
  360. package/dist/runner/phases/merge.js.map +1 -1
  361. package/dist/runner/phases/planning.d.ts.map +1 -1
  362. package/dist/runner/phases/planning.js +46 -8
  363. package/dist/runner/phases/planning.js.map +1 -1
  364. package/dist/runner/phases/production-sync.d.ts.map +1 -1
  365. package/dist/runner/phases/production-sync.js +28 -4
  366. package/dist/runner/phases/production-sync.js.map +1 -1
  367. package/dist/runner/phases/revision.d.ts.map +1 -1
  368. package/dist/runner/phases/revision.js +112 -32
  369. package/dist/runner/phases/revision.js.map +1 -1
  370. package/dist/runner/preflight.d.ts +2 -0
  371. package/dist/runner/preflight.d.ts.map +1 -1
  372. package/dist/runner/preflight.js +112 -3
  373. package/dist/runner/preflight.js.map +1 -1
  374. package/dist/runner/resolve-route.d.ts +1 -0
  375. package/dist/runner/resolve-route.d.ts.map +1 -1
  376. package/dist/runner/resolve-route.js +26 -0
  377. package/dist/runner/resolve-route.js.map +1 -1
  378. package/dist/runner/run-generation.d.ts +2 -0
  379. package/dist/runner/run-generation.d.ts.map +1 -0
  380. package/dist/runner/run-generation.js +19 -0
  381. package/dist/runner/run-generation.js.map +1 -0
  382. package/dist/runner/uninitialized-product-routing.d.ts +24 -0
  383. package/dist/runner/uninitialized-product-routing.d.ts.map +1 -0
  384. package/dist/runner/uninitialized-product-routing.js +70 -0
  385. package/dist/runner/uninitialized-product-routing.js.map +1 -0
  386. package/dist/setup/config-builder.d.ts.map +1 -1
  387. package/dist/setup/config-builder.js +12 -0
  388. package/dist/setup/config-builder.js.map +1 -1
  389. package/dist/setup/control-plane-readiness.d.ts +8 -1
  390. package/dist/setup/control-plane-readiness.d.ts.map +1 -1
  391. package/dist/setup/control-plane-readiness.js +63 -19
  392. package/dist/setup/control-plane-readiness.js.map +1 -1
  393. package/dist/setup/control-plane-setup-state.d.ts +13 -3
  394. package/dist/setup/control-plane-setup-state.d.ts.map +1 -1
  395. package/dist/setup/control-plane-setup-state.js +30 -3
  396. package/dist/setup/control-plane-setup-state.js.map +1 -1
  397. package/dist/setup/control-plane-state-lock.d.ts +12 -0
  398. package/dist/setup/control-plane-state-lock.d.ts.map +1 -0
  399. package/dist/setup/control-plane-state-lock.js +79 -0
  400. package/dist/setup/control-plane-state-lock.js.map +1 -0
  401. package/dist/setup/control-plane-types.d.ts +72 -1
  402. package/dist/setup/control-plane-types.d.ts.map +1 -1
  403. package/dist/setup/first-run-readiness.d.ts +4 -0
  404. package/dist/setup/first-run-readiness.d.ts.map +1 -1
  405. package/dist/setup/first-run-readiness.js +2 -2
  406. package/dist/setup/first-run-readiness.js.map +1 -1
  407. package/dist/setup/git-askpass-credentials.d.ts +19 -0
  408. package/dist/setup/git-askpass-credentials.d.ts.map +1 -0
  409. package/dist/setup/git-askpass-credentials.js +60 -0
  410. package/dist/setup/git-askpass-credentials.js.map +1 -0
  411. package/dist/setup/github-dispatch-token.d.ts +4 -0
  412. package/dist/setup/github-dispatch-token.d.ts.map +1 -1
  413. package/dist/setup/github-dispatch-token.js +23 -3
  414. package/dist/setup/github-dispatch-token.js.map +1 -1
  415. package/dist/setup/github-remote-provider.d.ts +44 -0
  416. package/dist/setup/github-remote-provider.d.ts.map +1 -1
  417. package/dist/setup/github-remote-provider.js +22 -2
  418. package/dist/setup/github-remote-provider.js.map +1 -1
  419. package/dist/setup/github-remote-setup-live.d.ts +30 -1
  420. package/dist/setup/github-remote-setup-live.d.ts.map +1 -1
  421. package/dist/setup/github-remote-setup-live.js +68 -11
  422. package/dist/setup/github-remote-setup-live.js.map +1 -1
  423. package/dist/setup/github-repository-name.d.ts +15 -0
  424. package/dist/setup/github-repository-name.d.ts.map +1 -0
  425. package/dist/setup/github-repository-name.js +54 -0
  426. package/dist/setup/github-repository-name.js.map +1 -0
  427. package/dist/setup/github-target-repository-provider-live.d.ts +35 -0
  428. package/dist/setup/github-target-repository-provider-live.d.ts.map +1 -0
  429. package/dist/setup/github-target-repository-provider-live.js +236 -0
  430. package/dist/setup/github-target-repository-provider-live.js.map +1 -0
  431. package/dist/setup/github-target-repository-provider-mock.d.ts +47 -0
  432. package/dist/setup/github-target-repository-provider-mock.d.ts.map +1 -0
  433. package/dist/setup/github-target-repository-provider-mock.js +189 -0
  434. package/dist/setup/github-target-repository-provider-mock.js.map +1 -0
  435. package/dist/setup/github-target-repository-provider.d.ts +44 -0
  436. package/dist/setup/github-target-repository-provider.d.ts.map +1 -0
  437. package/dist/setup/github-target-repository-provider.js +7 -0
  438. package/dist/setup/github-target-repository-provider.js.map +1 -0
  439. package/dist/setup/github-workflow-permissions.d.ts +1 -1
  440. package/dist/setup/github-workflow-permissions.d.ts.map +1 -1
  441. package/dist/setup/github-workflow-permissions.js +1 -1
  442. package/dist/setup/github-workflow-permissions.js.map +1 -1
  443. package/dist/setup/gui-view-model.d.ts +5 -0
  444. package/dist/setup/gui-view-model.d.ts.map +1 -1
  445. package/dist/setup/gui-view-model.js +5 -0
  446. package/dist/setup/gui-view-model.js.map +1 -1
  447. package/dist/setup/harness-dispatch-repo.d.ts +16 -2
  448. package/dist/setup/harness-dispatch-repo.d.ts.map +1 -1
  449. package/dist/setup/harness-dispatch-repo.js +113 -22
  450. package/dist/setup/harness-dispatch-repo.js.map +1 -1
  451. package/dist/setup/harness-managed-repo-marker.d.ts +1 -0
  452. package/dist/setup/harness-managed-repo-marker.d.ts.map +1 -1
  453. package/dist/setup/harness-managed-repo-marker.js +18 -0
  454. package/dist/setup/harness-managed-repo-marker.js.map +1 -1
  455. package/dist/setup/harness-provisioning-last-run.d.ts +27 -0
  456. package/dist/setup/harness-provisioning-last-run.d.ts.map +1 -0
  457. package/dist/setup/harness-provisioning-last-run.js +94 -0
  458. package/dist/setup/harness-provisioning-last-run.js.map +1 -0
  459. package/dist/setup/harness-provisioning-pending-state.d.ts +1 -1
  460. package/dist/setup/harness-provisioning-pending-state.d.ts.map +1 -1
  461. package/dist/setup/harness-provisioning-pending-state.js.map +1 -1
  462. package/dist/setup/harness-provisioning-progress.d.ts +58 -0
  463. package/dist/setup/harness-provisioning-progress.d.ts.map +1 -0
  464. package/dist/setup/harness-provisioning-progress.js +134 -0
  465. package/dist/setup/harness-provisioning-progress.js.map +1 -0
  466. package/dist/setup/harness-repo-provisioning.d.ts +11 -0
  467. package/dist/setup/harness-repo-provisioning.d.ts.map +1 -1
  468. package/dist/setup/harness-repo-provisioning.js +98 -6
  469. package/dist/setup/harness-repo-provisioning.js.map +1 -1
  470. package/dist/setup/harness-snapshot-git-transport.d.ts +92 -0
  471. package/dist/setup/harness-snapshot-git-transport.d.ts.map +1 -0
  472. package/dist/setup/harness-snapshot-git-transport.js +544 -0
  473. package/dist/setup/harness-snapshot-git-transport.js.map +1 -0
  474. package/dist/setup/harness-snapshot-provisioning-helpers.d.ts +1 -1
  475. package/dist/setup/harness-snapshot-provisioning-helpers.d.ts.map +1 -1
  476. package/dist/setup/harness-snapshot-provisioning-helpers.js.map +1 -1
  477. package/dist/setup/harness-snapshot-provisioning.d.ts +12 -1
  478. package/dist/setup/harness-snapshot-provisioning.d.ts.map +1 -1
  479. package/dist/setup/harness-snapshot-provisioning.js +298 -73
  480. package/dist/setup/harness-snapshot-provisioning.js.map +1 -1
  481. package/dist/setup/harness-step-readiness-server.d.ts +11 -0
  482. package/dist/setup/harness-step-readiness-server.d.ts.map +1 -0
  483. package/dist/setup/harness-step-readiness-server.js +24 -0
  484. package/dist/setup/harness-step-readiness-server.js.map +1 -0
  485. package/dist/setup/harness-step-readiness.d.ts +21 -0
  486. package/dist/setup/harness-step-readiness.d.ts.map +1 -0
  487. package/dist/setup/harness-step-readiness.js +40 -0
  488. package/dist/setup/harness-step-readiness.js.map +1 -0
  489. package/dist/setup/harness-workspace-snapshot-loader.d.ts +6 -1
  490. package/dist/setup/harness-workspace-snapshot-loader.d.ts.map +1 -1
  491. package/dist/setup/harness-workspace-snapshot-loader.js +45 -12
  492. package/dist/setup/harness-workspace-snapshot-loader.js.map +1 -1
  493. package/dist/setup/initial-setup-lifecycle.d.ts +51 -0
  494. package/dist/setup/initial-setup-lifecycle.d.ts.map +1 -0
  495. package/dist/setup/initial-setup-lifecycle.js +93 -0
  496. package/dist/setup/initial-setup-lifecycle.js.map +1 -0
  497. package/dist/setup/linear-category-labels.d.ts +2 -0
  498. package/dist/setup/linear-category-labels.d.ts.map +1 -0
  499. package/dist/setup/linear-category-labels.js +19 -0
  500. package/dist/setup/linear-category-labels.js.map +1 -0
  501. package/dist/setup/linear-setup-apply.d.ts +1 -0
  502. package/dist/setup/linear-setup-apply.d.ts.map +1 -1
  503. package/dist/setup/linear-setup-apply.js +67 -16
  504. package/dist/setup/linear-setup-apply.js.map +1 -1
  505. package/dist/setup/linear-setup-client.d.ts +24 -0
  506. package/dist/setup/linear-setup-client.d.ts.map +1 -1
  507. package/dist/setup/linear-setup-client.js +61 -0
  508. package/dist/setup/linear-setup-client.js.map +1 -1
  509. package/dist/setup/linear-setup-plan.d.ts +22 -1
  510. package/dist/setup/linear-setup-plan.d.ts.map +1 -1
  511. package/dist/setup/linear-setup-plan.js +69 -6
  512. package/dist/setup/linear-setup-plan.js.map +1 -1
  513. package/dist/setup/linear-setup-progress.d.ts +30 -0
  514. package/dist/setup/linear-setup-progress.d.ts.map +1 -0
  515. package/dist/setup/linear-setup-progress.js +71 -0
  516. package/dist/setup/linear-setup-progress.js.map +1 -0
  517. package/dist/setup/linear-status-contract.d.ts +2 -1
  518. package/dist/setup/linear-status-contract.d.ts.map +1 -1
  519. package/dist/setup/linear-status-contract.js +26 -67
  520. package/dist/setup/linear-status-contract.js.map +1 -1
  521. package/dist/setup/linear-workflow-status-repair.d.ts +36 -0
  522. package/dist/setup/linear-workflow-status-repair.d.ts.map +1 -0
  523. package/dist/setup/linear-workflow-status-repair.js +187 -0
  524. package/dist/setup/linear-workflow-status-repair.js.map +1 -0
  525. package/dist/setup/linear-workspace-apply.d.ts +25 -0
  526. package/dist/setup/linear-workspace-apply.d.ts.map +1 -0
  527. package/dist/setup/linear-workspace-apply.js +212 -0
  528. package/dist/setup/linear-workspace-apply.js.map +1 -0
  529. package/dist/setup/linear-workspace-drift.d.ts +2 -0
  530. package/dist/setup/linear-workspace-drift.d.ts.map +1 -0
  531. package/dist/setup/linear-workspace-drift.js +2 -0
  532. package/dist/setup/linear-workspace-drift.js.map +1 -0
  533. package/dist/setup/linear-workspace-migration.d.ts +43 -0
  534. package/dist/setup/linear-workspace-migration.d.ts.map +1 -0
  535. package/dist/setup/linear-workspace-migration.js +212 -0
  536. package/dist/setup/linear-workspace-migration.js.map +1 -0
  537. package/dist/setup/linear-workspace-plan.d.ts +92 -0
  538. package/dist/setup/linear-workspace-plan.d.ts.map +1 -0
  539. package/dist/setup/linear-workspace-plan.js +283 -0
  540. package/dist/setup/linear-workspace-plan.js.map +1 -0
  541. package/dist/setup/local-readiness-checks.d.ts +17 -0
  542. package/dist/setup/local-readiness-checks.d.ts.map +1 -1
  543. package/dist/setup/local-readiness-checks.js +86 -23
  544. package/dist/setup/local-readiness-checks.js.map +1 -1
  545. package/dist/setup/mock-target-workflow-finalization.d.ts.map +1 -1
  546. package/dist/setup/mock-target-workflow-finalization.js +27 -4
  547. package/dist/setup/mock-target-workflow-finalization.js.map +1 -1
  548. package/dist/setup/packaged-default-route.d.ts +15 -0
  549. package/dist/setup/packaged-default-route.d.ts.map +1 -0
  550. package/dist/setup/packaged-default-route.js +17 -0
  551. package/dist/setup/packaged-default-route.js.map +1 -0
  552. package/dist/setup/release-sync-managed-runner.d.ts +61 -0
  553. package/dist/setup/release-sync-managed-runner.d.ts.map +1 -0
  554. package/dist/setup/release-sync-managed-runner.js +364 -0
  555. package/dist/setup/release-sync-managed-runner.js.map +1 -0
  556. package/dist/setup/remote-apply-actions.d.ts.map +1 -1
  557. package/dist/setup/remote-apply-actions.js +23 -0
  558. package/dist/setup/remote-apply-actions.js.map +1 -1
  559. package/dist/setup/runner-upgrade-canary-dispatch.d.ts +19 -0
  560. package/dist/setup/runner-upgrade-canary-dispatch.d.ts.map +1 -0
  561. package/dist/setup/runner-upgrade-canary-dispatch.js +38 -0
  562. package/dist/setup/runner-upgrade-canary-dispatch.js.map +1 -0
  563. package/dist/setup/runner-upgrade-canary.d.ts +23 -0
  564. package/dist/setup/runner-upgrade-canary.d.ts.map +1 -0
  565. package/dist/setup/runner-upgrade-canary.js +146 -0
  566. package/dist/setup/runner-upgrade-canary.js.map +1 -0
  567. package/dist/setup/runner-upgrade-evidence.d.ts +14 -0
  568. package/dist/setup/runner-upgrade-evidence.d.ts.map +1 -0
  569. package/dist/setup/runner-upgrade-evidence.js +9 -0
  570. package/dist/setup/runner-upgrade-evidence.js.map +1 -0
  571. package/dist/setup/runner-upgrade-pending-state.d.ts +30 -0
  572. package/dist/setup/runner-upgrade-pending-state.d.ts.map +1 -0
  573. package/dist/setup/runner-upgrade-pending-state.js +75 -0
  574. package/dist/setup/runner-upgrade-pending-state.js.map +1 -0
  575. package/dist/setup/runner-upgrade-progress.d.ts +38 -0
  576. package/dist/setup/runner-upgrade-progress.d.ts.map +1 -0
  577. package/dist/setup/runner-upgrade-progress.js +95 -0
  578. package/dist/setup/runner-upgrade-progress.js.map +1 -0
  579. package/dist/setup/runner-upgrade-provider-live.d.ts +5 -0
  580. package/dist/setup/runner-upgrade-provider-live.d.ts.map +1 -0
  581. package/dist/setup/runner-upgrade-provider-live.js +338 -0
  582. package/dist/setup/runner-upgrade-provider-live.js.map +1 -0
  583. package/dist/setup/runner-upgrade-provider.d.ts +231 -0
  584. package/dist/setup/runner-upgrade-provider.d.ts.map +1 -0
  585. package/dist/setup/runner-upgrade-provider.js +466 -0
  586. package/dist/setup/runner-upgrade-provider.js.map +1 -0
  587. package/dist/setup/runner-upgrade-status-cache.d.ts +13 -0
  588. package/dist/setup/runner-upgrade-status-cache.d.ts.map +1 -0
  589. package/dist/setup/runner-upgrade-status-cache.js +39 -0
  590. package/dist/setup/runner-upgrade-status-cache.js.map +1 -0
  591. package/dist/setup/runner-upgrade-three-way.d.ts +28 -0
  592. package/dist/setup/runner-upgrade-three-way.d.ts.map +1 -0
  593. package/dist/setup/runner-upgrade-three-way.js +102 -0
  594. package/dist/setup/runner-upgrade-three-way.js.map +1 -0
  595. package/dist/setup/runner-upgrade-timeouts.d.ts +72 -0
  596. package/dist/setup/runner-upgrade-timeouts.d.ts.map +1 -0
  597. package/dist/setup/runner-upgrade-timeouts.js +261 -0
  598. package/dist/setup/runner-upgrade-timeouts.js.map +1 -0
  599. package/dist/setup/runner-upgrade-types.d.ts +84 -0
  600. package/dist/setup/runner-upgrade-types.d.ts.map +1 -0
  601. package/dist/setup/runner-upgrade-types.js +64 -0
  602. package/dist/setup/runner-upgrade-types.js.map +1 -0
  603. package/dist/setup/runner-upgrade-worker.d.ts +17 -0
  604. package/dist/setup/runner-upgrade-worker.d.ts.map +1 -0
  605. package/dist/setup/runner-upgrade-worker.js +115 -0
  606. package/dist/setup/runner-upgrade-worker.js.map +1 -0
  607. package/dist/setup/runner-upgrade.d.ts +57 -0
  608. package/dist/setup/runner-upgrade.d.ts.map +1 -0
  609. package/dist/setup/runner-upgrade.js +1311 -0
  610. package/dist/setup/runner-upgrade.js.map +1 -0
  611. package/dist/setup/service-verification.d.ts +18 -1
  612. package/dist/setup/service-verification.d.ts.map +1 -1
  613. package/dist/setup/service-verification.js +110 -19
  614. package/dist/setup/service-verification.js.map +1 -1
  615. package/dist/setup/settings-config-patch.d.ts +69 -0
  616. package/dist/setup/settings-config-patch.d.ts.map +1 -0
  617. package/dist/setup/settings-config-patch.js +312 -0
  618. package/dist/setup/settings-config-patch.js.map +1 -0
  619. package/dist/setup/setup-state.d.ts +1 -0
  620. package/dist/setup/setup-state.d.ts.map +1 -1
  621. package/dist/setup/setup-state.js +11 -1
  622. package/dist/setup/setup-state.js.map +1 -1
  623. package/dist/setup/step6-automatic-control-state.d.ts +21 -0
  624. package/dist/setup/step6-automatic-control-state.d.ts.map +1 -0
  625. package/dist/setup/step6-automatic-control-state.js +28 -0
  626. package/dist/setup/step6-automatic-control-state.js.map +1 -0
  627. package/dist/setup/sync-harness-config-cloud.d.ts +23 -0
  628. package/dist/setup/sync-harness-config-cloud.d.ts.map +1 -0
  629. package/dist/setup/sync-harness-config-cloud.js +91 -0
  630. package/dist/setup/sync-harness-config-cloud.js.map +1 -0
  631. package/dist/setup/target-repo-provisioning-pending-state.d.ts +42 -0
  632. package/dist/setup/target-repo-provisioning-pending-state.d.ts.map +1 -0
  633. package/dist/setup/target-repo-provisioning-pending-state.js +95 -0
  634. package/dist/setup/target-repo-provisioning-pending-state.js.map +1 -0
  635. package/dist/setup/target-repo-provisioning.d.ts +67 -0
  636. package/dist/setup/target-repo-provisioning.d.ts.map +1 -0
  637. package/dist/setup/target-repo-provisioning.js +473 -0
  638. package/dist/setup/target-repo-provisioning.js.map +1 -0
  639. package/dist/setup/target-workflow-finalization-progress.d.ts +43 -0
  640. package/dist/setup/target-workflow-finalization-progress.d.ts.map +1 -0
  641. package/dist/setup/target-workflow-finalization-progress.js +83 -0
  642. package/dist/setup/target-workflow-finalization-progress.js.map +1 -0
  643. package/dist/setup/target-workflow-finalization-types.d.ts +21 -1
  644. package/dist/setup/target-workflow-finalization-types.d.ts.map +1 -1
  645. package/dist/setup/target-workflow-finalization-types.js +75 -0
  646. package/dist/setup/target-workflow-finalization-types.js.map +1 -1
  647. package/dist/setup/target-workflow-finalization.d.ts.map +1 -1
  648. package/dist/setup/target-workflow-finalization.js +618 -15
  649. package/dist/setup/target-workflow-finalization.js.map +1 -1
  650. package/dist/setup/target-workflow-setup.d.ts.map +1 -1
  651. package/dist/setup/target-workflow-setup.js +2 -0
  652. package/dist/setup/target-workflow-setup.js.map +1 -1
  653. package/dist/setup/test-only-runner-upgrade-provider.d.ts +11 -0
  654. package/dist/setup/test-only-runner-upgrade-provider.d.ts.map +1 -0
  655. package/dist/setup/test-only-runner-upgrade-provider.js +37 -0
  656. package/dist/setup/test-only-runner-upgrade-provider.js.map +1 -0
  657. package/dist/setup/test-only-target-repo-provisioning-provider.d.ts +7 -0
  658. package/dist/setup/test-only-target-repo-provisioning-provider.d.ts.map +1 -0
  659. package/dist/setup/test-only-target-repo-provisioning-provider.js +33 -0
  660. package/dist/setup/test-only-target-repo-provisioning-provider.js.map +1 -0
  661. package/dist/setup/vercel-bridge-artifact.d.ts +7 -0
  662. package/dist/setup/vercel-bridge-artifact.d.ts.map +1 -0
  663. package/dist/setup/vercel-bridge-artifact.js +164 -0
  664. package/dist/setup/vercel-bridge-artifact.js.map +1 -0
  665. package/dist/setup/vercel-bridge-deploy.d.ts +42 -0
  666. package/dist/setup/vercel-bridge-deploy.d.ts.map +1 -0
  667. package/dist/setup/vercel-bridge-deploy.js +138 -0
  668. package/dist/setup/vercel-bridge-deploy.js.map +1 -0
  669. package/dist/setup/vercel-bridge-diagnostics.js +1 -1
  670. package/dist/setup/vercel-bridge-diagnostics.js.map +1 -1
  671. package/dist/setup/vercel-bridge-options.d.ts +2 -0
  672. package/dist/setup/vercel-bridge-options.d.ts.map +1 -1
  673. package/dist/setup/vercel-bridge-options.js +2 -0
  674. package/dist/setup/vercel-bridge-options.js.map +1 -1
  675. package/dist/setup/vercel-bridge-orchestration-summary.d.ts +13 -0
  676. package/dist/setup/vercel-bridge-orchestration-summary.d.ts.map +1 -0
  677. package/dist/setup/vercel-bridge-orchestration-summary.js +22 -0
  678. package/dist/setup/vercel-bridge-orchestration-summary.js.map +1 -0
  679. package/dist/setup/vercel-bridge-project-marker.d.ts +5 -0
  680. package/dist/setup/vercel-bridge-project-marker.d.ts.map +1 -0
  681. package/dist/setup/vercel-bridge-project-marker.js +6 -0
  682. package/dist/setup/vercel-bridge-project-marker.js.map +1 -0
  683. package/dist/setup/vercel-bridge-readiness.d.ts +1 -0
  684. package/dist/setup/vercel-bridge-readiness.d.ts.map +1 -1
  685. package/dist/setup/vercel-bridge-readiness.js +1 -1
  686. package/dist/setup/vercel-bridge-readiness.js.map +1 -1
  687. package/dist/setup/vercel-bridge-redeploy-normalize.d.ts +18 -0
  688. package/dist/setup/vercel-bridge-redeploy-normalize.d.ts.map +1 -0
  689. package/dist/setup/vercel-bridge-redeploy-normalize.js +175 -0
  690. package/dist/setup/vercel-bridge-redeploy-normalize.js.map +1 -0
  691. package/dist/setup/vercel-bridge-redeploy-poll.d.ts +7 -1
  692. package/dist/setup/vercel-bridge-redeploy-poll.d.ts.map +1 -1
  693. package/dist/setup/vercel-bridge-redeploy-poll.js +329 -166
  694. package/dist/setup/vercel-bridge-redeploy-poll.js.map +1 -1
  695. package/dist/setup/vercel-bridge-redeploy-state.d.ts.map +1 -1
  696. package/dist/setup/vercel-bridge-redeploy-state.js +3 -0
  697. package/dist/setup/vercel-bridge-redeploy-state.js.map +1 -1
  698. package/dist/setup/vercel-bridge-structured-log.d.ts +5 -0
  699. package/dist/setup/vercel-bridge-structured-log.d.ts.map +1 -1
  700. package/dist/setup/vercel-bridge-structured-log.js.map +1 -1
  701. package/dist/setup/vercel-project-name.d.ts +7 -0
  702. package/dist/setup/vercel-project-name.d.ts.map +1 -0
  703. package/dist/setup/vercel-project-name.js +26 -0
  704. package/dist/setup/vercel-project-name.js.map +1 -0
  705. package/dist/setup/vercel-setup-apply.d.ts +7 -2
  706. package/dist/setup/vercel-setup-apply.d.ts.map +1 -1
  707. package/dist/setup/vercel-setup-apply.js +315 -38
  708. package/dist/setup/vercel-setup-apply.js.map +1 -1
  709. package/dist/setup/vercel-setup-client.d.ts +26 -1
  710. package/dist/setup/vercel-setup-client.d.ts.map +1 -1
  711. package/dist/setup/vercel-setup-client.js +50 -1
  712. package/dist/setup/vercel-setup-client.js.map +1 -1
  713. package/dist/setup/vercel-setup-plan.d.ts +5 -0
  714. package/dist/setup/vercel-setup-plan.d.ts.map +1 -1
  715. package/dist/setup/vercel-setup-plan.js +65 -13
  716. package/dist/setup/vercel-setup-plan.js.map +1 -1
  717. package/dist/setup/vercel-setup-summary.d.ts +3 -0
  718. package/dist/setup/vercel-setup-summary.d.ts.map +1 -1
  719. package/dist/setup/vercel-setup-summary.js +4 -0
  720. package/dist/setup/vercel-setup-summary.js.map +1 -1
  721. package/dist/setup/workflow-config-snapshot.d.ts +8 -0
  722. package/dist/setup/workflow-config-snapshot.d.ts.map +1 -0
  723. package/dist/setup/workflow-config-snapshot.js +13 -0
  724. package/dist/setup/workflow-config-snapshot.js.map +1 -0
  725. package/dist/setup/workflow-install-branch-recovery.d.ts +116 -0
  726. package/dist/setup/workflow-install-branch-recovery.d.ts.map +1 -0
  727. package/dist/setup/workflow-install-branch-recovery.js +385 -0
  728. package/dist/setup/workflow-install-branch-recovery.js.map +1 -0
  729. package/dist/setup/workflow-install-merge-errors.d.ts +5 -2
  730. package/dist/setup/workflow-install-merge-errors.d.ts.map +1 -1
  731. package/dist/setup/workflow-install-merge-errors.js +51 -17
  732. package/dist/setup/workflow-install-merge-errors.js.map +1 -1
  733. package/dist/setup/workflow-install-merge-gate.d.ts +10 -0
  734. package/dist/setup/workflow-install-merge-gate.d.ts.map +1 -0
  735. package/dist/setup/workflow-install-merge-gate.js +21 -0
  736. package/dist/setup/workflow-install-merge-gate.js.map +1 -0
  737. package/dist/setup/workflow-model-save-queue.d.ts +16 -0
  738. package/dist/setup/workflow-model-save-queue.d.ts.map +1 -0
  739. package/dist/setup/workflow-model-save-queue.js +174 -0
  740. package/dist/setup/workflow-model-save-queue.js.map +1 -0
  741. package/dist/setup/workflow-model-sync-lock.d.ts +12 -0
  742. package/dist/setup/workflow-model-sync-lock.d.ts.map +1 -0
  743. package/dist/setup/workflow-model-sync-lock.js +79 -0
  744. package/dist/setup/workflow-model-sync-lock.js.map +1 -0
  745. package/dist/setup/workflow-model-sync.d.ts +34 -0
  746. package/dist/setup/workflow-model-sync.d.ts.map +1 -0
  747. package/dist/setup/workflow-model-sync.js +163 -0
  748. package/dist/setup/workflow-model-sync.js.map +1 -0
  749. package/dist/setup/workflow-models-sync-evidence.d.ts +12 -0
  750. package/dist/setup/workflow-models-sync-evidence.d.ts.map +1 -0
  751. package/dist/setup/workflow-models-sync-evidence.js +15 -0
  752. package/dist/setup/workflow-models-sync-evidence.js.map +1 -0
  753. package/dist/types/parsed-issue.d.ts +8 -0
  754. package/dist/types/parsed-issue.d.ts.map +1 -1
  755. package/dist/types/run.d.ts +18 -3
  756. package/dist/types/run.d.ts.map +1 -1
  757. package/dist/validate/issue.d.ts +5 -0
  758. package/dist/validate/issue.d.ts.map +1 -1
  759. package/dist/validate/issue.js +23 -3
  760. package/dist/validate/issue.js.map +1 -1
  761. package/dist/validate/types.d.ts +3 -0
  762. package/dist/validate/types.d.ts.map +1 -1
  763. package/dist/webhook/dispatch-statuses.d.ts +1 -1
  764. package/dist/webhook/dispatch-statuses.d.ts.map +1 -1
  765. package/dist/webhook/dispatch-statuses.js +4 -13
  766. package/dist/webhook/dispatch-statuses.js.map +1 -1
  767. package/dist/webhook/filter.d.ts +5 -2
  768. package/dist/webhook/filter.d.ts.map +1 -1
  769. package/dist/webhook/filter.js +15 -1
  770. package/dist/webhook/filter.js.map +1 -1
  771. package/dist/webhook/handle-linear-webhook.d.ts.map +1 -1
  772. package/dist/webhook/handle-linear-webhook.js +15 -1
  773. package/dist/webhook/handle-linear-webhook.js.map +1 -1
  774. package/dist/webhook/parse-linear-issue-event.d.ts +6 -0
  775. package/dist/webhook/parse-linear-issue-event.d.ts.map +1 -1
  776. package/dist/webhook/parse-linear-issue-event.js +2 -0
  777. package/dist/webhook/parse-linear-issue-event.js.map +1 -1
  778. package/dist/webhook/types.d.ts +3 -1
  779. package/dist/webhook/types.d.ts.map +1 -1
  780. package/dist/workflow/canonical-product-development-workflow.d.ts +106 -0
  781. package/dist/workflow/canonical-product-development-workflow.d.ts.map +1 -0
  782. package/dist/workflow/canonical-product-development-workflow.js +425 -0
  783. package/dist/workflow/canonical-product-development-workflow.js.map +1 -0
  784. package/dist/workflow/canonical-workflow-gate.d.ts +33 -0
  785. package/dist/workflow/canonical-workflow-gate.d.ts.map +1 -0
  786. package/dist/workflow/canonical-workflow-gate.js +164 -0
  787. package/dist/workflow/canonical-workflow-gate.js.map +1 -0
  788. package/dist/workflow/canonical-workflow-validation.d.ts +44 -0
  789. package/dist/workflow/canonical-workflow-validation.d.ts.map +1 -0
  790. package/dist/workflow/canonical-workflow-validation.js +193 -0
  791. package/dist/workflow/canonical-workflow-validation.js.map +1 -0
  792. package/dist/workflow/finalize-harness-run.d.ts +2 -0
  793. package/dist/workflow/finalize-harness-run.d.ts.map +1 -0
  794. package/dist/workflow/finalize-harness-run.js +62 -0
  795. package/dist/workflow/finalize-harness-run.js.map +1 -0
  796. package/dist/workflow/preflight-canonical.d.ts +11 -0
  797. package/dist/workflow/preflight-canonical.d.ts.map +1 -0
  798. package/dist/workflow/preflight-canonical.js +20 -0
  799. package/dist/workflow/preflight-canonical.js.map +1 -0
  800. package/dist/workflow/write-fallback-manifest.d.ts +2 -0
  801. package/dist/workflow/write-fallback-manifest.d.ts.map +1 -0
  802. package/dist/workflow/write-fallback-manifest.js +30 -0
  803. package/dist/workflow/write-fallback-manifest.js.map +1 -0
  804. package/dist/workflow-page/bootstrap.d.ts +21 -0
  805. package/dist/workflow-page/bootstrap.d.ts.map +1 -0
  806. package/dist/workflow-page/bootstrap.js +185 -0
  807. package/dist/workflow-page/bootstrap.js.map +1 -0
  808. package/dist/workflow-page/catalog-validation.d.ts +33 -0
  809. package/dist/workflow-page/catalog-validation.d.ts.map +1 -0
  810. package/dist/workflow-page/catalog-validation.js +105 -0
  811. package/dist/workflow-page/catalog-validation.js.map +1 -0
  812. package/dist/workflow-page/constants.d.ts +7 -0
  813. package/dist/workflow-page/constants.d.ts.map +1 -0
  814. package/dist/workflow-page/constants.js +18 -0
  815. package/dist/workflow-page/constants.js.map +1 -0
  816. package/dist/workflow-page/current-workflow.d.ts +18 -0
  817. package/dist/workflow-page/current-workflow.d.ts.map +1 -0
  818. package/dist/workflow-page/current-workflow.js +142 -0
  819. package/dist/workflow-page/current-workflow.js.map +1 -0
  820. package/dist/workflow-page/fingerprint.d.ts +3 -0
  821. package/dist/workflow-page/fingerprint.d.ts.map +1 -0
  822. package/dist/workflow-page/fingerprint.js +8 -0
  823. package/dist/workflow-page/fingerprint.js.map +1 -0
  824. package/dist/workflow-page/fixture-definition.d.ts +13 -0
  825. package/dist/workflow-page/fixture-definition.d.ts.map +1 -0
  826. package/dist/workflow-page/fixture-definition.js +2 -0
  827. package/dist/workflow-page/fixture-definition.js.map +1 -0
  828. package/dist/workflow-page/fixture-role-models.d.ts +19 -0
  829. package/dist/workflow-page/fixture-role-models.d.ts.map +1 -0
  830. package/dist/workflow-page/fixture-role-models.js +32 -0
  831. package/dist/workflow-page/fixture-role-models.js.map +1 -0
  832. package/dist/workflow-page/fixtures/basic-current-workflow.d.ts +5 -0
  833. package/dist/workflow-page/fixtures/basic-current-workflow.d.ts.map +1 -0
  834. package/dist/workflow-page/fixtures/basic-current-workflow.js +36 -0
  835. package/dist/workflow-page/fixtures/basic-current-workflow.js.map +1 -0
  836. package/dist/workflow-page/fixtures/branching-pr-review.d.ts +3 -0
  837. package/dist/workflow-page/fixtures/branching-pr-review.d.ts.map +1 -0
  838. package/dist/workflow-page/fixtures/branching-pr-review.js +10 -0
  839. package/dist/workflow-page/fixtures/branching-pr-review.js.map +1 -0
  840. package/dist/workflow-page/fixtures/canonical-violations.d.ts +6 -0
  841. package/dist/workflow-page/fixtures/canonical-violations.d.ts.map +1 -0
  842. package/dist/workflow-page/fixtures/canonical-violations.js +19 -0
  843. package/dist/workflow-page/fixtures/canonical-violations.js.map +1 -0
  844. package/dist/workflow-page/fixtures/credential-errors.d.ts +3 -0
  845. package/dist/workflow-page/fixtures/credential-errors.d.ts.map +1 -0
  846. package/dist/workflow-page/fixtures/credential-errors.js +12 -0
  847. package/dist/workflow-page/fixtures/credential-errors.js.map +1 -0
  848. package/dist/workflow-page/fixtures/empty-linear-statuses.d.ts +3 -0
  849. package/dist/workflow-page/fixtures/empty-linear-statuses.d.ts.map +1 -0
  850. package/dist/workflow-page/fixtures/empty-linear-statuses.js +9 -0
  851. package/dist/workflow-page/fixtures/empty-linear-statuses.js.map +1 -0
  852. package/dist/workflow-page/fixtures/hundred-node-performance.d.ts +3 -0
  853. package/dist/workflow-page/fixtures/hundred-node-performance.d.ts.map +1 -0
  854. package/dist/workflow-page/fixtures/hundred-node-performance.js +21 -0
  855. package/dist/workflow-page/fixtures/hundred-node-performance.js.map +1 -0
  856. package/dist/workflow-page/fixtures/index.d.ts +6 -0
  857. package/dist/workflow-page/fixtures/index.d.ts.map +1 -0
  858. package/dist/workflow-page/fixtures/index.js +24 -0
  859. package/dist/workflow-page/fixtures/index.js.map +1 -0
  860. package/dist/workflow-page/fixtures/model-catalog-snapshot.d.ts +10 -0
  861. package/dist/workflow-page/fixtures/model-catalog-snapshot.d.ts.map +1 -0
  862. package/dist/workflow-page/fixtures/model-catalog-snapshot.js +29 -0
  863. package/dist/workflow-page/fixtures/model-catalog-snapshot.js.map +1 -0
  864. package/dist/workflow-page/fixtures/workflow-scopes.d.ts +4 -0
  865. package/dist/workflow-page/fixtures/workflow-scopes.d.ts.map +1 -0
  866. package/dist/workflow-page/fixtures/workflow-scopes.js +16 -0
  867. package/dist/workflow-page/fixtures/workflow-scopes.js.map +1 -0
  868. package/dist/workflow-page/linear-status-source.d.ts +15 -0
  869. package/dist/workflow-page/linear-status-source.d.ts.map +1 -0
  870. package/dist/workflow-page/linear-status-source.js +44 -0
  871. package/dist/workflow-page/linear-status-source.js.map +1 -0
  872. package/dist/workflow-page/model-catalog-lookup.d.ts +3 -0
  873. package/dist/workflow-page/model-catalog-lookup.d.ts.map +1 -0
  874. package/dist/workflow-page/model-catalog-lookup.js +4 -0
  875. package/dist/workflow-page/model-catalog-lookup.js.map +1 -0
  876. package/dist/workflow-page/model-catalog-utils.d.ts +19 -0
  877. package/dist/workflow-page/model-catalog-utils.d.ts.map +1 -0
  878. package/dist/workflow-page/model-catalog-utils.js +46 -0
  879. package/dist/workflow-page/model-catalog-utils.js.map +1 -0
  880. package/dist/workflow-page/model-catalog.d.ts +12 -0
  881. package/dist/workflow-page/model-catalog.d.ts.map +1 -0
  882. package/dist/workflow-page/model-catalog.js +40 -0
  883. package/dist/workflow-page/model-catalog.js.map +1 -0
  884. package/dist/workflow-page/scope-branches.d.ts +11 -0
  885. package/dist/workflow-page/scope-branches.d.ts.map +1 -0
  886. package/dist/workflow-page/scope-branches.js +18 -0
  887. package/dist/workflow-page/scope-branches.js.map +1 -0
  888. package/dist/workflow-page/source-context.d.ts +13 -0
  889. package/dist/workflow-page/source-context.d.ts.map +1 -0
  890. package/dist/workflow-page/source-context.js +61 -0
  891. package/dist/workflow-page/source-context.js.map +1 -0
  892. package/dist/workflow-page/types.d.ts +108 -0
  893. package/dist/workflow-page/types.d.ts.map +1 -0
  894. package/dist/workflow-page/types.js +2 -0
  895. package/dist/workflow-page/types.js.map +1 -0
  896. package/dist/workflow-page/workflow-scopes.d.ts +16 -0
  897. package/dist/workflow-page/workflow-scopes.d.ts.map +1 -0
  898. package/dist/workflow-page/workflow-scopes.js +55 -0
  899. package/dist/workflow-page/workflow-scopes.js.map +1 -0
  900. package/gui/.next/BUILD_ID +1 -1
  901. package/gui/.next/app-build-manifest.json +376 -115
  902. package/gui/.next/app-path-routes-manifest.json +44 -15
  903. package/gui/.next/build-manifest.json +12 -12
  904. package/gui/.next/next-minimal-server.js.nft.json +1 -1
  905. package/gui/.next/next-server.js.nft.json +1 -1
  906. package/gui/.next/prerender-manifest.json +0 -24
  907. package/gui/.next/required-server-files.json +4 -3
  908. package/gui/.next/routes-manifest.json +54 -0
  909. package/gui/.next/server/app/_not-found/page.js +2 -2
  910. package/gui/.next/server/app/_not-found/page.js.nft.json +1 -1
  911. package/gui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  912. package/gui/.next/server/app/_not-found.html +1 -1
  913. package/gui/.next/server/app/_not-found.rsc +3 -3
  914. package/gui/.next/server/app/api/observability/event/route.js +1 -0
  915. package/gui/.next/server/app/api/observability/event/route.js.nft.json +1 -0
  916. package/gui/.next/server/app/api/observability/event/route_client-reference-manifest.js +1 -0
  917. package/gui/.next/server/app/api/observability/preferences/route.js +1 -0
  918. package/gui/.next/server/app/api/observability/preferences/route.js.nft.json +1 -0
  919. package/gui/.next/server/app/api/observability/preferences/route_client-reference-manifest.js +1 -0
  920. package/gui/.next/server/app/api/operations/bootstrap/route.js +1 -0
  921. package/gui/.next/server/app/api/operations/bootstrap/route.js.nft.json +1 -0
  922. package/gui/.next/server/app/api/operations/bootstrap/route_client-reference-manifest.js +1 -0
  923. package/gui/.next/server/app/api/operations/draft/route.js +1 -0
  924. package/gui/.next/server/app/api/operations/draft/route.js.nft.json +1 -0
  925. package/gui/.next/server/app/api/operations/draft/route_client-reference-manifest.js +1 -0
  926. package/gui/.next/server/app/api/settings/apply-config-patch/route.js +8 -0
  927. package/gui/.next/server/app/api/settings/apply-config-patch/route.js.nft.json +1 -0
  928. package/gui/.next/server/app/api/settings/apply-config-patch/route_client-reference-manifest.js +1 -0
  929. package/gui/.next/server/app/api/settings/preview-config-patch/route.js +8 -0
  930. package/gui/.next/server/app/api/settings/preview-config-patch/route.js.nft.json +1 -0
  931. package/gui/.next/server/app/api/settings/preview-config-patch/route_client-reference-manifest.js +1 -0
  932. package/gui/.next/server/app/api/setup/apply-connect-services/route.js +1 -1
  933. package/gui/.next/server/app/api/setup/apply-connect-services/route.js.nft.json +1 -1
  934. package/gui/.next/server/app/api/setup/apply-connect-services/route_client-reference-manifest.js +1 -1
  935. package/gui/.next/server/app/api/setup/apply-harness-repo-provisioning/route.js +1 -1
  936. package/gui/.next/server/app/api/setup/apply-harness-repo-provisioning/route.js.nft.json +1 -1
  937. package/gui/.next/server/app/api/setup/apply-harness-repo-provisioning/route_client-reference-manifest.js +1 -1
  938. package/gui/.next/server/app/api/setup/apply-harness-secrets/route.js +1 -1
  939. package/gui/.next/server/app/api/setup/apply-harness-secrets/route.js.nft.json +1 -1
  940. package/gui/.next/server/app/api/setup/apply-harness-secrets/route_client-reference-manifest.js +1 -1
  941. package/gui/.next/server/app/api/setup/apply-linear-setup/route.js +1 -1
  942. package/gui/.next/server/app/api/setup/apply-linear-setup/route.js.nft.json +1 -1
  943. package/gui/.next/server/app/api/setup/apply-linear-setup/route_client-reference-manifest.js +1 -1
  944. package/gui/.next/server/app/api/setup/apply-linear-workspace/route.js +1 -0
  945. package/gui/.next/server/app/api/setup/apply-linear-workspace/route.js.nft.json +1 -0
  946. package/gui/.next/server/app/api/setup/apply-linear-workspace/route_client-reference-manifest.js +1 -0
  947. package/gui/.next/server/app/api/setup/apply-local-files/route.js +1 -1
  948. package/gui/.next/server/app/api/setup/apply-local-files/route.js.nft.json +1 -1
  949. package/gui/.next/server/app/api/setup/apply-local-files/route_client-reference-manifest.js +1 -1
  950. package/gui/.next/server/app/api/setup/apply-runner-upgrade/route.js +1 -0
  951. package/gui/.next/server/app/api/setup/apply-runner-upgrade/route.js.nft.json +1 -0
  952. package/gui/.next/server/app/api/setup/apply-runner-upgrade/route_client-reference-manifest.js +1 -0
  953. package/gui/.next/server/app/api/setup/apply-target-repo-provisioning/route.js +1 -0
  954. package/gui/.next/server/app/api/setup/apply-target-repo-provisioning/route.js.nft.json +1 -0
  955. package/gui/.next/server/app/api/setup/apply-target-repo-provisioning/route_client-reference-manifest.js +1 -0
  956. package/gui/.next/server/app/api/setup/apply-target-workflow/route.js +1 -1
  957. package/gui/.next/server/app/api/setup/apply-target-workflow/route.js.nft.json +1 -1
  958. package/gui/.next/server/app/api/setup/apply-target-workflow/route_client-reference-manifest.js +1 -1
  959. package/gui/.next/server/app/api/setup/apply-vercel-bridge/route.js +1 -1
  960. package/gui/.next/server/app/api/setup/apply-vercel-bridge/route.js.nft.json +1 -1
  961. package/gui/.next/server/app/api/setup/apply-vercel-bridge/route_client-reference-manifest.js +1 -1
  962. package/gui/.next/server/app/api/setup/complete-initial-setup/route.js +1 -0
  963. package/gui/.next/server/app/api/setup/complete-initial-setup/route.js.nft.json +1 -0
  964. package/gui/.next/server/app/api/setup/complete-initial-setup/route_client-reference-manifest.js +1 -0
  965. package/gui/.next/server/app/api/setup/finalize-target-workflow/route.js +1 -1
  966. package/gui/.next/server/app/api/setup/finalize-target-workflow/route.js.nft.json +1 -1
  967. package/gui/.next/server/app/api/setup/finalize-target-workflow/route_client-reference-manifest.js +1 -1
  968. package/gui/.next/server/app/api/setup/harness-provisioning-progress/route.js +1 -0
  969. package/gui/.next/server/app/api/setup/harness-provisioning-progress/route.js.nft.json +1 -0
  970. package/gui/.next/server/app/api/setup/harness-provisioning-progress/route_client-reference-manifest.js +1 -0
  971. package/gui/.next/server/app/api/setup/harness-provisioning-summary/route.js +1 -1
  972. package/gui/.next/server/app/api/setup/harness-provisioning-summary/route.js.nft.json +1 -1
  973. package/gui/.next/server/app/api/setup/harness-provisioning-summary/route_client-reference-manifest.js +1 -1
  974. package/gui/.next/server/app/api/setup/linear-options/route.js +1 -1
  975. package/gui/.next/server/app/api/setup/linear-options/route.js.nft.json +1 -1
  976. package/gui/.next/server/app/api/setup/linear-options/route_client-reference-manifest.js +1 -1
  977. package/gui/.next/server/app/api/setup/linear-setup-progress/route.js +1 -0
  978. package/gui/.next/server/app/api/setup/linear-setup-progress/route.js.nft.json +1 -0
  979. package/gui/.next/server/app/api/setup/linear-setup-progress/route_client-reference-manifest.js +1 -0
  980. package/gui/.next/server/app/api/setup/linear-summary/route.js +1 -1
  981. package/gui/.next/server/app/api/setup/linear-summary/route.js.nft.json +1 -1
  982. package/gui/.next/server/app/api/setup/linear-summary/route_client-reference-manifest.js +1 -1
  983. package/gui/.next/server/app/api/setup/linear-workspace-editor-state/route.js +1 -0
  984. package/gui/.next/server/app/api/setup/linear-workspace-editor-state/route.js.nft.json +1 -0
  985. package/gui/.next/server/app/api/setup/linear-workspace-editor-state/route_client-reference-manifest.js +1 -0
  986. package/gui/.next/server/app/api/setup/local-readiness/route.js +3 -1
  987. package/gui/.next/server/app/api/setup/local-readiness/route.js.nft.json +1 -1
  988. package/gui/.next/server/app/api/setup/local-readiness/route_client-reference-manifest.js +1 -1
  989. package/gui/.next/server/app/api/setup/manual-harness-secret-values/route.js +1 -1
  990. package/gui/.next/server/app/api/setup/manual-harness-secret-values/route.js.nft.json +1 -1
  991. package/gui/.next/server/app/api/setup/manual-harness-secret-values/route_client-reference-manifest.js +1 -1
  992. package/gui/.next/server/app/api/setup/preview-connect-services/route.js +1 -1
  993. package/gui/.next/server/app/api/setup/preview-connect-services/route.js.nft.json +1 -1
  994. package/gui/.next/server/app/api/setup/preview-connect-services/route_client-reference-manifest.js +1 -1
  995. package/gui/.next/server/app/api/setup/preview-harness-repo-provisioning/route.js +1 -1
  996. package/gui/.next/server/app/api/setup/preview-harness-repo-provisioning/route.js.nft.json +1 -1
  997. package/gui/.next/server/app/api/setup/preview-harness-repo-provisioning/route_client-reference-manifest.js +1 -1
  998. package/gui/.next/server/app/api/setup/preview-harness-secrets/route.js +1 -1
  999. package/gui/.next/server/app/api/setup/preview-harness-secrets/route.js.nft.json +1 -1
  1000. package/gui/.next/server/app/api/setup/preview-harness-secrets/route_client-reference-manifest.js +1 -1
  1001. package/gui/.next/server/app/api/setup/preview-linear-setup/route.js +1 -1
  1002. package/gui/.next/server/app/api/setup/preview-linear-setup/route.js.nft.json +1 -1
  1003. package/gui/.next/server/app/api/setup/preview-linear-setup/route_client-reference-manifest.js +1 -1
  1004. package/gui/.next/server/app/api/setup/preview-linear-workspace/route.js +1 -0
  1005. package/gui/.next/server/app/api/setup/preview-linear-workspace/route.js.nft.json +1 -0
  1006. package/gui/.next/server/app/api/setup/preview-linear-workspace/route_client-reference-manifest.js +1 -0
  1007. package/gui/.next/server/app/api/setup/preview-local-files/route.js +1 -1
  1008. package/gui/.next/server/app/api/setup/preview-local-files/route.js.nft.json +1 -1
  1009. package/gui/.next/server/app/api/setup/preview-local-files/route_client-reference-manifest.js +1 -1
  1010. package/gui/.next/server/app/api/setup/preview-runner-upgrade/route.js +1 -0
  1011. package/gui/.next/server/app/api/setup/preview-runner-upgrade/route.js.nft.json +1 -0
  1012. package/gui/.next/server/app/api/setup/preview-runner-upgrade/route_client-reference-manifest.js +1 -0
  1013. package/gui/.next/server/app/api/setup/preview-target-repo-provisioning/route.js +1 -0
  1014. package/gui/.next/server/app/api/setup/preview-target-repo-provisioning/route.js.nft.json +1 -0
  1015. package/gui/.next/server/app/api/setup/preview-target-repo-provisioning/route_client-reference-manifest.js +1 -0
  1016. package/gui/.next/server/app/api/setup/preview-target-workflow/route.js +1 -1
  1017. package/gui/.next/server/app/api/setup/preview-target-workflow/route.js.nft.json +1 -1
  1018. package/gui/.next/server/app/api/setup/preview-target-workflow/route_client-reference-manifest.js +1 -1
  1019. package/gui/.next/server/app/api/setup/preview-vercel-bridge/route.js +1 -1
  1020. package/gui/.next/server/app/api/setup/preview-vercel-bridge/route.js.nft.json +1 -1
  1021. package/gui/.next/server/app/api/setup/preview-vercel-bridge/route_client-reference-manifest.js +1 -1
  1022. package/gui/.next/server/app/api/setup/remote-summary/route.js +1 -1
  1023. package/gui/.next/server/app/api/setup/remote-summary/route.js.nft.json +1 -1
  1024. package/gui/.next/server/app/api/setup/remote-summary/route_client-reference-manifest.js +1 -1
  1025. package/gui/.next/server/app/api/setup/runner-upgrade-progress/route.js +1 -0
  1026. package/gui/.next/server/app/api/setup/runner-upgrade-progress/route.js.nft.json +1 -0
  1027. package/gui/.next/server/app/api/setup/runner-upgrade-progress/route_client-reference-manifest.js +1 -0
  1028. package/gui/.next/server/app/api/setup/runner-upgrade-status/route.js +1 -0
  1029. package/gui/.next/server/app/api/setup/runner-upgrade-status/route.js.nft.json +1 -0
  1030. package/gui/.next/server/app/api/setup/runner-upgrade-status/route_client-reference-manifest.js +1 -0
  1031. package/gui/.next/server/app/api/setup/summary/route.js +1 -1
  1032. package/gui/.next/server/app/api/setup/summary/route.js.nft.json +1 -1
  1033. package/gui/.next/server/app/api/setup/summary/route_client-reference-manifest.js +1 -1
  1034. package/gui/.next/server/app/api/setup/vercel-bridge-options/route.js +1 -1
  1035. package/gui/.next/server/app/api/setup/vercel-bridge-options/route.js.nft.json +1 -1
  1036. package/gui/.next/server/app/api/setup/vercel-bridge-options/route_client-reference-manifest.js +1 -1
  1037. package/gui/.next/server/app/api/setup/vercel-bridge-redeploy-status/route.js +1 -1
  1038. package/gui/.next/server/app/api/setup/vercel-bridge-redeploy-status/route.js.nft.json +1 -1
  1039. package/gui/.next/server/app/api/setup/vercel-bridge-redeploy-status/route_client-reference-manifest.js +1 -1
  1040. package/gui/.next/server/app/api/setup/vercel-summary/route.js +1 -1
  1041. package/gui/.next/server/app/api/setup/vercel-summary/route.js.nft.json +1 -1
  1042. package/gui/.next/server/app/api/setup/vercel-summary/route_client-reference-manifest.js +1 -1
  1043. package/gui/.next/server/app/api/setup/verify-harness-repo/route.js +1 -1
  1044. package/gui/.next/server/app/api/setup/verify-harness-repo/route.js.nft.json +1 -1
  1045. package/gui/.next/server/app/api/setup/verify-harness-repo/route_client-reference-manifest.js +1 -1
  1046. package/gui/.next/server/app/api/setup/verify-service/route.js +1 -1
  1047. package/gui/.next/server/app/api/setup/verify-service/route.js.nft.json +1 -1
  1048. package/gui/.next/server/app/api/setup/verify-service/route_client-reference-manifest.js +1 -1
  1049. package/gui/.next/server/app/api/setup/verify-target-repo/route.js +1 -1
  1050. package/gui/.next/server/app/api/setup/verify-target-repo/route.js.nft.json +1 -1
  1051. package/gui/.next/server/app/api/setup/verify-target-repo/route_client-reference-manifest.js +1 -1
  1052. package/gui/.next/server/app/api/workflow/bootstrap/route.js +1 -0
  1053. package/gui/.next/server/app/api/workflow/bootstrap/route.js.nft.json +1 -0
  1054. package/gui/.next/server/app/api/workflow/bootstrap/route_client-reference-manifest.js +1 -0
  1055. package/gui/.next/server/app/api/workflow/models/route.js +1 -0
  1056. package/gui/.next/server/app/api/workflow/models/route.js.nft.json +1 -0
  1057. package/gui/.next/server/app/api/workflow/models/route_client-reference-manifest.js +1 -0
  1058. package/gui/.next/server/app/operations/page.js +2 -0
  1059. package/gui/.next/server/app/operations/page.js.nft.json +1 -0
  1060. package/gui/.next/server/app/operations/page_client-reference-manifest.js +1 -0
  1061. package/gui/.next/server/app/page.js +3 -2
  1062. package/gui/.next/server/app/page.js.nft.json +1 -1
  1063. package/gui/.next/server/app/page_client-reference-manifest.js +1 -1
  1064. package/gui/.next/server/app/settings/(console)/connections/page.js +2 -0
  1065. package/gui/.next/server/app/settings/(console)/connections/page.js.nft.json +1 -0
  1066. package/gui/.next/server/app/settings/(console)/connections/page_client-reference-manifest.js +1 -0
  1067. package/gui/.next/server/app/settings/(console)/data-sharing/page.js +2 -0
  1068. package/gui/.next/server/app/settings/(console)/data-sharing/page.js.nft.json +1 -0
  1069. package/gui/.next/server/app/settings/(console)/data-sharing/page_client-reference-manifest.js +1 -0
  1070. package/gui/.next/server/app/settings/(console)/deployments/page.js +2 -0
  1071. package/gui/.next/server/app/settings/(console)/deployments/page.js.nft.json +1 -0
  1072. package/gui/.next/server/app/settings/(console)/deployments/page_client-reference-manifest.js +1 -0
  1073. package/gui/.next/server/app/settings/(console)/linear/page.js +10 -0
  1074. package/gui/.next/server/app/settings/(console)/linear/page.js.nft.json +1 -0
  1075. package/gui/.next/server/app/settings/(console)/linear/page_client-reference-manifest.js +1 -0
  1076. package/gui/.next/server/app/settings/(console)/models/page.js +2 -0
  1077. package/gui/.next/server/app/settings/(console)/models/page.js.nft.json +1 -0
  1078. package/gui/.next/server/app/settings/(console)/models/page_client-reference-manifest.js +1 -0
  1079. package/gui/.next/server/app/settings/(console)/page.js +2 -0
  1080. package/gui/.next/server/app/settings/(console)/page.js.nft.json +1 -0
  1081. package/gui/.next/server/app/settings/(console)/page_client-reference-manifest.js +1 -0
  1082. package/gui/.next/server/app/settings/(console)/repositories/page.js +6 -0
  1083. package/gui/.next/server/app/settings/(console)/repositories/page.js.nft.json +1 -0
  1084. package/gui/.next/server/app/settings/(console)/repositories/page_client-reference-manifest.js +1 -0
  1085. package/gui/.next/server/app/settings/configure/page.js +4 -4
  1086. package/gui/.next/server/app/settings/configure/page.js.nft.json +1 -1
  1087. package/gui/.next/server/app/settings/configure/page_client-reference-manifest.js +1 -1
  1088. package/gui/.next/server/app/workflow/page.js +2 -0
  1089. package/gui/.next/server/app/workflow/page.js.nft.json +1 -0
  1090. package/gui/.next/server/app/workflow/page_client-reference-manifest.js +1 -0
  1091. package/gui/.next/server/app-paths-manifest.json +44 -15
  1092. package/gui/.next/server/chunks/105.js +2 -0
  1093. package/gui/.next/server/chunks/1304.js +200 -0
  1094. package/gui/.next/server/chunks/1536.js +1 -0
  1095. package/gui/.next/server/chunks/1948.js +59 -0
  1096. package/gui/.next/server/chunks/2470.js +3 -0
  1097. package/gui/.next/server/chunks/2581.js +2 -0
  1098. package/gui/.next/server/chunks/383.js +1 -1
  1099. package/gui/.next/server/chunks/521.js +1 -0
  1100. package/gui/.next/server/chunks/553.js +1 -0
  1101. package/gui/.next/server/chunks/5827.js +1 -0
  1102. package/gui/.next/server/chunks/6408.js +1 -0
  1103. package/gui/.next/server/chunks/641.js +1 -0
  1104. package/gui/.next/server/chunks/6482.js +1 -0
  1105. package/gui/.next/server/chunks/6801.js +1 -0
  1106. package/gui/.next/server/chunks/6890.js +1 -0
  1107. package/gui/.next/server/chunks/7201.js +1 -0
  1108. package/gui/.next/server/chunks/7221.js +1 -0
  1109. package/gui/.next/server/chunks/{332.js → 7332.js} +1 -1
  1110. package/gui/.next/server/chunks/7527.js +1 -0
  1111. package/gui/.next/server/chunks/8312.js +1 -0
  1112. package/gui/.next/server/chunks/8476.js +8 -0
  1113. package/gui/.next/server/chunks/8764.js +16 -0
  1114. package/gui/.next/server/chunks/8819.js +22 -0
  1115. package/gui/.next/server/chunks/8825.js +1 -0
  1116. package/gui/.next/server/chunks/9148.js +1 -0
  1117. package/gui/.next/server/chunks/9454.js +1 -0
  1118. package/gui/.next/server/instrumentation.js +1 -0
  1119. package/gui/.next/server/instrumentation.js.nft.json +1 -0
  1120. package/gui/.next/server/middleware-build-manifest.js +1 -1
  1121. package/gui/.next/server/pages/404.html +1 -1
  1122. package/gui/.next/server/pages/500.html +1 -1
  1123. package/gui/.next/server/pages/_document.js +1 -1
  1124. package/gui/.next/server/pages/_document.js.nft.json +1 -1
  1125. package/gui/.next/server/pages/_error.js +2 -2
  1126. package/gui/.next/server/pages/_error.js.nft.json +1 -1
  1127. package/gui/.next/server/pages-manifest.json +1 -1
  1128. package/gui/.next/server/webpack-runtime.js +1 -1
  1129. package/gui/.next/static/chunks/3800-379a4b854a7eb1dc.js +1 -0
  1130. package/gui/.next/static/chunks/464-7503c96bb839c213.js +1 -0
  1131. package/gui/.next/static/chunks/5567-672d065d2668f1ea.js +1 -0
  1132. package/gui/.next/static/chunks/6240-d3f8028539091853.js +1 -0
  1133. package/gui/.next/static/chunks/7420-cb03f2f94db611c4.js +1 -0
  1134. package/gui/.next/static/chunks/8002-528c2e589bc54111.js +1 -0
  1135. package/gui/.next/static/chunks/9188-540635591aa2baf5.js +1 -0
  1136. package/gui/.next/static/chunks/9289-00509b3e0c520cce.js +1 -0
  1137. package/gui/.next/static/chunks/9576-6d94e3d152f876e7.js +1 -0
  1138. package/gui/.next/static/chunks/app/_not-found/page-89865576110e31f0.js +1 -0
  1139. package/gui/.next/static/chunks/app/api/observability/event/route-08ffe80f6f4603f6.js +1 -0
  1140. package/gui/.next/static/chunks/app/api/observability/preferences/route-08ffe80f6f4603f6.js +1 -0
  1141. package/gui/.next/static/chunks/app/api/operations/bootstrap/route-08ffe80f6f4603f6.js +1 -0
  1142. package/gui/.next/static/chunks/app/api/operations/draft/route-08ffe80f6f4603f6.js +1 -0
  1143. package/gui/.next/static/chunks/app/api/settings/apply-config-patch/route-08ffe80f6f4603f6.js +1 -0
  1144. package/gui/.next/static/chunks/app/api/settings/preview-config-patch/route-08ffe80f6f4603f6.js +1 -0
  1145. package/gui/.next/static/chunks/app/api/setup/apply-connect-services/route-08ffe80f6f4603f6.js +1 -0
  1146. package/gui/.next/static/chunks/app/api/setup/apply-harness-repo-provisioning/route-08ffe80f6f4603f6.js +1 -0
  1147. package/gui/.next/static/chunks/app/api/setup/apply-harness-secrets/route-08ffe80f6f4603f6.js +1 -0
  1148. package/gui/.next/static/chunks/app/api/setup/apply-linear-setup/route-08ffe80f6f4603f6.js +1 -0
  1149. package/gui/.next/static/chunks/app/api/setup/apply-linear-workspace/route-08ffe80f6f4603f6.js +1 -0
  1150. package/gui/.next/static/chunks/app/api/setup/apply-local-files/route-08ffe80f6f4603f6.js +1 -0
  1151. package/gui/.next/static/chunks/app/api/setup/apply-runner-upgrade/route-08ffe80f6f4603f6.js +1 -0
  1152. package/gui/.next/static/chunks/app/api/setup/apply-target-repo-provisioning/route-08ffe80f6f4603f6.js +1 -0
  1153. package/gui/.next/static/chunks/app/api/setup/apply-target-workflow/route-08ffe80f6f4603f6.js +1 -0
  1154. package/gui/.next/static/chunks/app/api/setup/apply-vercel-bridge/route-08ffe80f6f4603f6.js +1 -0
  1155. package/gui/.next/static/chunks/app/api/setup/complete-initial-setup/route-08ffe80f6f4603f6.js +1 -0
  1156. package/gui/.next/static/chunks/app/api/setup/finalize-target-workflow/route-08ffe80f6f4603f6.js +1 -0
  1157. package/gui/.next/static/chunks/app/api/setup/harness-provisioning-progress/route-08ffe80f6f4603f6.js +1 -0
  1158. package/gui/.next/static/chunks/app/api/setup/harness-provisioning-summary/route-08ffe80f6f4603f6.js +1 -0
  1159. package/gui/.next/static/chunks/app/api/setup/linear-options/route-08ffe80f6f4603f6.js +1 -0
  1160. package/gui/.next/static/chunks/app/api/setup/linear-setup-progress/route-08ffe80f6f4603f6.js +1 -0
  1161. package/gui/.next/static/chunks/app/api/setup/linear-summary/route-08ffe80f6f4603f6.js +1 -0
  1162. package/gui/.next/static/chunks/app/api/setup/linear-workspace-editor-state/route-08ffe80f6f4603f6.js +1 -0
  1163. package/gui/.next/static/chunks/app/api/setup/local-readiness/route-08ffe80f6f4603f6.js +1 -0
  1164. package/gui/.next/static/chunks/app/api/setup/manual-harness-secret-values/route-08ffe80f6f4603f6.js +1 -0
  1165. package/gui/.next/static/chunks/app/api/setup/preview-connect-services/route-08ffe80f6f4603f6.js +1 -0
  1166. package/gui/.next/static/chunks/app/api/setup/preview-harness-repo-provisioning/route-08ffe80f6f4603f6.js +1 -0
  1167. package/gui/.next/static/chunks/app/api/setup/preview-harness-secrets/route-08ffe80f6f4603f6.js +1 -0
  1168. package/gui/.next/static/chunks/app/api/setup/preview-linear-setup/route-08ffe80f6f4603f6.js +1 -0
  1169. package/gui/.next/static/chunks/app/api/setup/preview-linear-workspace/route-08ffe80f6f4603f6.js +1 -0
  1170. package/gui/.next/static/chunks/app/api/setup/preview-local-files/route-08ffe80f6f4603f6.js +1 -0
  1171. package/gui/.next/static/chunks/app/api/setup/preview-runner-upgrade/route-08ffe80f6f4603f6.js +1 -0
  1172. package/gui/.next/static/chunks/app/api/setup/preview-target-repo-provisioning/route-08ffe80f6f4603f6.js +1 -0
  1173. package/gui/.next/static/chunks/app/api/setup/preview-target-workflow/route-08ffe80f6f4603f6.js +1 -0
  1174. package/gui/.next/static/chunks/app/api/setup/preview-vercel-bridge/route-08ffe80f6f4603f6.js +1 -0
  1175. package/gui/.next/static/chunks/app/api/setup/remote-summary/route-08ffe80f6f4603f6.js +1 -0
  1176. package/gui/.next/static/chunks/app/api/setup/runner-upgrade-progress/route-08ffe80f6f4603f6.js +1 -0
  1177. package/gui/.next/static/chunks/app/api/setup/runner-upgrade-status/route-08ffe80f6f4603f6.js +1 -0
  1178. package/gui/.next/static/chunks/app/api/setup/summary/route-08ffe80f6f4603f6.js +1 -0
  1179. package/gui/.next/static/chunks/app/api/setup/vercel-bridge-options/route-08ffe80f6f4603f6.js +1 -0
  1180. package/gui/.next/static/chunks/app/api/setup/vercel-bridge-redeploy-status/route-08ffe80f6f4603f6.js +1 -0
  1181. package/gui/.next/static/chunks/app/api/setup/vercel-summary/route-08ffe80f6f4603f6.js +1 -0
  1182. package/gui/.next/static/chunks/app/api/setup/verify-harness-repo/route-08ffe80f6f4603f6.js +1 -0
  1183. package/gui/.next/static/chunks/app/api/setup/verify-service/route-08ffe80f6f4603f6.js +1 -0
  1184. package/gui/.next/static/chunks/app/api/setup/verify-target-repo/route-08ffe80f6f4603f6.js +1 -0
  1185. package/gui/.next/static/chunks/app/api/workflow/bootstrap/route-08ffe80f6f4603f6.js +1 -0
  1186. package/gui/.next/static/chunks/app/api/workflow/models/route-08ffe80f6f4603f6.js +1 -0
  1187. package/gui/.next/static/chunks/app/layout-ec756afb9686f579.js +1 -0
  1188. package/gui/.next/static/chunks/app/operations/page-08ffe80f6f4603f6.js +1 -0
  1189. package/gui/.next/static/chunks/app/page-08ffe80f6f4603f6.js +1 -0
  1190. package/gui/.next/static/chunks/app/settings/(console)/connections/page-95847d89fc70089a.js +1 -0
  1191. package/gui/.next/static/chunks/app/settings/(console)/data-sharing/page-3e0d8fe941c7334e.js +1 -0
  1192. package/gui/.next/static/chunks/app/settings/(console)/deployments/page-e3aaff205f09b567.js +1 -0
  1193. package/gui/.next/static/chunks/app/settings/(console)/layout-74ce539ae02dc765.js +1 -0
  1194. package/gui/.next/static/chunks/app/settings/(console)/linear/page-0a1e73b5ec66af90.js +1 -0
  1195. package/gui/.next/static/chunks/app/settings/(console)/models/page-336406c2905983c9.js +1 -0
  1196. package/gui/.next/static/chunks/app/settings/(console)/page-08ffe80f6f4603f6.js +1 -0
  1197. package/gui/.next/static/chunks/app/settings/(console)/repositories/page-b1f7159c7771b16a.js +1 -0
  1198. package/gui/.next/static/chunks/app/settings/configure/loading-5f1e73b910fbd9da.js +1 -0
  1199. package/gui/.next/static/chunks/app/settings/configure/page-54b7572655b9f60f.js +1 -0
  1200. package/gui/.next/static/chunks/app/workflow/page-8087b342a6ece93c.js +1 -0
  1201. package/gui/.next/static/chunks/framework-dc88dc15d5e043e1.js +1 -0
  1202. package/gui/.next/static/chunks/main-5b390d9aaa7199a5.js +1 -0
  1203. package/gui/.next/static/chunks/main-app-7fbf1b54aaed0242.js +1 -0
  1204. package/gui/.next/static/chunks/pages/{_app-2e239ff05bfdf6d6.js → _app-50fa07b56b2d29ac.js} +1 -1
  1205. package/gui/.next/static/chunks/pages/_error-fed8688bdd23f211.js +1 -0
  1206. package/gui/.next/static/chunks/{webpack-1e50074b7e886e1b.js → webpack-b27d2f88ec3d35a4.js} +1 -1
  1207. package/gui/.next/static/css/b7b323a34ac09e0b.css +3 -0
  1208. package/gui/.next/static/wM7YWpWgyTcGc7H5h1u7U/_buildManifest.js +1 -0
  1209. package/gui/.next/trace +6 -4
  1210. package/gui/.next/types/app/api/observability/event/route.ts +347 -0
  1211. package/gui/.next/types/app/api/observability/preferences/route.ts +347 -0
  1212. package/gui/.next/types/app/api/operations/bootstrap/route.ts +347 -0
  1213. package/gui/.next/types/app/api/operations/draft/route.ts +347 -0
  1214. package/gui/.next/types/app/api/settings/apply-config-patch/route.ts +347 -0
  1215. package/gui/.next/types/app/api/settings/preview-config-patch/route.ts +347 -0
  1216. package/gui/.next/types/app/api/setup/apply-linear-workspace/route.ts +347 -0
  1217. package/gui/.next/types/app/api/setup/apply-runner-upgrade/route.ts +347 -0
  1218. package/gui/.next/types/app/api/setup/apply-target-repo-provisioning/route.ts +347 -0
  1219. package/gui/.next/types/app/api/setup/complete-initial-setup/route.ts +347 -0
  1220. package/gui/.next/types/app/api/setup/harness-provisioning-progress/route.ts +347 -0
  1221. package/gui/.next/types/app/api/setup/linear-setup-progress/route.ts +347 -0
  1222. package/gui/.next/types/app/api/setup/linear-workspace-editor-state/route.ts +347 -0
  1223. package/gui/.next/types/app/api/setup/preview-linear-workspace/route.ts +347 -0
  1224. package/gui/.next/types/app/api/setup/preview-runner-upgrade/route.ts +347 -0
  1225. package/gui/.next/types/app/api/setup/preview-target-repo-provisioning/route.ts +347 -0
  1226. package/gui/.next/types/app/api/setup/runner-upgrade-progress/route.ts +347 -0
  1227. package/gui/.next/types/app/api/setup/runner-upgrade-status/route.ts +347 -0
  1228. package/gui/.next/types/app/api/workflow/bootstrap/route.ts +347 -0
  1229. package/gui/.next/types/app/api/workflow/models/route.ts +347 -0
  1230. package/gui/.next/types/app/operations/page.ts +84 -0
  1231. package/gui/.next/types/app/settings/(console)/connections/page.ts +84 -0
  1232. package/gui/.next/types/app/settings/(console)/data-sharing/page.ts +84 -0
  1233. package/gui/.next/types/app/settings/(console)/deployments/page.ts +84 -0
  1234. package/gui/.next/types/app/settings/(console)/layout.ts +84 -0
  1235. package/gui/.next/types/app/settings/(console)/linear/page.ts +84 -0
  1236. package/gui/.next/types/app/settings/(console)/models/page.ts +84 -0
  1237. package/gui/.next/types/app/settings/(console)/page.ts +84 -0
  1238. package/gui/.next/types/app/settings/(console)/repositories/page.ts +84 -0
  1239. package/gui/.next/types/app/workflow/page.ts +84 -0
  1240. package/gui/.next/types/routes.d.ts +33 -3
  1241. package/gui/.next/types/validator.ts +270 -0
  1242. package/observability.public.json +6 -0
  1243. package/package.json +5 -1
  1244. package/templates/.harness/config.example.json +1 -0
  1245. package/workspace-snapshot/files/.agents/skills/implementation/SKILL.md +4 -0
  1246. package/workspace-snapshot/files/.agents/skills/issue-intake/SKILL.md +13 -1
  1247. package/workspace-snapshot/files/.agents/skills/planner/SKILL.md +10 -0
  1248. package/workspace-snapshot/files/.github/workflows/harness-auto-runner.yml +38 -11
  1249. package/workspace-snapshot/files/.github/workflows/p-dev-runner-config-canary.yml +24 -0
  1250. package/workspace-snapshot/files/.harness/config.example.json +1 -0
  1251. package/workspace-snapshot/files/AGENTS.md +13 -2
  1252. package/workspace-snapshot/files/ARCHITECTURE.md +23 -6
  1253. package/workspace-snapshot/files/CHANGELOG.md +50 -5
  1254. package/workspace-snapshot/files/README.md +10 -4
  1255. package/workspace-snapshot/files/ROADMAP.md +10 -1
  1256. package/workspace-snapshot/files/apps/gui/app/api/observability/event/route.ts +36 -0
  1257. package/workspace-snapshot/files/apps/gui/app/api/observability/preferences/route.ts +88 -0
  1258. package/workspace-snapshot/files/apps/gui/app/api/operations/bootstrap/route.ts +8 -0
  1259. package/workspace-snapshot/files/apps/gui/app/api/operations/draft/route.ts +15 -0
  1260. package/workspace-snapshot/files/apps/gui/app/api/settings/apply-config-patch/route.ts +52 -0
  1261. package/workspace-snapshot/files/apps/gui/app/api/settings/preview-config-patch/route.ts +40 -0
  1262. package/workspace-snapshot/files/apps/gui/app/api/setup/apply-harness-repo-provisioning/route.ts +6 -5
  1263. package/workspace-snapshot/files/apps/gui/app/api/setup/apply-linear-workspace/route.ts +23 -0
  1264. package/workspace-snapshot/files/apps/gui/app/api/setup/apply-runner-upgrade/route.ts +33 -0
  1265. package/workspace-snapshot/files/apps/gui/app/api/setup/apply-target-repo-provisioning/route.ts +38 -0
  1266. package/workspace-snapshot/files/apps/gui/app/api/setup/apply-vercel-bridge/route.ts +7 -1
  1267. package/workspace-snapshot/files/apps/gui/app/api/setup/complete-initial-setup/route.ts +49 -0
  1268. package/workspace-snapshot/files/apps/gui/app/api/setup/harness-provisioning-progress/route.ts +21 -0
  1269. package/workspace-snapshot/files/apps/gui/app/api/setup/linear-setup-progress/route.ts +17 -0
  1270. package/workspace-snapshot/files/apps/gui/app/api/setup/linear-workspace-editor-state/route.ts +17 -0
  1271. package/workspace-snapshot/files/apps/gui/app/api/setup/local-readiness/route.ts +52 -13
  1272. package/workspace-snapshot/files/apps/gui/app/api/setup/preview-linear-workspace/route.ts +22 -0
  1273. package/workspace-snapshot/files/apps/gui/app/api/setup/preview-runner-upgrade/route.ts +17 -0
  1274. package/workspace-snapshot/files/apps/gui/app/api/setup/preview-target-repo-provisioning/route.ts +34 -0
  1275. package/workspace-snapshot/files/apps/gui/app/api/setup/runner-upgrade-progress/route.ts +17 -0
  1276. package/workspace-snapshot/files/apps/gui/app/api/setup/runner-upgrade-status/route.ts +72 -0
  1277. package/workspace-snapshot/files/apps/gui/app/api/setup/verify-service/route.ts +2 -2
  1278. package/workspace-snapshot/files/apps/gui/app/api/setup/verify-target-repo/route.ts +9 -2
  1279. package/workspace-snapshot/files/apps/gui/app/api/workflow/bootstrap/route.ts +24 -0
  1280. package/workspace-snapshot/files/apps/gui/app/api/workflow/models/route.ts +86 -0
  1281. package/workspace-snapshot/files/apps/gui/app/operations/page.tsx +23 -0
  1282. package/workspace-snapshot/files/apps/gui/app/page.tsx +8 -2
  1283. package/workspace-snapshot/files/apps/gui/app/settings/(console)/connections/page.tsx +27 -0
  1284. package/workspace-snapshot/files/apps/gui/app/settings/(console)/data-sharing/page.tsx +25 -0
  1285. package/workspace-snapshot/files/apps/gui/app/settings/(console)/deployments/page.tsx +28 -0
  1286. package/workspace-snapshot/files/apps/gui/app/settings/(console)/layout.tsx +45 -0
  1287. package/workspace-snapshot/files/apps/gui/app/settings/(console)/linear/page.tsx +20 -0
  1288. package/workspace-snapshot/files/apps/gui/app/settings/(console)/models/page.tsx +14 -0
  1289. package/workspace-snapshot/files/apps/gui/app/settings/(console)/page.tsx +7 -0
  1290. package/workspace-snapshot/files/apps/gui/app/settings/(console)/repositories/page.tsx +29 -0
  1291. package/workspace-snapshot/files/apps/gui/app/settings/configure/loading.tsx +25 -0
  1292. package/workspace-snapshot/files/apps/gui/app/settings/configure/page.tsx +76 -7
  1293. package/workspace-snapshot/files/apps/gui/app/workflow/page.tsx +24 -0
  1294. package/workspace-snapshot/files/apps/gui/components/custom/app-shell.tsx +26 -32
  1295. package/workspace-snapshot/files/apps/gui/components/custom/application-header.tsx +64 -0
  1296. package/workspace-snapshot/files/apps/gui/components/custom/configure-experience.tsx +347 -85
  1297. package/workspace-snapshot/files/apps/gui/components/custom/configure-page-content.tsx +15 -0
  1298. package/workspace-snapshot/files/apps/gui/components/custom/configure-workflow.tsx +675 -112
  1299. package/workspace-snapshot/files/apps/gui/components/custom/data-sharing-preferences.tsx +159 -0
  1300. package/workspace-snapshot/files/apps/gui/components/custom/environment-config-form.tsx +31 -13
  1301. package/workspace-snapshot/files/apps/gui/components/custom/guided-cloud-secrets-card.tsx +99 -46
  1302. package/workspace-snapshot/files/apps/gui/components/custom/guided-linear-workspace-card.tsx +974 -148
  1303. package/workspace-snapshot/files/apps/gui/components/custom/guided-local-readiness-card.tsx +153 -35
  1304. package/workspace-snapshot/files/apps/gui/components/custom/guided-operation-panel.tsx +102 -0
  1305. package/workspace-snapshot/files/apps/gui/components/custom/guided-progress-check.tsx +37 -0
  1306. package/workspace-snapshot/files/apps/gui/components/custom/guided-setup-progress.tsx +114 -0
  1307. package/workspace-snapshot/files/apps/gui/components/custom/guided-step-success-panel.tsx +50 -0
  1308. package/workspace-snapshot/files/apps/gui/components/custom/guided-step-transition.tsx +81 -27
  1309. package/workspace-snapshot/files/apps/gui/components/custom/guided-target-workflow-card.tsx +267 -60
  1310. package/workspace-snapshot/files/apps/gui/components/custom/guided-vercel-bridge-card.tsx +341 -179
  1311. package/workspace-snapshot/files/apps/gui/components/custom/observability-settings-card.tsx +23 -0
  1312. package/workspace-snapshot/files/apps/gui/components/custom/remote-action-confirmation.tsx +13 -11
  1313. package/workspace-snapshot/files/apps/gui/components/custom/review-workflow-changes-disclosure.tsx +59 -0
  1314. package/workspace-snapshot/files/apps/gui/components/custom/settings-menu.tsx +109 -0
  1315. package/workspace-snapshot/files/apps/gui/components/custom/setup-checklist.tsx +47 -29
  1316. package/workspace-snapshot/files/apps/gui/components/custom/target-repo-config-form.tsx +22 -2
  1317. package/workspace-snapshot/files/apps/gui/components/custom/target-repo-create-connect.tsx +419 -0
  1318. package/workspace-snapshot/files/apps/gui/components/custom/target-workflow-pr-card.tsx +105 -43
  1319. package/workspace-snapshot/files/apps/gui/components/custom/theme-toggle.tsx +3 -11
  1320. package/workspace-snapshot/files/apps/gui/components/custom/vercel-bridge-orchestration-status.tsx +65 -0
  1321. package/workspace-snapshot/files/apps/gui/components/custom/workflow-install-pending-panel.tsx +125 -53
  1322. package/workspace-snapshot/files/apps/gui/components/settings/editors/connections-settings-editor.tsx +261 -0
  1323. package/workspace-snapshot/files/apps/gui/components/settings/editors/deployments-settings-editor.tsx +397 -0
  1324. package/workspace-snapshot/files/apps/gui/components/settings/editors/linear-settings-editor.tsx +512 -0
  1325. package/workspace-snapshot/files/apps/gui/components/settings/editors/repositories-settings-editor.tsx +749 -0
  1326. package/workspace-snapshot/files/apps/gui/components/settings/editors/runner-upgrade-settings-card.tsx +533 -0
  1327. package/workspace-snapshot/files/apps/gui/components/settings/settings-models-client.tsx +102 -0
  1328. package/workspace-snapshot/files/apps/gui/components/settings/settings-mutation-panel.tsx +125 -0
  1329. package/workspace-snapshot/files/apps/gui/components/settings/settings-shell.tsx +46 -0
  1330. package/workspace-snapshot/files/apps/gui/components/ui/dropdown-menu.tsx +257 -0
  1331. package/workspace-snapshot/files/apps/gui/components/ui/guided-select.tsx +22 -0
  1332. package/workspace-snapshot/files/apps/gui/components/workflow/workflow-cards-section.tsx +206 -0
  1333. package/workspace-snapshot/files/apps/gui/components/workflow/workflow-health-panel.tsx +43 -0
  1334. package/workspace-snapshot/files/apps/gui/components/workflow/workflow-model-control.tsx +111 -0
  1335. package/workspace-snapshot/files/apps/gui/components/workflow/workflow-page-client.tsx +161 -0
  1336. package/workspace-snapshot/files/apps/gui/components/workflow/workflow-scope-selector.tsx +41 -0
  1337. package/workspace-snapshot/files/apps/gui/instrumentation.ts +136 -0
  1338. package/workspace-snapshot/files/apps/gui/lib/configure-navigation-timing.ts +53 -0
  1339. package/workspace-snapshot/files/apps/gui/lib/constants/form.ts +5 -0
  1340. package/workspace-snapshot/files/apps/gui/lib/constants/layout.ts +10 -3
  1341. package/workspace-snapshot/files/apps/gui/lib/guided-setup.ts +222 -0
  1342. package/workspace-snapshot/files/apps/gui/lib/linear-association-draft.ts +93 -0
  1343. package/workspace-snapshot/files/apps/gui/lib/local-readiness-visual-queue.ts +61 -0
  1344. package/workspace-snapshot/files/apps/gui/lib/observability-client.ts +21 -0
  1345. package/workspace-snapshot/files/apps/gui/lib/observability-preferences.ts +19 -0
  1346. package/workspace-snapshot/files/apps/gui/lib/observability-request-guard.ts +136 -0
  1347. package/workspace-snapshot/files/apps/gui/lib/observability-route.ts +75 -0
  1348. package/workspace-snapshot/files/apps/gui/lib/settings/load-harness-config-summary.ts +20 -0
  1349. package/workspace-snapshot/files/apps/gui/lib/settings/load-repositories-overview.ts +37 -0
  1350. package/workspace-snapshot/files/apps/gui/lib/settings/load-settings-editor-data.ts +51 -0
  1351. package/workspace-snapshot/files/apps/gui/lib/settings/load-target-repo-overview-fields.ts +124 -0
  1352. package/workspace-snapshot/files/apps/gui/lib/settings/runner-upgrade-feature-flag.ts +9 -0
  1353. package/workspace-snapshot/files/apps/gui/lib/settings/runner-upgrade-ssr.ts +13 -0
  1354. package/workspace-snapshot/files/apps/gui/lib/settings/runner-upgrade-ui-gates.ts +87 -0
  1355. package/workspace-snapshot/files/apps/gui/lib/settings/settings-mutation.ts +49 -0
  1356. package/workspace-snapshot/files/apps/gui/lib/settings/settings-navigation.ts +10 -0
  1357. package/workspace-snapshot/files/apps/gui/lib/settings/settings-setup-client.ts +312 -0
  1358. package/workspace-snapshot/files/apps/gui/lib/setup-server.ts +608 -17
  1359. package/workspace-snapshot/files/apps/gui/lib/use-theme-toggle.ts +26 -0
  1360. package/workspace-snapshot/files/apps/gui/lib/vercel-bridge-polling-ui.ts +88 -1
  1361. package/workspace-snapshot/files/apps/gui/lib/verification-state.ts +97 -1
  1362. package/workspace-snapshot/files/apps/gui/lib/workflow/api-client.ts +84 -0
  1363. package/workspace-snapshot/files/apps/gui/lib/workflow/use-model-autosave.ts +90 -0
  1364. package/workspace-snapshot/files/apps/gui/lib/workflow/use-workflow-model-save.ts +265 -0
  1365. package/workspace-snapshot/files/apps/gui/lib/workflow/workflow-health.ts +53 -0
  1366. package/workspace-snapshot/files/apps/gui/lib/workflow/workflow-ownership.ts +47 -0
  1367. package/workspace-snapshot/files/apps/gui/lib/workflow/workflow-status-content.ts +149 -0
  1368. package/workspace-snapshot/files/apps/gui/lib/workflow/workflow-violation-messages.ts +49 -0
  1369. package/workspace-snapshot/files/apps/gui/lib/workflow-server.ts +307 -0
  1370. package/workspace-snapshot/files/apps/gui/next.config.ts +8 -3
  1371. package/workspace-snapshot/files/docs/architecture/canonical-product-development-workflow.md +70 -0
  1372. package/workspace-snapshot/files/docs/architecture/linear-automation-state-machine.md +26 -10
  1373. package/workspace-snapshot/files/docs/design/product-development-harness-gui.md +0 -1
  1374. package/workspace-snapshot/files/docs/getting-started.md +2 -2
  1375. package/workspace-snapshot/files/docs/gui-local.md +3 -3
  1376. package/workspace-snapshot/files/docs/gui-remote-setup.md +2 -2
  1377. package/workspace-snapshot/files/docs/issue-intake.md +12 -0
  1378. package/workspace-snapshot/files/docs/observability-and-privacy.md +247 -0
  1379. package/workspace-snapshot/files/docs/operator-config.md +16 -1
  1380. package/workspace-snapshot/files/docs/p-dev.md +43 -9
  1381. package/workspace-snapshot/files/docs/releases/release-process.md +135 -7
  1382. package/workspace-snapshot/files/docs/releases/v0.3.1.md +42 -6
  1383. package/workspace-snapshot/files/docs/releases/v0.4.0.md +93 -0
  1384. package/workspace-snapshot/files/docs/security.md +8 -0
  1385. package/workspace-snapshot/files/docs/settings-console.md +44 -0
  1386. package/workspace-snapshot/files/harness.config.schema.json +114 -0
  1387. package/workspace-snapshot/files/package-lock.json +1881 -95
  1388. package/workspace-snapshot/files/package.json +10 -2
  1389. package/workspace-snapshot/files/packages/p-dev/README.md +12 -4
  1390. package/workspace-snapshot/files/packages/p-dev/observability.public.json +6 -0
  1391. package/workspace-snapshot/files/packages/p-dev/package.json +5 -1
  1392. package/workspace-snapshot/files/prompts/issue-intake-chatgpt.md +4 -0
  1393. package/workspace-snapshot/files/scripts/configure-browser-matrix.config.ts +40 -0
  1394. package/workspace-snapshot/files/scripts/configure-browser-matrix.spec.ts +294 -0
  1395. package/workspace-snapshot/files/scripts/configure-step4-harness-readiness.config.ts +118 -0
  1396. package/workspace-snapshot/files/scripts/configure-step4-harness-readiness.spec.ts +80 -0
  1397. package/workspace-snapshot/files/scripts/prepare-configure-browser-workspace.ts +138 -0
  1398. package/workspace-snapshot/files/scripts/prepare-p-dev-package.ts +9 -0
  1399. package/workspace-snapshot/files/scripts/workflow-browser-matrix.config.ts +27 -0
  1400. package/workspace-snapshot/files/scripts/workflow-browser-matrix.spec.ts +151 -0
  1401. package/workspace-snapshot/files/src/agents/cursor-provider.ts +12 -14
  1402. package/workspace-snapshot/files/src/agents/index.ts +8 -12
  1403. package/workspace-snapshot/files/src/agents/types.ts +40 -4
  1404. package/workspace-snapshot/files/src/artifacts/redact.ts +18 -2
  1405. package/workspace-snapshot/files/src/artifacts/write-json-out-manifest.ts +90 -0
  1406. package/workspace-snapshot/files/src/cli/commands/canary-runner-config.ts +6 -0
  1407. package/workspace-snapshot/files/src/cli/commands/doctor.ts +148 -0
  1408. package/workspace-snapshot/files/src/cli/commands/resolve-route.ts +5 -0
  1409. package/workspace-snapshot/files/src/cli/commands/run.ts +65 -17
  1410. package/workspace-snapshot/files/src/cli/commands/sync-managed-runner.ts +126 -0
  1411. package/workspace-snapshot/files/src/cli/program.ts +47 -0
  1412. package/workspace-snapshot/files/src/config/assert-cloud-config-fingerprint.ts +36 -0
  1413. package/workspace-snapshot/files/src/config/cloud-config-fingerprint.ts +90 -0
  1414. package/workspace-snapshot/files/src/config/legacy-linear-top-level.ts +69 -0
  1415. package/workspace-snapshot/files/src/config/linear-association-gate.ts +80 -0
  1416. package/workspace-snapshot/files/src/config/resolve-linear-team.ts +41 -0
  1417. package/workspace-snapshot/files/src/config/resolve-linear-workspace.ts +391 -0
  1418. package/workspace-snapshot/files/src/config/role-models.ts +39 -0
  1419. package/workspace-snapshot/files/src/config/runner-upgrade-sync-gate.ts +26 -0
  1420. package/workspace-snapshot/files/src/config/schema.ts +17 -0
  1421. package/workspace-snapshot/files/src/config/types.ts +5 -1
  1422. package/workspace-snapshot/files/src/config/workspace-root.ts +28 -0
  1423. package/workspace-snapshot/files/src/cursor/agent-factory.ts +51 -5
  1424. package/workspace-snapshot/files/src/cursor/builder-resume-errors.ts +41 -0
  1425. package/workspace-snapshot/files/src/cursor/model.ts +106 -25
  1426. package/workspace-snapshot/files/src/cursor/run-observer.ts +15 -2
  1427. package/workspace-snapshot/files/src/github/auth-verification-retry.ts +63 -0
  1428. package/workspace-snapshot/files/src/github/client.ts +204 -5
  1429. package/workspace-snapshot/files/src/gui/configure-health.ts +2 -2
  1430. package/workspace-snapshot/files/src/gui/repo-root.ts +20 -1
  1431. package/workspace-snapshot/files/src/gui/start-configure-stable.ts +6 -2
  1432. package/workspace-snapshot/files/src/gui/start-gui.ts +8 -3
  1433. package/workspace-snapshot/files/src/linear/client.ts +10 -0
  1434. package/workspace-snapshot/files/src/linear/comments.ts +52 -0
  1435. package/workspace-snapshot/files/src/linear/issue-query.ts +4 -0
  1436. package/workspace-snapshot/files/src/linear/markers.ts +28 -0
  1437. package/workspace-snapshot/files/src/linear/parser.ts +61 -1
  1438. package/workspace-snapshot/files/src/linear/project-harness-metadata.ts +147 -0
  1439. package/workspace-snapshot/files/src/linear/project-metadata-sync.ts +115 -0
  1440. package/workspace-snapshot/files/src/linear/run-status-comment.ts +197 -0
  1441. package/workspace-snapshot/files/src/linear/writer.ts +25 -0
  1442. package/workspace-snapshot/files/src/observability/adapters/fake.ts +267 -0
  1443. package/workspace-snapshot/files/src/observability/adapters/noop.ts +62 -0
  1444. package/workspace-snapshot/files/src/observability/adapters/posthog.ts +165 -0
  1445. package/workspace-snapshot/files/src/observability/adapters/sentry.ts +276 -0
  1446. package/workspace-snapshot/files/src/observability/analytics-schemas.ts +150 -0
  1447. package/workspace-snapshot/files/src/observability/consent.ts +70 -0
  1448. package/workspace-snapshot/files/src/observability/constants.ts +25 -0
  1449. package/workspace-snapshot/files/src/observability/context.ts +152 -0
  1450. package/workspace-snapshot/files/src/observability/facade-runtime-state.ts +47 -0
  1451. package/workspace-snapshot/files/src/observability/facade.ts +628 -0
  1452. package/workspace-snapshot/files/src/observability/fatal-handlers.ts +60 -0
  1453. package/workspace-snapshot/files/src/observability/identity.ts +13 -0
  1454. package/workspace-snapshot/files/src/observability/index.ts +47 -0
  1455. package/workspace-snapshot/files/src/observability/local-state.ts +142 -0
  1456. package/workspace-snapshot/files/src/observability/package-config.ts +180 -0
  1457. package/workspace-snapshot/files/src/observability/posthog-dashboard-contract.ts +277 -0
  1458. package/workspace-snapshot/files/src/observability/privacy-schema.ts +229 -0
  1459. package/workspace-snapshot/files/src/observability/product-error-messages.ts +19 -0
  1460. package/workspace-snapshot/files/src/observability/product-errors.ts +139 -0
  1461. package/workspace-snapshot/files/src/observability/provisioning-analytics.ts +28 -0
  1462. package/workspace-snapshot/files/src/observability/redaction.ts +85 -0
  1463. package/workspace-snapshot/files/src/observability/runtime-eligibility.ts +50 -0
  1464. package/workspace-snapshot/files/src/observability/sentry-outbound-privacy.ts +216 -0
  1465. package/workspace-snapshot/files/src/observability/session-dedupe.ts +73 -0
  1466. package/workspace-snapshot/files/src/observability/session-handoff.ts +47 -0
  1467. package/workspace-snapshot/files/src/observability/transport-lifecycle.ts +93 -0
  1468. package/workspace-snapshot/files/src/observability/types.ts +265 -0
  1469. package/workspace-snapshot/files/src/p-dev/cli.ts +1 -1
  1470. package/workspace-snapshot/files/src/p-dev/git-object-plumbing.ts +139 -14
  1471. package/workspace-snapshot/files/src/p-dev/launch.ts +93 -14
  1472. package/workspace-snapshot/files/src/p-dev/main.ts +12 -1
  1473. package/workspace-snapshot/files/src/p-dev/package-paths.ts +72 -2
  1474. package/workspace-snapshot/files/src/p-dev/workspace-snapshot-generator.ts +21 -0
  1475. package/workspace-snapshot/files/src/p-dev/workspace-snapshot-manifest.ts +53 -0
  1476. package/workspace-snapshot/files/src/p-dev/workspace-snapshot-types.ts +8 -0
  1477. package/workspace-snapshot/files/src/preview/preview-capability.ts +21 -0
  1478. package/workspace-snapshot/files/src/product/initialization-state.ts +65 -0
  1479. package/workspace-snapshot/files/src/product/product-marker.ts +76 -0
  1480. package/workspace-snapshot/files/src/product/read-product-marker.ts +63 -0
  1481. package/workspace-snapshot/files/src/prompts/builder.ts +31 -1
  1482. package/workspace-snapshot/files/src/prompts/implementation.md +6 -0
  1483. package/workspace-snapshot/files/src/prompts/integration-repair.md +6 -0
  1484. package/workspace-snapshot/files/src/prompts/planning.md +8 -0
  1485. package/workspace-snapshot/files/src/prompts/revision.md +7 -0
  1486. package/workspace-snapshot/files/src/resolver/errors.ts +3 -1
  1487. package/workspace-snapshot/files/src/resolver/target-repo.ts +60 -1
  1488. package/workspace-snapshot/files/src/runner/builder-thread-acquire.ts +321 -0
  1489. package/workspace-snapshot/files/src/runner/builder-thread-evidence.ts +40 -0
  1490. package/workspace-snapshot/files/src/runner/builder-thread-idempotency.ts +27 -0
  1491. package/workspace-snapshot/files/src/runner/builder-thread-lineage-errors.ts +23 -0
  1492. package/workspace-snapshot/files/src/runner/builder-thread-lineage.ts +555 -0
  1493. package/workspace-snapshot/files/src/runner/builder-thread-types.ts +41 -0
  1494. package/workspace-snapshot/files/src/runner/delivery-dedup.ts +78 -0
  1495. package/workspace-snapshot/files/src/runner/failure-finalization.ts +234 -0
  1496. package/workspace-snapshot/files/src/runner/fixture.ts +6 -1
  1497. package/workspace-snapshot/files/src/runner/phases/handoff.ts +74 -46
  1498. package/workspace-snapshot/files/src/runner/phases/implementation.ts +174 -28
  1499. package/workspace-snapshot/files/src/runner/phases/integration-repair.ts +123 -7
  1500. package/workspace-snapshot/files/src/runner/phases/merge.ts +145 -67
  1501. package/workspace-snapshot/files/src/runner/phases/planning.ts +50 -7
  1502. package/workspace-snapshot/files/src/runner/phases/production-sync.ts +37 -4
  1503. package/workspace-snapshot/files/src/runner/phases/revision.ts +130 -44
  1504. package/workspace-snapshot/files/src/runner/preflight.ts +134 -7
  1505. package/workspace-snapshot/files/src/runner/resolve-route.ts +29 -0
  1506. package/workspace-snapshot/files/src/runner/run-generation.ts +21 -0
  1507. package/workspace-snapshot/files/src/runner/uninitialized-product-routing.ts +121 -0
  1508. package/workspace-snapshot/files/src/setup/config-builder.ts +14 -0
  1509. package/workspace-snapshot/files/src/setup/control-plane-readiness.ts +92 -18
  1510. package/workspace-snapshot/files/src/setup/control-plane-setup-state.ts +61 -5
  1511. package/workspace-snapshot/files/src/setup/control-plane-state-lock.ts +103 -0
  1512. package/workspace-snapshot/files/src/setup/control-plane-types.ts +100 -1
  1513. package/workspace-snapshot/files/src/setup/first-run-readiness.ts +9 -2
  1514. package/workspace-snapshot/files/src/setup/git-askpass-credentials.ts +80 -0
  1515. package/workspace-snapshot/files/src/setup/github-dispatch-token.ts +34 -3
  1516. package/workspace-snapshot/files/src/setup/github-remote-provider.ts +78 -2
  1517. package/workspace-snapshot/files/src/setup/github-remote-setup-live.ts +113 -11
  1518. package/workspace-snapshot/files/src/setup/github-repository-name.ts +63 -0
  1519. package/workspace-snapshot/files/src/setup/github-target-repository-provider-live.ts +323 -0
  1520. package/workspace-snapshot/files/src/setup/github-target-repository-provider-mock.ts +284 -0
  1521. package/workspace-snapshot/files/src/setup/github-target-repository-provider.ts +86 -0
  1522. package/workspace-snapshot/files/src/setup/github-workflow-permissions.ts +2 -1
  1523. package/workspace-snapshot/files/src/setup/gui-view-model.ts +10 -0
  1524. package/workspace-snapshot/files/src/setup/harness-dispatch-repo.ts +157 -25
  1525. package/workspace-snapshot/files/src/setup/harness-managed-repo-marker.ts +24 -0
  1526. package/workspace-snapshot/files/src/setup/harness-provisioning-last-run.ts +152 -0
  1527. package/workspace-snapshot/files/src/setup/harness-provisioning-pending-state.ts +3 -0
  1528. package/workspace-snapshot/files/src/setup/harness-provisioning-progress.ts +213 -0
  1529. package/workspace-snapshot/files/src/setup/harness-repo-provisioning.ts +135 -6
  1530. package/workspace-snapshot/files/src/setup/harness-snapshot-git-transport.ts +846 -0
  1531. package/workspace-snapshot/files/src/setup/harness-snapshot-provisioning-helpers.ts +4 -1
  1532. package/workspace-snapshot/files/src/setup/harness-snapshot-provisioning.ts +352 -81
  1533. package/workspace-snapshot/files/src/setup/harness-step-readiness-server.ts +39 -0
  1534. package/workspace-snapshot/files/src/setup/harness-step-readiness.ts +72 -0
  1535. package/workspace-snapshot/files/src/setup/harness-workspace-snapshot-loader.ts +59 -12
  1536. package/workspace-snapshot/files/src/setup/initial-setup-lifecycle.ts +181 -0
  1537. package/workspace-snapshot/files/src/setup/linear-category-labels.ts +18 -0
  1538. package/workspace-snapshot/files/src/setup/linear-setup-apply.ts +97 -17
  1539. package/workspace-snapshot/files/src/setup/linear-setup-client.ts +96 -0
  1540. package/workspace-snapshot/files/src/setup/linear-setup-plan.ts +105 -11
  1541. package/workspace-snapshot/files/src/setup/linear-setup-progress.ts +113 -0
  1542. package/workspace-snapshot/files/src/setup/linear-status-contract.ts +36 -77
  1543. package/workspace-snapshot/files/src/setup/linear-workflow-status-repair.ts +278 -0
  1544. package/workspace-snapshot/files/src/setup/linear-workspace-apply.ts +309 -0
  1545. package/workspace-snapshot/files/src/setup/linear-workspace-drift.ts +4 -0
  1546. package/workspace-snapshot/files/src/setup/linear-workspace-migration.ts +314 -0
  1547. package/workspace-snapshot/files/src/setup/linear-workspace-plan.ts +407 -0
  1548. package/workspace-snapshot/files/src/setup/local-readiness-checks.ts +163 -31
  1549. package/workspace-snapshot/files/src/setup/mock-target-workflow-finalization.ts +30 -4
  1550. package/workspace-snapshot/files/src/setup/packaged-default-route.ts +29 -0
  1551. package/workspace-snapshot/files/src/setup/release-sync-managed-runner.ts +604 -0
  1552. package/workspace-snapshot/files/src/setup/remote-apply-actions.ts +33 -0
  1553. package/workspace-snapshot/files/src/setup/runner-upgrade-canary-dispatch.ts +69 -0
  1554. package/workspace-snapshot/files/src/setup/runner-upgrade-canary.ts +213 -0
  1555. package/workspace-snapshot/files/src/setup/runner-upgrade-evidence.ts +30 -0
  1556. package/workspace-snapshot/files/src/setup/runner-upgrade-pending-state.ts +116 -0
  1557. package/workspace-snapshot/files/src/setup/runner-upgrade-progress.ts +150 -0
  1558. package/workspace-snapshot/files/src/setup/runner-upgrade-provider-live.ts +520 -0
  1559. package/workspace-snapshot/files/src/setup/runner-upgrade-provider.ts +852 -0
  1560. package/workspace-snapshot/files/src/setup/runner-upgrade-status-cache.ts +61 -0
  1561. package/workspace-snapshot/files/src/setup/runner-upgrade-three-way.ts +162 -0
  1562. package/workspace-snapshot/files/src/setup/runner-upgrade-timeouts.ts +386 -0
  1563. package/workspace-snapshot/files/src/setup/runner-upgrade-types.ts +176 -0
  1564. package/workspace-snapshot/files/src/setup/runner-upgrade-worker.ts +149 -0
  1565. package/workspace-snapshot/files/src/setup/runner-upgrade.ts +1926 -0
  1566. package/workspace-snapshot/files/src/setup/service-verification.ts +160 -20
  1567. package/workspace-snapshot/files/src/setup/settings-config-patch.ts +461 -0
  1568. package/workspace-snapshot/files/src/setup/setup-state.ts +12 -1
  1569. package/workspace-snapshot/files/src/setup/step6-automatic-control-state.ts +59 -0
  1570. package/workspace-snapshot/files/src/setup/sync-harness-config-cloud.ts +128 -0
  1571. package/workspace-snapshot/files/src/setup/target-repo-provisioning-pending-state.ts +160 -0
  1572. package/workspace-snapshot/files/src/setup/target-repo-provisioning.ts +704 -0
  1573. package/workspace-snapshot/files/src/setup/target-workflow-finalization-progress.ts +166 -0
  1574. package/workspace-snapshot/files/src/setup/target-workflow-finalization-types.ts +128 -1
  1575. package/workspace-snapshot/files/src/setup/target-workflow-finalization.ts +806 -15
  1576. package/workspace-snapshot/files/src/setup/target-workflow-setup.ts +2 -0
  1577. package/workspace-snapshot/files/src/setup/test-only-runner-upgrade-provider.ts +51 -0
  1578. package/workspace-snapshot/files/src/setup/test-only-target-repo-provisioning-provider.ts +47 -0
  1579. package/workspace-snapshot/files/src/setup/vercel-bridge-artifact.ts +174 -0
  1580. package/workspace-snapshot/files/src/setup/vercel-bridge-deploy.ts +217 -0
  1581. package/workspace-snapshot/files/src/setup/vercel-bridge-diagnostics.ts +1 -1
  1582. package/workspace-snapshot/files/src/setup/vercel-bridge-options.ts +4 -0
  1583. package/workspace-snapshot/files/src/setup/vercel-bridge-orchestration-summary.ts +46 -0
  1584. package/workspace-snapshot/files/src/setup/vercel-bridge-project-marker.ts +8 -0
  1585. package/workspace-snapshot/files/src/setup/vercel-bridge-readiness.ts +2 -1
  1586. package/workspace-snapshot/files/src/setup/vercel-bridge-redeploy-normalize.ts +244 -0
  1587. package/workspace-snapshot/files/src/setup/vercel-bridge-redeploy-poll.ts +406 -190
  1588. package/workspace-snapshot/files/src/setup/vercel-bridge-redeploy-state.ts +3 -0
  1589. package/workspace-snapshot/files/src/setup/vercel-bridge-structured-log.ts +5 -0
  1590. package/workspace-snapshot/files/src/setup/vercel-project-name.ts +38 -0
  1591. package/workspace-snapshot/files/src/setup/vercel-setup-apply.ts +386 -40
  1592. package/workspace-snapshot/files/src/setup/vercel-setup-client.ts +97 -3
  1593. package/workspace-snapshot/files/src/setup/vercel-setup-plan.ts +84 -14
  1594. package/workspace-snapshot/files/src/setup/vercel-setup-summary.ts +10 -0
  1595. package/workspace-snapshot/files/src/setup/workflow-config-snapshot.ts +22 -0
  1596. package/workspace-snapshot/files/src/setup/workflow-install-branch-recovery.ts +660 -0
  1597. package/workspace-snapshot/files/src/setup/workflow-install-merge-errors.ts +70 -20
  1598. package/workspace-snapshot/files/src/setup/workflow-install-merge-gate.ts +25 -0
  1599. package/workspace-snapshot/files/src/setup/workflow-model-save-queue.ts +251 -0
  1600. package/workspace-snapshot/files/src/setup/workflow-model-sync-lock.ts +103 -0
  1601. package/workspace-snapshot/files/src/setup/workflow-model-sync.ts +259 -0
  1602. package/workspace-snapshot/files/src/setup/workflow-models-sync-evidence.ts +34 -0
  1603. package/workspace-snapshot/files/src/types/parsed-issue.ts +9 -0
  1604. package/workspace-snapshot/files/src/types/run.ts +44 -1
  1605. package/workspace-snapshot/files/src/validate/issue.ts +52 -6
  1606. package/workspace-snapshot/files/src/validate/types.ts +3 -0
  1607. package/workspace-snapshot/files/src/webhook/dispatch-statuses.ts +8 -16
  1608. package/workspace-snapshot/files/src/webhook/filter.ts +24 -1
  1609. package/workspace-snapshot/files/src/webhook/handle-linear-webhook.ts +15 -1
  1610. package/workspace-snapshot/files/src/webhook/parse-linear-issue-event.ts +4 -0
  1611. package/workspace-snapshot/files/src/webhook/types.ts +4 -1
  1612. package/workspace-snapshot/files/src/workflow/canonical-product-development-workflow.ts +584 -0
  1613. package/workspace-snapshot/files/src/workflow/canonical-workflow-gate.ts +255 -0
  1614. package/workspace-snapshot/files/src/workflow/canonical-workflow-validation.ts +297 -0
  1615. package/workspace-snapshot/files/src/workflow/finalize-harness-run.ts +83 -0
  1616. package/workspace-snapshot/files/src/workflow/preflight-canonical.ts +40 -0
  1617. package/workspace-snapshot/files/src/workflow/write-fallback-manifest.ts +39 -0
  1618. package/workspace-snapshot/files/src/workflow-page/bootstrap.ts +277 -0
  1619. package/workspace-snapshot/files/src/workflow-page/catalog-validation.ts +158 -0
  1620. package/workspace-snapshot/files/src/workflow-page/constants.ts +22 -0
  1621. package/workspace-snapshot/files/src/workflow-page/current-workflow.ts +225 -0
  1622. package/workspace-snapshot/files/src/workflow-page/fingerprint.ts +9 -0
  1623. package/workspace-snapshot/files/src/workflow-page/fixture-definition.ts +16 -0
  1624. package/workspace-snapshot/files/src/workflow-page/fixture-role-models.ts +50 -0
  1625. package/workspace-snapshot/files/src/workflow-page/fixtures/basic-current-workflow.ts +39 -0
  1626. package/workspace-snapshot/files/src/workflow-page/fixtures/branching-pr-review.ts +11 -0
  1627. package/workspace-snapshot/files/src/workflow-page/fixtures/canonical-violations.ts +50 -0
  1628. package/workspace-snapshot/files/src/workflow-page/fixtures/credential-errors.ts +13 -0
  1629. package/workspace-snapshot/files/src/workflow-page/fixtures/empty-linear-statuses.ts +10 -0
  1630. package/workspace-snapshot/files/src/workflow-page/fixtures/hundred-node-performance.ts +23 -0
  1631. package/workspace-snapshot/files/src/workflow-page/fixtures/index.ts +37 -0
  1632. package/workspace-snapshot/files/src/workflow-page/fixtures/model-catalog-snapshot.ts +34 -0
  1633. package/workspace-snapshot/files/src/workflow-page/fixtures/workflow-scopes.ts +18 -0
  1634. package/workspace-snapshot/files/src/workflow-page/linear-status-source.ts +65 -0
  1635. package/workspace-snapshot/files/src/workflow-page/model-catalog-lookup.ts +8 -0
  1636. package/workspace-snapshot/files/src/workflow-page/model-catalog-utils.ts +83 -0
  1637. package/workspace-snapshot/files/src/workflow-page/model-catalog.ts +60 -0
  1638. package/workspace-snapshot/files/src/workflow-page/scope-branches.ts +27 -0
  1639. package/workspace-snapshot/files/src/workflow-page/source-context.ts +91 -0
  1640. package/workspace-snapshot/files/src/workflow-page/types.ts +134 -0
  1641. package/workspace-snapshot/files/src/workflow-page/workflow-scopes.ts +73 -0
  1642. package/workspace-snapshot/files/tests/agents/cursor-provider.test.ts +41 -29
  1643. package/workspace-snapshot/files/tests/artifacts/redact.test.ts +11 -0
  1644. package/workspace-snapshot/files/tests/cli/json-out-manifest.test.ts +96 -0
  1645. package/workspace-snapshot/files/tests/config/cloud-config-fingerprint.test.ts +62 -0
  1646. package/workspace-snapshot/files/tests/config/legacy-linear-top-level.test.ts +86 -0
  1647. package/workspace-snapshot/files/tests/config/onboarding-cloud-runner-contract.test.ts +139 -0
  1648. package/workspace-snapshot/files/tests/config/resolve-linear-workspace.test.ts +314 -0
  1649. package/workspace-snapshot/files/tests/config/role-models.test.ts +35 -0
  1650. package/workspace-snapshot/files/tests/cursor/agent-factory.test.ts +124 -0
  1651. package/workspace-snapshot/files/tests/cursor/role-models.test.ts +52 -0
  1652. package/workspace-snapshot/files/tests/cursor/run-observer.test.ts +36 -0
  1653. package/workspace-snapshot/files/tests/fixtures/workflows/harness-auto-runner-with-production-sync.yml +36 -11
  1654. package/workspace-snapshot/files/tests/github/auth-verification-retry.test.ts +141 -0
  1655. package/workspace-snapshot/files/tests/gui/app-shell-settings-menu.test.ts +115 -0
  1656. package/workspace-snapshot/files/tests/gui/configure-fix-loop.test.ts +50 -37
  1657. package/workspace-snapshot/files/tests/gui/configure-navigation-contract.test.ts +107 -0
  1658. package/workspace-snapshot/files/tests/gui/configure-target-repo-create.test.ts +103 -0
  1659. package/workspace-snapshot/files/tests/gui/configure-workflow-readiness.test.ts +117 -0
  1660. package/workspace-snapshot/files/tests/gui/data-sharing-preferences.test.ts +43 -0
  1661. package/workspace-snapshot/files/tests/gui/design-system.test.ts +65 -5
  1662. package/workspace-snapshot/files/tests/gui/guided-linear-workspace-card.test.ts +168 -0
  1663. package/workspace-snapshot/files/tests/gui/guided-operation-ux.test.ts +100 -0
  1664. package/workspace-snapshot/files/tests/gui/guided-setup-progress.test.ts +267 -0
  1665. package/workspace-snapshot/files/tests/gui/guided-setup.test.ts +60 -0
  1666. package/workspace-snapshot/files/tests/gui/guided-target-workflow-polling.test.ts +38 -0
  1667. package/workspace-snapshot/files/tests/gui/linear-association-draft.test.ts +93 -0
  1668. package/workspace-snapshot/files/tests/gui/local-readiness-stream.test.ts +154 -0
  1669. package/workspace-snapshot/files/tests/gui/local-readiness-visual-queue.test.ts +69 -0
  1670. package/workspace-snapshot/files/tests/gui/local-readiness-workspace.test.ts +299 -0
  1671. package/workspace-snapshot/files/tests/gui/m6-configure-boundaries.test.ts +177 -35
  1672. package/workspace-snapshot/files/tests/gui/observability-preferences-route.test.ts +343 -0
  1673. package/workspace-snapshot/files/tests/gui/observability-request-guard.test.ts +177 -0
  1674. package/workspace-snapshot/files/tests/gui/packaged-harness-cloud-secrets-routes.test.ts +16 -0
  1675. package/workspace-snapshot/files/tests/gui/packaged-runner-upgrade-routes.test.ts +532 -0
  1676. package/workspace-snapshot/files/tests/gui/packaged-target-repo-provisioning-routes.test.ts +108 -0
  1677. package/workspace-snapshot/files/tests/gui/repo-root.test.ts +55 -0
  1678. package/workspace-snapshot/files/tests/gui/runner-upgrade-settings-card.test.ts +97 -0
  1679. package/workspace-snapshot/files/tests/gui/settings-cursor.test.ts +39 -0
  1680. package/workspace-snapshot/files/tests/gui/settings-deployments-autoload.test.ts +57 -0
  1681. package/workspace-snapshot/files/tests/gui/settings-mutation-editors.test.ts +154 -0
  1682. package/workspace-snapshot/files/tests/gui/settings-navigation.test.ts +95 -0
  1683. package/workspace-snapshot/files/tests/gui/settings-repositories-page.test.ts +54 -0
  1684. package/workspace-snapshot/files/tests/gui/step7-settings-polish.test.ts +180 -0
  1685. package/workspace-snapshot/files/tests/gui/target-workflow-pr-card.test.ts +68 -0
  1686. package/workspace-snapshot/files/tests/gui/vercel-bridge-polling-ui.test.ts +50 -1
  1687. package/workspace-snapshot/files/tests/gui/verification-state.test.ts +45 -0
  1688. package/workspace-snapshot/files/tests/gui/workflow-bootstrap-route.test.ts +78 -0
  1689. package/workspace-snapshot/files/tests/gui/workflow-model-autosave.test.ts +36 -0
  1690. package/workspace-snapshot/files/tests/gui/workflow-source-ui.test.ts +22 -0
  1691. package/workspace-snapshot/files/tests/gui/workflow-violation-messages.test.ts +39 -0
  1692. package/workspace-snapshot/files/tests/gui/workflow-workspace.test.ts +188 -0
  1693. package/workspace-snapshot/files/tests/linear/markers.test.ts +29 -0
  1694. package/workspace-snapshot/files/tests/linear/run-status-comment.test.ts +143 -0
  1695. package/workspace-snapshot/files/tests/observability/analytics-schemas.test.ts +74 -0
  1696. package/workspace-snapshot/files/tests/observability/context.test.ts +132 -0
  1697. package/workspace-snapshot/files/tests/observability/fatal-process.test.ts +106 -0
  1698. package/workspace-snapshot/files/tests/observability/foundation.test.ts +229 -0
  1699. package/workspace-snapshot/files/tests/observability/instrumentation-dev-startup.test.ts +79 -0
  1700. package/workspace-snapshot/files/tests/observability/lifecycle.test.ts +348 -0
  1701. package/workspace-snapshot/files/tests/observability/package-config.test.ts +66 -0
  1702. package/workspace-snapshot/files/tests/observability/packaged-config.test.ts +47 -0
  1703. package/workspace-snapshot/files/tests/observability/posthog-dashboard-contract.test.ts +133 -0
  1704. package/workspace-snapshot/files/tests/observability/posthog-envelope.test.ts +167 -0
  1705. package/workspace-snapshot/files/tests/observability/posthog-shutdown.test.ts +68 -0
  1706. package/workspace-snapshot/files/tests/observability/privacy-schema.test.ts +83 -0
  1707. package/workspace-snapshot/files/tests/observability/provisioning-analytics.test.ts +54 -0
  1708. package/workspace-snapshot/files/tests/observability/public-config-enablement.test.ts +48 -0
  1709. package/workspace-snapshot/files/tests/observability/sentry-envelope.test.ts +289 -0
  1710. package/workspace-snapshot/files/tests/observability/sentry-outbound-privacy.test.ts +141 -0
  1711. package/workspace-snapshot/files/tests/observability/sentry-privacy-assertions.ts +52 -0
  1712. package/workspace-snapshot/files/tests/observability/sentry-server-only.test.ts +68 -0
  1713. package/workspace-snapshot/files/tests/observability/sentry-transport.test.ts +88 -0
  1714. package/workspace-snapshot/files/tests/observability/session-dedupe.test.ts +117 -0
  1715. package/workspace-snapshot/files/tests/observability/snapshot-exclusion.test.ts +9 -0
  1716. package/workspace-snapshot/files/tests/p-dev/cli.test.ts +2 -2
  1717. package/workspace-snapshot/files/tests/p-dev/git-object-plumbing.test.ts +49 -0
  1718. package/workspace-snapshot/files/tests/p-dev/installed-tarball-gui.test.ts +475 -0
  1719. package/workspace-snapshot/files/tests/p-dev/installed-tarball-loopback.test.ts +986 -0
  1720. package/workspace-snapshot/files/tests/p-dev/installed-tarball-snapshot-provisioning.test.ts +361 -0
  1721. package/workspace-snapshot/files/tests/p-dev/launch.test.ts +55 -3
  1722. package/workspace-snapshot/files/tests/p-dev/package-manifest.test.ts +3 -1
  1723. package/workspace-snapshot/files/tests/p-dev/package-packed-artifact.test.ts +115 -10
  1724. package/workspace-snapshot/files/tests/p-dev/package-paths.test.ts +51 -0
  1725. package/workspace-snapshot/files/tests/p-dev/package-version.test.ts +1 -1
  1726. package/workspace-snapshot/files/tests/p-dev/packaged-workspace-setup.test.ts +1 -1
  1727. package/workspace-snapshot/files/tests/p-dev/workspace-snapshot-policy.test.ts +6 -0
  1728. package/workspace-snapshot/files/tests/product/initialization-state.test.ts +78 -0
  1729. package/workspace-snapshot/files/tests/product/read-product-marker.test.ts +46 -0
  1730. package/workspace-snapshot/files/tests/prompts/builder.test.ts +1 -0
  1731. package/workspace-snapshot/files/tests/prompts/implementation-builder.test.ts +1 -0
  1732. package/workspace-snapshot/files/tests/prompts/issue-intake-chatgpt.test.ts +1 -0
  1733. package/workspace-snapshot/files/tests/resolver/target-repo.test.ts +66 -0
  1734. package/workspace-snapshot/files/tests/runner/builder-thread-acquire.test.ts +288 -0
  1735. package/workspace-snapshot/files/tests/runner/builder-thread-idempotency.test.ts +42 -0
  1736. package/workspace-snapshot/files/tests/runner/builder-thread-lineage.test.ts +206 -0
  1737. package/workspace-snapshot/files/tests/runner/delivery-dedup.test.ts +53 -0
  1738. package/workspace-snapshot/files/tests/runner/failure-finalization-runner-upgrade.test.ts +112 -0
  1739. package/workspace-snapshot/files/tests/runner/failure-finalization.test.ts +203 -0
  1740. package/workspace-snapshot/files/tests/runner/handoff.test.ts +66 -0
  1741. package/workspace-snapshot/files/tests/runner/idempotency-handoff.test.ts +1 -0
  1742. package/workspace-snapshot/files/tests/runner/idempotency-implementation.test.ts +1 -0
  1743. package/workspace-snapshot/files/tests/runner/idempotency-revision.test.ts +1 -0
  1744. package/workspace-snapshot/files/tests/runner/idempotency.test.ts +1 -0
  1745. package/workspace-snapshot/files/tests/runner/implementation.test.ts +24 -5
  1746. package/workspace-snapshot/files/tests/runner/integration-repair.test.ts +21 -6
  1747. package/workspace-snapshot/files/tests/runner/merge-linear-metadata.test.ts +90 -0
  1748. package/workspace-snapshot/files/tests/runner/merge.test.ts +79 -0
  1749. package/workspace-snapshot/files/tests/runner/planning.test.ts +9 -0
  1750. package/workspace-snapshot/files/tests/runner/preflight-canonical.test.ts +73 -0
  1751. package/workspace-snapshot/files/tests/runner/preflight-fail-closed.integration.test.ts +418 -0
  1752. package/workspace-snapshot/files/tests/runner/preview-capability.test.ts +46 -0
  1753. package/workspace-snapshot/files/tests/runner/resolve-route.test.ts +6 -0
  1754. package/workspace-snapshot/files/tests/runner/revision.test.ts +117 -9
  1755. package/workspace-snapshot/files/tests/runner/uninitialized-product-routing.test.ts +120 -0
  1756. package/workspace-snapshot/files/tests/setup/control-plane-readiness.test.ts +86 -0
  1757. package/workspace-snapshot/files/tests/setup/control-plane-state-lock.test.ts +67 -0
  1758. package/workspace-snapshot/files/tests/setup/first-run-readiness.test.ts +134 -2
  1759. package/workspace-snapshot/files/tests/setup/github-dispatch-token.test.ts +49 -1
  1760. package/workspace-snapshot/files/tests/setup/github-repository-name.test.ts +28 -0
  1761. package/workspace-snapshot/files/tests/setup/gui-remote-storage.test.ts +0 -2
  1762. package/workspace-snapshot/files/tests/setup/harness-dispatch-repo.test.ts +292 -3
  1763. package/workspace-snapshot/files/tests/setup/harness-snapshot-bulk-fixture.ts +72 -0
  1764. package/workspace-snapshot/files/tests/setup/harness-snapshot-bulk-installed.test.ts +93 -0
  1765. package/workspace-snapshot/files/tests/setup/harness-snapshot-git-transport.test.ts +518 -0
  1766. package/workspace-snapshot/files/tests/setup/harness-step-readiness.test.ts +145 -0
  1767. package/workspace-snapshot/files/tests/setup/harness-workspace-snapshot-loader.test.ts +142 -0
  1768. package/workspace-snapshot/files/tests/setup/initial-setup-lifecycle.test.ts +220 -0
  1769. package/workspace-snapshot/files/tests/setup/linear-setup-apply.test.ts +7 -4
  1770. package/workspace-snapshot/files/tests/setup/linear-setup-plan.test.ts +46 -3
  1771. package/workspace-snapshot/files/tests/setup/linear-workflow-status-repair.test.ts +314 -0
  1772. package/workspace-snapshot/files/tests/setup/linear-workspace-migration.test.ts +173 -0
  1773. package/workspace-snapshot/files/tests/setup/linear-workspace-plan.test.ts +247 -0
  1774. package/workspace-snapshot/files/tests/setup/local-apply-actions.test.ts +13 -0
  1775. package/workspace-snapshot/files/tests/setup/local-readiness-checks.test.ts +25 -1
  1776. package/workspace-snapshot/files/tests/setup/mock-canonical-preflight.ts +14 -0
  1777. package/workspace-snapshot/files/tests/setup/packaged-default-route.test.ts +85 -0
  1778. package/workspace-snapshot/files/tests/setup/release-sync-managed-runner.test.ts +385 -0
  1779. package/workspace-snapshot/files/tests/setup/runner-upgrade-canary.test.ts +201 -0
  1780. package/workspace-snapshot/files/tests/setup/runner-upgrade-three-way.test.ts +226 -0
  1781. package/workspace-snapshot/files/tests/setup/runner-upgrade.test.ts +702 -0
  1782. package/workspace-snapshot/files/tests/setup/service-verification.test.ts +197 -18
  1783. package/workspace-snapshot/files/tests/setup/settings-config-patch.test.ts +280 -0
  1784. package/workspace-snapshot/files/tests/setup/setup-state.test.ts +47 -0
  1785. package/workspace-snapshot/files/tests/setup/step6-automatic-apply-outcome.test.ts +1 -0
  1786. package/workspace-snapshot/files/tests/setup/step6-automatic-control-state.test.ts +73 -0
  1787. package/workspace-snapshot/files/tests/setup/target-repo-provisioning.test.ts +307 -0
  1788. package/workspace-snapshot/files/tests/setup/target-workflow-finalization-progress.test.ts +71 -0
  1789. package/workspace-snapshot/files/tests/setup/target-workflow-finalization-step-github.test.ts +240 -0
  1790. package/workspace-snapshot/files/tests/setup/vercel-bridge-redeploy-normalize.test.ts +106 -0
  1791. package/workspace-snapshot/files/tests/setup/vercel-bridge-redeploy-poll.test.ts +78 -4
  1792. package/workspace-snapshot/files/tests/setup/vercel-setup-apply.test.ts +278 -3
  1793. package/workspace-snapshot/files/tests/setup/vercel-setup-client.test.ts +76 -0
  1794. package/workspace-snapshot/files/tests/setup/vercel-setup-plan.test.ts +58 -0
  1795. package/workspace-snapshot/files/tests/setup/workflow-install-branch-recovery-commit.test.ts +144 -0
  1796. package/workspace-snapshot/files/tests/setup/workflow-install-branch-recovery.test.ts +133 -0
  1797. package/workspace-snapshot/files/tests/setup/workflow-install-merge-errors.test.ts +66 -1
  1798. package/workspace-snapshot/files/tests/setup/workflow-install-merge-gate.test.ts +58 -0
  1799. package/workspace-snapshot/files/tests/setup/workflow-model-save-queue.test.ts +139 -0
  1800. package/workspace-snapshot/files/tests/setup/workflow-model-sync.test.ts +141 -0
  1801. package/workspace-snapshot/files/tests/validate-issue/uninitialized-product.test.ts +108 -0
  1802. package/workspace-snapshot/files/tests/webhook/filter.test.ts +55 -0
  1803. package/workspace-snapshot/files/tests/webhook/harness-auto-runner-workflow.test.ts +7 -0
  1804. package/workspace-snapshot/files/tests/workflow/canonical-product-development-workflow.test.ts +193 -0
  1805. package/workspace-snapshot/files/tests/workflow/canonical-workflow-validation.test.ts +202 -0
  1806. package/workspace-snapshot/files/tests/workflow/workflow-shell-safety.test.ts +5 -2
  1807. package/workspace-snapshot/files/vitest.config.ts +5 -0
  1808. package/workspace-snapshot/manifest.json +3604 -836
  1809. package/workspace-snapshot/object-pack/snapshot-2735d42c938e514f27a9b2aaf5fa2fcc68019075.idx +0 -0
  1810. package/workspace-snapshot/object-pack/snapshot-2735d42c938e514f27a9b2aaf5fa2fcc68019075.pack +0 -0
  1811. package/gui/.next/server/app/index.html +0 -1
  1812. package/gui/.next/server/app/index.meta +0 -9
  1813. package/gui/.next/server/app/index.rsc +0 -18
  1814. package/gui/.next/server/chunks/200.js +0 -1
  1815. package/gui/.next/server/chunks/477.js +0 -16
  1816. package/gui/.next/server/chunks/585.js +0 -1
  1817. package/gui/.next/server/chunks/647.js +0 -82
  1818. package/gui/.next/server/chunks/711.js +0 -1
  1819. package/gui/.next/server/chunks/900.js +0 -1
  1820. package/gui/.next/server/chunks/901.js +0 -22
  1821. package/gui/.next/static/ZGJuemeaiW4yT7CTlmjdG/_buildManifest.js +0 -1
  1822. package/gui/.next/static/chunks/661-5fc9351358e2f084.js +0 -1
  1823. package/gui/.next/static/chunks/app/_not-found/page-f15332c94524c284.js +0 -1
  1824. package/gui/.next/static/chunks/app/api/setup/apply-connect-services/route-979ec1702bd9938a.js +0 -1
  1825. package/gui/.next/static/chunks/app/api/setup/apply-harness-repo-provisioning/route-979ec1702bd9938a.js +0 -1
  1826. package/gui/.next/static/chunks/app/api/setup/apply-harness-secrets/route-979ec1702bd9938a.js +0 -1
  1827. package/gui/.next/static/chunks/app/api/setup/apply-linear-setup/route-979ec1702bd9938a.js +0 -1
  1828. package/gui/.next/static/chunks/app/api/setup/apply-local-files/route-979ec1702bd9938a.js +0 -1
  1829. package/gui/.next/static/chunks/app/api/setup/apply-target-workflow/route-979ec1702bd9938a.js +0 -1
  1830. package/gui/.next/static/chunks/app/api/setup/apply-vercel-bridge/route-979ec1702bd9938a.js +0 -1
  1831. package/gui/.next/static/chunks/app/api/setup/finalize-target-workflow/route-979ec1702bd9938a.js +0 -1
  1832. package/gui/.next/static/chunks/app/api/setup/harness-provisioning-summary/route-979ec1702bd9938a.js +0 -1
  1833. package/gui/.next/static/chunks/app/api/setup/linear-options/route-979ec1702bd9938a.js +0 -1
  1834. package/gui/.next/static/chunks/app/api/setup/linear-summary/route-979ec1702bd9938a.js +0 -1
  1835. package/gui/.next/static/chunks/app/api/setup/local-readiness/route-979ec1702bd9938a.js +0 -1
  1836. package/gui/.next/static/chunks/app/api/setup/manual-harness-secret-values/route-979ec1702bd9938a.js +0 -1
  1837. package/gui/.next/static/chunks/app/api/setup/preview-connect-services/route-979ec1702bd9938a.js +0 -1
  1838. package/gui/.next/static/chunks/app/api/setup/preview-harness-repo-provisioning/route-979ec1702bd9938a.js +0 -1
  1839. package/gui/.next/static/chunks/app/api/setup/preview-harness-secrets/route-979ec1702bd9938a.js +0 -1
  1840. package/gui/.next/static/chunks/app/api/setup/preview-linear-setup/route-979ec1702bd9938a.js +0 -1
  1841. package/gui/.next/static/chunks/app/api/setup/preview-local-files/route-979ec1702bd9938a.js +0 -1
  1842. package/gui/.next/static/chunks/app/api/setup/preview-target-workflow/route-979ec1702bd9938a.js +0 -1
  1843. package/gui/.next/static/chunks/app/api/setup/preview-vercel-bridge/route-979ec1702bd9938a.js +0 -1
  1844. package/gui/.next/static/chunks/app/api/setup/remote-summary/route-979ec1702bd9938a.js +0 -1
  1845. package/gui/.next/static/chunks/app/api/setup/summary/route-979ec1702bd9938a.js +0 -1
  1846. package/gui/.next/static/chunks/app/api/setup/vercel-bridge-options/route-979ec1702bd9938a.js +0 -1
  1847. package/gui/.next/static/chunks/app/api/setup/vercel-bridge-redeploy-status/route-979ec1702bd9938a.js +0 -1
  1848. package/gui/.next/static/chunks/app/api/setup/vercel-summary/route-979ec1702bd9938a.js +0 -1
  1849. package/gui/.next/static/chunks/app/api/setup/verify-harness-repo/route-979ec1702bd9938a.js +0 -1
  1850. package/gui/.next/static/chunks/app/api/setup/verify-service/route-979ec1702bd9938a.js +0 -1
  1851. package/gui/.next/static/chunks/app/api/setup/verify-target-repo/route-979ec1702bd9938a.js +0 -1
  1852. package/gui/.next/static/chunks/app/layout-10445a363bff6a38.js +0 -1
  1853. package/gui/.next/static/chunks/app/page-979ec1702bd9938a.js +0 -1
  1854. package/gui/.next/static/chunks/app/settings/configure/page-25b2288ace2949a1.js +0 -1
  1855. package/gui/.next/static/chunks/framework-7318ce553e854ad6.js +0 -1
  1856. package/gui/.next/static/chunks/main-app-732547e2b1a794b6.js +0 -1
  1857. package/gui/.next/static/chunks/main-f7a784f5852cbbd1.js +0 -1
  1858. package/gui/.next/static/chunks/pages/_error-bda15e7831eec981.js +0 -1
  1859. package/gui/.next/static/css/781f3c93b6d7425a.css +0 -3
  1860. package/workspace-snapshot/files/apps/gui/components/custom/setup-dashboard.tsx +0 -124
  1861. package/workspace-snapshot/files/apps/gui/components/custom/setup-readonly-sections.tsx +0 -210
  1862. /package/gui/.next/static/{ZGJuemeaiW4yT7CTlmjdG → wM7YWpWgyTcGc7H5h1u7U}/_ssgManifest.js +0 -0
@@ -0,0 +1,1926 @@
1
+ import { createHash, randomUUID } from "node:crypto";
2
+ import { readFile } from "node:fs/promises";
3
+ import path from "node:path";
4
+ import type { WorkspaceSnapshotManifest } from "../p-dev/workspace-snapshot-types.js";
5
+ import {
6
+ isIncludedSnapshotPath,
7
+ isForbiddenSnapshotPath,
8
+ } from "../p-dev/workspace-snapshot-policy.js";
9
+ import { loadWorkspaceSnapshotEntryContent } from "../p-dev/workspace-snapshot-generator.js";
10
+ import {
11
+ loadEmbeddedWorkspaceSnapshot,
12
+ loadEmbeddedWorkspaceSnapshotIdentityForStatus,
13
+ } from "./harness-workspace-snapshot-loader.js";
14
+ import {
15
+ HARNESS_MANAGED_REPO_MARKER_FILE,
16
+ buildHarnessSnapshotManagedRepoMarker,
17
+ parseHarnessManagedRepoMarkerJson,
18
+ validateManagedMarkerForReconnect,
19
+ type HarnessManagedRepoMarker,
20
+ } from "./harness-managed-repo-marker.js";
21
+ import { formatHarnessDispatchRepo, resolveHarnessDispatchRepo } from "./harness-dispatch-repo.js";
22
+ import { deriveProvisioningCommitIdentity } from "./harness-snapshot-provisioning-helpers.js";
23
+ import { syncHarnessConfigCloudPair } from "./sync-harness-config-cloud.js";
24
+ import { recordRunnerUpgradeEvidence } from "./runner-upgrade-evidence.js";
25
+ import {
26
+ clearRunnerUpgradePendingState,
27
+ readRunnerUpgradePendingState,
28
+ withHarnessRunnerUpgradeMutex,
29
+ writeRunnerUpgradePendingStateAtomic,
30
+ type RunnerUpgradePendingState,
31
+ } from "./runner-upgrade-pending-state.js";
32
+ import {
33
+ writeRunnerUpgradeProgressAtomic,
34
+ type RunnerUpgradeProgressState,
35
+ } from "./runner-upgrade-progress.js";
36
+ import {
37
+ compareThreeWayUpgrade,
38
+ extractFileHashesFromManifest,
39
+ extractFileHashesFromMarker,
40
+ type FileHashMap,
41
+ } from "./runner-upgrade-three-way.js";
42
+ import {
43
+ CANARY_OPERATION_ID_INPUT,
44
+ locateCanaryRunByOperationId,
45
+ } from "./runner-upgrade-canary-dispatch.js";
46
+ import {
47
+ asRemoteSetupProviderForRunnerUpgrade,
48
+ type RunnerUpgradeGitHubProvider,
49
+ } from "./runner-upgrade-provider.js";
50
+ import {
51
+ lastVerifiedToSnapshotSummary,
52
+ readRunnerUpgradeLastVerifiedIdentity,
53
+ writeRunnerUpgradeLastVerifiedIdentity,
54
+ } from "./runner-upgrade-status-cache.js";
55
+ import {
56
+ RUNNER_UPGRADE_CANARY_WORKFLOW_PATH,
57
+ buildRunnerUpgradeBranchName,
58
+ buildRunnerUpgradePrMarker,
59
+ parseRunnerUpgradePrMarker,
60
+ runnerUpgradeStatusLabel,
61
+ type RunnerUpgradeAcceptResult,
62
+ type RunnerUpgradeApplyResult,
63
+ type RunnerUpgradeImpactSummary,
64
+ type RunnerUpgradePhase,
65
+ type RunnerUpgradePreviewResult,
66
+ type RunnerUpgradeSnapshotSummary,
67
+ type RunnerUpgradeStatus,
68
+ type RunnerUpgradeStatusResult,
69
+ } from "./runner-upgrade-types.js";
70
+ import {
71
+ RUNNER_UPGRADE_HEARTBEAT_EVERY_FILES,
72
+ RUNNER_UPGRADE_STATUS_OVERALL_DEADLINE_MS,
73
+ RUNNER_UPGRADE_STATUS_PROVIDER_TIMEOUT_MS,
74
+ RUNNER_UPGRADE_WORKER_PROVIDER_TIMEOUT_MS,
75
+ RunnerUpgradeStatusStageTracker,
76
+ RunnerUpgradeTimeoutError,
77
+ beginRunnerUpgradeStatusRequest,
78
+ endRunnerUpgradeStatusRequest,
79
+ recordRunnerUpgradeStatusCallTimings,
80
+ throwIfRunnerUpgradeAborted,
81
+ withRunnerUpgradeStatusDeadline,
82
+ withTimedRunnerUpgradeCall,
83
+ type RunnerUpgradeCallTiming,
84
+ type RunnerUpgradeStatusStage,
85
+ } from "./runner-upgrade-timeouts.js";
86
+ import {
87
+ enqueueRunnerUpgradeOperation,
88
+ isRunnerUpgradeOperationActive,
89
+ reconcileAbandonedRunnerUpgrades,
90
+ } from "./runner-upgrade-worker.js";
91
+
92
+ export {
93
+ getLastRunnerUpgradeStatusCallTimings,
94
+ getLastRunnerUpgradeStatusStageTimings,
95
+ getLastUnresolvedRunnerUpgradeStatusStage,
96
+ isRunnerUpgradeProgressStale,
97
+ abortInFlightRunnerUpgradeStatus,
98
+ RUNNER_UPGRADE_NO_PROGRESS_STALE_MS,
99
+ RUNNER_UPGRADE_STATUS_OVERALL_DEADLINE_MS,
100
+ RUNNER_UPGRADE_STATUS_PROVIDER_TIMEOUT_MS,
101
+ RUNNER_UPGRADE_WORKER_PROVIDER_TIMEOUT_MS,
102
+ runnerUpgradeProgressShowsNoProgress,
103
+ } from "./runner-upgrade-timeouts.js";
104
+
105
+ const ALL_RUNNER_UPGRADE_PHASES: RunnerUpgradePhase[] = [
106
+ "verifying-managed-repository",
107
+ "comparing-runner-snapshots",
108
+ "preparing-upgrade-commit",
109
+ "updating-managed-runner",
110
+ "verifying-runner-on-production-branch",
111
+ "synchronizing-cloud-configuration",
112
+ "running-configuration-canary",
113
+ ];
114
+
115
+ const DEFAULT_CANARY_POLL_INTERVAL_MS = 2_000;
116
+ const DEFAULT_CANARY_POLL_TIMEOUT_MS = 120_000;
117
+
118
+ type ResolveContextMode = "status" | "worker";
119
+
120
+ const OPERATOR_LOCAL_ONLY_PATHS = new Set([
121
+ ".harness/config.local.json",
122
+ ".env.local",
123
+ ]);
124
+
125
+ export interface RunnerUpgradeApplyOptions {
126
+ previewFingerprint?: string;
127
+ canaryPollIntervalMs?: number;
128
+ canaryPollTimeoutMs?: number;
129
+ /** When true, skip worker enqueue (used by the worker itself / sync unit tests). */
130
+ executeInline?: boolean;
131
+ }
132
+
133
+ export interface RunnerUpgradeAcceptOptions {
134
+ previewFingerprint?: string;
135
+ resume?: boolean;
136
+ }
137
+
138
+ interface ResolvedRunnerUpgradeContext {
139
+ repoSlug: string;
140
+ owner: string;
141
+ repo: string;
142
+ repositoryId: number;
143
+ defaultBranch: string;
144
+ defaultBranchHead: string;
145
+ marker: HarnessManagedRepoMarker;
146
+ packagedSnapshot: {
147
+ packageRoot: string;
148
+ snapshotRoot: string;
149
+ packageVersion: string;
150
+ manifest: WorkspaceSnapshotManifest;
151
+ fingerprint: string;
152
+ };
153
+ }
154
+
155
+ function sha256Content(content: string | Buffer): string {
156
+ return createHash("sha256").update(content).digest("hex");
157
+ }
158
+
159
+ function snapshotSummaryFromManifest(
160
+ manifest: WorkspaceSnapshotManifest,
161
+ ): RunnerUpgradeSnapshotSummary {
162
+ return {
163
+ snapshotContentId: manifest.snapshotContentId,
164
+ packageVersion: manifest.packageVersion,
165
+ sourceCommit: manifest.sourceCommit,
166
+ };
167
+ }
168
+
169
+ function buildImpactSummary(input: {
170
+ replacePaths: string[];
171
+ deletePaths: string[];
172
+ }): RunnerUpgradeImpactSummary {
173
+ return {
174
+ replacePathCount: input.replacePaths.length,
175
+ deletePathCount: input.deletePaths.length,
176
+ sampleReplacePaths: input.replacePaths.slice(0, 8),
177
+ sampleDeletePaths: input.deletePaths.slice(0, 8),
178
+ };
179
+ }
180
+
181
+ function computePreviewFingerprint(input: {
182
+ targetSnapshotContentId: string;
183
+ replacePaths: string[];
184
+ deletePaths: string[];
185
+ repositoryId: number;
186
+ }): string {
187
+ return sha256Content(
188
+ JSON.stringify({
189
+ targetSnapshotContentId: input.targetSnapshotContentId,
190
+ replacePaths: [...input.replacePaths].sort(),
191
+ deletePaths: [...input.deletePaths].sort(),
192
+ repositoryId: input.repositoryId,
193
+ }),
194
+ );
195
+ }
196
+
197
+ function isOperatorLocalOnlyPath(filePath: string): boolean {
198
+ if (OPERATOR_LOCAL_ONLY_PATHS.has(filePath)) {
199
+ return true;
200
+ }
201
+ return isForbiddenSnapshotPath(filePath);
202
+ }
203
+
204
+ function findUnexpectedRemotePaths(input: {
205
+ remoteTreePaths: string[];
206
+ nextHashes: FileHashMap;
207
+ previousHashes: FileHashMap | null;
208
+ }): string[] {
209
+ const packagePaths = new Set(Object.keys(input.nextHashes));
210
+ const unexpected: string[] = [];
211
+ for (const remotePath of input.remoteTreePaths) {
212
+ if (remotePath === HARNESS_MANAGED_REPO_MARKER_FILE) {
213
+ continue;
214
+ }
215
+ if (!isIncludedSnapshotPath(remotePath)) {
216
+ continue;
217
+ }
218
+ if (packagePaths.has(remotePath)) {
219
+ continue;
220
+ }
221
+ if (isOperatorLocalOnlyPath(remotePath)) {
222
+ continue;
223
+ }
224
+ if (input.previousHashes?.[remotePath]) {
225
+ continue;
226
+ }
227
+ unexpected.push(remotePath);
228
+ }
229
+ return [...new Set(unexpected)].sort();
230
+ }
231
+
232
+ async function resolveHarnessRepository(cwd?: string): Promise<{
233
+ repoSlug: string;
234
+ owner: string;
235
+ repo: string;
236
+ }> {
237
+ const harnessDispatchRepo = await resolveHarnessDispatchRepo({ cwd });
238
+ if (!harnessDispatchRepo.resolved || !harnessDispatchRepo.repo) {
239
+ throw new Error("Harness dispatch repository is not configured.");
240
+ }
241
+ const repoSlug = formatHarnessDispatchRepo(harnessDispatchRepo);
242
+ const [owner, repo] = repoSlug.split("/");
243
+ if (!owner || !repo) {
244
+ throw new Error(`Invalid harness repository slug ${repoSlug}.`);
245
+ }
246
+ return { repoSlug, owner, repo };
247
+ }
248
+
249
+ async function loadPackagedSnapshot(): Promise<
250
+ ResolvedRunnerUpgradeContext["packagedSnapshot"] | null
251
+ > {
252
+ const embedded = await loadEmbeddedWorkspaceSnapshot(import.meta.url);
253
+ if (!embedded.ok) {
254
+ return null;
255
+ }
256
+ return {
257
+ packageRoot: embedded.packageRoot,
258
+ snapshotRoot: embedded.snapshotRoot,
259
+ packageVersion: embedded.packageVersion,
260
+ manifest: embedded.manifest,
261
+ fingerprint: embedded.fingerprint,
262
+ };
263
+ }
264
+
265
+ async function loadPackagedSnapshotIdentityForStatus(
266
+ signal?: AbortSignal,
267
+ ): Promise<ResolvedRunnerUpgradeContext["packagedSnapshot"] | null> {
268
+ const embedded = await loadEmbeddedWorkspaceSnapshotIdentityForStatus(
269
+ import.meta.url,
270
+ process.env,
271
+ signal,
272
+ );
273
+ if (!embedded.ok) {
274
+ return null;
275
+ }
276
+ return {
277
+ packageRoot: embedded.packageRoot,
278
+ snapshotRoot: embedded.snapshotRoot,
279
+ packageVersion: embedded.packageVersion,
280
+ manifest: embedded.manifest,
281
+ fingerprint: embedded.fingerprint,
282
+ };
283
+ }
284
+
285
+ async function hasLocalManagedRepoEvidence(cwd?: string): Promise<boolean> {
286
+ const raw = await readLocalManagedRepoMarker(cwd);
287
+ if (!raw) {
288
+ return false;
289
+ }
290
+ const parsed = parseHarnessManagedRepoMarkerJson(raw);
291
+ return parsed.ok;
292
+ }
293
+
294
+ async function readRemoteManagedMarker(
295
+ provider: RunnerUpgradeGitHubProvider,
296
+ input: {
297
+ owner: string;
298
+ repo: string;
299
+ defaultBranch: string;
300
+ defaultBranchHead: string;
301
+ signal?: AbortSignal;
302
+ },
303
+ ): Promise<
304
+ | { ok: true; marker: HarnessManagedRepoMarker }
305
+ | { ok: false; status: RunnerUpgradeStatus; reason: string }
306
+ > {
307
+ const raw = await provider.readRepositoryFileContent(
308
+ input.owner,
309
+ input.repo,
310
+ HARNESS_MANAGED_REPO_MARKER_FILE,
311
+ input.defaultBranchHead,
312
+ { signal: input.signal },
313
+ );
314
+ if (!raw) {
315
+ return {
316
+ ok: false,
317
+ status: "blocked_non_managed",
318
+ reason: "Managed repository marker is missing on the default branch.",
319
+ };
320
+ }
321
+ const parsed = parseHarnessManagedRepoMarkerJson(raw);
322
+ if (!parsed.ok) {
323
+ return {
324
+ ok: false,
325
+ status: "blocked_non_managed",
326
+ reason: parsed.reason,
327
+ };
328
+ }
329
+ if (!parsed.marker.createdFromPackageSnapshot) {
330
+ return {
331
+ ok: false,
332
+ status: "blocked_non_managed",
333
+ reason: "Managed repository was not created from a packaged workspace snapshot.",
334
+ };
335
+ }
336
+ return { ok: true, marker: parsed.marker };
337
+ }
338
+
339
+ async function buildRemoteFileHashes(
340
+ provider: RunnerUpgradeGitHubProvider,
341
+ input: {
342
+ owner: string;
343
+ repo: string;
344
+ defaultBranchHead: string;
345
+ paths: string[];
346
+ onHeartbeat?: (progress: {
347
+ filesInspected: number;
348
+ filesTotal: number;
349
+ lastCompletedBatch: string;
350
+ }) => Promise<void>;
351
+ },
352
+ ): Promise<FileHashMap> {
353
+ const hashes: FileHashMap = {};
354
+ const total = input.paths.length;
355
+ let inspected = 0;
356
+ for (const filePath of input.paths) {
357
+ const content = await provider.readRepositoryFileContent(
358
+ input.owner,
359
+ input.repo,
360
+ filePath,
361
+ input.defaultBranchHead,
362
+ );
363
+ inspected += 1;
364
+ if (content !== null) {
365
+ hashes[filePath] = sha256Content(content);
366
+ }
367
+ if (
368
+ input.onHeartbeat &&
369
+ (inspected % RUNNER_UPGRADE_HEARTBEAT_EVERY_FILES === 0 ||
370
+ inspected === total)
371
+ ) {
372
+ await input.onHeartbeat({
373
+ filesInspected: inspected,
374
+ filesTotal: total,
375
+ lastCompletedBatch: filePath,
376
+ });
377
+ }
378
+ }
379
+ return hashes;
380
+ }
381
+
382
+ export interface ResolveRunnerUpgradeContextOptions {
383
+ signal?: AbortSignal;
384
+ tracker?: RunnerUpgradeStatusStageTracker;
385
+ /** Test-only: never resolve after this stage begins. */
386
+ testHangAfterStage?: RunnerUpgradeStatusStage;
387
+ debugTimings?: boolean;
388
+ }
389
+
390
+ async function maybeHangForTest(
391
+ stage: RunnerUpgradeStatusStage,
392
+ options?: ResolveRunnerUpgradeContextOptions,
393
+ ): Promise<void> {
394
+ if (options?.testHangAfterStage !== stage) {
395
+ return;
396
+ }
397
+ await new Promise<never>((_resolve, reject) => {
398
+ const onAbort = () => {
399
+ reject(
400
+ new RunnerUpgradeTimeoutError(
401
+ `test hang aborted at ${stage}`,
402
+ "testHangAfterStage",
403
+ 0,
404
+ stage,
405
+ ),
406
+ );
407
+ };
408
+ if (options.signal?.aborted) {
409
+ onAbort();
410
+ return;
411
+ }
412
+ options.signal?.addEventListener("abort", onAbort, { once: true });
413
+ });
414
+ }
415
+
416
+ async function resolveRunnerUpgradeContext(
417
+ cwd: string | undefined,
418
+ provider: RunnerUpgradeGitHubProvider,
419
+ mode: ResolveContextMode = "worker",
420
+ options: ResolveRunnerUpgradeContextOptions = {},
421
+ ): Promise<
422
+ | { ok: true; context: ResolvedRunnerUpgradeContext }
423
+ | { ok: false; result: RunnerUpgradeStatusResult }
424
+ > {
425
+ const providerTimeoutMs =
426
+ mode === "status"
427
+ ? RUNNER_UPGRADE_STATUS_PROVIDER_TIMEOUT_MS
428
+ : RUNNER_UPGRADE_WORKER_PROVIDER_TIMEOUT_MS;
429
+ const timings: RunnerUpgradeCallTiming[] = [];
430
+ const recordTiming = (timing: RunnerUpgradeCallTiming) => {
431
+ timings.push(timing);
432
+ };
433
+ const tracker = options.tracker;
434
+ const signal = options.signal;
435
+
436
+ tracker?.begin("embedded_snapshot_identity");
437
+ throwIfRunnerUpgradeAborted(signal);
438
+ await maybeHangForTest("embedded_snapshot_identity", options);
439
+ const packagedSnapshot =
440
+ mode === "status"
441
+ ? await loadPackagedSnapshotIdentityForStatus(signal)
442
+ : await loadPackagedSnapshot();
443
+ tracker?.end();
444
+ if (!packagedSnapshot) {
445
+ if (mode === "status") {
446
+ recordRunnerUpgradeStatusCallTimings(timings);
447
+ }
448
+ return {
449
+ ok: false,
450
+ result: {
451
+ status: "failed",
452
+ statusLabel: runnerUpgradeStatusLabel("failed"),
453
+ blockedReason: "Embedded workspace snapshot is unavailable.",
454
+ },
455
+ };
456
+ }
457
+
458
+ try {
459
+ tracker?.begin("context_normalization");
460
+ throwIfRunnerUpgradeAborted(signal);
461
+ await maybeHangForTest("context_normalization", options);
462
+ const { repoSlug, owner, repo } = await resolveHarnessRepository(cwd);
463
+ tracker?.end();
464
+
465
+ tracker?.begin("provider_wrapper");
466
+ throwIfRunnerUpgradeAborted(signal);
467
+ await maybeHangForTest("provider_wrapper", options);
468
+ const metadata = await withTimedRunnerUpgradeCall(
469
+ "getRepositoryMetadata",
470
+ providerTimeoutMs,
471
+ (callSignal) =>
472
+ provider.getRepositoryMetadata(owner, repo, { signal: callSignal }),
473
+ recordTiming,
474
+ signal,
475
+ );
476
+ if (!metadata) {
477
+ tracker?.end();
478
+ if (mode === "status") {
479
+ recordRunnerUpgradeStatusCallTimings(timings);
480
+ }
481
+ return {
482
+ ok: false,
483
+ result: {
484
+ status: "failed",
485
+ statusLabel: runnerUpgradeStatusLabel("failed"),
486
+ blockedReason: `Harness repository ${repoSlug} is not accessible.`,
487
+ },
488
+ };
489
+ }
490
+
491
+ const defaultBranchHead = await withTimedRunnerUpgradeCall(
492
+ "getRepositoryDefaultBranchHead",
493
+ providerTimeoutMs,
494
+ (callSignal) =>
495
+ provider.getRepositoryDefaultBranchHead(
496
+ owner,
497
+ repo,
498
+ metadata.defaultBranch,
499
+ { signal: callSignal },
500
+ ),
501
+ recordTiming,
502
+ signal,
503
+ );
504
+ tracker?.end();
505
+
506
+ tracker?.begin("marker_parsing");
507
+ throwIfRunnerUpgradeAborted(signal);
508
+ await maybeHangForTest("marker_parsing", options);
509
+ const markerResult = await withTimedRunnerUpgradeCall(
510
+ "readRemoteManagedMarker",
511
+ providerTimeoutMs,
512
+ (callSignal) =>
513
+ readRemoteManagedMarker(provider, {
514
+ owner,
515
+ repo,
516
+ defaultBranch: metadata.defaultBranch,
517
+ defaultBranchHead,
518
+ signal: callSignal,
519
+ }),
520
+ recordTiming,
521
+ signal,
522
+ );
523
+ tracker?.end();
524
+ if (mode === "status") {
525
+ recordRunnerUpgradeStatusCallTimings(timings);
526
+ }
527
+ if (!markerResult.ok) {
528
+ return {
529
+ ok: false,
530
+ result: {
531
+ status: markerResult.status,
532
+ statusLabel: runnerUpgradeStatusLabel(markerResult.status),
533
+ blockedReason: markerResult.reason,
534
+ availableSnapshot: snapshotSummaryFromManifest(
535
+ packagedSnapshot.manifest,
536
+ ),
537
+ },
538
+ };
539
+ }
540
+
541
+ tracker?.begin("status_conversion");
542
+ throwIfRunnerUpgradeAborted(signal);
543
+ await maybeHangForTest("status_conversion", options);
544
+ const reconnect = validateManagedMarkerForReconnect(
545
+ markerResult.marker,
546
+ repoSlug,
547
+ { repositoryId: metadata.id },
548
+ );
549
+ if (!reconnect.ok) {
550
+ tracker?.end();
551
+ return {
552
+ ok: false,
553
+ result: {
554
+ status: "blocked_non_managed",
555
+ statusLabel: runnerUpgradeStatusLabel("blocked_non_managed"),
556
+ blockedReason: reconnect.reason,
557
+ currentSnapshot: markerResult.marker.createdFromPackageSnapshot
558
+ ? {
559
+ snapshotContentId:
560
+ markerResult.marker.createdFromPackageSnapshot
561
+ .snapshotContentId,
562
+ packageVersion:
563
+ markerResult.marker.createdFromPackageSnapshot.packageVersion,
564
+ sourceCommit:
565
+ markerResult.marker.createdFromPackageSnapshot.sourceCommit,
566
+ }
567
+ : undefined,
568
+ availableSnapshot: snapshotSummaryFromManifest(
569
+ packagedSnapshot.manifest,
570
+ ),
571
+ },
572
+ };
573
+ }
574
+ tracker?.end();
575
+
576
+ return {
577
+ ok: true,
578
+ context: {
579
+ repoSlug,
580
+ owner,
581
+ repo,
582
+ repositoryId: metadata.id,
583
+ defaultBranch: metadata.defaultBranch,
584
+ defaultBranchHead,
585
+ marker: markerResult.marker,
586
+ packagedSnapshot,
587
+ },
588
+ };
589
+ } catch (error) {
590
+ if (mode === "status") {
591
+ recordRunnerUpgradeStatusCallTimings(timings);
592
+ tracker?.markTimedOut();
593
+ }
594
+ if (error instanceof RunnerUpgradeTimeoutError || mode === "status") {
595
+ return {
596
+ ok: false,
597
+ result: {
598
+ status: "checking",
599
+ statusLabel: runnerUpgradeStatusLabel("checking"),
600
+ degraded: true,
601
+ blockedReason:
602
+ error instanceof Error
603
+ ? error.message
604
+ : "Runner upgrade status check timed out.",
605
+ retryGuidance:
606
+ "Retry status shortly. GitHub did not respond within the page-status deadline.",
607
+ retryAvailable: true,
608
+ unresolvedStage: tracker?.unresolvedStage,
609
+ availableSnapshot: snapshotSummaryFromManifest(
610
+ packagedSnapshot.manifest,
611
+ ),
612
+ },
613
+ };
614
+ }
615
+ throw error;
616
+ }
617
+ }
618
+
619
+ async function writeProgress(
620
+ cwd: string | undefined,
621
+ pending: RunnerUpgradePendingState,
622
+ phase: RunnerUpgradePhase,
623
+ extras?: Partial<
624
+ Pick<
625
+ RunnerUpgradeProgressState,
626
+ | "lastSuccessfulProviderCallAt"
627
+ | "workerHeartbeatAt"
628
+ | "filesInspected"
629
+ | "filesTotal"
630
+ | "lastCompletedBatch"
631
+ | "retryCount"
632
+ | "retryable"
633
+ | "errorCode"
634
+ | "lastCheckpoint"
635
+ | "recoveryInstruction"
636
+ >
637
+ >,
638
+ ): Promise<void> {
639
+ const now = new Date().toISOString();
640
+ await writeRunnerUpgradeProgressAtomic(
641
+ {
642
+ operationId: pending.operationId,
643
+ phase,
644
+ phaseStartedAt: now,
645
+ startedAt: pending.startedAt,
646
+ canaryRunId: pending.canaryRunId,
647
+ canaryRunUrl: pending.canaryRunUrl,
648
+ prUrl: pending.prUrl,
649
+ workerHeartbeatAt: extras?.workerHeartbeatAt ?? now,
650
+ lastSuccessfulProviderCallAt: extras?.lastSuccessfulProviderCallAt,
651
+ filesInspected: extras?.filesInspected,
652
+ filesTotal: extras?.filesTotal,
653
+ lastCompletedBatch: extras?.lastCompletedBatch,
654
+ retryCount: extras?.retryCount,
655
+ retryable: extras?.retryable,
656
+ errorCode: extras?.errorCode,
657
+ lastCheckpoint: extras?.lastCheckpoint ?? phase,
658
+ recoveryInstruction: extras?.recoveryInstruction,
659
+ },
660
+ cwd,
661
+ );
662
+ }
663
+
664
+ async function compareUpgradeSnapshots(
665
+ provider: RunnerUpgradeGitHubProvider,
666
+ context: ResolvedRunnerUpgradeContext,
667
+ options?: {
668
+ onHeartbeat?: (progress: {
669
+ filesInspected: number;
670
+ filesTotal: number;
671
+ lastCompletedBatch: string;
672
+ }) => Promise<void>;
673
+ },
674
+ ): Promise<
675
+ | {
676
+ ok: true;
677
+ previousHashes: FileHashMap | null;
678
+ remoteHashes: FileHashMap;
679
+ nextHashes: FileHashMap;
680
+ replacePaths: string[];
681
+ deletePaths: string[];
682
+ previewFingerprint: string;
683
+ }
684
+ | {
685
+ ok: false;
686
+ status: RunnerUpgradeStatus;
687
+ conflictPaths?: string[];
688
+ message: string;
689
+ }
690
+ > {
691
+ const previousHashes = extractFileHashesFromMarker(context.marker);
692
+ const nextHashes = extractFileHashesFromManifest(context.packagedSnapshot.manifest);
693
+ const comparePaths = [
694
+ ...new Set([
695
+ ...Object.keys(previousHashes ?? {}),
696
+ ...Object.keys(nextHashes),
697
+ ]),
698
+ ].sort();
699
+ const remoteHashes = await buildRemoteFileHashes(provider, {
700
+ owner: context.owner,
701
+ repo: context.repo,
702
+ defaultBranchHead: context.defaultBranchHead,
703
+ paths: comparePaths,
704
+ onHeartbeat: options?.onHeartbeat,
705
+ });
706
+
707
+ if (provider.listRepositoryTreePaths) {
708
+ const treePaths = await provider.listRepositoryTreePaths(
709
+ context.owner,
710
+ context.repo,
711
+ context.defaultBranchHead,
712
+ );
713
+ const unexpected = findUnexpectedRemotePaths({
714
+ remoteTreePaths: treePaths.map((entry) => entry.path),
715
+ nextHashes,
716
+ previousHashes,
717
+ });
718
+ if (unexpected.length > 0) {
719
+ return {
720
+ ok: false,
721
+ status: "blocked_unexpected_remote",
722
+ message: `Unexpected remote paths outside packaged policy: ${unexpected.join(", ")}`,
723
+ };
724
+ }
725
+ }
726
+
727
+ const compare = compareThreeWayUpgrade({
728
+ previousHashes,
729
+ remoteHashes,
730
+ nextHashes,
731
+ previousSnapshotContentId:
732
+ context.marker.createdFromPackageSnapshot?.snapshotContentId,
733
+ remoteSnapshotContentId:
734
+ context.marker.createdFromPackageSnapshot?.snapshotContentId,
735
+ remoteTreeSha: context.marker.createdFromPackageSnapshot?.snapshotGitTreeSha1,
736
+ previousTreeSha: context.marker.createdFromPackageSnapshot?.snapshotGitTreeSha1,
737
+ });
738
+
739
+ if (!compare.ok) {
740
+ return {
741
+ ok: false,
742
+ status:
743
+ compare.code === "operator_conflicts"
744
+ ? "blocked_operator_conflicts"
745
+ : "blocked_non_managed",
746
+ conflictPaths: compare.conflictPaths,
747
+ message: compare.message,
748
+ };
749
+ }
750
+
751
+ const previewFingerprint = computePreviewFingerprint({
752
+ targetSnapshotContentId: context.packagedSnapshot.manifest.snapshotContentId,
753
+ replacePaths: compare.replacePaths,
754
+ deletePaths: compare.deletePaths,
755
+ repositoryId: context.repositoryId,
756
+ });
757
+
758
+ return {
759
+ ok: true,
760
+ previousHashes,
761
+ remoteHashes,
762
+ nextHashes,
763
+ replacePaths: compare.replacePaths,
764
+ deletePaths: compare.deletePaths,
765
+ previewFingerprint,
766
+ };
767
+ }
768
+
769
+ async function findExistingUpgradePullRequest(
770
+ provider: RunnerUpgradeGitHubProvider,
771
+ input: {
772
+ owner: string;
773
+ repo: string;
774
+ repositoryId: number;
775
+ snapshotContentId: string;
776
+ defaultBranch: string;
777
+ branchName: string;
778
+ },
779
+ ): Promise<{ number: number; htmlUrl: string; headSha: string } | null> {
780
+ const openPulls = await provider.listPullRequests(input.owner, input.repo, {
781
+ state: "open",
782
+ base: input.defaultBranch,
783
+ });
784
+ for (const pull of openPulls) {
785
+ const marker = parseRunnerUpgradePrMarker(pull.body);
786
+ if (
787
+ marker &&
788
+ marker.repositoryId === input.repositoryId &&
789
+ marker.snapshotContentId === input.snapshotContentId
790
+ ) {
791
+ return {
792
+ number: pull.number,
793
+ htmlUrl: pull.htmlUrl,
794
+ headSha: pull.headSha,
795
+ };
796
+ }
797
+ }
798
+ const byBranch = openPulls.find((pull) => pull.headRef === input.branchName);
799
+ if (byBranch) {
800
+ return {
801
+ number: byBranch.number,
802
+ htmlUrl: byBranch.htmlUrl,
803
+ headSha: byBranch.headSha,
804
+ };
805
+ }
806
+ return null;
807
+ }
808
+
809
+ async function buildUpgradeCommitOnBranch(
810
+ provider: RunnerUpgradeGitHubProvider,
811
+ context: ResolvedRunnerUpgradeContext,
812
+ input: {
813
+ operationId: string;
814
+ branchName: string;
815
+ replacePaths: string[];
816
+ deletePaths: string[];
817
+ },
818
+ ): Promise<{ commitSha: string; headSha: string }> {
819
+ const parentSha = context.defaultBranchHead;
820
+ const parentCommit = await provider.getGitCommit(
821
+ context.owner,
822
+ context.repo,
823
+ parentSha,
824
+ );
825
+ const parentTreeSha = parentCommit.tree.sha;
826
+ const manifest = context.packagedSnapshot.manifest;
827
+ const blobShaByPath = new Map<string, string>();
828
+
829
+ for (const filePath of input.replacePaths) {
830
+ const manifestFile = manifest.files.find((file) => file.path === filePath);
831
+ if (!manifestFile) {
832
+ throw new Error(`Packaged snapshot is missing ${filePath}.`);
833
+ }
834
+ const content = await loadWorkspaceSnapshotEntryContent({
835
+ snapshotRoot: context.packagedSnapshot.snapshotRoot,
836
+ path: filePath,
837
+ expectedSha256: manifestFile.sha256,
838
+ });
839
+ const blob = await provider.createGitBlob({
840
+ owner: context.owner,
841
+ repo: context.repo,
842
+ content,
843
+ });
844
+ blobShaByPath.set(filePath, blob.sha);
845
+ }
846
+
847
+ const markerContent = JSON.stringify(
848
+ buildHarnessSnapshotManagedRepoMarker({
849
+ repository: context.repoSlug,
850
+ repositoryId: context.repositoryId,
851
+ manifest,
852
+ snapshotCommitSha: "pending",
853
+ defaultBranch: context.defaultBranch,
854
+ operationId: input.operationId,
855
+ pDevVersion: context.packagedSnapshot.packageVersion,
856
+ }),
857
+ null,
858
+ 2,
859
+ );
860
+ const markerBlob = await provider.createGitBlob({
861
+ owner: context.owner,
862
+ repo: context.repo,
863
+ content: Buffer.from(`${markerContent}\n`, "utf8"),
864
+ });
865
+ blobShaByPath.set(HARNESS_MANAGED_REPO_MARKER_FILE, markerBlob.sha);
866
+
867
+ const treeEntries = [
868
+ ...input.replacePaths.map((filePath) => {
869
+ const manifestFile = manifest.files.find((file) => file.path === filePath);
870
+ return {
871
+ path: filePath,
872
+ mode: manifestFile?.mode ?? "100644",
873
+ type: "blob" as const,
874
+ sha: blobShaByPath.get(filePath)!,
875
+ };
876
+ }),
877
+ ...input.deletePaths.map((filePath) => ({
878
+ path: filePath,
879
+ mode: "100644",
880
+ type: "blob" as const,
881
+ sha: null as unknown as string,
882
+ })),
883
+ {
884
+ path: HARNESS_MANAGED_REPO_MARKER_FILE,
885
+ mode: "100644",
886
+ type: "blob" as const,
887
+ sha: markerBlob.sha,
888
+ },
889
+ ];
890
+
891
+ const tree = await provider.createGitTree({
892
+ owner: context.owner,
893
+ repo: context.repo,
894
+ baseTree: parentTreeSha,
895
+ tree: treeEntries,
896
+ });
897
+
898
+ const commitIdentity = deriveProvisioningCommitIdentity({
899
+ operationId: input.operationId,
900
+ sourceCommit: manifest.sourceCommit,
901
+ });
902
+ const commit = await provider.createGitCommit({
903
+ owner: context.owner,
904
+ repo: context.repo,
905
+ message: `Update p-dev runner to ${manifest.packageVersion}`,
906
+ tree: tree.sha,
907
+ parents: [parentSha],
908
+ author: commitIdentity,
909
+ committer: commitIdentity,
910
+ });
911
+
912
+ let branchHeadSha: string | null = null;
913
+ try {
914
+ const existingRef = await provider.getGitRef(
915
+ context.owner,
916
+ context.repo,
917
+ input.branchName,
918
+ );
919
+ branchHeadSha = existingRef.object.sha;
920
+ } catch {
921
+ branchHeadSha = null;
922
+ }
923
+
924
+ if (branchHeadSha) {
925
+ await provider.updateGitRef({
926
+ owner: context.owner,
927
+ repo: context.repo,
928
+ ref: input.branchName,
929
+ sha: commit.sha,
930
+ expectedSha: branchHeadSha,
931
+ });
932
+ } else if (provider.createGitRef) {
933
+ await provider.createGitRef({
934
+ owner: context.owner,
935
+ repo: context.repo,
936
+ ref: input.branchName,
937
+ sha: commit.sha,
938
+ });
939
+ } else {
940
+ await provider.updateGitRef({
941
+ owner: context.owner,
942
+ repo: context.repo,
943
+ ref: input.branchName,
944
+ sha: commit.sha,
945
+ });
946
+ }
947
+
948
+ return { commitSha: commit.sha, headSha: commit.sha };
949
+ }
950
+
951
+ async function verifyProductionMarker(
952
+ provider: RunnerUpgradeGitHubProvider,
953
+ context: ResolvedRunnerUpgradeContext,
954
+ targetSnapshotContentId: string,
955
+ ): Promise<{ ok: true } | { ok: false; message: string }> {
956
+ const headSha = await provider.getRepositoryDefaultBranchHead(
957
+ context.owner,
958
+ context.repo,
959
+ context.defaultBranch,
960
+ );
961
+ const raw = await provider.readRepositoryFileContent(
962
+ context.owner,
963
+ context.repo,
964
+ HARNESS_MANAGED_REPO_MARKER_FILE,
965
+ headSha,
966
+ );
967
+ if (!raw) {
968
+ return { ok: false, message: "Production marker is missing after merge." };
969
+ }
970
+ const parsed = parseHarnessManagedRepoMarkerJson(raw);
971
+ if (!parsed.ok) {
972
+ return { ok: false, message: parsed.reason };
973
+ }
974
+ const remoteSnapshotContentId =
975
+ parsed.marker.createdFromPackageSnapshot?.snapshotContentId;
976
+ if (remoteSnapshotContentId !== targetSnapshotContentId) {
977
+ return {
978
+ ok: false,
979
+ message: `Production marker snapshotContentId mismatch (expected ${targetSnapshotContentId}, found ${remoteSnapshotContentId ?? "none"}).`,
980
+ };
981
+ }
982
+ const remoteHashes = extractFileHashesFromMarker(parsed.marker);
983
+ if (remoteHashes) {
984
+ const nextHashes = extractFileHashesFromManifest(context.packagedSnapshot.manifest);
985
+ for (const [filePath, expectedHash] of Object.entries(nextHashes)) {
986
+ if (remoteHashes[filePath] !== expectedHash) {
987
+ return {
988
+ ok: false,
989
+ message: `Production marker file hash mismatch for ${filePath}.`,
990
+ };
991
+ }
992
+ }
993
+ }
994
+ return { ok: true };
995
+ }
996
+
997
+ async function pollCanaryRun(
998
+ provider: RunnerUpgradeGitHubProvider,
999
+ input: {
1000
+ owner: string;
1001
+ repo: string;
1002
+ runId: number;
1003
+ pollIntervalMs: number;
1004
+ pollTimeoutMs: number;
1005
+ onHeartbeat?: () => Promise<void>;
1006
+ },
1007
+ ): Promise<{ ok: true; run: { htmlUrl: string } } | { ok: false; message: string }> {
1008
+ const started = Date.now();
1009
+ while (Date.now() - started < input.pollTimeoutMs) {
1010
+ const run = await provider.getWorkflowRun(input.owner, input.repo, input.runId);
1011
+ await input.onHeartbeat?.();
1012
+ if (run.status === "completed") {
1013
+ if (run.conclusion === "success") {
1014
+ return { ok: true, run: { htmlUrl: run.htmlUrl } };
1015
+ }
1016
+ return {
1017
+ ok: false,
1018
+ message: `Configuration canary failed with conclusion ${run.conclusion ?? "unknown"}.`,
1019
+ };
1020
+ }
1021
+ await new Promise((resolve) => setTimeout(resolve, input.pollIntervalMs));
1022
+ }
1023
+ return { ok: false, message: "Configuration canary timed out." };
1024
+ }
1025
+
1026
+ function statusFromPending(
1027
+ pending: RunnerUpgradePendingState,
1028
+ ): RunnerUpgradeStatusResult {
1029
+ if (pending.lastError) {
1030
+ const status: RunnerUpgradeStatus =
1031
+ pending.lastStatus ??
1032
+ (pending.codeUpdateComplete ? "partially_updated" : "failed");
1033
+ return {
1034
+ status,
1035
+ statusLabel: runnerUpgradeStatusLabel(status),
1036
+ pendingOperationId: pending.operationId,
1037
+ pendingPhase: pending.phase,
1038
+ blockedReason: pending.lastError,
1039
+ conflictPaths: pending.conflictPaths,
1040
+ prUrl: pending.prUrl,
1041
+ canaryRunUrl: pending.canaryRunUrl,
1042
+ retryGuidance: pending.codeUpdateComplete
1043
+ ? "Resume the runner upgrade to finish cloud sync or canary."
1044
+ : "Retry or Resume the runner upgrade after reviewing the error.",
1045
+ retryAvailable: true,
1046
+ };
1047
+ }
1048
+ return {
1049
+ status: pending.codeUpdateComplete ? "partially_updated" : "updating",
1050
+ statusLabel: runnerUpgradeStatusLabel(
1051
+ pending.codeUpdateComplete ? "partially_updated" : "updating",
1052
+ ),
1053
+ pendingOperationId: pending.operationId,
1054
+ pendingPhase: pending.phase,
1055
+ prUrl: pending.prUrl,
1056
+ canaryRunUrl: pending.canaryRunUrl,
1057
+ };
1058
+ }
1059
+
1060
+ export interface LoadRunnerUpgradeStatusOptions {
1061
+ signal?: AbortSignal;
1062
+ debugTimings?: boolean;
1063
+ /** Test-only: never resolve after this stage begins. */
1064
+ testHangAfterStage?: RunnerUpgradeStatusStage;
1065
+ /** Override absolute deadline (tests). */
1066
+ overallDeadlineMs?: number;
1067
+ /** Workspace key for aborting prior in-flight status requests. */
1068
+ workspaceKey?: string;
1069
+ }
1070
+
1071
+ async function withCachedIdentityFallback(
1072
+ cwd: string | undefined,
1073
+ result: RunnerUpgradeStatusResult,
1074
+ availableSnapshot?: RunnerUpgradeSnapshotSummary,
1075
+ debugTimings?: boolean,
1076
+ tracker?: RunnerUpgradeStatusStageTracker,
1077
+ ): Promise<RunnerUpgradeStatusResult> {
1078
+ const localManagedRepoEvidence = await hasLocalManagedRepoEvidence(cwd);
1079
+ const cached = await readRunnerUpgradeLastVerifiedIdentity(cwd);
1080
+ tracker?.commit();
1081
+ const base: RunnerUpgradeStatusResult = {
1082
+ ...result,
1083
+ localManagedRepoEvidence,
1084
+ availableSnapshot: result.availableSnapshot ?? availableSnapshot,
1085
+ unresolvedStage: result.unresolvedStage ?? tracker?.unresolvedStage,
1086
+ retryAvailable:
1087
+ result.retryAvailable ??
1088
+ (result.status === "checking" || result.degraded === true),
1089
+ debugTimings: debugTimings ? tracker?.snapshot() : result.debugTimings,
1090
+ };
1091
+ if (base.currentSnapshot || !cached) {
1092
+ return base;
1093
+ }
1094
+ return {
1095
+ ...base,
1096
+ currentSnapshot: lastVerifiedToSnapshotSummary(cached),
1097
+ currentSnapshotCached: true,
1098
+ currentSnapshotVerifiedAt: cached.verifiedAt,
1099
+ };
1100
+ }
1101
+
1102
+ export async function loadRunnerUpgradeStatus(
1103
+ cwd: string | undefined,
1104
+ provider: RunnerUpgradeGitHubProvider,
1105
+ options: LoadRunnerUpgradeStatusOptions = {},
1106
+ ): Promise<RunnerUpgradeStatusResult> {
1107
+ const workspaceKey = options.workspaceKey ?? cwd ?? process.cwd();
1108
+ const { signal, controller } = options.signal
1109
+ ? { signal: options.signal, controller: null }
1110
+ : beginRunnerUpgradeStatusRequest(workspaceKey);
1111
+ const tracker = new RunnerUpgradeStatusStageTracker();
1112
+ const deadlineMs =
1113
+ options.overallDeadlineMs ?? RUNNER_UPGRADE_STATUS_OVERALL_DEADLINE_MS;
1114
+
1115
+ const run = async (requestSignal: AbortSignal): Promise<RunnerUpgradeStatusResult> => {
1116
+ tracker.begin("local_state_reads");
1117
+ throwIfRunnerUpgradeAborted(requestSignal);
1118
+ const pending = await readRunnerUpgradePendingState(cwd);
1119
+ const localManagedRepoEvidence = await hasLocalManagedRepoEvidence(cwd);
1120
+ tracker.end();
1121
+
1122
+ if (pending) {
1123
+ tracker.begin("reconciliation_enqueue");
1124
+ if (
1125
+ !pending.lastError &&
1126
+ !isRunnerUpgradeOperationActive(pending.operationId)
1127
+ ) {
1128
+ // Enqueue only — never await worker/mutex work on the status path.
1129
+ void reconcileAbandonedRunnerUpgrades(cwd);
1130
+ }
1131
+ tracker.end();
1132
+ tracker.begin("status_conversion");
1133
+ const fromPending = statusFromPending(pending);
1134
+ tracker.end();
1135
+ return withCachedIdentityFallback(
1136
+ cwd,
1137
+ {
1138
+ ...fromPending,
1139
+ localManagedRepoEvidence,
1140
+ },
1141
+ undefined,
1142
+ options.debugTimings,
1143
+ tracker,
1144
+ );
1145
+ }
1146
+
1147
+ tracker.begin("embedded_snapshot_identity");
1148
+ throwIfRunnerUpgradeAborted(requestSignal);
1149
+ const packagedSnapshot =
1150
+ await loadPackagedSnapshotIdentityForStatus(requestSignal);
1151
+ tracker.end();
1152
+ const availableSnapshot = packagedSnapshot
1153
+ ? snapshotSummaryFromManifest(packagedSnapshot.manifest)
1154
+ : undefined;
1155
+
1156
+ const checkingTimeout = (
1157
+ unresolvedStage?: RunnerUpgradeStatusStage,
1158
+ blockedReason?: string,
1159
+ ): Promise<RunnerUpgradeStatusResult> =>
1160
+ withCachedIdentityFallback(
1161
+ cwd,
1162
+ {
1163
+ status: "checking",
1164
+ statusLabel: runnerUpgradeStatusLabel("checking"),
1165
+ degraded: true,
1166
+ localManagedRepoEvidence,
1167
+ availableSnapshot,
1168
+ blockedReason:
1169
+ blockedReason ??
1170
+ `runner-upgrade-status overall deadline exceeded after ${deadlineMs}ms.`,
1171
+ retryGuidance:
1172
+ "Retry status shortly. GitHub did not respond within the page-status deadline.",
1173
+ retryAvailable: true,
1174
+ unresolvedStage,
1175
+ },
1176
+ availableSnapshot,
1177
+ options.debugTimings,
1178
+ tracker,
1179
+ );
1180
+
1181
+ return withRunnerUpgradeStatusDeadline(
1182
+ deadlineMs,
1183
+ requestSignal,
1184
+ () => {
1185
+ if (!requestSignal.aborted) {
1186
+ controller?.abort();
1187
+ }
1188
+ },
1189
+ async (deadlineSignal) => {
1190
+ const resolved = await resolveRunnerUpgradeContext(
1191
+ cwd,
1192
+ provider,
1193
+ "status",
1194
+ {
1195
+ signal: deadlineSignal,
1196
+ tracker,
1197
+ testHangAfterStage: options.testHangAfterStage,
1198
+ debugTimings: options.debugTimings,
1199
+ },
1200
+ );
1201
+ if (!resolved.ok) {
1202
+ return withCachedIdentityFallback(
1203
+ cwd,
1204
+ {
1205
+ ...resolved.result,
1206
+ localManagedRepoEvidence,
1207
+ retryAvailable:
1208
+ resolved.result.status === "checking" ||
1209
+ resolved.result.degraded === true,
1210
+ },
1211
+ availableSnapshot,
1212
+ options.debugTimings,
1213
+ tracker,
1214
+ );
1215
+ }
1216
+ const { context } = resolved;
1217
+ tracker.begin("status_conversion");
1218
+ throwIfRunnerUpgradeAborted(deadlineSignal);
1219
+ const currentSnapshot = snapshotSummaryFromManifest(
1220
+ context.marker.createdFromPackageSnapshot
1221
+ ? {
1222
+ ...context.packagedSnapshot.manifest,
1223
+ snapshotContentId:
1224
+ context.marker.createdFromPackageSnapshot.snapshotContentId,
1225
+ packageVersion:
1226
+ context.marker.createdFromPackageSnapshot.packageVersion,
1227
+ sourceCommit:
1228
+ context.marker.createdFromPackageSnapshot.sourceCommit,
1229
+ }
1230
+ : context.packagedSnapshot.manifest,
1231
+ );
1232
+ const verifiedAt = new Date().toISOString();
1233
+ await writeRunnerUpgradeLastVerifiedIdentity(
1234
+ {
1235
+ ...currentSnapshot,
1236
+ verifiedAt,
1237
+ repoSlug: context.repoSlug,
1238
+ },
1239
+ cwd,
1240
+ );
1241
+ tracker.end();
1242
+
1243
+ if (
1244
+ currentSnapshot.snapshotContentId ===
1245
+ availableSnapshot?.snapshotContentId
1246
+ ) {
1247
+ return withCachedIdentityFallback(
1248
+ cwd,
1249
+ {
1250
+ status: "up_to_date",
1251
+ statusLabel: runnerUpgradeStatusLabel("up_to_date"),
1252
+ currentSnapshot,
1253
+ availableSnapshot,
1254
+ localManagedRepoEvidence,
1255
+ currentSnapshotVerifiedAt: verifiedAt,
1256
+ },
1257
+ availableSnapshot,
1258
+ options.debugTimings,
1259
+ tracker,
1260
+ );
1261
+ }
1262
+
1263
+ return withCachedIdentityFallback(
1264
+ cwd,
1265
+ {
1266
+ status: "update_available",
1267
+ statusLabel: runnerUpgradeStatusLabel("update_available"),
1268
+ currentSnapshot,
1269
+ availableSnapshot,
1270
+ localManagedRepoEvidence,
1271
+ currentSnapshotVerifiedAt: verifiedAt,
1272
+ },
1273
+ availableSnapshot,
1274
+ options.debugTimings,
1275
+ tracker,
1276
+ );
1277
+ },
1278
+ (unresolvedStage) => checkingTimeout(unresolvedStage),
1279
+ tracker,
1280
+ );
1281
+ };
1282
+
1283
+ try {
1284
+ return await run(signal);
1285
+ } finally {
1286
+ if (controller) {
1287
+ endRunnerUpgradeStatusRequest(workspaceKey, controller);
1288
+ }
1289
+ }
1290
+ }
1291
+
1292
+ export async function previewRunnerUpgrade(
1293
+ cwd: string | undefined,
1294
+ provider: RunnerUpgradeGitHubProvider,
1295
+ ): Promise<RunnerUpgradePreviewResult> {
1296
+ const resolved = await resolveRunnerUpgradeContext(cwd, provider);
1297
+ if (!resolved.ok) {
1298
+ return {
1299
+ previewFingerprint: "",
1300
+ targetSnapshotContentId: "",
1301
+ phases: ALL_RUNNER_UPGRADE_PHASES,
1302
+ blocked: true,
1303
+ blockedStatus: resolved.result.status,
1304
+ message: resolved.result.blockedReason,
1305
+ impact: {
1306
+ replacePathCount: 0,
1307
+ deletePathCount: 0,
1308
+ sampleReplacePaths: [],
1309
+ sampleDeletePaths: [],
1310
+ },
1311
+ };
1312
+ }
1313
+
1314
+ const compare = await compareUpgradeSnapshots(provider, resolved.context);
1315
+ if (!compare.ok) {
1316
+ return {
1317
+ previewFingerprint: "",
1318
+ targetSnapshotContentId:
1319
+ resolved.context.packagedSnapshot.manifest.snapshotContentId,
1320
+ currentSnapshotContentId:
1321
+ resolved.context.marker.createdFromPackageSnapshot?.snapshotContentId,
1322
+ phases: ALL_RUNNER_UPGRADE_PHASES,
1323
+ blocked: true,
1324
+ blockedStatus: compare.status,
1325
+ conflictPaths: compare.conflictPaths,
1326
+ message: compare.message,
1327
+ impact: {
1328
+ replacePathCount: 0,
1329
+ deletePathCount: 0,
1330
+ sampleReplacePaths: [],
1331
+ sampleDeletePaths: [],
1332
+ },
1333
+ };
1334
+ }
1335
+
1336
+ return {
1337
+ previewFingerprint: compare.previewFingerprint,
1338
+ targetSnapshotContentId:
1339
+ resolved.context.packagedSnapshot.manifest.snapshotContentId,
1340
+ currentSnapshotContentId:
1341
+ resolved.context.marker.createdFromPackageSnapshot?.snapshotContentId,
1342
+ impact: buildImpactSummary({
1343
+ replacePaths: compare.replacePaths,
1344
+ deletePaths: compare.deletePaths,
1345
+ }),
1346
+ phases: ALL_RUNNER_UPGRADE_PHASES,
1347
+ };
1348
+ }
1349
+
1350
+ async function buildAcceptedPendingState(
1351
+ cwd: string | undefined,
1352
+ options: RunnerUpgradeAcceptOptions = {},
1353
+ ): Promise<RunnerUpgradePendingState> {
1354
+ const existing = await readRunnerUpgradePendingState(cwd);
1355
+ if (existing) {
1356
+ const next: RunnerUpgradePendingState = {
1357
+ ...existing,
1358
+ previewFingerprint:
1359
+ options.previewFingerprint ?? existing.previewFingerprint,
1360
+ };
1361
+ if (options.resume || existing.lastError) {
1362
+ delete next.lastError;
1363
+ delete next.lastStatus;
1364
+ }
1365
+ return next;
1366
+ }
1367
+
1368
+ const packagedSnapshot = await loadPackagedSnapshot();
1369
+ if (!packagedSnapshot) {
1370
+ throw new Error("Embedded workspace snapshot is unavailable.");
1371
+ }
1372
+ const { repoSlug } = await resolveHarnessRepository(cwd);
1373
+ let repositoryId = 0;
1374
+ let defaultBranch = "main";
1375
+ try {
1376
+ const localMarkerRaw = await readLocalManagedRepoMarker(cwd);
1377
+ if (localMarkerRaw) {
1378
+ const parsed = parseHarnessManagedRepoMarkerJson(localMarkerRaw);
1379
+ if (parsed.ok) {
1380
+ repositoryId = parsed.marker.repositoryId ?? repositoryId;
1381
+ defaultBranch =
1382
+ parsed.marker.createdFromTemplate?.defaultBranch ?? defaultBranch;
1383
+ }
1384
+ }
1385
+ } catch {
1386
+ // Local marker is optional for accept.
1387
+ }
1388
+
1389
+ return {
1390
+ operationId: randomUUID(),
1391
+ repositoryId,
1392
+ repoSlug,
1393
+ defaultBranch,
1394
+ targetSnapshotContentId: packagedSnapshot.manifest.snapshotContentId,
1395
+ phase: "verifying-managed-repository",
1396
+ startedAt: new Date().toISOString(),
1397
+ previewFingerprint: options.previewFingerprint ?? "",
1398
+ syncInProgress: false,
1399
+ codeUpdateComplete: false,
1400
+ branchName: buildRunnerUpgradeBranchName(
1401
+ packagedSnapshot.manifest.snapshotContentId,
1402
+ ),
1403
+ };
1404
+ }
1405
+
1406
+ /**
1407
+ * Accept an upgrade: write durable pending/progress locally, enqueue the
1408
+ * process-level worker, and return before any remote provider work.
1409
+ */
1410
+ export async function acceptRunnerUpgrade(
1411
+ cwd: string | undefined,
1412
+ options: RunnerUpgradeAcceptOptions = {},
1413
+ ): Promise<{
1414
+ apply: RunnerUpgradeAcceptResult;
1415
+ progress: RunnerUpgradeProgressState;
1416
+ }> {
1417
+ const workspaceDir = cwd ?? process.cwd();
1418
+ return withHarnessRunnerUpgradeMutex(workspaceDir, async () => {
1419
+ const pending = await buildAcceptedPendingState(cwd, options);
1420
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1421
+ const progress = await writeRunnerUpgradeProgressAtomic(
1422
+ {
1423
+ operationId: pending.operationId,
1424
+ phase: pending.phase,
1425
+ phaseStartedAt: new Date().toISOString(),
1426
+ startedAt: pending.startedAt,
1427
+ canaryRunId: pending.canaryRunId,
1428
+ canaryRunUrl: pending.canaryRunUrl,
1429
+ prUrl: pending.prUrl,
1430
+ workerHeartbeatAt: new Date().toISOString(),
1431
+ lastCheckpoint: pending.phase,
1432
+ },
1433
+ cwd,
1434
+ );
1435
+ enqueueRunnerUpgradeOperation(pending.operationId, cwd);
1436
+ return {
1437
+ apply: {
1438
+ operationId: pending.operationId,
1439
+ status: "updating",
1440
+ phase: pending.phase,
1441
+ previewFingerprint: pending.previewFingerprint,
1442
+ message: "Runner upgrade accepted and queued.",
1443
+ },
1444
+ progress,
1445
+ };
1446
+ });
1447
+ }
1448
+
1449
+ /**
1450
+ * Execute a previously accepted upgrade from durable pending state.
1451
+ * Owned by the process-level worker (or sync unit tests via executeInline).
1452
+ */
1453
+ export async function executeRunnerUpgradeOperation(
1454
+ cwd: string | undefined,
1455
+ provider: RunnerUpgradeGitHubProvider,
1456
+ options: RunnerUpgradeApplyOptions = {},
1457
+ ): Promise<RunnerUpgradeApplyResult> {
1458
+ return applyRunnerUpgradeInternal(cwd, provider, options);
1459
+ }
1460
+
1461
+ async function applyRunnerUpgradeInternal(
1462
+ cwd: string | undefined,
1463
+ provider: RunnerUpgradeGitHubProvider,
1464
+ options: RunnerUpgradeApplyOptions = {},
1465
+ ): Promise<RunnerUpgradeApplyResult> {
1466
+ let pending = await readRunnerUpgradePendingState(cwd);
1467
+ const startedAt = pending?.startedAt ?? new Date().toISOString();
1468
+ const operationId = pending?.operationId ?? randomUUID();
1469
+
1470
+ if (!pending) {
1471
+ pending = await buildAcceptedPendingState(cwd, {
1472
+ previewFingerprint: options.previewFingerprint,
1473
+ });
1474
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1475
+ await writeProgress(cwd, pending, pending.phase, {
1476
+ workerHeartbeatAt: new Date().toISOString(),
1477
+ lastSuccessfulProviderCallAt: undefined,
1478
+ });
1479
+ } else {
1480
+ await writeProgress(cwd, pending, pending.phase, {
1481
+ workerHeartbeatAt: new Date().toISOString(),
1482
+ });
1483
+ }
1484
+
1485
+ const resolved = await resolveRunnerUpgradeContext(cwd, provider, "worker");
1486
+ if (!resolved.ok) {
1487
+ pending.lastError = resolved.result.blockedReason;
1488
+ pending.lastStatus = resolved.result.status;
1489
+ pending.phase = "verifying-managed-repository";
1490
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1491
+ await writeProgress(cwd, pending, pending.phase, {
1492
+ retryable: true,
1493
+ errorCode: "verify_managed_repository_failed",
1494
+ });
1495
+ return {
1496
+ operationId,
1497
+ status: resolved.result.status,
1498
+ phase: "verifying-managed-repository",
1499
+ previewFingerprint: pending.previewFingerprint,
1500
+ message: resolved.result.blockedReason,
1501
+ };
1502
+ }
1503
+ const context = resolved.context;
1504
+ if (context.marker.createdFromPackageSnapshot) {
1505
+ await writeRunnerUpgradeLastVerifiedIdentity(
1506
+ {
1507
+ snapshotContentId:
1508
+ context.marker.createdFromPackageSnapshot.snapshotContentId,
1509
+ packageVersion:
1510
+ context.marker.createdFromPackageSnapshot.packageVersion,
1511
+ sourceCommit: context.marker.createdFromPackageSnapshot.sourceCommit,
1512
+ verifiedAt: new Date().toISOString(),
1513
+ repoSlug: context.repoSlug,
1514
+ },
1515
+ cwd,
1516
+ );
1517
+ }
1518
+ pending.repositoryId = context.repositoryId;
1519
+ pending.repoSlug = context.repoSlug;
1520
+ pending.defaultBranch = context.defaultBranch;
1521
+ pending.targetSnapshotContentId =
1522
+ context.packagedSnapshot.manifest.snapshotContentId;
1523
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1524
+ await writeProgress(cwd, pending, pending.phase, {
1525
+ lastSuccessfulProviderCallAt: new Date().toISOString(),
1526
+ workerHeartbeatAt: new Date().toISOString(),
1527
+ });
1528
+
1529
+ if (
1530
+ context.marker.createdFromPackageSnapshot?.snapshotContentId ===
1531
+ context.packagedSnapshot.manifest.snapshotContentId &&
1532
+ !pending.codeUpdateComplete
1533
+ ) {
1534
+ await clearRunnerUpgradePendingState(cwd);
1535
+ return {
1536
+ operationId,
1537
+ status: "up_to_date",
1538
+ phase: "verifying-managed-repository",
1539
+ previewFingerprint: pending.previewFingerprint,
1540
+ message: "Runner is already up to date.",
1541
+ };
1542
+ }
1543
+
1544
+ let compare:
1545
+ | Awaited<ReturnType<typeof compareUpgradeSnapshots>>
1546
+ | null = null;
1547
+ if (!pending.codeUpdateComplete) {
1548
+ pending.phase = "comparing-runner-snapshots";
1549
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1550
+ await writeProgress(cwd, pending, pending.phase, {
1551
+ workerHeartbeatAt: new Date().toISOString(),
1552
+ });
1553
+
1554
+ compare = await compareUpgradeSnapshots(provider, context, {
1555
+ onHeartbeat: async (heartbeat) => {
1556
+ await writeProgress(cwd, pending!, pending!.phase, {
1557
+ workerHeartbeatAt: new Date().toISOString(),
1558
+ lastSuccessfulProviderCallAt: new Date().toISOString(),
1559
+ filesInspected: heartbeat.filesInspected,
1560
+ filesTotal: heartbeat.filesTotal,
1561
+ lastCompletedBatch: heartbeat.lastCompletedBatch,
1562
+ lastCheckpoint: "comparing-runner-snapshots",
1563
+ });
1564
+ },
1565
+ });
1566
+ if (!compare.ok) {
1567
+ pending.phase = "comparing-runner-snapshots";
1568
+ pending.conflictPaths = compare.conflictPaths;
1569
+ pending.lastError = compare.message;
1570
+ pending.syncInProgress = false;
1571
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1572
+ await writeProgress(cwd, pending, pending.phase, {
1573
+ retryable: true,
1574
+ errorCode: compare.status,
1575
+ });
1576
+ return {
1577
+ operationId,
1578
+ status: compare.status,
1579
+ phase: "comparing-runner-snapshots",
1580
+ previewFingerprint: pending.previewFingerprint,
1581
+ message: compare.message,
1582
+ };
1583
+ }
1584
+ if (
1585
+ options.previewFingerprint &&
1586
+ options.previewFingerprint !== compare.previewFingerprint
1587
+ ) {
1588
+ pending.lastError =
1589
+ "Preview fingerprint mismatch; re-run preview before applying.";
1590
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1591
+ await writeProgress(cwd, pending, pending.phase, {
1592
+ retryable: true,
1593
+ errorCode: "preview_fingerprint_mismatch",
1594
+ });
1595
+ return {
1596
+ operationId,
1597
+ status: "failed",
1598
+ phase: "comparing-runner-snapshots",
1599
+ previewFingerprint: compare.previewFingerprint,
1600
+ message: pending.lastError,
1601
+ };
1602
+ }
1603
+ }
1604
+
1605
+ const previewFingerprint =
1606
+ pending.previewFingerprint || compare?.previewFingerprint || "";
1607
+ pending.previewFingerprint = previewFingerprint;
1608
+ const branchName =
1609
+ pending.branchName ??
1610
+ buildRunnerUpgradeBranchName(
1611
+ context.packagedSnapshot.manifest.snapshotContentId,
1612
+ );
1613
+ pending.branchName = branchName;
1614
+ const targetSnapshotContentId =
1615
+ context.packagedSnapshot.manifest.snapshotContentId;
1616
+
1617
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1618
+ await writeProgress(cwd, pending, pending.phase, {
1619
+ lastSuccessfulProviderCallAt: new Date().toISOString(),
1620
+ workerHeartbeatAt: new Date().toISOString(),
1621
+ });
1622
+
1623
+ if (!pending.codeUpdateComplete) {
1624
+ pending.phase = "preparing-upgrade-commit";
1625
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1626
+ await writeProgress(cwd, pending, pending.phase, {
1627
+ workerHeartbeatAt: new Date().toISOString(),
1628
+ });
1629
+
1630
+ const upgradeCommit = await buildUpgradeCommitOnBranch(provider, context, {
1631
+ operationId,
1632
+ branchName,
1633
+ replacePaths: compare!.replacePaths,
1634
+ deletePaths: compare!.deletePaths,
1635
+ });
1636
+ await writeProgress(cwd, pending, pending.phase, {
1637
+ lastSuccessfulProviderCallAt: new Date().toISOString(),
1638
+ workerHeartbeatAt: new Date().toISOString(),
1639
+ });
1640
+
1641
+ pending.phase = "updating-managed-runner";
1642
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1643
+ await writeProgress(cwd, pending, pending.phase);
1644
+
1645
+ let pr = await findExistingUpgradePullRequest(provider, {
1646
+ owner: context.owner,
1647
+ repo: context.repo,
1648
+ repositoryId: context.repositoryId,
1649
+ snapshotContentId: targetSnapshotContentId,
1650
+ defaultBranch: context.defaultBranch,
1651
+ branchName,
1652
+ });
1653
+
1654
+ if (!pr) {
1655
+ const created = await provider.createPullRequest({
1656
+ owner: context.owner,
1657
+ repo: context.repo,
1658
+ title: `Update p-dev runner to ${context.packagedSnapshot.packageVersion}`,
1659
+ head: branchName,
1660
+ base: context.defaultBranch,
1661
+ body: [
1662
+ buildRunnerUpgradePrMarker(context.repositoryId, targetSnapshotContentId),
1663
+ "",
1664
+ `Updates the managed p-dev runner workspace to package ${context.packagedSnapshot.packageVersion}.`,
1665
+ ].join("\n"),
1666
+ });
1667
+ pr = {
1668
+ number: created.number,
1669
+ htmlUrl: created.htmlUrl,
1670
+ headSha: upgradeCommit.headSha,
1671
+ };
1672
+ }
1673
+
1674
+ pending.prUrl = pr.htmlUrl;
1675
+ pending.prNumber = pr.number;
1676
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1677
+ await writeProgress(cwd, pending, pending.phase);
1678
+
1679
+ const latestHeadRef = await provider.getGitRef(
1680
+ context.owner,
1681
+ context.repo,
1682
+ branchName,
1683
+ );
1684
+ const mergeHeadSha = latestHeadRef.object.sha;
1685
+
1686
+ await provider.mergePullRequest(context.owner, context.repo, pr.number, {
1687
+ mergeMethod: "squash",
1688
+ commitTitle: `Update p-dev runner to ${context.packagedSnapshot.packageVersion}`,
1689
+ expectedHeadSha: mergeHeadSha,
1690
+ });
1691
+
1692
+ pending.phase = "verifying-runner-on-production-branch";
1693
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1694
+ await writeProgress(cwd, pending, pending.phase);
1695
+
1696
+ const productionCheck = await verifyProductionMarker(
1697
+ provider,
1698
+ context,
1699
+ targetSnapshotContentId,
1700
+ );
1701
+ if (!productionCheck.ok) {
1702
+ pending.lastError = productionCheck.message;
1703
+ pending.phase = "verifying-runner-on-production-branch";
1704
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1705
+ await writeProgress(cwd, pending, pending.phase);
1706
+ return {
1707
+ operationId,
1708
+ status: "failed",
1709
+ phase: pending.phase,
1710
+ previewFingerprint,
1711
+ prUrl: pending.prUrl,
1712
+ prNumber: pending.prNumber,
1713
+ branchName,
1714
+ message: productionCheck.message,
1715
+ };
1716
+ }
1717
+
1718
+ pending.codeUpdateComplete = true;
1719
+ pending.phase = "synchronizing-cloud-configuration";
1720
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1721
+ await writeProgress(cwd, pending, pending.phase);
1722
+ }
1723
+
1724
+ pending.syncInProgress = true;
1725
+ pending.phase = "synchronizing-cloud-configuration";
1726
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1727
+ await writeProgress(cwd, pending, pending.phase);
1728
+
1729
+ try {
1730
+ const syncResult = await syncHarnessConfigCloudPair({
1731
+ cwd,
1732
+ provider: asRemoteSetupProviderForRunnerUpgrade(provider),
1733
+ harnessRepository: context.repoSlug,
1734
+ });
1735
+ pending.expectedFingerprint = syncResult.fingerprint;
1736
+ } catch (error) {
1737
+ pending.lastError =
1738
+ error instanceof Error ? error.message : "Cloud configuration sync failed.";
1739
+ pending.syncInProgress = false;
1740
+ pending.phase = "synchronizing-cloud-configuration";
1741
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1742
+ await writeProgress(cwd, pending, pending.phase);
1743
+ return {
1744
+ operationId,
1745
+ status: "partially_updated",
1746
+ phase: pending.phase,
1747
+ previewFingerprint,
1748
+ prUrl: pending.prUrl,
1749
+ prNumber: pending.prNumber,
1750
+ branchName,
1751
+ message: pending.lastError,
1752
+ };
1753
+ }
1754
+
1755
+ pending.phase = "running-configuration-canary";
1756
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1757
+ await writeProgress(cwd, pending, pending.phase);
1758
+
1759
+ const canaryOperationId = randomUUID();
1760
+ // GitHub workflow_dispatch returns 204 with no run id — locate by operation id.
1761
+ await provider.dispatchWorkflow(
1762
+ context.owner,
1763
+ context.repo,
1764
+ RUNNER_UPGRADE_CANARY_WORKFLOW_PATH,
1765
+ context.defaultBranch,
1766
+ { [CANARY_OPERATION_ID_INPUT]: canaryOperationId },
1767
+ );
1768
+ const located = await locateCanaryRunByOperationId(provider, {
1769
+ owner: context.owner,
1770
+ repo: context.repo,
1771
+ operationId: canaryOperationId,
1772
+ ref: context.defaultBranch,
1773
+ pollIntervalMs: options.canaryPollIntervalMs ?? DEFAULT_CANARY_POLL_INTERVAL_MS,
1774
+ pollTimeoutMs: Math.min(
1775
+ options.canaryPollTimeoutMs ?? DEFAULT_CANARY_POLL_TIMEOUT_MS,
1776
+ 60_000,
1777
+ ),
1778
+ });
1779
+ if (!located) {
1780
+ pending.lastError = `Could not locate canary workflow run for operation id ${canaryOperationId} after workflow_dispatch (204).`;
1781
+ pending.syncInProgress = false;
1782
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1783
+ await writeProgress(cwd, pending, pending.phase);
1784
+ return {
1785
+ operationId,
1786
+ status: "partially_updated",
1787
+ phase: pending.phase,
1788
+ previewFingerprint,
1789
+ prUrl: pending.prUrl,
1790
+ prNumber: pending.prNumber,
1791
+ branchName,
1792
+ message: pending.lastError,
1793
+ };
1794
+ }
1795
+
1796
+ pending.canaryRunId = String(located.id);
1797
+ const canaryPoll = await pollCanaryRun(provider, {
1798
+ owner: context.owner,
1799
+ repo: context.repo,
1800
+ runId: located.id,
1801
+ pollIntervalMs: options.canaryPollIntervalMs ?? DEFAULT_CANARY_POLL_INTERVAL_MS,
1802
+ pollTimeoutMs: options.canaryPollTimeoutMs ?? DEFAULT_CANARY_POLL_TIMEOUT_MS,
1803
+ onHeartbeat: async () => {
1804
+ await writeProgress(cwd, pending, pending.phase, {
1805
+ lastSuccessfulProviderCallAt: new Date().toISOString(),
1806
+ workerHeartbeatAt: new Date().toISOString(),
1807
+ lastCheckpoint: "running-configuration-canary",
1808
+ });
1809
+ },
1810
+ });
1811
+
1812
+ if (!canaryPoll.ok) {
1813
+ pending.canaryRunUrl =
1814
+ located.htmlUrl ??
1815
+ `https://github.com/${context.owner}/${context.repo}/actions/runs/${located.id}`;
1816
+ pending.lastError = canaryPoll.message;
1817
+ pending.syncInProgress = false;
1818
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1819
+ await writeProgress(cwd, pending, pending.phase);
1820
+ return {
1821
+ operationId,
1822
+ status: "partially_updated",
1823
+ phase: pending.phase,
1824
+ previewFingerprint,
1825
+ prUrl: pending.prUrl,
1826
+ prNumber: pending.prNumber,
1827
+ branchName,
1828
+ canaryRunId: pending.canaryRunId,
1829
+ canaryRunUrl: pending.canaryRunUrl,
1830
+ message: pending.lastError,
1831
+ };
1832
+ }
1833
+
1834
+ pending.canaryRunUrl = canaryPoll.run.htmlUrl;
1835
+ await recordRunnerUpgradeEvidence(
1836
+ {
1837
+ appliedSnapshotContentId: targetSnapshotContentId,
1838
+ appliedAt: new Date().toISOString(),
1839
+ targetSnapshotContentId,
1840
+ repositoryId: context.repositoryId,
1841
+ lastOperationId: operationId,
1842
+ syncInProgress: false,
1843
+ status: "up_to_date",
1844
+ canaryRunUrl: pending.canaryRunUrl,
1845
+ },
1846
+ cwd,
1847
+ );
1848
+ await clearRunnerUpgradePendingState(cwd);
1849
+ await writeRunnerUpgradeProgressAtomic(
1850
+ {
1851
+ operationId,
1852
+ phase: "running-configuration-canary",
1853
+ phaseStartedAt: new Date().toISOString(),
1854
+ startedAt,
1855
+ canaryRunUrl: pending.canaryRunUrl,
1856
+ prUrl: pending.prUrl,
1857
+ recoveryInstruction: "Runner upgrade completed successfully.",
1858
+ },
1859
+ cwd,
1860
+ );
1861
+
1862
+ return {
1863
+ operationId,
1864
+ status: "up_to_date",
1865
+ phase: "running-configuration-canary",
1866
+ previewFingerprint,
1867
+ prUrl: pending.prUrl,
1868
+ prNumber: pending.prNumber,
1869
+ branchName,
1870
+ canaryRunId: pending.canaryRunId,
1871
+ canaryRunUrl: pending.canaryRunUrl,
1872
+ message: "Runner upgrade completed successfully.",
1873
+ };
1874
+ }
1875
+
1876
+ /**
1877
+ * Synchronous apply path for unit tests and inline execution.
1878
+ * Writes durable pending first, then runs the upgrade body under the mutex.
1879
+ * GUI/routes should use acceptRunnerUpgrade + the process worker instead.
1880
+ */
1881
+ export async function applyRunnerUpgrade(
1882
+ cwd: string | undefined,
1883
+ provider: RunnerUpgradeGitHubProvider,
1884
+ options: RunnerUpgradeApplyOptions = {},
1885
+ ): Promise<RunnerUpgradeApplyResult> {
1886
+ const workspaceDir = cwd ?? process.cwd();
1887
+ return withHarnessRunnerUpgradeMutex(workspaceDir, () =>
1888
+ applyRunnerUpgradeInternal(cwd, provider, {
1889
+ ...options,
1890
+ executeInline: true,
1891
+ }),
1892
+ );
1893
+ }
1894
+
1895
+ export async function resumeRunnerUpgrade(
1896
+ cwd: string | undefined,
1897
+ provider: RunnerUpgradeGitHubProvider,
1898
+ options: RunnerUpgradeApplyOptions = {},
1899
+ ): Promise<RunnerUpgradeApplyResult> {
1900
+ const pending = await readRunnerUpgradePendingState(cwd);
1901
+ if (!pending) {
1902
+ return {
1903
+ operationId: randomUUID(),
1904
+ status: "update_available",
1905
+ phase: "verifying-managed-repository",
1906
+ previewFingerprint: "",
1907
+ message: "No pending runner upgrade operation to resume.",
1908
+ };
1909
+ }
1910
+ delete pending.lastError;
1911
+ await writeRunnerUpgradePendingStateAtomic(pending, cwd);
1912
+ return applyRunnerUpgrade(cwd, provider, options);
1913
+ }
1914
+
1915
+ export async function readLocalManagedRepoMarker(
1916
+ cwd?: string,
1917
+ ): Promise<string | null> {
1918
+ const markerPath =
1919
+ process.env.CANARY_MARKER_PATH ??
1920
+ path.join(cwd ?? process.cwd(), HARNESS_MANAGED_REPO_MARKER_FILE);
1921
+ try {
1922
+ return await readFile(markerPath, "utf8");
1923
+ } catch {
1924
+ return null;
1925
+ }
1926
+ }