@outerlayer/cli 0.40.0-next.20261117031847 → 0.40.0-next.20261117034333
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/dist/agent-setup-UU3NQZ3A.js +41 -0
- package/dist/{agent-subcommand-SNGOSV4D.js → agent-subcommand-MW4TF4SG.js} +4 -4
- package/dist/{artifact-link-cmd-K6VFGMIO.js → artifact-link-cmd-XUHNVFVU.js} +2 -2
- package/dist/{bridge-C5FNHUYF.js → bridge-WEK2IMAD.js} +7 -7
- package/dist/{build-YFKCYJR6.js → build-LJSUCORB.js} +13 -13
- package/dist/{build-disk-ZRWIYYVO.js → build-disk-S2XHWSDH.js} +11 -11
- package/dist/build-info.json +1 -1
- package/dist/{builder-334EUQCE.js → builder-TCRJKB2W.js} +10 -10
- package/dist/caller-VJBDXZXG.js +23 -0
- package/dist/{check-LGB3BWZ7.js → check-Z6GAY2C4.js} +55 -55
- package/dist/{chunk-SBSH253O.js → chunk-2QFZBWBP.js} +1 -1
- package/dist/{chunk-5LDYQLE3.js → chunk-33DTLCL6.js} +2 -2
- package/dist/{chunk-6RJBLCPV.js → chunk-33RKRHJG.js} +1 -1
- package/dist/{chunk-CVSREZEZ.js → chunk-3ETI7MKK.js} +4 -4
- package/dist/{chunk-M7RI6IMR.js → chunk-3PXV4I75.js} +3 -3
- package/dist/{chunk-WNQMNFJG.js → chunk-4FTRLX6A.js} +5 -5
- package/dist/{chunk-CEHT2FCU.js → chunk-5EWESACE.js} +2 -2
- package/dist/{chunk-5SAJ23BY.js → chunk-5O7P6VXS.js} +1 -1
- package/dist/{chunk-DHB3M244.js → chunk-6GJMRVMX.js} +1 -1
- package/dist/{chunk-DRF45IQZ.js → chunk-6NODVJGM.js} +3 -3
- package/dist/{chunk-QAZOUTEM.js → chunk-6QXGAGQY.js} +1 -1
- package/dist/{chunk-NLOUOUZV.js → chunk-6ZBUQIJA.js} +1 -1
- package/dist/{chunk-Z3IDEUCC.js → chunk-7PIUTUXI.js} +3 -3
- package/dist/{chunk-OF6XMZHO.js → chunk-7QIQ7QR3.js} +1 -1
- package/dist/{chunk-QVQWIKDP.js → chunk-ABXHYH2Y.js} +6 -6
- package/dist/{chunk-G3HBBHIK.js → chunk-ABY722KN.js} +1 -1
- package/dist/{chunk-62EOPMMA.js → chunk-AGKUDDIN.js} +1 -1
- package/dist/{chunk-ERFVB3TJ.js → chunk-AH2BO6Q6.js} +6 -6
- package/dist/{chunk-GZLNKW2J.js → chunk-BEK2BZAI.js} +6 -6
- package/dist/{chunk-DQQID2EX.js → chunk-BZFRU6M7.js} +8 -8
- package/dist/{chunk-MCUI6RHU.js → chunk-CH3PO7UY.js} +10 -2
- package/dist/{chunk-OUVDFJ3T.js → chunk-CNMC4OXO.js} +7 -7
- package/dist/{chunk-CJCGE7TW.js → chunk-CW6H5JXV.js} +8 -8
- package/dist/{chunk-2MSLNM5V.js → chunk-D2QNQOFX.js} +1 -1
- package/dist/{chunk-F2I2GQMF.js → chunk-D3CALDGC.js} +1 -1
- package/dist/{chunk-HQPB4ZMS.js → chunk-EBWA6KIE.js} +1 -1
- package/dist/{chunk-2VVSAKM3.js → chunk-EU6JHHES.js} +338 -97
- package/dist/{chunk-EO7KUUKZ.js → chunk-F4PRZBBJ.js} +2 -2
- package/dist/{chunk-WT74ZSRC.js → chunk-F6J3ACXH.js} +6 -6
- package/dist/{chunk-DV44KCM6.js → chunk-FG2E3HES.js} +1 -1
- package/dist/{chunk-6JRDP6O4.js → chunk-FLHDVJAV.js} +5 -5
- package/dist/{chunk-CGYKQEPN.js → chunk-GBLNHZ3E.js} +4 -4
- package/dist/{chunk-QVTGSGQ5.js → chunk-GQI5N56J.js} +2 -2
- package/dist/{chunk-3IHZYNZW.js → chunk-H2THCHUP.js} +1 -1
- package/dist/{chunk-FPUFOQEH.js → chunk-H4JQKCVP.js} +9 -9
- package/dist/{chunk-UNGZ25QF.js → chunk-H6L6SWMN.js} +2 -2
- package/dist/{chunk-WYD6XWET.js → chunk-HI6R4XYD.js} +2 -2
- package/dist/{chunk-6P23FS2Z.js → chunk-HSGZ4JEV.js} +1 -1
- package/dist/{chunk-QIO2NIX2.js → chunk-I7ZQKMKG.js} +1 -1
- package/dist/{chunk-PIJWOPSG.js → chunk-IQYAPM4S.js} +7 -7
- package/dist/{chunk-ONDONSBT.js → chunk-K6THWLSJ.js} +1 -1
- package/dist/{chunk-2F3RZT5L.js → chunk-KCLFDN26.js} +3 -3
- package/dist/{chunk-OY4EJVUH.js → chunk-KDVQGQXM.js} +1 -1
- package/dist/{chunk-IWPU2TDY.js → chunk-LYHR47YE.js} +2 -2
- package/dist/{chunk-MJGBRYDH.js → chunk-MBOQJTOS.js} +11 -6
- package/dist/{chunk-NWYQ7PKS.js → chunk-MEZVLRJK.js} +10 -10
- package/dist/{chunk-T3NBGNP5.js → chunk-MG2Y5XYV.js} +247 -138
- package/dist/{chunk-J6WQ6POX.js → chunk-NWWED36F.js} +1 -1
- package/dist/{chunk-AAOM7S3Z.js → chunk-P7OXJ3ZD.js} +5 -5
- package/dist/{chunk-XLU5ZOTK.js → chunk-PB4QDL6Q.js} +4 -4
- package/dist/{chunk-YUR7GV5L.js → chunk-PHC24VUU.js} +5 -5
- package/dist/{chunk-R4IC7BKJ.js → chunk-PZZS6DHY.js} +8 -8
- package/dist/{chunk-A72OH6K3.js → chunk-QJI56HI2.js} +7 -7
- package/dist/{chunk-F7EYCXY4.js → chunk-RUSF2YGL.js} +6 -6
- package/dist/{chunk-CWJ26A6W.js → chunk-S4CX66JO.js} +1 -1
- package/dist/{chunk-H7EBNQGW.js → chunk-SK4BESZM.js} +1 -1
- package/dist/{chunk-OCXVMUXA.js → chunk-TTBG7YZW.js} +7 -7
- package/dist/{chunk-ROMZCAG7.js → chunk-TZNIDZGI.js} +1 -1
- package/dist/{chunk-IQTMXXKU.js → chunk-UAZBE4O3.js} +10 -10
- package/dist/{chunk-6MF44FPF.js → chunk-UE42G3QY.js} +1 -1
- package/dist/{chunk-GOJ2SPKB.js → chunk-UFGV3JZ5.js} +1 -1
- package/dist/{chunk-JGSIVQVE.js → chunk-UN7RXMOB.js} +4 -4
- package/dist/{chunk-OVF475U5.js → chunk-UUVURKWB.js} +4 -4
- package/dist/{chunk-OIAWDKSR.js → chunk-V6UDJVVD.js} +3 -3
- package/dist/{chunk-WZRXXOWB.js → chunk-V77IQKWK.js} +17 -17
- package/dist/{chunk-NO3JPGJW.js → chunk-VG6FUXGK.js} +1 -1
- package/dist/{chunk-4WRECUUH.js → chunk-WEPLWKV6.js} +3 -3
- package/dist/{chunk-3TQVQKQ2.js → chunk-WZ6K327V.js} +7 -7
- package/dist/{chunk-DOJGTDZU.js → chunk-X6BGCNE3.js} +8 -8
- package/dist/{chunk-RO5YUUN2.js → chunk-XT6LWXJ2.js} +1 -1
- package/dist/{chunk-KDKMVWHJ.js → chunk-YICV7DAE.js} +3 -3
- package/dist/{chunk-ZTZFWQBG.js → chunk-ZASDJ7F5.js} +4 -4
- package/dist/{chunk-YNNTU5IZ.js → chunk-ZIN6G7DS.js} +1 -1
- package/dist/{chunk-O2324X34.js → chunk-ZQTMWBLA.js} +1 -1
- package/dist/{chunk-JDAH6YHU.js → chunk-ZYIVNB6B.js} +5 -5
- package/dist/{claude-launcher-3H5XSXVA.js → claude-launcher-HWC5S5HD.js} +7 -7
- package/dist/{cli-FRR5Q3IX.js → cli-TWF7CU3E.js} +168 -168
- package/dist/{command-Y5FG3FWC.js → command-KGYVPB7B.js} +52 -52
- package/dist/{config-V6VQOSHM.js → config-J4VSNOH4.js} +12 -12
- package/dist/{connect-cmd-AU2IGAYG.js → connect-cmd-LPC6J27D.js} +13 -13
- package/dist/{container-start-Z6OCZPUC.js → container-start-O6BAIQGT.js} +49 -49
- package/dist/{context-cleanup-SK445SLA.js → context-cleanup-VWJSWUJB.js} +4 -4
- package/dist/{context-show-cmd-Z6YW2XPG.js → context-show-cmd-B427F3M4.js} +14 -14
- package/dist/{control-plane-launch-CNGKWYLK.js → control-plane-launch-WV253P7I.js} +14 -14
- package/dist/{demo-record-cmd-VEMSRUVR.js → demo-record-cmd-YRND2HVT.js} +8 -8
- package/dist/{demo-voice-cmd-ABNZ6H7V.js → demo-voice-cmd-TUIXJ7CY.js} +20 -20
- package/dist/{dist-775TDFCK.js → dist-UV2JOW3N.js} +2 -2
- package/dist/{docker-UHQ4LAJE.js → docker-6NO5B657.js} +10 -10
- package/dist/{doctor-B7XTBO53.js → doctor-V3Z5CR5Q.js} +51 -51
- package/dist/{emit-artifact-cmd-WLBQOFGX.js → emit-artifact-cmd-MWDEBRB2.js} +19 -19
- package/dist/{emit-cmd-A6ZGOPLZ.js → emit-cmd-2ADJWBJP.js} +7 -7
- package/dist/{emit-criteria-cmd-S533NEY4.js → emit-criteria-cmd-35O7KR37.js} +16 -16
- package/dist/{emit-demo-cmd-K4JY5PDP.js → emit-demo-cmd-HJCW3JEA.js} +20 -20
- package/dist/{emit-finding-cmd-C7RZGGVJ.js → emit-finding-cmd-Q4SN3OA7.js} +16 -16
- package/dist/{emit-result-cmd-5NLUDBXM.js → emit-result-cmd-7VEMDT2P.js} +18 -18
- package/dist/{emit-step-cmd-Q7VIXGYQ.js → emit-step-cmd-DYQM5OQA.js} +16 -16
- package/dist/{exec-client-RR6F42IB.js → exec-client-6WGSNY56.js} +8 -8
- package/dist/{find-unit-WRHK3H5X.js → find-unit-6BX4K4WV.js} +13 -13
- package/dist/{findings-cmd-74MN2Q7K.js → findings-cmd-WHQBJZNA.js} +16 -16
- package/dist/{fleet-readiness-R6B3PYU7.js → fleet-readiness-A67D5OP4.js} +14 -14
- package/dist/{governing-source-M2HYH7ZN.js → governing-source-C4BMFNFZ.js} +21 -21
- package/dist/{guest-init-QEWU2H7W.js → guest-init-ZWEJGXQS.js} +9 -9
- package/dist/{hook-fast-GPW7D4MD.js → hook-fast-SZ5L3ZJK.js} +1 -1
- package/dist/{hook-install-VF3X2ZXN.js → hook-install-63GJ3OUI.js} +4 -4
- package/dist/host-checks-SYD7WFUN.js +82 -0
- package/dist/host-key-AYXCAME4.js +18 -0
- package/dist/{image-tag-LKOD5GRQ.js → image-tag-6HQDPX45.js} +8 -8
- package/dist/index.js +4 -4
- package/dist/{init-UO4SOY57.js → init-KOG5S5KX.js} +47 -47
- package/dist/init-ULMPF7MK.js +82 -0
- package/dist/{init-agent-JVMIDIXN.js → init-agent-XIDQULDZ.js} +47 -47
- package/dist/init-cmd-P7FYHTLS.js +53 -0
- package/dist/{init-update-BRUFAWCA.js → init-update-7SBDG65Z.js} +24 -24
- package/dist/install-cmd-TWYZTNRV.js +26 -0
- package/dist/launch-agent-5MCXT6QN.js +26 -0
- package/dist/{layout-BG6MFUS3.js → layout-2MIQCJ3U.js} +4 -4
- package/dist/{login-browser-OA4R4PEQ.js → login-browser-ZYWUIEOQ.js} +2 -2
- package/dist/{logs-WNZZNFA3.js → logs-SP6RPVCP.js} +7 -7
- package/dist/loop-OU2U7SUJ.js +92 -0
- package/dist/machine-NE34TJIO.js +82 -0
- package/dist/{machine-skills-B7KO47CH.js → machine-skills-UYWZXOZI.js} +4 -4
- package/dist/{mcp-install-cmd-JXD6Q7NN.js → mcp-install-cmd-U2SEWH66.js} +4 -4
- package/dist/{mcp-serve-cmd-4D4P6IA7.js → mcp-serve-cmd-VAQL3CJB.js} +9 -9
- package/dist/{paths-I7LDWR3Q.js → paths-G7LFPGQQ.js} +7 -7
- package/dist/{pending-L65HTOAV.js → pending-OEAYMKZO.js} +8 -8
- package/dist/{pidfile-SNTRLZ2Z.js → pidfile-FIVR2HKB.js} +8 -8
- package/dist/{record-QJPGOWYX.js → record-K3I7V46A.js} +8 -8
- package/dist/{relay-V5GHEWT3.js → relay-AQBBQJ5I.js} +5 -5
- package/dist/{relay-protocol-2S2EAHYH.js → relay-protocol-XZ7WESQL.js} +5 -5
- package/dist/{run-cmd-YY34QRDU.js → run-cmd-BRUSQKEA.js} +16 -16
- package/dist/{runner-agents-CLDURIBZ.js → runner-agents-KF6EECFW.js} +4 -4
- package/dist/runner-env-XAO7EBCK.js +24 -0
- package/dist/{runner-identity-2374JAQF.js → runner-identity-JM3ZQ2PJ.js} +10 -10
- package/dist/{runner-key-JRZ5N4IM.js → runner-key-P6FUFO6Y.js} +47 -47
- package/dist/{session-sender-CUM4SRT7.js → session-sender-N3U3ZTL3.js} +19 -19
- package/dist/{setup-cmd-5ICCOGTJ.js → setup-cmd-F7Y4SFTK.js} +14 -14
- package/dist/{setup-wiring-CEGNPVS5.js → setup-wiring-LU6AY2QA.js} +54 -54
- package/dist/{spec-cmd-6ACWBET6.js → spec-cmd-ZNXNMAYA.js} +17 -17
- package/dist/{starter-pack-WOD4WMUX.js → starter-pack-NEQLRMTX.js} +5 -5
- package/dist/state-VXN7EX2K.js +18 -0
- package/dist/{status-H677WBLM.js → status-N326EK5I.js} +47 -47
- package/dist/{sync-cmd-5UMBZRKI.js → sync-cmd-KG7YQGM6.js} +18 -18
- package/dist/update-steps-YQQXESUZ.js +83 -0
- package/dist/{watch-34LOYMEQ.js → watch-3VJ363V2.js} +18 -18
- package/dist/{work-claim-cmd-NRHTDJC3.js → work-claim-cmd-MXWB5NG6.js} +23 -23
- package/dist/{work-cmd-NBYW3LBP.js → work-cmd-X55AAJG2.js} +16 -16
- package/dist/{work-comment-cmd-J4CG33NA.js → work-comment-cmd-7AL5KEVJ.js} +18 -18
- package/dist/{work-demo-cmd-APJDOTHV.js → work-demo-cmd-6UFGGEMI.js} +16 -16
- package/dist/{work-logs-cmd-FL7DOHUU.js → work-logs-cmd-DCAV3J7A.js} +16 -16
- package/dist/{work-mock-cmd-4MAYOAQS.js → work-mock-cmd-O7KFTS65.js} +16 -16
- package/dist/{work-needs-attention-cmd-LG5MFGPW.js → work-needs-attention-cmd-OD5PTHLX.js} +16 -16
- package/dist/{work-no-change-cmd-QATDFQ46.js → work-no-change-cmd-ABYXIOZT.js} +16 -16
- package/dist/{work-open-pr-cmd-FV43THW5.js → work-open-pr-cmd-WRFHZXVM.js} +17 -17
- package/dist/{work-pr-cmd-53VAE7HD.js → work-pr-cmd-VEH4HP7P.js} +16 -16
- package/dist/{work-proofs-cmd-4SF7WZC3.js → work-proofs-cmd-TKA3J2II.js} +18 -18
- package/dist/{work-proofs-record-IGKVQOLA.js → work-proofs-record-WTBSJLET.js} +24 -24
- package/dist/{work-stop-cmd-V5SPVTY4.js → work-stop-cmd-WF7R6ILK.js} +16 -16
- package/package.json +1 -1
- package/skill-pack/maintained/outerlayer-review/SKILL.md +5 -2
- package/skill-pack/maintained/outerlayer-review/references/consolidation.md +80 -0
- package/dist/agent-setup-E3NJKG6H.js +0 -41
- package/dist/caller-6PMFDU4O.js +0 -23
- package/dist/host-checks-PKOVCAGU.js +0 -82
- package/dist/host-key-HICYSAZ5.js +0 -18
- package/dist/init-DFC5GUE5.js +0 -82
- package/dist/init-cmd-WTJ7KOQ5.js +0 -53
- package/dist/install-cmd-2H4QK5O7.js +0 -26
- package/dist/launch-agent-HPWRSGXZ.js +0 -26
- package/dist/loop-WO37TJ5C.js +0 -92
- package/dist/machine-ZXCUPCDS.js +0 -82
- package/dist/runner-env-ACRSRRBW.js +0 -24
- package/dist/state-TUO74X72.js +0 -18
- package/dist/update-steps-XCDL66FA.js +0 -83
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-
|
|
3
|
+
import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-TZNIDZGI.js';
|
|
4
4
|
import { fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-E7R2GIAW.js';
|
|
5
|
-
import { reportFailedStart, fitImageBuildMemory } from './chunk-
|
|
6
|
-
import { renderUpdateSteps } from './chunk-
|
|
5
|
+
import { reportFailedStart, fitImageBuildMemory } from './chunk-QJI56HI2.js';
|
|
6
|
+
import { renderUpdateSteps } from './chunk-7PIUTUXI.js';
|
|
7
7
|
import { decideInstalledSwitch } from './chunk-TXKHD4Q6.js';
|
|
8
|
-
import { writeFleetState } from './chunk-
|
|
9
|
-
import { writePendingUpdate } from './chunk-
|
|
10
|
-
import { fleetConfigProblem, realBlockedProbes, checkBlockedWithSlots, askFleetMachine } from './chunk-
|
|
11
|
-
import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-
|
|
12
|
-
import { leaseTimeLeftMs, createContainerRuntime, heldSandboxClaimsOf, unfinishedJobs, withTunnelLog, itemTag, releaseLease, runDecision, claimRun, LEASE_SECONDS, isUnfinished, prepareResume, restoreSessionIntoMicroVm, restoreSessionIntoContainer, restoreSessionIntoSandbox, restoreWork, keptSessionDir, workRestoredEnv, sessionGuestOfMicroVm, sessionGuestOfContainer, sessionGuestOfSandbox, recordsProofsOnly, itemScope, attemptNote, fetchManagedClaudeKey, holdManagedClaudeKey, fetchManagedBuildSettings, holdManagedBuildSettings, setStage, jobEnv, runHook, describeHookEnd, needsBuildSkill, provisionContainer, leaseExpiresAtMs, withJobTimeLimit, deliverContainerHooks, provisionSandbox, deliverSandboxHooks, provisionMicroVm, deliverCommitHooks, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, deliverExecMaven, runWithSpawn, hostCommandEnvironment, lifecycleSteps, execArgv, lifecycleFailureReason, decideHostBuildSkill, prepareBranch, keptCommitsLine, currentSkillCommand, formerSkillProblem, commandLogOffset, startSandboxCommand, MICROVM_COMMAND_DIR, startMicroVmCommand, microVmCommandLine, runCommand, containerCommandExec, execCommandLine, startSender, startHostServices, finishJob, sampleGuest, foldSample, isSandboxTracked, isContainerTracked, isMicroVmTracked, probeSandboxCommand, probeMicroVmCommand, probeCommand, appendCommandLog, judgeProbe, SandboxGoneError, SandboxContainerStoppedError, EXIT_CODE_FILE, isTracked, isGroupAlive, outcomeFromExitCode, isIsolatedJob, jobTimeLimitMinutes, isTimedOut, readCpuUsec, isIdle, HELPER_ENV, setUpRunnerCgroup, stopOrphanedMicroVms, sweepImageBuilders, listUnreadableJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, GUEST_USAGE_INTERVAL_MS, vmAlive, filesAreCopied, inSandbox, listItemDisks, hookLimitsFor, runCommandOf, AttemptLogBook, environmentFor, builtOf, judgeCredential, readWorkItem, makeRecorder, microVmOomKills, needsRenew, renewRun, renewLease, RENEW_INTERVAL_SECONDS, stoppedHelperReason, measureDisk, listTrackedJobs, sweepSandboxes, keptSandboxIds, parseCpuList, ensureTunnel, keepGhConfigCurrent, restartSender, rejoinSandboxBuild, createHousekeepingDocker, housekeepingDockerIfReachable, runHousekeeping, shellQuote, jobRecordsClaim, freeItemDisksUntil, savedStatesDir, readRecords, removeOldestUntil, treeFileText, timeoutAfter, scrubReason, ensureNetworkReady, ADOPTED_FETCH_RETRY_WINDOW_MS, managedBuildSettingsFor, gitRemoteFor, startServicesFor, installTrust, createLeaseChannel, serveLease, writeGuestGhConfig, deliverJobFiles, inTeardown } from './chunk-
|
|
13
|
-
import { RUNNER_PROTOCOL } from './chunk-
|
|
14
|
-
import { criteriaOf, loadCitationFinder, wholeItems, itemsSentence, oneLineReason, wholeEntries,
|
|
15
|
-
import { RepoFilter } from './chunk-
|
|
8
|
+
import { writeFleetState } from './chunk-VG6FUXGK.js';
|
|
9
|
+
import { writePendingUpdate } from './chunk-5O7P6VXS.js';
|
|
10
|
+
import { fleetConfigProblem, realBlockedProbes, checkBlockedWithSlots, askFleetMachine } from './chunk-MEZVLRJK.js';
|
|
11
|
+
import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-I7ZQKMKG.js';
|
|
12
|
+
import { leaseTimeLeftMs, createContainerRuntime, heldSandboxClaimsOf, unfinishedJobs, withTunnelLog, itemTag, releaseLease, runDecision, claimRun, LEASE_SECONDS, isUnfinished, prepareResume, restoreSessionIntoMicroVm, restoreSessionIntoContainer, restoreSessionIntoSandbox, restoreWork, keptSessionDir, workRestoredEnv, sessionGuestOfMicroVm, sessionGuestOfContainer, sessionGuestOfSandbox, recordsProofsOnly, itemScope, attemptNote, fetchManagedClaudeKey, holdManagedClaudeKey, fetchManagedBuildSettings, holdManagedBuildSettings, setStage, jobEnv, runHook, describeHookEnd, needsBuildSkill, provisionContainer, leaseExpiresAtMs, withJobTimeLimit, deliverContainerHooks, provisionSandbox, deliverSandboxHooks, provisionMicroVm, deliverCommitHooks, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, deliverExecMaven, runWithSpawn, hostCommandEnvironment, lifecycleSteps, execArgv, lifecycleFailureReason, decideHostBuildSkill, prepareBranch, keptCommitsLine, currentSkillCommand, formerSkillProblem, commandLogOffset, startSandboxCommand, MICROVM_COMMAND_DIR, startMicroVmCommand, microVmCommandLine, runCommand, containerCommandExec, execCommandLine, startSender, startHostServices, finishJob, sampleGuest, foldSample, isSandboxTracked, isContainerTracked, isMicroVmTracked, probeSandboxCommand, probeMicroVmCommand, probeCommand, appendCommandLog, judgeProbe, SandboxGoneError, SandboxContainerStoppedError, EXIT_CODE_FILE, isTracked, isGroupAlive, outcomeFromExitCode, isIsolatedJob, jobTimeLimitMinutes, isTimedOut, readCpuUsec, isIdle, HELPER_ENV, setUpRunnerCgroup, stopOrphanedMicroVms, sweepImageBuilders, listUnreadableJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, GUEST_USAGE_INTERVAL_MS, vmAlive, filesAreCopied, inSandbox, listItemDisks, hookLimitsFor, runCommandOf, AttemptLogBook, environmentFor, builtOf, judgeCredential, readWorkItem, makeRecorder, microVmOomKills, needsRenew, renewRun, renewLease, RENEW_INTERVAL_SECONDS, stoppedHelperReason, measureDisk, listTrackedJobs, sweepSandboxes, keptSandboxIds, parseCpuList, ensureTunnel, keepGhConfigCurrent, restartSender, rejoinSandboxBuild, createHousekeepingDocker, housekeepingDockerIfReachable, runHousekeeping, shellQuote, jobRecordsClaim, freeItemDisksUntil, savedStatesDir, readRecords, holdsHostDisk, removeOldestUntil, treeFileText, timeoutAfter, scrubReason, ensureNetworkReady, ADOPTED_FETCH_RETRY_WINDOW_MS, managedBuildSettingsFor, gitRemoteFor, startServicesFor, installTrust, createLeaseChannel, serveLease, writeGuestGhConfig, deliverJobFiles, inTeardown } from './chunk-MG2Y5XYV.js';
|
|
13
|
+
import { RUNNER_PROTOCOL } from './chunk-EBWA6KIE.js';
|
|
14
|
+
import { criteriaOf, diffLines, loadCitationFinder, wholeItems, itemsSentence, oneLineReason, parseJudgeAnswer, wholeEntries, treePath, lineInDiff } from './chunk-MBOQJTOS.js';
|
|
15
|
+
import { RepoFilter } from './chunk-H4JQKCVP.js';
|
|
16
16
|
import { JOB_STATE_FORMAT, readsJobState, jobStateFormatOf } from './chunk-B4XB5QFD.js';
|
|
17
|
-
import { imageTag, writeUpdateStatus, pullInstruction, tagToPull } from './chunk-
|
|
17
|
+
import { imageTag, writeUpdateStatus, pullInstruction, tagToPull } from './chunk-UE42G3QY.js';
|
|
18
18
|
import { isVersion, compareVersions, satisfiesRange } from './chunk-TQMI335S.js';
|
|
19
|
-
import { claimCalls, claimItem, spoolHomeFor, leftByRunnerKey, runnerCalls, itemCalls, configForJob } from './chunk-
|
|
20
|
-
import { fetchCommit, readBranchHead, diffBetween } from './chunk-
|
|
21
|
-
import { claimPidFile, releasePidFile, writePidFile, readPidFile } from './chunk-
|
|
19
|
+
import { claimCalls, claimItem, spoolHomeFor, leftByRunnerKey, runnerCalls, itemCalls, configForJob } from './chunk-HI6R4XYD.js';
|
|
20
|
+
import { fetchCommit, readBranchHead, diffBetween } from './chunk-WZ6K327V.js';
|
|
21
|
+
import { claimPidFile, releasePidFile, writePidFile, readPidFile } from './chunk-6QXGAGQY.js';
|
|
22
22
|
import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
|
|
23
|
-
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-
|
|
24
|
-
import { WorkCommandError, isSignatureRefusal, getJson, postJson, getBytes } from './chunk-
|
|
25
|
-
import { keyRunnerFactory, readsOnly, isBuiltinSandbox, isBuiltinContainer, isBuiltinVm, loadRunnerConfig, checkHooks, builtinKind, keepsHostBuilder, runnerDeliversComments, DEFAULT_CHECK_TIME_LIMIT_MINUTES, readOnlyRemoteOf, DEFAULT_SAVED_STATE_MAX_BYTES, DEFAULT_UPDATE_MAX_WAIT_HOURS, readOnlyOption } from './chunk-
|
|
26
|
-
import { formatBytes, freeBytes } from './chunk-
|
|
27
|
-
import { writeJobFile, ensureRunnerIdentity, identityDockerFor, readJobFile, JUDGE_TREE, exceedsDisk, runnerLabelValue, builderName, ensureFailureCount, builderSpec, ensureBuilder, spawnRun,
|
|
28
|
-
import { loadHostKey, ensureHostKey, signerFor } from './chunk-
|
|
29
|
-
import { jobsDir, RUNNER_DIR_MODE, runnerDir, RUNNER_FILE_MODE, buildDir, attemptStamp, jobDir, pidFilePath, storeScopes } from './chunk-
|
|
30
|
-
import { parseClaimIdentity, parseBranchlessRepositories, parseClaimedRepositories, parseUnreachable, repositoriesOf, primaryOf, JOB_MOUNT, WORK_DIR } from './chunk-
|
|
31
|
-
import { jobCredentialProblem, COMMAND_LOST_REASON, takeAgentCredentials, heldAgentCredential, CONTAINER_STOPPED_REASON, currentAgentCredential, fdName } from './chunk-
|
|
32
|
-
import { cleanAttachmentName } from './chunk-
|
|
33
|
-
import { jobAgent, jobCommandEnv, runnerAgents, judgeAgent } from './chunk-
|
|
34
|
-
import { defaultAgents, resolvePackRoot } from './chunk-
|
|
23
|
+
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-CW6H5JXV.js';
|
|
24
|
+
import { WorkCommandError, isSignatureRefusal, getJson, postJson, getBytes } from './chunk-X6BGCNE3.js';
|
|
25
|
+
import { keyRunnerFactory, readsOnly, isBuiltinSandbox, isBuiltinContainer, isBuiltinVm, loadRunnerConfig, checkHooks, builtinKind, keepsHostBuilder, runnerDeliversComments, DEFAULT_CHECK_TIME_LIMIT_MINUTES, readOnlyRemoteOf, DEFAULT_SAVED_STATE_MAX_BYTES, DEFAULT_UPDATE_MAX_WAIT_HOURS, readOnlyOption } from './chunk-ZASDJ7F5.js';
|
|
26
|
+
import { formatBytes, freeBytes } from './chunk-33DTLCL6.js';
|
|
27
|
+
import { writeJobFile, ensureRunnerIdentity, identityDockerFor, readJobFile, JUDGE_TREE, exceedsDisk, runnerLabelValue, builderName, ensureFailureCount, builderSpec, ensureBuilder, spawnRun, JUDGE_DIR, judgeCommand, JUDGE_MAX_TURNS } from './chunk-PZZS6DHY.js';
|
|
28
|
+
import { loadHostKey, ensureHostKey, signerFor } from './chunk-6ZBUQIJA.js';
|
|
29
|
+
import { jobsDir, RUNNER_DIR_MODE, runnerDir, RUNNER_FILE_MODE, buildDir, attemptStamp, jobDir, pidFilePath, storeScopes } from './chunk-H2THCHUP.js';
|
|
30
|
+
import { parseClaimIdentity, parseBranchlessRepositories, parseClaimedRepositories, parseUnreachable, repositoriesOf, primaryOf, JOB_MOUNT, WORK_DIR } from './chunk-ZYIVNB6B.js';
|
|
31
|
+
import { jobCredentialProblem, COMMAND_LOST_REASON, takeAgentCredentials, heldAgentCredential, CONTAINER_STOPPED_REASON, currentAgentCredential, fdName } from './chunk-GQI5N56J.js';
|
|
32
|
+
import { cleanAttachmentName } from './chunk-6NODVJGM.js';
|
|
33
|
+
import { jobAgent, jobCommandEnv, runnerAgents, judgeAgent } from './chunk-7QIQ7QR3.js';
|
|
34
|
+
import { defaultAgents, resolvePackRoot } from './chunk-5EWESACE.js';
|
|
35
35
|
import { resolveVersion } from './chunk-RA3O54FC.js';
|
|
36
|
-
import { CheckItemsSchema, CODE_REVIEW_NAME, CHECK_ITEM_HREF_MAX_LENGTH, CHECK_ITEM_REASON_MAX_LENGTH, UNREVIEWED_FILES_ITEM_ID, problemKind, CODE_REVIEW_PROBLEMS_MAX, REVIEWED_COMMIT_ITEM_ID } from './chunk-
|
|
36
|
+
import { CheckItemsSchema, CODE_REVIEW_NAME, CHECK_ITEM_HREF_MAX_LENGTH, CHECK_ITEM_REASON_MAX_LENGTH, UNREVIEWED_FILES_ITEM_ID, problemKind, CODE_REVIEW_PROBLEMS_MAX, REVIEWED_COMMIT_ITEM_ID, PROBLEM_KINDS, problemSeverity } from './chunk-CH3PO7UY.js';
|
|
37
37
|
import { randomBytes, createHash } from 'crypto';
|
|
38
38
|
import { mkdirSync, existsSync, writeFileSync, chmodSync, renameSync, statSync, readdirSync, rmSync, readFileSync, lstatSync, closeSync } from 'fs';
|
|
39
39
|
import { totalmem, userInfo, constants } from 'os';
|
|
@@ -393,11 +393,11 @@ function commentsOf(data) {
|
|
|
393
393
|
for (const entry of raw) {
|
|
394
394
|
const comment = entry;
|
|
395
395
|
if (comment === null || typeof comment !== "object") continue;
|
|
396
|
-
const { claimId, workItemId, commentId, thread, authorName, text, summary, at } = comment;
|
|
396
|
+
const { claimId, workItemId, commentId, thread, authorName, text: text2, summary, at } = comment;
|
|
397
397
|
if (typeof claimId !== "string" || typeof workItemId !== "string" || typeof commentId !== "string" || commentId === "") continue;
|
|
398
|
-
if (typeof thread !== "string" || typeof authorName !== "string" || typeof
|
|
398
|
+
if (typeof thread !== "string" || typeof authorName !== "string" || typeof text2 !== "string" || typeof at !== "string") continue;
|
|
399
399
|
const attachments = attachmentsOf(comment.attachments);
|
|
400
|
-
comments.push({ claimId, workItemId, commentId, thread, authorName, text, summary: typeof summary === "string" ? summary : null, at, ...attachments.length === 0 ? {} : { attachments } });
|
|
400
|
+
comments.push({ claimId, workItemId, commentId, thread, authorName, text: text2, summary: typeof summary === "string" ? summary : null, at, ...attachments.length === 0 ? {} : { attachments } });
|
|
401
401
|
}
|
|
402
402
|
return comments;
|
|
403
403
|
}
|
|
@@ -664,8 +664,8 @@ function readLastUpdate(configPath) {
|
|
|
664
664
|
return void 0;
|
|
665
665
|
}
|
|
666
666
|
}
|
|
667
|
-
function isoTime(
|
|
668
|
-
const ms = Date.parse(
|
|
667
|
+
function isoTime(text2) {
|
|
668
|
+
const ms = Date.parse(text2);
|
|
669
669
|
if (!Number.isFinite(ms)) return void 0;
|
|
670
670
|
const iso = new Date(ms).toISOString();
|
|
671
671
|
return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(iso) ? iso : void 0;
|
|
@@ -1276,8 +1276,8 @@ var SMALL_CHANGE_LINES = 40;
|
|
|
1276
1276
|
var LARGE_CHANGE_LINES = 800;
|
|
1277
1277
|
var GENERATED = /(^|\/)(openapi\.ya?ml|gateway-types\.ts|yarn\.lock|package-lock\.json|pnpm-lock\.yaml)$|\.golden$|\.snap$|(^|\/)generated\/|(^|\/)db-types\//;
|
|
1278
1278
|
var FLOOR = /\.sql$|(^|\/)migrations\/|auth|secret|permission|webhook|token|(^|\/)rls/i;
|
|
1279
|
-
function markdownSection(
|
|
1280
|
-
const lines =
|
|
1279
|
+
function markdownSection(text2, heading) {
|
|
1280
|
+
const lines = text2.split("\n");
|
|
1281
1281
|
const start2 = lines.findIndex((line) => line.trim() === `## ${heading}`);
|
|
1282
1282
|
if (start2 === -1) return void 0;
|
|
1283
1283
|
const end = lines.findIndex((line, index) => index > start2 && line.startsWith("## "));
|
|
@@ -1288,15 +1288,15 @@ function splitDiff(patch) {
|
|
|
1288
1288
|
const parts = [];
|
|
1289
1289
|
const starts = [...patch.matchAll(/^diff --git /gm)].map((match) => match.index);
|
|
1290
1290
|
for (const [index, start2] of starts.entries()) {
|
|
1291
|
-
const
|
|
1292
|
-
const path = /^diff --git a\/\S+ b\/(\S+)/.exec(
|
|
1291
|
+
const text2 = patch.slice(start2, starts[index + 1] ?? patch.length);
|
|
1292
|
+
const path = /^diff --git a\/\S+ b\/(\S+)/.exec(text2)?.[1] ?? "?";
|
|
1293
1293
|
let added = 0;
|
|
1294
1294
|
let removed = 0;
|
|
1295
|
-
for (const line of
|
|
1295
|
+
for (const line of text2.split("\n")) {
|
|
1296
1296
|
if (line.startsWith("+") && !line.startsWith("+++")) added += 1;
|
|
1297
1297
|
else if (line.startsWith("-") && !line.startsWith("---")) removed += 1;
|
|
1298
1298
|
}
|
|
1299
|
-
parts.push({ path, text, added, removed });
|
|
1299
|
+
parts.push({ path, text: text2, added, removed });
|
|
1300
1300
|
}
|
|
1301
1301
|
return parts;
|
|
1302
1302
|
}
|
|
@@ -1326,8 +1326,8 @@ function territories(changed, briefs) {
|
|
|
1326
1326
|
];
|
|
1327
1327
|
if (full) names.push(["security", "Security reviewer"], ["failure-path", "Failure-path reviewer"]);
|
|
1328
1328
|
const focused = names.flatMap(([name, heading]) => {
|
|
1329
|
-
const
|
|
1330
|
-
return
|
|
1329
|
+
const text2 = briefs === void 0 ? void 0 : markdownSection(briefs, heading);
|
|
1330
|
+
return text2 === void 0 ? [] : [{ name, text: text2 }];
|
|
1331
1331
|
});
|
|
1332
1332
|
return [generalist, ...focused];
|
|
1333
1333
|
}
|
|
@@ -1364,15 +1364,24 @@ function storedProblemsText(problems) {
|
|
|
1364
1364
|
}
|
|
1365
1365
|
function mergeAnswers(answers) {
|
|
1366
1366
|
const items = [];
|
|
1367
|
-
const earlier = /* @__PURE__ */ new
|
|
1367
|
+
const earlier = /* @__PURE__ */ new Map();
|
|
1368
1368
|
const keyOf = (entry) => {
|
|
1369
1369
|
const place = entry.refs?.[0];
|
|
1370
1370
|
return [entry.id, entry.result, place?.path ?? ""].join("\0");
|
|
1371
1371
|
};
|
|
1372
1372
|
for (const answer of answers) {
|
|
1373
|
-
const
|
|
1374
|
-
for (const entry of
|
|
1375
|
-
|
|
1373
|
+
const own = [];
|
|
1374
|
+
for (const entry of answer.items) {
|
|
1375
|
+
const held = earlier.get(keyOf(entry));
|
|
1376
|
+
if (held === void 0) {
|
|
1377
|
+
const kept = { ...entry, ...entry.reviewer === void 0 ? {} : { foundBy: [entry.reviewer] } };
|
|
1378
|
+
own.push([keyOf(entry), kept]);
|
|
1379
|
+
items.push(kept);
|
|
1380
|
+
continue;
|
|
1381
|
+
}
|
|
1382
|
+
if (entry.reviewer !== void 0 && !(held.foundBy ?? []).includes(entry.reviewer)) held.foundBy = [...held.foundBy ?? [], entry.reviewer];
|
|
1383
|
+
}
|
|
1384
|
+
for (const [key, entry] of own) if (!earlier.has(key)) earlier.set(key, entry);
|
|
1376
1385
|
}
|
|
1377
1386
|
const lists = answers.flatMap((answer) => answer.reviewed === void 0 ? [] : [answer.reviewed]);
|
|
1378
1387
|
const reviewed = lists.length === 0 ? void 0 : [...new Set(lists.flat())];
|
|
@@ -1390,7 +1399,7 @@ function mergeAnswers(answers) {
|
|
|
1390
1399
|
const result = failed2 ? "fail" : said.length > 0 && said.every((answer) => answer.result === "pass") ? "pass" : void 0;
|
|
1391
1400
|
return { ...result === void 0 ? {} : { result }, items, ...reviewed === void 0 ? {} : { reviewed }, ...previous === void 0 ? {} : { previous } };
|
|
1392
1401
|
}
|
|
1393
|
-
function
|
|
1402
|
+
function carriedProblems(merged, stored) {
|
|
1394
1403
|
const verdicts = new Map((merged.previous ?? []).map((entry) => [entry.id, entry]));
|
|
1395
1404
|
const kept = [];
|
|
1396
1405
|
const decided = /* @__PURE__ */ new Set();
|
|
@@ -1406,10 +1415,20 @@ function carryProblems(merged, stored) {
|
|
|
1406
1415
|
kind: problem.kind,
|
|
1407
1416
|
...problem.title === "" ? {} : { title: problem.title },
|
|
1408
1417
|
...problem.reason === "" ? {} : { reason: problem.reason },
|
|
1409
|
-
...problem.path === "" ? {} : { refs: [{ path: problem.path, ...line === void 0 ? {} : { line } }] }
|
|
1418
|
+
...problem.path === "" ? {} : { refs: [{ path: problem.path, ...line === void 0 ? {} : { line } }] },
|
|
1419
|
+
...problem.severity === null ? {} : { severity: problem.severity }
|
|
1410
1420
|
});
|
|
1411
1421
|
}
|
|
1412
|
-
return {
|
|
1422
|
+
return { kept, fresh: merged.items.filter((entry) => !decided.has(entry.id)) };
|
|
1423
|
+
}
|
|
1424
|
+
function dropNonProblems(answer, known) {
|
|
1425
|
+
const dropped = [];
|
|
1426
|
+
const items = answer.items.filter((entry) => {
|
|
1427
|
+
const why = (entry.refs ?? []).length === 0 ? "no place" : (entry.reason ?? "").trim() === "" ? "no reason" : entry.refs.some((ref) => known(ref.path)) ? void 0 : "unknown file";
|
|
1428
|
+
if (why !== void 0) dropped.push({ id: entry.id, why });
|
|
1429
|
+
return why === void 0;
|
|
1430
|
+
});
|
|
1431
|
+
return { answer: { ...answer, items }, dropped };
|
|
1413
1432
|
}
|
|
1414
1433
|
function unreviewedFiles(changed, reviewed) {
|
|
1415
1434
|
if (reviewed === void 0) return void 0;
|
|
@@ -1435,18 +1454,172 @@ function unreviewedItem(changed, reviewed, commit) {
|
|
|
1435
1454
|
return { id: UNREVIEWED_FILES_ITEM_ID, result: "skipped", commit, reason: `${reason}.` };
|
|
1436
1455
|
}
|
|
1437
1456
|
|
|
1457
|
+
// src/runner/code-review-consolidate.ts
|
|
1458
|
+
var CONSOLIDATION_INPUT = "problems.json";
|
|
1459
|
+
var CONSOLIDATION_ANSWER = "items-consolidator.json";
|
|
1460
|
+
var CONSOLIDATOR = "consolidator";
|
|
1461
|
+
var DROP_REASONS = ["duplicate", "out-of-scope", "not-shown", "wrong"];
|
|
1462
|
+
function shouldConsolidate(reviewers, fresh) {
|
|
1463
|
+
if (fresh === 0) return false;
|
|
1464
|
+
return reviewers > 1 || fresh > 1;
|
|
1465
|
+
}
|
|
1466
|
+
var keyAt = (index) => `p${index + 1}`;
|
|
1467
|
+
var finders = (entry) => entry.foundBy ?? (entry.reviewer === void 0 ? [] : [entry.reviewer]);
|
|
1468
|
+
function consolidationInput(fresh, reviewers) {
|
|
1469
|
+
const problems = fresh.map((entry, index) => ({
|
|
1470
|
+
key: keyAt(index),
|
|
1471
|
+
reviewers: finders(entry),
|
|
1472
|
+
id: entry.id,
|
|
1473
|
+
kind: entry.kind ?? "bug",
|
|
1474
|
+
...entry.title === void 0 ? {} : { title: entry.title },
|
|
1475
|
+
...entry.reason === void 0 ? {} : { reason: entry.reason },
|
|
1476
|
+
refs: entry.refs ?? []
|
|
1477
|
+
}));
|
|
1478
|
+
return `${JSON.stringify({ reviewers, problems }, null, 2)}
|
|
1479
|
+
`;
|
|
1480
|
+
}
|
|
1481
|
+
var RULES = ["What the review covers", "What is a problem", "What is never a problem", "Repository text"];
|
|
1482
|
+
function consolidationBrief(consolidation, brief) {
|
|
1483
|
+
const rules = RULES.flatMap((heading) => {
|
|
1484
|
+
const body = markdownSection(brief, heading);
|
|
1485
|
+
return body === void 0 ? [] : [`## ${heading}
|
|
1486
|
+
|
|
1487
|
+
${body}`];
|
|
1488
|
+
});
|
|
1489
|
+
return [consolidation.trimEnd(), ...rules.length === 0 ? [] : ["# The rules of the review", ...rules]].join("\n\n");
|
|
1490
|
+
}
|
|
1491
|
+
function consolidationProtocol(instructions, answer) {
|
|
1492
|
+
return `${instructions.trimEnd()}
|
|
1493
|
+
|
|
1494
|
+
## How to answer
|
|
1495
|
+
|
|
1496
|
+
This section comes from the factory host and overrides any other answer format above. \`${JUDGE_DIR}/${CONSOLIDATION_INPUT}\` lists the new problems, each under a \`key\`. \`${JUDGE_DIR}/files.md\` lists the changed files, the \`diff-<n>.patch\` files hold the change and \`${JUDGE_TREE}/\` the files of the commit under review.
|
|
1497
|
+
|
|
1498
|
+
Write your answer as JSON to \`${answer}\`: \`{"problems":[{"from":["<key>"],"id":"<a short name>","kind":"bug"|"security"|"data"|"test"|"docs"|"comment","severity":"blocking"|"advisory","title":"<a short name>","reason":"<one to three sentences>","trigger":"<the input or state that triggers it>","result":"<the wrong result>","changed":{"path":"<changed file>","line":<the changed line that adds or causes it>},"refs":[{"path":"<path relative to ${JUDGE_TREE}/>","line":<the line in the commit>}]}],"dropped":[{"key":"<key>","why":"duplicate"|"out-of-scope"|"not-shown"|"wrong","of":"<key it repeats, for a duplicate>","reason":"<one sentence>"}]}\`. \`from\` lists every key the kept problem joins. Give each key once: in the \`from\` of one kept problem, or in \`dropped\`. Never keep a problem that no key names. The host drops a kept problem with no \`trigger\`, \`result\` or \`changed\` line of the change.
|
|
1499
|
+
`;
|
|
1500
|
+
}
|
|
1501
|
+
function knownPlaces(raw, known) {
|
|
1502
|
+
if (!Array.isArray(raw)) return [];
|
|
1503
|
+
return raw.flatMap((entry) => {
|
|
1504
|
+
const { path, line } = typeof entry === "object" && entry !== null ? entry : {};
|
|
1505
|
+
if (typeof path !== "string" || path === "" || path.length > 1024 || !known(path)) return [];
|
|
1506
|
+
return [{ path, ...typeof line === "number" && Number.isInteger(line) && line > 0 ? { line } : {} }];
|
|
1507
|
+
});
|
|
1508
|
+
}
|
|
1509
|
+
var text = (raw, max) => typeof raw === "string" && raw.trim() !== "" && raw.length <= max ? raw : void 0;
|
|
1510
|
+
function severityOf(kind, lowered) {
|
|
1511
|
+
if (kind === "test" || kind === "docs" || kind === "comment") return "advisory";
|
|
1512
|
+
if (kind === "security" || kind === "data") return "blocking";
|
|
1513
|
+
return lowered === "advisory" ? "advisory" : "blocking";
|
|
1514
|
+
}
|
|
1515
|
+
function shown(said, inChange) {
|
|
1516
|
+
const changed = Object(said.changed);
|
|
1517
|
+
const placed = typeof changed.path === "string" && typeof changed.line === "number" && Number.isInteger(changed.line) && changed.line > 0 && inChange(changed.path, changed.line);
|
|
1518
|
+
return placed && text(said.trigger, 2e3) !== void 0 && text(said.result, 2e3) !== void 0;
|
|
1519
|
+
}
|
|
1520
|
+
var UNSHOWN_REASON = "The consolidator kept it without naming the trigger, the wrong result and a changed line.";
|
|
1521
|
+
function readConsolidation(raw, fresh, known, inChange) {
|
|
1522
|
+
if (raw === void 0 || raw.trim() === "") return { ok: false, reason: "the consolidator wrote no answer file" };
|
|
1523
|
+
let parsed;
|
|
1524
|
+
try {
|
|
1525
|
+
parsed = JSON.parse(raw);
|
|
1526
|
+
} catch {
|
|
1527
|
+
return { ok: false, reason: "the consolidator's answer is not JSON" };
|
|
1528
|
+
}
|
|
1529
|
+
const answer = Object(parsed);
|
|
1530
|
+
if (!Array.isArray(answer.problems)) return { ok: false, reason: "the consolidator's answer lists no problems" };
|
|
1531
|
+
const sources = new Map(fresh.map((entry, index) => [keyAt(index), entry]));
|
|
1532
|
+
const used = /* @__PURE__ */ new Set();
|
|
1533
|
+
const notes = [];
|
|
1534
|
+
const kept = [];
|
|
1535
|
+
const dropped = [];
|
|
1536
|
+
const droppedKeys = /* @__PURE__ */ new Set();
|
|
1537
|
+
for (const [index, item] of answer.problems.entries()) {
|
|
1538
|
+
const said = Object(item);
|
|
1539
|
+
const keys = (Array.isArray(said.from) ? said.from : []).filter((key) => typeof key === "string" && sources.has(key) && !used.has(key));
|
|
1540
|
+
if (keys.length === 0) {
|
|
1541
|
+
notes.push(`problem ${index + 1} of the answer names no reported problem, so it is ignored`);
|
|
1542
|
+
continue;
|
|
1543
|
+
}
|
|
1544
|
+
for (const key of keys) used.add(key);
|
|
1545
|
+
if (!shown(said, inChange)) {
|
|
1546
|
+
for (const key of keys) {
|
|
1547
|
+
droppedKeys.add(key);
|
|
1548
|
+
dropped.push({ key, id: sources.get(key).id, reviewers: finders(sources.get(key)), why: "not-shown", reason: UNSHOWN_REASON });
|
|
1549
|
+
}
|
|
1550
|
+
continue;
|
|
1551
|
+
}
|
|
1552
|
+
const first = sources.get(keys[0]);
|
|
1553
|
+
const refs = knownPlaces(said.refs, known);
|
|
1554
|
+
const kind = PROBLEM_KINDS.includes(said.kind) ? said.kind : first.kind ?? "bug";
|
|
1555
|
+
const title = text(said.title, 300) ?? first.title;
|
|
1556
|
+
const reason = text(said.reason, 4e3) ?? first.reason;
|
|
1557
|
+
kept.push({
|
|
1558
|
+
keys,
|
|
1559
|
+
entry: {
|
|
1560
|
+
id: text(said.id, 200) ?? first.id,
|
|
1561
|
+
result: "fail",
|
|
1562
|
+
kind,
|
|
1563
|
+
...title === void 0 ? {} : { title },
|
|
1564
|
+
...reason === void 0 ? {} : { reason },
|
|
1565
|
+
refs: refs.length > 0 ? refs : first.refs ?? [],
|
|
1566
|
+
severity: severityOf(kind, problemSeverity(said.severity)),
|
|
1567
|
+
...first.reviewer === void 0 ? {} : { reviewer: first.reviewer }
|
|
1568
|
+
}
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
1571
|
+
const keptKey = (key) => kept.find((problem) => problem.keys.includes(key));
|
|
1572
|
+
const drops = Array.isArray(answer.dropped) ? answer.dropped : [];
|
|
1573
|
+
const ordered = [...drops.filter((drop) => Object(drop).why !== "duplicate"), ...drops.filter((drop) => Object(drop).why === "duplicate")];
|
|
1574
|
+
for (const drop of ordered) {
|
|
1575
|
+
const said = Object(drop);
|
|
1576
|
+
const key = said.key;
|
|
1577
|
+
if (typeof key !== "string" || !sources.has(key) || used.has(key)) continue;
|
|
1578
|
+
if (!DROP_REASONS.includes(said.why)) {
|
|
1579
|
+
notes.push(`the drop of ${key} gives no known reason, so ${key} is kept`);
|
|
1580
|
+
continue;
|
|
1581
|
+
}
|
|
1582
|
+
const why = said.why;
|
|
1583
|
+
const of = typeof said.of === "string" ? said.of : void 0;
|
|
1584
|
+
if (why === "duplicate") {
|
|
1585
|
+
const target = of === void 0 ? void 0 : keptKey(of);
|
|
1586
|
+
if (target === void 0 && (of === void 0 || !droppedKeys.has(of))) {
|
|
1587
|
+
notes.push(`${key} is called a duplicate of ${of ?? "nothing"}, which is no kept or dropped problem, so ${key} is kept`);
|
|
1588
|
+
continue;
|
|
1589
|
+
}
|
|
1590
|
+
if (target !== void 0) target.keys.push(key);
|
|
1591
|
+
}
|
|
1592
|
+
used.add(key);
|
|
1593
|
+
droppedKeys.add(key);
|
|
1594
|
+
const source = sources.get(key);
|
|
1595
|
+
const reason = text(said.reason, 1e3);
|
|
1596
|
+
dropped.push({ key, id: source.id, reviewers: finders(source), why, ...of === void 0 ? {} : { of }, ...reason === void 0 ? {} : { reason } });
|
|
1597
|
+
}
|
|
1598
|
+
const items = kept.map(({ entry, keys }) => {
|
|
1599
|
+
const reviewers = [...new Set(keys.flatMap((key) => finders(sources.get(key))))];
|
|
1600
|
+
return reviewers.length === 0 ? entry : { ...entry, foundBy: reviewers };
|
|
1601
|
+
});
|
|
1602
|
+
for (const [key, entry] of sources) {
|
|
1603
|
+
if (used.has(key)) continue;
|
|
1604
|
+
notes.push(`the answer neither keeps nor drops ${key} (${entry.id}), so it is kept as reported`);
|
|
1605
|
+
items.push({ ...entry, severity: severityOf(entry.kind) });
|
|
1606
|
+
}
|
|
1607
|
+
return { ok: true, items, dropped, notes };
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1438
1610
|
// src/runner/code-review-problems.ts
|
|
1439
1611
|
var EXCERPT_CONTEXT_LINES = 5;
|
|
1440
1612
|
var EXCERPT_LINE_MAX = 300;
|
|
1441
1613
|
var PROBLEMS_MAX = CODE_REVIEW_PROBLEMS_MAX;
|
|
1442
1614
|
var FILES_MAX = 2e3;
|
|
1443
1615
|
var TITLE_MAX = 300;
|
|
1444
|
-
|
|
1445
|
-
|
|
1616
|
+
var CONSOLIDATION_REASON_MAX = 200;
|
|
1617
|
+
function storable(text2) {
|
|
1618
|
+
return text2.replace(/\u0000/g, "").replace(/\p{Cs}/gu, "");
|
|
1446
1619
|
}
|
|
1447
|
-
function problemExcerpt(
|
|
1448
|
-
if (
|
|
1449
|
-
const lines = storable(
|
|
1620
|
+
function problemExcerpt(text2, line) {
|
|
1621
|
+
if (text2 === void 0 || line === void 0 || !Number.isInteger(line) || line < 1) return null;
|
|
1622
|
+
const lines = storable(text2).split(/\r\n|\r|\n/);
|
|
1450
1623
|
if (lines.at(-1) === "") lines.pop();
|
|
1451
1624
|
if (line > lines.length) return null;
|
|
1452
1625
|
const startLine = Math.max(1, line - EXCERPT_CONTEXT_LINES);
|
|
@@ -1469,13 +1642,14 @@ function reviewRecord(input) {
|
|
|
1469
1642
|
problems.push({
|
|
1470
1643
|
id: item.id,
|
|
1471
1644
|
kind: problemKind(entry.kind),
|
|
1472
|
-
title: titleOf(entry.title, item.id, input.clean ?? ((
|
|
1645
|
+
title: titleOf(entry.title, item.id, input.clean ?? ((text2) => text2)),
|
|
1473
1646
|
reason: item.reason ?? "",
|
|
1474
1647
|
path: place?.path ?? "",
|
|
1475
1648
|
line: place?.line ?? null,
|
|
1476
1649
|
inDiff: place?.inDiff === true,
|
|
1477
1650
|
excerpt: place === void 0 ? null : input.excerptOf(place.path, place.line),
|
|
1478
|
-
reviewer: entry.reviewer ?? ""
|
|
1651
|
+
reviewer: entry.reviewer ?? "",
|
|
1652
|
+
severity: entry.severity ?? null
|
|
1479
1653
|
});
|
|
1480
1654
|
}
|
|
1481
1655
|
const files = unreviewedFiles(input.changed, input.merged.reviewed);
|
|
@@ -1526,7 +1700,8 @@ function readStoredProblems(data) {
|
|
|
1526
1700
|
path: typeof row.path === "string" ? row.path : "",
|
|
1527
1701
|
line: typeof row.line === "number" && Number.isInteger(row.line) ? row.line : null,
|
|
1528
1702
|
commit: typeof row.commit === "string" ? row.commit : "",
|
|
1529
|
-
dismissalReason: typeof row.dismissalReason === "string" ? row.dismissalReason : null
|
|
1703
|
+
dismissalReason: typeof row.dismissalReason === "string" ? row.dismissalReason : null,
|
|
1704
|
+
severity: problemSeverity(row.severity) ?? null
|
|
1530
1705
|
}
|
|
1531
1706
|
];
|
|
1532
1707
|
});
|
|
@@ -1549,9 +1724,9 @@ async function readCodeReviewProblems(config, job, deps) {
|
|
|
1549
1724
|
var REVIEW_SKILL = "outerlayer-review";
|
|
1550
1725
|
var REVIEW_EFFORT = "high";
|
|
1551
1726
|
var MAX_DIFF_BYTES = 4 * 1024 * 1024;
|
|
1552
|
-
function withoutFrontMatter(
|
|
1553
|
-
const match = /^---\r?\n[\s\S]*?\r?\n---\r?\n/.exec(
|
|
1554
|
-
return match === null ?
|
|
1727
|
+
function withoutFrontMatter(text2) {
|
|
1728
|
+
const match = /^---\r?\n[\s\S]*?\r?\n---\r?\n/.exec(text2);
|
|
1729
|
+
return match === null ? text2 : text2.slice(match[0].length).trimStart();
|
|
1555
1730
|
}
|
|
1556
1731
|
function readReviewInstructions(root = resolvePackRoot()) {
|
|
1557
1732
|
const dir = join(root, "maintained", REVIEW_SKILL);
|
|
@@ -1561,14 +1736,17 @@ function readReviewInstructions(root = resolvePackRoot()) {
|
|
|
1561
1736
|
} catch {
|
|
1562
1737
|
return void 0;
|
|
1563
1738
|
}
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1739
|
+
const reference = (name) => {
|
|
1740
|
+
try {
|
|
1741
|
+
return readFileSync(join(dir, "references", name), "utf8");
|
|
1742
|
+
} catch {
|
|
1743
|
+
return void 0;
|
|
1744
|
+
}
|
|
1745
|
+
};
|
|
1746
|
+
const briefs = reference("territories.md");
|
|
1747
|
+
const consolidation = reference("consolidation.md");
|
|
1748
|
+
const sha256 = createHash("sha256").update(skill).update("\0").update(briefs ?? "").update("\0").update(consolidation ?? "").digest("hex");
|
|
1749
|
+
return { brief: withoutFrontMatter(skill), territories: briefs, consolidation, sha256 };
|
|
1572
1750
|
}
|
|
1573
1751
|
function reviewIsolation(config) {
|
|
1574
1752
|
const kind = builtinKind(config.hooks.provision);
|
|
@@ -1590,11 +1768,11 @@ This section comes from the factory host and overrides any other answer format a
|
|
|
1590
1768
|
Write your answer as JSON to \`${answer}\`: \`{"reviewed":["<changed file path>"],"previous":[{"id":"<id in previous.json>","verdict":"fixed"|"open","line":<its line in the commit, when open>}],"problems":[{"id":"<a short name>","kind":"bug"|"security"|"data"|"test"|"docs"|"comment","title":"<a short name>","reason":"<one to three sentences>","refs":[{"path":"<path relative to ${JUDGE_TREE}/>","line":<the line in the commit>}]}]}\`. Each problem is unique by its id in the answer, and names in \`refs\` the file and line it is about. \`reviewed\` lists each changed file you read in full, by its path in the repository. \`previous\` gives a verdict on each defect in \`previous.json\`, when the file exists. Never list a defect of \`previous.json\` in \`problems\`: the host keeps each one that is still open. \`kind\` is what the problem is about, and \`bug\` when none fits. A reason quotes the decisive line or names what is missing. An answer with no problems lists none.
|
|
1591
1769
|
`;
|
|
1592
1770
|
}
|
|
1593
|
-
function parseReviewAnswer(
|
|
1594
|
-
if (
|
|
1771
|
+
function parseReviewAnswer(text2) {
|
|
1772
|
+
if (text2 === void 0 || text2.trim() === "") return void 0;
|
|
1595
1773
|
let raw;
|
|
1596
1774
|
try {
|
|
1597
|
-
raw = JSON.parse(
|
|
1775
|
+
raw = JSON.parse(text2);
|
|
1598
1776
|
} catch {
|
|
1599
1777
|
return { ok: false, reason: "the reviewer's answer is not JSON" };
|
|
1600
1778
|
}
|
|
@@ -1620,7 +1798,7 @@ async function runReviewJob(input) {
|
|
|
1620
1798
|
const { runtime, log } = deps;
|
|
1621
1799
|
const tag = itemTag(job);
|
|
1622
1800
|
const scratch = join(jobDir2, "review-scratch");
|
|
1623
|
-
const cleanReason = (
|
|
1801
|
+
const cleanReason = (text2) => scrubReason(text2, config, void 0, jobDir2, CHECK_ITEM_REASON_MAX_LENGTH) ?? "";
|
|
1624
1802
|
const notRun = async (reason) => {
|
|
1625
1803
|
if (input.ending()) return { kind: "ended" };
|
|
1626
1804
|
const said = oneLineReason(cleanReason(reason)) ?? "the code review did not run";
|
|
@@ -1684,34 +1862,59 @@ async function runReviewJob(input) {
|
|
|
1684
1862
|
log.line(`${tag} code review of ${head.slice(0, 8)}: ${changed.length} changed ${changed.length === 1 ? "file" : "files"}, reviewers ${runs.map((run) => run.name).join(", ")}`);
|
|
1685
1863
|
const limitMinutes = config.checks?.timeLimitMinutes ?? DEFAULT_CHECK_TIME_LIMIT_MINUTES;
|
|
1686
1864
|
const minutes = `${limitMinutes} ${limitMinutes === 1 ? "minute" : "minutes"}`;
|
|
1687
|
-
const
|
|
1865
|
+
const reviewerRuns = runs.map((territory, index) => {
|
|
1866
|
+
const answerName = index === 0 ? "items.json" : `items-${territory.name}.json`;
|
|
1867
|
+
return { territory, answerName, logName: index === 0 ? "review.log" : `review-${territory.name}.log`, prompt: reviewAnswerProtocol(territoryBrief(instructions.brief, territory), `${JUDGE_DIR}/${answerName}`) };
|
|
1868
|
+
});
|
|
1869
|
+
const reviewed = await reviewSideBySide({ environment, files, tree: treeDir, runs: reviewerRuns, credential, limitMinutes, minutes, jobDir: jobDir2, deps, tag });
|
|
1688
1870
|
if (!reviewed.ok) return await notRun(reviewed.reason);
|
|
1689
1871
|
if (input.ending()) return { kind: "ended" };
|
|
1872
|
+
let ownTree = false;
|
|
1873
|
+
try {
|
|
1874
|
+
lstatSync(join(treeDir, "tree"));
|
|
1875
|
+
ownTree = true;
|
|
1876
|
+
} catch {
|
|
1877
|
+
}
|
|
1878
|
+
const changedPaths = new Set(changed.map((file) => file.path));
|
|
1879
|
+
const known = (raw) => {
|
|
1880
|
+
const written = treePath(raw, JUDGE_TREE);
|
|
1881
|
+
if (written === void 0) return false;
|
|
1882
|
+
const path = written.startsWith("tree/") && !ownTree ? written.slice("tree/".length) : written;
|
|
1883
|
+
return path !== "" && (changedPaths.has(path) || treeFileText(treeDir, path) !== void 0);
|
|
1884
|
+
};
|
|
1885
|
+
const shownLines = diffLines(diff);
|
|
1886
|
+
const inChange = (raw, line) => {
|
|
1887
|
+
const written = treePath(raw, JUDGE_TREE);
|
|
1888
|
+
const path = written !== void 0 && written.startsWith("tree/") && !ownTree ? written.slice("tree/".length) : written;
|
|
1889
|
+
if (path === void 0 || !changedPaths.has(path)) return false;
|
|
1890
|
+
return shownLines.has(path) ? lineInDiff(shownLines, path, line) : true;
|
|
1891
|
+
};
|
|
1690
1892
|
const answers = [];
|
|
1691
|
-
for (const { territory, end, answer } of reviewed.runs) {
|
|
1893
|
+
for (const { territory, end, answer } of reviewed.runs.map((run) => ({ ...run, answer: parseReviewAnswer(run.text) }))) {
|
|
1692
1894
|
if (answer?.ok === true) {
|
|
1693
|
-
|
|
1895
|
+
const guarded = dropNonProblems(answer.answer, known);
|
|
1896
|
+
for (const { id, why } of guarded.dropped) log.line(`${tag} the ${territory.name} review's entry ${JSON.stringify(id)} is no problem (${why}), so it is left out`);
|
|
1897
|
+
answers.push({ ...guarded.answer, items: guarded.answer.items.map((entry) => ({ ...entry, reviewer: territory.name })) });
|
|
1694
1898
|
if (!end.finished) log.line(`${tag} the ${territory.name} review stopped before it ended, so only what it found is kept: ${end.reason}`);
|
|
1695
1899
|
} else log.line(`${tag} the ${territory.name} review gave no answer: ${answer?.ok === false ? answer.reason : end.finished ? "it wrote no answer file" : end.reason}`);
|
|
1696
1900
|
}
|
|
1697
1901
|
if (answers.length === 0) {
|
|
1698
1902
|
const first = reviewed.runs[0];
|
|
1699
|
-
|
|
1903
|
+
const answer = parseReviewAnswer(first.text);
|
|
1904
|
+
return await notRun(answer?.ok === false ? answer.reason : first.end.finished ? "the review wrote no answer file" : first.end.reason);
|
|
1700
1905
|
}
|
|
1701
|
-
const
|
|
1906
|
+
const joined = mergeAnswers(answers);
|
|
1907
|
+
const { kept, fresh } = carriedProblems(joined, stored ?? []);
|
|
1908
|
+
const consolidated = await consolidate({ fresh, reviewers: answers.length, names: runs.map((run) => run.name) });
|
|
1909
|
+
if (input.ending()) return { kind: "ended" };
|
|
1910
|
+
const merged = { ...joined, items: [...kept, ...consolidated.items] };
|
|
1702
1911
|
const finder = await loadCitationFinder();
|
|
1703
|
-
let ownTree = false;
|
|
1704
|
-
try {
|
|
1705
|
-
lstatSync(join(treeDir, "tree"));
|
|
1706
|
-
ownTree = true;
|
|
1707
|
-
} catch {
|
|
1708
|
-
}
|
|
1709
1912
|
const place = (path, line) => {
|
|
1710
1913
|
if (treeFileText(treeDir, path) === void 0) return {};
|
|
1711
1914
|
const href = finder.testHref(repository, head, path, line ?? 1);
|
|
1712
1915
|
return href !== null && href.length <= CHECK_ITEM_HREF_MAX_LENGTH && /^https:\/\/\S+$/.test(href) ? { href } : {};
|
|
1713
1916
|
};
|
|
1714
|
-
const items = wholeItems({ answer: merged, commit: head, treeRoot: JUDGE_TREE, place, ownTree, patch: diff, clean: cleanReason });
|
|
1917
|
+
const items = wholeItems({ answer: merged, commit: head, treeRoot: JUDGE_TREE, place, ownTree, patch: diff, clean: cleanReason, reviewers: answers.length });
|
|
1715
1918
|
const unreviewed = unreviewedItem(changed, merged.reviewed, head);
|
|
1716
1919
|
const record2 = {
|
|
1717
1920
|
...reviewRecord({
|
|
@@ -1724,12 +1927,13 @@ async function runReviewJob(input) {
|
|
|
1724
1927
|
seconds: run.end.usage?.durationMs === void 0 ? run.seconds : run.end.usage.durationMs / 1e3,
|
|
1725
1928
|
...run.end.usage?.costUsd === void 0 ? {} : { costUsd: run.end.usage.costUsd },
|
|
1726
1929
|
// A reviewer that stopped early or wrote no answer proves nothing about a problem that it did not report.
|
|
1727
|
-
answered: run.
|
|
1930
|
+
answered: parseReviewAnswer(run.text)?.ok === true && run.end.finished
|
|
1728
1931
|
})),
|
|
1729
1932
|
excerptOf: (path, line) => problemExcerpt(treeFileText(treeDir, path), line),
|
|
1730
1933
|
clean: cleanReason
|
|
1731
1934
|
}),
|
|
1732
|
-
instructions: { cliVersion: deps.cliVersion, sha256: instructions.sha256 }
|
|
1935
|
+
instructions: { cliVersion: deps.cliVersion, sha256: instructions.sha256 },
|
|
1936
|
+
consolidation: consolidated.record
|
|
1733
1937
|
};
|
|
1734
1938
|
if (input.ending()) return { kind: "ended" };
|
|
1735
1939
|
const listed = unreviewed === void 0 ? items : [...items, unreviewed];
|
|
@@ -1743,6 +1947,44 @@ async function runReviewJob(input) {
|
|
|
1743
1947
|
await reportCodeReview(config, job, { result: "reviewed", reason: "reviewed", commit: head, problems, review: record2 }, deps);
|
|
1744
1948
|
log.line(`${tag} code review done: ${problems} ${problems === 1 ? "problem" : "problems"}`);
|
|
1745
1949
|
return { kind: "reviewed", problems };
|
|
1950
|
+
async function consolidate(input2) {
|
|
1951
|
+
const unchanged = (result2, reason) => {
|
|
1952
|
+
log.line(`${tag} the problems were not consolidated: ${reason}`);
|
|
1953
|
+
const items2 = input2.fresh.map((entry) => ({ ...entry, severity: severityOf(entry.kind) }));
|
|
1954
|
+
return { items: items2, record: { result: result2, reason: oneLineReason(cleanReason(reason))?.slice(0, CONSOLIDATION_REASON_MAX) ?? result2 } };
|
|
1955
|
+
};
|
|
1956
|
+
if (!shouldConsolidate(input2.reviewers, input2.fresh.length)) return unchanged("skipped", input2.fresh.length === 0 ? "no reviewer reported a new problem" : "one reviewer reported one problem");
|
|
1957
|
+
if (instructions.consolidation === void 0) return unchanged("skipped", `this CLI's ${REVIEW_SKILL} skill holds no consolidation instructions`);
|
|
1958
|
+
try {
|
|
1959
|
+
return await runPass(instructions.consolidation);
|
|
1960
|
+
} catch (err) {
|
|
1961
|
+
return unchanged("failed", `the consolidator could not be run: ${describeCallFailure(err)}`);
|
|
1962
|
+
}
|
|
1963
|
+
async function runPass(text2) {
|
|
1964
|
+
const answer = `${JUDGE_DIR}/${CONSOLIDATION_ANSWER}`;
|
|
1965
|
+
const run = await reviewSideBySide({
|
|
1966
|
+
environment,
|
|
1967
|
+
files: { ...files, [CONSOLIDATION_INPUT]: consolidationInput(input2.fresh, input2.names) },
|
|
1968
|
+
tree: treeDir,
|
|
1969
|
+
runs: [{ territory: { name: CONSOLIDATOR, text: "" }, answerName: CONSOLIDATION_ANSWER, logName: `review-${CONSOLIDATOR}.log`, prompt: consolidationProtocol(consolidationBrief(text2, instructions.brief), answer) }],
|
|
1970
|
+
credential,
|
|
1971
|
+
limitMinutes,
|
|
1972
|
+
minutes,
|
|
1973
|
+
jobDir: jobDir2,
|
|
1974
|
+
deps,
|
|
1975
|
+
tag
|
|
1976
|
+
});
|
|
1977
|
+
if (!run.ok) return unchanged("failed", run.reason);
|
|
1978
|
+
const { end, text: written } = run.runs[0];
|
|
1979
|
+
if (!end.finished) return unchanged("failed", end.reason);
|
|
1980
|
+
const read = readConsolidation(written, input2.fresh, known, inChange);
|
|
1981
|
+
if (!read.ok) return unchanged("failed", read.reason);
|
|
1982
|
+
for (const note of read.notes) log.line(`${tag} consolidation: ${note}`);
|
|
1983
|
+
for (const drop of read.dropped) log.line(`${tag} consolidation dropped ${JSON.stringify(drop.id)} (${drop.reviewers.join(", ") || "no reviewer"}): ${drop.why}${drop.of === void 0 ? "" : ` of ${drop.of}`}${drop.reason === void 0 ? "" : `: ${oneLineReason(cleanReason(drop.reason)) ?? ""}`}`);
|
|
1984
|
+
log.line(`${tag} consolidation kept ${read.items.length} of ${input2.fresh.length} new ${input2.fresh.length === 1 ? "problem" : "problems"}`);
|
|
1985
|
+
return { items: read.items, record: { result: "consolidated" } };
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1746
1988
|
}
|
|
1747
1989
|
}
|
|
1748
1990
|
function withCommit(items, commit, result) {
|
|
@@ -1756,13 +1998,12 @@ async function reviewSideBySide(input) {
|
|
|
1756
1998
|
} catch (err) {
|
|
1757
1999
|
return { ok: false, reason: `the review could not be prepared: ${describeCallFailure(err)}` };
|
|
1758
2000
|
}
|
|
1759
|
-
const started = input.runs.map((territory,
|
|
1760
|
-
const answerName = index === 0 ? "items.json" : `items-${territory.name}.json`;
|
|
2001
|
+
const started = input.runs.map(({ territory, prompt, answerName, logName }) => {
|
|
1761
2002
|
const answer = `${JUDGE_DIR}/${answerName}`;
|
|
1762
|
-
const command = judgeCommand({ brief:
|
|
2003
|
+
const command = judgeCommand({ brief: prompt, credential: input.credential, effort: REVIEW_EFFORT, answer }, deps.runtime.agents);
|
|
1763
2004
|
const began = now().getTime();
|
|
1764
2005
|
const run = { territory, answerName, began, seconds: void 0, outcome: void 0 };
|
|
1765
|
-
const settled = environment.run(command, { logPath: join(input.jobDir,
|
|
2006
|
+
const settled = environment.run(command, { logPath: join(input.jobDir, logName) }).then(
|
|
1766
2007
|
(result) => result,
|
|
1767
2008
|
(err) => err instanceof Error ? err : new Error(String(err))
|
|
1768
2009
|
);
|
|
@@ -1782,7 +2023,7 @@ async function reviewSideBySide(input) {
|
|
|
1782
2023
|
const answers = await Promise.all(
|
|
1783
2024
|
started.map(async ({ run }) => {
|
|
1784
2025
|
try {
|
|
1785
|
-
return
|
|
2026
|
+
return await environment.readItems(run.answerName);
|
|
1786
2027
|
} catch (err) {
|
|
1787
2028
|
deps.log.error(`${tag} the ${run.territory.name} review's answer could not be read: ${describeCallFailure(err)}`);
|
|
1788
2029
|
return void 0;
|
|
@@ -1799,7 +2040,7 @@ async function reviewSideBySide(input) {
|
|
|
1799
2040
|
const outcome = run.outcome;
|
|
1800
2041
|
if (outcome instanceof Error) deps.log.error(`${tag} the ${run.territory.name} review could not be run: ${describeCallFailure(outcome)}`);
|
|
1801
2042
|
const ran = outcome === void 0 ? { kind: "timeout" } : outcome instanceof Error ? { kind: "exited", status: 1, stdout: "", stderr: outcome.message } : { kind: "exited", status: outcome.status, stdout: outcome.stdout, stderr: outcome.stderr };
|
|
1802
|
-
return { territory: run.territory, end: readReviewerEnd(ran, input.minutes, deps.runtime.agents),
|
|
2043
|
+
return { territory: run.territory, end: readReviewerEnd(ran, input.minutes, deps.runtime.agents), text: answers[index], seconds: run.seconds ?? (now().getTime() - run.began) / 1e3 };
|
|
1803
2044
|
})
|
|
1804
2045
|
};
|
|
1805
2046
|
}
|
|
@@ -2434,7 +2675,7 @@ async function freeDiskFromItemDisks(state, readFree) {
|
|
|
2434
2675
|
}
|
|
2435
2676
|
async function freeDiskFromSavedStates(state, root, readFree) {
|
|
2436
2677
|
const dir = savedStatesDir(root);
|
|
2437
|
-
const records = readRecords(dir).filter((record2) => record2.complete);
|
|
2678
|
+
const records = readRecords(dir).filter((record2) => record2.complete && holdsHostDisk(record2));
|
|
2438
2679
|
if (records.length === 0) return readFree();
|
|
2439
2680
|
const log = logOf(state);
|
|
2440
2681
|
const minimum = state.config.housekeeping?.minFreeDisk ?? 0;
|
|
@@ -2461,11 +2702,11 @@ async function freeDiskFromSavedStates(state, root, readFree) {
|
|
|
2461
2702
|
return readFree();
|
|
2462
2703
|
}
|
|
2463
2704
|
function recordPendingUpdate(state, record2) {
|
|
2464
|
-
const
|
|
2465
|
-
if (state.updateRecord ===
|
|
2705
|
+
const text2 = record2 === void 0 ? "none" : JSON.stringify(record2);
|
|
2706
|
+
if (state.updateRecord === text2) return;
|
|
2466
2707
|
try {
|
|
2467
2708
|
writePendingUpdate(runnerDir(state.config.configPath), record2);
|
|
2468
|
-
state.updateRecord =
|
|
2709
|
+
state.updateRecord = text2;
|
|
2469
2710
|
reportRepeating(state, "the update-pending.json record", void 0);
|
|
2470
2711
|
} catch (err) {
|
|
2471
2712
|
const code = err.code;
|
|
@@ -3120,7 +3361,7 @@ var CLAIM_REFUSAL_CODES = new Set(
|
|
|
3120
3361
|
"pull_request_from_fork pull_request_on_default_branch pull_request_ambiguous pull_request_repository_not_connected repository_not_reachable branch_claimed_elsewhere".split(" ")
|
|
3121
3362
|
);
|
|
3122
3363
|
async function tryClaimAndStart(state, item, queue) {
|
|
3123
|
-
const { postJson: postJson2 } = await import('./work-cmd-
|
|
3364
|
+
const { postJson: postJson2 } = await import('./work-cmd-X55AAJG2.js');
|
|
3124
3365
|
const log = logOf(state);
|
|
3125
3366
|
const hostKey = await loadHostKey(state.config.configPath);
|
|
3126
3367
|
const claim = await retrySend(
|
|
@@ -4751,7 +4992,7 @@ async function startRunner(configPath, deps, startup) {
|
|
|
4751
4992
|
check: update.check ? () => update.check(configPath) : async () => {
|
|
4752
4993
|
const held = runnerAgents(deps.agents).flatMap((agent) => heldAgentCredential(agent.descriptor.id) ?? []);
|
|
4753
4994
|
const env = { ...process.env, ...Object.fromEntries(held.map((credential) => [credential.variable, credential.value])) };
|
|
4754
|
-
return (await import('./check-
|
|
4995
|
+
return (await import('./check-Z6GAY2C4.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl, env });
|
|
4755
4996
|
},
|
|
4756
4997
|
now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
|
|
4757
4998
|
log
|