@outerlayer/cli 0.36.1-next.20261104165351 → 0.37.0-next.20261104191505
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-DUE6IXPP.js +40 -0
- package/dist/{agent-subcommand-ASYEDGY2.js → agent-subcommand-C625JDSN.js} +4 -4
- package/dist/{artifact-link-cmd-ZPQXVG5O.js → artifact-link-cmd-72FQTBGO.js} +2 -2
- package/dist/{bridge-JYWNVBZW.js → bridge-UHNGV6DM.js} +7 -7
- package/dist/{build-G25G35OY.js → build-ALG3MYX2.js} +13 -13
- package/dist/{build-disk-LCBVNYLL.js → build-disk-JU2QHE64.js} +11 -11
- package/dist/build-info.json +1 -1
- package/dist/{builder-VV5Q3IOR.js → builder-4LK2FDCX.js} +10 -10
- package/dist/caller-JQC4VW36.js +23 -0
- package/dist/{check-3DBOM5UT.js → check-VOJWXIRZ.js} +55 -55
- package/dist/{chunk-WUKLQWGY.js → chunk-2JIGPSVF.js} +6 -3
- package/dist/{chunk-XGGXKR4M.js → chunk-2KFLMNQU.js} +1 -1
- package/dist/{chunk-FHKZZHM3.js → chunk-2LXO2YIW.js} +6 -6
- package/dist/{chunk-2CSXFU4A.js → chunk-2QFRAMJX.js} +1 -1
- package/dist/{chunk-G3JG75DP.js → chunk-3LT6REKE.js} +2 -2
- package/dist/{chunk-IHW5KZN7.js → chunk-3Z5GISKU.js} +42 -142
- package/dist/{chunk-ALPMGHDV.js → chunk-4U57GP2X.js} +2 -2
- package/dist/{chunk-SMT2K2AR.js → chunk-62RPMJXQ.js} +3 -3
- package/dist/{chunk-2BUZUDSH.js → chunk-6BS4DDCY.js} +8 -8
- package/dist/{chunk-MA4ZUS4A.js → chunk-6MWBZHBW.js} +1 -1
- package/dist/{chunk-ZDFZWQUF.js → chunk-6SC66WGJ.js} +94 -122
- package/dist/{chunk-DU2QDWHB.js → chunk-A75ZPAOP.js} +5 -5
- package/dist/{chunk-R6G7OGS6.js → chunk-DQZ7XFCI.js} +1 -1
- package/dist/{chunk-GXZTSNVW.js → chunk-E2DJ6TWB.js} +3 -3
- package/dist/{chunk-5Y7ZBX4U.js → chunk-EDEBGBPL.js} +4 -4
- package/dist/{chunk-ZOT3CD34.js → chunk-ERGU3OZP.js} +25 -25
- package/dist/{chunk-CQWXQDAZ.js → chunk-FBZE3LGM.js} +1 -1
- package/dist/{chunk-EKPSKSEJ.js → chunk-FV52S3JR.js} +2 -2
- package/dist/{chunk-TADKX7OA.js → chunk-FX4ZG4E5.js} +16 -16
- package/dist/{chunk-6C6WH6KL.js → chunk-FYPVUT27.js} +1 -1
- package/dist/{chunk-KNGCCNVO.js → chunk-G43WGW64.js} +4 -4
- package/dist/{chunk-ULFMR5UJ.js → chunk-G62P3EFL.js} +3 -3
- package/dist/{chunk-3Z5KIYBR.js → chunk-GBCQ3KHH.js} +3 -3
- package/dist/{chunk-A72Q4LSP.js → chunk-GF4O3M23.js} +1 -1
- package/dist/{chunk-PDBYH3V5.js → chunk-GQA54433.js} +2 -2
- package/dist/{chunk-IZKRPQIU.js → chunk-HN76DIHX.js} +7 -7
- package/dist/{chunk-C47K5UDL.js → chunk-HOTRWPVM.js} +4 -4
- package/dist/{chunk-TLVRBSOX.js → chunk-IHPJFMSV.js} +8 -8
- package/dist/{chunk-L2J7B7V6.js → chunk-IJU6DMQA.js} +1 -1
- package/dist/{chunk-EJ4MVQYZ.js → chunk-JAHR4LAD.js} +4 -4
- package/dist/{chunk-DOSM5H4B.js → chunk-JNGKTJ7L.js} +7 -7
- package/dist/{chunk-3TEZYUG6.js → chunk-JO2FOEZE.js} +4 -4
- package/dist/{chunk-R6CQLTRC.js → chunk-KCNL7KX2.js} +9 -9
- package/dist/{chunk-RFNETJEH.js → chunk-KSSHEWPV.js} +3 -3
- package/dist/{chunk-2A5LRRGL.js → chunk-L2PT4NRI.js} +1 -1
- package/dist/{chunk-ZV5QX3GK.js → chunk-LLZG5A2J.js} +9 -9
- package/dist/{chunk-QQVX4HUP.js → chunk-LNTZH3UL.js} +5 -5
- package/dist/{chunk-ULIDETYK.js → chunk-LUQWY7BX.js} +5 -5
- package/dist/{chunk-VB6ODZL2.js → chunk-LVZ3UV7T.js} +1 -1
- package/dist/{chunk-JXHN4E4Q.js → chunk-MITBH4LH.js} +3 -3
- package/dist/{chunk-UDX4B237.js → chunk-MZ2OOMOT.js} +1 -1
- package/dist/{chunk-4LA7E3HT.js → chunk-N3FPRSUZ.js} +6 -6
- package/dist/{chunk-UYCK4L43.js → chunk-NBGBMZE4.js} +1 -1
- package/dist/{chunk-4PGTFUTY.js → chunk-NSDQESOY.js} +1 -1
- package/dist/{chunk-NKQL3LHK.js → chunk-NSX2KF4L.js} +1 -1
- package/dist/{chunk-V6VMFAKC.js → chunk-OG6RJXQ3.js} +1 -1
- package/dist/{chunk-TYLXRXDY.js → chunk-OLZVQCDX.js} +1 -1
- package/dist/{chunk-S6AZPAUS.js → chunk-P3KL3ZJF.js} +1 -1
- package/dist/{chunk-UN6X7TYJ.js → chunk-P4YTEF6T.js} +1 -1
- package/dist/{chunk-K72IBKLA.js → chunk-PNZN656P.js} +1 -1
- package/dist/{chunk-FFJHFOFD.js → chunk-Q6FXWSN3.js} +7 -7
- package/dist/{chunk-HNKGBQFA.js → chunk-R2IPYS6A.js} +11 -11
- package/dist/{chunk-YATN35MN.js → chunk-RFCAK6OI.js} +7 -7
- package/dist/{chunk-KWOQTSSZ.js → chunk-RXWFZB3P.js} +1 -1
- package/dist/{chunk-Q7CXOTVR.js → chunk-SQWYFCEU.js} +3 -3
- package/dist/{chunk-R6SOMMDQ.js → chunk-TCWYLSE3.js} +1 -1
- package/dist/{chunk-MFVANFEJ.js → chunk-THL7WJ3F.js} +2 -2
- package/dist/{chunk-GBTHXD74.js → chunk-TSYTPW6Y.js} +161 -155
- package/dist/{chunk-KQSRABR6.js → chunk-UZNSGMUZ.js} +2 -2
- package/dist/{chunk-3NWBJVIL.js → chunk-VNMTA2JE.js} +3 -3
- package/dist/{chunk-PCIWQUBH.js → chunk-VTJ5MGGC.js} +6 -6
- package/dist/{chunk-KYFMMW65.js → chunk-VV3Y32EV.js} +1 -1
- package/dist/{chunk-F3T5QJ24.js → chunk-VVZIFOAN.js} +1 -1
- package/dist/{chunk-YMYYRYKE.js → chunk-W6GP4CNN.js} +7 -7
- package/dist/{chunk-RTPGEOBA.js → chunk-WCJCGFVQ.js} +1 -1
- package/dist/{chunk-RJTFSUZI.js → chunk-XGJXLITW.js} +6 -6
- package/dist/{chunk-GPVZFUTD.js → chunk-XMIUPI5N.js} +6 -6
- package/dist/{chunk-BCQDEM2N.js → chunk-YLJXRXPX.js} +1 -1
- package/dist/{chunk-A6RI6KTI.js → chunk-ZBPUHNUZ.js} +1 -1
- package/dist/{chunk-ZEM4IRBH.js → chunk-ZHOPDD7U.js} +5 -5
- package/dist/{chunk-FGA3EXGJ.js → chunk-ZQNYV4OZ.js} +1 -1
- package/dist/{chunk-3GHHGCNU.js → chunk-ZRITZJ36.js} +6 -6
- package/dist/{claude-launcher-WZPO6HPI.js → claude-launcher-HW5YVYWR.js} +7 -7
- package/dist/{cli-UPBWBSZK.js → cli-FFPFIMPZ.js} +148 -148
- package/dist/{command-FJIGATGO.js → command-MYYGFCW3.js} +50 -50
- package/dist/{config-2APX7UB2.js → config-CZJINZN5.js} +12 -12
- package/dist/{connect-cmd-NA6MMPXY.js → connect-cmd-4ZEF4WNR.js} +13 -13
- package/dist/{container-start-SUDA7O4K.js → container-start-ICNSSPBS.js} +48 -48
- package/dist/{context-cleanup-2PECPCE4.js → context-cleanup-7QZQJXID.js} +4 -4
- package/dist/{context-show-cmd-PCKELSP2.js → context-show-cmd-JYV7RKMC.js} +14 -14
- package/dist/{control-plane-launch-T33K3464.js → control-plane-launch-HLFLGLW6.js} +14 -14
- package/dist/{demo-record-cmd-6TY4YHDY.js → demo-record-cmd-MDPZD53Q.js} +8 -8
- package/dist/{demo-voice-cmd-LAYGJR4O.js → demo-voice-cmd-4JEXQP4I.js} +20 -20
- package/dist/{dist-P4VFDPWT.js → dist-NEH3H3EL.js} +2 -2
- package/dist/{docker-PS5OVPIF.js → docker-F4S3PBPD.js} +10 -10
- package/dist/{doctor-D6IRPOAQ.js → doctor-LEGPWSQ3.js} +50 -50
- package/dist/{emit-artifact-cmd-PQZZORYH.js → emit-artifact-cmd-QDYKKQT5.js} +19 -19
- package/dist/{emit-cmd-7JNFV35K.js → emit-cmd-ANJGKYSQ.js} +7 -7
- package/dist/{emit-criteria-cmd-HXP5RCRU.js → emit-criteria-cmd-OCLNKIL4.js} +16 -16
- package/dist/{emit-demo-cmd-7SGOM2YU.js → emit-demo-cmd-RO3OXK4U.js} +20 -20
- package/dist/{emit-finding-cmd-2LEHV4FK.js → emit-finding-cmd-M4OKFZPF.js} +16 -16
- package/dist/{emit-result-cmd-P4NAJ2CH.js → emit-result-cmd-CUTNYSOQ.js} +18 -18
- package/dist/{emit-step-cmd-K6HYSFGW.js → emit-step-cmd-SY54AQYM.js} +16 -16
- package/dist/{exec-client-GEN7MH5Q.js → exec-client-3ZVMZRZD.js} +8 -8
- package/dist/find-unit-5ALT2LU3.js +24 -0
- package/dist/{findings-cmd-KCDAXNUH.js → findings-cmd-246XYZSE.js} +16 -16
- package/dist/{fleet-readiness-OBHMDNEQ.js → fleet-readiness-SOSSKSII.js} +14 -14
- package/dist/{governing-source-4PJ6W6RY.js → governing-source-2UXHLXCS.js} +21 -21
- package/dist/{guest-init-XN7ZOOK5.js → guest-init-ZNSEHMXA.js} +9 -9
- package/dist/{hook-fast-J26JZG67.js → hook-fast-27GO6BM2.js} +1 -1
- package/dist/{hook-install-SVEA6RYI.js → hook-install-5OS6ZH4B.js} +4 -4
- package/dist/host-checks-VGJVO23Y.js +79 -0
- package/dist/host-key-ZRJ4CGFC.js +18 -0
- package/dist/{image-tag-MAWC5FC5.js → image-tag-WQB5HVLI.js} +8 -8
- package/dist/index.js +4 -4
- package/dist/{init-RTJUSLNZ.js → init-F3L4CTBJ.js} +46 -46
- package/dist/init-Z6ZVLUJ5.js +79 -0
- package/dist/{init-agent-ZQICLASB.js → init-agent-DO233UTF.js} +46 -46
- package/dist/{init-cmd-QCLXU6F3.js → init-cmd-AKIPYTNP.js} +27 -27
- package/dist/{init-update-4MNOI44P.js → init-update-BIHC42CB.js} +24 -24
- package/dist/{install-cmd-LTIF23I4.js → install-cmd-YMPTGHE4.js} +10 -10
- package/dist/{layout-J7NA2HJ3.js → layout-DBSSMC4R.js} +4 -4
- package/dist/{login-browser-NUQQYH5J.js → login-browser-AMCRDS5C.js} +2 -2
- package/dist/{logs-44SEY5AH.js → logs-HIXNEXBT.js} +7 -7
- package/dist/loop-MUPQOIW6.js +90 -0
- package/dist/machine-WFZ5KM76.js +79 -0
- package/dist/{machine-skills-UOF5X7OU.js → machine-skills-QEAB6375.js} +4 -4
- package/dist/{mcp-install-cmd-6CP7ODB4.js → mcp-install-cmd-ZL2TJUIK.js} +4 -4
- package/dist/{mcp-serve-cmd-QOPRMVCR.js → mcp-serve-cmd-4EGVZBCK.js} +9 -9
- package/dist/{paths-IMTP2VFJ.js → paths-AGOA7QX6.js} +7 -7
- package/dist/{pending-6LTQDPDQ.js → pending-625SL7WI.js} +8 -8
- package/dist/{pidfile-2FKC65BM.js → pidfile-H2DZIODT.js} +8 -8
- package/dist/{record-KD3622E7.js → record-UHMPQIUU.js} +8 -8
- package/dist/{relay-3RRPUZKH.js → relay-MS7QJ53J.js} +5 -5
- package/dist/{relay-protocol-ZFQ3QL76.js → relay-protocol-7LG6NHYA.js} +5 -5
- package/dist/{runner-agents-3A2SJEZ7.js → runner-agents-QJCL4MO3.js} +4 -4
- package/dist/runner-env-YPIZG3VG.js +24 -0
- package/dist/{runner-identity-6UUYHJVJ.js → runner-identity-RPRUONRJ.js} +10 -10
- package/dist/{runner-key-R5HMAPIW.js → runner-key-2SKLS37E.js} +46 -46
- package/dist/{session-sender-SOYN2W4Z.js → session-sender-B526LNJ6.js} +19 -19
- package/dist/{spec-cmd-HVQQ73ST.js → spec-cmd-6TZVHED2.js} +17 -17
- package/dist/{starter-pack-RI3RMOOM.js → starter-pack-6TS4PJYJ.js} +5 -5
- package/dist/state-ALHXVNOS.js +18 -0
- package/dist/{status-AGLJZQF2.js → status-WZCEHCL2.js} +46 -46
- package/dist/{sync-cmd-LGYH6DQH.js → sync-cmd-NMWPCIFU.js} +18 -18
- package/dist/update-steps-5BGDQTVG.js +80 -0
- package/dist/{watch-CHUOAXUM.js → watch-INJRAQRE.js} +18 -18
- package/dist/{work-claim-cmd-2LDQQYWT.js → work-claim-cmd-2IOJVHR5.js} +22 -22
- package/dist/{work-cmd-ALCIHXMP.js → work-cmd-6JUZHKXN.js} +16 -16
- package/dist/{work-comment-cmd-OSC5UISU.js → work-comment-cmd-KK7H6F67.js} +18 -18
- package/dist/{work-demo-cmd-EUQ733UV.js → work-demo-cmd-32PXKPZK.js} +16 -16
- package/dist/{work-logs-cmd-ILW6PUQT.js → work-logs-cmd-QYSBE2SP.js} +16 -16
- package/dist/{work-open-pr-cmd-6IZNKXUC.js → work-open-pr-cmd-PSATZ2BK.js} +17 -17
- package/dist/{work-pr-cmd-NC3L2W73.js → work-pr-cmd-BEYPR7TL.js} +16 -16
- package/dist/{work-proofs-cmd-24BTANI3.js → work-proofs-cmd-P33QGSIQ.js} +18 -18
- package/dist/{work-proofs-record-KGB7FN5R.js → work-proofs-record-FN6M7BIZ.js} +24 -24
- package/dist/{work-stop-cmd-C6TTKZW3.js → work-stop-cmd-MUSKJC5M.js} +16 -16
- package/package.json +1 -1
- package/skill-pack/maintained/outerlayer-build/SKILL.md +4 -6
- package/skill-pack/maintained/outerlayer-build/references/agent-briefs.md +13 -12
- package/skill-pack/maintained/outerlayer-build/references/criteria-judge.md +40 -36
- package/skill-pack/maintained/outerlayer-build/references/evidence.md +5 -7
- package/skill-pack/maintained/outerlayer-build/references/release.md +6 -4
- package/skill-pack/maintained/outerlayer-build/references/review-briefs.md +5 -5
- package/skill-pack/maintained/outerlayer-build/scripts/criterion-citations.mjs +44 -80
- package/skill-pack/shipped.json +2 -0
- package/skill-pack/template/writing-tests/SKILL.md +6 -11
- package/skill-pack/validators/acceptance-criteria.yaml +11 -9
- package/dist/agent-setup-PBHLFTH5.js +0 -40
- package/dist/caller-GSOX6OEA.js +0 -23
- package/dist/find-unit-UCWO22YS.js +0 -24
- package/dist/host-checks-OLB3DXCU.js +0 -79
- package/dist/host-key-V6D7QGRX.js +0 -18
- package/dist/init-5LCIMEBR.js +0 -79
- package/dist/loop-7T33PKFZ.js +0 -90
- package/dist/machine-D7P4L63X.js +0 -79
- package/dist/runner-env-CDNYK5XI.js +0 -24
- package/dist/state-LBWBA36C.js +0 -18
- package/dist/update-steps-HN2DF4QW.js +0 -80
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { criteriaOf, loadCitationFinder,
|
|
4
|
-
import { WorkCommandError, resolveCredentials, getJson } from './chunk-
|
|
5
|
-
import { sanitizeTerminal } from './chunk-
|
|
3
|
+
import { criteriaOf, loadCitationFinder, testFileMatcher, hostItemsOf, NO_VERDICT_REASON } from './chunk-6SC66WGJ.js';
|
|
4
|
+
import { WorkCommandError, resolveCredentials, getJson } from './chunk-6BS4DDCY.js';
|
|
5
|
+
import { sanitizeTerminal } from './chunk-VVZIFOAN.js';
|
|
6
6
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
7
|
-
import { defaultFetch } from './chunk-
|
|
7
|
+
import { defaultFetch } from './chunk-FYPVUT27.js';
|
|
8
8
|
import { parseWorkItemEnv } from './chunk-4OD45RBP.js';
|
|
9
9
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
10
10
|
import { readDeliveryRecord } from './chunk-YQR6E6OV.js';
|
|
11
|
-
import { resolveRepoIdentity } from './chunk-
|
|
12
|
-
import { inferArtifactKind, mediaTypeForArtifactPath, WORK_ITEM_COMMENT_MAX_BODY_LENGTH } from './chunk-
|
|
11
|
+
import { resolveRepoIdentity } from './chunk-ZQNYV4OZ.js';
|
|
12
|
+
import { inferArtifactKind, mediaTypeForArtifactPath, WORK_ITEM_COMMENT_MAX_BODY_LENGTH } from './chunk-2JIGPSVF.js';
|
|
13
13
|
import { createHash } from 'crypto';
|
|
14
14
|
import { spawnSync } from 'child_process';
|
|
15
15
|
import { existsSync, statSync, readFileSync } from 'fs';
|
|
@@ -49,147 +49,58 @@ function ownPullRequest(pullRequests, requested, checkoutRepository) {
|
|
|
49
49
|
if (open.length > 1) return { ambiguous: open.map((pr) => pr.prNumber) };
|
|
50
50
|
return { pr: open[0]?.prNumber };
|
|
51
51
|
}
|
|
52
|
-
var NO_BRIEF = "";
|
|
53
52
|
var GITHUB_BLOB = /^https:\/\/github\.com\/[^/]+\/[^/]+\/blob\/([0-9a-f]{7,64})\//;
|
|
54
|
-
function commitOf(
|
|
55
|
-
|
|
53
|
+
function commitOf(item) {
|
|
54
|
+
if (item.commit !== void 0) return item.commit;
|
|
55
|
+
for (const ref of item.refs ?? []) {
|
|
56
56
|
const match = GITHUB_BLOB.exec(ref.href ?? "");
|
|
57
57
|
if (match !== null) return match[1];
|
|
58
58
|
}
|
|
59
59
|
return void 0;
|
|
60
60
|
}
|
|
61
61
|
function unprovenCriteria(input) {
|
|
62
|
-
const { criteria, finder } = input;
|
|
63
|
-
const citations = finder.buildCitations({ ids: criteria.map((c) => c.id), files: [...input.headFiles], repository: null, sha: null });
|
|
64
|
-
const headTexts = new Map(input.headFiles.map((file) => [file.path, file.contents]));
|
|
65
|
-
const inputs = new Map(criteria.map((c) => [c.id, criterionInputs({ brief: NO_BRIEF, criterion: c, citations, testFiles: headTexts })]));
|
|
66
62
|
const notes = [];
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
if (!filesByCommit.has(commit)) filesByCommit.set(commit, input.testFilesAt(commit));
|
|
81
|
-
const files = filesByCommit.get(commit);
|
|
82
|
-
if (files === void 0) {
|
|
83
|
-
notes.push(`this checkout does not hold ${item.id}'s cited tests at ${commit.slice(0, 7)}`);
|
|
63
|
+
const entries = [];
|
|
64
|
+
const changed = /* @__PURE__ */ new Map();
|
|
65
|
+
for (const criterion of input.criteria) {
|
|
66
|
+
if (criterion.proof !== null) continue;
|
|
67
|
+
const item = input.items.find((entry) => entry.id === criterion.id);
|
|
68
|
+
if (item === void 0 || item.result !== "fail" || item.reason === NO_VERDICT_REASON) continue;
|
|
69
|
+
const commit = commitOf(item);
|
|
70
|
+
if (commit === void 0) continue;
|
|
71
|
+
if (!changed.has(commit)) changed.set(commit, input.changedTestsSince(commit));
|
|
72
|
+
const since = changed.get(commit);
|
|
73
|
+
if (since === void 0) {
|
|
74
|
+
notes.push(`this checkout does not hold ${commit.slice(0, 7)}, where the judge failed ${item.id}`);
|
|
84
75
|
continue;
|
|
85
76
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
commits.set(item.id, commit);
|
|
89
|
-
previous.set(item.id, { ...item, inputs: criterionInputs({ brief: NO_BRIEF, criterion, citations: judgedCitations, testFiles: judged }) });
|
|
90
|
-
}
|
|
91
|
-
const uncited = uncitedIds(criteria, citations);
|
|
92
|
-
const foundIn = uncited.length === 0 ? void 0 : input.foundOutsideTestsAt?.(uncited);
|
|
93
|
-
if (uncited.length > 0 && input.foundOutsideTestsAt !== void 0 && foundIn === void 0) {
|
|
94
|
-
notes.push("the files that could hold the id of a criterion no test cites cannot be read, so its row names none");
|
|
95
|
-
}
|
|
96
|
-
const plan = planCriteria({ criteria, citations, inputs, previous: [...previous.values()], noTestFiles: input.headFiles.length === 0 });
|
|
97
|
-
const settled = new Map(plan.settled.map((item) => [item.id, item]));
|
|
98
|
-
const entries = [];
|
|
99
|
-
for (const criterion of criteria) {
|
|
100
|
-
const item = settled.get(criterion.id);
|
|
101
|
-
if (item === void 0 || item.result !== "fail") continue;
|
|
102
|
-
if (item.refs === void 0) {
|
|
103
|
-
const where = foundIn?.get(criterion.id);
|
|
104
|
-
entries.push({ id: criterion.id, proof: null, state: "uncited", ...where !== void 0 ? { foundIn: where } : item.reason === NO_TEST_FILES_REASON ? { noTestFiles: true } : {} });
|
|
105
|
-
} else entries.push({ id: criterion.id, proof: null, state: "failed", commit: commits.get(criterion.id) ?? "", reason: item.reason ?? "no reason recorded" });
|
|
77
|
+
if (since.length > 0) continue;
|
|
78
|
+
entries.push({ id: criterion.id, proof: null, state: "failed", commit, reason: item.reason ?? "no reason recorded" });
|
|
106
79
|
}
|
|
107
80
|
return { entries, notes };
|
|
108
81
|
}
|
|
109
|
-
function git(cwd, args
|
|
110
|
-
const run = spawnSync("git", args, { cwd,
|
|
82
|
+
function git(cwd, args) {
|
|
83
|
+
const run = spawnSync("git", args, { cwd, maxBuffer: 268435456 });
|
|
111
84
|
if (run.status !== 0) throw new Error(`git ${args[0]} failed`);
|
|
112
85
|
return run.stdout;
|
|
113
86
|
}
|
|
114
|
-
function
|
|
115
|
-
const listing = git(cwd, ["ls-tree", "-r", "-l", "-z", "--full-tree", head]);
|
|
116
|
-
const entries = [];
|
|
117
|
-
for (const entry of listing.toString("utf8").split("\0")) {
|
|
118
|
-
const match = /^(\d+) blob ([0-9a-f]+)\s+(\d+)\t(.*)$/s.exec(entry);
|
|
119
|
-
if (match !== null && match[1].startsWith("100")) entries.push({ path: match[4], oid: match[2], size: Number(match[3]) });
|
|
120
|
-
}
|
|
121
|
-
return entries;
|
|
122
|
-
}
|
|
123
|
-
function readObjects(cwd, specs) {
|
|
124
|
-
const out = git(cwd, ["cat-file", "--batch"], `${specs.join("\n")}
|
|
125
|
-
`);
|
|
126
|
-
const texts = [];
|
|
127
|
-
let at = 0;
|
|
128
|
-
for (let n = 0; n < specs.length; n += 1) {
|
|
129
|
-
const end = out.indexOf(10, at);
|
|
130
|
-
const header = out.subarray(at, end).toString("utf8");
|
|
131
|
-
at = end + 1;
|
|
132
|
-
const match = /^[0-9a-f]+ blob (\d+)$/.exec(header);
|
|
133
|
-
if (match === null) {
|
|
134
|
-
texts.push(void 0);
|
|
135
|
-
continue;
|
|
136
|
-
}
|
|
137
|
-
const size = Number(match[1]);
|
|
138
|
-
texts.push(out.subarray(at, at + size).toString("utf8"));
|
|
139
|
-
at += size + 1;
|
|
140
|
-
}
|
|
141
|
-
return texts;
|
|
142
|
-
}
|
|
143
|
-
function readTexts(cwd, entries, visit) {
|
|
144
|
-
for (const [start, end] of groupBySize(entries.map((entry) => entry.size))) {
|
|
145
|
-
for (const [n, text] of readObjects(cwd, entries.slice(start, end).map((entry) => entry.oid)).entries()) {
|
|
146
|
-
if (text !== void 0 && visit(start + n, text) === false) return;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
function testFilesAt(cwd, head, isTest) {
|
|
151
|
-
try {
|
|
152
|
-
const picked = [];
|
|
153
|
-
for (const entry of treeAt(cwd, head)) {
|
|
154
|
-
if (entry.size > MAX_TEST_FILE_BYTES || !isTest(entry.path)) continue;
|
|
155
|
-
if (picked.length >= MAX_TEST_FILES) break;
|
|
156
|
-
picked.push(entry);
|
|
157
|
-
}
|
|
158
|
-
const files = [];
|
|
159
|
-
readTexts(cwd, picked, (n, text) => {
|
|
160
|
-
files.push({ path: picked[n].path, contents: text });
|
|
161
|
-
});
|
|
162
|
-
return files;
|
|
163
|
-
} catch {
|
|
164
|
-
return void 0;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
function findIdsOutsideTestsAt(cwd, head, input, limits) {
|
|
87
|
+
function proofsFileAt(cwd, commit) {
|
|
168
88
|
try {
|
|
169
|
-
|
|
170
|
-
const scan = new IdScan(input.finder, input.ids);
|
|
171
|
-
readTexts(cwd, picked, (n, text) => {
|
|
172
|
-
scan.offer(picked[n].path, text);
|
|
173
|
-
return !scan.complete;
|
|
174
|
-
});
|
|
175
|
-
return scan.result();
|
|
89
|
+
return git(cwd, ["show", `${commit}:.outerlayer-proofs.yaml`]).toString("utf8");
|
|
176
90
|
} catch {
|
|
177
91
|
return void 0;
|
|
178
92
|
}
|
|
179
93
|
}
|
|
180
|
-
function
|
|
94
|
+
function changedTestsBetween(cwd, commit, head, isTest) {
|
|
181
95
|
try {
|
|
182
|
-
|
|
96
|
+
const listing = git(cwd, ["diff", "--name-only", "-z", "--no-renames", commit, head, "--"]).toString("utf8");
|
|
97
|
+
const atCommit = isTest.at(commit);
|
|
98
|
+
const atHead = isTest.at(head);
|
|
99
|
+
return listing.split("\0").filter((path) => path !== "" && (atCommit(path) || atHead(path)));
|
|
183
100
|
} catch {
|
|
184
101
|
return void 0;
|
|
185
102
|
}
|
|
186
103
|
}
|
|
187
|
-
function matcherAt(cwd, commit, finder) {
|
|
188
|
-
return testFileMatcher(finder, proofsFileAt(cwd, commit));
|
|
189
|
-
}
|
|
190
|
-
function testFilesOf(cwd, commit, finder) {
|
|
191
|
-
return testFilesAt(cwd, commit, matcherAt(cwd, commit, finder));
|
|
192
|
-
}
|
|
193
104
|
function checkoutPlaces(cwd) {
|
|
194
105
|
for (let dir = resolve(cwd); ; dir = dirname(dir)) {
|
|
195
106
|
const dotGit = resolve(dir, ".git");
|
|
@@ -217,14 +128,14 @@ function governingDir(cwd) {
|
|
|
217
128
|
async function testProofMode(cwd) {
|
|
218
129
|
const dir = governingDir(cwd);
|
|
219
130
|
if (dir === void 0) return "any";
|
|
220
|
-
const { testProofIn } = await import('./host-checks-
|
|
131
|
+
const { testProofIn } = await import('./host-checks-VGJVO23Y.js');
|
|
221
132
|
return testProofIn(dir);
|
|
222
133
|
}
|
|
223
134
|
async function judgeCheckName(cwd) {
|
|
224
135
|
const dir = governingDir(cwd);
|
|
225
136
|
if (dir === void 0) return {};
|
|
226
137
|
if (!existsSync(dir)) return { note: `the governed context at ${dir} is not readable` };
|
|
227
|
-
const { checksIn, isJudgeCheck } = await import('./host-checks-
|
|
138
|
+
const { checksIn, isJudgeCheck } = await import('./host-checks-VGJVO23Y.js');
|
|
228
139
|
const quiet = { line: () => void 0, error: () => void 0 };
|
|
229
140
|
const check = checksIn(dir, quiet, "").checks.find((c) => isJudgeCheck(c) && c.judge.subjects === "criteria");
|
|
230
141
|
return check === void 0 ? {} : { name: check.name };
|
|
@@ -236,17 +147,13 @@ async function findUnproven(input) {
|
|
|
236
147
|
const criteria = criteriaOf(input.item);
|
|
237
148
|
if (criteria === void 0) return { entries: [], notes: [] };
|
|
238
149
|
const finder = await loadCitationFinder();
|
|
239
|
-
const
|
|
240
|
-
|
|
150
|
+
const matchers = /* @__PURE__ */ new Map();
|
|
151
|
+
const at = (commit) => {
|
|
152
|
+
if (!matchers.has(commit)) matchers.set(commit, testFileMatcher(finder, proofsFileAt(input.cwd, commit)));
|
|
153
|
+
return matchers.get(commit);
|
|
154
|
+
};
|
|
241
155
|
const items = hostItemsOf(input.item, found.name);
|
|
242
|
-
const result = unprovenCriteria({
|
|
243
|
-
criteria,
|
|
244
|
-
finder,
|
|
245
|
-
headFiles,
|
|
246
|
-
items,
|
|
247
|
-
testFilesAt: (commit) => testFilesOf(input.cwd, commit, finder),
|
|
248
|
-
foundOutsideTestsAt: (ids) => findIdsOutsideTestsAt(input.cwd, input.head, { isTest: matcherAt(input.cwd, input.head, finder), isSearchable: finder.isSearchableFile, finder, ids })
|
|
249
|
-
});
|
|
156
|
+
const result = unprovenCriteria({ criteria, items, changedTestsSince: (commit) => changedTestsBetween(input.cwd, commit, input.head, { at }) });
|
|
250
157
|
const check = Object(input.item).checks?.find((c) => Object(c).name === found.name);
|
|
251
158
|
if (check?.source === "host" && check.result === "fail" && items.length === 0) result.notes.unshift("the gateway returned no check items for the judge's result");
|
|
252
159
|
return result;
|
|
@@ -298,15 +205,8 @@ function classifyProofsAt(data, heads, listing = {}) {
|
|
|
298
205
|
var STATE_LABEL = { current: "current", "out-of-date": "out of date", missing: "missing" };
|
|
299
206
|
function renderEntry(e) {
|
|
300
207
|
const id = sanitizeTerminal(e.id);
|
|
301
|
-
if (e.state === "uncited") {
|
|
302
|
-
if (e.foundIn !== void 0) return `${id} none uncited ${sanitizeTerminal(foundInReason(e.id, e.foundIn))}`;
|
|
303
|
-
if (e.noTestFiles === true) {
|
|
304
|
-
return `${id} none uncited ${NO_TEST_FILES_REASON}`;
|
|
305
|
-
}
|
|
306
|
-
return `${id} none uncited No test at HEAD cites it. Put ${id} in a test's title or in a comment above the test, as in // proves ${id}`;
|
|
307
|
-
}
|
|
308
208
|
if (e.state === "failed") {
|
|
309
|
-
return `${id} none failed ${sanitizeTerminal(e.commit)} The judge failed it: ${sanitizeTerminal(e.reason)} No test
|
|
209
|
+
return `${id} none failed ${sanitizeTerminal(e.commit)} The judge failed it: ${sanitizeTerminal(e.reason)} No test file has changed since. Add or change a test that proves ${id}.`;
|
|
310
210
|
}
|
|
311
211
|
const row = `${id} ${sanitizeTerminal(e.proof)} ${STATE_LABEL[e.state]} ${sanitizeTerminal(e.commit ?? "no commit")}`;
|
|
312
212
|
if (e.proof !== "test" || e.state === "current") return row;
|
|
@@ -369,7 +269,7 @@ async function runWorkProofs(opts) {
|
|
|
369
269
|
async function runWorkProofsCommand(opts) {
|
|
370
270
|
try {
|
|
371
271
|
if (opts.record) {
|
|
372
|
-
const { runWorkProofsRecord } = await import('./work-proofs-record-
|
|
272
|
+
const { runWorkProofsRecord } = await import('./work-proofs-record-FN6M7BIZ.js');
|
|
373
273
|
const result2 = await runWorkProofsRecord(opts);
|
|
374
274
|
process.exitCode = result2.exitCode;
|
|
375
275
|
return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { parseSize, BUILD_LABEL, RUNNER_LABEL, runnerLabelValue } from './chunk-
|
|
4
|
-
import { buildsDir, storeScopes, rootfsDir, orgStoreIn, runnerDir, imagesDir, builderCacheDiskPath } from './chunk-
|
|
3
|
+
import { parseSize, BUILD_LABEL, RUNNER_LABEL, runnerLabelValue } from './chunk-R2IPYS6A.js';
|
|
4
|
+
import { buildsDir, storeScopes, rootfsDir, orgStoreIn, runnerDir, imagesDir, builderCacheDiskPath } from './chunk-RXWFZB3P.js';
|
|
5
5
|
import { spawnSync } from 'child_process';
|
|
6
6
|
import { statfsSync, statSync, existsSync, readdirSync } from 'fs';
|
|
7
7
|
import { dirname, join } from 'path';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { launcherPath, pathNotes, writeLauncher, LauncherWriteError } from './chunk-
|
|
4
|
-
import { currentVersion, currentLink, versionDir, execStartLine, isInLayout, packageRootIn, switchCurrent } from './chunk-
|
|
3
|
+
import { launcherPath, pathNotes, writeLauncher, LauncherWriteError } from './chunk-YLJXRXPX.js';
|
|
4
|
+
import { currentVersion, currentLink, versionDir, execStartLine, isInLayout, packageRootIn, switchCurrent } from './chunk-IJU6DMQA.js';
|
|
5
5
|
import { compareVersions } from './chunk-TQMI335S.js';
|
|
6
|
-
import { runnerDir, RUNNER_DIR_MODE } from './chunk-
|
|
6
|
+
import { runnerDir, RUNNER_DIR_MODE } from './chunk-RXWFZB3P.js';
|
|
7
7
|
import { lchownSync, lstatSync, realpathSync, readFileSync, mkdirSync, rmSync, cpSync, existsSync, readdirSync } from 'fs';
|
|
8
8
|
import { dirname, sep, join } from 'path';
|
|
9
9
|
import { spawnSync } from 'child_process';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { detectActiveSession } from './chunk-
|
|
4
|
-
import { autoConnect } from './chunk-
|
|
5
|
-
import { workPageUrl } from './chunk-
|
|
6
|
-
import { sanitizeTerminal } from './chunk-
|
|
3
|
+
import { detectActiveSession } from './chunk-6MWBZHBW.js';
|
|
4
|
+
import { autoConnect } from './chunk-GBCQ3KHH.js';
|
|
5
|
+
import { workPageUrl } from './chunk-XGJXLITW.js';
|
|
6
|
+
import { sanitizeTerminal } from './chunk-VVZIFOAN.js';
|
|
7
7
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
8
|
-
import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-
|
|
9
|
-
import { signRunnerRequest } from './chunk-
|
|
8
|
+
import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-FYPVUT27.js';
|
|
9
|
+
import { signRunnerRequest } from './chunk-MZ2OOMOT.js';
|
|
10
10
|
import { readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
11
11
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
12
12
|
import { NATIVE_AGENTS, LEGACY_AGENT } from './chunk-QJKW4MKH.js';
|
|
13
13
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
14
|
-
import { resolveRepoIdentity } from './chunk-
|
|
14
|
+
import { resolveRepoIdentity } from './chunk-ZQNYV4OZ.js';
|
|
15
15
|
|
|
16
16
|
createRequire(import.meta.url);
|
|
17
17
|
|
|
@@ -486,7 +486,7 @@ async function runWorkLinkSession(opts) {
|
|
|
486
486
|
return await linkSession(opts);
|
|
487
487
|
} catch (err) {
|
|
488
488
|
if (opts.logFailures) {
|
|
489
|
-
const { logHookError } = await import('./hook-fast-
|
|
489
|
+
const { logHookError } = await import('./hook-fast-27GO6BM2.js');
|
|
490
490
|
const reason = err instanceof Error ? err.message : String(err);
|
|
491
491
|
logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
|
|
492
492
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { defaultAgents } from './chunk-
|
|
3
|
+
import { defaultAgents } from './chunk-UZNSGMUZ.js';
|
|
4
4
|
import { openSync, fstatSync, readSync, closeSync } from 'fs';
|
|
5
5
|
import { join } from 'path';
|
|
6
6
|
|
|
@@ -1,87 +1,94 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { sanitizeTerminal } from './chunk-
|
|
4
|
-
import { resolvePackRoot, parseProofsConfig } from './chunk-
|
|
5
|
-
import { CHECK_ITEM_REASON_MAX_LENGTH, CheckItemsSchema } from './chunk-
|
|
3
|
+
import { sanitizeTerminal } from './chunk-VVZIFOAN.js';
|
|
4
|
+
import { resolvePackRoot, parseProofsConfig } from './chunk-UZNSGMUZ.js';
|
|
5
|
+
import { CHECK_ITEM_REASON_MAX_LENGTH, CheckItemsSchema, CHECK_ITEM_REFS_MAX, CHECK_ITEM_REF_PATH_MAX_LENGTH } from './chunk-2JIGPSVF.js';
|
|
6
6
|
import { createHash } from 'crypto';
|
|
7
7
|
import { join } from 'path';
|
|
8
8
|
import { pathToFileURL } from 'url';
|
|
9
9
|
|
|
10
10
|
createRequire(import.meta.url);
|
|
11
11
|
var ARTIFACT_PROOF_REASON = "Its declared artifact proves it; the judge does not judge artifacts.";
|
|
12
|
-
var
|
|
13
|
-
var NO_TEST_FILES_REASON = "No file at this commit is recognized as a test. Name the repository's test files with a runner glob in `.outerlayer-proofs.yaml`.";
|
|
12
|
+
var NO_NAMED_TEST_REASON = "The judge named no test file that proves this criterion.";
|
|
14
13
|
var NO_VERDICT_REASON = "The judge gave no result for this criterion.";
|
|
15
|
-
|
|
14
|
+
var JUDGE_GROUP_SIZE = 12;
|
|
15
|
+
function notReadAsTestReason(paths) {
|
|
16
16
|
const named = paths.slice(0, 3).map((path2) => `\`${path2}\``);
|
|
17
|
-
const list =
|
|
18
|
-
const
|
|
19
|
-
|
|
17
|
+
const list = named.length === 1 ? named[0] : `${named.slice(0, -1).join(", ")} and ${named.at(-1)}`;
|
|
18
|
+
const more = paths.length > 3 ? " and other files" : "";
|
|
19
|
+
const one = paths.length === 1;
|
|
20
|
+
return `The judge named ${list}${more}, which ${one ? "is" : "are"} not read as ${one ? "a test" : "tests"}. If ${one ? "that file holds" : "one of them holds"} the test, name it with a runner glob in \`.outerlayer-proofs.yaml\`.`;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
function treePath(raw, treeRoot) {
|
|
23
|
+
let path2 = raw.trim().replace(/\\/g, "/");
|
|
24
|
+
const root = `${treeRoot.replace(/\/+$/, "")}/`;
|
|
25
|
+
if (path2.startsWith(root)) path2 = path2.slice(root.length);
|
|
26
|
+
while (path2.startsWith("./")) path2 = path2.slice(2);
|
|
27
|
+
if (path2 === "" || path2.length > CHECK_ITEM_REF_PATH_MAX_LENGTH || path2.startsWith("/") || /[\u0000-\u001f\u007f]/.test(path2)) return void 0;
|
|
28
|
+
if (path2.split("/").some((segment) => segment === ".." || segment === "")) return void 0;
|
|
29
|
+
return path2;
|
|
28
30
|
}
|
|
29
31
|
function criterionInputs(input) {
|
|
30
|
-
const paths = [...new Set((input.citations[input.criterion.id] ?? []).map((citation) => citation.path))].sort();
|
|
31
32
|
const hash = createHash("sha256");
|
|
32
33
|
const part = (text) => {
|
|
33
34
|
hash.update(`${Buffer.byteLength(text)}:`);
|
|
34
35
|
hash.update(text);
|
|
35
36
|
};
|
|
36
|
-
part("judge-criterion-
|
|
37
|
+
part("judge-criterion-v2");
|
|
37
38
|
part(input.brief);
|
|
38
39
|
part(input.criterion.id);
|
|
39
40
|
part(input.criterion.text);
|
|
40
41
|
part(input.criterion.proof ?? "");
|
|
41
|
-
for (const path2 of
|
|
42
|
+
for (const path2 of [...input.files.keys()].sort()) {
|
|
43
|
+
const text = input.files.get(path2);
|
|
42
44
|
part(path2);
|
|
43
|
-
part(
|
|
45
|
+
part(text === void 0 ? "missing" : `text:${text}`);
|
|
44
46
|
}
|
|
45
47
|
return hash.digest("hex");
|
|
46
48
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const refs = (citations[id] ?? []).slice(0, 20).map((citation) => ({
|
|
50
|
-
path: citation.path,
|
|
51
|
-
line: citation.line,
|
|
52
|
-
// Only an https link becomes an href on a page; any other is left off rather than refusing the check.
|
|
53
|
-
...HTTPS_LINK.test(citation.href ?? "") ? { href: citation.href } : {}
|
|
54
|
-
}));
|
|
55
|
-
return refs.length === 0 ? void 0 : refs;
|
|
49
|
+
function refPaths(refs) {
|
|
50
|
+
return [...new Set((refs ?? []).map((ref) => ref.path))].sort();
|
|
56
51
|
}
|
|
57
52
|
function planCriteria(input) {
|
|
58
53
|
const previousById = new Map(input.previous.map((item) => [item.id, item]));
|
|
59
54
|
const settled = [];
|
|
60
55
|
const toJudge = [];
|
|
61
56
|
for (const criterion of input.criteria) {
|
|
62
|
-
const
|
|
63
|
-
const base = { id: criterion.id, criterion: criterion.id, ...inputs === void 0 ? {} : { inputs } };
|
|
64
|
-
const refs = refsFor(criterion.id, input.citations);
|
|
57
|
+
const base = { id: criterion.id, criterion: criterion.id };
|
|
65
58
|
if (criterion.proof !== null) {
|
|
66
59
|
settled.push({ ...base, result: "skipped", reason: ARTIFACT_PROOF_REASON });
|
|
67
60
|
continue;
|
|
68
61
|
}
|
|
69
|
-
if (refs === void 0) {
|
|
70
|
-
const where = input.foundIn?.get(criterion.id) ?? [];
|
|
71
|
-
const reason = where.length > 0 ? foundInReason(criterion.id, where) : input.noTestFiles === true ? NO_TEST_FILES_REASON : NO_CITING_TEST_REASON;
|
|
72
|
-
settled.push({ ...base, result: "fail", reason });
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
62
|
const kept = previousById.get(criterion.id);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
63
|
+
const paths = refPaths(kept?.refs);
|
|
64
|
+
if (kept !== void 0 && kept.result === "pass" && kept.inputs !== void 0 && paths.length > 0) {
|
|
65
|
+
const inputs = input.inputsFor(criterion, paths);
|
|
66
|
+
if (inputs === kept.inputs) {
|
|
67
|
+
settled.push({ ...base, ...kept.commit === void 0 ? {} : { commit: kept.commit }, result: "pass", ...kept.reason === void 0 ? {} : { reason: kept.reason }, refs: kept.refs, inputs });
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
79
70
|
}
|
|
80
71
|
toJudge.push(criterion);
|
|
81
72
|
}
|
|
82
73
|
return { settled, toJudge };
|
|
83
74
|
}
|
|
75
|
+
function judgeGroups(criteria, size = JUDGE_GROUP_SIZE) {
|
|
76
|
+
const groups = [];
|
|
77
|
+
for (let start = 0; start < criteria.length; start += size) groups.push(criteria.slice(start, start + size));
|
|
78
|
+
return groups;
|
|
79
|
+
}
|
|
84
80
|
var MAX_ANSWER_ENTRIES = 500;
|
|
81
|
+
var MAX_NAMED_TESTS = 50;
|
|
82
|
+
function readTests(raw) {
|
|
83
|
+
if (!Array.isArray(raw)) return void 0;
|
|
84
|
+
const tests = [];
|
|
85
|
+
for (const entry of raw.slice(0, MAX_NAMED_TESTS)) {
|
|
86
|
+
const { path: path2, line } = typeof entry === "object" && entry !== null ? entry : {};
|
|
87
|
+
if (typeof path2 !== "string" || path2 === "" || path2.length > 1024) continue;
|
|
88
|
+
tests.push({ path: path2, ...typeof line === "number" && Number.isInteger(line) && line > 0 ? { line } : {} });
|
|
89
|
+
}
|
|
90
|
+
return tests;
|
|
91
|
+
}
|
|
85
92
|
function readAnswer(raw) {
|
|
86
93
|
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) return { ok: false, problem: "expected an object" };
|
|
87
94
|
const { result, items } = raw;
|
|
@@ -91,11 +98,12 @@ function readAnswer(raw) {
|
|
|
91
98
|
if (entries.length > MAX_ANSWER_ENTRIES) return { ok: false, problem: `items: at most ${MAX_ANSWER_ENTRIES} entries` };
|
|
92
99
|
const read = [];
|
|
93
100
|
for (const [index, entry] of entries.entries()) {
|
|
94
|
-
const { id, result: itemResult, reason } = typeof entry === "object" && entry !== null ? entry : {};
|
|
101
|
+
const { id, result: itemResult, reason, tests } = typeof entry === "object" && entry !== null ? entry : {};
|
|
95
102
|
if (typeof id !== "string" || id === "" || id.length > 200) return { ok: false, problem: `items.${index}.id: must be text of 1 to 200 characters` };
|
|
96
103
|
if (itemResult !== "pass" && itemResult !== "fail") return { ok: false, problem: `items.${index}.result: must be "pass" or "fail"` };
|
|
97
104
|
if (reason !== void 0 && typeof reason !== "string") return { ok: false, problem: `items.${index}.reason: must be text` };
|
|
98
|
-
|
|
105
|
+
const named = readTests(tests);
|
|
106
|
+
read.push({ id, result: itemResult, ...reason === void 0 ? {} : { reason }, ...named === void 0 ? {} : { tests: named } });
|
|
99
107
|
}
|
|
100
108
|
return { ok: true, answer: { ...result === void 0 ? {} : { result }, items: read } };
|
|
101
109
|
}
|
|
@@ -116,22 +124,53 @@ function oneLineReason(text) {
|
|
|
116
124
|
if (line === "") return void 0;
|
|
117
125
|
return line.length <= CHECK_ITEM_REASON_MAX_LENGTH ? line : `${line.slice(0, CHECK_ITEM_REASON_MAX_LENGTH - 1)}\u2026`;
|
|
118
126
|
}
|
|
127
|
+
function namedTests(tests, input) {
|
|
128
|
+
const refs = [];
|
|
129
|
+
const notTests = [];
|
|
130
|
+
const seen = /* @__PURE__ */ new Set();
|
|
131
|
+
for (const test of tests ?? []) {
|
|
132
|
+
const written = treePath(test.path, input.treeRoot);
|
|
133
|
+
if (written === void 0) continue;
|
|
134
|
+
const path2 = written.startsWith("tree/") && input.ownTree !== true ? written.slice("tree/".length) : written;
|
|
135
|
+
if (path2 === "") continue;
|
|
136
|
+
const known = input.check(path2, test.line);
|
|
137
|
+
if (known === void 0) continue;
|
|
138
|
+
const key = `${path2}:${test.line ?? ""}`;
|
|
139
|
+
if (seen.has(key)) continue;
|
|
140
|
+
if (known === "not-a-test") {
|
|
141
|
+
if (!notTests.includes(path2)) notTests.push(path2);
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
seen.add(key);
|
|
145
|
+
refs.push({ path: path2, ...test.line === void 0 ? {} : { line: test.line }, ...known.href === void 0 ? {} : { href: known.href } });
|
|
146
|
+
if (refs.length >= CHECK_ITEM_REFS_MAX) break;
|
|
147
|
+
}
|
|
148
|
+
return { refs, notTests };
|
|
149
|
+
}
|
|
119
150
|
function judgedItems(input) {
|
|
120
151
|
return input.toJudge.map((criterion) => {
|
|
121
152
|
const said = input.results.get(criterion.id);
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
...refs === void 0 ? {} : { refs },
|
|
131
|
-
...inputs === void 0 || said === void 0 ? {} : { inputs }
|
|
132
|
-
};
|
|
153
|
+
const base = { id: criterion.id, criterion: criterion.id, commit: input.commit };
|
|
154
|
+
if (said === void 0) return { ...base, result: "fail", reason: NO_VERDICT_REASON };
|
|
155
|
+
const { refs, notTests } = namedTests(said.tests, { treeRoot: input.treeRoot, check: input.check, ownTree: input.ownTree });
|
|
156
|
+
const withRefs = refs.length === 0 ? {} : { refs };
|
|
157
|
+
if (said.result === "pass" && refs.length === 0) return { ...base, result: "fail", reason: notTests.length > 0 ? oneLineReason(notReadAsTestReason(notTests)) : NO_NAMED_TEST_REASON };
|
|
158
|
+
const reason = oneLineReason(said.reason);
|
|
159
|
+
const kept = said.result === "pass" ? { inputs: input.inputsFor(criterion, refPaths(refs)) } : {};
|
|
160
|
+
return { ...base, result: said.result, ...reason === void 0 ? {} : { reason }, ...withRefs, ...kept };
|
|
133
161
|
});
|
|
134
162
|
}
|
|
163
|
+
function failedItems(criteria, reason) {
|
|
164
|
+
const said = oneLineReason(reason) ?? NO_VERDICT_REASON;
|
|
165
|
+
return criteria.map((criterion) => ({ id: criterion.id, criterion: criterion.id, result: "fail", reason: said }));
|
|
166
|
+
}
|
|
167
|
+
function testsByCriterion(items) {
|
|
168
|
+
const tests = {};
|
|
169
|
+
for (const item of items) {
|
|
170
|
+
tests[item.id] = (item.refs ?? []).flatMap((ref) => ref.line === void 0 ? [] : [{ path: ref.path, line: ref.line, href: ref.href ?? null }]);
|
|
171
|
+
}
|
|
172
|
+
return tests;
|
|
173
|
+
}
|
|
135
174
|
function inCriteriaOrder(items, criteria) {
|
|
136
175
|
const order = new Map(criteria.map((criterion, index) => [criterion.id, index]));
|
|
137
176
|
return [...items].sort((a, b) => (order.get(a.id) ?? Number.MAX_SAFE_INTEGER) - (order.get(b.id) ?? Number.MAX_SAFE_INTEGER));
|
|
@@ -2041,7 +2080,6 @@ function runnerMatcher(runners) {
|
|
|
2041
2080
|
return index === -1 ? void 0 : index;
|
|
2042
2081
|
};
|
|
2043
2082
|
}
|
|
2044
|
-
var MAX_TEST_FILES = 2e4;
|
|
2045
2083
|
var MAX_TEST_FILE_BYTES = 1024 * 1024;
|
|
2046
2084
|
async function loadCitationFinder() {
|
|
2047
2085
|
return await import(pathToFileURL(join(resolvePackRoot(), "maintained", "outerlayer-build", "scripts", "criterion-citations.mjs")).href);
|
|
@@ -2074,70 +2112,4 @@ function hostItemsOf(workItem, name) {
|
|
|
2074
2112
|
return parsed.success ? parsed.data : [];
|
|
2075
2113
|
}
|
|
2076
2114
|
|
|
2077
|
-
|
|
2078
|
-
var MAX_FOUND_FILES = 4;
|
|
2079
|
-
var MAX_NAMED_PATH_LENGTH = 200;
|
|
2080
|
-
var JUDGE_LIMITS = { files: MAX_TEST_FILES, bytes: MAX_TEST_FILE_BYTES };
|
|
2081
|
-
function isSearchCandidate(file, rules, maxBytes = MAX_TEST_FILE_BYTES) {
|
|
2082
|
-
return file.size <= maxBytes && !rules.isTest(file.path) && rules.isSearchable(file.path);
|
|
2083
|
-
}
|
|
2084
|
-
function firstInPathOrder(files, limit) {
|
|
2085
|
-
return [...files].sort((a, b) => a.path < b.path ? -1 : 1).slice(0, limit);
|
|
2086
|
-
}
|
|
2087
|
-
function pickSearchable(candidates, rules, limits = JUDGE_LIMITS) {
|
|
2088
|
-
return firstInPathOrder(
|
|
2089
|
-
candidates.filter((file) => isSearchCandidate(file, rules, limits.bytes)),
|
|
2090
|
-
limits.files
|
|
2091
|
-
);
|
|
2092
|
-
}
|
|
2093
|
-
var READ_GROUP = { files: 500, bytes: 33554432 };
|
|
2094
|
-
function groupBySize(sizes, limit = READ_GROUP) {
|
|
2095
|
-
const groups = [];
|
|
2096
|
-
let start = 0;
|
|
2097
|
-
let bytes = 0;
|
|
2098
|
-
for (let at = 0; at < sizes.length; at += 1) {
|
|
2099
|
-
if (at > start && (at - start >= limit.files || bytes + sizes[at] > limit.bytes)) {
|
|
2100
|
-
groups.push([start, at]);
|
|
2101
|
-
start = at;
|
|
2102
|
-
bytes = 0;
|
|
2103
|
-
}
|
|
2104
|
-
bytes += sizes[at];
|
|
2105
|
-
}
|
|
2106
|
-
if (start < sizes.length) groups.push([start, sizes.length]);
|
|
2107
|
-
return groups;
|
|
2108
|
-
}
|
|
2109
|
-
function isNameable(path2) {
|
|
2110
|
-
if (path2.length > MAX_NAMED_PATH_LENGTH) return false;
|
|
2111
|
-
for (const character of path2) {
|
|
2112
|
-
const code = character.codePointAt(0);
|
|
2113
|
-
if (code < 32 || code >= 127 && code <= 159 || character === "`") return false;
|
|
2114
|
-
if (code === 8232 || code === 8233 || code >= 8234 && code <= 8238 || code >= 8294 && code <= 8297) return false;
|
|
2115
|
-
}
|
|
2116
|
-
return true;
|
|
2117
|
-
}
|
|
2118
|
-
var IdScan = class {
|
|
2119
|
-
constructor(finder, ids) {
|
|
2120
|
-
this.found = /* @__PURE__ */ new Map();
|
|
2121
|
-
this.pending = [...new Set(ids)].filter((id) => id !== "");
|
|
2122
|
-
this.patterns = new Map(this.pending.map((id) => [id, finder.idPattern(id)]));
|
|
2123
|
-
}
|
|
2124
|
-
/** True when every id has all its paths, so no later file can change the result. */
|
|
2125
|
-
get complete() {
|
|
2126
|
-
return this.pending.length === 0;
|
|
2127
|
-
}
|
|
2128
|
-
offer(path2, contents) {
|
|
2129
|
-
if (this.complete || !isNameable(path2) || contents.includes("\0")) return;
|
|
2130
|
-
for (const id of [...this.pending]) {
|
|
2131
|
-
if (!contents.includes(id) || !this.patterns.get(id).test(contents)) continue;
|
|
2132
|
-
const paths = this.found.get(id) ?? [];
|
|
2133
|
-
paths.push(path2);
|
|
2134
|
-
this.found.set(id, paths);
|
|
2135
|
-
if (paths.length >= MAX_FOUND_FILES) this.pending.splice(this.pending.indexOf(id), 1);
|
|
2136
|
-
}
|
|
2137
|
-
}
|
|
2138
|
-
result() {
|
|
2139
|
-
return this.found;
|
|
2140
|
-
}
|
|
2141
|
-
};
|
|
2142
|
-
|
|
2143
|
-
export { IdScan, MAX_TEST_FILES, MAX_TEST_FILE_BYTES, NO_CITING_TEST_REASON, NO_TEST_FILES_REASON, NO_VERDICT_REASON, criteriaOf, criterionInputs, firstInPathOrder, foundInReason, groupBySize, hostItemsOf, inCriteriaOrder, isFoundInReason, isSearchCandidate, itemsSentence, judgedItems, loadCitationFinder, oneLineReason, parseJudgeAnswer, pickSearchable, planCriteria, runnerMatcher, testFileMatcher, uncitedIds };
|
|
2115
|
+
export { MAX_TEST_FILE_BYTES, NO_VERDICT_REASON, criteriaOf, criterionInputs, failedItems, hostItemsOf, inCriteriaOrder, itemsSentence, judgeGroups, judgedItems, loadCitationFinder, oneLineReason, parseJudgeAnswer, planCriteria, runnerMatcher, testFileMatcher, testsByCriterion };
|