@joshuafolkken/kit 1.2116.0 → 1.3000.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/.claude/agents/design-consultant.md +19 -0
- package/.claude/agents/investigator.md +12 -2
- package/.claude/agents/reviewer-verification.md +13 -2
- package/.claude/agents/reviewer.md +13 -2
- package/.claude/settings.json +32 -9
- package/.claude/skills/dependency-update/SKILL.md +11 -14
- package/.claude/skills/epic-commands/SKILL.md +8 -6
- package/.claude/skills/epic-commands/epic-bundle.md +6 -7
- package/.claude/skills/verify-ui/SKILL.md +13 -23
- package/.claude/skills/workflow-commands/SKILL.md +19 -18
- package/.claude/skills/workflow-commands/background-commands.md +7 -4
- package/.claude/skills/workflow-commands/backlogrun-child.md +31 -64
- package/.claude/skills/workflow-commands/backlogrun-lanes.md +54 -62
- package/.claude/skills/workflow-commands/backlogrun-park.md +65 -64
- package/.claude/skills/workflow-commands/backlogrun-progress.md +30 -44
- package/.claude/skills/workflow-commands/backlogrun-recovery.md +18 -33
- package/.claude/skills/workflow-commands/backlogrun-steps.md +62 -50
- package/.claude/skills/workflow-commands/backlogrun.md +13 -18
- package/.claude/skills/workflow-commands/chain-rule.md +54 -53
- package/.claude/skills/workflow-commands/delegation.md +11 -11
- package/.claude/skills/workflow-commands/entry-sequence.md +23 -34
- package/.claude/skills/workflow-commands/followup.md +19 -17
- package/.claude/skills/workflow-commands/fullrun-lane.md +11 -0
- package/.claude/skills/workflow-commands/fullrun-steps.md +27 -34
- package/.claude/skills/workflow-commands/fullrun.md +5 -6
- package/.claude/skills/workflow-commands/halfrun.md +4 -7
- package/.claude/skills/workflow-commands/issue-comments.md +29 -15
- package/.claude/skills/workflow-commands/issue-fold-existing.md +9 -14
- package/.claude/skills/workflow-commands/issue-scout.md +5 -8
- package/.claude/skills/workflow-commands/kickoff.md +25 -34
- package/.claude/skills/workflow-commands/latest-gate.md +6 -14
- package/.claude/skills/workflow-commands/needs-human-review.md +3 -3
- package/.claude/skills/workflow-commands/observation-filing.md +9 -7
- package/.claude/skills/workflow-commands/observation-ledger.md +4 -1
- package/.claude/skills/workflow-commands/pre-gate-cut.md +21 -26
- package/.claude/skills/workflow-commands/prerequisite.md +21 -6
- package/.claude/skills/workflow-commands/progress-watcher.md +8 -18
- package/.claude/skills/workflow-commands/prrun.md +1 -1
- package/.claude/skills/workflow-commands/retrospective.md +16 -15
- package/.claude/skills/workflow-commands/split-assessment.md +32 -22
- package/.claude/skills/workflow-commands/target-repository.md +2 -2
- package/.claude/skills/workflow-commands/working-tree-hold.md +3 -2
- package/.codex/hooks.json +18 -8
- package/.cursorrules +1 -2
- package/.github/actions/change-scope/action.yml +19 -0
- package/.github/actions/setup-pnpm/action.yml +87 -14
- package/.github/dependabot.yml +1 -0
- package/.github/workflows/ci.yml +74 -30
- package/.github/workflows/publish.yml +56 -14
- package/.github/workflows/sonar-qube.yml +28 -1
- package/.prettierignore +2 -0
- package/AGENTS.md +1 -2
- package/CLAUDE.md +8 -8
- package/GEMINI.md +1 -2
- package/README.md +1 -1
- package/SECURITY.md +11 -1
- package/cspell/index.yaml +11 -0
- package/dist/.inputs-verified.json +1 -0
- package/dist/CLAUDE.md +8 -8
- package/dist/commands/adopt.js +222 -0
- package/dist/commands/auth-setup-cli.js +127 -0
- package/dist/commands/auto-ok-judge-cli.js +223 -0
- package/dist/commands/auto-ok-main.js +136 -0
- package/dist/commands/backlog-budget-main.js +146 -0
- package/dist/commands/backlog-drive-cli.js +1935 -0
- package/dist/commands/backlog-next-main.js +186 -0
- package/dist/commands/backlog-offer-main.js +190 -0
- package/dist/commands/backlog-plan-cli.js +329 -0
- package/dist/commands/backlog-triage-cli.js +642 -0
- package/dist/commands/backlogrun-cli.js +829 -0
- package/dist/commands/behavior-cli.js +216 -0
- package/dist/commands/bump-version-main.js +22 -0
- package/dist/commands/bytes-command.js +208 -0
- package/dist/commands/cases-cli.js +57 -0
- package/dist/commands/check-commit-message-main.js +22 -0
- package/dist/commands/check-related.js +551 -0
- package/dist/commands/chunk-23GH6B3D.js +333 -0
- package/dist/commands/chunk-2ADQ5XRD.js +36 -0
- package/dist/commands/chunk-2CXAVVST.js +20 -0
- package/dist/commands/chunk-2DJLAUYB.js +109 -0
- package/dist/commands/chunk-2FE3C4PH.js +112 -0
- package/dist/commands/chunk-2FJJYCBD.js +149 -0
- package/dist/commands/chunk-2IESYBZH.js +34 -0
- package/dist/commands/chunk-2MJ4OCDL.js +188 -0
- package/dist/commands/chunk-2NSB5ZYQ.js +26 -0
- package/dist/commands/chunk-2OIX4JLA.js +37 -0
- package/dist/commands/chunk-2TQXCH2K.js +145 -0
- package/dist/commands/chunk-2VLHFILE.js +52 -0
- package/dist/commands/chunk-2VRITY55.js +41 -0
- package/dist/commands/chunk-2YCKPX3A.js +25 -0
- package/dist/commands/chunk-32SNWQJP.js +99 -0
- package/dist/commands/chunk-337QQM4C.js +136 -0
- package/dist/commands/chunk-34DND4BA.js +104 -0
- package/dist/commands/chunk-34LAULSC.js +352 -0
- package/dist/commands/chunk-36LOGVJ7.js +38 -0
- package/dist/commands/chunk-36M2UV6C.js +80 -0
- package/dist/commands/chunk-3BNNMJOT.js +702 -0
- package/dist/commands/chunk-3CCGKX7Y.js +20 -0
- package/dist/commands/chunk-3EO2XN3A.js +124 -0
- package/dist/commands/chunk-3GF52L5F.js +271 -0
- package/dist/commands/chunk-3HU3LPIF.js +113 -0
- package/dist/commands/chunk-3LZXX5GL.js +50 -0
- package/dist/commands/chunk-3NWAGIA6.js +39 -0
- package/dist/commands/chunk-3PEXBHRN.js +33 -0
- package/dist/commands/chunk-3RIQ36LH.js +110 -0
- package/dist/commands/chunk-3UKJFWKS.js +170 -0
- package/dist/commands/chunk-3WRQP3QE.js +47 -0
- package/dist/commands/chunk-3WWQFCGX.js +18 -0
- package/dist/commands/chunk-3ZEO3KOM.js +35 -0
- package/dist/commands/chunk-4BEIYKI2.js +76 -0
- package/dist/commands/chunk-4D5KWMFL.js +461 -0
- package/dist/commands/chunk-4DVM57T7.js +86 -0
- package/dist/commands/chunk-4EADHJVC.js +247 -0
- package/dist/commands/chunk-4G7NKNAZ.js +114 -0
- package/dist/commands/chunk-4HBVHYNL.js +73 -0
- package/dist/commands/chunk-4LWRCPS5.js +114 -0
- package/dist/commands/chunk-4P2LCVGO.js +211 -0
- package/dist/commands/chunk-4PES3BAA.js +263 -0
- package/dist/commands/chunk-4PUKDAXL.js +42 -0
- package/dist/commands/chunk-4Q4FXBUQ.js +99 -0
- package/dist/commands/chunk-4QYW2IL7.js +82 -0
- package/dist/commands/chunk-4YI4SLRJ.js +161 -0
- package/dist/commands/chunk-4Z5723GA.js +350 -0
- package/dist/commands/chunk-4ZHWTTQW.js +99 -0
- package/dist/commands/chunk-55I7OYHI.js +98 -0
- package/dist/commands/chunk-5GBZ43UA.js +58 -0
- package/dist/commands/chunk-5HCPSV45.js +800 -0
- package/dist/{hooks/chunk-OPSRGWFU.js → commands/chunk-5HVYOIIK.js} +1 -1
- package/dist/commands/chunk-5HWZFL4D.js +4175 -0
- package/dist/commands/chunk-5PAEXYIY.js +234 -0
- package/dist/commands/chunk-5SB37YDW.js +321 -0
- package/dist/commands/chunk-5TMAPYQD.js +19 -0
- package/dist/commands/chunk-5WIZR5SC.js +313 -0
- package/dist/commands/chunk-5Y7QQYTU.js +232 -0
- package/dist/commands/chunk-5ZTQX7OS.js +125 -0
- package/dist/commands/chunk-65E4OZJ7.js +9 -0
- package/dist/commands/chunk-66NX6EXR.js +29 -0
- package/dist/commands/chunk-66TGK5XL.js +84 -0
- package/dist/commands/chunk-6CJXLPRI.js +72 -0
- package/dist/commands/chunk-6EU5ZCDP.js +402 -0
- package/dist/commands/chunk-6FWV56B3.js +40 -0
- package/dist/commands/chunk-6HRRZANN.js +55 -0
- package/dist/commands/chunk-6I2JM5UX.js +134 -0
- package/dist/commands/chunk-6JVNRY5A.js +29 -0
- package/dist/commands/chunk-6NGNMIMT.js +20 -0
- package/dist/commands/chunk-6NRTLH6I.js +51 -0
- package/dist/commands/chunk-6NV2F7QH.js +47 -0
- package/dist/commands/chunk-6OP63TBT.js +78 -0
- package/dist/commands/chunk-6Q3XUCLM.js +204 -0
- package/dist/commands/chunk-6SKMZGER.js +148 -0
- package/dist/commands/chunk-6TESOL3L.js +173 -0
- package/dist/commands/chunk-6UGFS3EU.js +704 -0
- package/dist/commands/chunk-6VTJO5L2.js +38 -0
- package/dist/commands/chunk-6WEVLIZE.js +29 -0
- package/dist/commands/chunk-6WKJ3GDA.js +408 -0
- package/dist/commands/chunk-6WTVAL4D.js +115 -0
- package/dist/commands/chunk-72EW7AVI.js +59 -0
- package/dist/commands/chunk-72J2G2E7.js +1189 -0
- package/dist/commands/chunk-73EBNBUW.js +90 -0
- package/dist/commands/chunk-73JOEKIC.js +169 -0
- package/dist/commands/chunk-73KBUQKI.js +41 -0
- package/dist/commands/chunk-7CHCZBNF.js +555 -0
- package/dist/commands/chunk-7EAMUVIO.js +326 -0
- package/dist/commands/chunk-7GHOFHUS.js +48 -0
- package/dist/commands/chunk-7GMTJDO2.js +469 -0
- package/dist/commands/chunk-7HCPRVMB.js +76 -0
- package/dist/commands/chunk-7IT23HIR.js +306 -0
- package/dist/commands/chunk-7IZJ5MG2.js +72 -0
- package/dist/commands/chunk-7LJQMM2K.js +102 -0
- package/dist/commands/chunk-7MOZEEFJ.js +350 -0
- package/dist/commands/chunk-7P4X4TQL.js +507 -0
- package/dist/commands/chunk-7S6VRZOH.js +223 -0
- package/dist/commands/chunk-7V5UVKFG.js +20 -0
- package/dist/commands/chunk-7W3D3WRW.js +171 -0
- package/dist/commands/chunk-7ZECP3J6.js +212 -0
- package/dist/commands/chunk-A3D2XHOJ.js +387 -0
- package/dist/commands/chunk-A4HOQKOG.js +85 -0
- package/dist/commands/chunk-A5V7EWIX.js +85 -0
- package/dist/commands/chunk-A6T2N7VC.js +159 -0
- package/dist/commands/chunk-AI5K4QJO.js +72 -0
- package/dist/commands/chunk-AJWR7D3H.js +15 -0
- package/dist/commands/chunk-AKK56GNX.js +205 -0
- package/dist/commands/chunk-AKQYYHP2.js +461 -0
- package/dist/commands/chunk-AM44D7NF.js +52 -0
- package/dist/commands/chunk-ANUTT56I.js +85 -0
- package/dist/commands/chunk-AQ3PMSXK.js +76 -0
- package/dist/commands/chunk-AS3GWVAN.js +45 -0
- package/dist/commands/chunk-ATRMETHT.js +23 -0
- package/dist/commands/chunk-AVUGMOHZ.js +210 -0
- package/dist/commands/chunk-AWLYN2SP.js +64 -0
- package/dist/commands/chunk-AZUE65NT.js +77 -0
- package/dist/commands/chunk-B2EA2HCY.js +119 -0
- package/dist/commands/chunk-B33BTNB4.js +87 -0
- package/dist/commands/chunk-B3XFOHDX.js +71 -0
- package/dist/commands/chunk-B5GXZK3E.js +34 -0
- package/dist/commands/chunk-B77ZMVHS.js +80 -0
- package/dist/commands/chunk-BCK5LW4F.js +45 -0
- package/dist/commands/chunk-BEE7OAQ5.js +210 -0
- package/dist/commands/chunk-BF6YX4HE.js +70 -0
- package/dist/commands/chunk-BFLFPKQQ.js +46 -0
- package/dist/commands/chunk-BHRS7HAM.js +272 -0
- package/dist/commands/chunk-BIKGPT52.js +29 -0
- package/dist/commands/chunk-BJA5U4Q7.js +75 -0
- package/dist/commands/chunk-BJKEXXY6.js +15 -0
- package/dist/commands/chunk-BK6Q4VCA.js +128 -0
- package/dist/commands/chunk-BNXE3NVB.js +107 -0
- package/dist/commands/chunk-BPSJSHYD.js +209 -0
- package/dist/commands/chunk-BRFQBJ5Y.js +132 -0
- package/dist/commands/chunk-BY3POLIQ.js +104 -0
- package/dist/commands/chunk-BYSPYVLD.js +130 -0
- package/dist/commands/chunk-C26LKDBE.js +60 -0
- package/dist/commands/chunk-C2SEDMZ3.js +238 -0
- package/dist/commands/chunk-C6QSVO5K.js +56 -0
- package/dist/commands/chunk-CA6F5OXK.js +809 -0
- package/dist/commands/chunk-CADFBQJJ.js +75 -0
- package/dist/commands/chunk-CDY4NFQG.js +15 -0
- package/dist/commands/chunk-CGLLAEKZ.js +110 -0
- package/dist/commands/chunk-CHX4QTP4.js +133 -0
- package/dist/commands/chunk-CJAA5GAF.js +418 -0
- package/dist/commands/chunk-CJKPF5DJ.js +156 -0
- package/dist/commands/chunk-CJSFC5YI.js +158 -0
- package/dist/commands/chunk-CRNPPKP2.js +99 -0
- package/dist/commands/chunk-CUR2WNYB.js +42 -0
- package/dist/commands/chunk-CYQ3ZF7R.js +372 -0
- package/dist/commands/chunk-D3SHCUBC.js +64 -0
- package/dist/commands/chunk-D4HNS43Q.js +208 -0
- package/dist/commands/chunk-D4SZK7H2.js +34 -0
- package/dist/commands/chunk-D5HIP4HT.js +289 -0
- package/dist/commands/chunk-D5TAR6TV.js +71 -0
- package/dist/commands/chunk-DAJCUSPG.js +127 -0
- package/dist/commands/chunk-DBKTFB5V.js +18 -0
- package/dist/commands/chunk-DIB2Z2OS.js +307 -0
- package/dist/commands/chunk-DJVMC3U2.js +131 -0
- package/dist/commands/chunk-DKM4UJQU.js +10 -0
- package/dist/commands/chunk-DMD74E3F.js +39 -0
- package/dist/commands/chunk-DNJC7X73.js +84 -0
- package/dist/commands/chunk-DP7WIGQ4.js +298 -0
- package/dist/commands/chunk-DPJVKTO4.js +41 -0
- package/dist/commands/chunk-DRCTDVI2.js +83 -0
- package/dist/commands/chunk-DSBK66US.js +67 -0
- package/dist/commands/chunk-DXJQHJQ4.js +73 -0
- package/dist/commands/chunk-DXZW4V7J.js +114 -0
- package/dist/commands/chunk-E2ZCUKHT.js +274 -0
- package/dist/commands/chunk-E33LSO2W.js +20 -0
- package/dist/commands/chunk-E3CXOVPQ.js +258 -0
- package/dist/commands/chunk-EBI2BAKQ.js +47 -0
- package/dist/commands/chunk-EBNIX2TC.js +81 -0
- package/dist/commands/chunk-EBVS2LKX.js +60 -0
- package/dist/commands/chunk-EFHSCUFN.js +170 -0
- package/dist/commands/chunk-EH3LVYOX.js +72 -0
- package/dist/commands/chunk-EI6JG5DF.js +92 -0
- package/dist/commands/chunk-EK2Y6B4X.js +140 -0
- package/dist/commands/chunk-EK327QOS.js +260 -0
- package/dist/commands/chunk-EKCKCX5S.js +291 -0
- package/dist/commands/chunk-ELWNRE6E.js +93 -0
- package/dist/commands/chunk-ENFPR7J2.js +53 -0
- package/dist/commands/chunk-ENLWXAHD.js +80 -0
- package/dist/commands/chunk-ERGZPWKP.js +102 -0
- package/dist/commands/chunk-ESQEEL4O.js +58 -0
- package/dist/commands/chunk-EW4NPUMQ.js +363 -0
- package/dist/commands/chunk-EWA72KO7.js +241 -0
- package/dist/commands/chunk-EWVR5AEX.js +140 -0
- package/dist/commands/chunk-EZSO25UZ.js +80 -0
- package/dist/commands/chunk-F22G3VDB.js +183 -0
- package/dist/commands/chunk-F2HFWLQR.js +32 -0
- package/dist/commands/chunk-F2J6DGDM.js +302 -0
- package/dist/commands/chunk-F3WBEEYC.js +68 -0
- package/dist/commands/chunk-F6OWP2AY.js +750 -0
- package/dist/commands/chunk-F7XLEK55.js +62 -0
- package/dist/commands/chunk-FB3D7CX5.js +241 -0
- package/dist/commands/chunk-FC33R5UN.js +516 -0
- package/dist/commands/chunk-FCINBCKB.js +77 -0
- package/dist/commands/chunk-FFHEGWPK.js +91 -0
- package/dist/commands/chunk-FGL6DBZU.js +71 -0
- package/dist/commands/chunk-FGZQSSGH.js +210 -0
- package/dist/{hooks/chunk-VVNYJWEI.js → commands/chunk-FIUCHMCF.js} +4 -2
- package/dist/commands/chunk-FNOSSXLG.js +61 -0
- package/dist/commands/chunk-FNQW6NY7.js +154 -0
- package/dist/commands/chunk-FROACLVU.js +525 -0
- package/dist/commands/chunk-FVVZIJUC.js +425 -0
- package/dist/commands/chunk-G47ZNQVG.js +17 -0
- package/dist/commands/chunk-G6BXCWPH.js +141 -0
- package/dist/commands/chunk-GA4VIFHD.js +224 -0
- package/dist/commands/chunk-GA6E4VGO.js +328 -0
- package/dist/commands/chunk-GDUK5YPO.js +185 -0
- package/dist/commands/chunk-GIGKMIPQ.js +72 -0
- package/dist/commands/chunk-GJYMI2CM.js +48 -0
- package/dist/commands/chunk-GK2KY4MO.js +67 -0
- package/dist/commands/chunk-GM3XLC4W.js +63 -0
- package/dist/commands/chunk-GO3GH7FG.js +75 -0
- package/dist/commands/chunk-GPMSYXYO.js +378 -0
- package/dist/commands/chunk-GPTO6IZG.js +29 -0
- package/dist/commands/chunk-GQHUFNXN.js +54 -0
- package/dist/commands/chunk-GU5ML3Y3.js +263 -0
- package/dist/commands/chunk-GW4UWR3O.js +126 -0
- package/dist/commands/chunk-H4LYG37R.js +716 -0
- package/dist/commands/chunk-HBNB3TLG.js +122 -0
- package/dist/commands/chunk-HCA5QG2U.js +299 -0
- package/dist/commands/chunk-HE5S4XRE.js +21 -0
- package/dist/commands/chunk-HESMKHEB.js +105 -0
- package/dist/commands/chunk-HG2NZQD5.js +135 -0
- package/dist/commands/chunk-HH2KDLTP.js +161 -0
- package/dist/commands/chunk-HHBC6QZE.js +95 -0
- package/dist/commands/chunk-HIB5G2X6.js +426 -0
- package/dist/commands/chunk-HIPO6HUG.js +45 -0
- package/dist/commands/chunk-HIU2WXB6.js +26 -0
- package/dist/commands/chunk-HJKZDDDI.js +62 -0
- package/dist/commands/chunk-HLKAFSN4.js +76 -0
- package/dist/commands/chunk-HLUS2M3D.js +7 -0
- package/dist/commands/chunk-HO52D6JY.js +278 -0
- package/dist/commands/chunk-HOGFJHBT.js +412 -0
- package/dist/commands/chunk-HOSZITJM.js +156 -0
- package/dist/commands/chunk-HPVLI26Z.js +123 -0
- package/dist/commands/chunk-HQ2HSZBN.js +69 -0
- package/dist/commands/chunk-HRLGFRAV.js +21 -0
- package/dist/commands/chunk-HRT4KWP4.js +178 -0
- package/dist/commands/chunk-HTIDHEEN.js +108 -0
- package/dist/commands/chunk-HXCZ3KWS.js +41 -0
- package/dist/commands/chunk-HZBTXKT2.js +61 -0
- package/dist/commands/chunk-HZSQI6TD.js +18 -0
- package/dist/commands/chunk-I63RNFFR.js +213 -0
- package/dist/commands/chunk-IBEKFLWG.js +137 -0
- package/dist/commands/chunk-ICEMFE2V.js +139 -0
- package/dist/commands/chunk-IG22Y5MA.js +56 -0
- package/dist/commands/chunk-IGD6QJPH.js +91 -0
- package/dist/commands/chunk-ILGPZ47M.js +33 -0
- package/dist/commands/chunk-ILQZFUDC.js +65 -0
- package/dist/commands/chunk-ISPBJVXM.js +238 -0
- package/dist/commands/chunk-IW6NWCSN.js +10 -0
- package/dist/commands/chunk-IXX4SXIP.js +53 -0
- package/dist/commands/chunk-IZVM2TTH.js +84 -0
- package/dist/commands/chunk-J3G2R64I.js +88 -0
- package/dist/commands/chunk-J3TKZLHA.js +11 -0
- package/dist/commands/chunk-J6GIVMXI.js +59 -0
- package/dist/commands/chunk-JB7R3A4A.js +204 -0
- package/dist/commands/chunk-JGTLNFFE.js +803 -0
- package/dist/commands/chunk-JHN6RCE6.js +123 -0
- package/dist/commands/chunk-JJRKTWLK.js +64 -0
- package/dist/commands/chunk-JLREFWJ4.js +244 -0
- package/dist/commands/chunk-JLYW7CP6.js +43 -0
- package/dist/commands/chunk-JNWHX25C.js +36 -0
- package/dist/commands/chunk-JOARHU3M.js +137 -0
- package/dist/commands/chunk-JQXPLMCO.js +81 -0
- package/dist/commands/chunk-JTU5A4JI.js +55 -0
- package/dist/commands/chunk-JUJFIATR.js +121 -0
- package/dist/commands/chunk-JUUBDYFZ.js +61 -0
- package/dist/commands/chunk-JZOTCPX2.js +115 -0
- package/dist/commands/chunk-K2WVYHCP.js +18 -0
- package/dist/commands/chunk-K7GL3BGI.js +419 -0
- package/dist/commands/chunk-KB3OQWDT.js +71 -0
- package/dist/commands/chunk-KHWTJ4F7.js +132 -0
- package/dist/commands/chunk-KIILCKQR.js +220 -0
- package/dist/commands/chunk-KIVOZY2J.js +1864 -0
- package/dist/commands/chunk-KQWSENCT.js +94 -0
- package/dist/commands/chunk-KSR23NYN.js +33 -0
- package/dist/commands/chunk-KTLR4Y32.js +21 -0
- package/dist/commands/chunk-KUJQWO6M.js +119 -0
- package/dist/commands/chunk-KVHNQHX3.js +100 -0
- package/dist/commands/chunk-KVJDDECB.js +51 -0
- package/dist/commands/chunk-KVSSLDA3.js +1062 -0
- package/dist/commands/chunk-KVURNO74.js +187 -0
- package/dist/commands/chunk-KXHXMERX.js +214 -0
- package/dist/commands/chunk-KXRFGPZD.js +69 -0
- package/dist/commands/chunk-KZSM5M5P.js +89 -0
- package/dist/commands/chunk-L6LU2633.js +91 -0
- package/dist/commands/chunk-L6TU7FC2.js +103 -0
- package/dist/commands/chunk-L6XN3EXI.js +138 -0
- package/dist/commands/chunk-LA5WTOAM.js +319 -0
- package/dist/commands/chunk-LAKVPOJQ.js +59 -0
- package/dist/commands/chunk-LAYSCY4L.js +6 -0
- package/dist/commands/chunk-LBLII7BS.js +14 -0
- package/dist/commands/chunk-LC7SBONO.js +98 -0
- package/dist/commands/chunk-LCEJXF7A.js +101 -0
- package/dist/commands/chunk-LE2T3FGJ.js +302 -0
- package/dist/commands/chunk-LE7TFPMU.js +88 -0
- package/dist/commands/chunk-LHKXJD6L.js +303 -0
- package/dist/commands/chunk-LMS6N6GE.js +332 -0
- package/dist/commands/chunk-LMSS4ARB.js +32 -0
- package/dist/commands/chunk-LNBUIOK6.js +133 -0
- package/dist/commands/chunk-LOSOLCCW.js +119 -0
- package/dist/commands/chunk-LQXFVZTS.js +13 -0
- package/dist/commands/chunk-LRA3PXHS.js +472 -0
- package/dist/commands/chunk-LRS2OS5J.js +395 -0
- package/dist/commands/chunk-LULJUD6P.js +131 -0
- package/dist/commands/chunk-LUMCYDGE.js +141 -0
- package/dist/commands/chunk-LWAXXZPS.js +118 -0
- package/dist/commands/chunk-LYEKT3IN.js +77 -0
- package/dist/commands/chunk-LZNYHWRO.js +78 -0
- package/dist/commands/chunk-M3ZDYCUF.js +117 -0
- package/dist/commands/chunk-M42SLJCD.js +97 -0
- package/dist/commands/chunk-M4PEC7YW.js +349 -0
- package/dist/commands/chunk-MAGJFH5T.js +77 -0
- package/dist/commands/chunk-MDKDJF2K.js +160 -0
- package/dist/commands/chunk-MDLOETXL.js +211 -0
- package/dist/commands/chunk-MGF64OHV.js +32 -0
- package/dist/commands/chunk-MMTVQOCP.js +211 -0
- package/dist/commands/chunk-MMXZKLDU.js +115 -0
- package/dist/commands/chunk-MPGJ4ONJ.js +634 -0
- package/dist/commands/chunk-MS6Q3Z7V.js +870 -0
- package/dist/commands/chunk-MSPIR3OA.js +32 -0
- package/dist/commands/chunk-MVPUQLN5.js +183 -0
- package/dist/commands/chunk-MXC4IBZ7.js +104 -0
- package/dist/commands/chunk-MY3RSOS5.js +52 -0
- package/dist/commands/chunk-MYNM3YMR.js +347 -0
- package/dist/commands/chunk-MYWRGF5A.js +177 -0
- package/dist/commands/chunk-MZHOPRI6.js +529 -0
- package/dist/commands/chunk-N4O5I55P.js +655 -0
- package/dist/commands/chunk-N6TYL3B2.js +250 -0
- package/dist/commands/chunk-NFEBQED3.js +179 -0
- package/dist/commands/chunk-NFKULY26.js +48 -0
- package/dist/commands/chunk-NGKB632X.js +92 -0
- package/dist/commands/chunk-NJ53AWJU.js +122 -0
- package/dist/commands/chunk-NJT5L6IC.js +126 -0
- package/dist/commands/chunk-NKKH3PBE.js +87 -0
- package/dist/commands/chunk-NKOET4FB.js +44 -0
- package/dist/commands/chunk-NMLCPYBN.js +134 -0
- package/dist/commands/chunk-NOXLKIPR.js +114 -0
- package/dist/commands/chunk-NSAVEXVR.js +353 -0
- package/dist/commands/chunk-NSZTSCBW.js +1263 -0
- package/dist/commands/chunk-NYWGJLBU.js +19 -0
- package/dist/commands/chunk-O26Y2FOJ.js +134 -0
- package/dist/commands/chunk-O27H6NN6.js +163 -0
- package/dist/commands/chunk-O3NDWYNT.js +68 -0
- package/dist/commands/chunk-O4WBADCX.js +88 -0
- package/dist/commands/chunk-O5FVBIRI.js +271 -0
- package/dist/commands/chunk-O5QZ2S6X.js +98 -0
- package/dist/commands/chunk-OGNTJ5JB.js +47 -0
- package/dist/commands/chunk-OHNP3QL2.js +186 -0
- package/dist/commands/chunk-OHVAEJSM.js +184 -0
- package/dist/commands/chunk-OI7KM4K3.js +43 -0
- package/dist/commands/chunk-OIDMJASD.js +62 -0
- package/dist/commands/chunk-OJ4LGBVD.js +126 -0
- package/dist/commands/chunk-OKKQI4ZG.js +49 -0
- package/dist/commands/chunk-OKYFQJW3.js +22 -0
- package/dist/commands/chunk-ORSI7Y55.js +133 -0
- package/dist/commands/chunk-OT3UMEWK.js +47 -0
- package/dist/commands/chunk-OTZJXU2R.js +170 -0
- package/dist/commands/chunk-OVA7STGP.js +578 -0
- package/dist/commands/chunk-OWR2TCOY.js +269 -0
- package/dist/commands/chunk-OZZWRJQI.js +246 -0
- package/dist/commands/chunk-P4CWLRT2.js +213 -0
- package/dist/commands/chunk-P4D5RESF.js +88 -0
- package/dist/commands/chunk-P4KIQRSL.js +119 -0
- package/dist/commands/chunk-P4O67FP5.js +488 -0
- package/dist/commands/chunk-P6RGQXHI.js +391 -0
- package/dist/commands/chunk-P7FPXAHP.js +29 -0
- package/dist/commands/chunk-PBOS7MTW.js +6 -0
- package/dist/commands/chunk-PDAY76AN.js +47 -0
- package/dist/commands/chunk-PDDKRHHS.js +128 -0
- package/dist/commands/chunk-PE7B7242.js +84 -0
- package/dist/commands/chunk-PF22VUWB.js +723 -0
- package/dist/commands/chunk-PFO7EYAP.js +45 -0
- package/dist/commands/chunk-PR3JCPP7.js +126 -0
- package/dist/commands/chunk-PWYXY46Y.js +1150 -0
- package/dist/commands/chunk-PYOK73QE.js +44 -0
- package/dist/commands/chunk-PZ4ITSLG.js +80 -0
- package/dist/commands/chunk-PZ6VWHOO.js +144 -0
- package/dist/commands/chunk-PZTWQYRI.js +44 -0
- package/dist/commands/chunk-PZU6FZO6.js +17 -0
- package/dist/commands/chunk-Q3463XNL.js +198 -0
- package/dist/commands/chunk-Q5N2J2UF.js +78 -0
- package/dist/commands/chunk-Q5Q2QYVU.js +112 -0
- package/dist/commands/chunk-Q6SKKQVJ.js +34 -0
- package/dist/commands/chunk-Q7TV3OV6.js +218 -0
- package/dist/commands/chunk-QA22PBCJ.js +165 -0
- package/dist/commands/chunk-QAHFPCFR.js +50 -0
- package/dist/commands/chunk-QDFDB4CF.js +478 -0
- package/dist/commands/chunk-QEIO2ZNQ.js +324 -0
- package/dist/commands/chunk-QF4WC2AE.js +10 -0
- package/dist/commands/chunk-QGAERR7D.js +99 -0
- package/dist/commands/chunk-QHWJJ6X5.js +53 -0
- package/dist/commands/chunk-QQ4CIYMF.js +132 -0
- package/dist/commands/chunk-QQBMVC5W.js +227 -0
- package/dist/commands/chunk-QQZOQ7AM.js +32 -0
- package/dist/commands/chunk-QS5USD4T.js +540 -0
- package/dist/commands/chunk-QVOFWFWC.js +134 -0
- package/dist/commands/chunk-QWWTC3XR.js +109 -0
- package/dist/commands/chunk-QWX7EBC6.js +112 -0
- package/dist/commands/chunk-QX2R6UJG.js +15 -0
- package/dist/commands/chunk-QXQ56E56.js +27 -0
- package/dist/commands/chunk-R2CF6VZE.js +114 -0
- package/dist/commands/chunk-R6QE5VJG.js +46 -0
- package/dist/commands/chunk-R7IT5VOL.js +27 -0
- package/dist/commands/chunk-RBU2NKHF.js +44 -0
- package/dist/commands/chunk-RDRN56E4.js +92 -0
- package/dist/commands/chunk-REMKUFAC.js +304 -0
- package/dist/commands/chunk-REPANBLS.js +168 -0
- package/dist/commands/chunk-RGDFWJPZ.js +135 -0
- package/dist/commands/chunk-RGGEQM6G.js +140 -0
- package/dist/commands/chunk-RH6ZWJOA.js +77 -0
- package/dist/commands/chunk-RHII5XI6.js +492 -0
- package/dist/commands/chunk-RI7EQYKL.js +60 -0
- package/dist/commands/chunk-RINVPTA2.js +1310 -0
- package/dist/commands/chunk-RIQ75QWR.js +233 -0
- package/dist/commands/chunk-RIUPRMLW.js +63 -0
- package/dist/commands/chunk-RK4HE5NW.js +172 -0
- package/dist/commands/chunk-ROJXMBXP.js +85 -0
- package/dist/commands/chunk-RPDWFUQO.js +239 -0
- package/dist/commands/chunk-RQRLW4XK.js +20 -0
- package/dist/commands/chunk-RRQFITJE.js +40 -0
- package/dist/commands/chunk-RS764ZMU.js +46 -0
- package/dist/commands/chunk-RSSJWMQS.js +30 -0
- package/dist/commands/chunk-RUIBQMOV.js +38 -0
- package/dist/commands/chunk-RUWV4INF.js +245 -0
- package/dist/commands/chunk-RVHBWSIG.js +114 -0
- package/dist/commands/chunk-RVUJ6F5L.js +181 -0
- package/dist/commands/chunk-RX5JSPPH.js +1153 -0
- package/dist/commands/chunk-RXAZJMSZ.js +18 -0
- package/dist/commands/chunk-RY6ZDHKB.js +1218 -0
- package/dist/commands/chunk-RYZ3RQRH.js +16 -0
- package/dist/commands/chunk-RZ4OKKPM.js +1722 -0
- package/dist/commands/chunk-RZJAUVMI.js +69 -0
- package/dist/commands/chunk-S4X5PJV7.js +40 -0
- package/dist/commands/chunk-S6SXMBF2.js +66 -0
- package/dist/commands/chunk-S7XWXG4M.js +3893 -0
- package/dist/commands/chunk-SADJPNDB.js +67 -0
- package/dist/commands/chunk-SBGTCT2C.js +89 -0
- package/dist/commands/chunk-SFNBUB6D.js +110 -0
- package/dist/commands/chunk-SK2LJBFS.js +168 -0
- package/dist/commands/chunk-SNFLV7VV.js +45 -0
- package/dist/commands/chunk-SNO7CY2B.js +69 -0
- package/dist/commands/chunk-ST32OGPY.js +82 -0
- package/dist/commands/chunk-SV4FHQE7.js +995 -0
- package/dist/commands/chunk-SVAKCXZ7.js +44 -0
- package/dist/commands/chunk-SXULS6DX.js +112 -0
- package/dist/commands/chunk-T25S4QHL.js +52 -0
- package/dist/commands/chunk-T2E724HN.js +117 -0
- package/dist/commands/chunk-T2IO4LEB.js +285 -0
- package/dist/commands/chunk-T33QDAWD.js +16 -0
- package/dist/commands/chunk-T3FD3Q73.js +49 -0
- package/dist/commands/chunk-T4UYEHWG.js +50 -0
- package/dist/commands/chunk-T57W3UWK.js +88 -0
- package/dist/commands/chunk-TAPDXK34.js +48 -0
- package/dist/commands/chunk-TBIX5FRN.js +106 -0
- package/dist/commands/chunk-TBNQIFWL.js +101 -0
- package/dist/commands/chunk-TCBUX52E.js +701 -0
- package/dist/commands/chunk-TIXJY22D.js +90 -0
- package/dist/commands/chunk-TKGBF75Y.js +88 -0
- package/dist/commands/chunk-TMLNI3YW.js +95 -0
- package/dist/commands/chunk-TPKFVVJQ.js +125 -0
- package/dist/commands/chunk-TS4ZK46L.js +116 -0
- package/dist/commands/chunk-TUIFS5E7.js +72 -0
- package/dist/commands/chunk-TVJE67O2.js +179 -0
- package/dist/commands/chunk-TVZXG4Y4.js +197 -0
- package/dist/commands/chunk-TXXYC7EV.js +74 -0
- package/dist/commands/chunk-U2UH4VM4.js +229 -0
- package/dist/commands/chunk-U3IVVR4W.js +33 -0
- package/dist/commands/chunk-U5HQQWRE.js +20 -0
- package/dist/commands/chunk-U7XU5RG3.js +86 -0
- package/dist/commands/chunk-UCI4AL3Q.js +35 -0
- package/dist/commands/chunk-UCQJDYE3.js +21 -0
- package/dist/commands/chunk-UCUSCLEK.js +90 -0
- package/dist/commands/chunk-UEURNXE5.js +280 -0
- package/dist/commands/chunk-UGCUSRZF.js +17 -0
- package/dist/commands/chunk-UIWAMLQH.js +49 -0
- package/dist/commands/chunk-UJOZ2MGX.js +705 -0
- package/dist/commands/chunk-ULVVGGTY.js +64 -0
- package/dist/commands/chunk-UOAG2XQT.js +37 -0
- package/dist/commands/chunk-US6X7JXC.js +120 -0
- package/dist/commands/chunk-UTBVTCQN.js +7401 -0
- package/dist/commands/chunk-UU6GCJGM.js +56 -0
- package/dist/commands/chunk-UWLLZQJB.js +110 -0
- package/dist/commands/chunk-UZAU6UI6.js +33 -0
- package/dist/commands/chunk-V4Z7G4UH.js +73 -0
- package/dist/commands/chunk-V5FD7DVV.js +48 -0
- package/dist/commands/chunk-V5OIPYA6.js +109 -0
- package/dist/commands/chunk-VCR77BHO.js +8 -0
- package/dist/commands/chunk-VD5674LW.js +127 -0
- package/dist/commands/chunk-VD72V5VX.js +230 -0
- package/dist/commands/chunk-VDGNXSP3.js +174 -0
- package/dist/commands/chunk-VFJYOAOQ.js +339 -0
- package/dist/commands/chunk-VGHSZLYQ.js +85 -0
- package/dist/commands/chunk-VHRNXWVP.js +28 -0
- package/dist/commands/chunk-VJE3RJAX.js +23 -0
- package/dist/commands/chunk-VJLZ3IQQ.js +151 -0
- package/dist/commands/chunk-VTLL6CKO.js +269 -0
- package/dist/commands/chunk-VW5SGE7A.js +18 -0
- package/dist/commands/chunk-VZCQZFPH.js +378 -0
- package/dist/commands/chunk-VZHC2I3T.js +1208 -0
- package/dist/commands/chunk-VZSJCFRT.js +44 -0
- package/dist/commands/chunk-W2IA2LV3.js +15 -0
- package/dist/commands/chunk-W32DIQEP.js +43 -0
- package/dist/commands/chunk-W3FX7FYN.js +84 -0
- package/dist/commands/chunk-W47I2KDY.js +47 -0
- package/dist/commands/chunk-W4J6YTFE.js +74 -0
- package/dist/commands/chunk-W4YH2DF3.js +58 -0
- package/dist/commands/chunk-W6MVQEMO.js +109 -0
- package/dist/commands/chunk-W6V4DWC5.js +70 -0
- package/dist/commands/chunk-WG6GYBRJ.js +271 -0
- package/dist/commands/chunk-WGULS5DA.js +129 -0
- package/dist/commands/chunk-WIE7VUBE.js +122 -0
- package/dist/commands/chunk-WJ4NEDNI.js +288 -0
- package/dist/commands/chunk-WL5JHB3I.js +12 -0
- package/dist/commands/chunk-WMMGXJXP.js +92 -0
- package/dist/commands/chunk-WN7NK3NY.js +24 -0
- package/dist/commands/chunk-WOFLW2LX.js +26 -0
- package/dist/commands/chunk-WPAQUMHC.js +28 -0
- package/dist/commands/chunk-WQ6FS544.js +35 -0
- package/dist/commands/chunk-WQJ7O3C3.js +229 -0
- package/dist/commands/chunk-WRX3MINT.js +60 -0
- package/dist/commands/chunk-WSOF74K4.js +30 -0
- package/dist/commands/chunk-WTRDWEUQ.js +533 -0
- package/dist/commands/chunk-WVR4RUFP.js +327 -0
- package/dist/commands/chunk-WW3TX742.js +122 -0
- package/dist/commands/chunk-WWC5L3AO.js +177 -0
- package/dist/commands/chunk-X5XYKDOD.js +7 -0
- package/dist/commands/chunk-X7PN54LZ.js +143 -0
- package/dist/commands/chunk-XBRD2BDL.js +74 -0
- package/dist/commands/chunk-XDF25GSU.js +536 -0
- package/dist/commands/chunk-XDQOWUVT.js +51 -0
- package/dist/commands/chunk-XFPEUYDV.js +67 -0
- package/dist/commands/chunk-XGMRAKSL.js +85 -0
- package/dist/commands/chunk-XH6BGVVP.js +1639 -0
- package/dist/commands/chunk-XMBRXCIE.js +89 -0
- package/dist/commands/chunk-XSKB6ZUA.js +123 -0
- package/dist/commands/chunk-XXNEY4B3.js +110 -0
- package/dist/commands/chunk-XYAK53TK.js +443 -0
- package/dist/commands/chunk-Y2RNUX4W.js +8 -0
- package/dist/commands/chunk-Y5ZW3KN5.js +58 -0
- package/dist/commands/chunk-YGDNUTTI.js +120 -0
- package/dist/commands/chunk-YIA6FC3K.js +78 -0
- package/dist/commands/chunk-YPNTORQD.js +121 -0
- package/dist/commands/chunk-YT342DRV.js +143 -0
- package/dist/commands/chunk-YVH2OLDS.js +104 -0
- package/dist/commands/chunk-Z4HYBFZD.js +1160 -0
- package/dist/commands/chunk-ZA3W73PF.js +192 -0
- package/dist/commands/chunk-ZAAHZY2A.js +19 -0
- package/dist/commands/chunk-ZAJD6T6E.js +38 -0
- package/dist/commands/chunk-ZBFNQUY7.js +12 -0
- package/dist/commands/chunk-ZDSDPKCD.js +88 -0
- package/dist/commands/chunk-ZECFKW7D.js +60 -0
- package/dist/commands/chunk-ZHZSZNE2.js +173 -0
- package/dist/commands/chunk-ZNX2LJCQ.js +29 -0
- package/dist/commands/chunk-ZQ3CKRMP.js +99 -0
- package/dist/commands/chunk-ZVAIIHBE.js +63 -0
- package/dist/commands/chunk-ZYGOZT4J.js +39 -0
- package/dist/commands/chunk-ZYIMQHCB.js +81 -0
- package/dist/commands/chunk-ZZAH3YQP.js +170 -0
- package/dist/commands/ci-timing-cli.js +76 -0
- package/dist/commands/clone-scan-cli.js +189 -0
- package/dist/commands/code-symbol-cli.js +185 -0
- package/dist/commands/codex-hook-adapter.js +357 -0
- package/dist/commands/command-derive.js +802 -0
- package/dist/commands/cost-audit-main.js +207 -0
- package/dist/commands/cost-main.js +28 -0
- package/dist/commands/cspell-cached.js +158 -0
- package/dist/commands/defect-origin-main.js +221 -0
- package/dist/commands/defect-report-main.js +288 -0
- package/dist/commands/delegation-cli.js +65 -0
- package/dist/commands/diff-summary-cli.js +147 -0
- package/dist/commands/disposition-cli.js +408 -0
- package/dist/commands/doctor.js +267 -0
- package/dist/commands/document-read-cli.js +39 -844
- package/dist/commands/document-section-main.js +26 -835
- package/dist/commands/dogfood-commit-cli.js +102 -0
- package/dist/commands/e2e-retry-check.js +79 -0
- package/dist/commands/edit-files-cli.js +147 -0
- package/dist/commands/effect-audit-cli.js +319 -0
- package/dist/commands/epic-audit-main.js +158 -0
- package/dist/commands/epic-bundle-main.js +199 -0
- package/dist/commands/epic-check.js +90 -0
- package/dist/commands/epic-main.js +222 -0
- package/dist/commands/epic-next-main.js +157 -0
- package/dist/commands/eval-run.js +838 -0
- package/dist/commands/fanout-cli.js +86 -0
- package/dist/commands/format-edited-cli.js +120 -0
- package/dist/commands/format.js +139 -0
- package/dist/commands/fresh-machine-cli.js +691 -0
- package/dist/commands/gh-usage-cli.js +224 -0
- package/dist/commands/git-followup-workflow.js +2012 -0
- package/dist/commands/git-gh-checks-failed-main.js +156 -0
- package/dist/commands/git-workflow.js +602 -0
- package/dist/commands/github-release-cli.js +253 -0
- package/dist/commands/hook-ledger-cli.js +416 -0
- package/dist/commands/init-main.js +98 -0
- package/dist/commands/inputs.json +2764 -0
- package/dist/commands/issue-ack-cli.js +106 -0
- package/dist/commands/issue-already-done-cli.js +305 -0
- package/dist/commands/issue-body-cli.js +184 -0
- package/dist/commands/issue-cite-main.js +162 -0
- package/dist/commands/issue-comment-main.js +72 -0
- package/dist/commands/issue-consolidate-cli.js +329 -0
- package/dist/commands/issue-file-main.js +419 -0
- package/dist/commands/issue-fold-existing-cli.js +506 -0
- package/dist/commands/issue-fold-main.js +113 -0
- package/dist/commands/issue-lint-main.js +126 -0
- package/dist/commands/issue-measured-cli.js +205 -0
- package/dist/commands/issue-plan-cli.js +352 -0
- package/dist/commands/issue-premise-unmet-cli.js +268 -0
- package/dist/commands/issue-priority-cli.js +184 -0
- package/dist/commands/issue-read-main.js +79 -0
- package/dist/commands/issue-release-class-cli.js +119 -0
- package/dist/commands/issue-release-main.js +71 -0
- package/dist/commands/issue-scout-main.js +203 -0
- package/dist/commands/issue-spill-main.js +564 -0
- package/dist/commands/issue-state-main.js +76 -0
- package/dist/commands/issue-tick-cli.js +112 -0
- package/dist/commands/josh-completion.js +153 -0
- package/dist/commands/lane-adopt-cli.js +275 -0
- package/dist/commands/lane-breakdown-cli.js +703 -0
- package/dist/commands/lane-cli.js +863 -0
- package/dist/commands/lane-launch-main.js +103 -0
- package/dist/commands/lane-limit-cli.js +286 -0
- package/dist/commands/lane-measure-cli.js +1797 -0
- package/dist/commands/lane-pause-cli.js +255 -0
- package/dist/commands/lane-plan-cli.js +322 -0
- package/dist/commands/lane-resolve-cli.js +300 -0
- package/dist/commands/lane-restart-cli.js +387 -0
- package/dist/commands/lane-why-cli.js +307 -0
- package/dist/commands/lane-withdraw-cli.js +191 -0
- package/dist/commands/latest-corepack.js +278 -0
- package/dist/commands/latest-if-required-cli.js +124 -0
- package/dist/commands/latest-lane-guard-main.js +16 -0
- package/dist/commands/latest-scope-main.js +38 -0
- package/dist/commands/latest-update.js +449 -0
- package/dist/commands/lines-command.js +121 -0
- package/dist/commands/lint-parallel-main.js +134 -0
- package/dist/commands/lint-related.js +565 -0
- package/dist/commands/lint-rule.js +305 -0
- package/dist/commands/lockfile-policy.js +107 -0
- package/dist/commands/main-merge-main.js +61 -0
- package/dist/commands/main-sync-main.js +60 -0
- package/dist/commands/managed-config-scope-cli.js +66 -0
- package/dist/commands/measure-rerun-cli.js +124 -0
- package/dist/commands/metrics-command.js +859 -0
- package/dist/commands/observation-depth-cli.js +109 -0
- package/dist/commands/observation-record-cli.js +87 -0
- package/dist/commands/observations-flush-cli.js +115 -0
- package/dist/commands/oracle-list-cli.js +73 -0
- package/dist/commands/overrides-check.js +112 -0
- package/dist/commands/package-scout-cli.js +496 -0
- package/dist/commands/pin-verify-cli.js +88 -0
- package/dist/commands/plan-consumers-main.js +49 -0
- package/dist/commands/plan-scaffold-cli.js +367 -0
- package/dist/commands/port-command.js +64 -0
- package/dist/commands/pr-classification-main.js +37 -0
- package/dist/commands/pre-commit-lint.js +163 -0
- package/dist/commands/pre-commit-type-check.js +210 -0
- package/dist/commands/pre-push-unit.js +271 -0
- package/dist/commands/pretool-guard-cli.js +205 -0
- package/dist/commands/prevent-main-commit.js +42 -0
- package/dist/commands/project-profile-cli.js +58 -0
- package/dist/commands/propagate.js +368 -0
- package/dist/commands/prose-stale-cli.js +128 -0
- package/dist/commands/publish-tag-cli.js +30 -0
- package/dist/commands/publishable-range-check.js +191 -0
- package/dist/commands/read-files-cli.js +81 -0
- package/dist/commands/read-set-cli.js +121 -1745
- package/dist/commands/reconcile-templates.js +135 -0
- package/dist/commands/refactor-scan-cli.js +175 -0
- package/dist/commands/release-cli.js +724 -0
- package/dist/commands/release-scope-main.js +81 -0
- package/dist/commands/rename-cli.js +432 -0
- package/dist/commands/repo-party-cli.js +58 -0
- package/dist/commands/report-lint-cli.js +124 -0
- package/dist/commands/report-template-cli.js +69 -0
- package/dist/commands/reserved-run.js +127 -0
- package/dist/commands/retrospective-cli.js +555 -0
- package/dist/commands/review-attest-cli.js +118 -0
- package/dist/commands/review-brief-main.js +247 -0
- package/dist/commands/review-findings-cli.js +114 -0
- package/dist/commands/review-pair-cli.js +366 -0
- package/dist/commands/review-record-main.js +222 -0
- package/dist/commands/review-round2-cli.js +349 -0
- package/dist/commands/review-stops-cli.js +149 -0
- package/dist/commands/review-submit-cli.js +610 -0
- package/dist/commands/rule-list.js +184 -0
- package/dist/commands/rule-value-cli.js +908 -0
- package/dist/commands/ruleset-check-cli.js +67 -0
- package/dist/commands/run-add-cli.js +273 -0
- package/dist/commands/run-board-main.js +272 -0
- package/dist/commands/run-carry-cli.js +641 -0
- package/dist/commands/run-chain-cli.js +537 -0
- package/dist/commands/run-cut-cli.js +709 -0
- package/dist/commands/run-ending-cli.js +169 -0
- package/dist/commands/run-entry-cli.js +1060 -0
- package/dist/commands/run-event-cli.js +298 -0
- package/dist/commands/run-handoff-cli.js +344 -0
- package/dist/commands/run-handoff-lanes-cli.js +233 -0
- package/dist/commands/run-hold-main.js +203 -0
- package/dist/commands/run-liveness-cli.js +190 -0
- package/dist/commands/run-merge-main.js +246 -0
- package/dist/commands/run-next-cli.js +240 -0
- package/dist/commands/run-park-cli.js +393 -0
- package/dist/commands/run-pause-cli.js +334 -0
- package/dist/commands/run-pickup-cli.js +196 -0
- package/dist/commands/run-prep-main.js +209 -21168
- package/dist/commands/run-prime-cli.js +281 -0
- package/dist/commands/run-progress-main.js +655 -0
- package/dist/commands/run-report-cli.js +376 -0
- package/dist/commands/run-review-cli.js +777 -0
- package/dist/commands/run-ship-cli.js +2615 -0
- package/dist/commands/run-ship-evidence-cli.js +288 -0
- package/dist/commands/run-ship-lap-W5T2VHFC.js +30 -0
- package/dist/commands/run-ship-wait-main.js +145 -0
- package/dist/commands/run-split-cli.js +525 -0
- package/dist/commands/run-stale-main.js +254 -0
- package/dist/commands/run-status-cli.js +216 -0
- package/dist/commands/run-step-cli.js +419 -27653
- package/dist/commands/run-tail-cli.js +119 -0
- package/dist/commands/run-tidy-main.js +402 -0
- package/dist/commands/run-wake-main.js +272 -0
- package/dist/commands/run-watcher-guard-cli.js +128 -0
- package/dist/commands/secretlint-scan.js +84 -0
- package/dist/commands/security-audit-main.js +151 -0
- package/dist/commands/security-audit-provision-main.js +52 -0
- package/dist/commands/selfcheck-cli.js +409 -0
- package/dist/commands/session-language-main.js +120 -0
- package/dist/commands/sonar-hotspots-cli.js +133 -0
- package/dist/commands/sonar-new-code-cli.js +143 -0
- package/dist/commands/split-assess-cli.js +138 -0
- package/dist/commands/split-child-recover-cli.js +168 -0
- package/dist/commands/start.js +707 -0
- package/dist/commands/stash-pop-main.js +26 -0
- package/dist/commands/stash-push-main.js +30 -0
- package/dist/commands/stop-guard.js +567 -0
- package/dist/commands/sync-main.js +57 -0
- package/dist/commands/telegram-test-main.js +64 -0
- package/dist/commands/test-declared.js +255 -0
- package/dist/commands/test-e2e-guard.js +200 -0
- package/dist/commands/test-pinned-main.js +189 -0
- package/dist/commands/test-reach-cli.js +111 -0
- package/dist/commands/test-red-main.js +46 -0
- package/dist/commands/test-related-ZT2AO62I.js +113 -0
- package/dist/commands/test-related-main.js +223 -0
- package/dist/commands/test-unit-guard-main.js +87 -0
- package/dist/commands/time-cli.js +356 -0
- package/dist/commands/time-density-cli.js +183 -0
- package/dist/commands/tree-status-cli.js +172 -0
- package/dist/commands/type-check-command.js +74 -0
- package/dist/commands/ui-routes-cli.js +135 -0
- package/dist/commands/ui-shot-cli.js +131 -0
- package/dist/commands/uninstall.js +424 -0
- package/dist/commands/unused-members-STULPRBU.js +331 -0
- package/dist/commands/unused-members-cli.js +54 -0
- package/dist/commands/upstream-interrupt-main.js +449 -0
- package/dist/commands/usage-tee-cli.js +60 -0
- package/dist/commands/verification-gate.js +808 -0
- package/dist/commands/version-check.js +497 -0
- package/dist/hooks/audit-provision.js +20 -9
- package/dist/hooks/{chunk-UJ3FPMMM.js → chunk-4YXV2REH.js} +444 -141
- package/dist/hooks/chunk-6RR6JZSB.js +12367 -0
- package/dist/hooks/chunk-6YGMIODI.js +86 -0
- package/dist/hooks/chunk-CICKRHTB.js +7586 -0
- package/dist/hooks/chunk-CY3ADSDR.js +28580 -0
- package/dist/hooks/chunk-FOW4B7OQ.js +1795 -0
- package/dist/hooks/chunk-LKQBEKBI.js +232 -0
- package/dist/hooks/chunk-LRD2ERRI.js +299 -0
- package/dist/hooks/chunk-LWD43Z3C.js +6793 -0
- package/dist/hooks/chunk-NUPVO7RI.js +3054 -0
- package/dist/hooks/chunk-P7BPAU26.js +1082 -0
- package/dist/hooks/chunk-RQXECHAS.js +309 -0
- package/dist/hooks/chunk-SAAPRHTK.js +43 -0
- package/dist/hooks/chunk-U3ON2GBN.js +12 -0
- package/dist/hooks/{chunk-CQD4LJE6.js → chunk-UU4PTPEZ.js} +3143 -1257
- package/dist/hooks/chunk-YEURBB4L.js +32 -0
- package/dist/hooks/codex-hook-adapter.js +61 -25
- package/dist/hooks/daemon.js +67304 -0
- package/dist/hooks/format-edited.js +15 -5
- package/dist/hooks/inputs.json +584 -401
- package/dist/hooks/pretool-guard.js +11 -7
- package/dist/hooks/ready.js +300 -0
- package/dist/hooks/run-ship-lap-VCEOUHQI.js +8 -0
- package/dist/hooks/session-lang.js +226 -121
- package/dist/hooks/stop-guard.js +9188 -4508
- package/dist/inputs.json +169 -0
- package/dist/josh.js +9617 -6711
- package/dist/self-sync-guard/index.js +68 -14
- package/dist/version/index.js +642 -85
- package/eslint/base.js +36 -11
- package/eslint/config-fingerprint.js +164 -21
- package/eslint/rules/code-quality.js +6 -0
- package/eslint/rules/comment-why-only.js +40 -16
- package/eslint/rules/english-only-prose.js +10 -3
- package/eslint/rules/import.js +3 -17
- package/eslint/rules/test-helper-bans.js +34 -0
- package/eslint/untyped-environment.js +21 -0
- package/eslint/untyped.js +60 -0
- package/lefthook/base.yml +4 -5
- package/package.json +15 -13
- package/pnpm-workspace.yaml +15 -0
- package/ports/index.js +8 -15
- package/prompts/coding-standards.md +4 -43
- package/prompts/collaboration-workflow/file-edits.md +10 -10
- package/prompts/collaboration-workflow/gh-rest.md +14 -7
- package/prompts/collaboration-workflow/issue-template.en.md +125 -0
- package/prompts/collaboration-workflow/issue-template.md +49 -56
- package/prompts/collaboration-workflow/lane-instructions.md +1 -0
- package/prompts/collaboration-workflow/measurement.md +13 -17
- package/prompts/collaboration-workflow/operating-rules.md +10 -7
- package/prompts/collaboration-workflow/output-bounds.md +3 -3
- package/prompts/collaboration-workflow/overview.md +8 -17
- package/prompts/collaboration-workflow/plan-comment.md +1 -1
- package/prompts/collaboration-workflow/principles.md +17 -19
- package/prompts/collaboration-workflow/report-format.md +6 -5
- package/prompts/collaboration-workflow/residency.md +1 -0
- package/prompts/collaboration-workflow/rule-delivery.md +4 -12
- package/prompts/collaboration-workflow/shell-body.md +7 -7
- package/prompts/collaboration-workflow/turn-batching.md +2 -2
- package/prompts/collaboration-workflow/upstream-interrupt.md +8 -8
- package/prompts/collaboration-workflow/wip-cap.md +3 -3
- package/prompts/refactoring.md +4 -3
- package/prompts/review-rubric.md +8 -21
- package/prompts/review.md +52 -80
- package/prompts/sonar-hotspot-handling.md +1 -1
- package/prompts/testing-guide.md +15 -2
- package/scripts/agent/agent-argv.ts +11 -4
- package/scripts/agent/agent-consultation-model.ts +47 -0
- package/scripts/agent/agent-event.ts +11 -2
- package/scripts/agent/agent-launch-environment.ts +6 -57
- package/scripts/agent/agent-model-alias.ts +19 -0
- package/scripts/agent/agent-profile-schema.ts +98 -0
- package/scripts/agent/agent-role-profile.ts +105 -82
- package/scripts/agent/agent-safe-text.ts +2 -2
- package/scripts/agent/agent-session-role.ts +25 -3
- package/scripts/agent/answer-judge.ts +174 -0
- package/scripts/agent/answer-verdict.ts +122 -0
- package/scripts/agent/claude-agent-argv.ts +12 -6
- package/scripts/agent/codex-agent-argv.ts +17 -143
- package/scripts/agent/codex-home-source.ts +1 -1
- package/scripts/agent/codex-hooks.ts +29 -6
- package/scripts/agent/judgment-agent-argv.ts +49 -0
- package/scripts/agent/lane-instructions.ts +4 -1
- package/scripts/auto-ok/auto-ok-author.ts +14 -3
- package/scripts/auto-ok/auto-ok-cli.ts +20 -12
- package/scripts/auto-ok/auto-ok-judge-cli.ts +7 -14
- package/scripts/auto-ok/auto-ok-judge-read.ts +3 -3
- package/scripts/auto-ok/auto-ok-judge-write.ts +18 -16
- package/scripts/backlog/backlog-arrival-added.ts +47 -11
- package/scripts/backlog/backlog-arrival.ts +90 -23
- package/scripts/backlog/backlog-auto-triage.ts +130 -0
- package/scripts/backlog/backlog-budget-cli.ts +2 -1
- package/scripts/backlog/backlog-budget.ts +31 -5
- package/scripts/backlog/backlog-defect-priority.ts +32 -19
- package/scripts/backlog/backlog-drain-flush.ts +22 -0
- package/scripts/backlog/backlog-drive-adopt.ts +2 -2
- package/scripts/backlog/backlog-drive-after-merge.ts +123 -0
- package/scripts/backlog/backlog-drive-args.ts +60 -7
- package/scripts/backlog/backlog-drive-cli.ts +69 -64
- package/scripts/backlog/backlog-drive-collect.ts +46 -0
- package/scripts/backlog/backlog-drive-epic.ts +1 -1
- package/scripts/backlog/backlog-drive-hold.ts +32 -8
- package/scripts/backlog/backlog-drive-idle.ts +21 -10
- package/scripts/backlog/backlog-drive-launch-pass.ts +79 -23
- package/scripts/backlog/backlog-drive-launch.ts +73 -7
- package/scripts/backlog/backlog-drive-listing.ts +59 -0
- package/scripts/backlog/backlog-drive-memory.ts +4 -5
- package/scripts/backlog/backlog-drive-named-offer.ts +112 -22
- package/scripts/backlog/backlog-drive-named.ts +11 -4
- package/scripts/backlog/backlog-drive-offer-argv.ts +10 -2
- package/scripts/backlog/backlog-drive-park-triage.ts +57 -0
- package/scripts/backlog/backlog-drive-paused.ts +2 -1
- package/scripts/backlog/backlog-drive-rate-limit.ts +29 -0
- package/scripts/backlog/backlog-drive-rate.ts +73 -0
- package/scripts/backlog/backlog-drive-record.ts +58 -0
- package/scripts/backlog/backlog-drive-restore.ts +38 -8
- package/scripts/backlog/backlog-drive-retrospective-unit.ts +80 -0
- package/scripts/backlog/backlog-drive-retrospective.ts +35 -1
- package/scripts/backlog/backlog-drive-retry.ts +85 -0
- package/scripts/backlog/backlog-drive-seats.ts +4 -7
- package/scripts/backlog/backlog-drive-split-unit.ts +108 -0
- package/scripts/backlog/backlog-drive-stalled-retry.ts +194 -0
- package/scripts/backlog/backlog-drive-state.ts +28 -0
- package/scripts/backlog/backlog-drive-tick.ts +77 -0
- package/scripts/backlog/backlog-drive-token-handling.ts +2 -2
- package/scripts/backlog/backlog-drive-trace.ts +45 -0
- package/scripts/backlog/backlog-drive-unit.ts +54 -0
- package/scripts/backlog/backlog-drive-unread.ts +1 -1
- package/scripts/backlog/backlog-drive.ts +142 -99
- package/scripts/backlog/backlog-gate-scope.ts +15 -3
- package/scripts/backlog/backlog-hold-codes.ts +23 -0
- package/scripts/backlog/backlog-hold-text.ts +107 -0
- package/scripts/backlog/backlog-measure-close.ts +61 -31
- package/scripts/backlog/backlog-named.ts +1 -1
- package/scripts/backlog/backlog-next-offer.ts +138 -0
- package/scripts/backlog/backlog-next-report.ts +221 -0
- package/scripts/backlog/backlog-next-shared.ts +22 -4
- package/scripts/backlog/backlog-next-size.ts +108 -0
- package/scripts/backlog/backlog-next.ts +52 -187
- package/scripts/backlog/backlog-occupied.ts +7 -7
- package/scripts/backlog/backlog-offer-cli.ts +13 -2
- package/scripts/backlog/backlog-offer-timing.ts +141 -0
- package/scripts/backlog/backlog-offer.ts +26 -6
- package/scripts/backlog/backlog-overlap.ts +7 -1
- package/scripts/backlog/backlog-plan-cli.ts +27 -3
- package/scripts/backlog/backlog-plan-comment.ts +36 -14
- package/scripts/backlog/backlog-plan-words.ts +69 -0
- package/scripts/backlog/backlog-plan.ts +63 -46
- package/scripts/backlog/backlog-pool.ts +42 -13
- package/scripts/backlog/backlog-preflight.ts +67 -0
- package/scripts/backlog/backlog-ready.ts +7 -69
- package/scripts/backlog/backlog-resumable.ts +65 -0
- package/scripts/backlog/backlog-resume-reads.ts +119 -0
- package/scripts/backlog/backlog-stalled-detect.ts +4 -3
- package/scripts/backlog/backlog-stalled.ts +3 -2
- package/scripts/backlog/backlog-triage-adopt.ts +239 -0
- package/scripts/backlog/backlog-triage-approval.ts +94 -0
- package/scripts/backlog/backlog-triage-cli.ts +270 -0
- package/scripts/backlog/backlog-triage-decision.ts +49 -0
- package/scripts/backlog/backlog-triage-park.ts +53 -0
- package/scripts/backlog/backlog-triage-pass.ts +113 -0
- package/scripts/backlog/backlog-triage-unblock.ts +68 -0
- package/scripts/backlog/backlog-wait-cause.ts +76 -16
- package/scripts/backlog/backlog-yield-cap.ts +108 -0
- package/scripts/backlog/backlogrun-args.ts +45 -16
- package/scripts/backlog/backlogrun-cli.ts +82 -18
- package/scripts/backlog/backlogrun-launch.ts +12 -4
- package/scripts/backlog/backlogrun-replace.ts +44 -4
- package/scripts/build/build-bin.ts +25 -2
- package/scripts/build/build-codex-hooks.ts +2 -2
- package/scripts/build/build-commands.ts +27 -19
- package/scripts/build/build-hooks.ts +117 -22
- package/scripts/build/hook-bundle-stamp.ts +15 -5
- package/scripts/build/local-bin.ts +27 -1
- package/scripts/build/source-location.ts +82 -0
- package/scripts/ci/ci-timing-cli.ts +73 -0
- package/scripts/ci/ci-timing-table.ts +84 -0
- package/scripts/ci/ci-timing.ts +104 -0
- package/scripts/ci/composite-actions.ts +1 -1
- package/scripts/ci/pr-classification.ts +89 -11
- package/scripts/code/code-symbol-cli.ts +121 -0
- package/scripts/code/code-symbol.ts +127 -0
- package/scripts/config-merge/patch-json-key.ts +4 -7
- package/scripts/cost-runtime/cost-blocks.ts +3 -4
- package/scripts/cost-runtime/cost-cli.ts +4 -7
- package/scripts/cost-runtime/cost-pricing.ts +2 -2
- package/scripts/cost-runtime/cost-tokens.ts +7 -6
- package/scripts/delegation/delegation-policy.ts +2 -2
- package/scripts/delegation/duplicate-read-guard.ts +41 -28
- package/scripts/delegation/investigation-guard.ts +13 -5
- package/scripts/delegation/investigation-reads.ts +52 -34
- package/scripts/delegation/large-read-guard.ts +150 -0
- package/scripts/discovery/git-directory.ts +61 -0
- package/scripts/discovery/pin-verify-cli.ts +115 -0
- package/scripts/discovery/repo-discovery.ts +10 -58
- package/scripts/discovery/repo-party.ts +1 -0
- package/scripts/document/backlogrun-parent-read-set.ts +37 -6
- package/scripts/document/capped-print.ts +3 -3
- package/scripts/document/command-reference-line-budget.ts +4 -1
- package/scripts/document/document-byte-budget.ts +34 -16
- package/scripts/document/document-byte-check.ts +1 -1
- package/scripts/document/document-reachability.ts +4 -3
- package/scripts/document/document-scan.ts +2 -5
- package/scripts/document/document-section-cli.ts +13 -1
- package/scripts/document/edit-files-cli.ts +3 -7
- package/scripts/document/entry-read-budget.ts +12 -4
- package/scripts/document/entry-read-set.ts +9 -2
- package/scripts/document/issue-citation-budget.ts +3 -3
- package/scripts/document/lane-child-read-set.ts +21 -29
- package/scripts/document/read-set-cli.ts +17 -10
- package/scripts/document/read-set-point-of-use.ts +13 -9
- package/scripts/document/read-set-trim.ts +42 -2
- package/scripts/epic/epic-audit-checks.ts +1 -1
- package/scripts/epic/epic-audit-cli.ts +19 -21
- package/scripts/epic/epic-audit-main.ts +17 -0
- package/scripts/epic/epic-audit-orphans.ts +1 -1
- package/scripts/epic/epic-audit.ts +6 -3
- package/scripts/epic/epic-blocked-by.ts +198 -0
- package/scripts/epic/epic-body.ts +6 -6
- package/scripts/epic/epic-bundle-apply.ts +41 -10
- package/scripts/epic/epic-bundle-cli.ts +40 -99
- package/scripts/epic/epic-bundle-evidence.ts +2 -2
- package/scripts/epic/epic-bundle-format.ts +21 -7
- package/scripts/epic/epic-bundle-recommend.ts +56 -0
- package/scripts/epic/epic-bundle-referenced.ts +42 -17
- package/scripts/epic/epic-bundle.ts +31 -4
- package/scripts/epic/epic-busy.ts +11 -9
- package/scripts/epic/epic-chains.ts +59 -23
- package/scripts/epic/epic-child-source.ts +111 -0
- package/scripts/epic/epic-cli-untrack.ts +38 -0
- package/scripts/epic/epic-cli.ts +26 -7
- package/scripts/epic/epic-close-comment.ts +4 -2
- package/scripts/epic/epic-close.ts +25 -11
- package/scripts/epic/epic-decide.ts +39 -3
- package/scripts/epic/epic-fetch.ts +116 -24
- package/scripts/epic/epic-graph.ts +1 -0
- package/scripts/epic/epic-label-age.ts +55 -13
- package/scripts/epic/epic-lane-occupancy.ts +75 -0
- package/scripts/epic/epic-lane-offer.ts +49 -13
- package/scripts/epic/epic-main.ts +23 -0
- package/scripts/epic/epic-next-main.ts +2 -4
- package/scripts/epic/epic-next-read.ts +12 -3
- package/scripts/epic/epic-next-views.ts +1 -1
- package/scripts/epic/epic-notify.ts +72 -0
- package/scripts/epic/epic-parse.ts +1 -1
- package/scripts/epic/epic-rank.ts +6 -2
- package/scripts/epic/epic-reference.ts +1 -1
- package/scripts/epic/epic-run.ts +14 -1
- package/scripts/epic/epic-shape.ts +2 -2
- package/scripts/epic/epic-solo-stale.ts +1 -1
- package/scripts/epic/epic-solo.ts +11 -5
- package/scripts/epic/epic-split-reach.ts +107 -0
- package/scripts/epic/epic-triage.ts +29 -5
- package/scripts/epic/epic-untrack-plan.ts +75 -0
- package/scripts/epic/epic-untrack.ts +42 -0
- package/scripts/epic/epic.ts +65 -31
- package/scripts/followup/followup-check-report.ts +70 -0
- package/scripts/followup/followup-ci-path.ts +27 -7
- package/scripts/followup/followup-coderabbit-retrigger.ts +61 -23
- package/scripts/followup/followup-failed-tests.ts +4 -0
- package/scripts/followup/followup-human-merge.ts +109 -0
- package/scripts/followup/followup-job-needs.ts +92 -14
- package/scripts/followup/followup-job-rerun.ts +162 -43
- package/scripts/followup/followup-run-rerun.ts +183 -0
- package/scripts/followup/followup-section.ts +30 -0
- package/scripts/followup/followup-ship-environment.ts +17 -0
- package/scripts/followup/git-followup-finish.ts +52 -1
- package/scripts/followup/git-followup-flush.ts +6 -8
- package/scripts/followup/git-followup-stages.ts +3 -0
- package/scripts/followup/git-followup-workflow.ts +29 -9
- package/scripts/followup/git-pr-followup-checks.ts +65 -8
- package/scripts/followup/git-pr-followup-wrapup.ts +11 -9
- package/scripts/followup/git-pr-followup.ts +18 -12
- package/scripts/fresh-machine/fresh-machine-cli.ts +2 -1
- package/scripts/fresh-machine/fresh-machine-image.ts +3 -1
- package/scripts/fresh-machine/fresh-machine-patterns.ts +25 -4
- package/scripts/fresh-machine/fresh-machine-registry.ts +85 -0
- package/scripts/fresh-machine/fresh-machine-script.ts +3 -1
- package/scripts/fresh-machine/fresh-machine-spec.ts +2 -2
- package/scripts/fresh-machine/specs/kit-test-backlogrun-python.json +0 -1
- package/scripts/fresh-machine/specs/kit-test-backlogrun.json +0 -1
- package/scripts/gate/busy-average.ts +26 -3
- package/scripts/gate/change-scope-action.ts +101 -0
- package/scripts/gate/check-inputs.ts +1 -1
- package/scripts/gate/check-related-order.ts +65 -0
- package/scripts/gate/check-related-pinned.ts +3 -2
- package/scripts/gate/check-related-reuse.ts +34 -6
- package/scripts/gate/check-related-section.ts +8 -1
- package/scripts/gate/check-related-unplanned.ts +11 -1
- package/scripts/gate/check-related.ts +122 -34
- package/scripts/gate/check-reuse.ts +63 -31
- package/scripts/gate/command-memory.ts +10 -4
- package/scripts/gate/core-admission.ts +34 -8
- package/scripts/gate/core-budget.ts +55 -65
- package/scripts/gate/core-priority.ts +28 -0
- package/scripts/gate/core-reservation.ts +85 -0
- package/scripts/gate/core-wait.ts +90 -19
- package/scripts/gate/core-weights.ts +25 -16
- package/scripts/gate/gate-checks.ts +196 -0
- package/scripts/gate/gate-labels.ts +4 -0
- package/scripts/gate/gate-plan.ts +34 -164
- package/scripts/gate/gate-report.ts +14 -10
- package/scripts/gate/gate-run-steps.ts +38 -6
- package/scripts/gate/gate-skip.ts +1 -1
- package/scripts/gate/gate-static-group.ts +35 -6
- package/scripts/gate/machine-capacity.ts +20 -25
- package/scripts/gate/metrics-totals.ts +30 -4
- package/scripts/gate/path-glob.ts +15 -0
- package/scripts/gate/pre-commit-type-check.ts +2 -6
- package/scripts/gate/project-checks.ts +33 -2
- package/scripts/gate/project-gate-steps.ts +206 -0
- package/scripts/gate/project-step-reuse.ts +69 -0
- package/scripts/gate/scoped-green.ts +10 -4
- package/scripts/gate/since-green.ts +76 -20
- package/scripts/gate/tree-verdict.ts +111 -0
- package/scripts/gate/tsc-arguments.ts +9 -0
- package/scripts/gate/type-check-command.ts +4 -7
- package/scripts/gate/type-check-step.ts +4 -1
- package/scripts/gate/type-program-serial.ts +52 -0
- package/scripts/gate/verification-gate.ts +47 -17
- package/scripts/gate/verification-inputs.ts +46 -11
- package/scripts/gate/whole-tree-reuse.ts +24 -0
- package/scripts/gh/gh-author-association.ts +40 -14
- package/scripts/gh/gh-call-kind.ts +97 -0
- package/scripts/gh/gh-comment-input.ts +26 -0
- package/scripts/gh/gh-core-rate-limit.ts +151 -0
- package/scripts/gh/gh-permission-cache.ts +44 -0
- package/scripts/gh/gh-request-tally.ts +143 -0
- package/scripts/gh/gh-spawn.ts +2 -2
- package/scripts/gh/gh-usage-cli.ts +71 -0
- package/scripts/gh/gh-usage-event.ts +82 -0
- package/scripts/gh/gh-usage-log.ts +48 -0
- package/scripts/gh/gh-usage-tally.ts +209 -0
- package/scripts/gh/git-gh-api-path.ts +17 -2
- package/scripts/gh/git-gh-blocked-by-graphql.ts +107 -0
- package/scripts/gh/git-gh-checks-failed-main.ts +24 -0
- package/scripts/gh/git-gh-checks-failed.ts +141 -0
- package/scripts/gh/git-gh-code-scanning.ts +81 -0
- package/scripts/gh/git-gh-conditional.ts +36 -4
- package/scripts/gh/git-gh-etag-read.ts +107 -0
- package/scripts/gh/git-gh-exec.ts +74 -25
- package/scripts/gh/git-gh-failure.ts +16 -2
- package/scripts/gh/git-gh-helpers.ts +2 -6
- package/scripts/gh/git-gh-issue-alias-graphql.ts +113 -0
- package/scripts/gh/git-gh-issue-batch-graphql.ts +155 -0
- package/scripts/gh/git-gh-issue-batch-read.ts +66 -0
- package/scripts/gh/git-gh-issue-graphql.ts +229 -0
- package/scripts/gh/git-gh-issue-list-graphql.ts +103 -0
- package/scripts/gh/git-gh-issue-list.ts +126 -34
- package/scripts/gh/git-gh-issue-memo.ts +53 -0
- package/scripts/gh/git-gh-issue-read.ts +87 -14
- package/scripts/gh/git-gh-issue-rest.ts +5 -8
- package/scripts/gh/git-gh-issue-write.ts +31 -10
- package/scripts/gh/git-gh-issue.ts +25 -4
- package/scripts/gh/git-gh-poll-read.ts +43 -18
- package/scripts/gh/git-gh-pr-auto-merge.ts +1 -4
- package/scripts/gh/git-gh-pr-graphql-snapshot.ts +369 -0
- package/scripts/gh/git-gh-pr-graphql-state.ts +21 -26
- package/scripts/gh/git-gh-pr-read.ts +4 -1
- package/scripts/gh/git-gh-pr-rollup.ts +10 -3
- package/scripts/gh/git-gh-pr-snapshot.ts +78 -22
- package/scripts/gh/git-gh-pr.ts +51 -17
- package/scripts/gh/git-gh-rate-limit.ts +91 -0
- package/scripts/gh/git-gh-repo.ts +37 -20
- package/scripts/gh/git-gh-retry.ts +60 -24
- package/scripts/gh/git-gh-spawn-width.ts +6 -0
- package/scripts/gh/git-gh-transport.ts +213 -0
- package/scripts/gh/git-pr-ai-review.ts +8 -5
- package/scripts/gh/git-pr-checks-eval.ts +16 -17
- package/scripts/gh/git-pr-checks-gate.ts +129 -0
- package/scripts/gh/git-pr-checks-missing.ts +165 -0
- package/scripts/gh/git-pr-checks-parse.ts +4 -0
- package/scripts/gh/git-pr-checks-watch.ts +22 -6
- package/scripts/gh/git-pr-checks.ts +105 -76
- package/scripts/gh/git-pr-merge-checked.ts +26 -12
- package/scripts/gh/git-pr.ts +9 -23
- package/scripts/git/base-tree.ts +18 -10
- package/scripts/git/changed-paths-sync.ts +4 -12
- package/scripts/git/changed-paths.ts +31 -6
- package/scripts/git/git-command.ts +9 -1
- package/scripts/git/git-common-directory.ts +17 -3
- package/scripts/git/git-issue.ts +3 -3
- package/scripts/git/git-merge-conflicts.ts +8 -3
- package/scripts/git/git-path-quoting.ts +54 -0
- package/scripts/git/git-push-transport.ts +8 -10
- package/scripts/git/git-schemas.ts +1 -0
- package/scripts/git/git-spawn-sync.ts +11 -7
- package/scripts/git/git-spawn.ts +1 -1
- package/scripts/git/git-ssh-keepalive.ts +3 -3
- package/scripts/git/git-workflow.ts +32 -9
- package/scripts/git/git-worktree.ts +12 -4
- package/scripts/git/main-merge.ts +3 -36
- package/scripts/git/main-sync.ts +2 -13
- package/scripts/git/repository-lock.ts +8 -7
- package/scripts/git/stash/git-stash.ts +38 -5
- package/scripts/git/stash/stash-pop-cli.ts +43 -6
- package/scripts/hooks/bash-revert.ts +253 -0
- package/scripts/hooks/batch-guard.ts +28 -16
- package/scripts/hooks/check-commit-message.ts +5 -7
- package/scripts/hooks/codex-hook-adapter.ts +58 -13
- package/scripts/hooks/direct-gh-usage.ts +130 -0
- package/scripts/hooks/edited-cspell.ts +8 -11
- package/scripts/hooks/fixtures/claude-Agent.json +16 -0
- package/scripts/hooks/fixtures/claude-Bash.json +12 -0
- package/scripts/hooks/fixtures/claude-Edit.json +17 -0
- package/scripts/hooks/fixtures/claude-Read.json +12 -0
- package/scripts/hooks/fixtures/claude-Write.json +12 -0
- package/scripts/hooks/fixtures/codex-Bash-cat.json +12 -0
- package/scripts/hooks/fixtures/codex-Bash.json +12 -0
- package/scripts/hooks/fixtures/codex-apply_patch.json +14 -0
- package/scripts/hooks/format-edited-cli.ts +8 -1
- package/scripts/hooks/format-edited-file.ts +33 -27
- package/scripts/hooks/hook-context.ts +22 -0
- package/scripts/hooks/hook-demoted.ts +84 -0
- package/scripts/hooks/hook-lap.ts +61 -0
- package/scripts/hooks/hook-ledger-cli.ts +246 -0
- package/scripts/hooks/hook-ledger-demote.ts +58 -0
- package/scripts/hooks/hook-ledger-issues.ts +61 -0
- package/scripts/hooks/hook-ledger-read.ts +97 -0
- package/scripts/hooks/hook-ledger.ts +163 -0
- package/scripts/hooks/implementation-authority.ts +48 -0
- package/scripts/hooks/implementation-shell-deny.ts +344 -0
- package/scripts/hooks/implementation-shell-nested.ts +148 -0
- package/scripts/hooks/implementation-shell.ts +253 -0
- package/scripts/hooks/lane-plan-guard.ts +1 -1
- package/scripts/hooks/pre-commit-lint.ts +10 -5
- package/scripts/hooks/pre-push-unit.ts +49 -13
- package/scripts/hooks/pretool-guard.ts +184 -70
- package/scripts/hooks/reserved-run.ts +13 -13
- package/scripts/hooks/run-hook.sh +84 -30
- package/scripts/hooks/step-zero-notice.ts +52 -14
- package/scripts/hooks/stop-actions.ts +10 -3
- package/scripts/hooks/stop-guard.ts +29 -8
- package/scripts/init/claude-kit-only-settings.ts +1 -1
- package/scripts/init/hook-command-rewrite.ts +90 -65
- package/scripts/init/hook-launch.ts +27 -22
- package/scripts/init/init-ai-copy.ts +14 -4
- package/scripts/init/init-bootstrap.ts +40 -8
- package/scripts/init/init-copy-content.ts +2 -2
- package/scripts/init/init-install.ts +9 -1
- package/scripts/init/init-logic-deploy-vps.ts +5 -3
- package/scripts/init/init-logic-workspace.ts +16 -1
- package/scripts/init/init-logic.ts +11 -18
- package/scripts/init/npm-publish-files.ts +25 -0
- package/scripts/init/start-setup-pr.ts +1 -1
- package/scripts/init/tsconfig-preset-migration.ts +5 -10
- package/scripts/issue/aggregation-split.ts +4 -2
- package/scripts/issue/already-done-citation.ts +103 -0
- package/scripts/issue/baseline-measure.ts +2 -1
- package/scripts/issue/behavior-change-lint.ts +5 -4
- package/scripts/issue/defect-origin-line.ts +11 -10
- package/scripts/issue/defect-origin.ts +4 -3
- package/scripts/issue/defect-rate.ts +2 -1
- package/scripts/issue/defect-report-format.ts +1 -1
- package/scripts/issue/effect-audit.ts +12 -11
- package/scripts/issue/enforcement-lint.ts +48 -0
- package/scripts/issue/expected-effect-lint.ts +6 -5
- package/scripts/issue/figure-source-lint.ts +59 -0
- package/scripts/issue/git-next-issues.ts +15 -17
- package/scripts/issue/issue-already-done-cli.ts +24 -4
- package/scripts/issue/issue-auto-ok.ts +23 -6
- package/scripts/issue/issue-body-cli.ts +75 -0
- package/scripts/issue/issue-body-keys.ts +223 -0
- package/scripts/issue/issue-body-or-comment.ts +1 -1
- package/scripts/issue/issue-bug-label.ts +5 -2
- package/scripts/issue/issue-cap-files.ts +111 -0
- package/scripts/issue/issue-cite-cli.ts +2 -2
- package/scripts/issue/issue-cite.ts +20 -3
- package/scripts/issue/issue-classification.ts +66 -7
- package/scripts/issue/issue-closing-pr.ts +51 -16
- package/scripts/issue/issue-consolidate-cli.ts +81 -0
- package/scripts/issue/issue-consolidate.ts +246 -0
- package/scripts/issue/issue-declared-size.ts +21 -0
- package/scripts/issue/issue-evidence-exit.ts +6 -3
- package/scripts/issue/issue-file-batch-entries.ts +107 -0
- package/scripts/issue/issue-file-batch.ts +206 -0
- package/scripts/issue/issue-file-cli.ts +147 -208
- package/scripts/issue/issue-file-fold.ts +4 -8
- package/scripts/issue/issue-file-interrupt.ts +68 -9
- package/scripts/issue/issue-file-lane-hint.ts +3 -2
- package/scripts/issue/issue-file-main.ts +17 -0
- package/scripts/issue/issue-file-pass.ts +242 -0
- package/scripts/issue/issue-file.ts +24 -5
- package/scripts/issue/issue-fold-apply.ts +102 -0
- package/scripts/issue/issue-fold-existing-cli.ts +226 -19
- package/scripts/issue/issue-human-stops.ts +102 -0
- package/scripts/issue/issue-labels.ts +14 -3
- package/scripts/issue/issue-lint-cli.ts +20 -6
- package/scripts/issue/issue-lint.ts +4 -6
- package/scripts/issue/issue-merged.ts +75 -9
- package/scripts/issue/issue-not-before.ts +34 -4
- package/scripts/issue/issue-number-shape.ts +8 -0
- package/scripts/issue/issue-plan-cli.ts +33 -5
- package/scripts/issue/issue-plan-notify.ts +100 -0
- package/scripts/issue/issue-premise-unmet-cli.ts +110 -0
- package/scripts/issue/issue-priority-cli.ts +103 -16
- package/scripts/issue/issue-priority-instructed.ts +55 -0
- package/scripts/issue/issue-priority-raise.ts +70 -12
- package/scripts/issue/issue-priority.ts +56 -16
- package/scripts/issue/issue-rank.ts +48 -15
- package/scripts/issue/issue-read-cli.ts +66 -33
- package/scripts/issue/issue-read.ts +20 -5
- package/scripts/issue/issue-release-class-cli.ts +79 -0
- package/scripts/issue/issue-report-failures.ts +14 -5
- package/scripts/issue/issue-run-hold.ts +13 -0
- package/scripts/issue/issue-run-verdict.ts +68 -0
- package/scripts/issue/issue-sample-gate.ts +18 -7
- package/scripts/issue/issue-sample-required.ts +20 -3
- package/scripts/issue/issue-sample-source.ts +2 -1
- package/scripts/issue/issue-scout-cli.ts +34 -18
- package/scripts/issue/issue-scout.ts +25 -4
- package/scripts/issue/issue-search.ts +3 -0
- package/scripts/issue/issue-sources.ts +98 -0
- package/scripts/issue/issue-spill-cli.ts +292 -0
- package/scripts/issue/issue-spill-main.ts +11 -0
- package/scripts/issue/issue-spill.ts +193 -0
- package/scripts/issue/issue-state-cli.ts +9 -17
- package/scripts/issue/issue-template-section.ts +8 -3
- package/scripts/issue/issue-tick-cli.ts +59 -0
- package/scripts/issue/issue-watch-diff.ts +22 -7
- package/scripts/issue/issue-watch-hook.ts +11 -9
- package/scripts/issue/issue-watch.ts +25 -5
- package/scripts/issue/issue-wip.ts +44 -9
- package/scripts/issue/markdown-section.ts +66 -10
- package/scripts/issue/measure-declaration.ts +70 -13
- package/scripts/issue/measure-rerun-cli.ts +9 -8
- package/scripts/issue/measure-twin.ts +37 -0
- package/scripts/issue/reproduction-measure.ts +2 -1
- package/scripts/issue/session-cite.ts +1 -1
- package/scripts/issue/size-estimate.ts +317 -22
- package/scripts/issue/trusted-measure-source.ts +43 -0
- package/scripts/issue/trusted-measure.ts +79 -35
- package/scripts/issue/upstream-interrupt-cli.ts +280 -0
- package/scripts/issue/upstream-interrupt-main.ts +11 -0
- package/scripts/josh/agent-session-environment.ts +19 -1
- package/scripts/josh/cli-body.ts +46 -9
- package/scripts/josh/command-usage.ts +3 -0
- package/scripts/josh/durable-state-migrate.ts +11 -4
- package/scripts/josh/durable-state-root.ts +60 -0
- package/scripts/josh/durable-state.ts +9 -44
- package/scripts/josh/hook-decision.ts +55 -113
- package/scripts/josh/hook-envelope.ts +62 -0
- package/scripts/josh/hook-payload-capture.ts +78 -0
- package/scripts/josh/hook-tool-payload.ts +15 -0
- package/scripts/josh/josh-aliases.ts +7 -0
- package/scripts/josh/josh-command-map.ts +15 -0
- package/scripts/josh/josh-command-types.ts +28 -4
- package/scripts/josh/josh-commands-agent-hooks.ts +39 -7
- package/scripts/josh/josh-commands-ai.ts +420 -9
- package/scripts/josh/josh-commands-backlog.ts +79 -11
- package/scripts/josh/josh-commands-clone.ts +2 -5
- package/scripts/josh/josh-commands-development.ts +25 -8
- package/scripts/josh/josh-commands-document.ts +22 -10
- package/scripts/josh/josh-commands-epic.ts +30 -11
- package/scripts/josh/josh-commands-hooks.ts +0 -1
- package/scripts/josh/josh-commands-issue-write.ts +190 -18
- package/scripts/josh/josh-commands-issue.ts +57 -17
- package/scripts/josh/josh-commands-lint.ts +52 -19
- package/scripts/josh/josh-commands-maintenance.ts +37 -4
- package/scripts/josh/josh-commands-pause.ts +53 -5
- package/scripts/josh/josh-commands-prime.ts +28 -0
- package/scripts/josh/josh-commands-progress.ts +59 -7
- package/scripts/josh/josh-commands-project.ts +8 -5
- package/scripts/josh/josh-commands-review.ts +83 -5
- package/scripts/josh/josh-commands-run.ts +20 -31
- package/scripts/josh/josh-commands-ship.ts +95 -13
- package/scripts/josh/josh-commands-test-check.ts +0 -2
- package/scripts/josh/josh-commands-versioning.ts +11 -2
- package/scripts/josh/josh-commands-workflow.ts +41 -11
- package/scripts/josh/josh-completion-scripts.ts +81 -0
- package/scripts/josh/josh-completion.ts +29 -0
- package/scripts/josh/josh-environment-file.ts +8 -10
- package/scripts/josh/josh-gh-usage.ts +53 -0
- package/scripts/josh/josh-in-process.ts +21 -21
- package/scripts/josh/josh-logic.ts +22 -46
- package/scripts/josh/josh-read-only.ts +51 -0
- package/scripts/josh/josh-run.ts +30 -6
- package/scripts/josh/josh.ts +9 -11
- package/scripts/josh/path-decision.ts +2 -2
- package/scripts/josh/process-identity.ts +5 -0
- package/scripts/josh/session-handoff-line.ts +88 -0
- package/scripts/josh/session-language-cli.ts +18 -4
- package/scripts/josh/session-model-record.ts +62 -0
- package/scripts/lane/historical-evidence.ts +136 -0
- package/scripts/lane/historical-log-evidence.ts +47 -0
- package/scripts/lane/lane-adopt-cli.ts +1 -1
- package/scripts/lane/lane-await.ts +8 -3
- package/scripts/lane/lane-breakdown-calls.ts +165 -0
- package/scripts/lane/lane-breakdown-cli.ts +77 -9
- package/scripts/lane/lane-breakdown-estimate.ts +136 -0
- package/scripts/lane/lane-breakdown-implement.ts +166 -29
- package/scripts/lane/lane-breakdown-laps.ts +116 -24
- package/scripts/lane/lane-breakdown-pause.ts +127 -0
- package/scripts/lane/lane-breakdown-pinned.ts +19 -3
- package/scripts/lane/lane-breakdown-related.ts +40 -0
- package/scripts/lane/lane-breakdown-text.ts +129 -15
- package/scripts/lane/lane-breakdown.ts +194 -30
- package/scripts/lane/lane-broker-server.ts +1 -1
- package/scripts/lane/lane-capacity.ts +27 -16
- package/scripts/lane/lane-chain-stop-stats.ts +110 -0
- package/scripts/lane/lane-check-stats.ts +25 -5
- package/scripts/lane/lane-child-invocation.ts +9 -9
- package/scripts/lane/lane-ci-path-stats.ts +15 -4
- package/scripts/lane/lane-cli.ts +2 -2
- package/scripts/lane/lane-concurrency-stats.ts +110 -0
- package/scripts/lane/lane-cut-stats.ts +101 -0
- package/scripts/lane/lane-dispatch.ts +25 -20
- package/scripts/lane/lane-early-push-stats.ts +25 -0
- package/scripts/lane/lane-environment.ts +2 -2
- package/scripts/lane/lane-gap-stats.ts +69 -8
- package/scripts/lane/lane-guard-policy.ts +1 -1
- package/scripts/lane/lane-hand-back-held.ts +51 -0
- package/scripts/lane/lane-hand-back-hold.ts +103 -0
- package/scripts/lane/lane-held-stats.ts +13 -1
- package/scripts/lane/lane-implement-rate-read.ts +50 -0
- package/scripts/lane/lane-implement-rate.ts +74 -0
- package/scripts/lane/lane-implement-read.ts +129 -0
- package/scripts/lane/lane-implement-signals-record.ts +56 -0
- package/scripts/lane/lane-implement-signals.ts +161 -0
- package/scripts/lane/lane-implement-stats.ts +93 -18
- package/scripts/lane/lane-launch-admission.ts +61 -0
- package/scripts/lane/lane-launch-cli.ts +63 -27
- package/scripts/lane/lane-launch-pending.ts +44 -0
- package/scripts/lane/lane-ledger-archive.ts +200 -0
- package/scripts/lane/lane-ledger-kind.ts +5 -0
- package/scripts/lane/lane-ledger-pinned-origin.ts +10 -0
- package/scripts/lane/lane-ledger-schema-load.ts +45 -0
- package/scripts/lane/lane-ledger-schema-offer.ts +30 -0
- package/scripts/lane/lane-ledger-schema-ship.ts +70 -4
- package/scripts/lane/lane-ledger-schema.ts +53 -30
- package/scripts/lane/lane-ledger-tail.ts +124 -0
- package/scripts/lane/lane-ledger-write.ts +60 -27
- package/scripts/lane/lane-ledger.ts +6 -31
- package/scripts/lane/lane-limit-cli.ts +11 -1
- package/scripts/lane/lane-limit-history.ts +77 -0
- package/scripts/lane/lane-limit-override.ts +49 -8
- package/scripts/lane/lane-listening-ports.ts +77 -0
- package/scripts/lane/lane-load.ts +62 -2
- package/scripts/lane/lane-measure-cli.ts +134 -55
- package/scripts/lane/lane-net-read.ts +22 -10
- package/scripts/lane/lane-net-time.ts +103 -18
- package/scripts/lane/lane-open.ts +19 -113
- package/scripts/lane/lane-over-causes.ts +130 -0
- package/scripts/lane/lane-over.ts +177 -0
- package/scripts/lane/lane-overrun-prompt.ts +4 -3
- package/scripts/lane/lane-overrun.ts +22 -9
- package/scripts/lane/lane-pairs.ts +128 -0
- package/scripts/lane/lane-paths.ts +26 -0
- package/scripts/lane/lane-pause-cli.ts +4 -2
- package/scripts/lane/lane-paused-spans.ts +11 -4
- package/scripts/lane/lane-phase.ts +36 -7
- package/scripts/lane/lane-plan-approval.ts +113 -0
- package/scripts/lane/lane-plan-auto.ts +53 -0
- package/scripts/lane/lane-plan-check.ts +196 -54
- package/scripts/lane/lane-plan-cli.ts +37 -10
- package/scripts/lane/lane-plan-imports.ts +53 -0
- package/scripts/lane/lane-plan-premise.ts +83 -0
- package/scripts/lane/lane-plan-probe.ts +115 -0
- package/scripts/lane/lane-plan-signals.ts +119 -0
- package/scripts/lane/lane-plan-size.ts +389 -0
- package/scripts/lane/lane-plan-wait-event.ts +124 -0
- package/scripts/lane/lane-plan-wait-until.ts +22 -0
- package/scripts/lane/lane-plan-wait.ts +125 -0
- package/scripts/lane/lane-plan.ts +113 -14
- package/scripts/lane/lane-preserve.ts +58 -13
- package/scripts/lane/lane-process-load.ts +130 -19
- package/scripts/lane/lane-process-stats.ts +51 -10
- package/scripts/lane/lane-reap.ts +4 -2
- package/scripts/lane/lane-registry.ts +19 -14
- package/scripts/lane/lane-relaunch.ts +32 -14
- package/scripts/lane/lane-report.ts +2 -0
- package/scripts/lane/lane-resolve-cli.ts +88 -0
- package/scripts/lane/lane-resolve-hunks.ts +63 -0
- package/scripts/lane/lane-resolve-record.ts +59 -0
- package/scripts/lane/lane-resolve.ts +122 -0
- package/scripts/lane/lane-restart.ts +1 -1
- package/scripts/lane/lane-room.ts +58 -0
- package/scripts/lane/lane-round-one-stats.ts +2 -1
- package/scripts/lane/lane-sampler.ts +53 -3
- package/scripts/lane/lane-seat-ownership.ts +57 -0
- package/scripts/lane/lane-seat-start.ts +52 -0
- package/scripts/lane/lane-seat-stop.ts +20 -0
- package/scripts/lane/lane-seat.ts +174 -0
- package/scripts/lane/lane-seed.ts +2 -5
- package/scripts/lane/lane-session-action.ts +26 -10
- package/scripts/lane/lane-session-broker.ts +1 -1
- package/scripts/lane/lane-session-reread.ts +2 -1
- package/scripts/lane/lane-setup.ts +59 -0
- package/scripts/lane/lane-ship-lap-stats.ts +3 -1
- package/scripts/lane/lane-sinks-issues.ts +52 -0
- package/scripts/lane/lane-sinks.ts +165 -0
- package/scripts/lane/lane-size-record.ts +39 -0
- package/scripts/lane/lane-size-stats.ts +111 -0
- package/scripts/lane/lane-split-stats.ts +33 -9
- package/scripts/lane/lane-stage-budget.ts +27 -0
- package/scripts/lane/lane-stage-stats.ts +94 -25
- package/scripts/lane/lane-state-record.ts +74 -0
- package/scripts/lane/lane-state.ts +21 -33
- package/scripts/lane/lane-stats-request.ts +163 -0
- package/scripts/lane/lane-stats-tables.ts +44 -3
- package/scripts/lane/lane-stats.ts +9 -2
- package/scripts/lane/lane-stop-stats.ts +3 -2
- package/scripts/lane/lane-test-related-stats.ts +5 -2
- package/scripts/lane/lane-timeline.ts +251 -0
- package/scripts/lane/lane-transcript-calls.ts +73 -4
- package/scripts/lane/lane-transcript-stats.ts +8 -3
- package/scripts/lane/lane-turn-stats.ts +171 -0
- package/scripts/lane/lane-value-cell.ts +87 -13
- package/scripts/lane/lane-value-missing.ts +21 -0
- package/scripts/lane/lane-why-causes.ts +102 -0
- package/scripts/lane/lane-why-ci.ts +50 -0
- package/scripts/lane/lane-why-cli.ts +83 -0
- package/scripts/lane/lane-why-period.ts +187 -0
- package/scripts/lane/lane-why-ship.ts +67 -0
- package/scripts/lane/lane-why.ts +192 -0
- package/scripts/lane/lane-withdraw.ts +12 -1
- package/scripts/lane/lane-yield-split.ts +218 -0
- package/scripts/lane/lane-yield.ts +38 -4
- package/scripts/lane/openai-lane-ship.ts +2 -2
- package/scripts/lane/openai-lane-supervisor-cli.ts +17 -8
- package/scripts/lane/openai-lane-supervisor-decision.ts +10 -4
- package/scripts/lane/openai-lane-supervisor-entry.ts +6 -0
- package/scripts/lane/openai-lane-supervisor-owner.ts +19 -3
- package/scripts/lane/openai-lane-supervisor.ts +26 -4
- package/scripts/lane/process-directories.ts +3 -1
- package/scripts/lane/process-lane-marks.ts +11 -5
- package/scripts/lane/process-linux.ts +81 -0
- package/scripts/lane/process-tools.ts +2 -5
- package/scripts/lib/bounded-pool.ts +38 -7
- package/scripts/lib/buffered-process.ts +34 -9
- package/scripts/lib/claude-installer.ts +29 -0
- package/scripts/lib/import-closure.ts +72 -0
- package/scripts/lib/josh-temporary-directory.ts +7 -0
- package/scripts/lib/main-guard.ts +29 -0
- package/scripts/lib/package-manifest.ts +54 -3
- package/scripts/lib/pnpm-installer.ts +16 -0
- package/scripts/lib/poll.ts +130 -20
- package/scripts/lib/schemas.ts +1 -1
- package/scripts/lib/stamped-memo.ts +1 -1
- package/scripts/lib/stamped-store.ts +82 -0
- package/scripts/lib/stdin-text.ts +68 -0
- package/scripts/lib/timeouts.ts +4 -4
- package/scripts/lib/transcript-record.ts +4 -0
- package/scripts/lib/verified-download.ts +17 -0
- package/scripts/lines/bytes-command.ts +1 -1
- package/scripts/lint/cspell-cached.ts +1 -1
- package/scripts/lint/eslint-cache-dependencies.ts +38 -8
- package/scripts/lint/eslint-daemon-calls.ts +83 -0
- package/scripts/lint/eslint-daemon.ts +101 -13
- package/scripts/lint/eslint-heap.ts +50 -0
- package/scripts/lint/eslint-memory.js +45 -0
- package/scripts/lint/eslint-trim.ts +44 -0
- package/scripts/lint/eslint-warm.ts +5 -2
- package/scripts/lint/format.ts +30 -5
- package/scripts/lint/import-graph-store.ts +245 -0
- package/scripts/lint/import-graph.ts +54 -65
- package/scripts/lint/import-move.ts +275 -0
- package/scripts/lint/import-test-inputs.ts +97 -0
- package/scripts/lint/lint-gate-scope.ts +1 -0
- package/scripts/lint/lint-parallel.ts +148 -43
- package/scripts/lint/lint-related-scope.ts +6 -1
- package/scripts/lint/lint-related.ts +66 -25
- package/scripts/lint/lint-rule.ts +293 -0
- package/scripts/lint/lint-shard.ts +91 -0
- package/scripts/lint/lint-timing.ts +39 -0
- package/scripts/lint/rename-cli.ts +36 -10
- package/scripts/lint/rename-identifier.ts +2 -2
- package/scripts/lint/type-only-imports.ts +20 -1
- package/scripts/notify/git-notify.ts +3 -1
- package/scripts/notify/telegram-notify.ts +33 -35
- package/scripts/notify/telegram-test.ts +9 -4
- package/scripts/observations/observation-depth-cli.ts +78 -0
- package/scripts/observations/observation-depth.ts +85 -0
- package/scripts/observations/observation-ledger-home.ts +14 -7
- package/scripts/observations/observations-flush-landing.ts +1 -1
- package/scripts/overrides/overrides-check.ts +33 -10
- package/scripts/overrides/overrides-diff-report.ts +91 -0
- package/scripts/overrides/overrides-diff.ts +98 -0
- package/scripts/package/package-scout-cli.ts +37 -11
- package/scripts/package/package-scout-format.ts +20 -6
- package/scripts/package/package-scout-reuse.ts +207 -0
- package/scripts/plan/plan-scaffold-cli.ts +125 -0
- package/scripts/plan/plan-scaffold.ts +112 -0
- package/scripts/ports/port-command.ts +2 -5
- package/scripts/propagate/propagate-git.ts +3 -3
- package/scripts/propagate/propagate-publish.ts +8 -7
- package/scripts/propagate/propagate-steps.ts +2 -3
- package/scripts/refactor/import-graph.ts +2 -4
- package/scripts/refactor/refactor-lint.ts +47 -30
- package/scripts/refactor/refactor-scan.ts +16 -9
- package/scripts/refactor/refactor-targets.ts +2 -3
- package/scripts/release/github-release.ts +10 -10
- package/scripts/release/publish-tag-cli.ts +13 -3
- package/scripts/release/release-cli.ts +2 -0
- package/scripts/release/release-progress.ts +44 -36
- package/scripts/release/release-request.ts +42 -0
- package/scripts/release/release-scope-cli.ts +31 -2
- package/scripts/release/release-workflow-check.ts +59 -0
- package/scripts/report/markdown-shape.ts +2 -1
- package/scripts/report/report-template-cli.ts +2 -2
- package/scripts/report/report-template.ts +17 -4
- package/scripts/review/acceptance-map.ts +87 -8
- package/scripts/review/diff-summary-cli.ts +81 -0
- package/scripts/review/diff-summary.ts +109 -0
- package/scripts/review/disposition-batch-filing.ts +150 -0
- package/scripts/review/disposition-batch.ts +103 -0
- package/scripts/review/disposition-cli.ts +35 -1
- package/scripts/review/import-specifiers.ts +38 -0
- package/scripts/review/prose-stale-cli.ts +7 -37
- package/scripts/review/prose-stale-read.ts +105 -0
- package/scripts/review/prose-stale-scan.ts +121 -17
- package/scripts/review/removed-tests-check.ts +28 -4
- package/scripts/review/review-brief-cli.ts +69 -71
- package/scripts/review/review-brief.ts +38 -42
- package/scripts/review/review-code-tree.ts +80 -16
- package/scripts/review/review-comment-carry.ts +30 -0
- package/scripts/review/review-diff-pack.ts +70 -0
- package/scripts/review/review-diff-write.ts +23 -22
- package/scripts/review/review-final-record.ts +47 -0
- package/scripts/review/review-finding-ledger.ts +72 -10
- package/scripts/review/review-findings-cli.ts +88 -8
- package/scripts/review/review-fix-hunks.ts +115 -0
- package/scripts/review/review-fix-round.ts +144 -0
- package/scripts/review/review-gate-mode.ts +25 -0
- package/scripts/review/review-interaction.ts +69 -11
- package/scripts/review/review-lane-handover.ts +29 -4
- package/scripts/review/review-level.ts +35 -34
- package/scripts/review/review-lint-findings.ts +3 -3
- package/scripts/review/review-lint-sections.ts +2 -2
- package/scripts/review/review-lint.ts +7 -1
- package/scripts/review/review-pair-cli.ts +157 -0
- package/scripts/review/review-pair-log.ts +75 -0
- package/scripts/review/review-pair-session.ts +98 -0
- package/scripts/review/review-pair.ts +112 -0
- package/scripts/review/review-prior-findings.ts +2 -4
- package/scripts/review/review-prompt-level.ts +28 -0
- package/scripts/review/review-readers-scan.ts +25 -3
- package/scripts/review/review-record-cli.ts +46 -68
- package/scripts/review/review-record-interaction.ts +2 -2
- package/scripts/review/review-record-main.ts +7 -2
- package/scripts/review/review-record-pinned.ts +5 -0
- package/scripts/review/review-record-slot.ts +155 -0
- package/scripts/review/review-reviewed-tree.ts +60 -13
- package/scripts/review/review-round-one-blobs.ts +43 -9
- package/scripts/review/review-round-one-skip.ts +72 -0
- package/scripts/review/review-round-reuse.ts +13 -6
- package/scripts/review/review-round.ts +57 -0
- package/scripts/review/review-round2-cli.ts +5 -0
- package/scripts/review/review-round2-skip-comment.ts +3 -1
- package/scripts/review/review-round2.ts +18 -6
- package/scripts/review/review-size.ts +92 -0
- package/scripts/review/review-stamps.ts +8 -0
- package/scripts/review/review-submit-args.ts +91 -0
- package/scripts/review/review-submit-cli.ts +55 -29
- package/scripts/review/selfcheck-cli.ts +193 -0
- package/scripts/review/selfcheck-commands.ts +175 -0
- package/scripts/review/selfcheck-report.ts +98 -0
- package/scripts/rules/bash-triggers.ts +24 -13
- package/scripts/rules/broad-investigation-shell.ts +183 -0
- package/scripts/rules/broad-investigation.ts +116 -0
- package/scripts/rules/consultation-handoff.ts +81 -0
- package/scripts/rules/consultation-investigation.ts +99 -0
- package/scripts/rules/decision-oracle.ts +1 -1
- package/scripts/rules/delivered-rules-guard.ts +94 -0
- package/scripts/rules/delivered-rules.ts +46 -87
- package/scripts/rules/destructive-command.ts +2 -1
- package/scripts/rules/direct-git-status.ts +81 -0
- package/scripts/rules/direct-issue-comment.ts +9 -1
- package/scripts/rules/direct-vitest-run.ts +98 -0
- package/scripts/rules/egress-guard.ts +308 -0
- package/scripts/rules/firing-point.ts +9 -12
- package/scripts/rules/gh-api.ts +19 -4
- package/scripts/rules/gh-repo-selector.ts +1 -1
- package/scripts/rules/git-argv.ts +57 -10
- package/scripts/rules/guard-remedy.ts +9 -0
- package/scripts/rules/guard-rule-rows.ts +13 -0
- package/scripts/rules/implementation-cut-verdict.ts +1 -1
- package/scripts/rules/implementation-cut.ts +94 -31
- package/scripts/rules/interpreter-options.ts +179 -0
- package/scripts/rules/investigator-foreground.ts +13 -7
- package/scripts/rules/josh-git-bare.ts +1 -1
- package/scripts/rules/keychain-read.ts +73 -0
- package/scripts/rules/lane-background.ts +15 -14
- package/scripts/rules/lane-carry-conflict.ts +15 -8
- package/scripts/rules/lane-direct-tool.ts +18 -11
- package/scripts/rules/lane-interactive-ask.ts +3 -5
- package/scripts/rules/lane-park.ts +25 -10
- package/scripts/rules/lane-spilled-read.ts +3 -5
- package/scripts/rules/lane-split-park.ts +7 -6
- package/scripts/rules/lane-switch-main.ts +10 -3
- package/scripts/rules/launched-call.ts +135 -0
- package/scripts/rules/main-model.ts +54 -0
- package/scripts/rules/nested-commands.ts +71 -0
- package/scripts/rules/permission-guards.ts +6 -2
- package/scripts/rules/pr-merge.ts +1 -1
- package/scripts/rules/pre-gate-cut.ts +20 -11
- package/scripts/rules/protected-files.ts +34 -98
- package/scripts/rules/repeat-check-related.ts +66 -0
- package/scripts/rules/reviewer-foreground.ts +11 -7
- package/scripts/rules/round-one-check-related.ts +59 -19
- package/scripts/rules/rule-list.ts +3 -4
- package/scripts/rules/rule-rephrase.ts +43 -0
- package/scripts/rules/rule-rewrite.ts +16 -6
- package/scripts/rules/rule-value-cache.ts +10 -1
- package/scripts/rules/rule-value-cli.ts +62 -54
- package/scripts/rules/rule-value-prose.ts +186 -0
- package/scripts/rules/rule-value-runs.ts +171 -0
- package/scripts/rules/rule-value.ts +38 -13
- package/scripts/rules/run-tail-rule.ts +19 -2
- package/scripts/rules/secret-paths.ts +92 -0
- package/scripts/rules/sed-in-place.ts +1 -1
- package/scripts/rules/shell-permissions.ts +91 -0
- package/scripts/rules/shell-redirects.ts +54 -0
- package/scripts/rules/shell-segments.ts +3 -2
- package/scripts/rules/stop-decision.ts +7 -1
- package/scripts/rules/stop-rules.ts +1 -1
- package/scripts/rules/unasked-filing.ts +158 -0
- package/scripts/run/add/run-add-cli.ts +114 -36
- package/scripts/run/add/run-add-epic.ts +45 -0
- package/scripts/run/add/run-add-issue.ts +17 -0
- package/scripts/run/add/run-add.ts +159 -21
- package/scripts/run/attached-log.ts +38 -0
- package/scripts/run/board/run-board-cli.ts +34 -9
- package/scripts/run/board/run-board-closed-graphql.ts +129 -0
- package/scripts/run/board/run-board-closed.ts +68 -10
- package/scripts/run/board/run-board-decision-graphql.ts +136 -0
- package/scripts/run/board/run-board-decision-read.ts +195 -0
- package/scripts/run/board/run-board-decision.ts +92 -0
- package/scripts/run/board/run-board-earlier.ts +27 -3
- package/scripts/run/board/run-board-ending-reason.ts +98 -9
- package/scripts/run/board/run-board-ending-states.ts +34 -0
- package/scripts/run/board/run-board-every.ts +19 -9
- package/scripts/run/board/run-board-first-lane.ts +26 -0
- package/scripts/run/board/run-board-fit.ts +47 -11
- package/scripts/run/board/run-board-fold-store.ts +62 -0
- package/scripts/run/board/run-board-fold.ts +41 -9
- package/scripts/run/board/run-board-gather-live.ts +2 -0
- package/scripts/run/board/run-board-gather-thread.ts +14 -3
- package/scripts/run/board/run-board-gather-worker.ts +10 -8
- package/scripts/run/board/run-board-gather.ts +10 -3
- package/scripts/run/board/run-board-github.ts +117 -29
- package/scripts/run/board/run-board-header.ts +33 -24
- package/scripts/run/board/run-board-held.ts +53 -0
- package/scripts/run/board/run-board-human-merge.ts +113 -0
- package/scripts/run/board/run-board-human.ts +37 -0
- package/scripts/run/board/run-board-idle.ts +9 -6
- package/scripts/run/board/run-board-issue-count.ts +101 -0
- package/scripts/run/board/run-board-keys.ts +19 -4
- package/scripts/run/board/run-board-labels.ts +20 -4
- package/scripts/run/board/run-board-lane-event.ts +23 -2
- package/scripts/run/board/run-board-lane-result.ts +58 -0
- package/scripts/run/board/run-board-lane-state.ts +52 -7
- package/scripts/run/board/run-board-lane-stop.ts +108 -0
- package/scripts/run/board/run-board-lane-time.ts +1 -0
- package/scripts/run/board/run-board-layout.ts +64 -74
- package/scripts/run/board/run-board-link.ts +42 -2
- package/scripts/run/board/run-board-notes.ts +1 -1
- package/scripts/run/board/run-board-now.ts +1 -1
- package/scripts/run/board/run-board-operation-codex.ts +37 -0
- package/scripts/run/board/run-board-operation-read.ts +2 -2
- package/scripts/run/board/run-board-operation.ts +8 -5
- package/scripts/run/board/run-board-plan-shared.ts +3 -0
- package/scripts/run/board/run-board-plan.ts +6 -1
- package/scripts/run/board/run-board-process-groups.ts +1 -1
- package/scripts/run/board/run-board-quota-held.ts +319 -0
- package/scripts/run/board/run-board-quota-lane.ts +23 -0
- package/scripts/run/board/run-board-quota-read.ts +422 -0
- package/scripts/run/board/run-board-quota-spent.ts +162 -0
- package/scripts/run/board/run-board-quota-status.ts +67 -0
- package/scripts/run/board/run-board-read.ts +112 -36
- package/scripts/run/board/run-board-reason.ts +40 -20
- package/scripts/run/board/run-board-render-condition.ts +18 -2
- package/scripts/run/board/run-board-render-drawn.ts +5 -1
- package/scripts/run/board/run-board-render-foot.ts +5 -1
- package/scripts/run/board/run-board-render-found.ts +21 -2
- package/scripts/run/board/run-board-render-icon.ts +3 -6
- package/scripts/run/board/run-board-render-lanes.ts +49 -9
- package/scripts/run/board/run-board-render-lead.ts +20 -1
- package/scripts/run/board/run-board-render-legend.ts +4 -0
- package/scripts/run/board/run-board-render-none.ts +35 -0
- package/scripts/run/board/run-board-render-notes.ts +5 -3
- package/scripts/run/board/run-board-render-processes.ts +6 -5
- package/scripts/run/board/run-board-render-quota-cell.ts +81 -0
- package/scripts/run/board/run-board-render-quota-github.ts +112 -0
- package/scripts/run/board/run-board-render-quota.ts +285 -0
- package/scripts/run/board/run-board-render-section.ts +50 -6
- package/scripts/run/board/run-board-render-tail.ts +53 -7
- package/scripts/run/board/run-board-render-throughput.ts +140 -0
- package/scripts/run/board/run-board-render-title.ts +26 -4
- package/scripts/run/board/run-board-render.ts +59 -57
- package/scripts/run/board/run-board-row-yield.ts +1 -0
- package/scripts/run/board/run-board-scope.ts +13 -6
- package/scripts/run/board/run-board-seat.ts +107 -0
- package/scripts/run/board/run-board-settle.ts +33 -0
- package/scripts/run/board/run-board-setup.ts +30 -15
- package/scripts/run/board/run-board-single.ts +123 -0
- package/scripts/run/board/run-board-snapshot.ts +7 -1
- package/scripts/run/board/run-board-span.ts +18 -3
- package/scripts/run/board/run-board-spin.ts +12 -6
- package/scripts/run/board/run-board-standing-waits.ts +52 -0
- package/scripts/run/board/run-board-state.ts +23 -0
- package/scripts/run/board/run-board-status.ts +86 -99
- package/scripts/run/board/run-board-throughput.ts +215 -0
- package/scripts/run/board/run-board-tick.ts +76 -30
- package/scripts/run/board/run-board-usage-read.ts +3 -3
- package/scripts/run/board/run-board-usage-top.ts +12 -35
- package/scripts/run/board/run-board-usual.ts +18 -1
- package/scripts/run/carry/run-carry-added.ts +6 -1
- package/scripts/run/carry/run-carry-args.ts +22 -8
- package/scripts/run/carry/run-carry-cli.ts +31 -1
- package/scripts/run/carry/run-carry-conversation.ts +12 -4
- package/scripts/run/carry/run-carry-ended.ts +3 -0
- package/scripts/run/carry/run-carry-reclaim.ts +2 -1
- package/scripts/run/carry/run-carry.ts +40 -20
- package/scripts/run/cut/run-cut-adoption.ts +67 -0
- package/scripts/run/cut/run-cut-cli.ts +88 -34
- package/scripts/run/cut/run-cut-decline.ts +1 -1
- package/scripts/run/cut/run-cut-handoff.ts +2 -1
- package/scripts/run/cut/run-cut-next.ts +20 -0
- package/scripts/run/cut/run-cut-ready.ts +7 -5
- package/scripts/run/cut/run-cut-report.ts +13 -14
- package/scripts/run/cut/run-cut-resume.ts +1 -1
- package/scripts/run/cut/run-cut.ts +36 -23
- package/scripts/run/detached-launch.ts +12 -7
- package/scripts/run/early-push-record.ts +22 -0
- package/scripts/run/entry/run-entry-children.ts +126 -0
- package/scripts/run/entry/run-entry-cli.ts +126 -82
- package/scripts/run/entry/run-entry-dispatch.ts +20 -0
- package/scripts/run/entry/run-entry-lane-plan.ts +39 -0
- package/scripts/run/entry/run-entry-spill.ts +67 -22
- package/scripts/run/entry/run-entry-stop.ts +9 -8
- package/scripts/run/entry/run-entry-sync.ts +149 -0
- package/scripts/run/entry/run-entry-trust.ts +1 -1
- package/scripts/run/entry/run-entry.ts +9 -0
- package/scripts/run/event/run-event-checks.ts +1 -1
- package/scripts/run/event/run-event-filed.ts +1 -1
- package/scripts/run/event/run-event-follow.ts +9 -5
- package/scripts/run/event/run-event-overrun.ts +7 -7
- package/scripts/run/event/run-event-plan.ts +1 -1
- package/scripts/run/event/run-event-render.ts +5 -0
- package/scripts/run/event/run-event-retry.ts +34 -0
- package/scripts/run/event/run-event-scope.ts +4 -1
- package/scripts/run/event/run-event-setup.ts +55 -5
- package/scripts/run/event/run-event-step.ts +81 -0
- package/scripts/run/event/run-event-stream-emit.ts +63 -23
- package/scripts/run/event/run-event-stream.ts +69 -21
- package/scripts/run/event/run-event-tail.ts +122 -0
- package/scripts/run/event/run-event-watch.ts +12 -7
- package/scripts/run/handoff/run-handoff-args.ts +93 -0
- package/scripts/run/handoff/run-handoff-cli.ts +320 -0
- package/scripts/run/handoff/run-handoff-final.ts +38 -0
- package/scripts/run/handoff/run-handoff-launch.ts +113 -0
- package/scripts/run/handoff/run-handoff-retrospective.ts +48 -0
- package/scripts/run/handoff-lanes/run-handoff-lanes-cli.ts +31 -0
- package/scripts/run/handoff-lanes/run-handoff-lanes.ts +183 -0
- package/scripts/run/hold/run-hold-block.ts +35 -0
- package/scripts/run/hold/run-hold-cli.ts +20 -36
- package/scripts/run/hold/run-hold-main.ts +16 -1
- package/scripts/run/hold/run-hold.ts +12 -8
- package/scripts/run/hold/run-stop-notify.ts +1 -1
- package/scripts/run/launch-priority.ts +4 -7
- package/scripts/run/merge/run-merge-auth.ts +38 -13
- package/scripts/run/merge/run-merge-cap.ts +11 -6
- package/scripts/run/merge/run-merge-cli.ts +55 -58
- package/scripts/run/merge/run-merge-dated.ts +64 -0
- package/scripts/run/merge/run-merge-decision.ts +183 -0
- package/scripts/run/merge/run-merge-driver.ts +2 -0
- package/scripts/run/merge/run-merge-github-limit.ts +98 -0
- package/scripts/run/merge/run-merge-health.ts +137 -0
- package/scripts/run/merge/run-merge-human-review.ts +26 -0
- package/scripts/run/merge/run-merge-restart.ts +10 -3
- package/scripts/run/merge/run-merge-signals.ts +34 -9
- package/scripts/run/merge/run-merge-steps.ts +49 -50
- package/scripts/run/merge/run-merge-token.ts +3 -4
- package/scripts/run/merge/run-merge-usage-limit.ts +22 -9
- package/scripts/run/merge/run-merge-withdrawn.ts +4 -3
- package/scripts/run/merge/run-merge.ts +36 -18
- package/scripts/run/park/run-park-answered.ts +84 -0
- package/scripts/run/park/run-park-body.ts +346 -0
- package/scripts/run/park/run-park-cli.ts +37 -12
- package/scripts/run/park/run-park-lane.ts +41 -0
- package/scripts/run/park/run-park-release.ts +61 -0
- package/scripts/run/park/run-park-write.ts +41 -0
- package/scripts/run/park/run-park.ts +2 -4
- package/scripts/run/park/run-stalled-park.ts +32 -0
- package/scripts/run/park/run-stalled.ts +75 -12
- package/scripts/run/pause/run-pause-cli.ts +4 -3
- package/scripts/run/pause/run-pause-comment.ts +30 -0
- package/scripts/run/pause/run-pause.ts +35 -223
- package/scripts/run/pause/run-set-aside-commit.ts +52 -0
- package/scripts/run/pause/run-set-aside.ts +139 -0
- package/scripts/run/prime/run-prime-cli.ts +105 -0
- package/scripts/run/progress/run-progress-cli.ts +44 -27
- package/scripts/run/progress/run-progress-config.ts +7 -18
- package/scripts/run/progress/run-progress.ts +16 -7
- package/scripts/run/review/run-chain-cli.ts +162 -0
- package/scripts/run/review/run-chain-join.ts +108 -0
- package/scripts/run/review/run-chain-review-fix.ts +70 -0
- package/scripts/run/review/run-chain.ts +167 -0
- package/scripts/run/review/run-review-cli.ts +127 -53
- package/scripts/run/review/run-review-early-push.ts +41 -7
- package/scripts/run/review/run-review-join-ready.ts +88 -0
- package/scripts/run/review/run-review-pinned-accepted.ts +15 -1
- package/scripts/run/review/run-review-pinned-join.ts +8 -4
- package/scripts/run/review/run-review-pinned-steps.ts +12 -7
- package/scripts/run/review/run-review-pinned.ts +8 -3
- package/scripts/run/review/run-review-steps.ts +29 -14
- package/scripts/run/review/run-review-unplanned.ts +75 -0
- package/scripts/run/review/run-review.ts +4 -4
- package/scripts/run/run-halfrun-resume.ts +9 -1
- package/scripts/run/run-headless-keys.ts +23 -0
- package/scripts/run/run-headless.ts +77 -13
- package/scripts/run/run-investigation-record.ts +66 -0
- package/scripts/run/run-label-main.ts +55 -0
- package/scripts/run/run-label.ts +20 -4
- package/scripts/run/run-liveness-cli.ts +1 -1
- package/scripts/run/run-liveness.ts +6 -5
- package/scripts/run/run-maintenance.ts +66 -0
- package/scripts/run/run-open-pr.ts +19 -0
- package/scripts/run/run-parent-cut-hook.ts +17 -9
- package/scripts/run/run-pickup-cli.ts +86 -0
- package/scripts/run/run-pickup-launch.ts +85 -0
- package/scripts/run/run-poll-hook.ts +14 -7
- package/scripts/run/run-pr-return.ts +99 -0
- package/scripts/run/run-prep-cli.ts +54 -7
- package/scripts/run/run-prep-locate.ts +8 -3
- package/scripts/run/run-prep-summary.ts +55 -0
- package/scripts/run/run-prep.ts +37 -1
- package/scripts/run/run-report-cli.ts +13 -2
- package/scripts/run/run-report-end.ts +133 -0
- package/scripts/run/run-report-handoff.ts +1 -1
- package/scripts/run/run-report.ts +7 -1
- package/scripts/run/run-stage-read.ts +38 -4
- package/scripts/run/run-stage.ts +18 -6
- package/scripts/run/run-status.ts +2 -1
- package/scripts/run/run-step-cli.ts +38 -10
- package/scripts/run/run-step-lane-plan.ts +26 -12
- package/scripts/run/run-step-progress.ts +61 -0
- package/scripts/run/run-step-section-driver.ts +27 -0
- package/scripts/run/run-step-section-once.ts +83 -0
- package/scripts/run/run-step-section-table.ts +120 -0
- package/scripts/run/run-step-section.ts +39 -53
- package/scripts/run/run-step.ts +4 -3
- package/scripts/run/run-stop-notify.ts +1 -1
- package/scripts/run/run-tail-cli.ts +14 -6
- package/scripts/run/run-tail.ts +22 -0
- package/scripts/run/run-watcher-guard.ts +15 -5
- package/scripts/run/run-watcher-hook.ts +12 -6
- package/scripts/run/ship/run-ship-args.ts +8 -1
- package/scripts/run/ship/run-ship-cli.ts +68 -65
- package/scripts/run/ship/run-ship-conflict-probe.ts +12 -14
- package/scripts/run/ship/run-ship-detach-wait.ts +25 -0
- package/scripts/run/ship/run-ship-detach.ts +29 -35
- package/scripts/run/ship/run-ship-early-push.ts +34 -0
- package/scripts/run/ship/run-ship-evidence-cli.ts +133 -0
- package/scripts/run/ship/run-ship-evidence.ts +71 -0
- package/scripts/run/ship/run-ship-final-review.ts +28 -0
- package/scripts/run/ship/run-ship-gate-runs.ts +58 -0
- package/scripts/run/ship/run-ship-group.ts +38 -0
- package/scripts/run/ship/run-ship-handover.ts +1 -1
- package/scripts/run/ship/run-ship-lap.ts +100 -12
- package/scripts/run/ship/run-ship-narrowed.ts +104 -0
- package/scripts/run/ship/run-ship-next.ts +3 -3
- package/scripts/run/ship/run-ship-pair-runs.ts +127 -0
- package/scripts/run/ship/run-ship-place.ts +9 -8
- package/scripts/run/ship/run-ship-planned.ts +1 -1
- package/scripts/run/ship/run-ship-pre-detach-pinned.ts +7 -1
- package/scripts/run/ship/run-ship-pre-detach.ts +18 -12
- package/scripts/run/ship/run-ship-preflight-reuse.ts +53 -0
- package/scripts/run/ship/run-ship-preflight.ts +21 -2
- package/scripts/run/ship/run-ship-probe.ts +5 -15
- package/scripts/run/ship/run-ship-record-wait.ts +30 -0
- package/scripts/run/ship/run-ship-relaunch-cap.ts +107 -14
- package/scripts/run/ship/run-ship-relaunch.ts +7 -1
- package/scripts/run/ship/run-ship-removed-rows.ts +34 -10
- package/scripts/run/ship/run-ship-reship.ts +125 -0
- package/scripts/run/ship/run-ship-return.ts +68 -22
- package/scripts/run/ship/run-ship-review-checkpoint.ts +112 -0
- package/scripts/run/ship/run-ship-review-reason.ts +3 -1
- package/scripts/run/ship/run-ship-review-steps.ts +80 -31
- package/scripts/run/ship/run-ship-review.ts +13 -9
- package/scripts/run/ship/run-ship-reviewer.ts +59 -7
- package/scripts/run/ship/run-ship-scoped.ts +232 -21
- package/scripts/run/ship/run-ship-stage.ts +3 -5
- package/scripts/run/ship/run-ship-steps.ts +65 -20
- package/scripts/run/ship/run-ship-stop-cause.ts +52 -1
- package/scripts/run/ship/run-ship-stop-context.ts +5 -5
- package/scripts/run/ship/run-ship-stop-text.ts +1 -1
- package/scripts/run/ship/run-ship-supervised.ts +38 -0
- package/scripts/run/ship/run-ship-sync.ts +114 -19
- package/scripts/run/ship/run-ship-synced-scope.ts +162 -58
- package/scripts/run/ship/run-ship-tree-stamp.ts +35 -0
- package/scripts/run/ship/run-ship-wait-cli.ts +23 -25
- package/scripts/run/ship/run-ship-wait-main.ts +12 -0
- package/scripts/run/ship/run-ship-waiter.ts +8 -6
- package/scripts/run/ship/run-ship.ts +12 -0
- package/scripts/run/split/run-split-cli.ts +134 -0
- package/scripts/run/split/run-split-prerequisite.ts +75 -0
- package/scripts/run/split/run-split.ts +213 -0
- package/scripts/run/stale/run-stale-cli.ts +86 -0
- package/scripts/run/stale/run-stale-main.ts +7 -0
- package/scripts/run/stale/run-stale.ts +117 -0
- package/scripts/run/tidy/run-tidy-cli.ts +24 -2
- package/scripts/run/tree-status-cli.ts +131 -0
- package/scripts/run/tree-status.ts +77 -0
- package/scripts/run/ts-entry-loader.ts +34 -0
- package/scripts/run/wake/run-wake-await.ts +22 -2
- package/scripts/run/wake/run-wake-cli.ts +3 -3
- package/scripts/run/wake/run-wake-describe.ts +1 -1
- package/scripts/run/wake/run-wake-driver.ts +158 -61
- package/scripts/run/wake/run-wake-handoff.ts +65 -14
- package/scripts/run/wake/run-wake-loop.ts +63 -23
- package/scripts/run/wake/run-wake-ports.ts +99 -17
- package/scripts/run/wake/run-wake-resume.ts +98 -0
- package/scripts/run/wake/run-wake-session.ts +16 -14
- package/scripts/run/wake/run-wake-window.ts +15 -0
- package/scripts/run/wake/run-wake.ts +7 -6
- package/scripts/safe-chain/preinstall-command.ts +3 -6
- package/scripts/safe-chain/project-config.ts +2 -2
- package/scripts/security/security-audit-cache.ts +157 -0
- package/scripts/security/security-audit-main.ts +4 -2
- package/scripts/security/security-audit-provision-logic.ts +4 -4
- package/scripts/security/security-audit-provision-main.ts +19 -5
- package/scripts/split/declared-growth.ts +22 -0
- package/scripts/split/split-assess.ts +220 -37
- package/scripts/split/split-child-recover-cli.ts +118 -0
- package/scripts/split/split-direction.ts +172 -0
- package/scripts/split/split-measure.ts +28 -14
- package/scripts/split/split-relocations.ts +108 -0
- package/scripts/split/split-resolution.ts +63 -61
- package/scripts/sync/claude-settings-merge.ts +8 -4
- package/scripts/sync/managed-config-scope.ts +13 -1
- package/scripts/sync/sync-ai-files.ts +2 -2
- package/scripts/sync/sync-configs.ts +3 -5
- package/scripts/test/test-e2e-guard.ts +2 -1
- package/scripts/test/test-inputs.ts +119 -0
- package/scripts/test/test-no-base.ts +35 -16
- package/scripts/test/test-pinned-cache-logic.ts +4 -0
- package/scripts/test/test-pinned-cache.ts +8 -15
- package/scripts/test/test-pinned-carry.ts +93 -0
- package/scripts/test/test-pinned-emit.ts +2 -1
- package/scripts/test/test-pinned-ledger.ts +15 -9
- package/scripts/test/test-pinned-logic.ts +66 -4
- package/scripts/test/test-pinned-main.ts +6 -30
- package/scripts/test/test-pinned-moves.ts +43 -0
- package/scripts/test/test-pinned-probe.ts +61 -17
- package/scripts/test/test-pinned-prune-logic.ts +2 -1
- package/scripts/test/test-pinned-reach.ts +11 -3
- package/scripts/test/test-pinned-record.ts +36 -4
- package/scripts/test/test-pinned-snapshot.ts +110 -0
- package/scripts/test/test-pinned-spawn.ts +32 -7
- package/scripts/test/test-pinned-stage.ts +43 -16
- package/scripts/test/test-pinned-type-check.ts +110 -0
- package/scripts/test/test-pinned.ts +92 -35
- package/scripts/test/test-red-logic.ts +40 -2
- package/scripts/test/test-red.ts +131 -19
- package/scripts/test/test-related-cap.ts +182 -0
- package/scripts/test/test-related-main.ts +2 -4
- package/scripts/test/test-related-pins.ts +33 -0
- package/scripts/test/test-related-record.ts +84 -8
- package/scripts/test/test-related-red.ts +218 -0
- package/scripts/test/test-related-reuse.ts +167 -0
- package/scripts/test/test-related-run.ts +144 -0
- package/scripts/test/test-related-synced.ts +31 -8
- package/scripts/test/test-related-touched.ts +10 -5
- package/scripts/test/test-related-verdict.ts +127 -0
- package/scripts/test/test-related-whole.ts +22 -0
- package/scripts/test/test-related.ts +123 -146
- package/scripts/test/test-type-logic.ts +1 -2
- package/scripts/test/test-unit-guard.ts +12 -3
- package/scripts/test/unit-count-file.ts +25 -1
- package/scripts/test/unit-lane-count.ts +63 -0
- package/scripts/test/unit-run-marker.ts +11 -1
- package/scripts/test/unit-update-arguments.ts +73 -0
- package/scripts/test/unit-worker-share.ts +28 -13
- package/scripts/test/whole-suite-files.ts +2 -0
- package/scripts/time-runtime/guard-rephrase.ts +66 -0
- package/scripts/time-runtime/time-agent-bundles.ts +5 -5
- package/scripts/time-runtime/time-bundle-call.ts +2 -2
- package/scripts/time-runtime/time-bundles.ts +2 -2
- package/scripts/time-runtime/time-command-key.ts +2 -5
- package/scripts/time-runtime/time-density-hook.ts +2 -31
- package/scripts/time-runtime/time-format.ts +4 -4
- package/scripts/time-runtime/time-josh-names.ts +51 -0
- package/scripts/time-runtime/time-markers.ts +4 -4
- package/scripts/time-runtime/time-phase-names.ts +2 -2
- package/scripts/time-runtime/time-shell.ts +28 -17
- package/scripts/time-runtime/time-single-check.ts +4 -4
- package/scripts/time-runtime/time-spans.ts +8 -8
- package/scripts/time-runtime/time-tool-call.ts +4 -3
- package/scripts/time-runtime/time-transcript-block.ts +172 -0
- package/scripts/time-runtime/time-transcript-line.ts +26 -158
- package/scripts/time-runtime/transcript-tail.ts +39 -0
- package/scripts/ui/ui-shot-cli.ts +90 -0
- package/scripts/ui/ui-shot.ts +95 -0
- package/scripts/usage/usage-state-path.ts +22 -0
- package/scripts/usage/usage-tee-cli.ts +5 -0
- package/scripts/usage/usage-tee.ts +48 -0
- package/scripts/version/development-engines-verdict.ts +7 -1
- package/scripts/version/fresh-metadata-cache.ts +4 -3
- package/scripts/version/latest-corepack.ts +3 -3
- package/scripts/version/latest-if-required-cli.ts +32 -4
- package/scripts/version/latest-scope-cli.ts +12 -2
- package/scripts/version/latest-stamp.ts +5 -4
- package/scripts/version/npm-registry.ts +19 -0
- package/scripts/version/playwright-browsers.ts +1 -1
- package/scripts/version/release-hold.ts +2 -2
- package/scripts/version/upgrade-command-guard.ts +1 -1
- package/templates/prettierignore.basic +3 -0
- package/templates/sonar-project.properties +2 -1
- package/templates/workflows/ci.yml +5 -4
- package/tsconfig/base.json +1 -0
- package/dist/hooks/chunk-3GKE653K.js +0 -6204
- package/dist/hooks/chunk-45CJJOO7.js +0 -1243
- package/dist/hooks/chunk-5PM2JRGV.js +0 -7780
- package/dist/hooks/chunk-7SIUNQXK.js +0 -3591
- package/dist/hooks/chunk-Z6DQJKH3.js +0 -2806
- package/prompts/collaboration-workflow.md +0 -28
- package/scripts/epic/epic-bundle-poll.ts +0 -41
- package/scripts/josh/josh-commands-lane.ts +0 -310
- package/scripts/josh/josh-commands-split.ts +0 -28
- package/scripts/review/review-lint-cli.ts +0 -57
- package/scripts/split/split-early-notice.ts +0 -116
|
@@ -0,0 +1,3054 @@
|
|
|
1
|
+
import {
|
|
2
|
+
error_text,
|
|
3
|
+
repo_discovery,
|
|
4
|
+
repo_origin
|
|
5
|
+
} from "./chunk-LRD2ERRI.js";
|
|
6
|
+
import {
|
|
7
|
+
agent_provider,
|
|
8
|
+
durable_state,
|
|
9
|
+
file_reader,
|
|
10
|
+
issue_number_shape,
|
|
11
|
+
lane_ledger_write,
|
|
12
|
+
process_identity,
|
|
13
|
+
run_carry
|
|
14
|
+
} from "./chunk-FOW4B7OQ.js";
|
|
15
|
+
import {
|
|
16
|
+
MS_PER_MINUTE,
|
|
17
|
+
PROBE_TIMEOUT_MS,
|
|
18
|
+
durable_state_root,
|
|
19
|
+
external_exports,
|
|
20
|
+
git_command,
|
|
21
|
+
git_common_directory,
|
|
22
|
+
git_diff_reads,
|
|
23
|
+
git_spawn,
|
|
24
|
+
json_value,
|
|
25
|
+
stamp_file
|
|
26
|
+
} from "./chunk-CY3ADSDR.js";
|
|
27
|
+
|
|
28
|
+
// scripts/time-runtime/transcript-tail.ts
|
|
29
|
+
import { closeSync, fstatSync, openSync, readSync } from "node:fs";
|
|
30
|
+
var TAIL_BYTES = 262144;
|
|
31
|
+
var FILE_START = 0;
|
|
32
|
+
function read_tail(file_path, max_bytes = TAIL_BYTES) {
|
|
33
|
+
const descriptor = openSync(file_path, "r");
|
|
34
|
+
try {
|
|
35
|
+
const { size } = fstatSync(descriptor);
|
|
36
|
+
const length = Math.min(size, max_bytes);
|
|
37
|
+
const buffer = Buffer.alloc(length);
|
|
38
|
+
const read3 = readSync(descriptor, buffer, FILE_START, length, size - length);
|
|
39
|
+
return buffer.subarray(FILE_START, read3).toString("utf8");
|
|
40
|
+
} finally {
|
|
41
|
+
closeSync(descriptor);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
var transcript_tail = { TAIL_BYTES, read_tail };
|
|
45
|
+
|
|
46
|
+
// scripts/josh/josh-environment-file.ts
|
|
47
|
+
import { readFileSync } from "node:fs";
|
|
48
|
+
import { parseEnv } from "node:util";
|
|
49
|
+
|
|
50
|
+
// ports/index.js
|
|
51
|
+
import { existsSync } from "node:fs";
|
|
52
|
+
import path from "node:path";
|
|
53
|
+
var PORT_SEED_KEY = "PORT_SEED";
|
|
54
|
+
var LANE_SEAT_KEY = "JOSH_LANE_SEAT";
|
|
55
|
+
var ENV_FILE_NAME = ".env";
|
|
56
|
+
var PACKAGE_FILE_NAME = "package.json";
|
|
57
|
+
var PROJECT_ENVIRONMENT_KEYS = /* @__PURE__ */ new Set([PORT_SEED_KEY, LANE_SEAT_KEY, "PLAYWRIGHT_REUSE_SERVER"]);
|
|
58
|
+
var DEV_PORT_BASE = 5173;
|
|
59
|
+
var PREVIEW_PORT_BASE = 4173;
|
|
60
|
+
var MIN_SEED = 0;
|
|
61
|
+
var SEED_LANE_MULTIPLIER = 10;
|
|
62
|
+
var MAX_LANE = 9;
|
|
63
|
+
var MAX_SEED = 99;
|
|
64
|
+
var INTEGER_PATTERN = /^\d+$/u;
|
|
65
|
+
function fail_invalid(key, raw, max) {
|
|
66
|
+
throw new Error(
|
|
67
|
+
`${key} must be an integer between ${MIN_SEED} and ${max}, got ${JSON.stringify(raw)}. Unset it to use the default ports (dev ${DEV_PORT_BASE}, preview ${PREVIEW_PORT_BASE}).`
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
function read_trimmed(environment, key) {
|
|
71
|
+
const raw = environment[key];
|
|
72
|
+
return raw === void 0 ? "" : raw.trim();
|
|
73
|
+
}
|
|
74
|
+
function resolve_bounded(environment, key, max) {
|
|
75
|
+
const trimmed = read_trimmed(environment, key);
|
|
76
|
+
if (trimmed.length === 0) return MIN_SEED;
|
|
77
|
+
if (!INTEGER_PATTERN.test(trimmed)) fail_invalid(key, trimmed, max);
|
|
78
|
+
const value = Number(trimmed);
|
|
79
|
+
if (value > max) fail_invalid(key, trimmed, max);
|
|
80
|
+
return value;
|
|
81
|
+
}
|
|
82
|
+
function resolve_seed(environment = process.env) {
|
|
83
|
+
return resolve_bounded(environment, PORT_SEED_KEY, MAX_SEED);
|
|
84
|
+
}
|
|
85
|
+
function resolve_lane(environment = process.env) {
|
|
86
|
+
return resolve_bounded(environment, LANE_SEAT_KEY, MAX_LANE);
|
|
87
|
+
}
|
|
88
|
+
function resolve_offset(environment = process.env) {
|
|
89
|
+
return resolve_seed(environment) * SEED_LANE_MULTIPLIER + resolve_lane(environment);
|
|
90
|
+
}
|
|
91
|
+
function offset_from(base, environment) {
|
|
92
|
+
return base + resolve_offset(environment);
|
|
93
|
+
}
|
|
94
|
+
function resolve_development_port(environment = process.env) {
|
|
95
|
+
return offset_from(DEV_PORT_BASE, environment);
|
|
96
|
+
}
|
|
97
|
+
function resolve_preview_port(environment = process.env) {
|
|
98
|
+
return offset_from(PREVIEW_PORT_BASE, environment);
|
|
99
|
+
}
|
|
100
|
+
function resolve_project_directory(directory) {
|
|
101
|
+
const start = path.resolve(directory);
|
|
102
|
+
let current = start;
|
|
103
|
+
while (!existsSync(path.join(current, PACKAGE_FILE_NAME))) {
|
|
104
|
+
const parent = path.dirname(current);
|
|
105
|
+
if (parent === current) return start;
|
|
106
|
+
current = parent;
|
|
107
|
+
}
|
|
108
|
+
return current;
|
|
109
|
+
}
|
|
110
|
+
function discard_loaded_keys(snapshot) {
|
|
111
|
+
for (const key of Object.keys(process.env)) {
|
|
112
|
+
if (!PROJECT_ENVIRONMENT_KEYS.has(key) && !Object.hasOwn(snapshot, key)) {
|
|
113
|
+
Reflect.deleteProperty(process.env, key);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function load_environment_file(directory = process.cwd()) {
|
|
118
|
+
const file = path.join(resolve_project_directory(directory), ENV_FILE_NAME);
|
|
119
|
+
if (!existsSync(file)) return false;
|
|
120
|
+
const snapshot = { ...process.env };
|
|
121
|
+
process.loadEnvFile(file);
|
|
122
|
+
discard_loaded_keys(snapshot);
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
var ports = {
|
|
126
|
+
load_environment_file,
|
|
127
|
+
resolve_project_directory,
|
|
128
|
+
resolve_seed,
|
|
129
|
+
resolve_lane,
|
|
130
|
+
resolve_development_port,
|
|
131
|
+
resolve_preview_port
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// scripts/josh/josh-command-types.ts
|
|
135
|
+
var OPTIONAL_ENV_FILE_FLAGS = [`--env-file-if-exists=${ENV_FILE_NAME}`];
|
|
136
|
+
var GATE_COMMAND = "gate";
|
|
137
|
+
var ESLINT_CACHE_FILE = ".eslintcache";
|
|
138
|
+
var TS_BUILD_INFO_FILE = ".tsbuildinfo";
|
|
139
|
+
var CSPELL_CACHE_FILE = ".cspellcache";
|
|
140
|
+
var ESLINT_EDIT_CACHE_FILE = ".eslintcache.edit";
|
|
141
|
+
var ESLINT_RELATED_CACHE_FILE = ".eslintcache.related";
|
|
142
|
+
var PRETTIER_CACHE_FILE = ".prettiercache";
|
|
143
|
+
var PRETTIER_RELATED_CACHE_FILE = ".prettiercache.related";
|
|
144
|
+
var CSPELL_COMMIT_CACHE_FILE = ".cspellcache.commit";
|
|
145
|
+
var ESLINT_COMMIT_CACHE_FILE = ".eslintcache.commit";
|
|
146
|
+
var ROOTED_JSON_PORTABILITY = "rooted-json";
|
|
147
|
+
var ESLINT_CACHE_SPEC = {
|
|
148
|
+
cache_file: ESLINT_CACHE_FILE,
|
|
149
|
+
portability: ROOTED_JSON_PORTABILITY
|
|
150
|
+
};
|
|
151
|
+
var TS_CACHE_SPEC = {
|
|
152
|
+
cache_file: TS_BUILD_INFO_FILE,
|
|
153
|
+
portability: "raw"
|
|
154
|
+
};
|
|
155
|
+
var CSPELL_CACHE_SPEC = {
|
|
156
|
+
cache_file: CSPELL_CACHE_FILE,
|
|
157
|
+
portability: "raw"
|
|
158
|
+
};
|
|
159
|
+
var GATE_CACHE_SPECS = [
|
|
160
|
+
ESLINT_CACHE_SPEC,
|
|
161
|
+
TS_CACHE_SPEC,
|
|
162
|
+
CSPELL_CACHE_SPEC
|
|
163
|
+
];
|
|
164
|
+
var GATE_CACHE_FILES = GATE_CACHE_SPECS.map((spec) => spec.cache_file);
|
|
165
|
+
var IGNORED_CACHE_FILES = [
|
|
166
|
+
...GATE_CACHE_FILES,
|
|
167
|
+
ESLINT_EDIT_CACHE_FILE,
|
|
168
|
+
ESLINT_RELATED_CACHE_FILE,
|
|
169
|
+
PRETTIER_CACHE_FILE,
|
|
170
|
+
PRETTIER_RELATED_CACHE_FILE,
|
|
171
|
+
CSPELL_COMMIT_CACHE_FILE,
|
|
172
|
+
ESLINT_COMMIT_CACHE_FILE
|
|
173
|
+
];
|
|
174
|
+
var CONTENT_CACHE_FLAGS = ["--cache", "--cache-strategy", "content"];
|
|
175
|
+
var CACHE_LOCATION_FLAG = "--cache-location";
|
|
176
|
+
function content_cache_flags(cache_file) {
|
|
177
|
+
return [...CONTENT_CACHE_FLAGS, CACHE_LOCATION_FLAG, cache_file];
|
|
178
|
+
}
|
|
179
|
+
var ESLINT_CACHE_FLAGS = content_cache_flags(ESLINT_CACHE_FILE);
|
|
180
|
+
var ESLINT_EDIT_CACHE_FLAGS = content_cache_flags(ESLINT_EDIT_CACHE_FILE);
|
|
181
|
+
var ESLINT_RELATED_CACHE_FLAGS = content_cache_flags(ESLINT_RELATED_CACHE_FILE);
|
|
182
|
+
var CSPELL_CACHE_FLAGS = content_cache_flags(CSPELL_CACHE_FILE);
|
|
183
|
+
var PRETTIER_CACHE_FLAGS = content_cache_flags(PRETTIER_CACHE_FILE);
|
|
184
|
+
var PRETTIER_RELATED_CACHE_FLAGS = content_cache_flags(PRETTIER_RELATED_CACHE_FILE);
|
|
185
|
+
var CSPELL_COMMIT_CACHE_FLAGS = content_cache_flags(CSPELL_COMMIT_CACHE_FILE);
|
|
186
|
+
var ESLINT_COMMIT_CACHE_FLAGS = content_cache_flags(ESLINT_COMMIT_CACHE_FILE);
|
|
187
|
+
var LINT_RULE_DIRECTORY = "node_modules/.cache/josh/lint-rule";
|
|
188
|
+
var LINT_RULE_CACHE_FILE = `${LINT_RULE_DIRECTORY}/.eslintcache`;
|
|
189
|
+
var LINT_RULE_CACHE_FLAGS = content_cache_flags(LINT_RULE_CACHE_FILE);
|
|
190
|
+
var LINT_RULE_PATHS_CACHE_FILE = `${LINT_RULE_DIRECTORY}/.eslintcache-paths`;
|
|
191
|
+
var LINT_RULE_PATHS_CACHE_FLAGS = content_cache_flags(LINT_RULE_PATHS_CACHE_FILE);
|
|
192
|
+
var LINT_RULE_WORKERS = 2;
|
|
193
|
+
|
|
194
|
+
// scripts/josh/josh-environment-file.ts
|
|
195
|
+
var LAUNCH_ONLY_KEY = /^JOSH_(?:\w+_GUARD|\w+_FORCE|SCOPED_GREEN)$/u;
|
|
196
|
+
function is_launch_only_key(key) {
|
|
197
|
+
return LAUNCH_ONLY_KEY.test(key);
|
|
198
|
+
}
|
|
199
|
+
function read_environment_file() {
|
|
200
|
+
try {
|
|
201
|
+
return readFileSync(ENV_FILE_NAME, "utf8");
|
|
202
|
+
} catch {
|
|
203
|
+
return "";
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function load_environment_file2() {
|
|
207
|
+
const entries = Object.entries(parseEnv(read_environment_file()));
|
|
208
|
+
for (const [key, value] of entries) {
|
|
209
|
+
if (!is_launch_only_key(key) && process.env[key] === void 0) process.env[key] = value;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
function apply_node_flags(flags) {
|
|
213
|
+
const [environment_flag] = OPTIONAL_ENV_FILE_FLAGS;
|
|
214
|
+
if (!flags.includes(environment_flag ?? "")) return flags;
|
|
215
|
+
load_environment_file2();
|
|
216
|
+
return flags.filter((flag) => flag !== environment_flag);
|
|
217
|
+
}
|
|
218
|
+
var josh_environment_file = {
|
|
219
|
+
apply_node_flags,
|
|
220
|
+
is_launch_only_key,
|
|
221
|
+
load_environment_file: load_environment_file2
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
// scripts/josh/session-language.ts
|
|
225
|
+
var ENV_KEY = "JOSH_SESSION_LANG";
|
|
226
|
+
var DEFAULT_SESSION_LANG = "ja";
|
|
227
|
+
function resolve_session_lang() {
|
|
228
|
+
const value = process.env[ENV_KEY]?.trim();
|
|
229
|
+
if (value) return { lang: value, is_default: false };
|
|
230
|
+
return { lang: DEFAULT_SESSION_LANG, is_default: true };
|
|
231
|
+
}
|
|
232
|
+
function is_japanese(lang) {
|
|
233
|
+
return lang.toLowerCase().startsWith(DEFAULT_SESSION_LANG);
|
|
234
|
+
}
|
|
235
|
+
var session_language = { DEFAULT_SESSION_LANG, ENV_KEY, resolve_session_lang, is_japanese };
|
|
236
|
+
|
|
237
|
+
// scripts/issue/issue-cite.ts
|
|
238
|
+
var GITHUB_URL_PREFIX = "https://github.com/";
|
|
239
|
+
var ISSUE_PATH = "/issues/";
|
|
240
|
+
var SUMMARY_SEPARATOR = " \u2014 ";
|
|
241
|
+
var REPO_QUALIFIED = /^([^\s/#]+\/[^\s/#]+)#(\d+)$/u;
|
|
242
|
+
var BARE_NUMBER = /^#?(\d+)$/u;
|
|
243
|
+
function plain(number, repo = "") {
|
|
244
|
+
return `${repo}#${String(number)}`;
|
|
245
|
+
}
|
|
246
|
+
function plain_for(_reason, number, repo = "") {
|
|
247
|
+
return plain(number, repo);
|
|
248
|
+
}
|
|
249
|
+
function issue_url(slug, number) {
|
|
250
|
+
return `${GITHUB_URL_PREFIX}${slug}${ISSUE_PATH}${number}`;
|
|
251
|
+
}
|
|
252
|
+
function citation_line(slug, number, summary) {
|
|
253
|
+
return `[${plain(number)}](${issue_url(slug, number)})${SUMMARY_SEPARATOR}${summary}`;
|
|
254
|
+
}
|
|
255
|
+
function reference(slug, number, title) {
|
|
256
|
+
if (slug === void 0) return plain(number);
|
|
257
|
+
return title === void 0 ? `[${plain(number)}](${issue_url(slug, number)})` : citation_line(slug, number, title);
|
|
258
|
+
}
|
|
259
|
+
function citer(slug, titles) {
|
|
260
|
+
return function cite(number) {
|
|
261
|
+
return reference(slug, number, titles.get(number));
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
function qualified_target(token) {
|
|
265
|
+
const match = REPO_QUALIFIED.exec(token);
|
|
266
|
+
if (match === null) return void 0;
|
|
267
|
+
const [, repo = "", number = ""] = match;
|
|
268
|
+
return { number, repo };
|
|
269
|
+
}
|
|
270
|
+
function bare_target(token, default_repo) {
|
|
271
|
+
const match = BARE_NUMBER.exec(token);
|
|
272
|
+
if (match === null) return void 0;
|
|
273
|
+
const [, number = ""] = match;
|
|
274
|
+
return { number, repo: default_repo };
|
|
275
|
+
}
|
|
276
|
+
function parse_target(token, default_repo) {
|
|
277
|
+
return qualified_target(token) ?? bare_target(token, default_repo);
|
|
278
|
+
}
|
|
279
|
+
function label(target2) {
|
|
280
|
+
return plain(target2.number, target2.repo);
|
|
281
|
+
}
|
|
282
|
+
function missing_line(target2) {
|
|
283
|
+
return `\u2716 ${label(target2)}: issue does not resolve \u2014 check the number and the repository`;
|
|
284
|
+
}
|
|
285
|
+
function unreadable_line(target2) {
|
|
286
|
+
return `\u2716 ${label(target2)}: could not be read \u2014 a rate limit, expired auth, or a dropped connection`;
|
|
287
|
+
}
|
|
288
|
+
function no_repo_line(target2) {
|
|
289
|
+
return `\u2716 ${label(target2)}: could not read this repository \u2014 check gh auth and the origin remote`;
|
|
290
|
+
}
|
|
291
|
+
var issue_cite = {
|
|
292
|
+
citation_line,
|
|
293
|
+
citer,
|
|
294
|
+
issue_url,
|
|
295
|
+
missing_line,
|
|
296
|
+
no_repo_line,
|
|
297
|
+
parse_target,
|
|
298
|
+
plain_for,
|
|
299
|
+
reference,
|
|
300
|
+
unreadable_line
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
// scripts/run/ship/run-ship-stage.ts
|
|
304
|
+
var STAGE = {
|
|
305
|
+
PREFLIGHT: "preflight",
|
|
306
|
+
REVIEW: "review",
|
|
307
|
+
GATE: "gate",
|
|
308
|
+
SYNC: "sync",
|
|
309
|
+
COMMIT: "commit",
|
|
310
|
+
ROUND_TWO: "round-2",
|
|
311
|
+
FOLLOWUP: "followup",
|
|
312
|
+
REPORT: "report"
|
|
313
|
+
};
|
|
314
|
+
var PHASE = {
|
|
315
|
+
START: "start",
|
|
316
|
+
DONE: "done",
|
|
317
|
+
FAILED: "failed",
|
|
318
|
+
SKIPPED: "skipped"
|
|
319
|
+
};
|
|
320
|
+
var RECORD_PREFIX = "josh-ship-stages-";
|
|
321
|
+
var RECORD_SEPARATOR = "-";
|
|
322
|
+
var SKIP_COMMIT_FLAG = "--skip-commit";
|
|
323
|
+
var SKIP_PUSH_FLAG = "--skip-push";
|
|
324
|
+
var WORD_SEPARATOR = " ";
|
|
325
|
+
var STARTED_SEPARATOR = ",";
|
|
326
|
+
var STARTED_INDEX = 3;
|
|
327
|
+
var WORD_COUNT = STARTED_INDEX + 1;
|
|
328
|
+
var REASON_SEPARATOR = " | ";
|
|
329
|
+
var record_schema = external_exports.object({
|
|
330
|
+
done: external_exports.array(external_exports.string()),
|
|
331
|
+
started: external_exports.array(external_exports.string()).default([]),
|
|
332
|
+
is_merge_waiting: external_exports.boolean().default(false),
|
|
333
|
+
is_place_waiting: external_exports.boolean().default(false)
|
|
334
|
+
});
|
|
335
|
+
var EMPTY_RECORD = {
|
|
336
|
+
done: [],
|
|
337
|
+
started: [],
|
|
338
|
+
is_merge_waiting: false,
|
|
339
|
+
is_place_waiting: false
|
|
340
|
+
};
|
|
341
|
+
function record_path(repository, issue2) {
|
|
342
|
+
return stamp_file.stamp_path(`${RECORD_PREFIX}${issue2}${RECORD_SEPARATOR}`, repository);
|
|
343
|
+
}
|
|
344
|
+
function parse_record(raw) {
|
|
345
|
+
return json_value.parse_with(raw, record_schema) ?? EMPTY_RECORD;
|
|
346
|
+
}
|
|
347
|
+
function read_record(target2) {
|
|
348
|
+
const raw = stamp_file.read_stamp_text(target2);
|
|
349
|
+
return raw === void 0 ? EMPTY_RECORD : parse_record(raw);
|
|
350
|
+
}
|
|
351
|
+
function read_done(target2) {
|
|
352
|
+
return new Set(read_record(target2).done);
|
|
353
|
+
}
|
|
354
|
+
function mark_done(target2, stage) {
|
|
355
|
+
const record2 = read_record(target2);
|
|
356
|
+
stamp_file.replace_stamp(target2, { ...record2, done: [.../* @__PURE__ */ new Set([...record2.done, stage])] });
|
|
357
|
+
}
|
|
358
|
+
function read_started(target2) {
|
|
359
|
+
return read_record(target2).started;
|
|
360
|
+
}
|
|
361
|
+
function mark_started(target2, stage) {
|
|
362
|
+
const record2 = read_record(target2);
|
|
363
|
+
stamp_file.replace_stamp(target2, { ...record2, started: [.../* @__PURE__ */ new Set([...record2.started, stage])] });
|
|
364
|
+
}
|
|
365
|
+
function end_attempt(target2) {
|
|
366
|
+
stamp_file.replace_stamp(target2, { ...read_record(target2), started: [], is_merge_waiting: false });
|
|
367
|
+
}
|
|
368
|
+
function read_merge_waiting(target2) {
|
|
369
|
+
return read_record(target2).is_merge_waiting;
|
|
370
|
+
}
|
|
371
|
+
function mark_merge_waiting(target2, is_merge_waiting) {
|
|
372
|
+
stamp_file.replace_stamp(target2, { ...read_record(target2), is_merge_waiting });
|
|
373
|
+
}
|
|
374
|
+
function read_place_waiting(target2) {
|
|
375
|
+
return read_record(target2).is_place_waiting;
|
|
376
|
+
}
|
|
377
|
+
function mark_place_waiting(target2, is_place_waiting) {
|
|
378
|
+
stamp_file.replace_stamp(target2, { ...read_record(target2), is_place_waiting });
|
|
379
|
+
}
|
|
380
|
+
function clear_waits(target2) {
|
|
381
|
+
stamp_file.replace_stamp(target2, {
|
|
382
|
+
...read_record(target2),
|
|
383
|
+
is_merge_waiting: false,
|
|
384
|
+
is_place_waiting: false
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
function clear(target2) {
|
|
388
|
+
stamp_file.remove_stamp(target2);
|
|
389
|
+
}
|
|
390
|
+
function is_shipped(state) {
|
|
391
|
+
return state.is_committed && state.is_pushed;
|
|
392
|
+
}
|
|
393
|
+
var DONE_BY = {
|
|
394
|
+
// The preflight asks what the commit stage would refuse on, so a commit is
|
|
395
|
+
// its output; a resumed commit stage still asks `git -y`'s own preflight.
|
|
396
|
+
[STAGE.PREFLIGHT]: (done, state) => state.is_merged || done.has(STAGE.PREFLIGHT) && state.is_committed,
|
|
397
|
+
// The sync stage commits locally before the review round and the gate, without pushing
|
|
398
|
+
// (`run-ship-sync.ts`), so a commit is neither's output: a pushed one on a clean tree is, as only the
|
|
399
|
+
// commit stage after the gate pushes — unless the issue changed since.
|
|
400
|
+
[STAGE.REVIEW]: (done, state) => state.is_merged || done.has(STAGE.REVIEW) && is_shipped(state) && state.is_review_stale !== true,
|
|
401
|
+
[STAGE.GATE]: (done, state) => state.is_merged || done.has(STAGE.GATE) && is_shipped(state),
|
|
402
|
+
// The merge of the default branch before the gate: once pushed, a default branch that
|
|
403
|
+
// moved is the followup's to merge again.
|
|
404
|
+
[STAGE.SYNC]: (done, state) => state.is_merged || done.has(STAGE.SYNC) && is_shipped(state),
|
|
405
|
+
[STAGE.COMMIT]: (done, state) => state.is_merged || done.has(STAGE.COMMIT) && is_shipped(state),
|
|
406
|
+
// The final review precedes the push. Its own tree stamp decides reuse after a stop.
|
|
407
|
+
[STAGE.ROUND_TWO]: (_done, state) => state.is_merged,
|
|
408
|
+
// A recorded followup still needs the shipped state: a record left by a merged ship whose report
|
|
409
|
+
// failed must not pass over the followup of new, not-yet-pushed work on the same issue.
|
|
410
|
+
[STAGE.FOLLOWUP]: (done, state) => state.is_merged || done.has(STAGE.FOLLOWUP) && is_shipped(state),
|
|
411
|
+
[STAGE.REPORT]: (done) => done.has(STAGE.REPORT)
|
|
412
|
+
};
|
|
413
|
+
function is_done(stage, done, state, has_body = false) {
|
|
414
|
+
if (has_body && stage === STAGE.COMMIT && !state.is_merged) return false;
|
|
415
|
+
return DONE_BY[stage](done, state);
|
|
416
|
+
}
|
|
417
|
+
function commit_flags(state) {
|
|
418
|
+
if (!state.is_committed) return [];
|
|
419
|
+
return state.is_pushed ? [SKIP_COMMIT_FLAG, SKIP_PUSH_FLAG] : [SKIP_COMMIT_FLAG];
|
|
420
|
+
}
|
|
421
|
+
function event_text(issue2, stage, phase, started = []) {
|
|
422
|
+
const words = [issue_cite.plain_for("program", issue2), stage, phase];
|
|
423
|
+
const listed = [...new Set(started)].join(STARTED_SEPARATOR);
|
|
424
|
+
const full = started.length > 0 ? [...words, listed] : words;
|
|
425
|
+
return full.join(WORD_SEPARATOR);
|
|
426
|
+
}
|
|
427
|
+
function with_reason(text2, reason) {
|
|
428
|
+
return reason === void 0 ? text2 : `${text2}${REASON_SEPARATOR}${reason}`;
|
|
429
|
+
}
|
|
430
|
+
function words_part(text2) {
|
|
431
|
+
return text2.split(REASON_SEPARATOR, 1)[0] ?? "";
|
|
432
|
+
}
|
|
433
|
+
function started_of(text2) {
|
|
434
|
+
return words_part(text2).split(WORD_SEPARATOR, WORD_COUNT)[STARTED_INDEX]?.split(STARTED_SEPARATOR);
|
|
435
|
+
}
|
|
436
|
+
function words_of(text2) {
|
|
437
|
+
const [, stage = "", phase = ""] = words_part(text2).split(WORD_SEPARATOR, WORD_COUNT);
|
|
438
|
+
return { stage, phase };
|
|
439
|
+
}
|
|
440
|
+
function reason_of(text2) {
|
|
441
|
+
const at = text2.indexOf(REASON_SEPARATOR);
|
|
442
|
+
return at === -1 ? void 0 : text2.slice(at + REASON_SEPARATOR.length);
|
|
443
|
+
}
|
|
444
|
+
var CONFLICT = "conflict";
|
|
445
|
+
function stop_reason(stage, conflicts = []) {
|
|
446
|
+
return conflicts.length > 0 ? CONFLICT : stage;
|
|
447
|
+
}
|
|
448
|
+
var run_ship_stage = {
|
|
449
|
+
CONFLICT,
|
|
450
|
+
PHASE,
|
|
451
|
+
STAGE,
|
|
452
|
+
clear,
|
|
453
|
+
clear_waits,
|
|
454
|
+
commit_flags,
|
|
455
|
+
end_attempt,
|
|
456
|
+
event_text,
|
|
457
|
+
is_done,
|
|
458
|
+
is_shipped,
|
|
459
|
+
mark_done,
|
|
460
|
+
mark_merge_waiting,
|
|
461
|
+
mark_place_waiting,
|
|
462
|
+
mark_started,
|
|
463
|
+
read_done,
|
|
464
|
+
read_merge_waiting,
|
|
465
|
+
read_place_waiting,
|
|
466
|
+
read_started,
|
|
467
|
+
reason_of,
|
|
468
|
+
record_path,
|
|
469
|
+
started_of,
|
|
470
|
+
with_reason,
|
|
471
|
+
words_of,
|
|
472
|
+
stop_reason
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
// scripts/agent/agent-safe-text.ts
|
|
476
|
+
var FIRST_PRINTABLE_CODE = 32;
|
|
477
|
+
var DELETE_CODE = 127;
|
|
478
|
+
var FIRST_CODE_POINT = 0;
|
|
479
|
+
var EMPTY_LENGTH = 0;
|
|
480
|
+
var MAX_VALUE_LENGTH = 4096;
|
|
481
|
+
var MAX_PROMPT_LENGTH = 65536;
|
|
482
|
+
var LINE_FEED = "\n";
|
|
483
|
+
var SPACE = " ";
|
|
484
|
+
function is_control_character(character) {
|
|
485
|
+
const code = character.codePointAt(FIRST_CODE_POINT) ?? FIRST_PRINTABLE_CODE;
|
|
486
|
+
return code < FIRST_PRINTABLE_CODE || code === DELETE_CODE;
|
|
487
|
+
}
|
|
488
|
+
function is_line_feed(character) {
|
|
489
|
+
return character === LINE_FEED;
|
|
490
|
+
}
|
|
491
|
+
function is_never_allowed() {
|
|
492
|
+
return false;
|
|
493
|
+
}
|
|
494
|
+
function is_refused(character, is_allowed2) {
|
|
495
|
+
return is_control_character(character) && !is_allowed2(character);
|
|
496
|
+
}
|
|
497
|
+
function is_safe_text(value, is_allowed2, max_length) {
|
|
498
|
+
if (value.length === EMPTY_LENGTH || value.length > max_length) return false;
|
|
499
|
+
for (const character of value) if (is_refused(character, is_allowed2)) return false;
|
|
500
|
+
return true;
|
|
501
|
+
}
|
|
502
|
+
function is_safe_value(value) {
|
|
503
|
+
return is_safe_text(value, is_never_allowed, MAX_VALUE_LENGTH);
|
|
504
|
+
}
|
|
505
|
+
function is_safe_prompt(value) {
|
|
506
|
+
return is_safe_text(value, is_line_feed, MAX_PROMPT_LENGTH);
|
|
507
|
+
}
|
|
508
|
+
function printable_character(character) {
|
|
509
|
+
return is_refused(character, is_line_feed) ? SPACE : character;
|
|
510
|
+
}
|
|
511
|
+
function printable(text2) {
|
|
512
|
+
return Array.from(text2, printable_character).join("");
|
|
513
|
+
}
|
|
514
|
+
var agent_safe_text = {
|
|
515
|
+
MAX_PROMPT_LENGTH,
|
|
516
|
+
MAX_VALUE_LENGTH,
|
|
517
|
+
is_safe_prompt,
|
|
518
|
+
is_safe_value,
|
|
519
|
+
printable
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
// scripts/lib/shell-quote.ts
|
|
523
|
+
var QUOTE = "'";
|
|
524
|
+
var ESCAPED_QUOTE = String.raw`'\''`;
|
|
525
|
+
function single_quoted(text2) {
|
|
526
|
+
return QUOTE + text2.split(QUOTE).join(ESCAPED_QUOTE) + QUOTE;
|
|
527
|
+
}
|
|
528
|
+
var BARE_WORD = /^[\w%+,./:=@-]+$/u;
|
|
529
|
+
function word(token) {
|
|
530
|
+
return BARE_WORD.test(token) ? token : single_quoted(token);
|
|
531
|
+
}
|
|
532
|
+
var shell_quote = { single_quoted, word };
|
|
533
|
+
|
|
534
|
+
// scripts/run/ship/run-ship-next.ts
|
|
535
|
+
var { STAGE: STAGE2 } = run_ship_stage;
|
|
536
|
+
var COMMAND = {
|
|
537
|
+
LOG: "pnpm josh ship --log",
|
|
538
|
+
DETACH: "pnpm josh ship --detach",
|
|
539
|
+
DETACH_REVIEW: "pnpm josh ship --detach --review"
|
|
540
|
+
};
|
|
541
|
+
function resume_of(args) {
|
|
542
|
+
const cites = args.cites.flatMap((cite) => ["--cite", cite]);
|
|
543
|
+
return {
|
|
544
|
+
title: args.title,
|
|
545
|
+
flags: [...args.notify, ...args.body, ...cites],
|
|
546
|
+
is_review: args.is_review,
|
|
547
|
+
unpinned_ok: args.unpinned_ok
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
function ship_command(command, resume, review_flags = []) {
|
|
551
|
+
const words = [...review_flags, ...resume.flags, resume.title].map(
|
|
552
|
+
(token) => shell_quote.word(token)
|
|
553
|
+
);
|
|
554
|
+
return [command, ...words].join(" ");
|
|
555
|
+
}
|
|
556
|
+
function review_command(resume) {
|
|
557
|
+
return ship_command(COMMAND.DETACH_REVIEW, resume, resume.unpinned_ok);
|
|
558
|
+
}
|
|
559
|
+
function detach_again(resume) {
|
|
560
|
+
return `leave the fix uncommitted and run \`${ship_command(COMMAND.DETACH, resume)}\`.`;
|
|
561
|
+
}
|
|
562
|
+
function detach_as_started(resume) {
|
|
563
|
+
const command = resume.is_review ? review_command(resume) : ship_command(COMMAND.DETACH, resume);
|
|
564
|
+
return `leave the fix uncommitted and run \`${command}\`.`;
|
|
565
|
+
}
|
|
566
|
+
var AFTER_FIX = {
|
|
567
|
+
[STAGE2.PREFLIGHT]: detach_as_started,
|
|
568
|
+
[STAGE2.REVIEW]: detach_as_started,
|
|
569
|
+
[STAGE2.GATE]: detach_as_started,
|
|
570
|
+
[STAGE2.SYNC]: detach_as_started,
|
|
571
|
+
[STAGE2.COMMIT]: detach_as_started,
|
|
572
|
+
[STAGE2.ROUND_TWO]: detach_again,
|
|
573
|
+
[STAGE2.FOLLOWUP]: detach_again,
|
|
574
|
+
[STAGE2.REPORT]: detach_again
|
|
575
|
+
};
|
|
576
|
+
function detach_review_again(resume) {
|
|
577
|
+
return `leave the fix uncommitted and run \`${review_command(resume)}\` \u2014 the review read the issue before its update, so the supervisor reviews round 1 again.`;
|
|
578
|
+
}
|
|
579
|
+
function after_fix(stage, resume) {
|
|
580
|
+
return resume.is_review_stale === true ? detach_review_again(resume) : AFTER_FIX[stage](resume);
|
|
581
|
+
}
|
|
582
|
+
function conflict_step(conflicts) {
|
|
583
|
+
return `Resolve the conflict with origin/main in ${conflicts.join(", ")} (the merge is left in progress: remove the conflict markers in those files), then`;
|
|
584
|
+
}
|
|
585
|
+
function fix_step(issue2, stage, is_excerpted) {
|
|
586
|
+
if (is_excerpted) return `Fix the ${stage} failure shown in the output below`;
|
|
587
|
+
return `Read the stopped report with \`${COMMAND.LOG} ${issue2}\`, fix the ${stage} failure`;
|
|
588
|
+
}
|
|
589
|
+
function next_step(issue2, stage, resume, is_excerpted = false) {
|
|
590
|
+
const conflicts = resume.conflicts ?? [];
|
|
591
|
+
if (conflicts.length > 0) return `${conflict_step(conflicts)} ${after_fix(stage, resume)}`;
|
|
592
|
+
return `${fix_step(issue2, stage, is_excerpted)}, then ${after_fix(stage, resume)}`;
|
|
593
|
+
}
|
|
594
|
+
var run_ship_next = { COMMAND, next_step, resume_of };
|
|
595
|
+
|
|
596
|
+
// scripts/run/ship/run-ship-stop-context.ts
|
|
597
|
+
import { stripVTControlCharacters } from "node:util";
|
|
598
|
+
|
|
599
|
+
// scripts/git/change-base.ts
|
|
600
|
+
async function resolved() {
|
|
601
|
+
try {
|
|
602
|
+
return await git_command.change_base_commit();
|
|
603
|
+
} catch {
|
|
604
|
+
return void 0;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
async function incoming_base() {
|
|
608
|
+
try {
|
|
609
|
+
const reference2 = await git_command.default_branch_reference();
|
|
610
|
+
return await git_spawn.read([...git_diff_reads.incoming_base_arguments(reference2)]);
|
|
611
|
+
} catch {
|
|
612
|
+
return void 0;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
async function later_of(base, incoming) {
|
|
616
|
+
const kept = await git_spawn.read([...git_diff_reads.later_base_arguments(base, incoming)]);
|
|
617
|
+
return git_diff_reads.later_base_of(kept, base);
|
|
618
|
+
}
|
|
619
|
+
async function resolved_through_merge() {
|
|
620
|
+
const [base, incoming] = await Promise.all([resolved(), incoming_base()]);
|
|
621
|
+
if (base === void 0 || incoming === void 0) return base;
|
|
622
|
+
return await later_of(base, incoming);
|
|
623
|
+
}
|
|
624
|
+
var change_base = { resolved, resolved_through_merge };
|
|
625
|
+
|
|
626
|
+
// scripts/git/changed-paths.ts
|
|
627
|
+
function to_paths(raw) {
|
|
628
|
+
return raw.split("\n").map((line) => line.trim()).filter((line) => line !== "");
|
|
629
|
+
}
|
|
630
|
+
async function tracked_names() {
|
|
631
|
+
const base = await change_base.resolved_through_merge();
|
|
632
|
+
if (base === void 0) {
|
|
633
|
+
return { tracked: to_paths(await git_command.diff_main_names()), base: "fallback" };
|
|
634
|
+
}
|
|
635
|
+
return { tracked: to_paths(await git_command.diff_names_since(base)), base: "merge_base" };
|
|
636
|
+
}
|
|
637
|
+
async function read_changed_parts() {
|
|
638
|
+
const { tracked, base } = await tracked_names();
|
|
639
|
+
const untracked = to_paths(await git_command.untracked_names());
|
|
640
|
+
return { tracked, untracked, base };
|
|
641
|
+
}
|
|
642
|
+
async function read_changed_paths(is_staged) {
|
|
643
|
+
if (is_staged) return to_paths(await git_command.diff_cached_names());
|
|
644
|
+
const { tracked, untracked } = await read_changed_parts();
|
|
645
|
+
return [...tracked, ...untracked];
|
|
646
|
+
}
|
|
647
|
+
async function read_changed_since(commit) {
|
|
648
|
+
const tracked = to_paths(await git_command.diff_names_since(commit));
|
|
649
|
+
const untracked = to_paths(await git_command.untracked_names());
|
|
650
|
+
return [.../* @__PURE__ */ new Set([...tracked, ...untracked])];
|
|
651
|
+
}
|
|
652
|
+
async function read_held_at(commit, paths) {
|
|
653
|
+
if (paths.length === 0) return [];
|
|
654
|
+
return to_paths(await git_command.tree_names_at(commit, paths));
|
|
655
|
+
}
|
|
656
|
+
var changed_paths = {
|
|
657
|
+
read_changed_parts,
|
|
658
|
+
read_changed_paths,
|
|
659
|
+
read_changed_since,
|
|
660
|
+
read_held_at,
|
|
661
|
+
to_paths
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
// scripts/review/review-stop-log.ts
|
|
665
|
+
import { mkdirSync } from "node:fs";
|
|
666
|
+
import path2 from "node:path";
|
|
667
|
+
var LOG_FILE = "review-stops.jsonl";
|
|
668
|
+
var LINE_SEPARATOR = "\n";
|
|
669
|
+
var stop_line_schema = external_exports.object({
|
|
670
|
+
at: external_exports.string(),
|
|
671
|
+
issue: external_exports.number(),
|
|
672
|
+
stage: external_exports.string(),
|
|
673
|
+
kind: external_exports.string(),
|
|
674
|
+
location: external_exports.string(),
|
|
675
|
+
sentence: external_exports.string(),
|
|
676
|
+
fixed: external_exports.boolean().optional()
|
|
677
|
+
});
|
|
678
|
+
function target() {
|
|
679
|
+
if (process.env["VITEST"] !== void 0) return void 0;
|
|
680
|
+
const common = git_common_directory.repository();
|
|
681
|
+
return common === void 0 ? void 0 : path2.join(common, git_common_directory.STATE_DIRECTORY, LOG_FILE);
|
|
682
|
+
}
|
|
683
|
+
function write(destination, stop) {
|
|
684
|
+
const at = (/* @__PURE__ */ new Date()).toISOString();
|
|
685
|
+
const mark = stop.is_fixed === true ? { fixed: true } : {};
|
|
686
|
+
mkdirSync(path2.dirname(destination), { recursive: true });
|
|
687
|
+
for (const finding of stop.findings) {
|
|
688
|
+
lane_ledger_write.append(destination, {
|
|
689
|
+
at,
|
|
690
|
+
issue: stop.issue,
|
|
691
|
+
stage: stop.stage,
|
|
692
|
+
...finding,
|
|
693
|
+
...mark
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
function record(stop, log_path = target()) {
|
|
698
|
+
if (log_path === void 0 || stop.findings.length === 0) return;
|
|
699
|
+
try {
|
|
700
|
+
write(log_path, stop);
|
|
701
|
+
} catch {
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
function parse_line(line) {
|
|
705
|
+
return stop_line_schema.safeParse(json_value.parse_or_undefined(line)).data;
|
|
706
|
+
}
|
|
707
|
+
function is_present(line) {
|
|
708
|
+
return line !== void 0;
|
|
709
|
+
}
|
|
710
|
+
function read(log_path = target()) {
|
|
711
|
+
const raw = log_path === void 0 ? void 0 : stamp_file.read_stamp_text(log_path);
|
|
712
|
+
if (raw === void 0) return [];
|
|
713
|
+
return raw.split(LINE_SEPARATOR).map((line) => parse_line(line.trim())).filter(is_present);
|
|
714
|
+
}
|
|
715
|
+
var review_stop_log = { read, record, target };
|
|
716
|
+
|
|
717
|
+
// scripts/review/review-prior-findings.ts
|
|
718
|
+
var PRIOR_LIMIT = 5;
|
|
719
|
+
var ENTRY_LENGTH_LIMIT = 400;
|
|
720
|
+
var LINE_SUFFIX = /:\d.*$/u;
|
|
721
|
+
var KEY_SEPARATOR = " \u2014 ";
|
|
722
|
+
var LINE_BREAKS = /[\n\r]+/gu;
|
|
723
|
+
function file_of(location) {
|
|
724
|
+
return location.replace(LINE_SUFFIX, "");
|
|
725
|
+
}
|
|
726
|
+
function key_of(finding) {
|
|
727
|
+
return `${finding.location}${KEY_SEPARATOR}${finding.sentence}`;
|
|
728
|
+
}
|
|
729
|
+
function entry_text(line) {
|
|
730
|
+
const disposition = line.fixed === true ? "fixed in place" : "stopped";
|
|
731
|
+
const text2 = `${key_of(line)} (${line.kind}, ${disposition} in the ${line.stage} stage)`;
|
|
732
|
+
return agent_safe_text.printable(text2.replaceAll(LINE_BREAKS, " ")).slice(0, ENTRY_LENGTH_LIMIT);
|
|
733
|
+
}
|
|
734
|
+
function latest(issue2, is_kept, log_path) {
|
|
735
|
+
return review_stop_log.read(log_path).filter((line) => String(line.issue) === issue2 && is_kept(line)).slice(-PRIOR_LIMIT).map((line) => entry_text(line));
|
|
736
|
+
}
|
|
737
|
+
function on_files(issue2, current, log_path) {
|
|
738
|
+
const files = new Set(current.map((finding) => file_of(finding.location)));
|
|
739
|
+
const own = new Set(current.map((finding) => key_of(finding)));
|
|
740
|
+
return latest(
|
|
741
|
+
issue2,
|
|
742
|
+
(line) => files.has(file_of(line.location)) && !own.has(key_of(line)),
|
|
743
|
+
log_path
|
|
744
|
+
);
|
|
745
|
+
}
|
|
746
|
+
function fix_lines(entries) {
|
|
747
|
+
if (entries === void 0 || entries.length === 0) return [];
|
|
748
|
+
return [
|
|
749
|
+
"Earlier review findings on the same files in this lane \u2014 confirm the fix still meets each before shipping again:",
|
|
750
|
+
...entries.map((entry) => `- ${entry}`)
|
|
751
|
+
];
|
|
752
|
+
}
|
|
753
|
+
function prompt_clauses(issue2, log_path) {
|
|
754
|
+
const entries = latest(issue2, () => true, log_path);
|
|
755
|
+
if (entries.length === 0) return [];
|
|
756
|
+
return [
|
|
757
|
+
`Earlier review rounds in this lane recorded these findings: ${entries.join("; ")}.`,
|
|
758
|
+
"Check that the change still meets each of them, and report a change that breaks one as a finding."
|
|
759
|
+
];
|
|
760
|
+
}
|
|
761
|
+
var review_prior_findings = {
|
|
762
|
+
ENTRY_LENGTH_LIMIT,
|
|
763
|
+
PRIOR_LIMIT,
|
|
764
|
+
fix_lines,
|
|
765
|
+
latest,
|
|
766
|
+
on_files,
|
|
767
|
+
prompt_clauses
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
// scripts/run/ship/run-ship-stop-context.ts
|
|
771
|
+
var EXCERPT_LINE_LIMIT = 40;
|
|
772
|
+
var EXCERPT_LINE_WIDTH = 240;
|
|
773
|
+
var CHANGED_PATH_LIMIT = 30;
|
|
774
|
+
var OUTPUT_PREFIX = "josh-ship-stop-";
|
|
775
|
+
var OUTPUT_SUFFIX = ".log";
|
|
776
|
+
var KEY_SEPARATOR2 = "-";
|
|
777
|
+
var LINE_BREAK = "\n";
|
|
778
|
+
var CARRIAGE_RETURN = "\r";
|
|
779
|
+
var omitted_schema = external_exports.object({ path: external_exports.string().optional(), last_line: external_exports.number().int() }).strict();
|
|
780
|
+
var stop_context_schema = external_exports.object({
|
|
781
|
+
excerpt: external_exports.array(external_exports.string()).readonly(),
|
|
782
|
+
omitted: omitted_schema.optional(),
|
|
783
|
+
changed: external_exports.array(external_exports.string()).readonly().optional(),
|
|
784
|
+
more_changed: external_exports.number().int(),
|
|
785
|
+
prior: external_exports.array(external_exports.string()).readonly().optional()
|
|
786
|
+
}).strict();
|
|
787
|
+
function shown_frame(line) {
|
|
788
|
+
return line.trimEnd().split(CARRIAGE_RETURN).at(-1) ?? "";
|
|
789
|
+
}
|
|
790
|
+
function output_lines(output) {
|
|
791
|
+
return stripVTControlCharacters(output).trimEnd().split(LINE_BREAK).map((line) => agent_safe_text.printable(shown_frame(line)));
|
|
792
|
+
}
|
|
793
|
+
async function keep_full_output(issue2, output) {
|
|
794
|
+
const repository = await git_common_directory.read_repository();
|
|
795
|
+
if (repository === void 0) return void 0;
|
|
796
|
+
const target2 = stamp_file.stamp_path(
|
|
797
|
+
`${OUTPUT_PREFIX}${issue2}${KEY_SEPARATOR2}`,
|
|
798
|
+
repository,
|
|
799
|
+
OUTPUT_SUFFIX
|
|
800
|
+
);
|
|
801
|
+
try {
|
|
802
|
+
return stamp_file.replace_text_stamp(target2, output);
|
|
803
|
+
} catch {
|
|
804
|
+
return void 0;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
async function omitted_range(issue2, lines) {
|
|
808
|
+
const path8 = await keep_full_output(issue2, lines.join(LINE_BREAK));
|
|
809
|
+
const last_line = lines.length - EXCERPT_LINE_LIMIT;
|
|
810
|
+
return path8 === void 0 ? { last_line } : { path: path8, last_line };
|
|
811
|
+
}
|
|
812
|
+
function clipped(lines) {
|
|
813
|
+
return lines.map((line) => line.slice(0, EXCERPT_LINE_WIDTH));
|
|
814
|
+
}
|
|
815
|
+
async function excerpt_of(issue2, output) {
|
|
816
|
+
const lines = output.trim() === "" ? [] : output_lines(output);
|
|
817
|
+
if (lines.length <= EXCERPT_LINE_LIMIT) return { excerpt: clipped(lines) };
|
|
818
|
+
return {
|
|
819
|
+
excerpt: clipped(lines.slice(-EXCERPT_LINE_LIMIT)),
|
|
820
|
+
omitted: await omitted_range(issue2, lines)
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
async function read_paths() {
|
|
824
|
+
try {
|
|
825
|
+
return await changed_paths.read_changed_paths(false);
|
|
826
|
+
} catch {
|
|
827
|
+
return void 0;
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
async function changed_of() {
|
|
831
|
+
const paths = await read_paths();
|
|
832
|
+
if (paths === void 0) return { more_changed: 0 };
|
|
833
|
+
return {
|
|
834
|
+
changed: paths.slice(0, CHANGED_PATH_LIMIT),
|
|
835
|
+
more_changed: Math.max(0, paths.length - CHANGED_PATH_LIMIT)
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
async function build(issue2, output, findings = []) {
|
|
839
|
+
const prior = review_prior_findings.on_files(issue2, findings);
|
|
840
|
+
return {
|
|
841
|
+
...await excerpt_of(issue2, output),
|
|
842
|
+
...await changed_of(),
|
|
843
|
+
...prior.length > 0 && { prior }
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
function has_excerpt(context) {
|
|
847
|
+
return context !== void 0 && context.excerpt.length > 0;
|
|
848
|
+
}
|
|
849
|
+
function excerpt_heading(issue2, omitted, shown) {
|
|
850
|
+
if (omitted === void 0) return "The failed stage output:";
|
|
851
|
+
const source = omitted.path ?? `the stopped report (\`${run_ship_next.COMMAND.LOG} ${issue2}\`)`;
|
|
852
|
+
const range = `lines 1-${String(omitted.last_line)} are in ${source}`;
|
|
853
|
+
return `The failed stage output (its last ${String(shown)} lines; ${range}):`;
|
|
854
|
+
}
|
|
855
|
+
function with_dropped(omitted, dropped) {
|
|
856
|
+
if (dropped === 0) return omitted;
|
|
857
|
+
return { ...omitted, last_line: (omitted?.last_line ?? 0) + dropped };
|
|
858
|
+
}
|
|
859
|
+
function excerpt_block(issue2, context, changed, dropped) {
|
|
860
|
+
const shown = context.excerpt.slice(dropped);
|
|
861
|
+
const heading = excerpt_heading(issue2, with_dropped(context.omitted, dropped), shown.length);
|
|
862
|
+
return [heading, ...shown, changed].join(LINE_BREAK);
|
|
863
|
+
}
|
|
864
|
+
function changed_text(context) {
|
|
865
|
+
if (context.changed === void 0) return "The changed files could not be read from git.";
|
|
866
|
+
if (context.changed.length === 0) return "No files changed against the default branch.";
|
|
867
|
+
const more = context.more_changed > 0 ? ` (and ${String(context.more_changed)} more)` : "";
|
|
868
|
+
return `Changed files on the branch: ${context.changed.join(", ")}${more}.`;
|
|
869
|
+
}
|
|
870
|
+
function trailer_text(context) {
|
|
871
|
+
return [changed_text(context), ...review_prior_findings.fix_lines(context.prior)].join(LINE_BREAK);
|
|
872
|
+
}
|
|
873
|
+
function fitted_block(issue2, context, budget) {
|
|
874
|
+
const changed = trailer_text(context);
|
|
875
|
+
if (!has_excerpt(context)) return changed;
|
|
876
|
+
let dropped = 0;
|
|
877
|
+
let block = excerpt_block(issue2, context, changed, dropped);
|
|
878
|
+
while (block.length > budget && dropped < context.excerpt.length - 1) {
|
|
879
|
+
dropped += 1;
|
|
880
|
+
block = excerpt_block(issue2, context, changed, dropped);
|
|
881
|
+
}
|
|
882
|
+
return block;
|
|
883
|
+
}
|
|
884
|
+
function has_prior(context) {
|
|
885
|
+
return context.prior !== void 0 && context.prior.length > 0;
|
|
886
|
+
}
|
|
887
|
+
function describe(issue2, context, budget = agent_safe_text.MAX_VALUE_LENGTH) {
|
|
888
|
+
let fitted = context;
|
|
889
|
+
let block = fitted_block(issue2, fitted, budget);
|
|
890
|
+
while (block.length > budget && has_prior(fitted)) {
|
|
891
|
+
fitted = { ...fitted, prior: fitted.prior?.slice(1) };
|
|
892
|
+
block = fitted_block(issue2, fitted, budget);
|
|
893
|
+
}
|
|
894
|
+
return block;
|
|
895
|
+
}
|
|
896
|
+
var run_ship_stop_context = {
|
|
897
|
+
CHANGED_PATH_LIMIT,
|
|
898
|
+
EXCERPT_LINE_LIMIT,
|
|
899
|
+
build,
|
|
900
|
+
describe,
|
|
901
|
+
has_excerpt,
|
|
902
|
+
stop_context_schema
|
|
903
|
+
};
|
|
904
|
+
|
|
905
|
+
// scripts/lane/lane-child-invocation.ts
|
|
906
|
+
var CHILD_INVOCATION = "fullrun";
|
|
907
|
+
var LINE_BREAK2 = "\n";
|
|
908
|
+
var REVIEW_INVOCATION = "the reviewer of lane";
|
|
909
|
+
var RESUME_GUIDE = ".claude/skills/workflow-commands/pre-gate-cut.md";
|
|
910
|
+
var SHIP_PROCESS = String.raw`(josh(\.[jt]s)? ship|run-ship-cli\.ts)`;
|
|
911
|
+
function child_invocation(issue2) {
|
|
912
|
+
issue_number_shape.require_issue_number(issue2);
|
|
913
|
+
return `${CHILD_INVOCATION} ${issue_cite.plain_for("program", issue2)}`;
|
|
914
|
+
}
|
|
915
|
+
function process_pattern(issue2) {
|
|
916
|
+
issue_number_shape.require_issue_number(issue2);
|
|
917
|
+
return `(${CHILD_INVOCATION}|${REVIEW_INVOCATION}|${SHIP_PROCESS} .*) ${issue_cite.plain_for("program", issue2)}$`;
|
|
918
|
+
}
|
|
919
|
+
function ship_pattern(issue2) {
|
|
920
|
+
issue_number_shape.require_issue_number(issue2);
|
|
921
|
+
return `${SHIP_PROCESS} .* ${issue_cite.plain_for("program", issue2)}$`;
|
|
922
|
+
}
|
|
923
|
+
function review_invocation(issue2) {
|
|
924
|
+
issue_number_shape.require_issue_number(issue2);
|
|
925
|
+
return `${REVIEW_INVOCATION} ${issue_cite.plain_for("program", issue2)}`;
|
|
926
|
+
}
|
|
927
|
+
function resume_invocation(issue2) {
|
|
928
|
+
const preamble = `Resuming the lane child for issue ${issue_cite.plain_for("program", issue2)} \u2014 do not re-read the workflow-commands entry documents (SKILL.md, fullrun.md). Run \`pnpm josh run:entry ${issue2}\` once before anything else; it checks the carried cut and completes the entry on \`fresh\`. Follow its resume verdict in ${RESUME_GUIDE}: \`resume\` goes to the gate, \`resume-impl\` continues implementation. Continue this`;
|
|
929
|
+
return `${preamble} ${child_invocation(issue2)}`;
|
|
930
|
+
}
|
|
931
|
+
function outage_resume_invocation(issue2) {
|
|
932
|
+
const preamble = `Resuming the lane child for issue ${issue_cite.plain_for("program", issue2)} after an API disconnection \u2014 your session was restored with its full context, so do not re-read the workflow-commands entry documents (SKILL.md, fullrun.md). Continue the run from where it stopped: run \`pnpm josh run:step ${issue2}\` to find the next action, redoing only the last step if it did not complete.`;
|
|
933
|
+
return `${preamble} ${child_invocation(issue2)}`;
|
|
934
|
+
}
|
|
935
|
+
function known_stop_lines(issue2, stop, frame) {
|
|
936
|
+
const { context } = stop;
|
|
937
|
+
const is_excerpted = run_ship_stop_context.has_excerpt(context);
|
|
938
|
+
const next = run_ship_next.next_step(issue2, stop.stage, stop, is_excerpted);
|
|
939
|
+
if (context === void 0) return [next];
|
|
940
|
+
const fixed = [...frame, next].join(LINE_BREAK2).length + LINE_BREAK2.length;
|
|
941
|
+
const budget = agent_safe_text.MAX_VALUE_LENGTH - fixed;
|
|
942
|
+
return [next, run_ship_stop_context.describe(issue2, context, budget)];
|
|
943
|
+
}
|
|
944
|
+
function ship_stop_invocation(issue2, stop) {
|
|
945
|
+
const opening = `Resuming the lane child for issue ${issue_cite.plain_for("program", issue2)} after its detached ship supervisor stopped at a failed stage \u2014 do not re-read the workflow-commands entry documents (SKILL.md, fullrun.md).`;
|
|
946
|
+
const closing = `Do not re-plan or re-implement what is already on the branch. ${child_invocation(issue2)}`;
|
|
947
|
+
const middle = stop === void 0 ? [
|
|
948
|
+
`Run \`pnpm josh run:step ${issue2}\` and read the stopped report it names, fix what stopped the ship, then hand the region back per chain-rule.md.`
|
|
949
|
+
] : known_stop_lines(issue2, stop, [opening, closing]);
|
|
950
|
+
return [opening, ...middle, closing].join(LINE_BREAK2);
|
|
951
|
+
}
|
|
952
|
+
function ship_stop_note(issue2, stop) {
|
|
953
|
+
return known_stop_lines(issue2, stop, []).join(LINE_BREAK2);
|
|
954
|
+
}
|
|
955
|
+
var lane_child_invocation = {
|
|
956
|
+
child_invocation,
|
|
957
|
+
outage_resume_invocation,
|
|
958
|
+
process_pattern,
|
|
959
|
+
resume_invocation,
|
|
960
|
+
review_invocation,
|
|
961
|
+
ship_pattern,
|
|
962
|
+
ship_stop_invocation,
|
|
963
|
+
ship_stop_note
|
|
964
|
+
};
|
|
965
|
+
|
|
966
|
+
// scripts/lane/lane-reap.ts
|
|
967
|
+
import { execFileSync } from "node:child_process";
|
|
968
|
+
|
|
969
|
+
// scripts/lane/process-tools.ts
|
|
970
|
+
import path3 from "node:path";
|
|
971
|
+
var NOT_FOUND_CODE = "ENOENT";
|
|
972
|
+
var PACKAGE_HINT = "install the package that provides it (procps on Debian/Ubuntu: `apt-get install procps`)";
|
|
973
|
+
function is_not_found(error) {
|
|
974
|
+
return error instanceof Error && "code" in error && error.code === NOT_FOUND_CODE;
|
|
975
|
+
}
|
|
976
|
+
function missing_notice(command) {
|
|
977
|
+
return `\`${path3.basename(command)}\` is not installed \u2014 kit's lane commands read processes with ps and pgrep; ${PACKAGE_HINT}`;
|
|
978
|
+
}
|
|
979
|
+
function throw_if_missing(command, error) {
|
|
980
|
+
if (is_not_found(error)) throw new Error(missing_notice(command), { cause: error });
|
|
981
|
+
}
|
|
982
|
+
var process_tools = { missing_notice, throw_if_missing };
|
|
983
|
+
|
|
984
|
+
// scripts/lane/lane-reap.ts
|
|
985
|
+
var PGREP_COMMAND = "pgrep";
|
|
986
|
+
var MATCH_FULL_COMMAND_LINE = "-f";
|
|
987
|
+
var CHILDREN_OF_FLAG = "-P";
|
|
988
|
+
var PS_COMMAND = "/bin/ps";
|
|
989
|
+
var PARENT_FORMAT = ["-o", "ppid=", "-p"];
|
|
990
|
+
var TERMINATE_SIGNAL = "SIGTERM";
|
|
991
|
+
var CONTINUE_SIGNAL = "SIGCONT";
|
|
992
|
+
var LOWEST_CHILD_PID = 2;
|
|
993
|
+
function parse_pids(printed) {
|
|
994
|
+
return printed.split("\n").map((line) => Number(line.trim())).filter((pid) => Number.isSafeInteger(pid) && pid >= LOWEST_CHILD_PID);
|
|
995
|
+
}
|
|
996
|
+
function run_probe(command, args) {
|
|
997
|
+
try {
|
|
998
|
+
return execFileSync(command, [...args], {
|
|
999
|
+
encoding: "utf8",
|
|
1000
|
+
timeout: PROBE_TIMEOUT_MS,
|
|
1001
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
1002
|
+
});
|
|
1003
|
+
} catch (error) {
|
|
1004
|
+
process_tools.throw_if_missing(command, error);
|
|
1005
|
+
return "";
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
function parent_of(pid) {
|
|
1009
|
+
return parse_pids(run_probe(PS_COMMAND, [...PARENT_FORMAT, String(pid)]))[0];
|
|
1010
|
+
}
|
|
1011
|
+
function send(pid, name) {
|
|
1012
|
+
try {
|
|
1013
|
+
process.kill(pid, name);
|
|
1014
|
+
return true;
|
|
1015
|
+
} catch {
|
|
1016
|
+
return false;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
function terminate(pid) {
|
|
1020
|
+
if (!send(pid, TERMINATE_SIGNAL)) return false;
|
|
1021
|
+
send(pid, CONTINUE_SIGNAL);
|
|
1022
|
+
return true;
|
|
1023
|
+
}
|
|
1024
|
+
var SYSTEM_PROBES = {
|
|
1025
|
+
matching: (pattern) => parse_pids(run_probe(PGREP_COMMAND, [MATCH_FULL_COMMAND_LINE, pattern])),
|
|
1026
|
+
children_of: (pid) => parse_pids(run_probe(PGREP_COMMAND, [CHILDREN_OF_FLAG, String(pid)])),
|
|
1027
|
+
parent_of,
|
|
1028
|
+
terminate
|
|
1029
|
+
};
|
|
1030
|
+
function ancestry_of(pid, probes = SYSTEM_PROBES) {
|
|
1031
|
+
const ancestry = /* @__PURE__ */ new Set([pid]);
|
|
1032
|
+
let current = probes.parent_of(pid);
|
|
1033
|
+
while (current !== void 0 && !ancestry.has(current)) {
|
|
1034
|
+
ancestry.add(current);
|
|
1035
|
+
current = probes.parent_of(current);
|
|
1036
|
+
}
|
|
1037
|
+
return ancestry;
|
|
1038
|
+
}
|
|
1039
|
+
function own_ancestry(probes = SYSTEM_PROBES) {
|
|
1040
|
+
return ancestry_of(process.pid, probes);
|
|
1041
|
+
}
|
|
1042
|
+
function tree_of(roots, probes) {
|
|
1043
|
+
const tree = [];
|
|
1044
|
+
const pending = [...roots];
|
|
1045
|
+
let next = pending.shift();
|
|
1046
|
+
while (next !== void 0) {
|
|
1047
|
+
if (!tree.includes(next)) {
|
|
1048
|
+
tree.push(next);
|
|
1049
|
+
pending.push(...probes.children_of(next));
|
|
1050
|
+
}
|
|
1051
|
+
next = pending.shift();
|
|
1052
|
+
}
|
|
1053
|
+
return tree;
|
|
1054
|
+
}
|
|
1055
|
+
function roots_of(issue2, own, probes) {
|
|
1056
|
+
const pattern = lane_child_invocation.process_pattern(issue2);
|
|
1057
|
+
return probes.matching(pattern).filter((pid) => !own.has(pid));
|
|
1058
|
+
}
|
|
1059
|
+
function lane_tree(issue2, probes = SYSTEM_PROBES) {
|
|
1060
|
+
const own = own_ancestry(probes);
|
|
1061
|
+
return tree_of(roots_of(issue2, own, probes), probes).filter((pid) => !own.has(pid));
|
|
1062
|
+
}
|
|
1063
|
+
function reap_child(lane, probes = SYSTEM_PROBES) {
|
|
1064
|
+
return lane_tree(lane.issue, probes).filter((pid) => probes.terminate(pid));
|
|
1065
|
+
}
|
|
1066
|
+
function is_child_running(issue2, probes = SYSTEM_PROBES) {
|
|
1067
|
+
return roots_of(issue2, own_ancestry(probes), probes).length > 0;
|
|
1068
|
+
}
|
|
1069
|
+
var lane_reap = {
|
|
1070
|
+
ancestry_of,
|
|
1071
|
+
is_child_running,
|
|
1072
|
+
lane_tree,
|
|
1073
|
+
own_ancestry,
|
|
1074
|
+
parse_pids,
|
|
1075
|
+
PS_COMMAND,
|
|
1076
|
+
reap_child,
|
|
1077
|
+
run_probe,
|
|
1078
|
+
SYSTEM_PROBES
|
|
1079
|
+
};
|
|
1080
|
+
|
|
1081
|
+
// scripts/lib/transcript-record.ts
|
|
1082
|
+
var TEXT_TYPE = "text";
|
|
1083
|
+
var TOOL_USE_TYPE = "tool_use";
|
|
1084
|
+
var TOOL_RESULT_TYPE = "tool_result";
|
|
1085
|
+
var BLOCK_SCHEMA = external_exports.object({
|
|
1086
|
+
type: external_exports.string().nullish(),
|
|
1087
|
+
text: external_exports.string().nullish(),
|
|
1088
|
+
name: external_exports.string().nullish(),
|
|
1089
|
+
id: external_exports.string().nullish(),
|
|
1090
|
+
tool_use_id: external_exports.string().nullish(),
|
|
1091
|
+
input: external_exports.unknown().nullish(),
|
|
1092
|
+
// Whether the harness wrote a `tool_result` back as a failure — absent on every other block, and
|
|
1093
|
+
// on the results of tools that never report one.
|
|
1094
|
+
is_error: external_exports.boolean().nullish(),
|
|
1095
|
+
// A result's body: a string or a list of blocks. Read as `unknown` because each reader flattens it
|
|
1096
|
+
// its own way, and a narrower type here would drop the whole line over one odd item.
|
|
1097
|
+
content: external_exports.unknown().nullish()
|
|
1098
|
+
});
|
|
1099
|
+
var CONTENT_SCHEMA = external_exports.union([external_exports.string(), external_exports.array(BLOCK_SCHEMA)]);
|
|
1100
|
+
var MESSAGE_SCHEMA = external_exports.object({ id: external_exports.string().nullish(), content: CONTENT_SCHEMA.nullish() });
|
|
1101
|
+
var LINE_SCHEMA = external_exports.object({
|
|
1102
|
+
type: external_exports.string().nullish(),
|
|
1103
|
+
timestamp: external_exports.string().nullish(),
|
|
1104
|
+
gitBranch: external_exports.string().nullish(),
|
|
1105
|
+
// The billed request an assistant line belongs to and the reasoning effort it ran at, written on
|
|
1106
|
+
// assistant lines only.
|
|
1107
|
+
requestId: external_exports.string().nullish(),
|
|
1108
|
+
effort: external_exports.string().nullish(),
|
|
1109
|
+
// The two fields outside `message` the harness writes an end-of-task notice on. `unknown`, since a
|
|
1110
|
+
// string here would reject every line whose `content` is a list of blocks.
|
|
1111
|
+
content: external_exports.unknown().nullish(),
|
|
1112
|
+
attachment: external_exports.unknown().nullish(),
|
|
1113
|
+
message: MESSAGE_SCHEMA.nullish()
|
|
1114
|
+
});
|
|
1115
|
+
function read2(value) {
|
|
1116
|
+
return LINE_SCHEMA.safeParse(value).data;
|
|
1117
|
+
}
|
|
1118
|
+
function parse(line) {
|
|
1119
|
+
return read2(json_value.parse_or_undefined(line));
|
|
1120
|
+
}
|
|
1121
|
+
function blocks_of(record2) {
|
|
1122
|
+
const content = record2.message?.content;
|
|
1123
|
+
return Array.isArray(content) ? content : [];
|
|
1124
|
+
}
|
|
1125
|
+
function is_tool_call(block) {
|
|
1126
|
+
return block.type === TOOL_USE_TYPE && typeof block.name === "string";
|
|
1127
|
+
}
|
|
1128
|
+
function tool_calls_of(record2) {
|
|
1129
|
+
return blocks_of(record2).filter((block) => is_tool_call(block));
|
|
1130
|
+
}
|
|
1131
|
+
var transcript_record = {
|
|
1132
|
+
TEXT_TYPE,
|
|
1133
|
+
TOOL_USE_TYPE,
|
|
1134
|
+
TOOL_RESULT_TYPE,
|
|
1135
|
+
read: read2,
|
|
1136
|
+
parse,
|
|
1137
|
+
blocks_of,
|
|
1138
|
+
tool_calls_of
|
|
1139
|
+
};
|
|
1140
|
+
|
|
1141
|
+
// scripts/cost-runtime/cost-blocks.ts
|
|
1142
|
+
var CONTENT_ITEM_SCHEMA = external_exports.object({ text: external_exports.string().nullish() });
|
|
1143
|
+
var RESULT_CONTENT_SCHEMA = external_exports.union([external_exports.string(), external_exports.array(CONTENT_ITEM_SCHEMA)]);
|
|
1144
|
+
var { TEXT_TYPE: TEXT_TYPE2, TOOL_USE_TYPE: TOOL_USE_TYPE2, TOOL_RESULT_TYPE: TOOL_RESULT_TYPE2 } = transcript_record;
|
|
1145
|
+
var BASH_TOOL = "Bash";
|
|
1146
|
+
var COMMAND_KEY = "command";
|
|
1147
|
+
function json_of(value) {
|
|
1148
|
+
return value === void 0 || value === null ? "" : JSON.stringify(value);
|
|
1149
|
+
}
|
|
1150
|
+
function split_bash_input(input) {
|
|
1151
|
+
if (!json_value.is_record(input)) return { command: "", rest: json_of(input) };
|
|
1152
|
+
const command = input[COMMAND_KEY];
|
|
1153
|
+
const rest = Object.entries(input).filter(([key]) => key !== COMMAND_KEY);
|
|
1154
|
+
return {
|
|
1155
|
+
command: typeof command === "string" ? command : "",
|
|
1156
|
+
rest: json_of(Object.fromEntries(rest))
|
|
1157
|
+
};
|
|
1158
|
+
}
|
|
1159
|
+
function to_tool_use(block) {
|
|
1160
|
+
const tool_name = block.name ?? "";
|
|
1161
|
+
const is_bash = tool_name === BASH_TOOL;
|
|
1162
|
+
const { command, rest } = is_bash ? split_bash_input(block.input) : { command: "", rest: json_of(block.input) };
|
|
1163
|
+
return { type: TOOL_USE_TYPE2, tool_name, command, text: rest };
|
|
1164
|
+
}
|
|
1165
|
+
function result_text(content) {
|
|
1166
|
+
const parsed = RESULT_CONTENT_SCHEMA.safeParse(content);
|
|
1167
|
+
if (!parsed.success) return "";
|
|
1168
|
+
if (typeof parsed.data === "string") return parsed.data;
|
|
1169
|
+
return parsed.data.map((item) => item.text ?? "").join("");
|
|
1170
|
+
}
|
|
1171
|
+
function to_plain_block(block) {
|
|
1172
|
+
const base = { type: block.type ?? "", tool_name: "", command: "" };
|
|
1173
|
+
const text2 = block.type === TOOL_RESULT_TYPE2 ? result_text(block.content) : block.text ?? "";
|
|
1174
|
+
return { ...base, text: text2 };
|
|
1175
|
+
}
|
|
1176
|
+
function to_block(block) {
|
|
1177
|
+
return block.type === TOOL_USE_TYPE2 ? to_tool_use(block) : to_plain_block(block);
|
|
1178
|
+
}
|
|
1179
|
+
function to_blocks(content) {
|
|
1180
|
+
if (typeof content === "string") {
|
|
1181
|
+
return [{ type: TEXT_TYPE2, tool_name: "", command: "", text: content }];
|
|
1182
|
+
}
|
|
1183
|
+
return content.map((block) => to_block(block));
|
|
1184
|
+
}
|
|
1185
|
+
function content_of(line) {
|
|
1186
|
+
return transcript_record.parse(line)?.message?.content ?? void 0;
|
|
1187
|
+
}
|
|
1188
|
+
function parse_line2(line) {
|
|
1189
|
+
const content = content_of(line);
|
|
1190
|
+
return content === void 0 ? [] : to_blocks(content);
|
|
1191
|
+
}
|
|
1192
|
+
function parse_content(text2) {
|
|
1193
|
+
return text2.split("\n").flatMap((line) => parse_line2(line));
|
|
1194
|
+
}
|
|
1195
|
+
var cost_blocks = {
|
|
1196
|
+
BASH_TOOL,
|
|
1197
|
+
TEXT_TYPE: TEXT_TYPE2,
|
|
1198
|
+
TOOL_USE_TYPE: TOOL_USE_TYPE2,
|
|
1199
|
+
TOOL_RESULT_TYPE: TOOL_RESULT_TYPE2,
|
|
1200
|
+
parse_line: parse_line2,
|
|
1201
|
+
parse_content
|
|
1202
|
+
};
|
|
1203
|
+
|
|
1204
|
+
// scripts/time-runtime/time-shell.ts
|
|
1205
|
+
var BASH_SEPARATOR = ": ";
|
|
1206
|
+
var WHITESPACE_PATTERN = /\s+/u;
|
|
1207
|
+
var SEGMENT_PATTERN = /&&|\|\||;|\|/u;
|
|
1208
|
+
var PIPE_PATTERN = /(?<!\|)\|(?!\|)/u;
|
|
1209
|
+
var CHAIN_PATTERN = /&&|\|\||;|\n/u;
|
|
1210
|
+
var SUBSTITUTION_ATOM = /\$\([^()]*\)/u;
|
|
1211
|
+
var LONE_DOLLAR = /\$(?!\([^()]*\))/u;
|
|
1212
|
+
var QUOTED_SPAN_PATTERN = new RegExp(
|
|
1213
|
+
String.raw`\\[\s\S]|'[^']*'|"(?:\\[\s\S]|${SUBSTITUTION_ATOM.source}|${LONE_DOLLAR.source}|[^"\\$])*"`,
|
|
1214
|
+
"gu"
|
|
1215
|
+
);
|
|
1216
|
+
var HEREDOC_MARKER = /(?<!<)<<-?\s*(['"]?)(\w+)\1/u;
|
|
1217
|
+
var HEREDOC_DELIMITER_GROUP = 2;
|
|
1218
|
+
var LINE_BREAK3 = "\n";
|
|
1219
|
+
var DOUBLE_QUOTE = '"';
|
|
1220
|
+
var SUBSTITUTION_PATTERN = /(?<!\\)\$\((?<dollar>[^()]*)\)|(?<!\\)`(?<tick>[^`]*)`/gu;
|
|
1221
|
+
var PIPEFAIL_PATTERN = /\bset\s+-[a-z]*o\s+pipefail\b/u;
|
|
1222
|
+
var COMMAND_WORD_PATTERN = /^[\w./@:+][\w./@:+-]*$/u;
|
|
1223
|
+
var ASSIGNMENT_PATTERN = /^\w+=/u;
|
|
1224
|
+
var SUBSHELL_OPENER = "$(";
|
|
1225
|
+
var FLAG_PREFIX = "-";
|
|
1226
|
+
var WRAPPER_COMMANDS = /* @__PURE__ */ new Map([
|
|
1227
|
+
["time", { valued: /* @__PURE__ */ new Set(["-f", "-o", "--format", "--output"]), operands: 0 }],
|
|
1228
|
+
["env", { valued: /* @__PURE__ */ new Set(["-u", "-C", "-S", "--unset", "--chdir"]), operands: 0 }],
|
|
1229
|
+
["sudo", { valued: /* @__PURE__ */ new Set(["-u", "-g", "-C", "-D"]), operands: 0 }],
|
|
1230
|
+
["timeout", { valued: /* @__PURE__ */ new Set(["-s", "-k", "--signal", "--kill-after"]), operands: 1 }],
|
|
1231
|
+
["nohup", { valued: /* @__PURE__ */ new Set(), operands: 0 }],
|
|
1232
|
+
["nice", { valued: /* @__PURE__ */ new Set(["-n", "--adjustment"]), operands: 0 }],
|
|
1233
|
+
["command", { valued: /* @__PURE__ */ new Set(), operands: 0 }],
|
|
1234
|
+
["exec", { valued: /* @__PURE__ */ new Set(["-a"]), operands: 0 }],
|
|
1235
|
+
["stdbuf", { valued: /* @__PURE__ */ new Set(["-i", "-o", "-e"]), operands: 0 }]
|
|
1236
|
+
]);
|
|
1237
|
+
var NAVIGATION_COMMANDS = /* @__PURE__ */ new Set(["cd", "pushd", "popd", "export", "source", "set", "."]);
|
|
1238
|
+
var PATH_SEPARATOR = "/";
|
|
1239
|
+
var FLAG_AND_VALUE = 2;
|
|
1240
|
+
var JOSH_LAUNCHER = String.raw`^(?:(?:pnpm|npx)\s+(?:exec\s+)?)?josh`;
|
|
1241
|
+
var JOSH_PATTERN = new RegExp(String.raw`${JOSH_LAUNCHER}\s+([a-z][\w:-]*)`, "u");
|
|
1242
|
+
var JOSH_LAUNCHER_PATTERN = new RegExp(String.raw`${JOSH_LAUNCHER}(?:\s|$)`, "u");
|
|
1243
|
+
var JOSH_PREFIX = "josh ";
|
|
1244
|
+
var COMMAND_KEY2 = "command";
|
|
1245
|
+
function bash_command(input) {
|
|
1246
|
+
if (!json_value.is_record(input)) return "";
|
|
1247
|
+
const command = input[COMMAND_KEY2];
|
|
1248
|
+
return typeof command === "string" ? command : "";
|
|
1249
|
+
}
|
|
1250
|
+
function after_flags(words, start, valued) {
|
|
1251
|
+
let index = start;
|
|
1252
|
+
while (words[index]?.startsWith(FLAG_PREFIX) === true) {
|
|
1253
|
+
index += valued.has(words[index] ?? "") ? FLAG_AND_VALUE : 1;
|
|
1254
|
+
}
|
|
1255
|
+
return index;
|
|
1256
|
+
}
|
|
1257
|
+
function after_prefix_word(words, index) {
|
|
1258
|
+
const word2 = words[index] ?? "";
|
|
1259
|
+
if (word2.startsWith(FLAG_PREFIX) || ASSIGNMENT_PATTERN.test(word2)) return index + 1;
|
|
1260
|
+
const wrapper = WRAPPER_COMMANDS.get(word2.slice(word2.lastIndexOf(PATH_SEPARATOR) + 1));
|
|
1261
|
+
if (wrapper === void 0) return index;
|
|
1262
|
+
return after_flags(words, index + 1, wrapper.valued) + wrapper.operands;
|
|
1263
|
+
}
|
|
1264
|
+
function command_words(segment) {
|
|
1265
|
+
const words = segment.replaceAll(SUBSHELL_OPENER, " ").trim().split(WHITESPACE_PATTERN);
|
|
1266
|
+
let start = 0;
|
|
1267
|
+
for (let next = after_prefix_word(words, start); next !== start; ) {
|
|
1268
|
+
start = next;
|
|
1269
|
+
next = after_prefix_word(words, start);
|
|
1270
|
+
}
|
|
1271
|
+
return words.slice(start);
|
|
1272
|
+
}
|
|
1273
|
+
function segment_command(segment) {
|
|
1274
|
+
const [head] = command_words(segment);
|
|
1275
|
+
if (head === void 0 || NAVIGATION_COMMANDS.has(head)) return "";
|
|
1276
|
+
return COMMAND_WORD_PATTERN.test(head) ? head : "";
|
|
1277
|
+
}
|
|
1278
|
+
function command_segment(command) {
|
|
1279
|
+
return command.split(SEGMENT_PATTERN).find((segment) => segment_command(segment) !== "") ?? "";
|
|
1280
|
+
}
|
|
1281
|
+
function leading_word(command) {
|
|
1282
|
+
return segment_command(command_segment(command));
|
|
1283
|
+
}
|
|
1284
|
+
function open_heredoc(line, kept) {
|
|
1285
|
+
kept.push(line.replace(HEREDOC_MARKER, " "));
|
|
1286
|
+
return HEREDOC_MARKER.exec(line)?.[HEREDOC_DELIMITER_GROUP];
|
|
1287
|
+
}
|
|
1288
|
+
function close_heredoc(line, delimiter) {
|
|
1289
|
+
return line.trim() === delimiter ? void 0 : delimiter;
|
|
1290
|
+
}
|
|
1291
|
+
function without_heredoc_bodies(command) {
|
|
1292
|
+
const kept = [];
|
|
1293
|
+
const body = {};
|
|
1294
|
+
for (const line of command.split(LINE_BREAK3)) {
|
|
1295
|
+
body.delimiter = body.delimiter === void 0 ? open_heredoc(line, kept) : close_heredoc(line, body.delimiter);
|
|
1296
|
+
}
|
|
1297
|
+
return kept.join(LINE_BREAK3);
|
|
1298
|
+
}
|
|
1299
|
+
function spoken_substitutions(span) {
|
|
1300
|
+
if (!span.startsWith(DOUBLE_QUOTE)) return " ";
|
|
1301
|
+
const inner = [...span.matchAll(SUBSTITUTION_PATTERN)].map(
|
|
1302
|
+
(match) => (match.groups?.["dollar"] ?? match.groups?.["tick"] ?? "").replaceAll(QUOTED_SPAN_PATTERN, " ")
|
|
1303
|
+
);
|
|
1304
|
+
return inner.length === 0 ? " " : ` ; ${inner.join(" ; ")} ; `;
|
|
1305
|
+
}
|
|
1306
|
+
function unquoted(command) {
|
|
1307
|
+
return without_heredoc_bodies(command).replaceAll(
|
|
1308
|
+
QUOTED_SPAN_PATTERN,
|
|
1309
|
+
(span) => spoken_substitutions(span)
|
|
1310
|
+
);
|
|
1311
|
+
}
|
|
1312
|
+
function has_heredoc(command) {
|
|
1313
|
+
return HEREDOC_MARKER.test(command);
|
|
1314
|
+
}
|
|
1315
|
+
function blanked(command) {
|
|
1316
|
+
if (has_heredoc(command)) return void 0;
|
|
1317
|
+
return command.replaceAll(QUOTED_SPAN_PATTERN, (span) => " ".repeat(span.length));
|
|
1318
|
+
}
|
|
1319
|
+
function literal_blanked(command) {
|
|
1320
|
+
return command.replaceAll(
|
|
1321
|
+
QUOTED_SPAN_PATTERN,
|
|
1322
|
+
(span) => span.startsWith(DOUBLE_QUOTE) ? span : " ".repeat(span.length)
|
|
1323
|
+
);
|
|
1324
|
+
}
|
|
1325
|
+
function discarded_commands(command) {
|
|
1326
|
+
const plain2 = unquoted(command);
|
|
1327
|
+
if (PIPEFAIL_PATTERN.test(plain2)) return [];
|
|
1328
|
+
return plain2.split(PIPE_PATTERN).slice(0, -1).map((segment) => segment.split(CHAIN_PATTERN).at(-1) ?? "");
|
|
1329
|
+
}
|
|
1330
|
+
function bash_label(command) {
|
|
1331
|
+
const word2 = leading_word(command);
|
|
1332
|
+
return word2 === "" ? cost_blocks.BASH_TOOL : `${cost_blocks.BASH_TOOL}${BASH_SEPARATOR}${word2}`;
|
|
1333
|
+
}
|
|
1334
|
+
function josh_command_of_segment(segment) {
|
|
1335
|
+
const name = JOSH_PATTERN.exec(command_words(segment).join(" "))?.[1];
|
|
1336
|
+
return name === void 0 ? "" : `${JOSH_PREFIX}${name}`;
|
|
1337
|
+
}
|
|
1338
|
+
function runs_josh(segment) {
|
|
1339
|
+
return JOSH_LAUNCHER_PATTERN.test(command_words(segment).join(" "));
|
|
1340
|
+
}
|
|
1341
|
+
function josh_command_of(command) {
|
|
1342
|
+
return josh_command_of_segment(command_segment(command));
|
|
1343
|
+
}
|
|
1344
|
+
function josh_commands_of(command) {
|
|
1345
|
+
return unquoted(command).split(SEGMENT_PATTERN).map((segment) => josh_command_of_segment(segment)).filter((name) => name !== "");
|
|
1346
|
+
}
|
|
1347
|
+
var REDIRECTION_CHARACTERS = ["<", ">"];
|
|
1348
|
+
function is_redirection(word2) {
|
|
1349
|
+
return REDIRECTION_CHARACTERS.some((character) => word2.includes(character));
|
|
1350
|
+
}
|
|
1351
|
+
function ends_in_redirection(word2) {
|
|
1352
|
+
return REDIRECTION_CHARACTERS.some((character) => word2.endsWith(character));
|
|
1353
|
+
}
|
|
1354
|
+
function drop_redirections(words) {
|
|
1355
|
+
const kept = [];
|
|
1356
|
+
let is_target = false;
|
|
1357
|
+
for (const word2 of words) {
|
|
1358
|
+
const is_dropped = is_target || is_redirection(word2);
|
|
1359
|
+
is_target = ends_in_redirection(word2);
|
|
1360
|
+
if (!is_dropped) kept.push(word2);
|
|
1361
|
+
}
|
|
1362
|
+
return kept;
|
|
1363
|
+
}
|
|
1364
|
+
function josh_arguments_of_segment(segment) {
|
|
1365
|
+
const text2 = command_words(segment).join(" ");
|
|
1366
|
+
const match = JOSH_PATTERN.exec(text2);
|
|
1367
|
+
if (match === null) return [];
|
|
1368
|
+
const words = text2.slice(match[0].length).split(WHITESPACE_PATTERN).filter((word2) => word2 !== "");
|
|
1369
|
+
return drop_redirections(words);
|
|
1370
|
+
}
|
|
1371
|
+
function josh_arguments(command) {
|
|
1372
|
+
return josh_arguments_of_segment(command_segment(command));
|
|
1373
|
+
}
|
|
1374
|
+
function josh_signature_of_segment(segment) {
|
|
1375
|
+
const name = josh_command_of_segment(segment);
|
|
1376
|
+
if (name === "") return "";
|
|
1377
|
+
return [name, ...josh_arguments_of_segment(segment)].join(" ");
|
|
1378
|
+
}
|
|
1379
|
+
function josh_signatures_of(command) {
|
|
1380
|
+
return unquoted(command).split(SEGMENT_PATTERN).map((segment) => josh_signature_of_segment(segment)).filter((signature) => signature !== "");
|
|
1381
|
+
}
|
|
1382
|
+
var time_shell = {
|
|
1383
|
+
JOSH_PREFIX,
|
|
1384
|
+
bash_command,
|
|
1385
|
+
bash_label,
|
|
1386
|
+
blanked,
|
|
1387
|
+
command_segment,
|
|
1388
|
+
command_words,
|
|
1389
|
+
discarded_commands,
|
|
1390
|
+
has_heredoc,
|
|
1391
|
+
josh_arguments,
|
|
1392
|
+
runs_josh,
|
|
1393
|
+
josh_command_of,
|
|
1394
|
+
josh_command_of_segment,
|
|
1395
|
+
josh_commands_of,
|
|
1396
|
+
josh_signatures_of,
|
|
1397
|
+
leading_word,
|
|
1398
|
+
literal_blanked,
|
|
1399
|
+
unquoted,
|
|
1400
|
+
without_heredoc_bodies
|
|
1401
|
+
};
|
|
1402
|
+
|
|
1403
|
+
// scripts/git/repository-lock.ts
|
|
1404
|
+
import { randomUUID } from "node:crypto";
|
|
1405
|
+
import { linkSync, renameSync, rmSync } from "node:fs";
|
|
1406
|
+
|
|
1407
|
+
// scripts/josh/process-owner.ts
|
|
1408
|
+
var process_owner_schema = external_exports.object({ pid: external_exports.number(), process_start: external_exports.string().optional() });
|
|
1409
|
+
|
|
1410
|
+
// scripts/lib/poll.ts
|
|
1411
|
+
async function sleep(duration_ms) {
|
|
1412
|
+
await new Promise((resolve) => {
|
|
1413
|
+
setTimeout(resolve, duration_ms);
|
|
1414
|
+
});
|
|
1415
|
+
}
|
|
1416
|
+
var POLL_BACKOFF = { initial_ms: 3e4, factor: 1.5, max_ms: 12e4 };
|
|
1417
|
+
var PR_POLL_SCHEDULES = {
|
|
1418
|
+
// CI does not finish right after it starts, so the lead reads coarsely; after it a fixed interval
|
|
1419
|
+
// bounds the detection delay that a lengthening wait would stretch toward its cap.
|
|
1420
|
+
checks: {
|
|
1421
|
+
lead: { count: 4, interval_ms: 3e4 },
|
|
1422
|
+
initial_ms: 2e4,
|
|
1423
|
+
factor: 1,
|
|
1424
|
+
max_ms: 2e4
|
|
1425
|
+
},
|
|
1426
|
+
// The CI completion wait and its watch: a poll where the head's checks did not move costs only
|
|
1427
|
+
// two conditional reads (`git-pr-checks-gate.ts`), so after the same lead it polls twice as often
|
|
1428
|
+
// (joshuafolkken/kit#7238). `checks` stays the CodeRabbit retrigger wait's, which has no gate.
|
|
1429
|
+
checks_gated: {
|
|
1430
|
+
lead: { count: 4, interval_ms: 3e4 },
|
|
1431
|
+
initial_ms: 1e4,
|
|
1432
|
+
factor: 1,
|
|
1433
|
+
max_ms: 1e4
|
|
1434
|
+
},
|
|
1435
|
+
// A merge lands soon after the checks pass, so its wait starts fine and keeps a low cap that
|
|
1436
|
+
// bounds the delay between the merge landing and its detection (joshuafolkken/kit#7237).
|
|
1437
|
+
merge: { initial_ms: 1e4, factor: 1.5, max_ms: 15e3 }
|
|
1438
|
+
};
|
|
1439
|
+
function fixed_cadence(options) {
|
|
1440
|
+
return function next_wait(attempt) {
|
|
1441
|
+
return attempt < options.attempts - 1 ? options.interval_ms : void 0;
|
|
1442
|
+
};
|
|
1443
|
+
}
|
|
1444
|
+
function next_backoff_interval(schedule, previous, seen) {
|
|
1445
|
+
if (seen !== previous.seen) return schedule.initial_ms;
|
|
1446
|
+
return Math.min(previous.interval_ms * schedule.factor, schedule.max_ms);
|
|
1447
|
+
}
|
|
1448
|
+
function next_backoff_step(schedule, previous, tick, seen) {
|
|
1449
|
+
const { lead } = schedule;
|
|
1450
|
+
if (lead !== void 0 && tick < lead.count) {
|
|
1451
|
+
return { interval_ms: lead.interval_ms, seen: void 0 };
|
|
1452
|
+
}
|
|
1453
|
+
return { interval_ms: next_backoff_interval(schedule, previous, seen), seen };
|
|
1454
|
+
}
|
|
1455
|
+
function backoff_cadence(options, backoff) {
|
|
1456
|
+
const schedule = backoff.schedule ?? POLL_BACKOFF;
|
|
1457
|
+
const budget_ms = (options.attempts - 1) * options.interval_ms;
|
|
1458
|
+
const state = { waited_ms: 0, step: { interval_ms: 0, seen: void 0 } };
|
|
1459
|
+
return function next_wait(tick) {
|
|
1460
|
+
if (state.waited_ms >= budget_ms) return void 0;
|
|
1461
|
+
const step = next_backoff_step(schedule, state.step, tick, backoff.seen?.() ?? "");
|
|
1462
|
+
const wait_ms = Math.min(step.interval_ms, budget_ms - state.waited_ms);
|
|
1463
|
+
Object.assign(state, { waited_ms: state.waited_ms + wait_ms, step });
|
|
1464
|
+
return wait_ms;
|
|
1465
|
+
};
|
|
1466
|
+
}
|
|
1467
|
+
function to_cadence(options) {
|
|
1468
|
+
return options.backoff === void 0 ? fixed_cadence(options) : backoff_cadence(options, options.backoff);
|
|
1469
|
+
}
|
|
1470
|
+
function wait_after(value, next_wait, attempt) {
|
|
1471
|
+
return value === void 0 ? next_wait(attempt) : void 0;
|
|
1472
|
+
}
|
|
1473
|
+
async function poll_for(read3, options) {
|
|
1474
|
+
const wait = options.sleeper ?? sleep;
|
|
1475
|
+
const next_wait = to_cadence(options);
|
|
1476
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
1477
|
+
const value = await read3();
|
|
1478
|
+
const wait_ms = wait_after(value, next_wait, attempt);
|
|
1479
|
+
if (wait_ms === void 0) return value;
|
|
1480
|
+
await wait(wait_ms);
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
async function poll_until(is_done2, options) {
|
|
1484
|
+
const is_reached = await poll_for(async () => await is_done2() ? true : void 0, options);
|
|
1485
|
+
return is_reached === true;
|
|
1486
|
+
}
|
|
1487
|
+
async function wait_for(read3, options) {
|
|
1488
|
+
const value = await poll_for(read3, { ...options, attempts: Infinity });
|
|
1489
|
+
if (value === void 0) throw new Error("an unbounded poll ran out of attempts");
|
|
1490
|
+
return value;
|
|
1491
|
+
}
|
|
1492
|
+
var poll = { poll_for, poll_until, sleep, wait_for };
|
|
1493
|
+
|
|
1494
|
+
// scripts/git/repository-lock.ts
|
|
1495
|
+
var POLL_INTERVAL_MS = 200;
|
|
1496
|
+
var SYNC_POLL_INTERVAL_MS = 10;
|
|
1497
|
+
var SLEEP_CELL = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));
|
|
1498
|
+
function lock_path(prefix, cwd) {
|
|
1499
|
+
return stamp_file.stamp_path(prefix, git_common_directory.repository(cwd) ?? cwd ?? process.cwd());
|
|
1500
|
+
}
|
|
1501
|
+
function parse_owner(raw) {
|
|
1502
|
+
if (raw === void 0) return void 0;
|
|
1503
|
+
const parsed = process_owner_schema.safeParse(json_value.parse_or_undefined(raw));
|
|
1504
|
+
return parsed.success ? parsed.data : void 0;
|
|
1505
|
+
}
|
|
1506
|
+
function read_owner(target2) {
|
|
1507
|
+
return parse_owner(stamp_file.read_stamp_text(target2));
|
|
1508
|
+
}
|
|
1509
|
+
function is_owner_gone(owner) {
|
|
1510
|
+
return process_identity.is_same_process(owner.pid, owner.process_start) === false;
|
|
1511
|
+
}
|
|
1512
|
+
function restore(aside, target2) {
|
|
1513
|
+
try {
|
|
1514
|
+
linkSync(aside, target2);
|
|
1515
|
+
} catch {
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
function stale_record(target2, is_gone) {
|
|
1519
|
+
const raw = stamp_file.read_stamp_text(target2);
|
|
1520
|
+
const owner = parse_owner(raw);
|
|
1521
|
+
return owner !== void 0 && is_gone(owner) ? raw : void 0;
|
|
1522
|
+
}
|
|
1523
|
+
function move_aside(target2) {
|
|
1524
|
+
const aside = `${target2}.${String(process.pid)}.${randomUUID()}`;
|
|
1525
|
+
try {
|
|
1526
|
+
renameSync(target2, aside);
|
|
1527
|
+
return aside;
|
|
1528
|
+
} catch {
|
|
1529
|
+
return void 0;
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
function clear_stale(target2, is_gone = is_owner_gone) {
|
|
1533
|
+
const raw = stale_record(target2, is_gone);
|
|
1534
|
+
if (raw === void 0) return;
|
|
1535
|
+
const aside = move_aside(target2);
|
|
1536
|
+
if (aside === void 0) return;
|
|
1537
|
+
if (stamp_file.read_stamp_text(aside) !== raw) restore(aside, target2);
|
|
1538
|
+
rmSync(aside, { force: true });
|
|
1539
|
+
}
|
|
1540
|
+
function claim(target2) {
|
|
1541
|
+
clear_stale(target2);
|
|
1542
|
+
return stamp_file.create_stamp(target2, process_identity.own_fields());
|
|
1543
|
+
}
|
|
1544
|
+
function release(target2) {
|
|
1545
|
+
const owner = read_owner(target2);
|
|
1546
|
+
if (owner !== void 0 && process_identity.is_own_process(owner.pid, owner.process_start)) {
|
|
1547
|
+
stamp_file.remove_stamp(target2);
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
async function acquire(target2, max_wait_ms) {
|
|
1551
|
+
const deadline = Date.now() + max_wait_ms;
|
|
1552
|
+
return await poll.wait_for(
|
|
1553
|
+
() => {
|
|
1554
|
+
if (claim(target2)) return true;
|
|
1555
|
+
return Date.now() >= deadline ? false : void 0;
|
|
1556
|
+
},
|
|
1557
|
+
{ interval_ms: POLL_INTERVAL_MS }
|
|
1558
|
+
);
|
|
1559
|
+
}
|
|
1560
|
+
function sleep_sync(ms) {
|
|
1561
|
+
Atomics.wait(SLEEP_CELL, 0, 0, ms);
|
|
1562
|
+
}
|
|
1563
|
+
function acquire_sync(target2, max_wait_ms) {
|
|
1564
|
+
const deadline = Date.now() + max_wait_ms;
|
|
1565
|
+
while (!claim(target2)) {
|
|
1566
|
+
if (Date.now() >= deadline) return false;
|
|
1567
|
+
sleep_sync(SYNC_POLL_INTERVAL_MS);
|
|
1568
|
+
}
|
|
1569
|
+
return true;
|
|
1570
|
+
}
|
|
1571
|
+
async function with_lock(work, target2, max_wait_ms) {
|
|
1572
|
+
if (!await acquire(target2, max_wait_ms)) return void 0;
|
|
1573
|
+
try {
|
|
1574
|
+
return await work();
|
|
1575
|
+
} finally {
|
|
1576
|
+
release(target2);
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
function with_lock_sync(work, target2, max_wait_ms) {
|
|
1580
|
+
if (!acquire_sync(target2, max_wait_ms)) return void 0;
|
|
1581
|
+
try {
|
|
1582
|
+
return work();
|
|
1583
|
+
} finally {
|
|
1584
|
+
release(target2);
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
var repository_lock = { clear_stale, lock_path, with_lock, with_lock_sync };
|
|
1588
|
+
|
|
1589
|
+
// scripts/run/event/run-event-stream.ts
|
|
1590
|
+
var EVENT_PREFIX = durable_state.PREFIX.EVENTS;
|
|
1591
|
+
var EVENT_SUFFIX = ".jsonl";
|
|
1592
|
+
var EVENT_CAP = 15e3;
|
|
1593
|
+
var FIRST_POSITION = 0;
|
|
1594
|
+
var POSITION_INCREMENT = 1;
|
|
1595
|
+
var LINE_SEPARATOR2 = "\n";
|
|
1596
|
+
var WORD_SEPARATOR2 = " ";
|
|
1597
|
+
var STAGE_PHASE_INDEX = 2;
|
|
1598
|
+
var LOCK_SUFFIX = ".lock";
|
|
1599
|
+
var LOCK_WAIT_MS = 5e3;
|
|
1600
|
+
var EVENT_KIND = {
|
|
1601
|
+
PLAN: "plan",
|
|
1602
|
+
CHILD_LAUNCH: "child-launch",
|
|
1603
|
+
MERGE: "merge",
|
|
1604
|
+
PARK: "park",
|
|
1605
|
+
HUMAN_REVIEW: "human-review",
|
|
1606
|
+
SPLIT: "split",
|
|
1607
|
+
OUTAGE: "outage",
|
|
1608
|
+
// A Claude usage limit stopped a lane child (joshuafolkken/kit#4745). Its text names the reset time,
|
|
1609
|
+
// which `backlog:drive` reads to hold launches until then; it counts against no streak, so it is not an
|
|
1610
|
+
// `OUTAGE`.
|
|
1611
|
+
USAGE_LIMIT: "usage-limit",
|
|
1612
|
+
CUT: "cut",
|
|
1613
|
+
// A fresh session adopted an implementation cut — `run:cut --resume` answered `resume-impl`. The
|
|
1614
|
+
// resume clears the cut record, so without this the `cut` would stay the newest position and
|
|
1615
|
+
// `run:step` would keep answering the resume command it had just run.
|
|
1616
|
+
RESUME: "resume",
|
|
1617
|
+
// A person stopped a running lane child and re-dispatched its issue in a fresh session
|
|
1618
|
+
// (`lane:restart`). It follows the fresh dispatch's `CHILD_LAUNCH`, so it is a launch to the parent and
|
|
1619
|
+
// the board, and — like that launch — a batch record a lane child never reads as its own position.
|
|
1620
|
+
RESTART: "restart",
|
|
1621
|
+
// A person withdrew a lane child — stopped it and left its issue open for the next run (`lane:withdraw`).
|
|
1622
|
+
// It is written before the stop, so `run:merge` settles the child as withdrawn whatever GitHub says
|
|
1623
|
+
// by the time the parent collects it, and counts it as neither a merge, a failure nor an outage.
|
|
1624
|
+
WITHDRAW: "withdraw",
|
|
1625
|
+
// The backlog emptied while nothing of the run's own was in flight — the drain. It marks the position
|
|
1626
|
+
// at which the end-of-run retrospective is owed, *before* the idle watch opens, so `run:step` fires
|
|
1627
|
+
// the retrospective at the drain rather than after the watch runs its course. It is not itself a
|
|
1628
|
+
// stop: the run watches on once the retrospective has run, and the real `STOP` follows when the watch
|
|
1629
|
+
// expires.
|
|
1630
|
+
DRAIN: "drain",
|
|
1631
|
+
STOP: "stop",
|
|
1632
|
+
PR_OPENED: "pr-opened",
|
|
1633
|
+
REVIEW_ROUND: "review-round",
|
|
1634
|
+
// The end-of-run retrospective's result, recorded when the run marks the retrospective done. A
|
|
1635
|
+
// retrospective that files zero improvements and one that never ran look
|
|
1636
|
+
// the same from outside — no new Issue either way — so the result is put on the stream the report is
|
|
1637
|
+
// generated from: the issues filed (or that none were), and the candidates dropped with why. It is
|
|
1638
|
+
// emitted from the `run:carry --retrospective` close, so marking the retrospective done and recording
|
|
1639
|
+
// what it found are one action rather than two the run could do only one of.
|
|
1640
|
+
RETROSPECTIVE: "retrospective",
|
|
1641
|
+
// Ready backlog work is sitting undispatched while a lane is free and nothing has dispatched for a
|
|
1642
|
+
// while. Emitted once per stall episode by the stop-time detector, it is both the dedup marker —
|
|
1643
|
+
// `emit_once_since` refuses a second until a `CHILD_LAUNCH` intervenes — and the line a terminal
|
|
1644
|
+
// reader following the stream sees. `run:step` reads it as `backlog:next`, so a run that
|
|
1645
|
+
// stalled is pointed straight at dispatching the work rather than left waiting.
|
|
1646
|
+
STALL: "stall",
|
|
1647
|
+
// The run's own driver is gone: the cut handed the budget off, the owner has died, and no supervisor
|
|
1648
|
+
// is watching. Emitted once per strand episode by the stop-time detector — or by the `run:wake`
|
|
1649
|
+
// supervisor as it fails, leaves that state behind and has warned of it —
|
|
1650
|
+
// exactly as `STALL` is — the newest-event dedup keeps a run polled every stop from notifying more
|
|
1651
|
+
// than once, and a terminal reader following the stream sees the line. The strand is the step before
|
|
1652
|
+
// the stall: a stalled run still has a driver that could dispatch, a stranded one has none.
|
|
1653
|
+
STRANDED: "stranded",
|
|
1654
|
+
// One `josh ship` stage starting, succeeding or failing. It is a trace of the
|
|
1655
|
+
// composite's progress rather than a position the run is at — the positions a ship leaves behind are
|
|
1656
|
+
// the closed issue its `followup` merges, or a detached supervisor's `SHIP_LAUNCH` / `SHIP_STOP` below
|
|
1657
|
+
// — so it is one of the `TRACE_KINDS` the last-event read skips.
|
|
1658
|
+
SHIP_STAGE: "ship-stage",
|
|
1659
|
+
// One progress watcher line — the `at … / next …` heartbeat `run:progress` prints. Printed only to
|
|
1660
|
+
// the watcher's own output, a headless successor's heartbeat would be buried in its log after a cut;
|
|
1661
|
+
// on the stream it reaches the attached session's relay. It says
|
|
1662
|
+
// the run is alive rather than where it is, so it is a trace kind like `SHIP_STAGE`.
|
|
1663
|
+
HEARTBEAT: "heartbeat",
|
|
1664
|
+
// The post-implementation region handed to a detached `josh ship --detach` supervisor. Unlike a stage
|
|
1665
|
+
// trace it is a position: the agent has ended and the
|
|
1666
|
+
// supervisor carries the run, so `run:step` answers `wait` until it stops or the issue closes.
|
|
1667
|
+
SHIP_LAUNCH: "ship-launch",
|
|
1668
|
+
// The supervisor stopped at a failed stage — a red gate, a High/Medium review, a failed push, red CI
|
|
1669
|
+
// The position that hands control back: `run:step` prints the command that
|
|
1670
|
+
// shows the stopped report, so the agent fixes it and relaunches rather than rebuilding the context.
|
|
1671
|
+
SHIP_STOP: "ship-stop",
|
|
1672
|
+
// The relaunch meant to answer a `SHIP_STOP` started nothing — the broker refused it, or the direct
|
|
1673
|
+
// spawn failed (joshuafolkken/kit#4765). `run:merge` reads it, not the transcript's mtime, to tell the
|
|
1674
|
+
// stop went unanswered, and a re-dispatch cap's park names its reason. A trace: the stop stays the
|
|
1675
|
+
// position `run:step` answers.
|
|
1676
|
+
RELAUNCH_FAILED: "relaunch-failed",
|
|
1677
|
+
// An Issue the run filed on its way, written by `issue:file`, so a run started from the command line
|
|
1678
|
+
// still surfaces what it found — `run:board`'s findings section reads it.
|
|
1679
|
+
FILED: "filed",
|
|
1680
|
+
// A one-line observation short of an Issue, written with `run:event --append note` and shown in the
|
|
1681
|
+
// same section.
|
|
1682
|
+
NOTE: "note",
|
|
1683
|
+
// A lane child reached a phase no other event marks — its first implementation edit, written by the
|
|
1684
|
+
// PreToolUse hook — so `run:board` draws how far the child has got. The backlog driver writes its own
|
|
1685
|
+
// `collect` / `launch` steps on a child as this kind too, which no reader draws as a phase
|
|
1686
|
+
// (`backlog-drive-trace.ts`). A trace, like `SHIP_STAGE`: it says where the child's work is, not where
|
|
1687
|
+
// the run is.
|
|
1688
|
+
LANE_PHASE: "lane-phase",
|
|
1689
|
+
// The fullrun step `run:step` or `run:entry` computed for an issue: `#<N> step <n>/<total> <name>`,
|
|
1690
|
+
// written once per change of step (`run-event-step.ts`), so `run:board` draws it (joshuafolkken/kit#6598).
|
|
1691
|
+
// A trace: it says which step the issue's run reached, not where the run is.
|
|
1692
|
+
STEP: "step",
|
|
1693
|
+
// An issue `run:add` put into the live run. The parent's `--wait` watcher
|
|
1694
|
+
// ends on it, so the issue takes the next free lane without waiting out the arrival probe's minute. A
|
|
1695
|
+
// trace: it says what the run was handed, not where the run is.
|
|
1696
|
+
ADD: "add",
|
|
1697
|
+
// `josh lane:limit` raised a live run's lane limit. The `--wait` watcher's
|
|
1698
|
+
// arrival probe reads it as a wake: the lanes a raise frees are new room for a pool its baseline
|
|
1699
|
+
// already holds. A trace: it says the run gained room, not where the run is.
|
|
1700
|
+
LANE_LIMIT: "lane-limit",
|
|
1701
|
+
// One stage of the run's start — the session starting, the plan, the hand-off to the supervisor, a
|
|
1702
|
+
// lane opening (`run-event-setup.ts`). `run:board` draws it while the run stands at it, so the
|
|
1703
|
+
// minutes before one read as work rather than as a run that has stopped. A trace: it says the run is
|
|
1704
|
+
// getting ready, not where the run is.
|
|
1705
|
+
SETUP: "setup",
|
|
1706
|
+
// A child's pull request checks as `josh followup` last polled them — the CI counts and CodeRabbit's
|
|
1707
|
+
// state (`run-event-checks.ts`), written only when they change, so `run:board` draws a child waiting
|
|
1708
|
+
// in followup without asking GitHub (joshuafolkken/kit#3770). A trace: it says how the checks stand,
|
|
1709
|
+
// not where the run is.
|
|
1710
|
+
PR_CHECKS: "pr-checks",
|
|
1711
|
+
// `backlog:drive` reached a watch with no child running and nothing to dispatch — the point a person's
|
|
1712
|
+
// hand is wanted. Emitted once per idle episode (`emit_once_since_with`, reset by `CHILD_LAUNCH`), it
|
|
1713
|
+
// is the dedup marker for the one idle Telegram. A trace: a drain's retrospective is read off the
|
|
1714
|
+
// position beneath it, so the marker must not stand over it.
|
|
1715
|
+
IDLE_NOTICE: "idle-notice",
|
|
1716
|
+
// A person paused or resumed a lane child (`lane:pause` / `lane:resume`), so who halted a lane and
|
|
1717
|
+
// when is on the stream rather than only in a shell history (joshuafolkken/kit#4268). A trace: it
|
|
1718
|
+
// says what a lane's processes were told, not where the run is.
|
|
1719
|
+
LANE_STATE: "lane-state",
|
|
1720
|
+
// `backlog:drive` found nothing of the run in flight and only paused lanes left, paused past the
|
|
1721
|
+
// silent window (joshuafolkken/kit#4270). Emitted once per pause episode (`emit_once_since_with`,
|
|
1722
|
+
// reset by `LANE_STATE`), it is the dedup marker for the one paused-lane Telegram. A trace.
|
|
1723
|
+
PAUSED_NOTICE: "paused-notice",
|
|
1724
|
+
// `backlog:drive` ran a due issue's measurement declaration itself, found it within its bound and
|
|
1725
|
+
// closed the issue through `issue:measured` — no lane was launched for it (joshuafolkken/kit#4621).
|
|
1726
|
+
// `run:board` draws it merged. A trace: the parent's position is the drive's, not this close.
|
|
1727
|
+
MEASURED: "measured",
|
|
1728
|
+
// `backlog:drive` ran a due issue's measurement declaration and found no sample to read yet, so the
|
|
1729
|
+
// issue waits without a lane (joshuafolkken/kit#6503). A trace: `offer_exclude` keeps it out of the
|
|
1730
|
+
// run's offers, the way the drive's own `waiting` list does.
|
|
1731
|
+
SAMPLE_WAIT: "sample-wait",
|
|
1732
|
+
// The host slept while `backlog:drive` sampled its load (joshuafolkken/kit#5032): the sampler's timer
|
|
1733
|
+
// ran late by more than a few intervals. `at` is the wake and `elapsed_ms` how long the sleep
|
|
1734
|
+
// lasted; every lane's net time takes it out (`lane-sleep.ts`). A trace.
|
|
1735
|
+
SLEEP: "sleep",
|
|
1736
|
+
// A lane's `lane:plan` blocking on a holder of its files (joshuafolkken/kit#6140): `#<N> start #<M>`
|
|
1737
|
+
// as one ask begins to wait, `#<N> end #<M>` as it ends, so `lane:breakdown` counts
|
|
1738
|
+
// the wait under its own row rather than the stage it fell in (`lane-plan-wait-event.ts`). A trace.
|
|
1739
|
+
PLAN_WAIT: "plan-wait",
|
|
1740
|
+
// GitHub's REST core rate limit read around one `backlog:drive` offer cycle (joshuafolkken/kit#6558):
|
|
1741
|
+
// JSON text with the cycle's `used_delta`, `remaining` and `reset`, or `is_missing` when a read failed
|
|
1742
|
+
// (`backlog-drive-rate.ts`). A trace written every cycle, so the bound rolls it off with the heartbeats.
|
|
1743
|
+
RATE_LIMIT: "rate-limit"
|
|
1744
|
+
};
|
|
1745
|
+
var EVENT_KINDS = Object.values(EVENT_KIND);
|
|
1746
|
+
var TRACE_KINDS = /* @__PURE__ */ new Set([
|
|
1747
|
+
EVENT_KIND.SHIP_STAGE,
|
|
1748
|
+
EVENT_KIND.HEARTBEAT,
|
|
1749
|
+
EVENT_KIND.FILED,
|
|
1750
|
+
EVENT_KIND.NOTE,
|
|
1751
|
+
EVENT_KIND.LANE_PHASE,
|
|
1752
|
+
EVENT_KIND.STEP,
|
|
1753
|
+
EVENT_KIND.ADD,
|
|
1754
|
+
EVENT_KIND.LANE_LIMIT,
|
|
1755
|
+
EVENT_KIND.SETUP,
|
|
1756
|
+
EVENT_KIND.PR_CHECKS,
|
|
1757
|
+
EVENT_KIND.IDLE_NOTICE,
|
|
1758
|
+
EVENT_KIND.LANE_STATE,
|
|
1759
|
+
EVENT_KIND.PAUSED_NOTICE,
|
|
1760
|
+
EVENT_KIND.MEASURED,
|
|
1761
|
+
EVENT_KIND.SAMPLE_WAIT,
|
|
1762
|
+
EVENT_KIND.RELAUNCH_FAILED,
|
|
1763
|
+
EVENT_KIND.SLEEP,
|
|
1764
|
+
EVENT_KIND.PLAN_WAIT,
|
|
1765
|
+
EVENT_KIND.RATE_LIMIT
|
|
1766
|
+
]);
|
|
1767
|
+
var DISPOSABLE_KINDS = /* @__PURE__ */ new Set([
|
|
1768
|
+
EVENT_KIND.SHIP_STAGE,
|
|
1769
|
+
EVENT_KIND.HEARTBEAT,
|
|
1770
|
+
EVENT_KIND.SETUP,
|
|
1771
|
+
EVENT_KIND.PR_CHECKS,
|
|
1772
|
+
EVENT_KIND.RATE_LIMIT
|
|
1773
|
+
]);
|
|
1774
|
+
var event_schema = external_exports.object({
|
|
1775
|
+
pos: external_exports.number(),
|
|
1776
|
+
at: external_exports.string(),
|
|
1777
|
+
kind: external_exports.string(),
|
|
1778
|
+
text: external_exports.string(),
|
|
1779
|
+
// The child's time on a lane, recorded once by the writer of an ending (joshuafolkken/kit#4481), so a
|
|
1780
|
+
// reader never has to find its launch again. An event written before it has none. A `sleep` event
|
|
1781
|
+
// carries the sleep's length here.
|
|
1782
|
+
elapsed_ms: external_exports.number().optional(),
|
|
1783
|
+
// The ship stop a park was taken at — its stage and `Cause` class (joshuafolkken/kit#6864) — so a
|
|
1784
|
+
// reader re-dispatching the park reads them without parsing text. Free strings: an event a later
|
|
1785
|
+
// version wrote with a new class still parses. A park written before it, or no ship's, has none —
|
|
1786
|
+
// as does one a lane on older code rewrote, since its schema drops the key, so none is a normal read.
|
|
1787
|
+
stop: external_exports.object({ stage: external_exports.string(), cause: external_exports.string() }).optional()
|
|
1788
|
+
});
|
|
1789
|
+
function is_event_kind(value) {
|
|
1790
|
+
return EVENT_KINDS.includes(value);
|
|
1791
|
+
}
|
|
1792
|
+
function target_of(repository) {
|
|
1793
|
+
return durable_state.path(EVENT_PREFIX, repository, EVENT_SUFFIX);
|
|
1794
|
+
}
|
|
1795
|
+
function is_present2(event) {
|
|
1796
|
+
return event !== void 0;
|
|
1797
|
+
}
|
|
1798
|
+
function parse_line3(line) {
|
|
1799
|
+
return event_schema.safeParse(json_value.parse_or_undefined(line)).data;
|
|
1800
|
+
}
|
|
1801
|
+
function lines_of(raw) {
|
|
1802
|
+
return raw.split(LINE_SEPARATOR2).map((line) => line.trim()).filter((line) => line.length > 0).map((line) => parse_line3(line)).filter(is_present2);
|
|
1803
|
+
}
|
|
1804
|
+
function events_of_text(raw) {
|
|
1805
|
+
return lines_of(raw).filter((event) => is_event_kind(event.kind));
|
|
1806
|
+
}
|
|
1807
|
+
function read_lines(target2, is_required = false) {
|
|
1808
|
+
const raw = stamp_file.read_stamp_text(target2);
|
|
1809
|
+
if (raw === void 0 && is_required) throw new Error("Could not read the run event stream.");
|
|
1810
|
+
if (raw === void 0) return [];
|
|
1811
|
+
return lines_of(raw);
|
|
1812
|
+
}
|
|
1813
|
+
function read_events(target2, is_required = false) {
|
|
1814
|
+
return read_lines(target2, is_required).filter((event) => is_event_kind(event.kind));
|
|
1815
|
+
}
|
|
1816
|
+
function last_position(events) {
|
|
1817
|
+
return events[events.length - POSITION_INCREMENT]?.pos ?? FIRST_POSITION;
|
|
1818
|
+
}
|
|
1819
|
+
function issue_of(event) {
|
|
1820
|
+
return event.text.split(WORD_SEPARATOR2)[FIRST_POSITION] ?? "";
|
|
1821
|
+
}
|
|
1822
|
+
function newest_by_issue(events, kind) {
|
|
1823
|
+
const newest = /* @__PURE__ */ new Map();
|
|
1824
|
+
for (const event of events) {
|
|
1825
|
+
if (event.kind === kind) newest.set(issue_of(event), event);
|
|
1826
|
+
}
|
|
1827
|
+
return new Set(newest.values());
|
|
1828
|
+
}
|
|
1829
|
+
function is_stage_start(event) {
|
|
1830
|
+
if (event.kind !== EVENT_KIND.SHIP_STAGE) return false;
|
|
1831
|
+
return event.text.split(WORD_SEPARATOR2)[STAGE_PHASE_INDEX] === run_ship_stage.PHASE.START;
|
|
1832
|
+
}
|
|
1833
|
+
function drawn_lines(events) {
|
|
1834
|
+
const setup = events.findLast((event) => event.kind === EVENT_KIND.SETUP);
|
|
1835
|
+
return /* @__PURE__ */ new Set([
|
|
1836
|
+
...newest_by_issue(events, EVENT_KIND.SHIP_STAGE),
|
|
1837
|
+
...newest_by_issue(events, EVENT_KIND.PR_CHECKS),
|
|
1838
|
+
...setup === void 0 ? [] : [setup]
|
|
1839
|
+
]);
|
|
1840
|
+
}
|
|
1841
|
+
function droppable(events) {
|
|
1842
|
+
const kept = drawn_lines(events);
|
|
1843
|
+
const disposable = events.filter((event) => DISPOSABLE_KINDS.has(event.kind) && !kept.has(event));
|
|
1844
|
+
return [
|
|
1845
|
+
...disposable.filter((event) => !is_stage_start(event)),
|
|
1846
|
+
...disposable.filter((event) => is_stage_start(event))
|
|
1847
|
+
];
|
|
1848
|
+
}
|
|
1849
|
+
function bounded(events) {
|
|
1850
|
+
const excess = events.length - EVENT_CAP;
|
|
1851
|
+
if (excess <= 0) return events;
|
|
1852
|
+
const dropped = new Set(droppable(events).slice(0, excess));
|
|
1853
|
+
return events.filter((event) => !dropped.has(event)).slice(-EVENT_CAP);
|
|
1854
|
+
}
|
|
1855
|
+
function serialize(events) {
|
|
1856
|
+
return `${events.map((event) => JSON.stringify(event)).join(LINE_SEPARATOR2)}${LINE_SEPARATOR2}`;
|
|
1857
|
+
}
|
|
1858
|
+
function append_held(target2, event) {
|
|
1859
|
+
const position = last_position(read_lines(target2)) + POSITION_INCREMENT;
|
|
1860
|
+
const events = bounded([...read_events(target2), { pos: position, ...event }]);
|
|
1861
|
+
stamp_file.replace_text_stamp(target2, serialize(events));
|
|
1862
|
+
return position;
|
|
1863
|
+
}
|
|
1864
|
+
function append_event(target2, event) {
|
|
1865
|
+
if (!is_event_kind(event.kind)) return { appended: false, position: FIRST_POSITION };
|
|
1866
|
+
const lock = `${target2}${LOCK_SUFFIX}`;
|
|
1867
|
+
const position = repository_lock.with_lock_sync(
|
|
1868
|
+
() => append_held(target2, event),
|
|
1869
|
+
lock,
|
|
1870
|
+
LOCK_WAIT_MS
|
|
1871
|
+
);
|
|
1872
|
+
if (position === void 0) {
|
|
1873
|
+
const message = `run event stream: gave up waiting for the lock at ${lock}`;
|
|
1874
|
+
process.stderr.write(`${message}
|
|
1875
|
+
`);
|
|
1876
|
+
throw new Error(message);
|
|
1877
|
+
}
|
|
1878
|
+
return { appended: true, position };
|
|
1879
|
+
}
|
|
1880
|
+
function append(target2, kind, text2, at) {
|
|
1881
|
+
return append_event(target2, { at, kind, text: text2 });
|
|
1882
|
+
}
|
|
1883
|
+
function read_from(target2, position) {
|
|
1884
|
+
const events = read_events(target2);
|
|
1885
|
+
return {
|
|
1886
|
+
events: events.filter((event) => event.pos > position),
|
|
1887
|
+
next_position: last_position(events)
|
|
1888
|
+
};
|
|
1889
|
+
}
|
|
1890
|
+
function read_last(target2) {
|
|
1891
|
+
return read_events(target2).findLast((event) => !TRACE_KINDS.has(event.kind));
|
|
1892
|
+
}
|
|
1893
|
+
function since(events, reset_kind) {
|
|
1894
|
+
const reset_at = events.findLastIndex((event) => event.kind === reset_kind);
|
|
1895
|
+
return events.slice(reset_at + POSITION_INCREMENT);
|
|
1896
|
+
}
|
|
1897
|
+
function has_since(events, kind, reset_kind) {
|
|
1898
|
+
return since(events, reset_kind).some((event) => event.kind === kind);
|
|
1899
|
+
}
|
|
1900
|
+
var FIELD_SEPARATOR = " \xB7 ";
|
|
1901
|
+
function format_event(event) {
|
|
1902
|
+
return [event.at, event.kind, event.text].join(FIELD_SEPARATOR);
|
|
1903
|
+
}
|
|
1904
|
+
var run_event_stream = {
|
|
1905
|
+
EVENT_CAP,
|
|
1906
|
+
EVENT_KIND,
|
|
1907
|
+
EVENT_KINDS,
|
|
1908
|
+
TRACE_KINDS,
|
|
1909
|
+
append,
|
|
1910
|
+
append_event,
|
|
1911
|
+
events_of_text,
|
|
1912
|
+
format_event,
|
|
1913
|
+
has_since,
|
|
1914
|
+
is_stage_start,
|
|
1915
|
+
read_events,
|
|
1916
|
+
read_from,
|
|
1917
|
+
read_last,
|
|
1918
|
+
since,
|
|
1919
|
+
target_of
|
|
1920
|
+
};
|
|
1921
|
+
|
|
1922
|
+
// scripts/rules/issue-citation.ts
|
|
1923
|
+
var ISSUE_NUMBER = /#\d+/gu;
|
|
1924
|
+
var REFERENCE_BOUNDARY = /[\s#()[\]<>|]/u;
|
|
1925
|
+
var OWNER_REPO = /^[^\s/#]+\/[^\s/#]+$/u;
|
|
1926
|
+
var MARKDOWN_LINK = /\[[^[\]]*\]\([^()]*\)/gu;
|
|
1927
|
+
var NUMBER_CONTINUATION = /^(?:\w|-[a-z])/iu;
|
|
1928
|
+
var CONTINUATION_WIDTH = 2;
|
|
1929
|
+
var GLUED_LEAD = /[&./]/u;
|
|
1930
|
+
var FENCE_MARKER = /^\s*(?:`{3,}|~{3,})/u;
|
|
1931
|
+
var QUOTE_LINE = /^\s*>/u;
|
|
1932
|
+
var PR_PREFIX = /\b(?:pr|pull request)\s*$/iu;
|
|
1933
|
+
var BACKTICK_PAIR = 2;
|
|
1934
|
+
function link_covers(link, index) {
|
|
1935
|
+
const start = link.index ?? 0;
|
|
1936
|
+
return index >= start && index < start + link[0].length;
|
|
1937
|
+
}
|
|
1938
|
+
function is_linked_at(line, index) {
|
|
1939
|
+
for (const link of line.matchAll(MARKDOWN_LINK)) {
|
|
1940
|
+
if (link_covers(link, index)) return true;
|
|
1941
|
+
}
|
|
1942
|
+
return false;
|
|
1943
|
+
}
|
|
1944
|
+
function lead_token(message, hash_index) {
|
|
1945
|
+
let start = hash_index;
|
|
1946
|
+
while (start > 0 && !REFERENCE_BOUNDARY.test(message.charAt(start - 1))) start -= 1;
|
|
1947
|
+
return message.slice(start, hash_index);
|
|
1948
|
+
}
|
|
1949
|
+
function repo_prefix(message, hash_index) {
|
|
1950
|
+
const token = lead_token(message, hash_index);
|
|
1951
|
+
return OWNER_REPO.test(token) ? token : "";
|
|
1952
|
+
}
|
|
1953
|
+
function is_inline_code_at(line, index) {
|
|
1954
|
+
const backticks = line.slice(0, index).split("`").length - 1;
|
|
1955
|
+
return backticks % BACKTICK_PAIR === 1;
|
|
1956
|
+
}
|
|
1957
|
+
function is_bare_at(line, index) {
|
|
1958
|
+
if (is_linked_at(line, index) || is_inline_code_at(line, index)) return false;
|
|
1959
|
+
return !PR_PREFIX.test(line.slice(0, index));
|
|
1960
|
+
}
|
|
1961
|
+
function is_glued(line, reference2) {
|
|
1962
|
+
const end = reference2.index + reference2.text.length;
|
|
1963
|
+
if (NUMBER_CONTINUATION.test(line.slice(end, end + CONTINUATION_WIDTH))) return true;
|
|
1964
|
+
return reference2.prefix === "" && GLUED_LEAD.test(lead_token(line, reference2.index));
|
|
1965
|
+
}
|
|
1966
|
+
function line_references(line) {
|
|
1967
|
+
const references = [];
|
|
1968
|
+
for (const match of line.matchAll(ISSUE_NUMBER)) {
|
|
1969
|
+
const reference2 = { index: match.index, prefix: repo_prefix(line, match.index), text: match[0] };
|
|
1970
|
+
if (!is_glued(line, reference2) && is_bare_at(line, match.index)) references.push(reference2);
|
|
1971
|
+
}
|
|
1972
|
+
return references;
|
|
1973
|
+
}
|
|
1974
|
+
function collect_line_references(line, found) {
|
|
1975
|
+
for (const reference2 of line_references(line)) found.push(`${reference2.prefix}${reference2.text}`);
|
|
1976
|
+
}
|
|
1977
|
+
function lines_outside_fences(message) {
|
|
1978
|
+
const lines = [];
|
|
1979
|
+
let is_in_fence = false;
|
|
1980
|
+
for (const line of message.split("\n")) {
|
|
1981
|
+
if (FENCE_MARKER.test(line)) is_in_fence = !is_in_fence;
|
|
1982
|
+
else if (!is_in_fence) lines.push(line);
|
|
1983
|
+
}
|
|
1984
|
+
return lines;
|
|
1985
|
+
}
|
|
1986
|
+
function prose_lines(message) {
|
|
1987
|
+
return lines_outside_fences(message).filter((line) => !QUOTE_LINE.test(line));
|
|
1988
|
+
}
|
|
1989
|
+
function bare_references(message) {
|
|
1990
|
+
const found = [];
|
|
1991
|
+
for (const line of prose_lines(message)) collect_line_references(line, found);
|
|
1992
|
+
return [...new Set(found)];
|
|
1993
|
+
}
|
|
1994
|
+
function has_bare_reference(message) {
|
|
1995
|
+
return bare_references(message).length > 0;
|
|
1996
|
+
}
|
|
1997
|
+
function reference_link(reference2, default_slug) {
|
|
1998
|
+
const slug = reference2.prefix === "" ? default_slug : reference2.prefix;
|
|
1999
|
+
const number = reference2.text.slice(1);
|
|
2000
|
+
return `[${reference2.prefix}${reference2.text}](${issue_cite.issue_url(slug, number)})`;
|
|
2001
|
+
}
|
|
2002
|
+
function linkify_line(line, slug) {
|
|
2003
|
+
let result = "";
|
|
2004
|
+
let cursor = 0;
|
|
2005
|
+
for (const reference2 of line_references(line)) {
|
|
2006
|
+
const start = reference2.index - reference2.prefix.length;
|
|
2007
|
+
result += line.slice(cursor, start) + reference_link(reference2, slug);
|
|
2008
|
+
cursor = reference2.index + reference2.text.length;
|
|
2009
|
+
}
|
|
2010
|
+
return result + line.slice(cursor);
|
|
2011
|
+
}
|
|
2012
|
+
function rewrite_line(line, slug, is_in_fence) {
|
|
2013
|
+
if (is_in_fence || FENCE_MARKER.test(line) || QUOTE_LINE.test(line)) return line;
|
|
2014
|
+
return linkify_line(line, slug);
|
|
2015
|
+
}
|
|
2016
|
+
function linkify(message, slug) {
|
|
2017
|
+
const out = [];
|
|
2018
|
+
let is_in_fence = false;
|
|
2019
|
+
for (const line of message.split("\n")) {
|
|
2020
|
+
if (FENCE_MARKER.test(line)) is_in_fence = !is_in_fence;
|
|
2021
|
+
out.push(rewrite_line(line, slug, is_in_fence));
|
|
2022
|
+
}
|
|
2023
|
+
return out.join("\n");
|
|
2024
|
+
}
|
|
2025
|
+
var issue_citation = {
|
|
2026
|
+
bare_references,
|
|
2027
|
+
has_bare_reference,
|
|
2028
|
+
linkify,
|
|
2029
|
+
prose_lines
|
|
2030
|
+
};
|
|
2031
|
+
|
|
2032
|
+
// scripts/issue/session-cite.ts
|
|
2033
|
+
function session_repo() {
|
|
2034
|
+
const url = repo_discovery.read_origin_url(process.cwd());
|
|
2035
|
+
const identity = url === void 0 ? void 0 : repo_origin.parse_origin_url(url);
|
|
2036
|
+
return identity === void 0 ? void 0 : `${identity.owner}/${identity.repo}`;
|
|
2037
|
+
}
|
|
2038
|
+
function issue(number, title, repo = session_repo()) {
|
|
2039
|
+
return issue_cite.reference(repo, String(number), title);
|
|
2040
|
+
}
|
|
2041
|
+
function text(message) {
|
|
2042
|
+
const repo = session_repo();
|
|
2043
|
+
return repo === void 0 ? message : issue_citation.linkify(message, repo);
|
|
2044
|
+
}
|
|
2045
|
+
var session_cite = {
|
|
2046
|
+
issue,
|
|
2047
|
+
session_repo,
|
|
2048
|
+
text
|
|
2049
|
+
};
|
|
2050
|
+
|
|
2051
|
+
// scripts/lane/lane-state.ts
|
|
2052
|
+
import { readdirSync } from "node:fs";
|
|
2053
|
+
import path5 from "node:path";
|
|
2054
|
+
|
|
2055
|
+
// scripts/lib/figure-format.ts
|
|
2056
|
+
var USD_DECIMALS = 4;
|
|
2057
|
+
var PERCENT_SCALE = 100;
|
|
2058
|
+
var PERCENT_DECIMALS = 1;
|
|
2059
|
+
var MINUTE_DECIMALS = 1;
|
|
2060
|
+
var CLOCK_WIDTH = 2;
|
|
2061
|
+
var CLOCK_PAD = "0";
|
|
2062
|
+
function format_usd(usd, decimals = USD_DECIMALS) {
|
|
2063
|
+
return `$${usd.toFixed(decimals)}`;
|
|
2064
|
+
}
|
|
2065
|
+
function format_tokens(count) {
|
|
2066
|
+
return count.toLocaleString("en-US");
|
|
2067
|
+
}
|
|
2068
|
+
function format_share(part, whole) {
|
|
2069
|
+
if (whole === 0) return "n/a";
|
|
2070
|
+
return `${(part / whole * PERCENT_SCALE).toFixed(PERCENT_DECIMALS)}%`;
|
|
2071
|
+
}
|
|
2072
|
+
function format_minutes(duration_ms) {
|
|
2073
|
+
return `${(duration_ms / MS_PER_MINUTE).toFixed(MINUTE_DECIMALS)} min`;
|
|
2074
|
+
}
|
|
2075
|
+
function two_digits(value) {
|
|
2076
|
+
return String(value).padStart(CLOCK_WIDTH, CLOCK_PAD);
|
|
2077
|
+
}
|
|
2078
|
+
function clock_of(ms) {
|
|
2079
|
+
const date = new Date(ms);
|
|
2080
|
+
return [date.getHours(), date.getMinutes(), date.getSeconds()].map((value) => two_digits(value)).join(":");
|
|
2081
|
+
}
|
|
2082
|
+
function minute_of(ms) {
|
|
2083
|
+
const date = new Date(ms);
|
|
2084
|
+
return [date.getHours(), date.getMinutes()].map((value) => two_digits(value)).join(":");
|
|
2085
|
+
}
|
|
2086
|
+
var figure_format = {
|
|
2087
|
+
format_usd,
|
|
2088
|
+
format_tokens,
|
|
2089
|
+
format_share,
|
|
2090
|
+
format_minutes,
|
|
2091
|
+
two_digits,
|
|
2092
|
+
clock_of,
|
|
2093
|
+
minute_of
|
|
2094
|
+
};
|
|
2095
|
+
|
|
2096
|
+
// scripts/lane/lane-state-record.ts
|
|
2097
|
+
import path4 from "node:path";
|
|
2098
|
+
var STATE_SUFFIX = ".json";
|
|
2099
|
+
var HUMAN_REVIEW = "human-review";
|
|
2100
|
+
var LANE_STATES = ["open", "running", "paused", HUMAN_REVIEW, "ended"];
|
|
2101
|
+
var IDLE_STATES = /* @__PURE__ */ new Set(["paused", HUMAN_REVIEW, "ended"]);
|
|
2102
|
+
var lane_run_schema = external_exports.object({ started_at: external_exports.string(), owner_pid: external_exports.number().optional() });
|
|
2103
|
+
var stuck_schema = external_exports.object({ pid: external_exports.number(), reason: external_exports.string() });
|
|
2104
|
+
var lane_state_schema = external_exports.object({
|
|
2105
|
+
issue: external_exports.string(),
|
|
2106
|
+
run: lane_run_schema.optional(),
|
|
2107
|
+
state: external_exports.enum(LANE_STATES),
|
|
2108
|
+
launched_at: external_exports.string().optional(),
|
|
2109
|
+
changed_at: external_exports.string(),
|
|
2110
|
+
changed_by: external_exports.string(),
|
|
2111
|
+
stuck: external_exports.array(stuck_schema).optional()
|
|
2112
|
+
});
|
|
2113
|
+
function record_name(common, issue2) {
|
|
2114
|
+
return stamp_file.stamp_name(
|
|
2115
|
+
durable_state_root.PREFIX.LANE_STATE,
|
|
2116
|
+
common,
|
|
2117
|
+
`-${issue2}${STATE_SUFFIX}`
|
|
2118
|
+
);
|
|
2119
|
+
}
|
|
2120
|
+
function read_record_file(source) {
|
|
2121
|
+
const raw = stamp_file.read_stamp_text(source);
|
|
2122
|
+
return raw === void 0 ? void 0 : json_value.parse_with(raw, lane_state_schema);
|
|
2123
|
+
}
|
|
2124
|
+
function is_idle(state_root, common, issue2) {
|
|
2125
|
+
const record2 = read_record_file(path4.join(state_root, record_name(common, issue2)));
|
|
2126
|
+
return record2 !== void 0 && IDLE_STATES.has(record2.state);
|
|
2127
|
+
}
|
|
2128
|
+
var lane_state_record = {
|
|
2129
|
+
HUMAN_REVIEW,
|
|
2130
|
+
LANE_STATES,
|
|
2131
|
+
STATE_SUFFIX,
|
|
2132
|
+
is_idle,
|
|
2133
|
+
read_record_file,
|
|
2134
|
+
record_name
|
|
2135
|
+
};
|
|
2136
|
+
|
|
2137
|
+
// scripts/lane/lane-state.ts
|
|
2138
|
+
var LOCK_SUFFIX2 = ".lock";
|
|
2139
|
+
var LOCK_WAIT_MS2 = 5e3;
|
|
2140
|
+
var { HUMAN_REVIEW: HUMAN_REVIEW2, LANE_STATES: LANE_STATES2, STATE_SUFFIX: STATE_SUFFIX2 } = lane_state_record;
|
|
2141
|
+
var NO_STATE_HINT = "no lane state \u2014 counted in use";
|
|
2142
|
+
var TRANSITIONS = {
|
|
2143
|
+
open: ["open", "running", HUMAN_REVIEW2, "ended"],
|
|
2144
|
+
running: ["running", "paused", HUMAN_REVIEW2, "ended"],
|
|
2145
|
+
paused: ["paused", "running", "ended"],
|
|
2146
|
+
[HUMAN_REVIEW2]: [HUMAN_REVIEW2, "running", "ended"],
|
|
2147
|
+
ended: ["ended", "open"]
|
|
2148
|
+
};
|
|
2149
|
+
function state_path(directory, issue2) {
|
|
2150
|
+
return path5.join(
|
|
2151
|
+
durable_state.ensure(durable_state.root()),
|
|
2152
|
+
lane_state_record.record_name(directory, issue2)
|
|
2153
|
+
);
|
|
2154
|
+
}
|
|
2155
|
+
function is_allowed(from, to) {
|
|
2156
|
+
return from === void 0 || TRANSITIONS[from].includes(to);
|
|
2157
|
+
}
|
|
2158
|
+
function read_record2(directory, issue2) {
|
|
2159
|
+
return lane_state_record.read_record_file(state_path(directory, issue2));
|
|
2160
|
+
}
|
|
2161
|
+
function write_record(directory, record2) {
|
|
2162
|
+
stamp_file.replace_stamp(state_path(directory, record2.issue), record2);
|
|
2163
|
+
}
|
|
2164
|
+
function current_run(directory) {
|
|
2165
|
+
const carried = run_carry.read_carry(run_carry.carry_path(directory));
|
|
2166
|
+
if (carried.kind !== "carried") return void 0;
|
|
2167
|
+
return { started_at: carried.carry.started_at, owner_pid: carried.carry.owner_pid };
|
|
2168
|
+
}
|
|
2169
|
+
function launch_fields(change, directory, now) {
|
|
2170
|
+
if (change.is_launch !== true) return {};
|
|
2171
|
+
return { run: current_run(directory), launched_at: now.toISOString() };
|
|
2172
|
+
}
|
|
2173
|
+
function next_record(change, previous, directory, now) {
|
|
2174
|
+
return {
|
|
2175
|
+
// An open starts a fresh life: a reopened lane keeps nothing of the run that launched it before.
|
|
2176
|
+
...change.state !== "open" && previous,
|
|
2177
|
+
issue: change.issue,
|
|
2178
|
+
state: change.state,
|
|
2179
|
+
changed_at: now.toISOString(),
|
|
2180
|
+
changed_by: change.command,
|
|
2181
|
+
...launch_fields(change, directory, now)
|
|
2182
|
+
};
|
|
2183
|
+
}
|
|
2184
|
+
function apply_held(change, directory, now) {
|
|
2185
|
+
const previous = read_record2(directory, change.issue);
|
|
2186
|
+
if (!is_allowed(previous?.state, change.state)) {
|
|
2187
|
+
return { kind: "skipped", reason: `no ${previous?.state ?? ""} \u2192 ${change.state} transition` };
|
|
2188
|
+
}
|
|
2189
|
+
const record2 = next_record(change, previous, directory, now);
|
|
2190
|
+
write_record(directory, record2);
|
|
2191
|
+
return { kind: "written", record: record2 };
|
|
2192
|
+
}
|
|
2193
|
+
var NO_DIRECTORY = { kind: "skipped", reason: "no git directory" };
|
|
2194
|
+
function locked(directory, issue2, held) {
|
|
2195
|
+
const lock = `${state_path(directory, issue2)}${LOCK_SUFFIX2}`;
|
|
2196
|
+
const outcome = repository_lock.with_lock_sync(held, lock, LOCK_WAIT_MS2);
|
|
2197
|
+
return outcome ?? { kind: "skipped", reason: `gave up waiting for the lock at ${lock}` };
|
|
2198
|
+
}
|
|
2199
|
+
function apply(change, directory, now) {
|
|
2200
|
+
return locked(directory, change.issue, () => apply_held(change, directory, now));
|
|
2201
|
+
}
|
|
2202
|
+
function warn(change, reason) {
|
|
2203
|
+
console.warn(
|
|
2204
|
+
`${change.command} ${session_cite.issue(change.issue)}: lane state not recorded \u2014 ${reason}`
|
|
2205
|
+
);
|
|
2206
|
+
}
|
|
2207
|
+
async function resolve_directory(directory) {
|
|
2208
|
+
return directory ?? await run_carry.repository_directory();
|
|
2209
|
+
}
|
|
2210
|
+
async function outcome_of(change, options) {
|
|
2211
|
+
const directory = await resolve_directory(options.directory);
|
|
2212
|
+
if (directory === void 0) return NO_DIRECTORY;
|
|
2213
|
+
return apply(change, directory, options.now ?? /* @__PURE__ */ new Date());
|
|
2214
|
+
}
|
|
2215
|
+
async function settled(write2) {
|
|
2216
|
+
try {
|
|
2217
|
+
return await write2();
|
|
2218
|
+
} catch (error) {
|
|
2219
|
+
return { kind: "skipped", reason: error instanceof Error ? error.message : String(error) };
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
async function record_change(change, options = {}) {
|
|
2223
|
+
const outcome = await settled(async () => await outcome_of(change, options));
|
|
2224
|
+
if (outcome.kind === "skipped") warn(change, outcome.reason);
|
|
2225
|
+
return outcome;
|
|
2226
|
+
}
|
|
2227
|
+
async function read_state(issue2, directory) {
|
|
2228
|
+
const root = await resolve_directory(directory);
|
|
2229
|
+
return root === void 0 ? void 0 : read_record2(root, issue2);
|
|
2230
|
+
}
|
|
2231
|
+
function recorded_issues(directory) {
|
|
2232
|
+
const empty = state_path(directory, "");
|
|
2233
|
+
const head = path5.basename(empty).slice(0, -STATE_SUFFIX2.length);
|
|
2234
|
+
return readdirSync(path5.dirname(empty)).filter((name) => name.startsWith(head) && name.endsWith(STATE_SUFFIX2)).map((name) => name.slice(head.length, -STATE_SUFFIX2.length)).filter((issue2) => issue2.length > 0);
|
|
2235
|
+
}
|
|
2236
|
+
async function read_records(directory) {
|
|
2237
|
+
const root = await resolve_directory(directory);
|
|
2238
|
+
if (root === void 0) return [];
|
|
2239
|
+
const records = recorded_issues(root).map((issue2) => read_record2(root, issue2));
|
|
2240
|
+
return records.filter((record2) => record2 !== void 0);
|
|
2241
|
+
}
|
|
2242
|
+
function stuck_held(issue2, stuck, directory) {
|
|
2243
|
+
const previous = read_record2(directory, issue2);
|
|
2244
|
+
if (previous === void 0) return { kind: "skipped", reason: "no record" };
|
|
2245
|
+
const record2 = { ...previous, stuck };
|
|
2246
|
+
write_record(directory, record2);
|
|
2247
|
+
return { kind: "written", record: record2 };
|
|
2248
|
+
}
|
|
2249
|
+
async function record_stuck(issue2, stuck, directory) {
|
|
2250
|
+
const root = await resolve_directory(directory);
|
|
2251
|
+
if (root === void 0) return NO_DIRECTORY;
|
|
2252
|
+
return locked(root, issue2, () => stuck_held(issue2, stuck, root));
|
|
2253
|
+
}
|
|
2254
|
+
function adopted_held(change, directory, now) {
|
|
2255
|
+
if (read_record2(directory, change.issue) !== void 0) {
|
|
2256
|
+
return { kind: "skipped", reason: "a record exists" };
|
|
2257
|
+
}
|
|
2258
|
+
return apply_held(change, directory, now);
|
|
2259
|
+
}
|
|
2260
|
+
async function adopted_outcome(change, options) {
|
|
2261
|
+
const directory = await resolve_directory(options.directory);
|
|
2262
|
+
if (directory === void 0) return NO_DIRECTORY;
|
|
2263
|
+
const now = options.now ?? /* @__PURE__ */ new Date();
|
|
2264
|
+
return locked(directory, change.issue, () => adopted_held(change, directory, now));
|
|
2265
|
+
}
|
|
2266
|
+
async function record_adopted(change, options = {}) {
|
|
2267
|
+
return await settled(async () => await adopted_outcome(change, options));
|
|
2268
|
+
}
|
|
2269
|
+
async function read_states(issues, directory) {
|
|
2270
|
+
const root = await resolve_directory(directory);
|
|
2271
|
+
if (root === void 0) return /* @__PURE__ */ new Map();
|
|
2272
|
+
const read3 = issues.map((issue2) => [
|
|
2273
|
+
issue2,
|
|
2274
|
+
read_record2(root, issue2)
|
|
2275
|
+
]);
|
|
2276
|
+
return new Map(read3.filter((entry) => entry[1] !== void 0));
|
|
2277
|
+
}
|
|
2278
|
+
function paused_text(since_ms, changed_by) {
|
|
2279
|
+
return `paused since ${figure_format.minute_of(since_ms)} by ${changed_by}`;
|
|
2280
|
+
}
|
|
2281
|
+
function paused_note(record2) {
|
|
2282
|
+
if (record2?.state !== "paused") return void 0;
|
|
2283
|
+
return paused_text(Date.parse(record2.changed_at), record2.changed_by);
|
|
2284
|
+
}
|
|
2285
|
+
var lane_state = {
|
|
2286
|
+
LANE_STATES: LANE_STATES2,
|
|
2287
|
+
NO_STATE_HINT,
|
|
2288
|
+
is_allowed,
|
|
2289
|
+
paused_note,
|
|
2290
|
+
paused_text,
|
|
2291
|
+
read_records,
|
|
2292
|
+
read_state,
|
|
2293
|
+
read_states,
|
|
2294
|
+
record_adopted,
|
|
2295
|
+
record_change,
|
|
2296
|
+
record_stuck,
|
|
2297
|
+
state_path
|
|
2298
|
+
};
|
|
2299
|
+
|
|
2300
|
+
// scripts/run/event/run-event-scope.ts
|
|
2301
|
+
var SINCE_SCOPE = "since";
|
|
2302
|
+
var UNKNOWN_SCOPE = "unknown";
|
|
2303
|
+
var UNKNOWN_EVENT_SCOPE = { kind: UNKNOWN_SCOPE };
|
|
2304
|
+
function moment_of(at) {
|
|
2305
|
+
const parsed = Date.parse(at);
|
|
2306
|
+
return Number.isNaN(parsed) ? void 0 : parsed;
|
|
2307
|
+
}
|
|
2308
|
+
function is_within(event, floor) {
|
|
2309
|
+
const at = moment_of(event.at);
|
|
2310
|
+
return at !== void 0 && at >= floor;
|
|
2311
|
+
}
|
|
2312
|
+
function scoped_events(events, scope) {
|
|
2313
|
+
if (scope.kind === UNKNOWN_SCOPE) return void 0;
|
|
2314
|
+
const floor = moment_of(scope.started_at);
|
|
2315
|
+
if (floor === void 0) return void 0;
|
|
2316
|
+
return events.filter((event) => is_within(event, floor));
|
|
2317
|
+
}
|
|
2318
|
+
function scope_of(read3) {
|
|
2319
|
+
if (read3.kind !== "carried") return UNKNOWN_EVENT_SCOPE;
|
|
2320
|
+
return { kind: SINCE_SCOPE, started_at: read3.carry.started_at };
|
|
2321
|
+
}
|
|
2322
|
+
function last_scoped_event(events, scope) {
|
|
2323
|
+
return scoped_events(events, scope)?.findLast(
|
|
2324
|
+
(event) => !run_event_stream.TRACE_KINDS.has(event.kind)
|
|
2325
|
+
);
|
|
2326
|
+
}
|
|
2327
|
+
var SHIP_POSITION_KINDS = /* @__PURE__ */ new Set([
|
|
2328
|
+
run_event_stream.EVENT_KIND.SHIP_LAUNCH,
|
|
2329
|
+
run_event_stream.EVENT_KIND.SHIP_STOP
|
|
2330
|
+
]);
|
|
2331
|
+
var KIND = run_event_stream.EVENT_KIND;
|
|
2332
|
+
var BATCH_RECORD_KINDS = /* @__PURE__ */ new Set([
|
|
2333
|
+
KIND.CHILD_LAUNCH,
|
|
2334
|
+
KIND.RESTART,
|
|
2335
|
+
KIND.WITHDRAW,
|
|
2336
|
+
KIND.PARK,
|
|
2337
|
+
KIND.HUMAN_REVIEW,
|
|
2338
|
+
KIND.SPLIT,
|
|
2339
|
+
KIND.RETROSPECTIVE,
|
|
2340
|
+
KIND.STRANDED
|
|
2341
|
+
]);
|
|
2342
|
+
var ISSUE_REFERENCE = /#(\d+)/u;
|
|
2343
|
+
function is_foreign_ship_event(event, issue2) {
|
|
2344
|
+
return SHIP_POSITION_KINDS.has(event.kind) && !event.text.startsWith(`${issue_cite.plain_for("program", issue2)} `);
|
|
2345
|
+
}
|
|
2346
|
+
function is_own_ship_event(event, issue2) {
|
|
2347
|
+
return SHIP_POSITION_KINDS.has(event.kind) && !is_foreign_ship_event(event, issue2);
|
|
2348
|
+
}
|
|
2349
|
+
function issue_named(event) {
|
|
2350
|
+
return ISSUE_REFERENCE.exec(event.text)?.[1];
|
|
2351
|
+
}
|
|
2352
|
+
function names_issue(event, issue2) {
|
|
2353
|
+
return issue_named(event) === issue2;
|
|
2354
|
+
}
|
|
2355
|
+
function is_lane_position(event, issue2) {
|
|
2356
|
+
return !BATCH_RECORD_KINDS.has(event.kind) && names_issue(event, issue2);
|
|
2357
|
+
}
|
|
2358
|
+
function since_own_launch(events, issue2) {
|
|
2359
|
+
const launch = events.findLastIndex(
|
|
2360
|
+
(event) => event.kind === KIND.CHILD_LAUNCH && names_issue(event, issue2)
|
|
2361
|
+
);
|
|
2362
|
+
return events.slice(launch + 1);
|
|
2363
|
+
}
|
|
2364
|
+
function is_foreign_event(event, issue2, is_lane_child) {
|
|
2365
|
+
if (is_lane_child) return !is_lane_position(event, issue2);
|
|
2366
|
+
return is_foreign_ship_event(event, issue2);
|
|
2367
|
+
}
|
|
2368
|
+
function last_issue_event(events, scope, issue2, is_lane_child) {
|
|
2369
|
+
const attempt = is_lane_child ? since_own_launch(events, issue2) : events;
|
|
2370
|
+
const own = attempt.filter((event) => !is_foreign_event(event, issue2, is_lane_child));
|
|
2371
|
+
if (scope.kind === SINCE_SCOPE) return last_scoped_event(own, scope);
|
|
2372
|
+
return own.findLast((event) => is_own_ship_event(event, issue2));
|
|
2373
|
+
}
|
|
2374
|
+
var LAUNCH_OR_SETTLE_KINDS = /* @__PURE__ */ new Set([
|
|
2375
|
+
KIND.CHILD_LAUNCH,
|
|
2376
|
+
KIND.MERGE,
|
|
2377
|
+
KIND.PARK,
|
|
2378
|
+
KIND.HUMAN_REVIEW,
|
|
2379
|
+
KIND.SPLIT,
|
|
2380
|
+
KIND.WITHDRAW
|
|
2381
|
+
]);
|
|
2382
|
+
function is_merge_owed(events, scope, issue2) {
|
|
2383
|
+
const newest = (scoped_events(events, scope) ?? []).findLast(
|
|
2384
|
+
(event) => LAUNCH_OR_SETTLE_KINDS.has(event.kind) && names_issue(event, issue2)
|
|
2385
|
+
);
|
|
2386
|
+
return newest?.kind === KIND.CHILD_LAUNCH;
|
|
2387
|
+
}
|
|
2388
|
+
function is_launch_or_withdrawal(event, issue2) {
|
|
2389
|
+
const is_kind = event.kind === KIND.CHILD_LAUNCH || event.kind === KIND.WITHDRAW;
|
|
2390
|
+
return is_kind && names_issue(event, issue2);
|
|
2391
|
+
}
|
|
2392
|
+
function is_withdrawn(events, issue2) {
|
|
2393
|
+
const newest = events.findLast((event) => is_launch_or_withdrawal(event, issue2));
|
|
2394
|
+
return newest?.kind === KIND.WITHDRAW;
|
|
2395
|
+
}
|
|
2396
|
+
var run_event_scope = {
|
|
2397
|
+
UNKNOWN_EVENT_SCOPE,
|
|
2398
|
+
is_merge_owed,
|
|
2399
|
+
is_withdrawn,
|
|
2400
|
+
issue_named,
|
|
2401
|
+
last_issue_event,
|
|
2402
|
+
last_scoped_event,
|
|
2403
|
+
moment_of,
|
|
2404
|
+
scope_of,
|
|
2405
|
+
scoped_events,
|
|
2406
|
+
since_own_launch
|
|
2407
|
+
};
|
|
2408
|
+
|
|
2409
|
+
// scripts/lane/lane-spans.ts
|
|
2410
|
+
function next_start_ms(starts, issue2, from_ms) {
|
|
2411
|
+
const later = starts.filter((other) => other.issue === issue2 && other.at_ms > from_ms);
|
|
2412
|
+
return Math.min(...later.map((other) => other.at_ms));
|
|
2413
|
+
}
|
|
2414
|
+
function issue_spans(pair) {
|
|
2415
|
+
return pair.starts.map((start) => {
|
|
2416
|
+
const until_ms = next_start_ms(pair.bounds, start.issue, start.at_ms);
|
|
2417
|
+
return {
|
|
2418
|
+
from_ms: start.at_ms,
|
|
2419
|
+
end_ms: pair.ends.find(
|
|
2420
|
+
(end) => end.issue === start.issue && end.at_ms >= start.at_ms && end.at_ms < until_ms
|
|
2421
|
+
)?.at_ms
|
|
2422
|
+
};
|
|
2423
|
+
});
|
|
2424
|
+
}
|
|
2425
|
+
var lane_spans = { issue_spans };
|
|
2426
|
+
|
|
2427
|
+
// scripts/run/board/run-board-lane-time.ts
|
|
2428
|
+
var KIND2 = run_event_stream.EVENT_KIND;
|
|
2429
|
+
var LAUNCH_KINDS = /* @__PURE__ */ new Set([KIND2.CHILD_LAUNCH, KIND2.RESTART]);
|
|
2430
|
+
var OFF_LANE_KINDS = /* @__PURE__ */ new Set([
|
|
2431
|
+
KIND2.MERGE,
|
|
2432
|
+
KIND2.PARK,
|
|
2433
|
+
KIND2.HUMAN_REVIEW,
|
|
2434
|
+
KIND2.WITHDRAW,
|
|
2435
|
+
KIND2.OUTAGE,
|
|
2436
|
+
KIND2.USAGE_LIMIT,
|
|
2437
|
+
KIND2.SPLIT,
|
|
2438
|
+
KIND2.STOP
|
|
2439
|
+
]);
|
|
2440
|
+
function moments_of(events, kinds) {
|
|
2441
|
+
return events.filter((event) => kinds.has(event.kind)).map((event) => ({
|
|
2442
|
+
issue: Number(run_event_scope.issue_named(event)),
|
|
2443
|
+
at_ms: Date.parse(event.at)
|
|
2444
|
+
}));
|
|
2445
|
+
}
|
|
2446
|
+
function spans_of(events) {
|
|
2447
|
+
const launches = moments_of(events, LAUNCH_KINDS);
|
|
2448
|
+
const ends = moments_of(events, OFF_LANE_KINDS);
|
|
2449
|
+
const issues = new Set(launches.map((launch) => launch.issue));
|
|
2450
|
+
return new Map(
|
|
2451
|
+
[...issues].map((issue2) => {
|
|
2452
|
+
const starts = launches.filter((launch) => launch.issue === issue2);
|
|
2453
|
+
return [issue2, lane_spans.issue_spans({ starts, bounds: starts, ends })];
|
|
2454
|
+
})
|
|
2455
|
+
);
|
|
2456
|
+
}
|
|
2457
|
+
function span_ms(span, until_ms, end_ms) {
|
|
2458
|
+
return Math.max(0, Math.min(span.end_ms ?? until_ms, end_ms) - span.from_ms);
|
|
2459
|
+
}
|
|
2460
|
+
function in_lane_ms(spans, end_ms) {
|
|
2461
|
+
return spans.reduce(
|
|
2462
|
+
(total, span, index) => total + span_ms(span, spans[index + 1]?.from_ms ?? end_ms, end_ms),
|
|
2463
|
+
0
|
|
2464
|
+
);
|
|
2465
|
+
}
|
|
2466
|
+
function elapsed_of(spans, started_ms, ended_ms) {
|
|
2467
|
+
return spans.length === 0 ? ended_ms - started_ms : in_lane_ms(spans, ended_ms);
|
|
2468
|
+
}
|
|
2469
|
+
function launched_ms(record2) {
|
|
2470
|
+
const launched_at = record2?.launched_at;
|
|
2471
|
+
return launched_at === void 0 ? void 0 : Date.parse(launched_at);
|
|
2472
|
+
}
|
|
2473
|
+
function counted_from(run, started_ms) {
|
|
2474
|
+
return run === void 0 ? started_ms : Date.parse(run.started_at);
|
|
2475
|
+
}
|
|
2476
|
+
function is_ended(spans) {
|
|
2477
|
+
return spans.at(-1)?.end_ms !== void 0;
|
|
2478
|
+
}
|
|
2479
|
+
function ending_elapsed(read3) {
|
|
2480
|
+
const started_ms = launched_ms(read3.record);
|
|
2481
|
+
if (started_ms === void 0) return void 0;
|
|
2482
|
+
const from_ms = counted_from(read3.record?.run, started_ms);
|
|
2483
|
+
const spans = (spans_of(read3.events).get(read3.issue) ?? []).filter(
|
|
2484
|
+
(span) => span.from_ms >= from_ms
|
|
2485
|
+
);
|
|
2486
|
+
return is_ended(spans) ? void 0 : elapsed_of(spans, started_ms, read3.ended_ms);
|
|
2487
|
+
}
|
|
2488
|
+
var run_board_lane_time = {
|
|
2489
|
+
LAUNCH_KINDS,
|
|
2490
|
+
OFF_LANE_KINDS,
|
|
2491
|
+
elapsed_of,
|
|
2492
|
+
ending_elapsed,
|
|
2493
|
+
in_lane_ms,
|
|
2494
|
+
spans_of
|
|
2495
|
+
};
|
|
2496
|
+
|
|
2497
|
+
// scripts/run/event/run-event-stream-emit.ts
|
|
2498
|
+
function now_iso() {
|
|
2499
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
2500
|
+
}
|
|
2501
|
+
async function stream_target() {
|
|
2502
|
+
const repository = await run_carry.repository_directory();
|
|
2503
|
+
return repository === void 0 ? void 0 : run_event_stream.target_of(repository);
|
|
2504
|
+
}
|
|
2505
|
+
async function lane_record(issue2) {
|
|
2506
|
+
try {
|
|
2507
|
+
return await lane_state.read_state(issue2);
|
|
2508
|
+
} catch (error) {
|
|
2509
|
+
error_text.trace_swallowed("run_event_stream_emit.lane_record", error);
|
|
2510
|
+
return void 0;
|
|
2511
|
+
}
|
|
2512
|
+
}
|
|
2513
|
+
async function ending_fields(target2, event) {
|
|
2514
|
+
const issue2 = run_event_scope.issue_named(event);
|
|
2515
|
+
if (issue2 === void 0 || !run_board_lane_time.OFF_LANE_KINDS.has(event.kind)) return {};
|
|
2516
|
+
const elapsed_ms = run_board_lane_time.ending_elapsed({
|
|
2517
|
+
events: run_event_stream.read_events(target2),
|
|
2518
|
+
issue: Number(issue2),
|
|
2519
|
+
record: await lane_record(issue2),
|
|
2520
|
+
ended_ms: Date.parse(event.at)
|
|
2521
|
+
});
|
|
2522
|
+
return elapsed_ms === void 0 ? {} : { elapsed_ms };
|
|
2523
|
+
}
|
|
2524
|
+
async function append_with(target2, event) {
|
|
2525
|
+
return run_event_stream.append_event(target2, {
|
|
2526
|
+
...event,
|
|
2527
|
+
...await ending_fields(target2, event)
|
|
2528
|
+
});
|
|
2529
|
+
}
|
|
2530
|
+
async function append_at(target2, kind, text2, at) {
|
|
2531
|
+
return await append_with(target2, { kind, text: text2, at: at.toISOString() });
|
|
2532
|
+
}
|
|
2533
|
+
async function emit(kind, text2, at = /* @__PURE__ */ new Date(), fields = {}) {
|
|
2534
|
+
try {
|
|
2535
|
+
const target2 = await stream_target();
|
|
2536
|
+
if (target2 === void 0) return;
|
|
2537
|
+
await append_with(target2, { ...fields, kind, text: text2, at: at.toISOString() });
|
|
2538
|
+
} catch {
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
async function fresh_target(kind) {
|
|
2542
|
+
const target2 = await stream_target();
|
|
2543
|
+
if (target2 === void 0 || run_event_stream.read_last(target2)?.kind === kind) return void 0;
|
|
2544
|
+
return target2;
|
|
2545
|
+
}
|
|
2546
|
+
async function emit_once(kind, text2, before_append) {
|
|
2547
|
+
try {
|
|
2548
|
+
const target2 = await fresh_target(kind);
|
|
2549
|
+
if (target2 === void 0) return false;
|
|
2550
|
+
await before_append?.();
|
|
2551
|
+
return run_event_stream.append(target2, kind, text2, now_iso()).appended;
|
|
2552
|
+
} catch (error) {
|
|
2553
|
+
error_text.trace_swallowed("run_event_stream_emit.emit_once", error);
|
|
2554
|
+
return false;
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
function invocation_events(repository, target2) {
|
|
2558
|
+
const events = run_event_stream.read_events(target2);
|
|
2559
|
+
const scope = run_event_scope.scope_of(run_carry.read_carry(run_carry.carry_path(repository)));
|
|
2560
|
+
return run_event_scope.scoped_events(events, scope) ?? events;
|
|
2561
|
+
}
|
|
2562
|
+
async function emit_once_since_with(kind, reset_kind, compose) {
|
|
2563
|
+
try {
|
|
2564
|
+
const repository = await run_carry.repository_directory();
|
|
2565
|
+
if (repository === void 0) return void 0;
|
|
2566
|
+
const target2 = run_event_stream.target_of(repository);
|
|
2567
|
+
if (run_event_stream.has_since(invocation_events(repository, target2), kind, reset_kind)) {
|
|
2568
|
+
return void 0;
|
|
2569
|
+
}
|
|
2570
|
+
const text2 = await compose();
|
|
2571
|
+
return run_event_stream.append(target2, kind, text2, now_iso()).appended ? text2 : void 0;
|
|
2572
|
+
} catch (error) {
|
|
2573
|
+
error_text.trace_swallowed("run_event_stream_emit.emit_once_since", error);
|
|
2574
|
+
return void 0;
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
async function emit_once_since(kind, text2, reset_kind) {
|
|
2578
|
+
const appended = await emit_once_since_with(kind, reset_kind, async () => text2);
|
|
2579
|
+
return appended !== void 0;
|
|
2580
|
+
}
|
|
2581
|
+
async function emit_heartbeat(line) {
|
|
2582
|
+
await emit(run_event_stream.EVENT_KIND.HEARTBEAT, line);
|
|
2583
|
+
}
|
|
2584
|
+
function read_current_events(repository, is_required) {
|
|
2585
|
+
if (repository === void 0) throw new Error("Could not resolve the run event stream.");
|
|
2586
|
+
const read3 = run_carry.read_carry(run_carry.carry_path(repository));
|
|
2587
|
+
const scope = run_event_scope.scope_of(read3);
|
|
2588
|
+
const events = run_event_stream.read_events(run_event_stream.target_of(repository), is_required);
|
|
2589
|
+
const scoped = run_event_scope.scoped_events(events, scope);
|
|
2590
|
+
if (scoped === void 0) throw new Error("Could not determine the run event scope.");
|
|
2591
|
+
return scoped;
|
|
2592
|
+
}
|
|
2593
|
+
async function current_events(is_required = false) {
|
|
2594
|
+
try {
|
|
2595
|
+
return read_current_events(await run_carry.repository_directory(), is_required);
|
|
2596
|
+
} catch (error) {
|
|
2597
|
+
if (is_required) throw error;
|
|
2598
|
+
return [];
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
async function invocation_or_all_events() {
|
|
2602
|
+
try {
|
|
2603
|
+
const repository = await run_carry.repository_directory();
|
|
2604
|
+
return repository === void 0 ? [] : invocation_events(repository, run_event_stream.target_of(repository));
|
|
2605
|
+
} catch {
|
|
2606
|
+
return [];
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
async function all_events() {
|
|
2610
|
+
try {
|
|
2611
|
+
const target2 = await stream_target();
|
|
2612
|
+
return target2 === void 0 ? [] : run_event_stream.read_events(target2);
|
|
2613
|
+
} catch {
|
|
2614
|
+
return [];
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
var run_event_stream_emit = {
|
|
2618
|
+
all_events,
|
|
2619
|
+
append_at,
|
|
2620
|
+
current_events,
|
|
2621
|
+
emit,
|
|
2622
|
+
emit_heartbeat,
|
|
2623
|
+
emit_once,
|
|
2624
|
+
emit_once_since,
|
|
2625
|
+
emit_once_since_with,
|
|
2626
|
+
invocation_or_all_events,
|
|
2627
|
+
stream_target
|
|
2628
|
+
};
|
|
2629
|
+
|
|
2630
|
+
// scripts/josh/josh-aliases.ts
|
|
2631
|
+
var ALIASES = {
|
|
2632
|
+
ga: "gate",
|
|
2633
|
+
l: "lint",
|
|
2634
|
+
lr: "lint:related",
|
|
2635
|
+
lrr: "lint:rule",
|
|
2636
|
+
cr: "check:related",
|
|
2637
|
+
ln: "lines",
|
|
2638
|
+
by: "bytes",
|
|
2639
|
+
mt: "metrics",
|
|
2640
|
+
f: "format",
|
|
2641
|
+
sd: "cspell:dot",
|
|
2642
|
+
bh: "behavior",
|
|
2643
|
+
eu: "exports:unused",
|
|
2644
|
+
t: "test",
|
|
2645
|
+
tu: "test:unit",
|
|
2646
|
+
tr: "test:related",
|
|
2647
|
+
td: "test:declared",
|
|
2648
|
+
trd: "test:red",
|
|
2649
|
+
tpn: "test:pinned",
|
|
2650
|
+
te: "test:e2e",
|
|
2651
|
+
c: "check",
|
|
2652
|
+
pt: "port",
|
|
2653
|
+
i: "init",
|
|
2654
|
+
pf: "profile",
|
|
2655
|
+
st: "start",
|
|
2656
|
+
sy: "sync",
|
|
2657
|
+
un: "uninstall",
|
|
2658
|
+
g: "git",
|
|
2659
|
+
gp: "pr",
|
|
2660
|
+
ms: "main:sync",
|
|
2661
|
+
mm: "main:merge",
|
|
2662
|
+
ckf: "checks:failed",
|
|
2663
|
+
bp: "bump",
|
|
2664
|
+
re: "release",
|
|
2665
|
+
v: "version",
|
|
2666
|
+
r: "ranges",
|
|
2667
|
+
dr: "doctor",
|
|
2668
|
+
rc: "ruleset:check",
|
|
2669
|
+
pg: "propagate",
|
|
2670
|
+
ad: "adopt",
|
|
2671
|
+
ov: "overrides",
|
|
2672
|
+
a: "audit",
|
|
2673
|
+
rt: "reconcile-templates",
|
|
2674
|
+
cdv: "command:derive",
|
|
2675
|
+
u: "latest",
|
|
2676
|
+
lc: "latest:corepack",
|
|
2677
|
+
lu: "latest:update",
|
|
2678
|
+
tm: "time",
|
|
2679
|
+
tmd: "time:density",
|
|
2680
|
+
rtr: "retrospective",
|
|
2681
|
+
ca: "cost:audit",
|
|
2682
|
+
cit: "ci:timing",
|
|
2683
|
+
ghu: "gh:usage",
|
|
2684
|
+
rvf: "review:findings",
|
|
2685
|
+
rvs: "review:stops",
|
|
2686
|
+
ruv: "rule:value",
|
|
2687
|
+
hkl: "hook:ledger",
|
|
2688
|
+
ev: "eval",
|
|
2689
|
+
fr: "fresh:run",
|
|
2690
|
+
as: "auth:setup",
|
|
2691
|
+
lsm: "lane:sample",
|
|
2692
|
+
lst: "lane:stats",
|
|
2693
|
+
lva: "lane:value",
|
|
2694
|
+
lnt: "lane:net",
|
|
2695
|
+
lbd: "lane:breakdown",
|
|
2696
|
+
lwy: "lane:why",
|
|
2697
|
+
lli: "lane:limit",
|
|
2698
|
+
lrs: "lane:restart",
|
|
2699
|
+
lwd: "lane:withdraw",
|
|
2700
|
+
lrv: "lane:resolve",
|
|
2701
|
+
lps: "lane:pause",
|
|
2702
|
+
lru: "lane:resume",
|
|
2703
|
+
lad: "lane:adopt",
|
|
2704
|
+
blr: "backlogrun"
|
|
2705
|
+
};
|
|
2706
|
+
function canonical_command(name) {
|
|
2707
|
+
if (!Object.hasOwn(ALIASES, name)) return name;
|
|
2708
|
+
return ALIASES[name] ?? name;
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2711
|
+
// scripts/time-runtime/time-josh-names.ts
|
|
2712
|
+
function canonical_name(name) {
|
|
2713
|
+
if (name === "") return "";
|
|
2714
|
+
const [subcommand = "", ...rest] = name.slice(time_shell.JOSH_PREFIX.length).split(" ");
|
|
2715
|
+
return [`${time_shell.JOSH_PREFIX}${canonical_command(subcommand)}`, ...rest].join(" ");
|
|
2716
|
+
}
|
|
2717
|
+
function josh_command_of2(command) {
|
|
2718
|
+
return canonical_name(time_shell.josh_command_of(command));
|
|
2719
|
+
}
|
|
2720
|
+
function josh_command_of_segment2(segment) {
|
|
2721
|
+
return canonical_name(time_shell.josh_command_of_segment(segment));
|
|
2722
|
+
}
|
|
2723
|
+
function josh_commands_of2(command) {
|
|
2724
|
+
return time_shell.josh_commands_of(command).map((name) => canonical_name(name));
|
|
2725
|
+
}
|
|
2726
|
+
function josh_signatures_of2(command) {
|
|
2727
|
+
return time_shell.josh_signatures_of(command).map((signature) => canonical_name(signature));
|
|
2728
|
+
}
|
|
2729
|
+
var time_josh_names = {
|
|
2730
|
+
josh_command_of: josh_command_of2,
|
|
2731
|
+
josh_command_of_segment: josh_command_of_segment2,
|
|
2732
|
+
josh_commands_of: josh_commands_of2,
|
|
2733
|
+
josh_signatures_of: josh_signatures_of2
|
|
2734
|
+
};
|
|
2735
|
+
|
|
2736
|
+
// scripts/agent/agent-model-alias.ts
|
|
2737
|
+
var CLAUDE_MODEL_PATTERN = /^claude-(?<family>opus|sonnet|haiku|fable)-/u;
|
|
2738
|
+
function alias_of(model) {
|
|
2739
|
+
return CLAUDE_MODEL_PATTERN.exec(model)?.groups?.["family"];
|
|
2740
|
+
}
|
|
2741
|
+
function suffix_of(model) {
|
|
2742
|
+
const alias = alias_of(model);
|
|
2743
|
+
return alias === void 0 ? "" : ` (${alias})`;
|
|
2744
|
+
}
|
|
2745
|
+
var agent_model_alias = { alias_of, suffix_of };
|
|
2746
|
+
|
|
2747
|
+
// scripts/agent/agent-profile-schema.ts
|
|
2748
|
+
var ROLE_SCHEMA = external_exports.enum(["scheduler", "worker", "reviewer"]);
|
|
2749
|
+
var EFFORT_SCHEMA = external_exports.enum(["low", "medium", "high", "xhigh", "max"]);
|
|
2750
|
+
var PHASE_SCHEMA = external_exports.enum(["implementation", "pre-gate"]);
|
|
2751
|
+
var PROFILE_SCHEMA = external_exports.object({
|
|
2752
|
+
provider: agent_provider.PROVIDER_SCHEMA.default("anthropic"),
|
|
2753
|
+
role: ROLE_SCHEMA,
|
|
2754
|
+
model: external_exports.string(),
|
|
2755
|
+
effort: EFFORT_SCHEMA
|
|
2756
|
+
});
|
|
2757
|
+
var SCHEDULER = "scheduler";
|
|
2758
|
+
var WORKER = "worker";
|
|
2759
|
+
var REVIEWER = "reviewer";
|
|
2760
|
+
var IMPLEMENTATION_PHASE = "implementation";
|
|
2761
|
+
var PRE_GATE_PHASE = "pre-gate";
|
|
2762
|
+
var OPENAI_MODEL = "gpt-6.1-sol";
|
|
2763
|
+
var ANTHROPIC_MODEL = "claude-opus-5-5";
|
|
2764
|
+
var REVIEW_EFFORT = "medium";
|
|
2765
|
+
var { ANTHROPIC_PROVIDER, OPENAI_PROVIDER } = agent_provider;
|
|
2766
|
+
var { is_safe_value: is_safe_value2 } = agent_safe_text;
|
|
2767
|
+
function role_profiles(provider, model) {
|
|
2768
|
+
return {
|
|
2769
|
+
scheduler: { provider, role: SCHEDULER, model, effort: "medium" },
|
|
2770
|
+
worker: { provider, role: WORKER, model, effort: "medium" },
|
|
2771
|
+
reviewer: { provider, role: REVIEWER, model, effort: REVIEW_EFFORT }
|
|
2772
|
+
};
|
|
2773
|
+
}
|
|
2774
|
+
var DEFAULT_PROFILES = role_profiles(ANTHROPIC_PROVIDER, ANTHROPIC_MODEL);
|
|
2775
|
+
var OPENAI_PROFILES = role_profiles(OPENAI_PROVIDER, OPENAI_MODEL);
|
|
2776
|
+
function describe2(profile) {
|
|
2777
|
+
return `provider=${profile.provider} role=${profile.role} model=${profile.model}${agent_model_alias.suffix_of(profile.model)} effort=${profile.effort}`;
|
|
2778
|
+
}
|
|
2779
|
+
function describe_review(round, profile) {
|
|
2780
|
+
return `review round ${String(round)} \xB7 ${describe2(profile)}`;
|
|
2781
|
+
}
|
|
2782
|
+
function parse2(value) {
|
|
2783
|
+
const parsed = PROFILE_SCHEMA.safeParse(value);
|
|
2784
|
+
return parsed.success && is_safe_value2(parsed.data.model) ? parsed.data : void 0;
|
|
2785
|
+
}
|
|
2786
|
+
var agent_profile_schema = {
|
|
2787
|
+
DEFAULT_PROFILES,
|
|
2788
|
+
EFFORT_SCHEMA,
|
|
2789
|
+
IMPLEMENTATION_PHASE,
|
|
2790
|
+
OPENAI_MODEL,
|
|
2791
|
+
OPENAI_PROFILES,
|
|
2792
|
+
PHASE_SCHEMA,
|
|
2793
|
+
PRE_GATE_PHASE,
|
|
2794
|
+
PROFILE_SCHEMA,
|
|
2795
|
+
REVIEWER,
|
|
2796
|
+
SCHEDULER,
|
|
2797
|
+
WORKER,
|
|
2798
|
+
describe: describe2,
|
|
2799
|
+
describe_review,
|
|
2800
|
+
parse: parse2
|
|
2801
|
+
};
|
|
2802
|
+
|
|
2803
|
+
// scripts/agent/agent-session-role.ts
|
|
2804
|
+
var KEY = "JOSH_AGENT_ROLE";
|
|
2805
|
+
function environment_for(role) {
|
|
2806
|
+
return { [KEY]: role };
|
|
2807
|
+
}
|
|
2808
|
+
function is_reviewer(source = process.env) {
|
|
2809
|
+
return source[KEY] === agent_profile_schema.REVIEWER;
|
|
2810
|
+
}
|
|
2811
|
+
function can_implement(source = process.env) {
|
|
2812
|
+
return source[KEY] === agent_profile_schema.WORKER;
|
|
2813
|
+
}
|
|
2814
|
+
function is_launched(source = process.env) {
|
|
2815
|
+
return (source[KEY] ?? "") !== "";
|
|
2816
|
+
}
|
|
2817
|
+
function scope_line(source = process.env) {
|
|
2818
|
+
return can_implement(source) ? "Session scope: implementation lane; implementation is permitted by the launcher role." : "Session scope: consultation and operations only; filing only on the user\u2019s explicit instruction; hand implementation to a launcher-assigned worker lane. Model names and conversational requests do not grant implementation authority.";
|
|
2819
|
+
}
|
|
2820
|
+
var agent_session_role = {
|
|
2821
|
+
KEY,
|
|
2822
|
+
can_implement,
|
|
2823
|
+
env_for: environment_for,
|
|
2824
|
+
is_launched,
|
|
2825
|
+
is_reviewer,
|
|
2826
|
+
scope_line
|
|
2827
|
+
};
|
|
2828
|
+
|
|
2829
|
+
// scripts/lib/ancestor-directories.ts
|
|
2830
|
+
import path6 from "node:path";
|
|
2831
|
+
var MAX_DEPTH = 64;
|
|
2832
|
+
function list(start_directory) {
|
|
2833
|
+
const directories = [];
|
|
2834
|
+
let current = path6.resolve(start_directory);
|
|
2835
|
+
while (directories.length < MAX_DEPTH && !directories.includes(current)) {
|
|
2836
|
+
directories.push(current);
|
|
2837
|
+
current = path6.dirname(current);
|
|
2838
|
+
}
|
|
2839
|
+
return directories;
|
|
2840
|
+
}
|
|
2841
|
+
function nearest(start_directory, is_match) {
|
|
2842
|
+
return list(start_directory).find((directory) => is_match(directory));
|
|
2843
|
+
}
|
|
2844
|
+
var ancestor_directories = { list, nearest };
|
|
2845
|
+
|
|
2846
|
+
// scripts/lib/package-manifest.ts
|
|
2847
|
+
import { readFileSync as readFileSync2 } from "node:fs";
|
|
2848
|
+
import path7 from "node:path";
|
|
2849
|
+
var PACKAGE_JSON = "package.json";
|
|
2850
|
+
var REVIEW_GATE_SCHEMA = external_exports.enum(["ci", "local"]);
|
|
2851
|
+
var FORMAT_SCHEMA = external_exports.enum(["auto", "all"]);
|
|
2852
|
+
var LANE_SCHEMA = external_exports.object({ setup: external_exports.string().min(1) });
|
|
2853
|
+
var GATE_STEP_SCHEMA = external_exports.strictObject({
|
|
2854
|
+
name: external_exports.string().min(1),
|
|
2855
|
+
command: external_exports.string().min(1),
|
|
2856
|
+
paths: external_exports.array(external_exports.string().min(1)).min(1).optional(),
|
|
2857
|
+
cores: external_exports.int().positive().optional()
|
|
2858
|
+
});
|
|
2859
|
+
var GATE_STEPS_SCHEMA = external_exports.array(GATE_STEP_SCHEMA).refine((steps) => new Set(steps.map((step) => step.name)).size === steps.length, {
|
|
2860
|
+
message: "step names must be unique"
|
|
2861
|
+
});
|
|
2862
|
+
var GATE_SCHEMA = external_exports.object({ steps: GATE_STEPS_SCHEMA.optional() });
|
|
2863
|
+
var josh_schemas = {
|
|
2864
|
+
format: external_exports.object({ josh: external_exports.object({ format: FORMAT_SCHEMA.optional() }).optional() }),
|
|
2865
|
+
gate_steps: external_exports.object({ josh: external_exports.object({ gate: GATE_SCHEMA.optional() }).optional() }),
|
|
2866
|
+
lane_setup: external_exports.object({ josh: external_exports.object({ lane: LANE_SCHEMA.optional() }).optional() }),
|
|
2867
|
+
progress_interval_minutes: external_exports.object({
|
|
2868
|
+
josh: external_exports.object({ progress_interval_minutes: external_exports.number().positive() }).optional()
|
|
2869
|
+
}),
|
|
2870
|
+
review_gate: external_exports.object({ josh: external_exports.object({ review_gate: REVIEW_GATE_SCHEMA }).optional() })
|
|
2871
|
+
};
|
|
2872
|
+
function manifest_path(directory) {
|
|
2873
|
+
return path7.join(directory, PACKAGE_JSON);
|
|
2874
|
+
}
|
|
2875
|
+
function read_manifest(directory, schema) {
|
|
2876
|
+
const text2 = readFileSync2(manifest_path(directory), "utf8");
|
|
2877
|
+
return schema.parse(JSON.parse(text2));
|
|
2878
|
+
}
|
|
2879
|
+
function read_manifest_if_valid(directory, schema) {
|
|
2880
|
+
const text2 = file_reader.read_if_readable(manifest_path(directory));
|
|
2881
|
+
if (text2 === void 0) return void 0;
|
|
2882
|
+
return json_value.parse_with(text2, schema);
|
|
2883
|
+
}
|
|
2884
|
+
function read_nearest_value(start, schema, select) {
|
|
2885
|
+
const value_schema = schema.transform(select);
|
|
2886
|
+
for (const directory of ancestor_directories.list(start)) {
|
|
2887
|
+
const value = read_manifest_if_valid(directory, value_schema);
|
|
2888
|
+
if (value !== void 0) return value;
|
|
2889
|
+
}
|
|
2890
|
+
return void 0;
|
|
2891
|
+
}
|
|
2892
|
+
var package_manifest = {
|
|
2893
|
+
josh_schemas,
|
|
2894
|
+
manifest_path,
|
|
2895
|
+
read_manifest,
|
|
2896
|
+
read_manifest_if_valid,
|
|
2897
|
+
read_nearest_value
|
|
2898
|
+
};
|
|
2899
|
+
|
|
2900
|
+
// scripts/josh/package-directory.ts
|
|
2901
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
2902
|
+
function find_package_directory(start_directory) {
|
|
2903
|
+
return ancestor_directories.nearest(
|
|
2904
|
+
start_directory,
|
|
2905
|
+
(directory) => existsSync2(package_manifest.manifest_path(directory))
|
|
2906
|
+
) ?? start_directory;
|
|
2907
|
+
}
|
|
2908
|
+
|
|
2909
|
+
// scripts/git/git-schemas.ts
|
|
2910
|
+
var package_name_schema = external_exports.object({ name: external_exports.string().min(1) });
|
|
2911
|
+
var rollup_item_schema = external_exports.looseObject({
|
|
2912
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- GraphQL field name from GitHub API
|
|
2913
|
+
__typename: external_exports.string().nullish(),
|
|
2914
|
+
state: external_exports.string().nullish(),
|
|
2915
|
+
status: external_exports.string().nullish(),
|
|
2916
|
+
conclusion: external_exports.string().nullish(),
|
|
2917
|
+
name: external_exports.string().nullish(),
|
|
2918
|
+
context: external_exports.string().nullish(),
|
|
2919
|
+
description: external_exports.string().nullish()
|
|
2920
|
+
});
|
|
2921
|
+
var pr_raw_schema = external_exports.object({
|
|
2922
|
+
statusCheckRollup: external_exports.array(rollup_item_schema).optional(),
|
|
2923
|
+
// The base branch's required status check contexts, read from its rules — empty where none are
|
|
2924
|
+
// set or they could not be read (`git-gh-branch-rules.ts`).
|
|
2925
|
+
requiredContexts: external_exports.array(external_exports.string()).optional(),
|
|
2926
|
+
mergeStateStatus: external_exports.string().optional(),
|
|
2927
|
+
reviewDecision: external_exports.string().optional(),
|
|
2928
|
+
headRefOid: external_exports.string().optional(),
|
|
2929
|
+
merged: external_exports.boolean().optional()
|
|
2930
|
+
});
|
|
2931
|
+
var pull_comment_schema = external_exports.object({
|
|
2932
|
+
body: external_exports.string().optional(),
|
|
2933
|
+
html_url: external_exports.string().optional(),
|
|
2934
|
+
user: external_exports.object({ login: external_exports.string().optional() }).optional()
|
|
2935
|
+
});
|
|
2936
|
+
var ai_review_pull_comment_schema = external_exports.object({
|
|
2937
|
+
body: external_exports.string().optional(),
|
|
2938
|
+
url: external_exports.string().optional(),
|
|
2939
|
+
author: external_exports.object({ login: external_exports.string().optional() }).optional(),
|
|
2940
|
+
updatedAt: external_exports.string().optional()
|
|
2941
|
+
});
|
|
2942
|
+
var pr_info_schema = external_exports.object({
|
|
2943
|
+
mergeable: external_exports.union([external_exports.boolean(), external_exports.string()]).nullable().optional(),
|
|
2944
|
+
mergeStateStatus: external_exports.string().nullable().optional(),
|
|
2945
|
+
state: external_exports.string().optional()
|
|
2946
|
+
});
|
|
2947
|
+
var epic_issue_schema = external_exports.object({
|
|
2948
|
+
number: external_exports.number(),
|
|
2949
|
+
body: external_exports.string().optional(),
|
|
2950
|
+
// REST answers null for an issue never closed and `reopened` for one a person reopened.
|
|
2951
|
+
stateReason: external_exports.string().nullish()
|
|
2952
|
+
});
|
|
2953
|
+
var blocking_issue_schema = external_exports.object({
|
|
2954
|
+
number: external_exports.number(),
|
|
2955
|
+
state: external_exports.string().optional(),
|
|
2956
|
+
repository_url: external_exports.string().optional()
|
|
2957
|
+
});
|
|
2958
|
+
var blocked_by_schema = external_exports.object({
|
|
2959
|
+
nodes: external_exports.array(blocking_issue_schema).default([]),
|
|
2960
|
+
totalCount: external_exports.number().optional()
|
|
2961
|
+
}).optional();
|
|
2962
|
+
var epic_child_schema = external_exports.object({
|
|
2963
|
+
state: external_exports.string().optional(),
|
|
2964
|
+
blockedBy: blocked_by_schema
|
|
2965
|
+
});
|
|
2966
|
+
var rest_comment_schema = external_exports.looseObject({
|
|
2967
|
+
body: external_exports.string().nullish(),
|
|
2968
|
+
html_url: external_exports.string().optional(),
|
|
2969
|
+
user: external_exports.looseObject({ login: external_exports.string().optional() }).nullish(),
|
|
2970
|
+
updated_at: external_exports.string().optional()
|
|
2971
|
+
});
|
|
2972
|
+
var issue_label_schema = external_exports.object({ name: external_exports.string() });
|
|
2973
|
+
var epic_subject_schema = external_exports.object({
|
|
2974
|
+
number: external_exports.number(),
|
|
2975
|
+
state: external_exports.string().optional(),
|
|
2976
|
+
labels: external_exports.array(issue_label_schema).optional(),
|
|
2977
|
+
body: external_exports.string().optional()
|
|
2978
|
+
});
|
|
2979
|
+
var author_fields_schema = {
|
|
2980
|
+
author_association: external_exports.string().nullish(),
|
|
2981
|
+
user: external_exports.looseObject({ login: external_exports.string() }).nullish()
|
|
2982
|
+
};
|
|
2983
|
+
var open_issue_schema = external_exports.object({
|
|
2984
|
+
number: external_exports.number(),
|
|
2985
|
+
title: external_exports.string(),
|
|
2986
|
+
labels: external_exports.array(issue_label_schema).optional(),
|
|
2987
|
+
createdAt: external_exports.string(),
|
|
2988
|
+
blockedBy: blocked_by_schema,
|
|
2989
|
+
// Present only on the pickup listing, which reads it for the paths each issue declares.
|
|
2990
|
+
body: external_exports.string().optional(),
|
|
2991
|
+
...author_fields_schema,
|
|
2992
|
+
// Assembled by the pickup from the author above, never read off the listing: whether the author
|
|
2993
|
+
// has write access. Absent on every other listing.
|
|
2994
|
+
author_trusted: external_exports.boolean().optional()
|
|
2995
|
+
});
|
|
2996
|
+
|
|
2997
|
+
export {
|
|
2998
|
+
agent_safe_text,
|
|
2999
|
+
issue_cite,
|
|
3000
|
+
shell_quote,
|
|
3001
|
+
run_ship_stage,
|
|
3002
|
+
change_base,
|
|
3003
|
+
changed_paths,
|
|
3004
|
+
review_stop_log,
|
|
3005
|
+
lane_child_invocation,
|
|
3006
|
+
process_tools,
|
|
3007
|
+
lane_reap,
|
|
3008
|
+
transcript_tail,
|
|
3009
|
+
PORT_SEED_KEY,
|
|
3010
|
+
LANE_SEAT_KEY,
|
|
3011
|
+
ENV_FILE_NAME,
|
|
3012
|
+
ports,
|
|
3013
|
+
OPTIONAL_ENV_FILE_FLAGS,
|
|
3014
|
+
GATE_COMMAND,
|
|
3015
|
+
ESLINT_RELATED_CACHE_FILE,
|
|
3016
|
+
ESLINT_EDIT_CACHE_FLAGS,
|
|
3017
|
+
ESLINT_RELATED_CACHE_FLAGS,
|
|
3018
|
+
PRETTIER_RELATED_CACHE_FLAGS,
|
|
3019
|
+
LINT_RULE_WORKERS,
|
|
3020
|
+
josh_environment_file,
|
|
3021
|
+
transcript_record,
|
|
3022
|
+
cost_blocks,
|
|
3023
|
+
canonical_command,
|
|
3024
|
+
time_shell,
|
|
3025
|
+
figure_format,
|
|
3026
|
+
pr_raw_schema,
|
|
3027
|
+
epic_issue_schema,
|
|
3028
|
+
blocking_issue_schema,
|
|
3029
|
+
blocked_by_schema,
|
|
3030
|
+
rest_comment_schema,
|
|
3031
|
+
issue_label_schema,
|
|
3032
|
+
author_fields_schema,
|
|
3033
|
+
open_issue_schema,
|
|
3034
|
+
process_owner_schema,
|
|
3035
|
+
PR_POLL_SCHEDULES,
|
|
3036
|
+
poll,
|
|
3037
|
+
repository_lock,
|
|
3038
|
+
run_event_stream,
|
|
3039
|
+
issue_citation,
|
|
3040
|
+
session_cite,
|
|
3041
|
+
lane_state_record,
|
|
3042
|
+
lane_state,
|
|
3043
|
+
lane_spans,
|
|
3044
|
+
run_event_scope,
|
|
3045
|
+
run_event_stream_emit,
|
|
3046
|
+
time_josh_names,
|
|
3047
|
+
agent_profile_schema,
|
|
3048
|
+
agent_session_role,
|
|
3049
|
+
ancestor_directories,
|
|
3050
|
+
PACKAGE_JSON,
|
|
3051
|
+
package_manifest,
|
|
3052
|
+
find_package_directory,
|
|
3053
|
+
session_language
|
|
3054
|
+
};
|