@outerlayer/cli 0.41.0-next.20261117195646 → 0.41.0-next.20261118010146
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/{build-75I2U74U.js → build-IY6V7WPQ.js} +2 -2
- package/dist/{build-disk-Z5YFT47Z.js → build-disk-NUH6XJI5.js} +2 -2
- package/dist/build-info.json +1 -1
- package/dist/{builder-NNNVIN4P.js → builder-2VPG6AQO.js} +1 -1
- package/dist/{caller-H3KRGMJH.js → caller-NFJUALRD.js} +4 -4
- package/dist/{check-KFQCKXHZ.js → check-XEFPJ5QV.js} +13 -13
- package/dist/{chunk-G4B473J5.js → chunk-2X3FX53G.js} +1 -1
- package/dist/{chunk-VATN55FQ.js → chunk-6USAAMGR.js} +1 -1
- package/dist/{chunk-V5MR6BWR.js → chunk-ARJLRXR6.js} +12 -195
- package/dist/{chunk-XNB2VFZI.js → chunk-DFTA22YA.js} +1 -1
- package/dist/{chunk-NCZNYMTB.js → chunk-H6V5NFPW.js} +2 -2
- package/dist/{chunk-IOSONR7N.js → chunk-JD5VDXQO.js} +1 -1
- package/dist/{chunk-A2AFTKMN.js → chunk-JYSJOUJE.js} +3 -3
- package/dist/{chunk-YLDCYJRP.js → chunk-M6I3CVUJ.js} +4 -4
- package/dist/{chunk-X7YMKZ7A.js → chunk-MKSCYAZU.js} +4 -4
- package/dist/{chunk-PMJGT7SQ.js → chunk-RSRFNL64.js} +1 -1
- package/dist/{chunk-UTZULAN6.js → chunk-SDOM7OMG.js} +4 -4
- package/dist/{chunk-VYF5BILX.js → chunk-SR4532T7.js} +2 -2
- package/dist/{chunk-YXUSSZAE.js → chunk-UU762HQX.js} +22 -1
- package/dist/{chunk-R6ME6MWL.js → chunk-VZT5SLZJ.js} +2 -2
- package/dist/{chunk-SE5ZVVDJ.js → chunk-W2BADNEW.js} +2 -2
- package/dist/{chunk-PLVLC7SU.js → chunk-Y5IJTSFC.js} +1 -1
- package/dist/{chunk-RVUOSR2D.js → chunk-YP6FUS5X.js} +343 -13
- package/dist/{chunk-BO5TMIRG.js → chunk-YPA5KKVR.js} +1 -1
- package/dist/{chunk-YXKZGVUL.js → chunk-ZFTAOXJE.js} +8 -5
- package/dist/{cli-NEZV54LS.js → cli-NV77HUIC.js} +50 -50
- package/dist/{command-H2R6EFUH.js → command-GUK5MRNN.js} +12 -12
- package/dist/{config-DIUO2GQY.js → config-6GDB7WSI.js} +3 -3
- package/dist/{container-start-B7BACAFN.js → container-start-IHBVFJVA.js} +11 -11
- package/dist/{docker-QQEZWBI3.js → docker-NOVLMJ63.js} +1 -1
- package/dist/{doctor-Y7CIJZX5.js → doctor-XE4WJ3EG.js} +11 -11
- package/dist/{find-unit-OAJKRZI2.js → find-unit-BSJIDCK6.js} +4 -4
- package/dist/{host-checks-GWUYRJXA.js → host-checks-ZSZAWHID.js} +9 -9
- package/dist/index.js +1 -1
- package/dist/{init-4MF5M74X.js → init-EGSEHSNO.js} +9 -9
- package/dist/{init-BEMNWKES.js → init-PXP2NCIG.js} +9 -9
- package/dist/{init-agent-6E3FAOEZ.js → init-agent-WWHNWKLZ.js} +9 -9
- package/dist/{init-cmd-R5ICA2LP.js → init-cmd-R75FE7AC.js} +2 -2
- package/dist/{install-cmd-HI5OQW5J.js → install-cmd-CQOUTGDI.js} +4 -4
- package/dist/{launch-agent-JLANNHFC.js → launch-agent-IGPMAMP3.js} +5 -5
- package/dist/{loop-PP7QFT3F.js → loop-YHRUH5FT.js} +13 -13
- package/dist/{machine-JHWQCYS3.js → machine-PDG5O7CC.js} +9 -9
- package/dist/{runner-env-FU6EWMWW.js → runner-env-C7WRAXKE.js} +5 -5
- package/dist/{runner-identity-PUW27LAT.js → runner-identity-UIGOYBCF.js} +1 -1
- package/dist/{runner-key-5G2AJD57.js → runner-key-R5HHVY2P.js} +9 -9
- package/dist/{setup-cmd-OZS4QOPI.js → setup-cmd-JAXSLBJY.js} +5 -2
- package/dist/{setup-wiring-G2RLSBQ6.js → setup-wiring-SOIFFGA2.js} +11 -11
- package/dist/{status-T6WDUAI4.js → status-OIYTNHPK.js} +9 -9
- package/dist/{update-steps-PU34FN7N.js → update-steps-C5VUAFC5.js} +10 -10
- package/dist/{work-claim-cmd-7TR6LNIY.js → work-claim-cmd-TIO6T5KJ.js} +3 -3
- package/dist/{work-proofs-cmd-PAJSCMJ2.js → work-proofs-cmd-XPQGYBKY.js} +2 -2
- package/dist/{work-proofs-record-A4NZTAME.js → work-proofs-record-N3II3BAE.js} +2 -2
- package/package.json +1 -1
- package/skill-pack/maintained/outerlayer-build/references/criteria-judge.md +13 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { keyRunnerFactory, RunnerConfigError } from './chunk-
|
|
3
|
+
import { keyRunnerFactory, RunnerConfigError } from './chunk-SR4532T7.js';
|
|
4
4
|
import { orgHomeDir } from './chunk-D5TZYUGZ.js';
|
|
5
5
|
|
|
6
6
|
createRequire(import.meta.url);
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { MAX_TEST_FILE_BYTES, itemsSentence, criteriaOf, hostItemsOf, loadCitationFinder, testFileMatcher, planCriteria, wholeItems, judgeGroups, failedItems, inCriteriaOrder, testsByCriterion, oneLineReason, criterionInputs, parseJudgeAnswer, judgedItems } from './chunk-
|
|
3
|
+
import { MAX_TEST_FILE_BYTES, itemsSentence, criteriaOf, hostItemsOf, loadCitationFinder, testFileMatcher, planCriteria, wholeItems, judgeGroups, failedItems, inCriteriaOrder, testsByCriterion, oneLineReason, criterionInputs, parseJudgeAnswer, judgedItems, hostCheckOf } from './chunk-ZFTAOXJE.js';
|
|
4
4
|
import { RUNNER_PROTOCOL } from './chunk-QDJBEQCE.js';
|
|
5
5
|
import { zodProblem } from './chunk-I3LTIAOR.js';
|
|
6
6
|
import { sha256OfFile, downloadPinned, VoiceDownloadError } from './chunk-2PGI6RDE.js';
|
|
7
7
|
import { upgradedStarterText } from './chunk-FMOGX7RR.js';
|
|
8
8
|
import { runnerImageVersion } from './chunk-3HH2AQKF.js';
|
|
9
|
-
import { hasStoredCredential, storedCredentialVariables, storeAgentCredential, replaceFile, isAgentName, credentialFromStdin } from './chunk-
|
|
9
|
+
import { hasStoredCredential, storedCredentialVariables, storeAgentCredential, replaceFile, isAgentName, credentialFromStdin } from './chunk-RSRFNL64.js';
|
|
10
10
|
import { describeCallFailure, shortClaim, retrySend, commandWithShim, logStamp, createRunnerLog, formatDuration, removeKeptContext, formatClock, stageGovernedContext, keptContextTree, removeStagedContext, WORKFLOW_PERMISSION_REASON, refusalCode, SELF_GOVERNED, resolveGoverningSource, prefetchGovernedContext, controlPlaneTokenFailure, keepStagedContext, pinnedSourceOf, shimScript } from './chunk-MYFC3HKP.js';
|
|
11
11
|
import { HELPER_PATH, HELPER_RECORD, DOCKERD_LOG } from './chunk-QFGKTIPS.js';
|
|
12
12
|
import { writeDockerClientConfig } from './chunk-H2NTP6OM.js';
|
|
13
13
|
import { senderPidfile } from './chunk-YNZVC7XT.js';
|
|
14
14
|
import { installScrubContext } from './chunk-QPC6OKD2.js';
|
|
15
15
|
import { readsJobState, READ_JOB_STATE_FORMATS, jobStateFormatOf } from './chunk-B4XB5QFD.js';
|
|
16
|
-
import { claimCalls, spoolHomeFor, itemCalls, claimItem, leftByRunnerKey, configForJob } from './chunk-
|
|
16
|
+
import { claimCalls, spoolHomeFor, itemCalls, claimItem, leftByRunnerKey, configForJob } from './chunk-Y5IJTSFC.js';
|
|
17
17
|
import { receiveFiles } from './chunk-NN33FYXG.js';
|
|
18
|
-
import { readDefaultBranchFiles, readDefaultBranchHead, buildRepositoryImage, readRepositoryRecipe, fetchCommit, readBranchHead, diffBetween, prepareImageBuild, KEY_PREFIX, TAG_HOST, SHARED_OWNER, SHARED_NAME, universalBase, metadataFromLabels, writeRecord } from './chunk-
|
|
18
|
+
import { readDefaultBranchFiles, readDefaultBranchHead, buildRepositoryImage, readRepositoryRecipe, fetchCommit, readBranchHead, diffBetween, prepareImageBuild, KEY_PREFIX, TAG_HOST, SHARED_OWNER, SHARED_NAME, universalBase, metadataFromLabels, writeRecord } from './chunk-6USAAMGR.js';
|
|
19
19
|
import { FETCHED_DIR, toolsDockerfile, FETCHED_FFMPEG, FETCHED_GH, FETCHED_TINI, FETCHED_HEADLESS_SHELL, FETCHED_PLAYWRIGHT_FFMPEG, FETCHED_VOICE_DIR } from './chunk-FD42O5SH.js';
|
|
20
20
|
import { isSameProcess, startTimeOf } from './chunk-JBJTC3UU.js';
|
|
21
21
|
import { currentCliBuild } from './chunk-OGFGZQA3.js';
|
|
@@ -23,9 +23,9 @@ import { vmExecArgs, runExec, execCapture, waitForAgent } from './chunk-NEOM73RW
|
|
|
23
23
|
import { socketPathProblem, vsockLinks, linkVsockSockets, GUEST_CID, LEASE_LINK } from './chunk-WOQOZCZZ.js';
|
|
24
24
|
import { postJson, getJson, WorkCommandError, isSignatureRefusal } from './chunk-YLDHHHBJ.js';
|
|
25
25
|
import { sanitizeTerminal, planArtifactUpload } from './chunk-WNFITHNX.js';
|
|
26
|
-
import { keyRunnerFactory, runnerCredentialProblem, builtinKind, readOnlyOption, optionalEgress, readsOnly, isBuiltinContainer, isBuiltinVm, isBuiltinSandbox, egressSummary, DEFAULT_WORKSPACE_KEEP_DAYS, readOnlyRemoteOf, DEFAULT_CHECK_TIME_LIMIT_MINUTES, DEFAULT_SETUP_MINUTES, allowHostProblem, systemClock, emptyEgressCounts, hostAllowed, sandboxTimeLimitMinutes, networkOf, imageBuildOf, machineSizeOf, sandboxSizeOf, DEFAULT_SAVED_STATE_MAX_BYTES } from './chunk-
|
|
27
|
-
import { formatBytes, volumeBytes, allocatedBytes, DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK, freeBytes } from './chunk-
|
|
28
|
-
import { said, NETWORK_HELPER_MEMORY, firstLine, JUDGE_MAX_TURNS, writeJobFile, readJobFile, spawnRun, RUNNER_LABEL, BUILD_LABEL, createDockerHost, builderSpec, childEnvironment, containerExecArgs, readDu, JUDGE_DIR, JUDGE_ITEMS, answerFileName, hashJudgeProgram, NETWORK_READY_FILE, MAX_ITEMS_BYTES, MAX_REPORT_BYTES, JUDGE_REPORT, judgeProgram, withAnswerProtocol, JUDGE_TREE, runnerLabelValue, parseSize, readJobFileChecked, networkHelperName, prepareRunArgs, containerRunArgs, NODE, JUDGE_HOME, judgeCommand, WORKSPACE_LABEL, homeCopyRunArgs, networkHelperRunArgs, identityScript, identityArgs, parseIdentity, mountableHome, homeCopyScript, homeCopyArgs, COMMAND_DIR, identityRunArgs, judgeProgramRecord, SAVED_STATE_LABEL } from './chunk-
|
|
26
|
+
import { keyRunnerFactory, runnerCredentialProblem, builtinKind, readOnlyOption, optionalEgress, readsOnly, isBuiltinContainer, isBuiltinVm, isBuiltinSandbox, egressSummary, DEFAULT_WORKSPACE_KEEP_DAYS, readOnlyRemoteOf, DEFAULT_CHECK_TIME_LIMIT_MINUTES, DEFAULT_SETUP_MINUTES, allowHostProblem, systemClock, emptyEgressCounts, hostAllowed, sandboxTimeLimitMinutes, networkOf, imageBuildOf, machineSizeOf, sandboxSizeOf, DEFAULT_SAVED_STATE_MAX_BYTES } from './chunk-SR4532T7.js';
|
|
27
|
+
import { formatBytes, volumeBytes, allocatedBytes, DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK, freeBytes } from './chunk-JD5VDXQO.js';
|
|
28
|
+
import { said, NETWORK_HELPER_MEMORY, firstLine, JUDGE_MAX_TURNS, writeJobFile, readJobFile, spawnRun, RUNNER_LABEL, BUILD_LABEL, createDockerHost, builderSpec, childEnvironment, containerExecArgs, readDu, JUDGE_DIR, JUDGE_ITEMS, answerFileName, hashJudgeProgram, NETWORK_READY_FILE, MAX_ITEMS_BYTES, MAX_REPORT_BYTES, JUDGE_REPORT, judgeProgram, withAnswerProtocol, JUDGE_TREE, runnerLabelValue, parseSize, readJobFileChecked, networkHelperName, prepareRunArgs, containerRunArgs, NODE, JUDGE_HOME, judgeCommand, WORKSPACE_LABEL, homeCopyRunArgs, networkHelperRunArgs, identityScript, identityArgs, parseIdentity, mountableHome, homeCopyScript, homeCopyArgs, COMMAND_DIR, identityRunArgs, judgeProgramRecord, SAVED_STATE_LABEL } from './chunk-UU762HQX.js';
|
|
29
29
|
import { universalImagePending, writeSanitizedRecipe, classifyProperties, RecipeError, DOCKER_FEATURE } from './chunk-EYD5HOQ7.js';
|
|
30
30
|
import { sharedSkillNames, skillConflictMessage } from './chunk-QKVOUI56.js';
|
|
31
31
|
import { readCloudConfig } from './chunk-HWVMRETT.js';
|
|
@@ -42,7 +42,7 @@ import { MAINTAINED_SKILLS } from './chunk-VSBG7MMU.js';
|
|
|
42
42
|
import { resolveVersion } from './chunk-RA3O54FC.js';
|
|
43
43
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
44
44
|
import { scrubText, MIN_SCRUBBED_LITERAL, setCustomScrubbers, setLocalIdentity, setRepoRoot, forkFor, scrubDeep } from './chunk-KTZOD7A3.js';
|
|
45
|
-
import { CheckItemsSchema, CODE_REVIEW_NAME, CRITERIA_JUDGE_NAME,
|
|
45
|
+
import { UNREVIEWED_FILES_ITEM_ID, CheckItemsSchema, CODE_REVIEW_NAME, CRITERIA_JUDGE_NAME, CHECK_ITEM_REASON_MAX_LENGTH, JUDGE_NOT_RUN_ITEM_ID, CHECK_ITEM_HREF_MAX_LENGTH, downconvertSession } from './chunk-37WA2LQC.js';
|
|
46
46
|
import { randomUUID, createHash, randomBytes } from 'crypto';
|
|
47
47
|
import { rmSync, appendFileSync, mkdirSync, existsSync, readFileSync, mkdtempSync, statSync, writeFileSync, readdirSync, accessSync, constants, openSync, closeSync, lstatSync, chmodSync, renameSync, rmdirSync, createReadStream, readSync, unlinkSync, realpathSync, writeSync, truncateSync, cpSync, copyFileSync, fstatSync, createWriteStream, linkSync } from 'fs';
|
|
48
48
|
import { join, dirname, isAbsolute, delimiter, basename, sep, relative, resolve } from 'path';
|
|
@@ -9742,6 +9742,250 @@ function readJudgeReply(run, minutes, agents = defaultAgents(), job) {
|
|
|
9742
9742
|
return { kind: "answered", verdict, unmet: new Set(lines.flatMap((line2) => UNMET_LINE.exec(line2)?.[1] ?? [])), ...usage };
|
|
9743
9743
|
}
|
|
9744
9744
|
|
|
9745
|
+
// src/runner/code-review-plan.ts
|
|
9746
|
+
var SMALL_CHANGE_LINES = 40;
|
|
9747
|
+
var LARGE_CHANGE_LINES = 800;
|
|
9748
|
+
var GENERATED = /(^|\/)(openapi\.ya?ml|gateway-types\.ts|yarn\.lock|package-lock\.json|pnpm-lock\.yaml)$|\.golden$|\.snap$|(^|\/)generated\/|(^|\/)db-types\//;
|
|
9749
|
+
var FLOOR = /\.sql$|(^|\/)migrations\/|auth|secret|permission|webhook|token|(^|\/)rls/i;
|
|
9750
|
+
function markdownSection(text2, heading) {
|
|
9751
|
+
const lines = text2.split("\n");
|
|
9752
|
+
const start = lines.findIndex((line2) => line2.trim() === `## ${heading}`);
|
|
9753
|
+
if (start === -1) return void 0;
|
|
9754
|
+
const end = lines.findIndex((line2, index) => index > start && line2.startsWith("## "));
|
|
9755
|
+
const body = lines.slice(start + 1, end === -1 ? void 0 : end).join("\n").trim();
|
|
9756
|
+
return body === "" ? void 0 : body;
|
|
9757
|
+
}
|
|
9758
|
+
function splitDiff(patch) {
|
|
9759
|
+
const parts = [];
|
|
9760
|
+
const starts = [...patch.matchAll(/^diff --git /gm)].map((match) => match.index);
|
|
9761
|
+
for (const [index, start] of starts.entries()) {
|
|
9762
|
+
const text2 = patch.slice(start, starts[index + 1] ?? patch.length);
|
|
9763
|
+
const path = /^diff --git a\/\S+ b\/(\S+)/.exec(text2)?.[1] ?? "?";
|
|
9764
|
+
let added = 0;
|
|
9765
|
+
let removed = 0;
|
|
9766
|
+
for (const line2 of text2.split("\n")) {
|
|
9767
|
+
if (line2.startsWith("+") && !line2.startsWith("+++")) added += 1;
|
|
9768
|
+
else if (line2.startsWith("-") && !line2.startsWith("---")) removed += 1;
|
|
9769
|
+
}
|
|
9770
|
+
parts.push({ path, text: text2, added, removed });
|
|
9771
|
+
}
|
|
9772
|
+
return parts;
|
|
9773
|
+
}
|
|
9774
|
+
function reviewFiles(patch) {
|
|
9775
|
+
const files = { "diff.patch": patch };
|
|
9776
|
+
const changed = [];
|
|
9777
|
+
const index = ["# Changed files", "", "| File | Added | Removed | Its part of the change |", "|---|---|---|---|"];
|
|
9778
|
+
for (const [position, part] of splitDiff(patch).entries()) {
|
|
9779
|
+
const name = `diff-${String(position + 1).padStart(3, "0")}.patch`;
|
|
9780
|
+
const generated = GENERATED.test(part.path);
|
|
9781
|
+
files[name] = part.text;
|
|
9782
|
+
changed.push({ path: part.path, added: part.added, removed: part.removed, name, generated });
|
|
9783
|
+
index.push(`| \`${part.path.replace(/[`|]/g, "_")}\` | ${part.added} | ${part.removed} | \`${name}\`${generated ? " (generated: skim it)" : ""} |`);
|
|
9784
|
+
}
|
|
9785
|
+
files["files.md"] = `${index.join("\n")}
|
|
9786
|
+
`;
|
|
9787
|
+
return { files, changed };
|
|
9788
|
+
}
|
|
9789
|
+
function territories(changed, briefs) {
|
|
9790
|
+
const lines = changed.filter((file) => !file.generated).reduce((sum, file) => sum + file.added + file.removed, 0);
|
|
9791
|
+
const generalist = { name: "generalist", text: "Review the full change with no restriction, and favor the seams no other reviewer names as its own." };
|
|
9792
|
+
const full = lines > LARGE_CHANGE_LINES || changed.some((file) => FLOOR.test(file.path));
|
|
9793
|
+
if (!full && lines < SMALL_CHANGE_LINES) return [generalist];
|
|
9794
|
+
const names = [
|
|
9795
|
+
["contracts", "Contracts reviewer"],
|
|
9796
|
+
["test-strength", "Test-strength reviewer"]
|
|
9797
|
+
];
|
|
9798
|
+
if (full) names.push(["security", "Security reviewer"], ["failure-path", "Failure-path reviewer"]);
|
|
9799
|
+
const focused = names.flatMap(([name, heading]) => {
|
|
9800
|
+
const text2 = briefs === void 0 ? void 0 : markdownSection(briefs, heading);
|
|
9801
|
+
return text2 === void 0 ? [] : [{ name, text: text2 }];
|
|
9802
|
+
});
|
|
9803
|
+
return [generalist, ...focused];
|
|
9804
|
+
}
|
|
9805
|
+
function territoryBrief(brief, territory) {
|
|
9806
|
+
return `${brief.trimEnd()}
|
|
9807
|
+
|
|
9808
|
+
## Your territory
|
|
9809
|
+
|
|
9810
|
+
${territory.text}
|
|
9811
|
+
`;
|
|
9812
|
+
}
|
|
9813
|
+
function issueText(workItem, criteria) {
|
|
9814
|
+
const issue = Object(Object(workItem).issue);
|
|
9815
|
+
const title = Object(workItem).title;
|
|
9816
|
+
const parts = [];
|
|
9817
|
+
if (typeof title === "string" && title.trim() !== "") parts.push(`# ${title.trim()}`);
|
|
9818
|
+
if (typeof issue.body === "string" && issue.body.trim() !== "") parts.push(issue.body.trim());
|
|
9819
|
+
if (criteria !== void 0 && criteria.length > 0) parts.push(["## Recorded criteria", "", ...criteria.map((criterion) => `- \`${criterion.id}\` ${criterion.text}`)].join("\n"));
|
|
9820
|
+
return parts.length === 0 ? void 0 : `${parts.join("\n\n")}
|
|
9821
|
+
`;
|
|
9822
|
+
}
|
|
9823
|
+
function storedProblemsText(problems) {
|
|
9824
|
+
const defects = problems.filter((problem) => problem.status === "open" || problem.status === "with_agent");
|
|
9825
|
+
const dismissed = problems.filter((problem) => problem.status === "not_a_problem");
|
|
9826
|
+
if (defects.length === 0 && dismissed.length === 0) return void 0;
|
|
9827
|
+
const place = (problem) => ({ path: problem.path, ...problem.line === null ? {} : { line: problem.line } });
|
|
9828
|
+
const body = {
|
|
9829
|
+
commit: defects[0]?.commit ?? null,
|
|
9830
|
+
defects: defects.map((problem) => ({ id: problem.id, ...problem.reason === "" ? {} : { reason: problem.reason }, refs: problem.path === "" ? [] : [place(problem)] })),
|
|
9831
|
+
dismissed: dismissed.map((problem) => ({ id: problem.id, ...problem.title === "" ? {} : { title: problem.title }, ...place(problem), reason: problem.dismissalReason }))
|
|
9832
|
+
};
|
|
9833
|
+
return `${JSON.stringify(body, null, 2)}
|
|
9834
|
+
`;
|
|
9835
|
+
}
|
|
9836
|
+
function mergeAnswers(answers) {
|
|
9837
|
+
const items = [];
|
|
9838
|
+
const earlier = /* @__PURE__ */ new Map();
|
|
9839
|
+
const keyOf2 = (entry) => {
|
|
9840
|
+
const place = entry.refs?.[0];
|
|
9841
|
+
return [entry.id, entry.result, place?.path ?? ""].join("\0");
|
|
9842
|
+
};
|
|
9843
|
+
for (const answer of answers) {
|
|
9844
|
+
const own = [];
|
|
9845
|
+
for (const entry of answer.items) {
|
|
9846
|
+
const held3 = earlier.get(keyOf2(entry));
|
|
9847
|
+
if (held3 === void 0) {
|
|
9848
|
+
const kept = { ...entry, ...entry.reviewer === void 0 ? {} : { foundBy: [entry.reviewer] } };
|
|
9849
|
+
own.push([keyOf2(entry), kept]);
|
|
9850
|
+
items.push(kept);
|
|
9851
|
+
continue;
|
|
9852
|
+
}
|
|
9853
|
+
if (entry.reviewer !== void 0 && !held3.foundBy?.includes(entry.reviewer)) held3.foundBy = [...held3.foundBy ?? [], entry.reviewer];
|
|
9854
|
+
}
|
|
9855
|
+
for (const [key, entry] of own) if (!earlier.has(key)) earlier.set(key, entry);
|
|
9856
|
+
}
|
|
9857
|
+
const lists = answers.flatMap((answer) => answer.reviewed === void 0 ? [] : [answer.reviewed]);
|
|
9858
|
+
const reviewed = lists.length === 0 ? void 0 : [...new Set(lists.flat())];
|
|
9859
|
+
const verdicts = /* @__PURE__ */ new Map();
|
|
9860
|
+
for (const answer of answers) {
|
|
9861
|
+
for (const { id, verdict, line: line2 } of answer.previous ?? []) {
|
|
9862
|
+
const held3 = verdicts.get(id);
|
|
9863
|
+
if (held3?.verdict !== "open") verdicts.set(id, verdict === "open" && line2 !== void 0 ? { verdict, line: line2 } : { verdict });
|
|
9864
|
+
else if (verdict === "open" && held3.line === void 0 && line2 !== void 0) held3.line = line2;
|
|
9865
|
+
}
|
|
9866
|
+
}
|
|
9867
|
+
const previous = answers.some((answer) => answer.previous !== void 0) ? [...verdicts].map(([id, said3]) => ({ id, ...said3 })) : void 0;
|
|
9868
|
+
const failed2 = answers.some((answer) => answer.result === "fail") || items.some((entry) => entry.result === "fail");
|
|
9869
|
+
const said2 = answers.filter((answer) => answer.result !== void 0);
|
|
9870
|
+
const result = failed2 ? "fail" : said2.length > 0 && said2.every((answer) => answer.result === "pass") ? "pass" : void 0;
|
|
9871
|
+
return { ...result === void 0 ? {} : { result }, items, ...reviewed === void 0 ? {} : { reviewed }, ...previous === void 0 ? {} : { previous } };
|
|
9872
|
+
}
|
|
9873
|
+
function carriedProblems(merged, stored) {
|
|
9874
|
+
const verdicts = new Map((merged.previous ?? []).map((entry) => [entry.id, entry]));
|
|
9875
|
+
const kept = [];
|
|
9876
|
+
const decided = /* @__PURE__ */ new Set();
|
|
9877
|
+
for (const problem of stored) {
|
|
9878
|
+
if (problem.status === "fixed" || decided.has(problem.id)) continue;
|
|
9879
|
+
decided.add(problem.id);
|
|
9880
|
+
const said2 = verdicts.get(problem.id);
|
|
9881
|
+
if (problem.status === "not_a_problem" || said2?.verdict === "fixed") continue;
|
|
9882
|
+
const line2 = said2?.line ?? problem.line ?? void 0;
|
|
9883
|
+
kept.push({
|
|
9884
|
+
id: problem.id,
|
|
9885
|
+
result: "fail",
|
|
9886
|
+
kind: problem.kind,
|
|
9887
|
+
...problem.title === "" ? {} : { title: problem.title },
|
|
9888
|
+
...problem.reason === "" ? {} : { reason: problem.reason },
|
|
9889
|
+
...problem.path === "" ? {} : { refs: [{ path: problem.path, ...line2 === void 0 ? {} : { line: line2 } }] },
|
|
9890
|
+
...problem.severity === null ? {} : { severity: problem.severity }
|
|
9891
|
+
});
|
|
9892
|
+
}
|
|
9893
|
+
return { kept, fresh: merged.items.filter((entry) => !decided.has(entry.id)) };
|
|
9894
|
+
}
|
|
9895
|
+
function dropNonProblems(answer, known) {
|
|
9896
|
+
const dropped = [];
|
|
9897
|
+
const items = answer.items.filter((entry) => {
|
|
9898
|
+
const why = (entry.refs ?? []).length === 0 ? "no place" : (entry.reason ?? "").trim() === "" ? "no reason" : entry.refs.some((ref) => known(ref.path)) ? void 0 : "unknown file";
|
|
9899
|
+
if (why !== void 0) dropped.push({ id: entry.id, why });
|
|
9900
|
+
return why === void 0;
|
|
9901
|
+
});
|
|
9902
|
+
return { answer: { ...answer, items }, dropped };
|
|
9903
|
+
}
|
|
9904
|
+
function unreviewedFiles(changed, reviewed) {
|
|
9905
|
+
if (reviewed === void 0) return void 0;
|
|
9906
|
+
const read = [...new Set(reviewed.map((path) => path.replace(/^\/+/, "").replace(/^outerlayer\/judge\/tree\//, "")))];
|
|
9907
|
+
const counted = changed.filter((file) => !file.generated && file.path !== "?");
|
|
9908
|
+
const seen = new Set(read);
|
|
9909
|
+
return { read, missed: counted.filter((file) => !seen.has(file.path)).map((file) => file.path), counted: counted.length };
|
|
9910
|
+
}
|
|
9911
|
+
function unreviewedItem(changed, reviewed, commit) {
|
|
9912
|
+
const files = unreviewedFiles(changed, reviewed);
|
|
9913
|
+
if (files === void 0 || files.missed.length === 0) return void 0;
|
|
9914
|
+
const { missed } = files;
|
|
9915
|
+
const room = CHECK_ITEM_REASON_MAX_LENGTH - 40;
|
|
9916
|
+
let reason = `${missed.length} of ${files.counted} changed files were not reviewed: `;
|
|
9917
|
+
let listed = 0;
|
|
9918
|
+
for (const path of missed) {
|
|
9919
|
+
const next = `${listed === 0 ? "" : ", "}${path}`;
|
|
9920
|
+
if (reason.length + next.length > room) break;
|
|
9921
|
+
reason += next;
|
|
9922
|
+
listed += 1;
|
|
9923
|
+
}
|
|
9924
|
+
if (listed < missed.length) reason += ` and ${missed.length - listed} more`;
|
|
9925
|
+
return { id: UNREVIEWED_FILES_ITEM_ID, result: "skipped", commit, reason: `${reason}.` };
|
|
9926
|
+
}
|
|
9927
|
+
|
|
9928
|
+
// src/runner/judge-material.ts
|
|
9929
|
+
var MAX_MATERIAL_BYTES = 256 * 1024;
|
|
9930
|
+
var MAX_PULL_REQUESTS = 5;
|
|
9931
|
+
function cutMaterial(text2, max = MAX_MATERIAL_BYTES) {
|
|
9932
|
+
const bytes = Buffer.from(text2, "utf8");
|
|
9933
|
+
if (bytes.length <= max) return text2;
|
|
9934
|
+
return `${bytes.subarray(0, max).toString("utf8").replace(/�+$/, "")}
|
|
9935
|
+
[the text was cut at ${max} bytes]
|
|
9936
|
+
`;
|
|
9937
|
+
}
|
|
9938
|
+
function issueMaterial(workItem, criteria) {
|
|
9939
|
+
return issueText(workItem, void 0) === void 0 ? void 0 : issueText(workItem, criteria);
|
|
9940
|
+
}
|
|
9941
|
+
function linkedPullRequests(workItem) {
|
|
9942
|
+
const linked = Object(workItem).pullRequests;
|
|
9943
|
+
if (!Array.isArray(linked)) return [];
|
|
9944
|
+
const seen = /* @__PURE__ */ new Set();
|
|
9945
|
+
const pulls = [];
|
|
9946
|
+
for (const entry of linked) {
|
|
9947
|
+
const { repository, prNumber, state } = Object(entry);
|
|
9948
|
+
if (typeof repository !== "string" || repository === "" || typeof prNumber !== "number" || !Number.isInteger(prNumber) || prNumber <= 0) continue;
|
|
9949
|
+
const key = `${repository.toLowerCase()}#${prNumber}`;
|
|
9950
|
+
if (seen.has(key)) continue;
|
|
9951
|
+
seen.add(key);
|
|
9952
|
+
pulls.push({ repository, prNumber, state: typeof state === "string" ? state : void 0 });
|
|
9953
|
+
}
|
|
9954
|
+
return pulls;
|
|
9955
|
+
}
|
|
9956
|
+
function pullRequestMaterial(pulls) {
|
|
9957
|
+
if (pulls.length === 0) return void 0;
|
|
9958
|
+
const parts = pulls.map((pull) => {
|
|
9959
|
+
const state = pull.state === void 0 ? "" : ` (${pull.state})`;
|
|
9960
|
+
const title = pull.title.trim() === "" ? "" : `: ${pull.title.trim()}`;
|
|
9961
|
+
const body = pull.body.trim() === "" ? "This pull request has no description." : pull.body.trim();
|
|
9962
|
+
return `# Pull request ${pull.repository}#${pull.prNumber}${state}${title}
|
|
9963
|
+
|
|
9964
|
+
${body}`;
|
|
9965
|
+
});
|
|
9966
|
+
return `${parts.join("\n\n")}
|
|
9967
|
+
`;
|
|
9968
|
+
}
|
|
9969
|
+
function previousMaterial(workItem, name) {
|
|
9970
|
+
const check = hostCheckOf(workItem, name);
|
|
9971
|
+
const items = (check?.items ?? []).filter((item) => item.id !== JUDGE_NOT_RUN_ITEM_ID);
|
|
9972
|
+
if (check === void 0 || items.length === 0) return void 0;
|
|
9973
|
+
const contradicted = check.result === "pass" && items.some((item) => item.result === "fail");
|
|
9974
|
+
const body = {
|
|
9975
|
+
...check.result === void 0 || contradicted ? {} : { result: check.result },
|
|
9976
|
+
items: items.map((item) => ({ id: item.id, result: item.result, ...item.reason === void 0 ? {} : { reason: item.reason }, ...item.commit === void 0 ? {} : { commit: item.commit } }))
|
|
9977
|
+
};
|
|
9978
|
+
return `${JSON.stringify(body, null, 2)}
|
|
9979
|
+
`;
|
|
9980
|
+
}
|
|
9981
|
+
function materialFiles(texts) {
|
|
9982
|
+
return {
|
|
9983
|
+
...texts.issue === void 0 ? {} : { "issue.md": texts.issue },
|
|
9984
|
+
...texts.pullRequest === void 0 ? {} : { "pull-request.md": texts.pullRequest },
|
|
9985
|
+
...texts.previous === void 0 ? {} : { "previous.json": texts.previous }
|
|
9986
|
+
};
|
|
9987
|
+
}
|
|
9988
|
+
|
|
9745
9989
|
// src/runner/judge-report.ts
|
|
9746
9990
|
function escape(text2) {
|
|
9747
9991
|
return text2.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
@@ -9792,6 +10036,54 @@ ${rows}
|
|
|
9792
10036
|
`;
|
|
9793
10037
|
}
|
|
9794
10038
|
|
|
10039
|
+
// src/runner/pull-request-words.ts
|
|
10040
|
+
var PULL_REQUEST_READ_TIMEOUT_MS = 3e4;
|
|
10041
|
+
var readPullRequest = async ({ apiUrl, repository, prNumber, token, fetchImpl }) => {
|
|
10042
|
+
const [owner, name, ...rest] = repository.split("/");
|
|
10043
|
+
if (owner === void 0 || owner === "" || name === void 0 || name === "" || rest.length > 0) return { ok: false, reason: `${JSON.stringify(repository)} is not an owner/name repository` };
|
|
10044
|
+
let response;
|
|
10045
|
+
try {
|
|
10046
|
+
response = await fetchImpl(`${apiUrl.replace(/\/+$/, "")}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(name)}/pulls/${prNumber}`, {
|
|
10047
|
+
headers: {
|
|
10048
|
+
...token === void 0 ? {} : { authorization: `Bearer ${token}` },
|
|
10049
|
+
accept: "application/vnd.github+json",
|
|
10050
|
+
"x-github-api-version": "2022-11-28",
|
|
10051
|
+
"user-agent": "outerlayer-runner"
|
|
10052
|
+
},
|
|
10053
|
+
signal: AbortSignal.timeout(PULL_REQUEST_READ_TIMEOUT_MS)
|
|
10054
|
+
});
|
|
10055
|
+
} catch (err) {
|
|
10056
|
+
return { ok: false, reason: describeCallFailure(err) };
|
|
10057
|
+
}
|
|
10058
|
+
if (!response.ok) return { ok: false, reason: `GitHub answered ${response.status}` };
|
|
10059
|
+
let answer;
|
|
10060
|
+
try {
|
|
10061
|
+
answer = Object(await response.json());
|
|
10062
|
+
} catch {
|
|
10063
|
+
return { ok: false, reason: "GitHub's answer is not JSON" };
|
|
10064
|
+
}
|
|
10065
|
+
if (typeof answer.title !== "string") return { ok: false, reason: "GitHub's answer holds no title" };
|
|
10066
|
+
return { ok: true, title: answer.title, body: typeof answer.body === "string" ? answer.body : "" };
|
|
10067
|
+
};
|
|
10068
|
+
async function readPullRequestWords(input) {
|
|
10069
|
+
const pushed = new Map(input.repositories.map((entry) => [entry.repository.toLowerCase(), entry]));
|
|
10070
|
+
const linked = linkedPullRequests(input.workItem).filter((pull) => pushed.has(pull.repository.toLowerCase()));
|
|
10071
|
+
const ordered = [...linked.filter((pull) => pull.state === "open"), ...linked.filter((pull) => pull.state !== "open")];
|
|
10072
|
+
const words = [];
|
|
10073
|
+
for (const pull of ordered.slice(0, MAX_PULL_REQUESTS)) {
|
|
10074
|
+
const name = `${pull.repository}#${pull.prNumber}`;
|
|
10075
|
+
let read;
|
|
10076
|
+
try {
|
|
10077
|
+
read = await input.read(pull, await pushed.get(pull.repository.toLowerCase()).token());
|
|
10078
|
+
} catch (err) {
|
|
10079
|
+
read = { ok: false, reason: describeCallFailure(err) };
|
|
10080
|
+
}
|
|
10081
|
+
if (read.ok) words.push({ ...pull, title: read.title, body: read.body });
|
|
10082
|
+
else input.note(`the pull request ${name} could not be read, so the judge does not read its title and description: ${read.reason}`);
|
|
10083
|
+
}
|
|
10084
|
+
return words;
|
|
10085
|
+
}
|
|
10086
|
+
|
|
9795
10087
|
// src/runner/pushed-branches.ts
|
|
9796
10088
|
async function readPushedBranches(input) {
|
|
9797
10089
|
const pushed = [];
|
|
@@ -9933,10 +10225,12 @@ async function runJudge(input) {
|
|
|
9933
10225
|
throw lastError;
|
|
9934
10226
|
};
|
|
9935
10227
|
let itemRead;
|
|
9936
|
-
const
|
|
10228
|
+
const readItemBy = (read) => itemRead ??= read().catch((err) => {
|
|
9937
10229
|
itemRead = void 0;
|
|
9938
10230
|
throw err;
|
|
9939
10231
|
});
|
|
10232
|
+
const readItem = () => readItemBy(readItemWithRetry);
|
|
10233
|
+
const readItemOnce = () => readItemBy(() => readWorkItem(itemCalls(config, job), job.item, deps.fetchImpl));
|
|
9940
10234
|
const cleanReason = (text2) => scrubReason(text2, config, void 0, jobDir, CHECK_ITEM_REASON_MAX_LENGTH) ?? "";
|
|
9941
10235
|
const notRunItems = (reason) => [{ id: JUDGE_NOT_RUN_ITEM_ID, result: "fail", reason: oneLineReason(cleanReason(reason)) ?? "the judge did not run" }];
|
|
9942
10236
|
const tokens = runtime.credentials.get(jobDir);
|
|
@@ -9946,6 +10240,7 @@ async function runJudge(input) {
|
|
|
9946
10240
|
} catch (err) {
|
|
9947
10241
|
log.error(`${tag} no read token for the judge: ${describeCallFailure(err)}`);
|
|
9948
10242
|
}
|
|
10243
|
+
const handed = (text2) => cutMaterial(scrubMaterial(text2, config, [config.apiKey, job.itemKey, ...tokens?.issuedTokens() ?? []], jobDir));
|
|
9949
10244
|
const scratch = join(jobDir, "judge-scratch");
|
|
9950
10245
|
rmSync(scratch, { recursive: true, force: true });
|
|
9951
10246
|
const definitionsDir = join(scratch, "definitions");
|
|
@@ -10083,7 +10378,17 @@ async function runJudge(input) {
|
|
|
10083
10378
|
}
|
|
10084
10379
|
const limitMinutes = config.checks?.timeLimitMinutes ?? DEFAULT_CHECK_TIME_LIMIT_MINUTES;
|
|
10085
10380
|
const minutes = `${limitMinutes} ${limitMinutes === 1 ? "minute" : "minutes"}`;
|
|
10086
|
-
|
|
10381
|
+
if (check.judge.subjects === "none") {
|
|
10382
|
+
try {
|
|
10383
|
+
workItem = await readItemOnce();
|
|
10384
|
+
} catch (err) {
|
|
10385
|
+
log.line(`${tag} judge: the work item could not be read, so ${check.name} reads no issue, pull request or earlier result: ${describeCallFailure(err)}`);
|
|
10386
|
+
}
|
|
10387
|
+
}
|
|
10388
|
+
const material = await materialOf(check, workItem, reads.pushed);
|
|
10389
|
+
const materialNames = Object.keys(material);
|
|
10390
|
+
if (materialNames.length > 0) log.line(`${tag} judge: ${check.name} also reads ${materialNames.join(", ")}`);
|
|
10391
|
+
const prompt = withAnswerProtocol(brief, check.judge.subjects, { material: materialNames });
|
|
10087
10392
|
const runOnce = async (files, logName) => {
|
|
10088
10393
|
await environment.prepare(files, branchDir);
|
|
10089
10394
|
const clear = async () => {
|
|
@@ -10154,7 +10459,7 @@ async function runJudge(input) {
|
|
|
10154
10459
|
if (criteria === void 0) {
|
|
10155
10460
|
let ran;
|
|
10156
10461
|
try {
|
|
10157
|
-
ran = await runOnce({ "diff.patch": diff }, "judge.log");
|
|
10462
|
+
ran = await runOnce({ "diff.patch": diff, ...material }, "judge.log");
|
|
10158
10463
|
} catch (err) {
|
|
10159
10464
|
return await fail(check, `the judge could not be run: ${describeCallFailure(err)}`);
|
|
10160
10465
|
}
|
|
@@ -10177,7 +10482,7 @@ async function runJudge(input) {
|
|
|
10177
10482
|
let ran;
|
|
10178
10483
|
try {
|
|
10179
10484
|
ran = await runOnce({ "criteria.json": `${JSON.stringify({ criteria: group }, null, 2)}
|
|
10180
|
-
`, "diff.patch": diff }, logName);
|
|
10485
|
+
`, "diff.patch": diff, ...material }, logName);
|
|
10181
10486
|
} catch (err) {
|
|
10182
10487
|
const reason = `the judge could not be run: ${describeCallFailure(err)}`;
|
|
10183
10488
|
log.error(`${tag} judge failed: ${reason}`);
|
|
@@ -10210,6 +10515,21 @@ async function runJudge(input) {
|
|
|
10210
10515
|
const whole = unanswered.length === groups.length && reasons.length === 1 ? { reason: reasons[0], limitKey: unanswered.some((entry) => entry.limitKey) } : void 0;
|
|
10211
10516
|
return await finish2(check, { criteria, items, repository: repo, head, branch, finder, judgeReport, ...whole === void 0 ? {} : whole });
|
|
10212
10517
|
}
|
|
10518
|
+
async function materialOf(check, workItem, pushed) {
|
|
10519
|
+
const issue = issueMaterial(workItem, criteriaOf(workItem));
|
|
10520
|
+
const words = check.judge.subjects === "none" ? await readPullRequestWords({
|
|
10521
|
+
workItem,
|
|
10522
|
+
repositories: pushed.map((entry) => ({ repository: entry.repository, token: async () => entry.primary ? readToken : await tokens?.token("read", entry.repository) })),
|
|
10523
|
+
read: (pull, token) => (deps.readPullRequest ?? readPullRequest)({ apiUrl: runtime.github.apiUrl, repository: pull.repository, prNumber: pull.prNumber, token, fetchImpl: deps.fetchImpl }),
|
|
10524
|
+
note: (line2) => log.line(`${tag} judge: ${line2}`)
|
|
10525
|
+
}) : [];
|
|
10526
|
+
const pullRequest = pullRequestMaterial(words);
|
|
10527
|
+
return materialFiles({
|
|
10528
|
+
issue: issue === void 0 ? void 0 : handed(issue),
|
|
10529
|
+
pullRequest: pullRequest === void 0 ? void 0 : handed(pullRequest),
|
|
10530
|
+
previous: previousMaterial(workItem, check.name)
|
|
10531
|
+
});
|
|
10532
|
+
}
|
|
10213
10533
|
async function finish2(check, at) {
|
|
10214
10534
|
const items = inCriteriaOrder(at.items, at.criteria);
|
|
10215
10535
|
const failing = itemsSentence(items, { one: "criterion", many: "criteria" });
|
|
@@ -10505,6 +10825,16 @@ function transcriptScrub(config, secrets, jobDir, agents = defaultAgents()) {
|
|
|
10505
10825
|
const base = releaseScrub(config, homeFromEnv(), jobDir, agents);
|
|
10506
10826
|
return { literals: [...scrubList(base.literals), ...secrets.filter((secret) => secret !== void 0 && secret !== "")], patterns: scrubList(base.patterns) };
|
|
10507
10827
|
}
|
|
10828
|
+
function scrubMaterial(text2, config, secrets, jobDir) {
|
|
10829
|
+
setCustomScrubbers(transcriptScrub(config, secrets, jobDir), () => void 0);
|
|
10830
|
+
setLocalIdentity({});
|
|
10831
|
+
setRepoRoot(void 0);
|
|
10832
|
+
try {
|
|
10833
|
+
return scrubText(text2);
|
|
10834
|
+
} finally {
|
|
10835
|
+
setCustomScrubbers(void 0, () => void 0);
|
|
10836
|
+
}
|
|
10837
|
+
}
|
|
10508
10838
|
function keptSessionScrub(config, job, jobDirPath) {
|
|
10509
10839
|
return () => {
|
|
10510
10840
|
const base = transcriptScrub(config, [job.itemKey, config.apiKey], jobDirPath);
|
|
@@ -14942,4 +15272,4 @@ async function runHostChecks(input) {
|
|
|
14942
15272
|
}
|
|
14943
15273
|
}
|
|
14944
15274
|
|
|
14945
|
-
export { ADOPTED_FETCH_RETRY_WINDOW_MS, ALREADY_RELEASED, AttemptLogBook, EXIT_CODE_FILE, GUEST_USAGE_INTERVAL_MS, HELPER_ENV, KIND_LABEL, LEASE_SECONDS, MAX_CHECK_ITEMS_BYTES, MICROVM_COMMAND_DIR, MIN_ENGINE_MAJOR, NO_LOG, PLACEHOLDER_MARKER, RENEW_INTERVAL_SECONDS, RunnerInitError, SandboxContainerStoppedError, SandboxGoneError, addRunnerAgent, agentCredentialCheck, agentCredentialFromFiles, appendCommandLog, attemptNote, builtOf, checksIn, claimPermissionProblem, claimRun, commandEndReasonOf, commandItems, commandLogOffset, containerCommandExec, createContainerRuntime, createGatewaySandboxClient, createHousekeepingDocker, createLeaseChannel, credentialVerdict, currentSkillCommand, decideHostBuildSkill, deliverCommitHooks, deliverContainerHooks, deliverExecMaven, deliverJobFiles, deliverSandboxHooks, describeHookEnd, describeMachineDocker, detectMachine, ensureFirecrackerAndJailer, ensureNetworkReady, ensureTunnel, environmentFor, execArgv, execCommandLine, fetchManagedBuildSettings, fetchManagedModelKey, filesAreCopied, finishJob, foldSample, formerSkillProblem, formerSkillQueues, freeItemDisksUntil, gatewayRefusalReason, gitRemoteFor, hasRunnerBlock, heldSandboxClaimsOf, helperFirecrackerNote, helperSocketPath, holdManagedBuildSettings, holdManagedKey, holdsHostDisk, hookLimitsFor, hostCommandEnvironment, hostEnvironment, housekeepingDockerIfReachable, inSandbox, inTeardown, installTrust, isContainerTracked, isGroupAlive, isIdle, isIsolatedJob, isJudgeCheck, isMicroVmTracked, isPlaceholderCommand, isReadable, isSandboxTracked, isTimedOut, isTracked, isUnfinished, itemScope, itemTag, jobEnv, jobRecordsClaim, jobTimeLimitMinutes, judgeCredential, judgeProbe, keepGhConfigCurrent, keptCommitsLine, keptSandboxIds, keptSessionDir, leaseExpiresAtMs, leaseTimeLeftMs, lifecycleFailureReason, lifecycleSteps, listAdoptableJobs, listItemDisks, listTrackedJobs, listUnreadableJobs, listenOnBroker, makeRecorder, managedBuildSettingsFor, measureDisk, microVmArchSupported, microVmAssetsPinned, microVmCommandLine, microVmOomKills, missingJudgeCredential, missingPermissionFix, missingPermissionOf, modellessProblem, modellessQueues, nativeWindowsSandboxRefusal, needsAgentCredential, needsBuildSkill, needsRenew, noteMissingCredential, outcomeFromExitCode, parseCpuList, permissionModeProblem, permissionModeProblems, placeholderProblem, placeholderQueues, prepareBranch, prepareResume, prepareRunnerInit, probeCommand, probeHelper, probeMicroVmCommand, probeSandboxCommand, provisionContainer, provisionEnvironment, provisionMicroVm, provisionSandbox, reachDockerStep, readConfigObject, readCpuUsec, readDefinitions, readProvisionOut, readRecords, readWorkItem, recordsProofsOnly, recoverLostJobs, rejoinSandboxBuild, releaseLease, removeOldestUntil, removeRunnerBlock, renewLease, renewRun, resolveHostBuild, restartSender, restoreSessionIntoContainer, restoreSessionIntoMicroVm, restoreSessionIntoSandbox, restoreWork, retryFailedReleases, runCommand, runCommandFor, runCommandOf, runDecision, runHook, runHostChecks, runHousekeeping, runRunnerInit, runWithSpawn, sampleGuest, savedStatesDir, scrubReason, serveLease, sessionGuestOfContainer, sessionGuestOfMicroVm, sessionGuestOfSandbox, setStage, setUpRunnerCgroup, shellQuote, startHostServices, startMicroVmCommand, startSandboxCommand, startSender, startServicesFor, stopOrphanedMicroVms, stoppedHelperReason, stripTerminalControls, superviseRuns, supportsContainerBuilds, supportsMicroVmBuilds, sweepImageBuilders, sweepSandboxes, testProofIn, timeoutAfter, treeFileText, unfinishedJobs, vmAlive, withJobTimeLimit, withTunnelLog, workRestoredEnv, workdirProblem, writeGuestGhConfig, writeRunnerInit };
|
|
15275
|
+
export { ADOPTED_FETCH_RETRY_WINDOW_MS, ALREADY_RELEASED, AttemptLogBook, EXIT_CODE_FILE, GUEST_USAGE_INTERVAL_MS, HELPER_ENV, KIND_LABEL, LEASE_SECONDS, MAX_CHECK_ITEMS_BYTES, MICROVM_COMMAND_DIR, MIN_ENGINE_MAJOR, NO_LOG, PLACEHOLDER_MARKER, RENEW_INTERVAL_SECONDS, RunnerInitError, SandboxContainerStoppedError, SandboxGoneError, addRunnerAgent, agentCredentialCheck, agentCredentialFromFiles, appendCommandLog, attemptNote, builtOf, carriedProblems, checksIn, claimPermissionProblem, claimRun, commandEndReasonOf, commandItems, commandLogOffset, containerCommandExec, createContainerRuntime, createGatewaySandboxClient, createHousekeepingDocker, createLeaseChannel, credentialVerdict, currentSkillCommand, decideHostBuildSkill, deliverCommitHooks, deliverContainerHooks, deliverExecMaven, deliverJobFiles, deliverSandboxHooks, describeHookEnd, describeMachineDocker, detectMachine, dropNonProblems, ensureFirecrackerAndJailer, ensureNetworkReady, ensureTunnel, environmentFor, execArgv, execCommandLine, fetchManagedBuildSettings, fetchManagedModelKey, filesAreCopied, finishJob, foldSample, formerSkillProblem, formerSkillQueues, freeItemDisksUntil, gatewayRefusalReason, gitRemoteFor, hasRunnerBlock, heldSandboxClaimsOf, helperFirecrackerNote, helperSocketPath, holdManagedBuildSettings, holdManagedKey, holdsHostDisk, hookLimitsFor, hostCommandEnvironment, hostEnvironment, housekeepingDockerIfReachable, inSandbox, inTeardown, installTrust, isContainerTracked, isGroupAlive, isIdle, isIsolatedJob, isJudgeCheck, isMicroVmTracked, isPlaceholderCommand, isReadable, isSandboxTracked, isTimedOut, isTracked, isUnfinished, issueText, itemScope, itemTag, jobEnv, jobRecordsClaim, jobTimeLimitMinutes, judgeCredential, judgeProbe, keepGhConfigCurrent, keptCommitsLine, keptSandboxIds, keptSessionDir, leaseExpiresAtMs, leaseTimeLeftMs, lifecycleFailureReason, lifecycleSteps, listAdoptableJobs, listItemDisks, listTrackedJobs, listUnreadableJobs, listenOnBroker, makeRecorder, managedBuildSettingsFor, markdownSection, measureDisk, mergeAnswers, microVmArchSupported, microVmAssetsPinned, microVmCommandLine, microVmOomKills, missingJudgeCredential, missingPermissionFix, missingPermissionOf, modellessProblem, modellessQueues, nativeWindowsSandboxRefusal, needsAgentCredential, needsBuildSkill, needsRenew, noteMissingCredential, outcomeFromExitCode, parseCpuList, permissionModeProblem, permissionModeProblems, placeholderProblem, placeholderQueues, prepareBranch, prepareResume, prepareRunnerInit, probeCommand, probeHelper, probeMicroVmCommand, probeSandboxCommand, provisionContainer, provisionEnvironment, provisionMicroVm, provisionSandbox, reachDockerStep, readConfigObject, readCpuUsec, readDefinitions, readProvisionOut, readRecords, readWorkItem, recordsProofsOnly, recoverLostJobs, rejoinSandboxBuild, releaseLease, removeOldestUntil, removeRunnerBlock, renewLease, renewRun, resolveHostBuild, restartSender, restoreSessionIntoContainer, restoreSessionIntoMicroVm, restoreSessionIntoSandbox, restoreWork, retryFailedReleases, reviewFiles, runCommand, runCommandFor, runCommandOf, runDecision, runHook, runHostChecks, runHousekeeping, runRunnerInit, runWithSpawn, sampleGuest, savedStatesDir, scrubReason, serveLease, sessionGuestOfContainer, sessionGuestOfMicroVm, sessionGuestOfSandbox, setStage, setUpRunnerCgroup, shellQuote, startHostServices, startMicroVmCommand, startSandboxCommand, startSender, startServicesFor, stopOrphanedMicroVms, stoppedHelperReason, storedProblemsText, stripTerminalControls, superviseRuns, supportsContainerBuilds, supportsMicroVmBuilds, sweepImageBuilders, sweepSandboxes, territories, territoryBrief, testProofIn, timeoutAfter, treeFileText, unfinishedJobs, unreviewedFiles, unreviewedItem, vmAlive, withJobTimeLimit, withTunnelLog, workRestoredEnv, workdirProblem, writeGuestGhConfig, writeRunnerInit };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { summarizeChecks, summaryText, renderDoctorText } from './chunk-
|
|
3
|
+
import { summarizeChecks, summaryText, renderDoctorText } from './chunk-MKSCYAZU.js';
|
|
4
4
|
import { shellFunctionInstalled, removeShellFunction, installShellFunction, SHELL_FUNCTION_LINE } from './chunk-23YVVYQC.js';
|
|
5
5
|
import { runConnect, hasUncommittedPolicy, commitCommandsFor } from './chunk-B2WCKRMW.js';
|
|
6
6
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
@@ -2672,13 +2672,16 @@ function criteriaOf(workItem) {
|
|
|
2672
2672
|
}
|
|
2673
2673
|
return items.length === 0 ? void 0 : items;
|
|
2674
2674
|
}
|
|
2675
|
-
function
|
|
2675
|
+
function hostCheckOf(workItem, name) {
|
|
2676
2676
|
const checks = Object(workItem).checks;
|
|
2677
|
-
if (!Array.isArray(checks)) return
|
|
2677
|
+
if (!Array.isArray(checks)) return void 0;
|
|
2678
2678
|
const check = checks.find((entry) => Object(entry).name === name);
|
|
2679
|
-
if (check?.source !== "host") return
|
|
2679
|
+
if (check?.source !== "host") return void 0;
|
|
2680
2680
|
const parsed = CheckItemsSchema.safeParse(check.items);
|
|
2681
|
-
return parsed.success ? parsed.data : [];
|
|
2681
|
+
return { result: check.result === "pass" || check.result === "fail" ? check.result : void 0, items: parsed.success ? parsed.data : [] };
|
|
2682
|
+
}
|
|
2683
|
+
function hostItemsOf(workItem, name) {
|
|
2684
|
+
return hostCheckOf(workItem, name)?.items ?? [];
|
|
2682
2685
|
}
|
|
2683
2686
|
|
|
2684
|
-
export { MAX_TEST_FILE_BYTES, NO_VERDICT_REASON, criteriaOf, criterionInputs, diffLines, failedItems, hostItemsOf, inCriteriaOrder, itemsSentence, judgeGroups, judgedItems, lineInDiff, loadCitationFinder, oneLineReason, parseJudgeAnswer, planCriteria, runnerMatcher, testFileMatcher, testsByCriterion, treePath, wholeEntries, wholeItems };
|
|
2687
|
+
export { MAX_TEST_FILE_BYTES, NO_VERDICT_REASON, criteriaOf, criterionInputs, diffLines, failedItems, hostCheckOf, hostItemsOf, inCriteriaOrder, itemsSentence, judgeGroups, judgedItems, lineInDiff, loadCitationFinder, oneLineReason, parseJudgeAnswer, planCriteria, runnerMatcher, testFileMatcher, testsByCriterion, treePath, wholeEntries, wholeItems };
|