@overdeck/desktop 0.47.1 → 0.48.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.
- package/drizzle/overdeck/0000_overdeck_init.sql +59 -0
- package/package.json +1 -1
- package/server/{acceptance-criteria-Cd7ZGZCq.js → acceptance-criteria-DmtLDbtt.js} +2 -2
- package/server/{activity-logger-CyteR4JO.js → activity-logger-Co5qljIj.js} +55 -4
- package/server/activity-logger-K7FYGF_z.js +3 -0
- package/server/{advancing-selfheal-DieFp3qi.js → advancing-selfheal-8AR68Asf.js} +6 -6
- package/server/{agent-gc-BMcgTDl7.js → agent-gc-BmYeT6eH.js} +5 -5
- package/server/agent-state-Dq3s84-P.js +3 -0
- package/server/{agent-state-service-DFO6qvHp.js → agent-state-service-DK1Vay1E.js} +1 -1
- package/server/{agent-state-service-BOzQhLjU.js → agent-state-service-rjnzpHDx.js} +6 -6
- package/server/{agent-state-source-Ca_zCaII.js → agent-state-source-Ds968-j6.js} +1 -1
- package/server/{agents-CtACUuVG.js → agents-Dls7tfJH.js} +5 -5
- package/server/agents-IPSa5kzn.js +3 -0
- package/server/{archive-planning-Binfb99i.js → archive-planning-Cq7cyinS.js} +51 -24
- package/server/archive-planning-MbkGCBIY.js +2 -0
- package/server/{artifact-index-jobs-Jn7BGOtV.js → artifact-index-jobs-Dj_8kpTd.js} +3 -3
- package/server/{assemble-DsqK9OAq.js → assemble-BTCmbcfH.js} +20 -13
- package/server/{auto-spawn-consent-BooqhC3L.js → auto-spawn-consent-lXqRJ1Dr.js} +304 -121
- package/server/{backlog-auto-trigger-BADGPxov.js → backlog-auto-trigger-Dn-amzt6.js} +3 -3
- package/server/{behavior-B7biGtFT.js → behavior-DIMQMRzs.js} +2 -2
- package/server/{boot-reconciled-stop-events-bQUzU8ns.js → boot-reconciled-stop-events-D6SeUTIr.js} +1 -1
- package/server/{bridge-pool-patrol-DsPj6F7t.js → bridge-pool-patrol-BEjt-xF3.js} +2 -2
- package/server/{briefing-freshness-CUerZqWd.js → briefing-freshness-3PNmL_p3.js} +2 -2
- package/server/{build-info-D0q_i8WM.js → build-info-CJg813Hm.js} +3 -3
- package/server/{build-info-Du74MKiP.js → build-info-CXyeFsXu.js} +1 -1
- package/server/{checkpoint-manager-Cu-R5Uzg.js → checkpoint-manager-9t7G5c1V.js} +1 -1
- package/server/{checkpoint-manager-R5tnaxEY.js → checkpoint-manager-B2G38R3p.js} +3 -3
- package/server/checkpoint-worker.js +1 -1
- package/server/{checkpoints-wF84ubZ8.js → checkpoints-CuBgiXO-.js} +1 -1
- package/server/{checkpoints-DYtLu-PB.js → checkpoints-VTZMd4Qm.js} +2 -2
- package/server/{claude-hooks-provision-DXI3Wqlm.js → claude-hooks-provision-55SyQaPz.js} +2 -2
- package/server/{claude-hooks-provision-UKxCeOyj.js → claude-hooks-provision-CEUT-CZd.js} +1 -1
- package/server/{claude-permissions-DYVLnX9t.js → claude-permissions-Cn0dIu2i.js} +2 -2
- package/server/{claude-settings-overlay-DxP2F_gY.js → claude-settings-overlay-B19hdzSA.js} +1 -1
- package/server/{claude-settings-overlay-DsbpIq2d.js → claude-settings-overlay-Yg_ANh81.js} +2 -2
- package/server/{cli-DzRKxxP_.js → cli-C9S84iTy.js} +79 -22
- package/server/cli-M1cwZ__d.js +3 -0
- package/server/{cliproxy-CG4meRFc.js → cliproxy-CJq3KXU6.js} +2 -2
- package/server/{cliproxy-Cwzw39yN.js → cliproxy-DgEZlr7Y.js} +1 -1
- package/server/{close-issue-BX1bATJy.js → close-issue-DPxRddGR.js} +5 -5
- package/server/{closed-issue-reaper-hLt0W86J.js → closed-issue-reaper-C5Zn4GRS.js} +13 -13
- package/server/{closed-issue-reaper-DvnTSN6a.js → closed-issue-reaper-D-2B48Ri.js} +1 -1
- package/server/{codex-rnJN3v3_.js → codex-B3n_rkwn.js} +1 -1
- package/server/{codex-BYwi1uyW.js → codex-CjkD1PJu.js} +6 -6
- package/server/{codex-parser-Poyz29GE.js → codex-parser-DpB1Il-P.js} +2 -2
- package/server/{compaction-continuation-DtMfHN0f.js → compaction-continuation-DZD9ukSE.js} +3 -3
- package/server/{config-R793W0yA.js → config-C5saf4Ja.js} +1 -1
- package/server/{config-CX4vk1CV.js → config-DnLJATZk.js} +2 -2
- package/server/{config-ktAVnp4s.js → config-DvM8jtQK.js} +2 -2
- package/server/{config-yaml-CxdwhAIA.js → config-yaml-BSCqwmX0.js} +11299 -10972
- package/server/{conflict-gate-BSTlwCtF.js → conflict-gate-DXa_L28t.js} +1 -1
- package/server/{conflict-gate-BNv6UolH.js → conflict-gate-WfVqgalf.js} +4 -4
- package/server/{context-layers-DCdaGsRG.js → context-layers-D7UqH9Ab.js} +2 -2
- package/server/{context-layers-DlWsDiRF.js → context-layers-Dpz3Vd6d.js} +3 -3
- package/server/{control-settings-qYYHrIqy.js → control-settings-DVf6pKyv.js} +4 -4
- package/server/{conversation-compaction-BxUKObHb.js → conversation-compaction-5XuH6OBn.js} +1 -1
- package/server/{conversation-compaction-CXQrN3I_.js → conversation-compaction-COrbnX1J.js} +8 -8
- package/server/{conversation-service-CZiUE8Uw.js → conversation-service-BufdtnZF.js} +169 -10
- package/server/{conversation-service-CDnQ3ayN.js → conversation-service-DnUyIiLb.js} +1 -1
- package/server/{conversations-D7lR670u.js → conversations-B4rxz-Wl.js} +17 -10
- package/server/{conversations-DXl5YTf4.js → conversations-D1bwxQMy.js} +1 -1
- package/server/{cost-Aat8HfO_.js → cost-CpFDrJUS.js} +46 -2
- package/server/{cost-CWvN9FP2.js → cost-KLuwKCW9.js} +3 -3
- package/server/{cost-sync-DiUBXwl6.js → cost-sync-cesi9dp8.js} +3 -3
- package/server/{dag-5QlmH0oC.js → dag-BYiFMqpU.js} +2 -2
- package/server/{dangerous-git-ops-DWX6Og8c.js → dangerous-git-ops-BKvd3-Hk.js} +1 -1
- package/server/dashboard-db-worker.js +7 -7
- package/server/{deacon-PW_bg4uL.js → deacon-BbsWw8a6.js} +3 -3
- package/server/{deacon-B1LD5cJU.js → deacon-HdEh0Esp.js} +672 -181
- package/server/deacon-event-client-C93rvOT7.js +237 -0
- package/server/deacon-event-client-Ck5Ei7Mn.js +3 -0
- package/server/{deacon-nudge-log-DPHsO14z.js → deacon-nudge-log-BND_97Wo.js} +4 -3
- package/server/{deacon-pending-lifecycle-2ZflPxgo.js → deacon-pending-lifecycle-CD3YsiQK.js} +3 -3
- package/server/deacon-swarm-DgWADWd_.js +2 -0
- package/server/{deacon-swarm-DwGUgSVp.js → deacon-swarm-rqrl4TMs.js} +39 -18
- package/server/deacon.js +12 -210
- package/server/{dead-end-trip-B06RFIr2.js → dead-end-trip-DSF23CLX.js} +4 -3
- package/server/dead-end-trip-zKlS4v6f.js +2 -0
- package/server/delivery-CsbQdZkS.js +3 -0
- package/server/{deploy-patrol-BNjeCL8u.js → deploy-patrol-kARAkji4.js} +17 -21
- package/server/{deploy-queue-CKT_Ia9p.js → deploy-queue-Bj0HJT1i.js} +2 -2
- package/server/{deploy-queue-DMMYhFC8.js → deploy-queue-rjTUy1RM.js} +1 -1
- package/server/{deploy-window-DC8lze3d.js → deploy-window-B2IM-9G5.js} +10 -44
- package/server/{deploy-window-D_AimdNN.js → deploy-window-BNFWnA8D.js} +1 -1
- package/server/{dev-supervisor-C4F0vbno.js → dev-supervisor-B1mZYXz4.js} +2 -2
- package/server/{devcontainer-renderer-66sqMQIi.js → devcontainer-renderer-B-o68Z5B.js} +3 -3
- package/server/{dist-C5FT9lTG.js → dist-3W--cGMa.js} +1 -1
- package/server/dist-BR0QtwmS.js +3 -0
- package/server/{dist-src-B-AlGWSl.js → dist-src-C-Vk2jNk.js} +1 -1
- package/server/{docker-BxrFhTZ_.js → docker-DH3jUYg1.js} +1 -1
- package/server/{docker-CoAT8R0J.js → docker-meuLKLzV.js} +27 -20
- package/server/{dod-Bg6wsKTV.js → dod-D7-9dCOD.js} +1 -1
- package/server/{driver-CKVGi51s.js → driver-CmsY2RLl.js} +1 -1
- package/server/{durable-review-pipeline-D_DcfIGP.js → durable-review-pipeline-CStTgOAf.js} +1 -1
- package/server/{durable-review-pipeline-HkAgnx0L.js → durable-review-pipeline-Chq0lzjL.js} +1 -1
- package/server/{ensure-devcontainer-Bg5HJAcO.js → ensure-devcontainer-BE3llBWP.js} +1 -1
- package/server/{ensure-devcontainer-DTxChVuA.js → ensure-devcontainer-BXrY7C2Z.js} +4 -4
- package/server/{esm-shims-CaBWIR7f.js → esm-shims-Bzy4ZzNU.js} +1 -1
- package/server/event-store-COd2tOx8.js +3 -0
- package/server/{event-store-CrHcVC5_.js → event-store-D_AR-Y78.js} +184 -11
- package/server/{events-ChEFB7Jp.js → events-CCkFWa7X.js} +1 -1
- package/server/{events-DhRN-6vM.js → events-zjDQozet.js} +3 -3
- package/server/{factory-BezSPaTd.js → factory-DhavwKVc.js} +5 -5
- package/server/{feature-registry-population-DhswNiXx.js → feature-registry-population-DWGBKyWd.js} +4 -4
- package/server/{feature-registry-storage-CUVNpAso.js → feature-registry-storage-C5DkXmCM.js} +3 -3
- package/server/{features-B2CfNPFw.js → features-CC47YcCX.js} +2 -2
- package/server/{feedback-target-CMrEAoeA.js → feedback-target-D9Tex35_.js} +1 -1
- package/server/{feedback-target-VBr9gKgX.js → feedback-target-DoRCR3L-.js} +8 -8
- package/server/{feedback-writer-CY91ckuw.js → feedback-writer-CTSuA6lw.js} +1 -1
- package/server/{feedback-writer-xpFgU632.js → feedback-writer-DdsBdtNL.js} +5 -5
- package/server/{flywheel-DsICCjTR.js → flywheel-DHWHzaYK.js} +1 -1
- package/server/{flywheel-DQqsSm7P.js → flywheel-DJQa9az8.js} +14 -14
- package/server/{flywheel-CTVY3yCG.js → flywheel-TacAI9MA.js} +21 -17
- package/server/{flywheel-merge-order-C-TI4JGu.js → flywheel-merge-order-D2foPh88.js} +1 -1
- package/server/{flywheel-merge-order-CMGz-imq.js → flywheel-merge-order-DRtex2Dt.js} +7 -7
- package/server/forge-CdlCG9aS.js +3 -0
- package/server/{forge-RTNqJe6a.js → forge-c8LeC-tw.js} +2 -2
- package/server/{from-DxGcivc9.js → from-BogSwvr2.js} +1 -1
- package/server/{fs-lock-Bre3sGoz.js → fs-lock-D_GeJtXl.js} +3 -3
- package/server/{fts-operations-BuTdlZFA.js → fts-operations-DP9R-8Q3.js} +3 -3
- package/server/{git-utils-CedsVume.js → git-utils-C31x1lpE.js} +1 -1
- package/server/{git-utils-DtdoEXJk.js → git-utils-xQ74FoSn.js} +5 -4
- package/server/{github-app-DIE8BkHI.js → github-app-CpQSDlv8.js} +1 -1
- package/server/{github-app-gVnZcP9B.js → github-app-D2QuvZ3j.js} +3 -3
- package/server/{github-client-BrAC6ELh.js → github-client-D9YvJX5D.js} +3 -3
- package/server/{github-client-CBOkvBUl.js → github-client-Tpi3PmKX.js} +1 -1
- package/server/{github-pr-lookup-CgMULTPf.js → github-pr-lookup-DvBMv-IW.js} +2 -2
- package/server/{harness-binary-CnBHpd57.js → harness-binary-BHxWf_sX.js} +7 -6
- package/server/{harness-resolve-BVj6sI8m.js → harness-resolve-bj9WMABA.js} +4 -4
- package/server/{health-events-BBWO_Dh9.js → health-events-bCDPn59Z.js} +2 -2
- package/server/{health-events-Der6bOkm.js → health-events-qo7Ss34U.js} +1 -1
- package/server/{hooks-BOavco-e.js → hooks-Dyxtg5fk.js} +2 -2
- package/server/{hooks-BJNal-bs.js → hooks-X2XHBB2b.js} +1 -1
- package/server/{hume-DBocJFkA.js → hume-DrZEGpqc.js} +2 -2
- package/server/hume-YPsy4UA8.js +3 -0
- package/server/{idle-stack-reaper-DQFh8rDh.js → idle-stack-reaper-CJ1ygW0p.js} +37 -7
- package/server/{idle-stack-reaper-CyGxXOfC.js → idle-stack-reaper-uJGOb-vu.js} +1 -1
- package/server/{in-flight-guard-nXEKoxI7.js → in-flight-guard-CG2Eo-rr.js} +1 -1
- package/server/{infra-BDQDRopn.js → infra-CTrmVqc_.js} +111 -6
- package/server/{injection-DfFFEMKL.js → injection-BisQ0lpX.js} +1 -1
- package/server/{injection-CCopdUKz.js → injection-C9sxqbc2.js} +73 -193
- package/server/{inspect-agent-FCDlNT_i.js → inspect-agent-BoSO51YC.js} +12 -12
- package/server/inspect-agent-BykeOH4a.js +2 -0
- package/server/{internal-token-BG6yQKNL.js → internal-token-AvXePaQT.js} +2 -2
- package/server/{internal-token-BJZa40Ld.js → internal-token-Djkj-yqK.js} +1 -1
- package/server/{io-C0NV7y6C.js → io-mxOWMZ7I.js} +6 -6
- package/server/{issue-closed-CNNGbhWm.js → issue-closed-Bj_bCv_0.js} +7 -7
- package/server/{issue-lifecycle-DSH0GpWC.js → issue-lifecycle-A5YIpDZE.js} +1 -1
- package/server/{issue-lifecycle-BXfzxFCD.js → issue-lifecycle-BXUqaHzF.js} +32 -28
- package/server/{issue-service-singleton-F3A5VP6M.js → issue-service-singleton-BPNEXczv.js} +11 -11
- package/server/{issue-service-singleton-lwFJ4dHk.js → issue-service-singleton-CcaHjKPR.js} +1 -1
- package/server/{issues-DA-U_MpR.js → issues-AX-YBeAQ.js} +2 -2
- package/server/{jsonl-parser-BXiGANOh.js → jsonl-parser-CgYWQ20q.js} +7 -3
- package/server/kimi-code-BYbme0aV.js +579 -0
- package/server/kimi-code-D_Ppt82c.js +3 -0
- package/server/kimi-parser-B-JBg3Pv.js +147 -0
- package/server/{label-cleanup-BnxRk0Eo.js → label-cleanup-sXUlgdM0.js} +3 -3
- package/server/{lifecycle-DOgGnpIv.js → lifecycle-D2X3al0D.js} +2 -2
- package/server/{lifecycle-Di48-w4x.js → lifecycle-DjlljAZ1.js} +6 -6
- package/server/{lifecycle-io-eVG6v_8-.js → lifecycle-io-C5nVk55o.js} +1 -1
- package/server/{lifecycle-io-1XSeczTr.js → lifecycle-io-NPm1YtIG.js} +5 -5
- package/server/{linear-client-CvGo9n7M.js → linear-client--luYwCZg.js} +1 -1
- package/server/{linear-client-CYZRrcjp.js → linear-client-B8pLegW1.js} +3 -3
- package/server/{linear-mcp-auth-Cp0XaP96.js → linear-mcp-auth-BQVWV0I3.js} +6 -6
- package/server/{linear-mcp-auth-DoJnjdPZ.js → linear-mcp-auth-Dx81Zl4G.js} +1 -1
- package/server/memory-fts-worker.js +1 -1
- package/server/{merge-DO14mOr3.js → merge-Bx5Bh9pi.js} +3 -3
- package/server/{merge-ZF99ig6A.js → merge-Dqmh_zja.js} +1 -1
- package/server/{merge-agent-gpiRkcvj.js → merge-agent-DP9AUY29.js} +33 -33
- package/server/{merge-agent-C1-9zbP_.js → merge-agent-DWd0KfiS.js} +1 -1
- package/server/{merge-batch-C11ocNkO.js → merge-batch-BdmvTEAC.js} +1 -1
- package/server/{merge-completeness-CghMbyX7.js → merge-completeness-BfRwFjRx.js} +1 -1
- package/server/{merge-completeness-BUzPZy0E.js → merge-completeness-C1FevcDT.js} +4 -4
- package/server/merge-ops-B98tKc1e.js +2 -0
- package/server/merge-rebase-BLykMwPO.js +2 -0
- package/server/{merge-rebase-iwlUzZjr.js → merge-rebase-BX1xKsrE.js} +2 -2
- package/server/{merge-set-Dbnx4chw.js → merge-set-DsLjjLEV.js} +4 -4
- package/server/{merge-set-BymrheTj.js → merge-set-H6epHOsw.js} +1 -1
- package/server/{merge-sync-CM978zez.js → merge-sync-BEdfsQV4.js} +2 -2
- package/server/{merge-sync-CqEtqjI2.js → merge-sync-BebcWWGA.js} +1 -1
- package/server/{merge-train-DvLcAn1G.js → merge-train-D1I0lNOT.js} +4 -4
- package/server/{merge-train-deps-Cl_kcRbO.js → merge-train-deps-D_-C0Pk2.js} +4 -4
- package/server/{merge-verification-c9Y9mllw.js → merge-verification-DN1Ov9bU.js} +6 -6
- package/server/{merged-docker-cleanup-worker-CGiDOdv8.js → merged-docker-cleanup-worker-CfXSr2pA.js} +4 -4
- package/server/{merged-docker-cleanup-worker-DgsLOx3E.js → merged-docker-cleanup-worker-ybsPyHjB.js} +1 -1
- package/server/{multipart-parser-D0twwRjz.js → multipart-parser-CL5QG8iv.js} +2 -2
- package/server/{no-resume-mode-DZvP0M_S.js → no-resume-mode-DUR7Hi98.js} +1 -1
- package/server/node_modules/.package-lock.json +7 -7
- package/server/node_modules/brace-expansion/README.md +23 -1
- package/server/node_modules/brace-expansion/index.js +206 -85
- package/server/node_modules/brace-expansion/package.json +1 -1
- package/server/node_modules/msgpackr/dist/index-no-eval.cjs +34 -28
- package/server/node_modules/msgpackr/dist/index-no-eval.cjs.map +1 -1
- package/server/node_modules/msgpackr/dist/index-no-eval.min.js +1 -1
- package/server/node_modules/msgpackr/dist/index-no-eval.min.js.map +1 -1
- package/server/node_modules/msgpackr/dist/index.js +34 -28
- package/server/node_modules/msgpackr/dist/index.js.map +1 -1
- package/server/node_modules/msgpackr/dist/index.min.js +1 -1
- package/server/node_modules/msgpackr/dist/index.min.js.map +1 -1
- package/server/node_modules/msgpackr/dist/node.cjs +36 -29
- package/server/node_modules/msgpackr/dist/node.cjs.map +1 -1
- package/server/node_modules/msgpackr/dist/test.js +63 -32
- package/server/node_modules/msgpackr/dist/test.js.map +1 -1
- package/server/node_modules/msgpackr/dist/unpack-no-eval.cjs +34 -28
- package/server/node_modules/msgpackr/dist/unpack-no-eval.cjs.map +1 -1
- package/server/node_modules/msgpackr/package.json +1 -1
- package/server/node_modules/msgpackr/unpack.js +34 -28
- package/server/{orphan-proposed-reconciler-6r2OEfYd.js → orphan-proposed-reconciler-CEW1maPl.js} +1 -1
- package/server/{orphan-proposed-reconciler-DtQP6oE_.js → orphan-proposed-reconciler-DfqHZftT.js} +23 -22
- package/server/package-lock.json +8 -8
- package/server/package.json +1 -1
- package/server/{pan-dir-DAOb1V2-.js → pan-dir-DhgKfO86.js} +21 -6
- package/server/{paths-DuATV5iE.js → paths-BUuhi6jM.js} +17 -17
- package/server/{pending-lifecycle-claim-DQUHIDfX.js → pending-lifecycle-claim-DJlA1rTR.js} +2 -2
- package/server/{persistent-logger-CBj016pT.js → persistent-logger-s8cbpFNV.js} +2 -2
- package/server/{pickup-zXZl5lQI.js → pickup-2AxtB3dW.js} +1 -1
- package/server/{pipeline-membership-DHOXmvba.js → pipeline-membership-2_okL5bm.js} +1 -1
- package/server/{pipeline-membership-B2yUcBz7.js → pipeline-membership-Dqv6_0ig.js} +1 -1
- package/server/{pipeline-membership-gather-OkLXuvxR.js → pipeline-membership-gather-4F1-tXKI.js} +1 -1
- package/server/{pipeline-membership-gather-BIcJ-N0W.js → pipeline-membership-gather-CtJ_7aGf.js} +149 -17
- package/server/{pipeline-notifier-BmwrVKsO.js → pipeline-notifier-CO9rxJgB.js} +1 -1
- package/server/{pipeline-notifier-CxMes51i.js → pipeline-notifier-DDfVBJhJ.js} +2 -2
- package/server/{post-merge-lifecycle-worker-3u_rA4R0.js → post-merge-lifecycle-worker-DmSOkeNp.js} +3 -3
- package/server/{project-pipelines-C3SPFJ38.js → project-pipelines-72WE8GVK.js} +2 -2
- package/server/{project-repos-BOpBzkO6.js → project-repos-BAqDwtvi.js} +16 -11
- package/server/project-repos-Df90Zw7Y.js +3 -0
- package/server/projects-WqMWCdpa.js +3 -0
- package/server/{prompts-B0TtboFm.js → prompts-XkL10m8M.js} +2 -2
- package/server/{providers-O2smCvSz.js → providers-ClGPGkQ8.js} +15 -12
- package/server/providers-DFUOed8u.js +3 -0
- package/server/public/assets/{chunk-BO2N2NFS-D_pGACYN.js → chunk-BO2N2NFS-CeQUdPxr.js} +4 -4
- package/server/public/assets/{diagram-OG6HWLK6-BO6fe3hH.js → diagram-OG6HWLK6-B7rgk4yT.js} +1 -1
- package/server/public/assets/{dist-5zingMiA.js → dist-2RPazfXY.js} +3 -3
- package/server/public/assets/{dist-CVxhbI2E.js → dist-B9NInrVZ.js} +1 -1
- package/server/public/assets/{ganttDiagram-6RSMTGT7-Bgj4A7kp.js → ganttDiagram-6RSMTGT7-Bxp0gV14.js} +1 -1
- package/server/public/assets/{highlighted-body-OFNGDK62-DNPK7_cm.js → highlighted-body-OFNGDK62-CzoRTVlC.js} +1 -1
- package/server/public/assets/index-Cml-kHo6.css +1 -0
- package/server/public/assets/{index-DEpY-D1O.js → index-CvN8cEgs.js} +216 -215
- package/server/public/assets/{linear-BB0jQT16.js → linear-CFEEl3ND.js} +1 -1
- package/server/public/assets/mermaid-GHXKKRXX-CpV7nCBM.js +1 -0
- package/server/public/assets/{pieDiagram-4H26LBE5-DeGIzzpZ.js → pieDiagram-4H26LBE5-BeR8R0cr.js} +1 -1
- package/server/public/assets/{prod-XBLvikex.js → prod-CYjzjCrn.js} +4 -4
- package/server/public/assets/{quadrantDiagram-W4KKPZXB-BV9SLeWz.js → quadrantDiagram-W4KKPZXB-BpcTkFuW.js} +1 -1
- package/server/public/assets/{sankeyDiagram-5OEKKPKP-Dwja0gj8.js → sankeyDiagram-5OEKKPKP-Bx2ETEV5.js} +1 -1
- package/server/public/assets/{xychartDiagram-2RQKCTM6-DCB4qvfw.js → xychartDiagram-2RQKCTM6-BKgEAFaj.js} +1 -1
- package/server/public/index.html +2 -2
- package/server/{pull-requests-BonZ4WVG.js → pull-requests-B-KrUph5.js} +3 -3
- package/server/{pull-requests-DNcJUVWA.js → pull-requests-DK5k92B4.js} +1 -1
- package/server/{queries-DCX27GRr.js → queries-DVpl1vsU.js} +1212 -193
- package/server/{rally-Cxe7lKYX.js → rally-DbE561hD.js} +3 -3
- package/server/rally-O_st_X7n.js +3 -0
- package/server/{rally-api-CzkKenoi.js → rally-api-CZLeEd2C.js} +2 -2
- package/server/{rally-api-Cp50exEi.js → rally-api-DaHtn5QN.js} +1 -1
- package/server/{rally-client-Bu3Cekkw.js → rally-client-C-MAl8ur.js} +1 -1
- package/server/{rally-client-CyBBEDHu.js → rally-client-Ch3zRsBX.js} +5 -5
- package/server/{reap-terminal-sessions-CtAhr6L0.js → reap-terminal-sessions-C1n0ALRb.js} +2 -2
- package/server/{reap-terminal-sessions-DvFqQUnq.js → reap-terminal-sessions-DegFS2p1.js} +2 -2
- package/server/{rebuild-stack-hCQtprWC.js → rebuild-stack-C9Li44A3.js} +20 -10
- package/server/{rebuild-stack-BKYpIPDL.js → rebuild-stack-qC0jCNm6.js} +2 -2
- package/server/{reconstruct-cache-CF2avArx.js → reconstruct-cache-BHyiAg02.js} +7 -7
- package/server/record-aVzu-LGm.js +3 -0
- package/server/record-update-CZh46a2f.js +617 -0
- package/server/{record-update-DhI7eySG.js → record-update-DtdJK2Iw.js} +1 -1
- package/server/recovery-trip-CSNWSLDn.js +77 -0
- package/server/recovery-trip-_16hFKv4.js +3 -0
- package/server/{release-engine-_eO3VFth.js → release-engine-Be5MX5GP.js} +5 -5
- package/server/{release-set-vxgZwwZV.js → release-set-DJv_O6PS.js} +3 -3
- package/server/{remote-BienmcrZ.js → remote-BMM3uH2J.js} +3 -3
- package/server/{remote-CVPCc7Vy.js → remote-C0xVTHA5.js} +3 -3
- package/server/{remote-agents-kwsEZvXu.js → remote-agents-BIIoc5pD.js} +1 -1
- package/server/{remote-agents-kxraOCGT.js → remote-agents-EUiZ26bj.js} +7 -7
- package/server/{remote-completion-BtmZ42aP.js → remote-completion-BS4tJUn8.js} +13 -13
- package/server/resolver-BvHd6RE4.js +163 -0
- package/server/resume-9thEqAQR.js +3 -0
- package/server/{review-agent-CIRr0yYt.js → review-agent-BHGaBoBu.js} +29 -29
- package/server/{review-agent-UpAM4DmT.js → review-agent-CD3RQ-tc.js} +1 -1
- package/server/{review-artifacts-BCODM9ww.js → review-artifacts-DyhajWso.js} +6 -6
- package/server/{review-context-BBsNrDri.js → review-context-B-dlsPnx.js} +9 -9
- package/server/{review-convoy-liveness-l06_LYCt.js → review-convoy-liveness-D7M-s_nS.js} +2 -2
- package/server/{review-status-CacDM78F.js → review-status-B6wYcOtP.js} +1 -1
- package/server/{review-status-CwhA9wmd.js → review-status-CKLk5aZ-.js} +306 -59
- package/server/{review-status-emit-BPJwYcRy.js → review-status-emit-CJ7UmEVU.js} +3 -3
- package/server/{review-status-enrichment-DvyZAbGR.js → review-status-enrichment-DJRgGX7-.js} +3 -3
- package/server/review-status-limits-4EJDCGHO.js +7 -0
- package/server/{review-status-source-DWnFE0b6.js → review-status-source-7nU3Z2wL.js} +1 -1
- package/server/{review-status-source-B70ekARK.js → review-status-source-BsDYGfyv.js} +1 -1
- package/server/{review-status-sync-B0IS6Beh.js → review-status-sync-BLssMTEW.js} +1 -1
- package/server/{review-status-sync-h2CJX6ju.js → review-status-sync-BxBeHRde.js} +35 -11
- package/server/{review-verdict-feedback-yrrmgps_.js → review-verdict-feedback-5jWuzgpc.js} +22 -10
- package/server/{review-verdict-feedback-qRohbFG2.js → review-verdict-feedback-HRY9P4bN.js} +1 -1
- package/server/{rollup-CUoav0Op.js → rollup-BGIrCEkU.js} +79 -44
- package/server/rollup-CZB4UL9q.js +3 -0
- package/server/{scanner-ChURu_b-.js → scanner-DydjXPrz.js} +16 -9
- package/server/search-DdtIjAiu.js +395 -0
- package/server/{sequence-io-D9ITDxzq.js → sequence-io-Fw-cLyDs.js} +4 -4
- package/server/{sequencer-agent-m7gmaakW.js → sequencer-agent-BcpGMt5x.js} +15 -10
- package/server/server.js +1258 -438
- package/server/{service-BzFG0Us_.js → service-BFFkGsG4.js} +58 -58
- package/server/{session-fork-KBq4HIHF.js → session-fork-D0V-3e5P.js} +2 -2
- package/server/{session-history-C_EMhIIF.js → session-history-Bta5l9jY.js} +5 -5
- package/server/{settings-DejgzzLs.js → settings-Ce8B1daF.js} +2 -2
- package/server/{settings-BLbcDqUp.js → settings-E3FnEIUx.js} +3 -3
- package/server/settings-eOOJpxi_.js +2 -0
- package/server/{shadow-engineering-D8R9I8Yl.js → shadow-engineering-Mt9nJO4i.js} +3 -3
- package/server/{shadow-state-C0Af4clN.js → shadow-state-Bzj_AZCV.js} +1 -1
- package/server/{shadow-state-fzIqIMDD.js → shadow-state-DrkhoVSx.js} +2 -2
- package/server/{shadow-utils-Ugca_9ND.js → shadow-utils-H1GfqP06.js} +2 -2
- package/server/{ship-log-VAv-lHrF.js → ship-log-CFUIo4PR.js} +1 -1
- package/server/{smart-compaction-BcYY_Suf.js → smart-compaction-DSTq-Wua.js} +1 -1
- package/server/{smart-compaction-B2Xu5XEb.js → smart-compaction-Hzp3KCJX.js} +7 -7
- package/server/{spawn-planning-session-Dsv-350T.js → spawn-planning-session-C0uSA2SL.js} +2 -2
- package/server/{spawn-planning-session-DhCoBPct.js → spawn-planning-session-DN4son31.js} +23 -21
- package/server/{specialist-completion-z6v3ZqJE.js → specialist-completion-Cf6tpIh1.js} +1 -1
- package/server/{specialist-context-CrA5azkJ.js → specialist-context-DEUEkjIQ.js} +5 -5
- package/server/{specialist-handoff-logger-CmpZYJMB.js → specialist-handoff-logger-D_LmQDj3.js} +2 -2
- package/server/{specialist-logs-BorrIu0x.js → specialist-logs-7Ynue0R7.js} +3 -3
- package/server/{specialists-ZdrifiKx.js → specialists-CQwBEGlD.js} +1 -1
- package/server/{specialists-2yLmqph9.js → specialists-DAjPgYs_.js} +504 -238
- package/server/{specialists-Dfx9_Wzb.js → specialists-Hr6iW9fU.js} +18 -18
- package/server/{specialists-CH6ah6D-.js → specialists-MOoeB4A8.js} +1 -1
- package/server/specs-Dl88cbKY.js +3 -0
- package/server/{src-B948bGVR.js → src-BYdwL_n-.js} +668 -64
- package/server/{src-Dm_NV7f6.js → src-DQnkPN2i.js} +3 -3
- package/server/{src-B2e5rGu2.js → src-DhfDV0o4.js} +6 -6
- package/server/{stack-health-Bf2WdG4E.js → stack-health-D_iKwNRg.js} +107 -16
- package/server/stack-health-deVSdDwn.js +3 -0
- package/server/{stale-task-claims-D1Ll8fI5.js → stale-task-claims-BYJGqhLI.js} +5 -5
- package/server/{staleness-CuED1Psm.js → staleness-CopBDKnA.js} +1 -1
- package/server/{staleness-45qZ_a60.js → staleness-D8WeMUHd.js} +1 -1
- package/server/{state-home-B4EWfIxF.js → state-home-DjN8qduI.js} +24 -3
- package/server/{state-mapping-BEONzr8P.js → state-mapping-DlM7OYRW.js} +1 -1
- package/server/{state-migrate-Cd8BH33U.js → state-migrate-a2p1gtD7.js} +4 -4
- package/server/state-mirror-Cv_XgvT5.js +121 -0
- package/server/{stuck-remediation-ChcooZuk.js → stuck-remediation-CXJX_kki.js} +1 -1
- package/server/{stuck-remediation-DmY5UJLg.js → stuck-remediation-CbCRSz1v.js} +31 -732
- package/server/{substrate-bug-weights-service-BvTWrFUz.js → substrate-bug-weights-service-DxpopNd9.js} +3 -3
- package/server/{summary-fork--Jr8duYh.js → summary-fork-B61fjRJn.js} +2 -2
- package/server/{summary-fork-Ct514_Jl.js → summary-fork-B9pszUJN.js} +91 -10
- package/server/supervisor/{injection-budget-B3UyEONL.js → injection-budget-Ar7hgyJq.js} +1 -1
- package/server/supervisor/pty-supervisor.js +12 -3
- package/server/supervisor/{pty-token-CWRffcCa.js → pty-token-CXCFU0Z8.js} +1 -1
- package/server/{supervisor-B7BHGcNA.js → supervisor-BvnxbuuF.js} +6 -4
- package/server/supervisor-C69kpqvd.js +2 -0
- package/server/{swarm-readiness-MNE5O8hn.js → swarm-readiness-vTw1kqGa.js} +3 -3
- package/server/{system-prerequisites-Cin9ZgDx.js → system-prerequisites-LLzTEqsK.js} +3 -3
- package/server/{teardown-workspace-CvBpvc85.js → teardown-workspace-CqKKVJr1.js} +15 -15
- package/server/{test-agent-queue-DmSIqays.js → test-agent-queue-CWMq7oyG.js} +8 -7
- package/server/{test-verdict-BieVDAV1.js → test-verdict-NdtgRBuA.js} +1 -1
- package/server/{test-verdict-Cy2jJGTe.js → test-verdict-diIWE6hz.js} +15 -3
- package/server/{tldr-daemon-Ca0eovh3.js → tldr-daemon-B1Jhrtc8.js} +1 -1
- package/server/{tldr-daemon-IOssGwg7.js → tldr-daemon-Bpls1CJB.js} +2 -2
- package/server/{tmux-CfDHob9M.js → tmux-CImZaX4q.js} +10 -16
- package/server/tmux-Cjpx8L8u.js +4 -0
- package/server/{token-B10VFNOD.js → token-Bgpjo3tE.js} +2 -2
- package/server/token-util-BsjFll-k.js +3 -0
- package/server/{token-util-CZ8WPtdk.js → token-util-BymbpkJp.js} +1 -1
- package/server/{tracker-config-CHbrjg6m.js → tracker-config-4DaKVTfc.js} +2 -2
- package/server/{tracker-utils-DZZq_C0R.js → tracker-utils-BDeAXC-q.js} +2 -2
- package/server/{traefik-connect-GHomyBaD.js → traefik-connect-CC5FyxYj.js} +1 -1
- package/server/{tunnel-Dz7y434T.js → tunnel-CDWkeceJ.js} +1 -1
- package/server/{tunnel-Bdyb-sNq.js → tunnel-CPf5M-Pc.js} +3 -3
- package/server/{typed-errors-Bn_2WRU7.js → typed-errors-9K7Dq_Vn.js} +1 -1
- package/server/{typed-errors-BR_RmPS_.js → typed-errors-DrS5fb5z.js} +1 -1
- package/server/{types-D2ETIB8T.js → types-DzlUKiuf.js} +4 -3
- package/server/{types-Dh6RI5Vj.js → types-kI9ik8XO.js} +1 -1
- package/server/{uat-promote-verification-DyvQXvIn.js → uat-promote-verification-c_pxoxEc.js} +5 -5
- package/server/{uat-train-Dv0Bxer7.js → uat-train-CWGxBdJO.js} +0 -0
- package/server/{uat-train-diX_7shd.js → uat-train-CfCYd2ve.js} +1 -1
- package/server/{validate-606KcYZC.js → validate-f3ItVCfm.js} +3 -3
- package/server/{validation-Cf7aaV5A.js → validation-5G_wQtea.js} +1 -1
- package/server/{validation-CnrDul1x.js → validation-7tSiCM82.js} +4 -4
- package/server/{verification-artifact-GOaj8u2s.js → verification-artifact-9h9dH8uX.js} +1 -1
- package/server/{verification-artifact-D4b-bio9.js → verification-artifact-C_4WJnf6.js} +1 -1
- package/server/{verification-runner-DiPaUP-C.js → verification-runner-BV5F6wrA.js} +1 -1
- package/server/{verification-runner-B5MVxDvU.js → verification-runner-D58KmBhK.js} +18 -38
- package/server/{vtt-parser-CMU5EZ5R.js → vtt-parser-2iT9OHa9.js} +1 -1
- package/server/{work-agent-prompt-Csb3fbVR.js → work-agent-prompt-D03s4DD1.js} +9 -9
- package/server/{workflows-D87ajwV6.js → workflows-BMBwLYPV.js} +281 -98
- package/server/workflows-BOmWGpIh.js +2 -0
- package/server/{workspace-iD8oULqu.js → workspace-BgflNCH0.js} +3 -3
- package/server/{workspace-AIOM7n00.js → workspace-Cn9ywfSW.js} +1 -1
- package/server/{workspace-anchor-drift-19cJ1bH5.js → workspace-anchor-drift-C8Fy3shi.js} +1 -1
- package/server/{workspace-anchor-drift-C3mK5wNI.js → workspace-anchor-drift-CMiNncwq.js} +5 -8
- package/server/{workspace-config-CJ7RqQiP.js → workspace-config-aUc2nIz6.js} +1 -1
- package/server/{workspace-manager-CXfrw4rR.js → workspace-manager-Bem7ZBs9.js} +521 -292
- package/server/workspace-manager-C0CpNh3t.js +3 -0
- package/server/{workspace-metadata-BuMRco5P.js → workspace-metadata-C5iSlPRo.js} +1 -1
- package/server/{workspace-metadata-eHSj_NsP.js → workspace-metadata-UKmTYmDQ.js} +2 -2
- package/server/{workspaces-DbtMX2TM.js → workspaces-DqxgwDZ8.js} +143 -113
- package/sync-sources/hooks/notification-hook +12 -1
- package/sync-sources/hooks/pan-hook-lib.sh +226 -0
- package/sync-sources/hooks/session-start-hook +31 -4
- package/sync-sources/hooks/work-agent-stop-hook +23 -1
- package/sync-sources/skills/pan-memory/SKILL.md +19 -3
- package/sync-sources/skills/pan-projects/SKILL.md +9 -0
- package/sync-sources/skills/pan-restart/SKILL.md +26 -7
- package/sync-sources/skills/pan-workspace/SKILL.md +77 -0
- package/server/activity-logger-CMthG6Vd.js +0 -3
- package/server/agent-state-DyZJia9f.js +0 -3
- package/server/agents-Dnn4XgdB.js +0 -3
- package/server/archive-planning-BHCd_eL5.js +0 -2
- package/server/cli-D6mRfUE6.js +0 -3
- package/server/deacon-swarm-BkKR7SXu.js +0 -2
- package/server/delivery-C2M73sBg.js +0 -3
- package/server/dist-qcf9gAP0.js +0 -3
- package/server/event-store-5UKzh9Jf.js +0 -3
- package/server/forge-D647IMNa.js +0 -3
- package/server/fts-db-wROfFfje.js +0 -146
- package/server/hume-DtWN8oV5.js +0 -3
- package/server/inspect-agent-CPqXI81t.js +0 -2
- package/server/merge-ops-7QqziXAh.js +0 -2
- package/server/merge-rebase-B4pgzvQJ.js +0 -2
- package/server/node_modules/brace-expansion/.tap/coverage/8b906b8c-e21f-40b5-8c0d-214d8c2682c5.json +0 -757
- package/server/node_modules/brace-expansion/.tap/processinfo/8b906b8c-e21f-40b5-8c0d-214d8c2682c5.json +0 -719
- package/server/node_modules/brace-expansion/ADVISORY-CVE-2026-14257.md +0 -107
- package/server/node_modules/brace-expansion/dist/commonjs/index.d.ts +0 -8
- package/server/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +0 -1
- package/server/node_modules/brace-expansion/dist/commonjs/index.js +0 -263
- package/server/node_modules/brace-expansion/dist/commonjs/index.js.map +0 -1
- package/server/node_modules/brace-expansion/dist/commonjs/package.json +0 -3
- package/server/node_modules/brace-expansion/dist/esm/index.d.ts +0 -8
- package/server/node_modules/brace-expansion/dist/esm/index.d.ts.map +0 -1
- package/server/node_modules/brace-expansion/dist/esm/index.js +0 -259
- package/server/node_modules/brace-expansion/dist/esm/index.js.map +0 -1
- package/server/node_modules/brace-expansion/dist/esm/package.json +0 -3
- package/server/project-repos-BgW4lcIa.js +0 -3
- package/server/projects-_n3Zui6K.js +0 -3
- package/server/providers-BI1mOBQ4.js +0 -3
- package/server/public/assets/index-Ddkcz3WT.css +0 -1
- package/server/public/assets/mermaid-GHXKKRXX-BzPfaQJ1.js +0 -1
- package/server/rally-x6ztTQo4.js +0 -3
- package/server/record-BTwWhtBb.js +0 -3
- package/server/record-update-DaOKS7Wb.js +0 -277
- package/server/recovery-trip-D-wM9EfB.js +0 -44
- package/server/resume-DXIIfJNk.js +0 -3
- package/server/rollup-DxCjJaAM.js +0 -3
- package/server/settings-9jSGHBPY.js +0 -2
- package/server/specs-DKV3jIEs.js +0 -3
- package/server/stack-health-CoWAhA99.js +0 -3
- package/server/supervisor-CyR_mW5B.js +0 -2
- package/server/tmux-Ctk6RV5l.js +0 -3
- package/server/token-util-CrfQ2FKf.js +0 -3
- package/server/workflows-DN6NyVGd.js +0 -2
- package/server/workspace-manager-B38rFWA1.js +0 -3
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
import { n as __esmMin } from "./rolldown-runtime-DNCzzKnI.js";
|
|
2
|
+
import { Bt as resolveStateReadHomeSync, K as getProjectConfigFromWorkspacePath, Q as readIssueRecordSync, Rt as STATE_BRANCH, St as init_auto_commit, U as getIssueRecordPath, V as ensureIssueRecordSync, Y as queueIssueRecordCommit, et as resolveProjectForIssue, hi as init_paths, mi as getOverdeckHome, ot as writeIssueRecordSync, q as init_record, xt as flushAutoCommits, zt as init_state_read_home } from "./config-yaml-BSCqwmX0.js";
|
|
3
|
+
import { c as init_activity_logger, i as emitActivityEntryOncePortable } from "./activity-logger-Co5qljIj.js";
|
|
4
|
+
import { n as init_fs_lock, o as releaseRecordLock, s as withRecordFsLock, t as acquireRecordLock } from "./fs-lock-D_GeJtXl.js";
|
|
5
|
+
import { basename, dirname, join, relative, resolve } from "node:path";
|
|
6
|
+
import { Effect } from "effect";
|
|
7
|
+
import { hostname } from "node:os";
|
|
8
|
+
import { mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
9
|
+
import { execFile } from "node:child_process";
|
|
10
|
+
import { promisify } from "node:util";
|
|
11
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
12
|
+
//#region ../../lib/pan-dir/state-git-lock.ts
|
|
13
|
+
function stateGitLockPath(gitRoot) {
|
|
14
|
+
const key = createHash("sha256").update(resolve(gitRoot)).digest("hex");
|
|
15
|
+
return join(getOverdeckHome(), "locks", "state-git", `${key}.lock`);
|
|
16
|
+
}
|
|
17
|
+
async function withStateGitLock(gitRoot, writerId, recordPath, operation) {
|
|
18
|
+
const key = resolve(gitRoot);
|
|
19
|
+
const prior = processQueues$1.get(key) ?? Promise.resolve();
|
|
20
|
+
let releaseQueue;
|
|
21
|
+
const gate = new Promise((resolveGate) => {
|
|
22
|
+
releaseQueue = resolveGate;
|
|
23
|
+
});
|
|
24
|
+
const tail = prior.catch(() => void 0).then(() => gate);
|
|
25
|
+
processQueues$1.set(key, tail);
|
|
26
|
+
await prior.catch(() => void 0);
|
|
27
|
+
const lockPath = stateGitLockPath(gitRoot);
|
|
28
|
+
try {
|
|
29
|
+
await acquireRecordLock(lockPath, {
|
|
30
|
+
writerId,
|
|
31
|
+
recordPath,
|
|
32
|
+
retryDelaysMs: STATE_GIT_LOCK_RETRY_DELAYS_MS
|
|
33
|
+
});
|
|
34
|
+
try {
|
|
35
|
+
return await operation();
|
|
36
|
+
} finally {
|
|
37
|
+
await releaseRecordLock(lockPath);
|
|
38
|
+
}
|
|
39
|
+
} finally {
|
|
40
|
+
releaseQueue();
|
|
41
|
+
if (processQueues$1.get(key) === tail) processQueues$1.delete(key);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
var STATE_GIT_LOCK_RETRY_DELAYS_MS, processQueues$1;
|
|
45
|
+
var init_state_git_lock = __esmMin((() => {
|
|
46
|
+
init_paths();
|
|
47
|
+
init_fs_lock();
|
|
48
|
+
STATE_GIT_LOCK_RETRY_DELAYS_MS = [
|
|
49
|
+
10,
|
|
50
|
+
20,
|
|
51
|
+
40,
|
|
52
|
+
80,
|
|
53
|
+
160,
|
|
54
|
+
320,
|
|
55
|
+
640,
|
|
56
|
+
1280,
|
|
57
|
+
2560,
|
|
58
|
+
5120,
|
|
59
|
+
10240,
|
|
60
|
+
10240
|
|
61
|
+
];
|
|
62
|
+
processQueues$1 = /* @__PURE__ */ new Map();
|
|
63
|
+
}));
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region ../../lib/pan-dir/push-health.ts
|
|
66
|
+
function defaultPushHealth() {
|
|
67
|
+
return { consecutiveReconcileFailures: 0 };
|
|
68
|
+
}
|
|
69
|
+
function pushHealthPath(project) {
|
|
70
|
+
const stateWorktreeName = basename(resolveStateReadHomeSync(project).root);
|
|
71
|
+
return join(getOverdeckHome(), "push-health", `${stateWorktreeName}.json`);
|
|
72
|
+
}
|
|
73
|
+
function normalizePendingEscalation(value) {
|
|
74
|
+
if (!value || typeof value !== "object") return void 0;
|
|
75
|
+
const candidate = value;
|
|
76
|
+
if (typeof candidate.id !== "string" || typeof candidate.issueId !== "string" || !Number.isInteger(candidate.failureCount) || Number(candidate.failureCount) < 3 || typeof candidate.reason !== "string" || !Array.isArray(candidate.conflictedPaths) || typeof candidate.createdAt !== "string") return;
|
|
77
|
+
return {
|
|
78
|
+
id: candidate.id,
|
|
79
|
+
issueId: candidate.issueId,
|
|
80
|
+
failureCount: Number(candidate.failureCount),
|
|
81
|
+
reason: candidate.reason,
|
|
82
|
+
conflictedPaths: candidate.conflictedPaths.filter((path) => typeof path === "string"),
|
|
83
|
+
createdAt: candidate.createdAt
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function normalizePushHealth(value) {
|
|
87
|
+
if (!value || typeof value !== "object") return defaultPushHealth();
|
|
88
|
+
const candidate = value;
|
|
89
|
+
const health = { consecutiveReconcileFailures: Number.isInteger(candidate.consecutiveReconcileFailures) && Number(candidate.consecutiveReconcileFailures) >= 0 ? Number(candidate.consecutiveReconcileFailures) : 0 };
|
|
90
|
+
if (typeof candidate.lastFailureAt === "string") health.lastFailureAt = candidate.lastFailureAt;
|
|
91
|
+
if (typeof candidate.lastFailureReason === "string") health.lastFailureReason = candidate.lastFailureReason;
|
|
92
|
+
if (Array.isArray(candidate.lastConflictedPaths)) health.lastConflictedPaths = candidate.lastConflictedPaths.filter((path) => typeof path === "string");
|
|
93
|
+
if (typeof candidate.lastSuccessAt === "string") health.lastSuccessAt = candidate.lastSuccessAt;
|
|
94
|
+
const pendingEscalation = normalizePendingEscalation(candidate.pendingEscalation);
|
|
95
|
+
if (pendingEscalation) health.pendingEscalation = pendingEscalation;
|
|
96
|
+
return health;
|
|
97
|
+
}
|
|
98
|
+
function readPushHealth(project) {
|
|
99
|
+
try {
|
|
100
|
+
return normalizePushHealth(JSON.parse(readFileSync(pushHealthPath(project), "utf8")));
|
|
101
|
+
} catch {
|
|
102
|
+
return defaultPushHealth();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function writePushHealth(project, health) {
|
|
106
|
+
const path = pushHealthPath(project);
|
|
107
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
108
|
+
const temporaryPath = `${path}.${process.pid}.${Date.now()}.${temporaryFileSequence++}.tmp`;
|
|
109
|
+
try {
|
|
110
|
+
writeFileSync(temporaryPath, `${JSON.stringify(health, null, 2)}\n`);
|
|
111
|
+
renameSync(temporaryPath, path);
|
|
112
|
+
} finally {
|
|
113
|
+
rmSync(temporaryPath, { force: true });
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
async function withPushHealthLock(project, operation) {
|
|
117
|
+
const path = pushHealthPath(project);
|
|
118
|
+
const key = resolve(path);
|
|
119
|
+
const prior = processQueues.get(key) ?? Promise.resolve();
|
|
120
|
+
let releaseQueue;
|
|
121
|
+
const gate = new Promise((resolveGate) => {
|
|
122
|
+
releaseQueue = resolveGate;
|
|
123
|
+
});
|
|
124
|
+
const tail = prior.catch(() => void 0).then(() => gate);
|
|
125
|
+
processQueues.set(key, tail);
|
|
126
|
+
await prior.catch(() => void 0);
|
|
127
|
+
const lockPath = `${path}.lock`;
|
|
128
|
+
try {
|
|
129
|
+
await acquireRecordLock(lockPath, {
|
|
130
|
+
writerId: `push-health:${process.pid}`,
|
|
131
|
+
recordPath: path,
|
|
132
|
+
retryDelaysMs: STATE_GIT_LOCK_RETRY_DELAYS_MS
|
|
133
|
+
});
|
|
134
|
+
try {
|
|
135
|
+
return operation();
|
|
136
|
+
} finally {
|
|
137
|
+
await releaseRecordLock(lockPath);
|
|
138
|
+
}
|
|
139
|
+
} finally {
|
|
140
|
+
releaseQueue();
|
|
141
|
+
if (processQueues.get(key) === tail) processQueues.delete(key);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
async function recordReconcileFailure(project, failure) {
|
|
145
|
+
return withPushHealthLock(project, () => {
|
|
146
|
+
const previous = readPushHealth(project);
|
|
147
|
+
const consecutiveReconcileFailures = previous.consecutiveReconcileFailures + 1;
|
|
148
|
+
const lastFailureAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
149
|
+
const pendingEscalation = previous.pendingEscalation ?? (consecutiveReconcileFailures === 3 ? {
|
|
150
|
+
id: randomUUID(),
|
|
151
|
+
issueId: failure.issueId,
|
|
152
|
+
failureCount: consecutiveReconcileFailures,
|
|
153
|
+
reason: failure.reason,
|
|
154
|
+
conflictedPaths: [...failure.conflictedPaths],
|
|
155
|
+
createdAt: lastFailureAt
|
|
156
|
+
} : void 0);
|
|
157
|
+
const health = {
|
|
158
|
+
...previous,
|
|
159
|
+
consecutiveReconcileFailures,
|
|
160
|
+
lastFailureAt,
|
|
161
|
+
lastFailureReason: failure.reason,
|
|
162
|
+
lastConflictedPaths: [...failure.conflictedPaths],
|
|
163
|
+
...pendingEscalation ? { pendingEscalation } : {}
|
|
164
|
+
};
|
|
165
|
+
writePushHealth(project, health);
|
|
166
|
+
return {
|
|
167
|
+
health,
|
|
168
|
+
crossedThreshold: consecutiveReconcileFailures === 3
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
async function recordReconcileSuccess(project) {
|
|
173
|
+
return withPushHealthLock(project, () => {
|
|
174
|
+
const health = {
|
|
175
|
+
...readPushHealth(project),
|
|
176
|
+
consecutiveReconcileFailures: 0,
|
|
177
|
+
lastSuccessAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
178
|
+
};
|
|
179
|
+
writePushHealth(project, health);
|
|
180
|
+
return health;
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
async function markPushEscalationDelivered(project, escalationId) {
|
|
184
|
+
await withPushHealthLock(project, () => {
|
|
185
|
+
const current = readPushHealth(project);
|
|
186
|
+
if (current.pendingEscalation?.id !== escalationId) return;
|
|
187
|
+
const { pendingEscalation: _delivered, ...health } = current;
|
|
188
|
+
writePushHealth(project, health);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
var processQueues, temporaryFileSequence;
|
|
192
|
+
var init_push_health = __esmMin((() => {
|
|
193
|
+
init_paths();
|
|
194
|
+
init_state_read_home();
|
|
195
|
+
init_fs_lock();
|
|
196
|
+
init_state_git_lock();
|
|
197
|
+
processQueues = /* @__PURE__ */ new Map();
|
|
198
|
+
temporaryFileSequence = 0;
|
|
199
|
+
}));
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region ../../lib/pan-dir/record-update.ts
|
|
202
|
+
/** The single locked read-modify-write door for per-issue records. */
|
|
203
|
+
function recordDurabilityBudgetMs() {
|
|
204
|
+
const parsed = Number(process.env.OVERDECK_RECORD_DURABILITY_BUDGET_MS);
|
|
205
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_RECORD_DURABILITY_BUDGET_MS;
|
|
206
|
+
}
|
|
207
|
+
async function withRecordDurabilityDeadline(issueId, promise, deadlineMs, budgetMs, onTimeout) {
|
|
208
|
+
const remaining = deadlineMs - Date.now();
|
|
209
|
+
if (remaining <= 0) {
|
|
210
|
+
await onTimeout?.().catch(() => void 0);
|
|
211
|
+
throw new RecordDurabilityTimeoutError(issueId, budgetMs);
|
|
212
|
+
}
|
|
213
|
+
return await new Promise((resolve, reject) => {
|
|
214
|
+
let settled = false;
|
|
215
|
+
let timingOut = false;
|
|
216
|
+
const timer = setTimeout(() => {
|
|
217
|
+
timingOut = true;
|
|
218
|
+
(onTimeout?.() ?? Promise.resolve()).catch(() => void 0).finally(() => {
|
|
219
|
+
settled = true;
|
|
220
|
+
reject(new RecordDurabilityTimeoutError(issueId, budgetMs));
|
|
221
|
+
});
|
|
222
|
+
}, remaining);
|
|
223
|
+
timer.unref?.();
|
|
224
|
+
promise.then((value) => {
|
|
225
|
+
if (settled || timingOut) return;
|
|
226
|
+
settled = true;
|
|
227
|
+
clearTimeout(timer);
|
|
228
|
+
resolve(value);
|
|
229
|
+
}, (error) => {
|
|
230
|
+
if (settled || timingOut) return;
|
|
231
|
+
settled = true;
|
|
232
|
+
clearTimeout(timer);
|
|
233
|
+
reject(error);
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
function updateIssueRecordForWorkspace(workspacePath, issueId, mutator, options = {}) {
|
|
238
|
+
return updateIssueRecord(resolveProjectForIssue(issueId) ?? getProjectConfigFromWorkspacePath(workspacePath), issueId, mutator, options);
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Clear the terminal close-out marker so a reopened issue re-enters the pipeline (sync).
|
|
242
|
+
* Ordinary status writes deliberately preserve closedOut (projectPipeline in records.ts),
|
|
243
|
+
* so reopen needs this explicit inverse of markRecordPipelineClosedOutSync in record.ts
|
|
244
|
+
* (MIN-850, 2026-07-24).
|
|
245
|
+
*/
|
|
246
|
+
function clearRecordPipelineClosedOutSync(project, issueId) {
|
|
247
|
+
const record = ensureIssueRecordSync(project, issueId);
|
|
248
|
+
if (!record.pipeline.closedOut && !record.pipeline.closedOutAt) return;
|
|
249
|
+
record.pipeline.closedOut = void 0;
|
|
250
|
+
record.pipeline.closedOutAt = void 0;
|
|
251
|
+
record.pipeline.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
252
|
+
queueIssueRecordCommit(project, issueId, writeIssueRecordSync(project, issueId, record));
|
|
253
|
+
}
|
|
254
|
+
async function git(gitRoot, args, options = {}) {
|
|
255
|
+
return (await execFileAsync("git", args, {
|
|
256
|
+
cwd: gitRoot,
|
|
257
|
+
encoding: "utf8",
|
|
258
|
+
timeout: options.timeoutMs ?? 3e4,
|
|
259
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
260
|
+
env: {
|
|
261
|
+
...process.env,
|
|
262
|
+
HUSKY: "0"
|
|
263
|
+
},
|
|
264
|
+
...options.signal ? { signal: options.signal } : {}
|
|
265
|
+
})).stdout.trim();
|
|
266
|
+
}
|
|
267
|
+
function throwIfDurabilityAborted(signal) {
|
|
268
|
+
if (signal?.aborted) throw new Error("Record durability operation aborted at the deadline");
|
|
269
|
+
}
|
|
270
|
+
function gitFailureMessage(error) {
|
|
271
|
+
if (error && typeof error === "object") {
|
|
272
|
+
const failure = error;
|
|
273
|
+
return failure.stderr?.trim() || failure.stdout?.trim() || failure.message;
|
|
274
|
+
}
|
|
275
|
+
return String(error);
|
|
276
|
+
}
|
|
277
|
+
function isRemoteRefRaceError(message) {
|
|
278
|
+
return /non-fast-forward|fetch first|stale info|cannot lock ref.*expected|failed to update ref/i.test(message);
|
|
279
|
+
}
|
|
280
|
+
function porcelainPaths(status) {
|
|
281
|
+
return status.split("\n").map((line) => line.trimEnd()).filter(Boolean).map((line) => line[2] === " " ? line.slice(3) : line[1] === " " ? line.slice(2) : line).map((path) => path.includes(" -> ") ? path.split(" -> ").at(-1) : path).map((path) => path.replace(/\\/g, "/"));
|
|
282
|
+
}
|
|
283
|
+
function isOwnedStatePath(path) {
|
|
284
|
+
return path.startsWith("specs/") || path.startsWith("records/");
|
|
285
|
+
}
|
|
286
|
+
async function adoptOrphanedStateWrites(gitRoot, signal) {
|
|
287
|
+
const paths = porcelainPaths(await git(gitRoot, [
|
|
288
|
+
"status",
|
|
289
|
+
"--porcelain=v1",
|
|
290
|
+
"--untracked-files=all"
|
|
291
|
+
], { signal }));
|
|
292
|
+
if (paths.length === 0) return;
|
|
293
|
+
const unowned = paths.filter((path) => !isOwnedStatePath(path));
|
|
294
|
+
if (unowned.length > 0) throw new Error(`State reconcile blocked by unowned changes: ${unowned.join(", ")}`);
|
|
295
|
+
throwIfDurabilityAborted(signal);
|
|
296
|
+
await git(gitRoot, [
|
|
297
|
+
"add",
|
|
298
|
+
"--",
|
|
299
|
+
"specs",
|
|
300
|
+
"records"
|
|
301
|
+
], { signal });
|
|
302
|
+
throwIfDurabilityAborted(signal);
|
|
303
|
+
await git(gitRoot, [
|
|
304
|
+
"commit",
|
|
305
|
+
"-m",
|
|
306
|
+
"chore(state): adopt orphaned write before state reconcile (PAN-3296)",
|
|
307
|
+
"--",
|
|
308
|
+
"specs",
|
|
309
|
+
"records"
|
|
310
|
+
], { signal });
|
|
311
|
+
console.warn(`[record-update] adopted orphaned state write(s): ${paths.join(", ")}`);
|
|
312
|
+
}
|
|
313
|
+
async function abortRebase(gitRoot, options = {}) {
|
|
314
|
+
try {
|
|
315
|
+
await git(gitRoot, ["rebase", "--abort"], {
|
|
316
|
+
timeoutMs: 5e3,
|
|
317
|
+
...options
|
|
318
|
+
});
|
|
319
|
+
} catch {}
|
|
320
|
+
}
|
|
321
|
+
async function abortMerge(gitRoot, options = {}) {
|
|
322
|
+
try {
|
|
323
|
+
await git(gitRoot, ["merge", "--abort"], {
|
|
324
|
+
timeoutMs: 5e3,
|
|
325
|
+
...options
|
|
326
|
+
});
|
|
327
|
+
} catch {}
|
|
328
|
+
}
|
|
329
|
+
async function resolveMergeConflicts(project, issueId, mutator, gitRoot, recordPath, mergeError, signal) {
|
|
330
|
+
const relativeRecordPath = relative(gitRoot, recordPath).replace(/\\/g, "/");
|
|
331
|
+
const conflicts = (await git(gitRoot, [
|
|
332
|
+
"diff",
|
|
333
|
+
"--name-only",
|
|
334
|
+
"--diff-filter=U"
|
|
335
|
+
], { signal })).split("\n").map((path) => path.trim()).filter(Boolean);
|
|
336
|
+
if (conflicts.length === 0) throw new Error(gitFailureMessage(mergeError));
|
|
337
|
+
try {
|
|
338
|
+
const nonRecordConflicts = conflicts.filter((path) => !path.startsWith("records/"));
|
|
339
|
+
if (nonRecordConflicts.length > 0) throw new Error(`state merge conflicted outside records/: ${nonRecordConflicts.join(", ")}`);
|
|
340
|
+
for (const conflictPath of conflicts) {
|
|
341
|
+
await git(gitRoot, [
|
|
342
|
+
"checkout",
|
|
343
|
+
"--theirs",
|
|
344
|
+
"--",
|
|
345
|
+
conflictPath
|
|
346
|
+
], { signal });
|
|
347
|
+
await git(gitRoot, [
|
|
348
|
+
"add",
|
|
349
|
+
"--",
|
|
350
|
+
conflictPath
|
|
351
|
+
], { signal });
|
|
352
|
+
}
|
|
353
|
+
throwIfDurabilityAborted(signal);
|
|
354
|
+
if (conflicts.includes(relativeRecordPath)) {
|
|
355
|
+
const remoteRecord = readIssueRecordSync(project, issueId);
|
|
356
|
+
if (!remoteRecord) throw new Error(`Remote ${issueId} state record is unreadable`);
|
|
357
|
+
const result = await mutator(remoteRecord);
|
|
358
|
+
throwIfDurabilityAborted(signal);
|
|
359
|
+
writeIssueRecordSync(project, issueId, result ?? remoteRecord);
|
|
360
|
+
await git(gitRoot, [
|
|
361
|
+
"add",
|
|
362
|
+
"--",
|
|
363
|
+
relativeRecordPath
|
|
364
|
+
], { signal });
|
|
365
|
+
}
|
|
366
|
+
throwIfDurabilityAborted(signal);
|
|
367
|
+
await git(gitRoot, [
|
|
368
|
+
"-c",
|
|
369
|
+
"core.editor=true",
|
|
370
|
+
"commit",
|
|
371
|
+
"--no-edit"
|
|
372
|
+
], { signal });
|
|
373
|
+
} catch (error) {
|
|
374
|
+
if (error instanceof StateMergeConflictError) throw error;
|
|
375
|
+
throw new StateMergeConflictError(gitFailureMessage(error), conflicts);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
async function restoreRetryableRecord(project, issueId, original, recordPath, signal) {
|
|
379
|
+
const stateHome = resolveStateReadHomeSync(project);
|
|
380
|
+
const gitRoot = stateHome.root;
|
|
381
|
+
const relativeRecordPath = relative(gitRoot, recordPath).replace(/\\/g, "/");
|
|
382
|
+
await abortRebase(gitRoot, { signal });
|
|
383
|
+
await abortMerge(gitRoot, { signal });
|
|
384
|
+
let restored = structuredClone(original);
|
|
385
|
+
const branch = stateHome.migrated ? STATE_BRANCH : await git(gitRoot, ["branch", "--show-current"], { signal });
|
|
386
|
+
try {
|
|
387
|
+
await git(gitRoot, [
|
|
388
|
+
"fetch",
|
|
389
|
+
"origin",
|
|
390
|
+
branch
|
|
391
|
+
], { signal });
|
|
392
|
+
restored = JSON.parse(await git(gitRoot, ["show", `origin/${branch}:${relativeRecordPath}`], { signal }));
|
|
393
|
+
} catch (fetchError) {
|
|
394
|
+
throwIfDurabilityAborted(signal);
|
|
395
|
+
}
|
|
396
|
+
throwIfDurabilityAborted(signal);
|
|
397
|
+
writeIssueRecordSync(project, issueId, restored);
|
|
398
|
+
await git(gitRoot, [
|
|
399
|
+
"add",
|
|
400
|
+
"--",
|
|
401
|
+
relativeRecordPath
|
|
402
|
+
], { signal });
|
|
403
|
+
try {
|
|
404
|
+
await git(gitRoot, [
|
|
405
|
+
"diff",
|
|
406
|
+
"--cached",
|
|
407
|
+
"--quiet",
|
|
408
|
+
"--",
|
|
409
|
+
relativeRecordPath
|
|
410
|
+
], { signal });
|
|
411
|
+
return;
|
|
412
|
+
} catch (diffError) {
|
|
413
|
+
throwIfDurabilityAborted(signal);
|
|
414
|
+
}
|
|
415
|
+
await git(gitRoot, [
|
|
416
|
+
"commit",
|
|
417
|
+
"-m",
|
|
418
|
+
`chore(records): restore ${issueId} after failed state push`,
|
|
419
|
+
"--",
|
|
420
|
+
relativeRecordPath
|
|
421
|
+
], { signal });
|
|
422
|
+
}
|
|
423
|
+
async function deliverPendingEscalation(project, escalation) {
|
|
424
|
+
if (!escalation) return;
|
|
425
|
+
const outcome = await emitActivityEntryOncePortable({
|
|
426
|
+
id: escalation.id,
|
|
427
|
+
source: "state-door",
|
|
428
|
+
level: "error",
|
|
429
|
+
issueId: escalation.issueId,
|
|
430
|
+
message: `State pushes for ${project.name} have failed ${escalation.failureCount} times in a row and automatic reconciliation cannot resolve them.`,
|
|
431
|
+
details: `Conflicted paths: ${escalation.conflictedPaths.join(", ") || "unknown"}. The overdeck-state branch is diverging from origin; run "pan doctor" to see ahead/behind counts, then resolve the conflicted files manually (git merge origin/overdeck-state in the state worktree). Until resolved, durable state written on this machine does not reach other machines.`
|
|
432
|
+
});
|
|
433
|
+
if (outcome === "appended" || outcome === "duplicate") await markPushEscalationDelivered(project, escalation.id);
|
|
434
|
+
else console.warn(`[pan-dir/records] State reconcile escalation ${escalation.id} remains pending after activity delivery returned ${outcome}`);
|
|
435
|
+
}
|
|
436
|
+
async function attemptPendingEscalationDelivery(project, escalation) {
|
|
437
|
+
if (!escalation) return;
|
|
438
|
+
let timer;
|
|
439
|
+
try {
|
|
440
|
+
const delivered = deliverPendingEscalation(project, escalation).then(() => true);
|
|
441
|
+
if (!await Promise.race([delivered, new Promise((resolveTimeout) => {
|
|
442
|
+
timer = setTimeout(() => resolveTimeout(false), PENDING_ESCALATION_DELIVERY_TIMEOUT_MS);
|
|
443
|
+
timer.unref?.();
|
|
444
|
+
})])) console.warn(`[pan-dir/records] State reconcile escalation ${escalation.id} remains pending after activity delivery timed out`);
|
|
445
|
+
} catch (deliveryError) {
|
|
446
|
+
console.warn(`[pan-dir/records] State reconcile escalation ${escalation.id} remains pending after activity delivery failed: ${gitFailureMessage(deliveryError)}`);
|
|
447
|
+
} finally {
|
|
448
|
+
if (timer) clearTimeout(timer);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
async function recordReconcileFailureHealth(project, issueId, error, conflictedPaths) {
|
|
452
|
+
try {
|
|
453
|
+
const { health } = await recordReconcileFailure(project, {
|
|
454
|
+
issueId,
|
|
455
|
+
reason: gitFailureMessage(error),
|
|
456
|
+
conflictedPaths
|
|
457
|
+
});
|
|
458
|
+
return health.pendingEscalation;
|
|
459
|
+
} catch (healthError) {
|
|
460
|
+
console.warn(`[pan-dir/records] Failed to record reconcile health for ${issueId}: ${gitFailureMessage(healthError)}`);
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
async function reconcileStatePush(project, issueId, mutator, recordPath, signal, onPendingEscalation) {
|
|
465
|
+
const gitRoot = resolveStateReadHomeSync(project).root;
|
|
466
|
+
let conflictedPaths = [];
|
|
467
|
+
try {
|
|
468
|
+
await abortMerge(gitRoot, { signal });
|
|
469
|
+
await abortRebase(gitRoot, { signal });
|
|
470
|
+
for (let attempt = 0; attempt < MAX_STATE_PUSH_RECONCILIATIONS; attempt += 1) {
|
|
471
|
+
throwIfDurabilityAborted(signal);
|
|
472
|
+
await git(gitRoot, [
|
|
473
|
+
"fetch",
|
|
474
|
+
"origin",
|
|
475
|
+
STATE_BRANCH
|
|
476
|
+
], { signal });
|
|
477
|
+
await adoptOrphanedStateWrites(gitRoot, signal);
|
|
478
|
+
try {
|
|
479
|
+
await git(gitRoot, [
|
|
480
|
+
"merge",
|
|
481
|
+
"--no-edit",
|
|
482
|
+
`origin/${STATE_BRANCH}`
|
|
483
|
+
], { signal });
|
|
484
|
+
} catch (error) {
|
|
485
|
+
throwIfDurabilityAborted(signal);
|
|
486
|
+
try {
|
|
487
|
+
await resolveMergeConflicts(project, issueId, mutator, gitRoot, recordPath, error, signal);
|
|
488
|
+
} catch (resolveError) {
|
|
489
|
+
if (resolveError instanceof StateMergeConflictError) conflictedPaths = resolveError.conflictedPaths;
|
|
490
|
+
await abortMerge(gitRoot, { signal });
|
|
491
|
+
await abortRebase(gitRoot, { signal });
|
|
492
|
+
throw new Error(`Failed to reconcile ${issueId} state after push race: ${gitFailureMessage(resolveError)}`, { cause: error });
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
try {
|
|
496
|
+
await git(gitRoot, [
|
|
497
|
+
"push",
|
|
498
|
+
"origin",
|
|
499
|
+
STATE_BRANCH
|
|
500
|
+
], { signal });
|
|
501
|
+
const record = readIssueRecordSync(project, issueId);
|
|
502
|
+
if (!record) throw new Error(`Reconciled ${issueId} state record is unreadable`);
|
|
503
|
+
try {
|
|
504
|
+
const health = await recordReconcileSuccess(project);
|
|
505
|
+
onPendingEscalation?.(health.pendingEscalation);
|
|
506
|
+
} catch (healthError) {
|
|
507
|
+
console.warn(`[pan-dir/records] Failed to reset reconcile health for ${issueId}: ${gitFailureMessage(healthError)}`);
|
|
508
|
+
}
|
|
509
|
+
return record;
|
|
510
|
+
} catch (error) {
|
|
511
|
+
throwIfDurabilityAborted(signal);
|
|
512
|
+
const message = gitFailureMessage(error);
|
|
513
|
+
if (!isRemoteRefRaceError(message)) throw new Error(`Failed to push reconciled ${issueId} state: ${message}`, { cause: error });
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
throw new Error(`Failed to push ${issueId} state after ${MAX_STATE_PUSH_RECONCILIATIONS} reconciliation attempts`);
|
|
517
|
+
} catch (error) {
|
|
518
|
+
onPendingEscalation?.(await recordReconcileFailureHealth(project, issueId, error, conflictedPaths));
|
|
519
|
+
throw error;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
async function updateIssueRecord(project, issueId, mutator, options = {}) {
|
|
523
|
+
const normalizedIssueId = issueId.toUpperCase();
|
|
524
|
+
const recordPath = getIssueRecordPath(project, normalizedIssueId);
|
|
525
|
+
const writerId = options.writerId ?? process.env.OVERDECK_AGENT_ID ?? `process-${process.pid}@${hostname()}`;
|
|
526
|
+
let pendingEscalation;
|
|
527
|
+
try {
|
|
528
|
+
const record = await withRecordFsLock(project, normalizedIssueId, {
|
|
529
|
+
writerId,
|
|
530
|
+
recordPath
|
|
531
|
+
}, async () => {
|
|
532
|
+
const operation = async () => {
|
|
533
|
+
const current = readIssueRecordSync(project, normalizedIssueId) ?? ensureIssueRecordSync(project, normalizedIssueId);
|
|
534
|
+
const original = structuredClone(current);
|
|
535
|
+
const next = await mutator(current) ?? current;
|
|
536
|
+
const path = writeIssueRecordSync(project, normalizedIssueId, next);
|
|
537
|
+
if (options.autoCommit === false) return readIssueRecordSync(project, normalizedIssueId) ?? next;
|
|
538
|
+
const budgetMs = recordDurabilityBudgetMs();
|
|
539
|
+
const deadlineMs = Date.now() + budgetMs;
|
|
540
|
+
try {
|
|
541
|
+
const commitRoot = queueIssueRecordCommit(project, normalizedIssueId, path);
|
|
542
|
+
const flushed = await withRecordDurabilityDeadline(normalizedIssueId, Effect.runPromise(flushAutoCommits(commitRoot)), deadlineMs, budgetMs);
|
|
543
|
+
if (flushed.pushed === false) {
|
|
544
|
+
if (resolveStateReadHomeSync(project).migrated && isRemoteRefRaceError(flushed.reason ?? "")) {
|
|
545
|
+
const reconcileAbort = new AbortController();
|
|
546
|
+
const reconcilePromise = reconcileStatePush(project, normalizedIssueId, mutator, path, reconcileAbort.signal, (escalation) => {
|
|
547
|
+
pendingEscalation = escalation;
|
|
548
|
+
});
|
|
549
|
+
return await withRecordDurabilityDeadline(normalizedIssueId, reconcilePromise, deadlineMs, budgetMs, async () => {
|
|
550
|
+
reconcileAbort.abort();
|
|
551
|
+
await reconcilePromise.catch(() => void 0);
|
|
552
|
+
const gitRoot = resolveStateReadHomeSync(project).root;
|
|
553
|
+
await abortRebase(gitRoot);
|
|
554
|
+
await abortMerge(gitRoot);
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
throw new Error(`Failed to push ${normalizedIssueId} state: ${flushed.reason ?? "unknown push failure"}`);
|
|
558
|
+
}
|
|
559
|
+
if (!flushed.committed && !["no diff", "no pending"].includes(flushed.reason ?? "")) throw new Error(`Failed to commit ${normalizedIssueId} state: ${flushed.reason ?? "unknown commit failure"}`);
|
|
560
|
+
return readIssueRecordSync(project, normalizedIssueId) ?? next;
|
|
561
|
+
} catch (error) {
|
|
562
|
+
if (error instanceof RecordDurabilityTimeoutError) throw error;
|
|
563
|
+
try {
|
|
564
|
+
const restoreAbort = new AbortController();
|
|
565
|
+
const restorePromise = restoreRetryableRecord(project, normalizedIssueId, original, path, restoreAbort.signal);
|
|
566
|
+
await withRecordDurabilityDeadline(normalizedIssueId, restorePromise, deadlineMs, budgetMs, async () => {
|
|
567
|
+
restoreAbort.abort();
|
|
568
|
+
await restorePromise.catch(() => void 0);
|
|
569
|
+
});
|
|
570
|
+
} catch (restoreError) {
|
|
571
|
+
if (restoreError instanceof RecordDurabilityTimeoutError) throw restoreError;
|
|
572
|
+
throw new Error(`Failed to persist ${normalizedIssueId} state and restore retryability: ${gitFailureMessage(restoreError)}`, { cause: error });
|
|
573
|
+
}
|
|
574
|
+
throw error;
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
const stateHome = resolveStateReadHomeSync(project);
|
|
578
|
+
return stateHome.migrated ? withStateGitLock(stateHome.root, writerId, recordPath, operation) : operation();
|
|
579
|
+
});
|
|
580
|
+
await attemptPendingEscalationDelivery(project, pendingEscalation);
|
|
581
|
+
return record;
|
|
582
|
+
} catch (error) {
|
|
583
|
+
await attemptPendingEscalationDelivery(project, pendingEscalation);
|
|
584
|
+
throw error;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
var execFileAsync, MAX_STATE_PUSH_RECONCILIATIONS, DEFAULT_RECORD_DURABILITY_BUDGET_MS, PENDING_ESCALATION_DELIVERY_TIMEOUT_MS, RecordDurabilityTimeoutError, StateMergeConflictError;
|
|
588
|
+
var init_record_update = __esmMin((() => {
|
|
589
|
+
init_activity_logger();
|
|
590
|
+
init_state_read_home();
|
|
591
|
+
init_auto_commit();
|
|
592
|
+
init_fs_lock();
|
|
593
|
+
init_push_health();
|
|
594
|
+
init_state_git_lock();
|
|
595
|
+
init_record();
|
|
596
|
+
execFileAsync = promisify(execFile);
|
|
597
|
+
MAX_STATE_PUSH_RECONCILIATIONS = 3;
|
|
598
|
+
DEFAULT_RECORD_DURABILITY_BUDGET_MS = 3e4;
|
|
599
|
+
PENDING_ESCALATION_DELIVERY_TIMEOUT_MS = 1e4;
|
|
600
|
+
RecordDurabilityTimeoutError = class extends Error {
|
|
601
|
+
constructor(issueId, budgetMs) {
|
|
602
|
+
super(`Durability wait for ${issueId} state exceeded ${budgetMs}ms; releasing the record lock. The mutation remains in the local record and the flush continues in the background; callers with a fallback (e.g. the review-verdict fallback and drain) reconcile through it, other writers must retry the write.`);
|
|
603
|
+
this.name = "RecordDurabilityTimeoutError";
|
|
604
|
+
}
|
|
605
|
+
};
|
|
606
|
+
StateMergeConflictError = class extends Error {
|
|
607
|
+
constructor(message, conflictedPaths) {
|
|
608
|
+
super(message);
|
|
609
|
+
this.conflictedPaths = conflictedPaths;
|
|
610
|
+
this.name = "StateMergeConflictError";
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
}));
|
|
614
|
+
//#endregion
|
|
615
|
+
export { updateIssueRecordForWorkspace as a, updateIssueRecord as i, clearRecordPipelineClosedOutSync as n, init_record_update as r, RecordDurabilityTimeoutError as t };
|
|
616
|
+
|
|
617
|
+
//# sourceMappingURL=record-update-CZh46a2f.js.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { n as __esmMin } from "./rolldown-runtime-DNCzzKnI.js";
|
|
2
|
+
import { Sn as resolveProjectFromIssueSync, X as readIssueRecord, cn as init_projects, nn as getProjectSync, q as init_record } from "./config-yaml-BSCqwmX0.js";
|
|
3
|
+
import { a as updateIssueRecordForWorkspace, r as init_record_update } from "./record-update-CZh46a2f.js";
|
|
4
|
+
//#region ../../lib/cloister/recovery-trip.ts
|
|
5
|
+
/**
|
|
6
|
+
* PAN-3092: read an existing trip without taking the per-issue record lock.
|
|
7
|
+
*
|
|
8
|
+
* A caller that surfaces lock contention needs to know whether it has already
|
|
9
|
+
* surfaced this episode, and it cannot learn that from a path that takes the
|
|
10
|
+
* contended lock. Best-effort: an unreadable record returns undefined, which
|
|
11
|
+
* callers must treat as "not yet surfaced" so a first warning is never lost.
|
|
12
|
+
*/
|
|
13
|
+
async function findRecoveryTrip(issue, recoveryPath, obligationGeneration) {
|
|
14
|
+
const normalized = issue.toUpperCase();
|
|
15
|
+
try {
|
|
16
|
+
const resolved = resolveProjectFromIssueSync(normalized);
|
|
17
|
+
if (!resolved) return void 0;
|
|
18
|
+
const project = getProjectSync(resolved.projectKey);
|
|
19
|
+
if (!project) return void 0;
|
|
20
|
+
return ((await readIssueRecord(project, normalized))?.recoveryTrips ?? []).find((trip) => trip.issue === normalized && trip.recoveryPath === recoveryPath && trip.obligationGeneration === obligationGeneration);
|
|
21
|
+
} catch {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function recordRecoveryFailure(workspacePath, issue, recoveryPath, obligationGeneration, threshold = 25, now = /* @__PURE__ */ new Date()) {
|
|
26
|
+
const normalized = issue.toUpperCase();
|
|
27
|
+
let outcome;
|
|
28
|
+
await updateIssueRecordForWorkspace(workspacePath, normalized, (record) => {
|
|
29
|
+
const trips = [...record.recoveryTrips ?? []];
|
|
30
|
+
const index = trips.findIndex((trip) => trip.issue === normalized && trip.recoveryPath === recoveryPath && trip.obligationGeneration === obligationGeneration);
|
|
31
|
+
const prior = index >= 0 ? trips[index] : void 0;
|
|
32
|
+
if (prior?.open) {
|
|
33
|
+
outcome = {
|
|
34
|
+
trip: prior,
|
|
35
|
+
emitNeedsYou: false
|
|
36
|
+
};
|
|
37
|
+
return record;
|
|
38
|
+
}
|
|
39
|
+
const tripCount = (prior?.tripCount ?? 0) + 1;
|
|
40
|
+
const emitNeedsYou = tripCount >= threshold;
|
|
41
|
+
const trip = {
|
|
42
|
+
issue: normalized,
|
|
43
|
+
recoveryPath,
|
|
44
|
+
obligationGeneration,
|
|
45
|
+
tripCount,
|
|
46
|
+
open: emitNeedsYou,
|
|
47
|
+
...prior?.needsYouEmittedAt ? { needsYouEmittedAt: prior.needsYouEmittedAt } : emitNeedsYou ? { needsYouEmittedAt: now.toISOString() } : {}
|
|
48
|
+
};
|
|
49
|
+
if (index >= 0) trips[index] = trip;
|
|
50
|
+
else trips.push(trip);
|
|
51
|
+
outcome = {
|
|
52
|
+
trip,
|
|
53
|
+
emitNeedsYou
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
...record,
|
|
57
|
+
recoveryTrips: trips
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
return outcome;
|
|
61
|
+
}
|
|
62
|
+
async function acknowledgeRecoveryTrip(workspacePath, issue, recoveryPath, obligationGeneration) {
|
|
63
|
+
const normalized = issue.toUpperCase();
|
|
64
|
+
await updateIssueRecordForWorkspace(workspacePath, normalized, (record) => ({
|
|
65
|
+
...record,
|
|
66
|
+
recoveryTrips: (record.recoveryTrips ?? []).filter((trip) => !(trip.issue === normalized && trip.recoveryPath === recoveryPath && trip.obligationGeneration === obligationGeneration))
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
var init_recovery_trip = __esmMin((() => {
|
|
70
|
+
init_record();
|
|
71
|
+
init_record_update();
|
|
72
|
+
init_projects();
|
|
73
|
+
}));
|
|
74
|
+
//#endregion
|
|
75
|
+
export { recordRecoveryFailure as i, findRecoveryTrip as n, init_recovery_trip as r, acknowledgeRecoveryTrip as t };
|
|
76
|
+
|
|
77
|
+
//# sourceMappingURL=recovery-trip-CSNWSLDn.js.map
|