@quikit/quikpilot-runner 9.3.0-rc.76 → 9.3.0-rc.78
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/README.md +325 -319
- package/dist/index.js +527 -290
- package/dist/index.js.map +3 -3
- package/package.json +30 -30
package/dist/index.js
CHANGED
|
@@ -5106,24 +5106,24 @@ var require_base = __commonJS2({
|
|
|
5106
5106
|
}
|
|
5107
5107
|
exports2.augmentError = augmentError;
|
|
5108
5108
|
var Loc = class {
|
|
5109
|
-
constructor(
|
|
5110
|
-
this.line =
|
|
5109
|
+
constructor(line2, column) {
|
|
5110
|
+
this.line = line2;
|
|
5111
5111
|
this.column = column;
|
|
5112
5112
|
}
|
|
5113
5113
|
};
|
|
5114
5114
|
exports2.Loc = Loc;
|
|
5115
5115
|
function locationForIndex(pos) {
|
|
5116
|
-
let
|
|
5116
|
+
let line2 = 1;
|
|
5117
5117
|
let column = 1;
|
|
5118
5118
|
for (let i3 = 0; i3 < pos; i3++) {
|
|
5119
5119
|
if (exports2.input.charCodeAt(i3) === _charcodes.charCodes.lineFeed) {
|
|
5120
|
-
|
|
5120
|
+
line2++;
|
|
5121
5121
|
column = 1;
|
|
5122
5122
|
} else {
|
|
5123
5123
|
column++;
|
|
5124
5124
|
}
|
|
5125
5125
|
}
|
|
5126
|
-
return new Loc(
|
|
5126
|
+
return new Loc(line2, column);
|
|
5127
5127
|
}
|
|
5128
5128
|
exports2.locationForIndex = locationForIndex;
|
|
5129
5129
|
function initParser(inputCode, isJSXEnabledArg, isTypeScriptEnabledArg, isFlowEnabledArg) {
|
|
@@ -16961,20 +16961,20 @@ var require_sourcemap_codec_umd = __commonJS2({
|
|
|
16961
16961
|
const reader = new StringReader(input);
|
|
16962
16962
|
const scopes = [];
|
|
16963
16963
|
const stack = [];
|
|
16964
|
-
let
|
|
16964
|
+
let line2 = 0;
|
|
16965
16965
|
for (; reader.pos < length; reader.pos++) {
|
|
16966
|
-
|
|
16966
|
+
line2 = decodeInteger(reader, line2);
|
|
16967
16967
|
const column = decodeInteger(reader, 0);
|
|
16968
16968
|
if (!hasMoreVlq(reader, length)) {
|
|
16969
16969
|
const last = stack.pop();
|
|
16970
|
-
last[2] =
|
|
16970
|
+
last[2] = line2;
|
|
16971
16971
|
last[3] = column;
|
|
16972
16972
|
continue;
|
|
16973
16973
|
}
|
|
16974
16974
|
const kind = decodeInteger(reader, 0);
|
|
16975
16975
|
const fields = decodeInteger(reader, 0);
|
|
16976
16976
|
const hasName = fields & 1;
|
|
16977
|
-
const scope = hasName ? [
|
|
16977
|
+
const scope = hasName ? [line2, column, 0, 0, kind, decodeInteger(reader, 0)] : [line2, column, 0, 0, kind];
|
|
16978
16978
|
let vars = EMPTY2;
|
|
16979
16979
|
if (hasMoreVlq(reader, length)) {
|
|
16980
16980
|
vars = [];
|
|
@@ -17191,10 +17191,10 @@ var require_sourcemap_codec_umd = __commonJS2({
|
|
|
17191
17191
|
state[1] = encodeInteger(writer, endColumn, state[1]);
|
|
17192
17192
|
return index;
|
|
17193
17193
|
}
|
|
17194
|
-
function catchupLine(writer, lastLine,
|
|
17194
|
+
function catchupLine(writer, lastLine, line2) {
|
|
17195
17195
|
do {
|
|
17196
17196
|
writer.write(semicolon);
|
|
17197
|
-
} while (++lastLine <
|
|
17197
|
+
} while (++lastLine < line2);
|
|
17198
17198
|
}
|
|
17199
17199
|
function decode(mappings) {
|
|
17200
17200
|
const { length } = mappings;
|
|
@@ -17207,7 +17207,7 @@ var require_sourcemap_codec_umd = __commonJS2({
|
|
|
17207
17207
|
let namesIndex = 0;
|
|
17208
17208
|
do {
|
|
17209
17209
|
const semi = reader.indexOf(";");
|
|
17210
|
-
const
|
|
17210
|
+
const line2 = [];
|
|
17211
17211
|
let sorted = true;
|
|
17212
17212
|
let lastCol = 0;
|
|
17213
17213
|
genColumn = 0;
|
|
@@ -17229,17 +17229,17 @@ var require_sourcemap_codec_umd = __commonJS2({
|
|
|
17229
17229
|
} else {
|
|
17230
17230
|
seg = [genColumn];
|
|
17231
17231
|
}
|
|
17232
|
-
|
|
17232
|
+
line2.push(seg);
|
|
17233
17233
|
reader.pos++;
|
|
17234
17234
|
}
|
|
17235
|
-
if (!sorted) sort(
|
|
17236
|
-
decoded.push(
|
|
17235
|
+
if (!sorted) sort(line2);
|
|
17236
|
+
decoded.push(line2);
|
|
17237
17237
|
reader.pos = semi + 1;
|
|
17238
17238
|
} while (reader.pos <= length);
|
|
17239
17239
|
return decoded;
|
|
17240
17240
|
}
|
|
17241
|
-
function sort(
|
|
17242
|
-
|
|
17241
|
+
function sort(line2) {
|
|
17242
|
+
line2.sort(sortComparator);
|
|
17243
17243
|
}
|
|
17244
17244
|
function sortComparator(a, b) {
|
|
17245
17245
|
return a[0] - b[0];
|
|
@@ -17251,12 +17251,12 @@ var require_sourcemap_codec_umd = __commonJS2({
|
|
|
17251
17251
|
let sourceColumn = 0;
|
|
17252
17252
|
let namesIndex = 0;
|
|
17253
17253
|
for (let i3 = 0; i3 < decoded.length; i3++) {
|
|
17254
|
-
const
|
|
17254
|
+
const line2 = decoded[i3];
|
|
17255
17255
|
if (i3 > 0) writer.write(semicolon);
|
|
17256
|
-
if (
|
|
17256
|
+
if (line2.length === 0) continue;
|
|
17257
17257
|
let genColumn = 0;
|
|
17258
|
-
for (let j = 0; j <
|
|
17259
|
-
const segment =
|
|
17258
|
+
for (let j = 0; j < line2.length; j++) {
|
|
17259
|
+
const segment = line2[j];
|
|
17260
17260
|
if (j > 0) writer.write(comma);
|
|
17261
17261
|
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
17262
17262
|
if (segment.length === 1) continue;
|
|
@@ -17570,17 +17570,17 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17570
17570
|
}
|
|
17571
17571
|
return mappings.length;
|
|
17572
17572
|
}
|
|
17573
|
-
function isSorted(
|
|
17574
|
-
for (let j = 1; j <
|
|
17575
|
-
if (
|
|
17573
|
+
function isSorted(line2) {
|
|
17574
|
+
for (let j = 1; j < line2.length; j++) {
|
|
17575
|
+
if (line2[j][COLUMN] < line2[j - 1][COLUMN]) {
|
|
17576
17576
|
return false;
|
|
17577
17577
|
}
|
|
17578
17578
|
}
|
|
17579
17579
|
return true;
|
|
17580
17580
|
}
|
|
17581
|
-
function sortSegments(
|
|
17582
|
-
if (!owned)
|
|
17583
|
-
return
|
|
17581
|
+
function sortSegments(line2, owned) {
|
|
17582
|
+
if (!owned) line2 = line2.slice();
|
|
17583
|
+
return line2.sort(sortComparator);
|
|
17584
17584
|
}
|
|
17585
17585
|
function sortComparator(a, b) {
|
|
17586
17586
|
return a[COLUMN] - b[COLUMN];
|
|
@@ -17588,9 +17588,9 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17588
17588
|
function buildBySources(decoded, memos) {
|
|
17589
17589
|
const sources = memos.map(() => []);
|
|
17590
17590
|
for (let i3 = 0; i3 < decoded.length; i3++) {
|
|
17591
|
-
const
|
|
17592
|
-
for (let j = 0; j <
|
|
17593
|
-
const seg =
|
|
17591
|
+
const line2 = decoded[i3];
|
|
17592
|
+
for (let j = 0; j < line2.length; j++) {
|
|
17593
|
+
const seg = line2[j];
|
|
17594
17594
|
if (seg.length === 1) continue;
|
|
17595
17595
|
const sourceIndex2 = seg[SOURCES_INDEX];
|
|
17596
17596
|
const sourceLine = seg[SOURCE_LINE];
|
|
@@ -17603,8 +17603,8 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17603
17603
|
for (let i3 = 0; i3 < sources.length; i3++) {
|
|
17604
17604
|
const source = sources[i3];
|
|
17605
17605
|
for (let j = 0; j < source.length; j++) {
|
|
17606
|
-
const
|
|
17607
|
-
if (
|
|
17606
|
+
const line2 = source[j];
|
|
17607
|
+
if (line2) line2.sort(sortComparator);
|
|
17608
17608
|
}
|
|
17609
17609
|
}
|
|
17610
17610
|
return sources;
|
|
@@ -17665,11 +17665,11 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17665
17665
|
state.lastNeedle = needle;
|
|
17666
17666
|
return state.lastIndex = binarySearch(haystack, needle, low, high);
|
|
17667
17667
|
}
|
|
17668
|
-
function
|
|
17668
|
+
function parse7(map) {
|
|
17669
17669
|
return typeof map === "string" ? JSON.parse(map) : map;
|
|
17670
17670
|
}
|
|
17671
17671
|
var FlattenMap = function(map, mapUrl) {
|
|
17672
|
-
const parsed =
|
|
17672
|
+
const parsed = parse7(map);
|
|
17673
17673
|
if (!("sections" in parsed)) {
|
|
17674
17674
|
return new TraceMap(parsed, mapUrl);
|
|
17675
17675
|
}
|
|
@@ -17733,7 +17733,7 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17733
17733
|
}
|
|
17734
17734
|
}
|
|
17735
17735
|
function addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {
|
|
17736
|
-
const parsed =
|
|
17736
|
+
const parsed = parse7(input);
|
|
17737
17737
|
if ("sections" in parsed) return recurse(...arguments);
|
|
17738
17738
|
const map = new TraceMap(parsed, mapUrl);
|
|
17739
17739
|
const sourcesOffset = sources.length;
|
|
@@ -17750,9 +17750,9 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17750
17750
|
if (lineI > stopLine) return;
|
|
17751
17751
|
const out2 = getLine(mappings, lineI);
|
|
17752
17752
|
const cOffset = i3 === 0 ? columnOffset : 0;
|
|
17753
|
-
const
|
|
17754
|
-
for (let j = 0; j <
|
|
17755
|
-
const seg =
|
|
17753
|
+
const line2 = decoded[i3];
|
|
17754
|
+
for (let j = 0; j < line2.length; j++) {
|
|
17755
|
+
const seg = line2[j];
|
|
17756
17756
|
const column = cOffset + seg[COLUMN];
|
|
17757
17757
|
if (lineI === stopLine && column >= stopColumn) return;
|
|
17758
17758
|
if (seg.length === 1) {
|
|
@@ -17783,7 +17783,7 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17783
17783
|
constructor(map, mapUrl) {
|
|
17784
17784
|
const isString = typeof map === "string";
|
|
17785
17785
|
if (!isString && map._decodedMemo) return map;
|
|
17786
|
-
const parsed =
|
|
17786
|
+
const parsed = parse7(map);
|
|
17787
17787
|
const { version: version2, file, names, sourceRoot, sources, sourcesContent } = parsed;
|
|
17788
17788
|
this.version = version2;
|
|
17789
17789
|
this.file = file;
|
|
@@ -17822,31 +17822,31 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17822
17822
|
var _a;
|
|
17823
17823
|
return (_a = cast(map))._decoded || (_a._decoded = (0, import_sourcemap_codec.decode)(cast(map)._encoded));
|
|
17824
17824
|
}
|
|
17825
|
-
function traceSegment(map,
|
|
17825
|
+
function traceSegment(map, line2, column) {
|
|
17826
17826
|
const decoded = decodedMappings(map);
|
|
17827
|
-
if (
|
|
17828
|
-
const segments = decoded[
|
|
17827
|
+
if (line2 >= decoded.length) return null;
|
|
17828
|
+
const segments = decoded[line2];
|
|
17829
17829
|
const index = traceSegmentInternal(
|
|
17830
17830
|
segments,
|
|
17831
17831
|
cast(map)._decodedMemo,
|
|
17832
|
-
|
|
17832
|
+
line2,
|
|
17833
17833
|
column,
|
|
17834
17834
|
GREATEST_LOWER_BOUND
|
|
17835
17835
|
);
|
|
17836
17836
|
return index === -1 ? null : segments[index];
|
|
17837
17837
|
}
|
|
17838
17838
|
function originalPositionFor(map, needle) {
|
|
17839
|
-
let { line, column, bias } = needle;
|
|
17840
|
-
|
|
17841
|
-
if (
|
|
17839
|
+
let { line: line2, column, bias } = needle;
|
|
17840
|
+
line2--;
|
|
17841
|
+
if (line2 < 0) throw new Error(LINE_GTR_ZERO);
|
|
17842
17842
|
if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
|
|
17843
17843
|
const decoded = decodedMappings(map);
|
|
17844
|
-
if (
|
|
17845
|
-
const segments = decoded[
|
|
17844
|
+
if (line2 >= decoded.length) return OMapping(null, null, null, null);
|
|
17845
|
+
const segments = decoded[line2];
|
|
17846
17846
|
const index = traceSegmentInternal(
|
|
17847
17847
|
segments,
|
|
17848
17848
|
cast(map)._decodedMemo,
|
|
17849
|
-
|
|
17849
|
+
line2,
|
|
17850
17850
|
column,
|
|
17851
17851
|
bias || GREATEST_LOWER_BOUND
|
|
17852
17852
|
);
|
|
@@ -17862,20 +17862,20 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17862
17862
|
);
|
|
17863
17863
|
}
|
|
17864
17864
|
function generatedPositionFor(map, needle) {
|
|
17865
|
-
const { source, line, column, bias } = needle;
|
|
17866
|
-
return generatedPosition(map, source,
|
|
17865
|
+
const { source, line: line2, column, bias } = needle;
|
|
17866
|
+
return generatedPosition(map, source, line2, column, bias || GREATEST_LOWER_BOUND, false);
|
|
17867
17867
|
}
|
|
17868
17868
|
function allGeneratedPositionsFor(map, needle) {
|
|
17869
|
-
const { source, line, column, bias } = needle;
|
|
17870
|
-
return generatedPosition(map, source,
|
|
17869
|
+
const { source, line: line2, column, bias } = needle;
|
|
17870
|
+
return generatedPosition(map, source, line2, column, bias || LEAST_UPPER_BOUND, true);
|
|
17871
17871
|
}
|
|
17872
17872
|
function eachMapping(map, cb) {
|
|
17873
17873
|
const decoded = decodedMappings(map);
|
|
17874
17874
|
const { names, resolvedSources } = map;
|
|
17875
17875
|
for (let i3 = 0; i3 < decoded.length; i3++) {
|
|
17876
|
-
const
|
|
17877
|
-
for (let j = 0; j <
|
|
17878
|
-
const seg =
|
|
17876
|
+
const line2 = decoded[i3];
|
|
17877
|
+
for (let j = 0; j < line2.length; j++) {
|
|
17878
|
+
const seg = line2[j];
|
|
17879
17879
|
const generatedLine = i3 + 1;
|
|
17880
17880
|
const generatedColumn = seg[0];
|
|
17881
17881
|
let source = null;
|
|
@@ -17940,22 +17940,22 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17940
17940
|
ignoreList: map.ignoreList || map.x_google_ignoreList
|
|
17941
17941
|
};
|
|
17942
17942
|
}
|
|
17943
|
-
function OMapping(source,
|
|
17944
|
-
return { source, line, column, name: name2 };
|
|
17943
|
+
function OMapping(source, line2, column, name2) {
|
|
17944
|
+
return { source, line: line2, column, name: name2 };
|
|
17945
17945
|
}
|
|
17946
|
-
function GMapping(
|
|
17947
|
-
return { line, column };
|
|
17946
|
+
function GMapping(line2, column) {
|
|
17947
|
+
return { line: line2, column };
|
|
17948
17948
|
}
|
|
17949
|
-
function traceSegmentInternal(segments, memo,
|
|
17950
|
-
let index = memoizedBinarySearch(segments, column, memo,
|
|
17949
|
+
function traceSegmentInternal(segments, memo, line2, column, bias) {
|
|
17950
|
+
let index = memoizedBinarySearch(segments, column, memo, line2);
|
|
17951
17951
|
if (found) {
|
|
17952
17952
|
index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
|
|
17953
17953
|
} else if (bias === LEAST_UPPER_BOUND) index++;
|
|
17954
17954
|
if (index === -1 || index === segments.length) return -1;
|
|
17955
17955
|
return index;
|
|
17956
17956
|
}
|
|
17957
|
-
function sliceGeneratedPositions(segments, memo,
|
|
17958
|
-
let min = traceSegmentInternal(segments, memo,
|
|
17957
|
+
function sliceGeneratedPositions(segments, memo, line2, column, bias) {
|
|
17958
|
+
let min = traceSegmentInternal(segments, memo, line2, column, GREATEST_LOWER_BOUND);
|
|
17959
17959
|
if (!found && bias === LEAST_UPPER_BOUND) min++;
|
|
17960
17960
|
if (min === -1 || min === segments.length) return [];
|
|
17961
17961
|
const matchedColumn = found ? column : segments[min][COLUMN];
|
|
@@ -17968,10 +17968,10 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17968
17968
|
}
|
|
17969
17969
|
return result;
|
|
17970
17970
|
}
|
|
17971
|
-
function generatedPosition(map, source,
|
|
17971
|
+
function generatedPosition(map, source, line2, column, bias, all) {
|
|
17972
17972
|
var _a, _b;
|
|
17973
|
-
|
|
17974
|
-
if (
|
|
17973
|
+
line2--;
|
|
17974
|
+
if (line2 < 0) throw new Error(LINE_GTR_ZERO);
|
|
17975
17975
|
if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
|
|
17976
17976
|
const { sources, resolvedSources } = map;
|
|
17977
17977
|
let sourceIndex2 = sources.indexOf(source);
|
|
@@ -17979,11 +17979,11 @@ var require_trace_mapping_umd = __commonJS2({
|
|
|
17979
17979
|
if (sourceIndex2 === -1) return all ? [] : GMapping(null, null);
|
|
17980
17980
|
const bySourceMemos = (_a = cast(map))._bySourceMemos || (_a._bySourceMemos = sources.map(memoizedState));
|
|
17981
17981
|
const generated = (_b = cast(map))._bySources || (_b._bySources = buildBySources(decodedMappings(map), bySourceMemos));
|
|
17982
|
-
const segments = generated[sourceIndex2][
|
|
17982
|
+
const segments = generated[sourceIndex2][line2];
|
|
17983
17983
|
if (segments == null) return all ? [] : GMapping(null, null);
|
|
17984
17984
|
const memo = bySourceMemos[sourceIndex2];
|
|
17985
|
-
if (all) return sliceGeneratedPositions(segments, memo,
|
|
17986
|
-
const index = traceSegmentInternal(segments, memo,
|
|
17985
|
+
if (all) return sliceGeneratedPositions(segments, memo, line2, column, bias);
|
|
17986
|
+
const index = traceSegmentInternal(segments, memo, line2, column, bias);
|
|
17987
17987
|
if (index === -1) return GMapping(null, null);
|
|
17988
17988
|
const segment = segments[index];
|
|
17989
17989
|
return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);
|
|
@@ -18222,9 +18222,9 @@ var require_gen_mapping_umd = __commonJS2({
|
|
|
18222
18222
|
const out2 = [];
|
|
18223
18223
|
const { _mappings: mappings, _sources: sources, _names: names } = cast2(map);
|
|
18224
18224
|
for (let i3 = 0; i3 < mappings.length; i3++) {
|
|
18225
|
-
const
|
|
18226
|
-
for (let j = 0; j <
|
|
18227
|
-
const seg =
|
|
18225
|
+
const line2 = mappings[i3];
|
|
18226
|
+
for (let j = 0; j < line2.length; j++) {
|
|
18227
|
+
const seg = line2[j];
|
|
18228
18228
|
const generated = { line: i3 + 1, column: seg[COLUMN] };
|
|
18229
18229
|
let source = void 0;
|
|
18230
18230
|
let original = void 0;
|
|
@@ -18247,22 +18247,22 @@ var require_gen_mapping_umd = __commonJS2({
|
|
|
18247
18247
|
_names: names
|
|
18248
18248
|
// _originalScopes: originalScopes,
|
|
18249
18249
|
} = cast2(map);
|
|
18250
|
-
const
|
|
18251
|
-
const index = getColumnIndex(
|
|
18250
|
+
const line2 = getIndex(mappings, genLine);
|
|
18251
|
+
const index = getColumnIndex(line2, genColumn);
|
|
18252
18252
|
if (!source) {
|
|
18253
|
-
if (skipable && skipSourceless(
|
|
18254
|
-
return insert(
|
|
18253
|
+
if (skipable && skipSourceless(line2, index)) return;
|
|
18254
|
+
return insert(line2, index, [genColumn]);
|
|
18255
18255
|
}
|
|
18256
18256
|
assert5(sourceLine);
|
|
18257
18257
|
assert5(sourceColumn);
|
|
18258
18258
|
const sourcesIndex = put(sources, source);
|
|
18259
18259
|
const namesIndex = name2 ? put(names, name2) : NO_NAME;
|
|
18260
18260
|
if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;
|
|
18261
|
-
if (skipable && skipSource(
|
|
18261
|
+
if (skipable && skipSource(line2, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
|
|
18262
18262
|
return;
|
|
18263
18263
|
}
|
|
18264
18264
|
return insert(
|
|
18265
|
-
|
|
18265
|
+
line2,
|
|
18266
18266
|
index,
|
|
18267
18267
|
name2 ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn]
|
|
18268
18268
|
);
|
|
@@ -18275,10 +18275,10 @@ var require_gen_mapping_umd = __commonJS2({
|
|
|
18275
18275
|
}
|
|
18276
18276
|
return arr[index];
|
|
18277
18277
|
}
|
|
18278
|
-
function getColumnIndex(
|
|
18279
|
-
let index =
|
|
18278
|
+
function getColumnIndex(line2, genColumn) {
|
|
18279
|
+
let index = line2.length;
|
|
18280
18280
|
for (let i3 = index - 1; i3 >= 0; index = i3--) {
|
|
18281
|
-
const current2 =
|
|
18281
|
+
const current2 = line2[i3];
|
|
18282
18282
|
if (genColumn >= current2[COLUMN]) break;
|
|
18283
18283
|
}
|
|
18284
18284
|
return index;
|
|
@@ -18300,14 +18300,14 @@ var require_gen_mapping_umd = __commonJS2({
|
|
|
18300
18300
|
function putAll(setarr, array) {
|
|
18301
18301
|
for (let i3 = 0; i3 < array.length; i3++) put(setarr, array[i3]);
|
|
18302
18302
|
}
|
|
18303
|
-
function skipSourceless(
|
|
18303
|
+
function skipSourceless(line2, index) {
|
|
18304
18304
|
if (index === 0) return true;
|
|
18305
|
-
const prev =
|
|
18305
|
+
const prev = line2[index - 1];
|
|
18306
18306
|
return prev.length === 1;
|
|
18307
18307
|
}
|
|
18308
|
-
function skipSource(
|
|
18308
|
+
function skipSource(line2, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
|
|
18309
18309
|
if (index === 0) return false;
|
|
18310
|
-
const prev =
|
|
18310
|
+
const prev = line2[index - 1];
|
|
18311
18311
|
if (prev.length === 1) return false;
|
|
18312
18312
|
return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);
|
|
18313
18313
|
}
|
|
@@ -18359,26 +18359,26 @@ var require_computeSourceMap = __commonJS2({
|
|
|
18359
18359
|
tokenIndex++;
|
|
18360
18360
|
currentMapping = rawMappings[tokenIndex];
|
|
18361
18361
|
}
|
|
18362
|
-
let
|
|
18362
|
+
let line2 = 0;
|
|
18363
18363
|
let lineStart = 0;
|
|
18364
18364
|
if (currentMapping !== lineStart) {
|
|
18365
|
-
_genmapping.maybeAddSegment.call(void 0, map,
|
|
18365
|
+
_genmapping.maybeAddSegment.call(void 0, map, line2, 0, filePath, line2, 0);
|
|
18366
18366
|
}
|
|
18367
18367
|
for (let i3 = 0; i3 < generatedCode.length; i3++) {
|
|
18368
18368
|
if (i3 === currentMapping) {
|
|
18369
18369
|
const genColumn = currentMapping - lineStart;
|
|
18370
18370
|
const sourceColumn = sourceColumns[tokenIndex];
|
|
18371
|
-
_genmapping.maybeAddSegment.call(void 0, map,
|
|
18371
|
+
_genmapping.maybeAddSegment.call(void 0, map, line2, genColumn, filePath, line2, sourceColumn);
|
|
18372
18372
|
while ((currentMapping === i3 || currentMapping === void 0) && tokenIndex < rawMappings.length - 1) {
|
|
18373
18373
|
tokenIndex++;
|
|
18374
18374
|
currentMapping = rawMappings[tokenIndex];
|
|
18375
18375
|
}
|
|
18376
18376
|
}
|
|
18377
18377
|
if (generatedCode.charCodeAt(i3) === _charcodes.charCodes.lineFeed) {
|
|
18378
|
-
|
|
18378
|
+
line2++;
|
|
18379
18379
|
lineStart = i3 + 1;
|
|
18380
18380
|
if (currentMapping !== lineStart) {
|
|
18381
|
-
_genmapping.maybeAddSegment.call(void 0, map,
|
|
18381
|
+
_genmapping.maybeAddSegment.call(void 0, map, line2, 0, filePath, line2, 0);
|
|
18382
18382
|
}
|
|
18383
18383
|
}
|
|
18384
18384
|
}
|
|
@@ -24228,7 +24228,7 @@ var require_parser = __commonJS2({
|
|
|
24228
24228
|
}
|
|
24229
24229
|
};
|
|
24230
24230
|
exports2.File = File;
|
|
24231
|
-
function
|
|
24231
|
+
function parse7(input, isJSXEnabled, isTypeScriptEnabled, isFlowEnabled) {
|
|
24232
24232
|
if (isFlowEnabled && isTypeScriptEnabled) {
|
|
24233
24233
|
throw new Error("Cannot combine flow and typescript plugins.");
|
|
24234
24234
|
}
|
|
@@ -24239,7 +24239,7 @@ var require_parser = __commonJS2({
|
|
|
24239
24239
|
}
|
|
24240
24240
|
return result;
|
|
24241
24241
|
}
|
|
24242
|
-
exports2.parse =
|
|
24242
|
+
exports2.parse = parse7;
|
|
24243
24243
|
}
|
|
24244
24244
|
});
|
|
24245
24245
|
|
|
@@ -27439,27 +27439,27 @@ var require_build = __commonJS2({
|
|
|
27439
27439
|
if (index < 0 || index > this.string.length) {
|
|
27440
27440
|
return null;
|
|
27441
27441
|
}
|
|
27442
|
-
var
|
|
27442
|
+
var line2 = 0;
|
|
27443
27443
|
var offsets = this.offsets;
|
|
27444
|
-
while (offsets[
|
|
27445
|
-
|
|
27444
|
+
while (offsets[line2 + 1] <= index) {
|
|
27445
|
+
line2++;
|
|
27446
27446
|
}
|
|
27447
|
-
var column = index - offsets[
|
|
27448
|
-
return { line, column };
|
|
27447
|
+
var column = index - offsets[line2];
|
|
27448
|
+
return { line: line2, column };
|
|
27449
27449
|
};
|
|
27450
27450
|
LinesAndColumns2.prototype.indexForLocation = function(location) {
|
|
27451
|
-
var
|
|
27452
|
-
if (
|
|
27451
|
+
var line2 = location.line, column = location.column;
|
|
27452
|
+
if (line2 < 0 || line2 >= this.offsets.length) {
|
|
27453
27453
|
return null;
|
|
27454
27454
|
}
|
|
27455
|
-
if (column < 0 || column > this.lengthOfLine(
|
|
27455
|
+
if (column < 0 || column > this.lengthOfLine(line2)) {
|
|
27456
27456
|
return null;
|
|
27457
27457
|
}
|
|
27458
|
-
return this.offsets[
|
|
27458
|
+
return this.offsets[line2] + column;
|
|
27459
27459
|
};
|
|
27460
|
-
LinesAndColumns2.prototype.lengthOfLine = function(
|
|
27461
|
-
var offset2 = this.offsets[
|
|
27462
|
-
var nextOffset =
|
|
27460
|
+
LinesAndColumns2.prototype.lengthOfLine = function(line2) {
|
|
27461
|
+
var offset2 = this.offsets[line2];
|
|
27462
|
+
var nextOffset = line2 === this.offsets.length - 1 ? this.string.length : this.offsets[line2 + 1];
|
|
27463
27463
|
return nextOffset - offset2;
|
|
27464
27464
|
};
|
|
27465
27465
|
return LinesAndColumns2;
|
|
@@ -28929,7 +28929,7 @@ function readTestHistory(input) {
|
|
|
28929
28929
|
}
|
|
28930
28930
|
}
|
|
28931
28931
|
if (!added || added.date === "" || added.date.length > MAX_HISTORY_DATE_CHARS) return { available: false };
|
|
28932
|
-
const changed = git3(["show", "--name-only", "--no-color", "--format=", added.sha]).split("\n").map((
|
|
28932
|
+
const changed = git3(["show", "--name-only", "--no-color", "--format=", added.sha]).split("\n").map((line2) => line2.trim()).filter((line2) => line2 !== "");
|
|
28933
28933
|
const others = changed.filter((file) => file !== input.path && file !== added.pathThen && file.length <= MAX_HISTORY_PATH_CHARS && !isTest(file));
|
|
28934
28934
|
return {
|
|
28935
28935
|
available: true,
|
|
@@ -28961,7 +28961,7 @@ function expectationTokens(code) {
|
|
|
28961
28961
|
function commentsOf(text3) {
|
|
28962
28962
|
const comments = [];
|
|
28963
28963
|
let code = "";
|
|
28964
|
-
let
|
|
28964
|
+
let line2 = 0;
|
|
28965
28965
|
let i3 = 0;
|
|
28966
28966
|
let quote = null;
|
|
28967
28967
|
while (i3 < text3.length) {
|
|
@@ -28970,12 +28970,12 @@ function commentsOf(text3) {
|
|
|
28970
28970
|
code += c;
|
|
28971
28971
|
if (c === "\\" && i3 + 1 < text3.length) {
|
|
28972
28972
|
code += text3[i3 + 1];
|
|
28973
|
-
if (text3[i3 + 1] === "\n")
|
|
28973
|
+
if (text3[i3 + 1] === "\n") line2 += 1;
|
|
28974
28974
|
i3 += 2;
|
|
28975
28975
|
continue;
|
|
28976
28976
|
}
|
|
28977
28977
|
if (c === quote) quote = null;
|
|
28978
|
-
if (c === "\n")
|
|
28978
|
+
if (c === "\n") line2 += 1;
|
|
28979
28979
|
i3 += 1;
|
|
28980
28980
|
continue;
|
|
28981
28981
|
}
|
|
@@ -28988,7 +28988,7 @@ function commentsOf(text3) {
|
|
|
28988
28988
|
if (c === "/" && text3[i3 + 1] === "/") {
|
|
28989
28989
|
let end = i3;
|
|
28990
28990
|
while (end < text3.length && text3[end] !== "\n") end += 1;
|
|
28991
|
-
comments.push({ line, text: text3.slice(i3 + 2, end) });
|
|
28991
|
+
comments.push({ line: line2, text: text3.slice(i3 + 2, end) });
|
|
28992
28992
|
i3 = end;
|
|
28993
28993
|
continue;
|
|
28994
28994
|
}
|
|
@@ -28996,16 +28996,16 @@ function commentsOf(text3) {
|
|
|
28996
28996
|
const close = text3.indexOf("*/", i3 + 2);
|
|
28997
28997
|
const stop2 = close === -1 ? text3.length : close + 2;
|
|
28998
28998
|
const body2 = text3.slice(i3 + 2, close === -1 ? text3.length : close);
|
|
28999
|
-
body2.split("\n").forEach((part, k) => comments.push({ line:
|
|
28999
|
+
body2.split("\n").forEach((part, k) => comments.push({ line: line2 + k, text: part }));
|
|
29000
29000
|
for (const ch of text3.slice(i3, stop2)) if (ch === "\n") {
|
|
29001
29001
|
code += "\n";
|
|
29002
|
-
|
|
29002
|
+
line2 += 1;
|
|
29003
29003
|
}
|
|
29004
29004
|
i3 = stop2;
|
|
29005
29005
|
continue;
|
|
29006
29006
|
}
|
|
29007
29007
|
code += c;
|
|
29008
|
-
if (c === "\n")
|
|
29008
|
+
if (c === "\n") line2 += 1;
|
|
29009
29009
|
i3 += 1;
|
|
29010
29010
|
}
|
|
29011
29011
|
return { comments, code };
|
|
@@ -29595,8 +29595,8 @@ function codePointToString(code) {
|
|
|
29595
29595
|
return String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320);
|
|
29596
29596
|
}
|
|
29597
29597
|
var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;
|
|
29598
|
-
var Position = function Position2(
|
|
29599
|
-
this.line =
|
|
29598
|
+
var Position = function Position2(line2, col) {
|
|
29599
|
+
this.line = line2;
|
|
29600
29600
|
this.column = col;
|
|
29601
29601
|
};
|
|
29602
29602
|
Position.prototype.offset = function offset(n) {
|
|
@@ -29610,12 +29610,12 @@ var SourceLocation = function SourceLocation2(p, start3, end) {
|
|
|
29610
29610
|
}
|
|
29611
29611
|
};
|
|
29612
29612
|
function getLineInfo(input, offset2) {
|
|
29613
|
-
for (var
|
|
29613
|
+
for (var line2 = 1, cur = 0; ; ) {
|
|
29614
29614
|
var nextBreak = nextLineBreak(input, cur, offset2);
|
|
29615
29615
|
if (nextBreak < 0) {
|
|
29616
|
-
return new Position(
|
|
29616
|
+
return new Position(line2, offset2 - cur);
|
|
29617
29617
|
}
|
|
29618
|
-
++
|
|
29618
|
+
++line2;
|
|
29619
29619
|
cur = nextBreak;
|
|
29620
29620
|
}
|
|
29621
29621
|
}
|
|
@@ -35126,9 +35126,9 @@ function attempt(text3, sourceType) {
|
|
|
35126
35126
|
return null;
|
|
35127
35127
|
} catch (err2) {
|
|
35128
35128
|
const e = err2;
|
|
35129
|
-
const
|
|
35129
|
+
const line2 = typeof e.loc?.line === "number" ? e.loc.line : 1;
|
|
35130
35130
|
const column = typeof e.loc?.column === "number" ? e.loc.column : 0;
|
|
35131
|
-
return { message: typeof e.message === "string" ? e.message : "", line, column };
|
|
35131
|
+
return { message: typeof e.message === "string" ? e.message : "", line: line2, column };
|
|
35132
35132
|
}
|
|
35133
35133
|
}
|
|
35134
35134
|
function readingsFor(path, text3) {
|
|
@@ -35449,9 +35449,9 @@ function titleOf(call) {
|
|
|
35449
35449
|
return null;
|
|
35450
35450
|
}
|
|
35451
35451
|
function lineAt(text3, offset2) {
|
|
35452
|
-
let
|
|
35453
|
-
for (let i3 = 0; i3 < offset2 && i3 < text3.length; i3++) if (text3.charCodeAt(i3) === 10)
|
|
35454
|
-
return
|
|
35452
|
+
let line2 = 1;
|
|
35453
|
+
for (let i3 = 0; i3 < offset2 && i3 < text3.length; i3++) if (text3.charCodeAt(i3) === 10) line2++;
|
|
35454
|
+
return line2;
|
|
35455
35455
|
}
|
|
35456
35456
|
function locateTests(path, text3) {
|
|
35457
35457
|
const parsed = parseProgram(path, text3);
|
|
@@ -36736,7 +36736,7 @@ function listingForWire(listing, deniedPaths) {
|
|
|
36736
36736
|
var NON_TEXT_EXTENSION_RE = /\.(png|jpe?g|gif|webp|avif|ico|icns|bmp|tiff?|psd|mp[34]|m4a|mov|avi|webm|mkv|wav|ogg|flac|woff2?|ttf|otf|eot|pdf|zip|gz|tgz|bz2|xz|7z|rar|jar|war|wasm|exe|dll|so|dylib|pyc|class|o|a|sqlite3?|db)$/i;
|
|
36737
36737
|
function isGeneratedText(lf) {
|
|
36738
36738
|
let start3 = 0;
|
|
36739
|
-
for (let
|
|
36739
|
+
for (let line2 = 0; line2 < 5 && start3 <= lf.length; line2++) {
|
|
36740
36740
|
const end = lf.indexOf("\n", start3);
|
|
36741
36741
|
const text3 = end === -1 ? lf.slice(start3) : lf.slice(start3, end);
|
|
36742
36742
|
if (text3.includes("@generated") || text3.includes("DO NOT EDIT")) return true;
|
|
@@ -37518,9 +37518,9 @@ function kindOfKeyword(word) {
|
|
|
37518
37518
|
if (w === "module" || w === "namespace" || w === "mod") return "module";
|
|
37519
37519
|
return "other";
|
|
37520
37520
|
}
|
|
37521
|
-
function indentOf(
|
|
37521
|
+
function indentOf(line2) {
|
|
37522
37522
|
let n = 0;
|
|
37523
|
-
for (const ch of
|
|
37523
|
+
for (const ch of line2) {
|
|
37524
37524
|
if (ch === " ") n += 1;
|
|
37525
37525
|
else if (ch === " ") n += 4;
|
|
37526
37526
|
else break;
|
|
@@ -37531,11 +37531,11 @@ function keywordEntries(text3, only) {
|
|
|
37531
37531
|
const lines = text3.replace(/\r\n/g, "\n").split("\n");
|
|
37532
37532
|
const found = [];
|
|
37533
37533
|
for (let i3 = 0; i3 < lines.length; i3++) {
|
|
37534
|
-
const
|
|
37535
|
-
if (
|
|
37536
|
-
const m = KEYWORD_LINE.exec(
|
|
37534
|
+
const line2 = lines[i3];
|
|
37535
|
+
if (line2.length > 400) continue;
|
|
37536
|
+
const m = KEYWORD_LINE.exec(line2);
|
|
37537
37537
|
if (!m) continue;
|
|
37538
|
-
if (indentOf(
|
|
37538
|
+
if (indentOf(line2) > MAX_INDENT) continue;
|
|
37539
37539
|
const kind = kindOfKeyword(m[2]);
|
|
37540
37540
|
if (only && !only.has(m[2])) continue;
|
|
37541
37541
|
found.push({ indent: indentOf(m[1]), kind, name: clip2(m[3]), line: i3 + 1 });
|
|
@@ -37837,17 +37837,17 @@ function prepareReadFileV2(args2, env2, ledger) {
|
|
|
37837
37837
|
let endLine = s - 1;
|
|
37838
37838
|
let cutInsideLine = false;
|
|
37839
37839
|
for (let n = s; n <= windowEnd; n++) {
|
|
37840
|
-
const
|
|
37841
|
-
const cost =
|
|
37840
|
+
const line2 = `${n} ${lines[n - 1]}`;
|
|
37841
|
+
const cost = line2.length + (out2.length > 0 ? 1 : 0);
|
|
37842
37842
|
if (used + cost <= budget) {
|
|
37843
|
-
out2.push(
|
|
37843
|
+
out2.push(line2);
|
|
37844
37844
|
used += cost;
|
|
37845
37845
|
endLine = n;
|
|
37846
37846
|
continue;
|
|
37847
37847
|
}
|
|
37848
37848
|
if (out2.length === 0) {
|
|
37849
37849
|
const keep = Math.max(0, budget - 12);
|
|
37850
|
-
out2.push(`${
|
|
37850
|
+
out2.push(`${line2.slice(0, keep)}\u2026[line cut]`);
|
|
37851
37851
|
used = out2[0].length;
|
|
37852
37852
|
endLine = n;
|
|
37853
37853
|
cutInsideLine = true;
|
|
@@ -38002,10 +38002,10 @@ function definitionsIn(text3, name2, path, parsed) {
|
|
|
38002
38002
|
const lines = text3.split("\n");
|
|
38003
38003
|
const found = [];
|
|
38004
38004
|
for (let i3 = 0; i3 < lines.length; i3++) {
|
|
38005
|
-
const
|
|
38006
|
-
if (
|
|
38005
|
+
const line2 = lines[i3];
|
|
38006
|
+
if (line2.length > 600 || !line2.includes(name2)) continue;
|
|
38007
38007
|
for (const [re, kind] of rules) {
|
|
38008
|
-
if (re.test(
|
|
38008
|
+
if (re.test(line2)) {
|
|
38009
38009
|
found.push({ line: i3 + 1, kind });
|
|
38010
38010
|
break;
|
|
38011
38011
|
}
|
|
@@ -38325,10 +38325,10 @@ function prepareReadFile(args2, env2, ledger) {
|
|
|
38325
38325
|
let endLine = startLine - 1;
|
|
38326
38326
|
let truncated = false;
|
|
38327
38327
|
for (let n = startLine; n <= endWanted; n++) {
|
|
38328
|
-
const
|
|
38329
|
-
const cost =
|
|
38328
|
+
const line2 = `${n} ${lines[n - 1]}`;
|
|
38329
|
+
const cost = line2.length + (out2.length > 0 ? 1 : 0);
|
|
38330
38330
|
if (used + cost <= budget) {
|
|
38331
|
-
out2.push(
|
|
38331
|
+
out2.push(line2);
|
|
38332
38332
|
used += cost;
|
|
38333
38333
|
endLine = n;
|
|
38334
38334
|
continue;
|
|
@@ -38336,7 +38336,7 @@ function prepareReadFile(args2, env2, ledger) {
|
|
|
38336
38336
|
truncated = true;
|
|
38337
38337
|
if (out2.length === 0) {
|
|
38338
38338
|
const keep = Math.max(0, budget - CUT.length);
|
|
38339
|
-
out2.push(
|
|
38339
|
+
out2.push(line2.slice(0, keep) + CUT);
|
|
38340
38340
|
used = out2[0].length;
|
|
38341
38341
|
endLine = n;
|
|
38342
38342
|
}
|
|
@@ -38390,8 +38390,8 @@ function prepareListFiles(args2, env2) {
|
|
|
38390
38390
|
};
|
|
38391
38391
|
}
|
|
38392
38392
|
var WORD_CHAR = /[A-Za-z0-9_$]/;
|
|
38393
|
-
function lineMatches(
|
|
38394
|
-
const hay = ignoreCase ?
|
|
38393
|
+
function lineMatches(line2, needle, ignoreCase, wholeWord) {
|
|
38394
|
+
const hay = ignoreCase ? line2.toLowerCase() : line2;
|
|
38395
38395
|
let from = 0;
|
|
38396
38396
|
for (; ; ) {
|
|
38397
38397
|
const i3 = hay.indexOf(needle, from);
|
|
@@ -38403,10 +38403,10 @@ function lineMatches(line, needle, ignoreCase, wholeWord) {
|
|
|
38403
38403
|
from = i3 + 1;
|
|
38404
38404
|
}
|
|
38405
38405
|
}
|
|
38406
|
-
function excerpt(
|
|
38407
|
-
const t =
|
|
38406
|
+
function excerpt(line2, at2, max) {
|
|
38407
|
+
const t = line2.trim();
|
|
38408
38408
|
if (t.length <= max) return t;
|
|
38409
|
-
const lead =
|
|
38409
|
+
const lead = line2.length - line2.trimStart().length;
|
|
38410
38410
|
const pos = Math.max(0, at2 - lead);
|
|
38411
38411
|
const from = Math.max(0, Math.min(pos - 40, t.length - max));
|
|
38412
38412
|
const piece = t.slice(from, from + max);
|
|
@@ -40615,12 +40615,12 @@ function parseAssertionLocation(body2) {
|
|
|
40615
40615
|
let any;
|
|
40616
40616
|
while (any = ANY_LOCATION_RE.exec(text3)) {
|
|
40617
40617
|
const raw = any[1] ?? any[3];
|
|
40618
|
-
const
|
|
40619
|
-
if (!raw || !
|
|
40618
|
+
const line2 = any[2] ?? any[4];
|
|
40619
|
+
if (!raw || !line2) continue;
|
|
40620
40620
|
const shown = shownPath(raw);
|
|
40621
40621
|
if (DEPENDENCY_PATH_RE.test(`/${shown}`) || /^(?:https?|file):/i.test(shown)) continue;
|
|
40622
40622
|
if (shown.length > MAX_FAILURE_LOCATION) return null;
|
|
40623
|
-
return `${shown}:${
|
|
40623
|
+
return `${shown}:${line2}`;
|
|
40624
40624
|
}
|
|
40625
40625
|
return null;
|
|
40626
40626
|
}
|
|
@@ -41722,14 +41722,14 @@ var JS_TS_EXTENSION_RE = /\.(?:ts|tsx|js|jsx|mjs|cjs)$/;
|
|
|
41722
41722
|
var EXPORTED_SYMBOL_RE = /^export\s+(?:default\s+)?(?:async\s+)?(?:function\*?|class|const|let|var|interface|type|enum)\s+([A-Za-z_$][\w$]*)/gm;
|
|
41723
41723
|
function countRemovedLines(currentContent, newContent) {
|
|
41724
41724
|
const remaining = /* @__PURE__ */ new Map();
|
|
41725
|
-
for (const
|
|
41726
|
-
remaining.set(
|
|
41725
|
+
for (const line2 of newContent.split("\n")) {
|
|
41726
|
+
remaining.set(line2, (remaining.get(line2) ?? 0) + 1);
|
|
41727
41727
|
}
|
|
41728
41728
|
let removed = 0;
|
|
41729
|
-
for (const
|
|
41730
|
-
const count3 = remaining.get(
|
|
41729
|
+
for (const line2 of currentContent.split("\n")) {
|
|
41730
|
+
const count3 = remaining.get(line2) ?? 0;
|
|
41731
41731
|
if (count3 > 0) {
|
|
41732
|
-
remaining.set(
|
|
41732
|
+
remaining.set(line2, count3 - 1);
|
|
41733
41733
|
} else {
|
|
41734
41734
|
removed++;
|
|
41735
41735
|
}
|
|
@@ -42537,9 +42537,9 @@ function withRelatedNote(message, related) {
|
|
|
42537
42537
|
var sha = (s) => (0, import_node_crypto3.createHash)("sha256").update(s).digest("hex");
|
|
42538
42538
|
var LOCATION_SUFFIX = / \[at [^\]\r\n]{1,70}\]$/;
|
|
42539
42539
|
function firstLine(text3, where, max = MAX_MESSAGE_CHARS) {
|
|
42540
|
-
const
|
|
42541
|
-
if (
|
|
42542
|
-
const safe = scrubSecrets2(where ? `${
|
|
42540
|
+
const line2 = text3.split(LINE_BREAK).map((l) => l.replace(CONTROL_CHARS, "").trim()).find((l) => l.length > 0);
|
|
42541
|
+
if (line2 === void 0) return "";
|
|
42542
|
+
const safe = scrubSecrets2(where ? `${line2} [at ${where}]` : line2);
|
|
42543
42543
|
if (safe.length <= max) return safe;
|
|
42544
42544
|
const kept = LOCATION_SUFFIX.exec(safe);
|
|
42545
42545
|
if (kept) return `${safe.slice(0, kept.index).slice(0, max - kept[0].length - 1)}\u2026${kept[0]}`;
|
|
@@ -42629,10 +42629,10 @@ function testAnswerFrom(args2) {
|
|
|
42629
42629
|
listed.forEach((id, i3) => {
|
|
42630
42630
|
if (!own.has(id)) {
|
|
42631
42631
|
if (args2.approvedIds?.has(id) === true) {
|
|
42632
|
-
const
|
|
42633
|
-
if (
|
|
42634
|
-
messages[names[i3]] =
|
|
42635
|
-
left -=
|
|
42632
|
+
const line3 = firstLine(failureText.get(id) ?? "", failureWhere.get(id));
|
|
42633
|
+
if (line3 && line3.length <= left) {
|
|
42634
|
+
messages[names[i3]] = line3;
|
|
42635
|
+
left -= line3.length;
|
|
42636
42636
|
}
|
|
42637
42637
|
}
|
|
42638
42638
|
return;
|
|
@@ -42640,10 +42640,10 @@ function testAnswerFrom(args2) {
|
|
|
42640
42640
|
ownToCome -= 1;
|
|
42641
42641
|
const where = failureWhere.get(id);
|
|
42642
42642
|
const allowance = Math.min(MAX_WHOLE_MESSAGE_CHARS, left - ownToCome * MAX_MESSAGE_CHARS);
|
|
42643
|
-
const
|
|
42644
|
-
if (
|
|
42645
|
-
messages[names[i3]] =
|
|
42646
|
-
left -=
|
|
42643
|
+
const line2 = args2.harness === true && allowance > MAX_MESSAGE_CHARS ? wholeFailure(failureDetail.get(id) ?? failureText.get(id) ?? "", where, allowance) : firstLine(failureText.get(id) ?? "", where);
|
|
42644
|
+
if (line2) {
|
|
42645
|
+
messages[names[i3]] = line2;
|
|
42646
|
+
left -= line2.length;
|
|
42647
42647
|
}
|
|
42648
42648
|
});
|
|
42649
42649
|
const messageCount = Object.keys(messages).length;
|
|
@@ -43277,17 +43277,17 @@ function wholeNumber(n) {
|
|
|
43277
43277
|
}
|
|
43278
43278
|
function clampRefusedTurns(turns) {
|
|
43279
43279
|
const rows = [];
|
|
43280
|
-
let
|
|
43280
|
+
let cut2 = false;
|
|
43281
43281
|
for (const t of turns ?? []) {
|
|
43282
43282
|
if (rows.length >= MAX_RECORD_REFUSED_TURNS) {
|
|
43283
|
-
|
|
43283
|
+
cut2 = true;
|
|
43284
43284
|
break;
|
|
43285
43285
|
}
|
|
43286
|
-
if (t.rules.length > MAX_RECORD_REFUSED_RULES)
|
|
43286
|
+
if (t.rules.length > MAX_RECORD_REFUSED_RULES) cut2 = true;
|
|
43287
43287
|
const rules = [...new Set(t.rules.map(recordRuleWord))].slice(0, MAX_RECORD_REFUSED_RULES);
|
|
43288
43288
|
if (rules.length > 0) rows.push({ turn: wholeNumber(t.turn), rules });
|
|
43289
43289
|
}
|
|
43290
|
-
return { rows, cut };
|
|
43290
|
+
return { rows, cut: cut2 };
|
|
43291
43291
|
}
|
|
43292
43292
|
|
|
43293
43293
|
// src/codegenAttempts.ts
|
|
@@ -43415,10 +43415,10 @@ function testRunFrom(answer) {
|
|
|
43415
43415
|
for (const [name2, text3] of Object.entries(answer.messages)) {
|
|
43416
43416
|
const key = name2.slice(0, MAX_PREVIOUS_NAME_CHARS);
|
|
43417
43417
|
if (typeof text3 !== "string" || !listed.has(key) || Object.keys(messages).length >= MAX_PREVIOUS_TESTS) continue;
|
|
43418
|
-
const
|
|
43419
|
-
if (
|
|
43420
|
-
messages[key] =
|
|
43421
|
-
total +=
|
|
43418
|
+
const cut2 = text3.slice(0, Math.min(MAX_PREVIOUS_WHOLE_MESSAGE_CHARS, MAX_PREVIOUS_MESSAGES_TOTAL_CHARS - total));
|
|
43419
|
+
if (cut2.length > 0) {
|
|
43420
|
+
messages[key] = cut2;
|
|
43421
|
+
total += cut2.length;
|
|
43422
43422
|
}
|
|
43423
43423
|
}
|
|
43424
43424
|
if (Object.keys(messages).length > 0) run3.messages = messages;
|
|
@@ -43455,22 +43455,22 @@ var MAX_NAMED = 4;
|
|
|
43455
43455
|
var QUOTE_WIDTH = 50;
|
|
43456
43456
|
var TAIL = "Make `find` longer by adding the line before or after the place you mean, so it matches exactly once.";
|
|
43457
43457
|
function lineNumberAt(text3, index) {
|
|
43458
|
-
let
|
|
43459
|
-
for (let at2 = text3.indexOf("\n"); at2 !== -1 && at2 < index; at2 = text3.indexOf("\n", at2 + 1))
|
|
43460
|
-
return
|
|
43458
|
+
let line2 = 1;
|
|
43459
|
+
for (let at2 = text3.indexOf("\n"); at2 !== -1 && at2 < index; at2 = text3.indexOf("\n", at2 + 1)) line2 += 1;
|
|
43460
|
+
return line2;
|
|
43461
43461
|
}
|
|
43462
43462
|
function previousTextLine(text3, index) {
|
|
43463
43463
|
let end = (index === 0 ? 0 : text3.lastIndexOf("\n", index - 1) + 1) - 1;
|
|
43464
43464
|
while (end >= 0) {
|
|
43465
43465
|
const start3 = end === 0 ? 0 : text3.lastIndexOf("\n", end - 1) + 1;
|
|
43466
|
-
const
|
|
43467
|
-
if (
|
|
43466
|
+
const line2 = text3.slice(start3, end);
|
|
43467
|
+
if (line2.trim() !== "") return line2;
|
|
43468
43468
|
end = start3 - 1;
|
|
43469
43469
|
}
|
|
43470
43470
|
return null;
|
|
43471
43471
|
}
|
|
43472
|
-
function quoted(
|
|
43473
|
-
return
|
|
43472
|
+
function quoted(line2, width) {
|
|
43473
|
+
return line2.replace(/`/g, "").trim().slice(0, width).trimEnd();
|
|
43474
43474
|
}
|
|
43475
43475
|
function ambiguousPlacesMessage(lf, starts, total) {
|
|
43476
43476
|
const named2 = starts.slice(0, MAX_NAMED);
|
|
@@ -45442,12 +45442,12 @@ function existingTestVerdictLang(input) {
|
|
|
45442
45442
|
const matches = /* @__PURE__ */ new Map();
|
|
45443
45443
|
const failed = embed(baseline, after, matches);
|
|
45444
45444
|
if (failed) {
|
|
45445
|
-
let
|
|
45445
|
+
let line2 = failed.unit.line;
|
|
45446
45446
|
if (before !== null) {
|
|
45447
45447
|
const mapped = /* @__PURE__ */ new Map();
|
|
45448
|
-
if (embed(baseline, before, mapped) === null)
|
|
45448
|
+
if (embed(baseline, before, mapped) === null) line2 = mapped.get(failed.unit)?.line ?? line2;
|
|
45449
45449
|
}
|
|
45450
|
-
return { ok: false, why: failed.why, line };
|
|
45450
|
+
return { ok: false, why: failed.why, line: line2 };
|
|
45451
45451
|
}
|
|
45452
45452
|
const matched = new Set(matches.values());
|
|
45453
45453
|
const problem = newCodeLine(lang, spec, baseline, after, matched, matches);
|
|
@@ -45691,8 +45691,8 @@ var LEAD2 = {
|
|
|
45691
45691
|
affects_existing: "Your new code could change what the existing tests check"
|
|
45692
45692
|
};
|
|
45693
45693
|
var GUIDANCE2 = "Existing tests and the code they use must stay exactly as they are, in the same order. You may add new tests, new helper functions and new import lines, add a name to an existing import line, and fix tests you added yourself.";
|
|
45694
|
-
function existingTestMessage(why,
|
|
45695
|
-
return `${LEAD2[why]}${
|
|
45694
|
+
function existingTestMessage(why, line2) {
|
|
45695
|
+
return `${LEAD2[why]}${line2 === void 0 ? "" : ` (line ${line2})`}. ${GUIDANCE2}`;
|
|
45696
45696
|
}
|
|
45697
45697
|
function protectedAnswer(verdict) {
|
|
45698
45698
|
if (typeof verdict.line === "number") return { reason: verdict.why, message: existingTestMessage(verdict.why, verdict.line) };
|
|
@@ -45874,9 +45874,9 @@ function isCheck(call) {
|
|
|
45874
45874
|
return o.type === "CallExpression" && o.callee.type === "Identifier" && o.callee.name === "expect";
|
|
45875
45875
|
}
|
|
45876
45876
|
function lineAt3(text3, offset2) {
|
|
45877
|
-
let
|
|
45878
|
-
for (let i3 = 0; i3 < offset2 && i3 < text3.length; i3++) if (text3.charCodeAt(i3) === 10)
|
|
45879
|
-
return
|
|
45877
|
+
let line2 = 1;
|
|
45878
|
+
for (let i3 = 0; i3 < offset2 && i3 < text3.length; i3++) if (text3.charCodeAt(i3) === 10) line2++;
|
|
45879
|
+
return line2;
|
|
45880
45880
|
}
|
|
45881
45881
|
function findTests(path, text3) {
|
|
45882
45882
|
const parsed = parseProgram(path, text3);
|
|
@@ -45951,19 +45951,19 @@ function ownTestFloor(input) {
|
|
|
45951
45951
|
const beforeById = before ? groupById(before) : null;
|
|
45952
45952
|
for (const { test, nth } of own) {
|
|
45953
45953
|
const found = after.get(test.id)?.[nth];
|
|
45954
|
-
const
|
|
45955
|
-
if (!found) return { ok: false, why: "test_removed", line };
|
|
45956
|
-
if (found.skipped && !test.skipped || found.checks < test.checks) return { ok: false, why: "test_emptied", line };
|
|
45954
|
+
const line2 = beforeById?.get(test.id)?.[nth]?.line ?? test.line;
|
|
45955
|
+
if (!found) return { ok: false, why: "test_removed", line: line2 };
|
|
45956
|
+
if (found.skipped && !test.skipped || found.checks < test.checks) return { ok: false, why: "test_emptied", line: line2 };
|
|
45957
45957
|
}
|
|
45958
45958
|
return { ok: true };
|
|
45959
45959
|
} catch {
|
|
45960
45960
|
return { ok: true };
|
|
45961
45961
|
}
|
|
45962
45962
|
}
|
|
45963
|
-
function ownTestMessage(why,
|
|
45963
|
+
function ownTestMessage(why, line2) {
|
|
45964
45964
|
const keep = "Correct its expectation instead, and keep its name, its [id] and a real check of the case.";
|
|
45965
|
-
if (why === "test_removed") return `Your edit removes a test that was written earlier in this run (line ${
|
|
45966
|
-
return `Your edit leaves a test that was written earlier in this run with fewer checks, or skips it (line ${
|
|
45965
|
+
if (why === "test_removed") return `Your edit removes a test that was written earlier in this run (line ${line2}). ${keep}`;
|
|
45966
|
+
return `Your edit leaves a test that was written earlier in this run with fewer checks, or skips it (line ${line2}). ${keep}`;
|
|
45967
45967
|
}
|
|
45968
45968
|
var MAX_PATHS = 10;
|
|
45969
45969
|
var MAX_LINES = 20;
|
|
@@ -47023,8 +47023,8 @@ function firstFailure(path, code) {
|
|
|
47023
47023
|
return first;
|
|
47024
47024
|
}
|
|
47025
47025
|
function stoppedAtTag(text3, failure) {
|
|
47026
|
-
const
|
|
47027
|
-
return
|
|
47026
|
+
const line2 = text3.split("\n")[failure.line - 1] ?? "";
|
|
47027
|
+
return line2[failure.column] === "<";
|
|
47028
47028
|
}
|
|
47029
47029
|
var WORDS = {
|
|
47030
47030
|
duplicate_declaration: "a name declared twice",
|
|
@@ -47191,10 +47191,10 @@ function fitBlocks(blocks, paths, room) {
|
|
|
47191
47191
|
const lines = block.split("\n");
|
|
47192
47192
|
const head = [];
|
|
47193
47193
|
let size = 0;
|
|
47194
|
-
for (const
|
|
47195
|
-
if (size +
|
|
47196
|
-
head.push(
|
|
47197
|
-
size +=
|
|
47194
|
+
for (const line2 of lines) {
|
|
47195
|
+
if (size + line2.length + 1 + rest.length > room) break;
|
|
47196
|
+
head.push(line2);
|
|
47197
|
+
size += line2.length + 1;
|
|
47198
47198
|
}
|
|
47199
47199
|
return [...head, rest].join("\n").slice(0, room);
|
|
47200
47200
|
}
|
|
@@ -48081,8 +48081,8 @@ async function proveProposals(input) {
|
|
|
48081
48081
|
return { ran: false, evidence, stillFailing: [], unexplained: [] };
|
|
48082
48082
|
};
|
|
48083
48083
|
const endOf = (f, c) => {
|
|
48084
|
-
const
|
|
48085
|
-
return
|
|
48084
|
+
const line2 = newEndLineOf(f, c);
|
|
48085
|
+
return line2 === void 0 ? {} : { newEndLine: line2 };
|
|
48086
48086
|
};
|
|
48087
48087
|
if (files.length === 0 || input.run === null) return notChecked();
|
|
48088
48088
|
const proposed = files.map((f) => ({ targetPath: f.path, newContent: fileText(f.newLf, f.ending, f.bom) }));
|
|
@@ -48605,8 +48605,8 @@ function reviewLine(id, text3) {
|
|
|
48605
48605
|
const prefix = `[${id}] fails on the code as it is with: `;
|
|
48606
48606
|
const room = Math.min(MAX_QUOTE_CHARS, MAX_REFUSED_SENTENCE_CHARS - prefix.length);
|
|
48607
48607
|
if (room < MIN_QUOTE_CHARS) return null;
|
|
48608
|
-
const
|
|
48609
|
-
return
|
|
48608
|
+
const line2 = firstLine(text3, void 0, room);
|
|
48609
|
+
return line2.length > 0 ? `${prefix}${line2}` : null;
|
|
48610
48610
|
}
|
|
48611
48611
|
function reviewAnswer(lines) {
|
|
48612
48612
|
return { rules: ["done_rule"], violations: [...lines.slice(0, MAX_REVIEW_CASES), REVIEW_CLOSING], message: REVIEW_MESSAGE };
|
|
@@ -48762,24 +48762,48 @@ var NOTE_MESSAGES = {
|
|
|
48762
48762
|
closed: "This file is QuikPilot's own note of the database change, and it is not written in this step.",
|
|
48763
48763
|
content: "content must be a string."
|
|
48764
48764
|
};
|
|
48765
|
+
var MAX_SHOWN_NAMES = 2;
|
|
48766
|
+
var MAX_SHOWN_NAME_CHARS = 32;
|
|
48767
|
+
var MAX_UNCHECKED = 8;
|
|
48768
|
+
var MAX_UNCHECKED_CHARS = 200;
|
|
48769
|
+
function cleanName(name2) {
|
|
48770
|
+
return name2.replace(/[^\w$.\-]/g, "_").slice(0, MAX_UNCHECKED_CHARS);
|
|
48771
|
+
}
|
|
48772
|
+
function namesSentence(names) {
|
|
48773
|
+
const shown = names.slice(0, MAX_SHOWN_NAMES).map((n) => n.slice(0, MAX_SHOWN_NAME_CHARS));
|
|
48774
|
+
const more = names.length > shown.length ? ` and ${names.length - shown.length} more` : "";
|
|
48775
|
+
return `${NOT_RECORDED} the migration names ${shown.join(", ")}${more}, which no file this run could read shows. Read the file that defines the stored data, then write the whole note again with the names the repository uses.`;
|
|
48776
|
+
}
|
|
48765
48777
|
function namesNote(args2) {
|
|
48766
48778
|
if (!isRecord3(args2) || typeof args2.path !== "string") return false;
|
|
48767
48779
|
const n = normaliseToolPath(args2.path);
|
|
48768
48780
|
return n.ok && n.path === DATABASE_CHANGE_PATH;
|
|
48769
48781
|
}
|
|
48770
48782
|
var DatabaseChangeNote = class {
|
|
48771
|
-
constructor(partIds, inEffect) {
|
|
48783
|
+
constructor(partIds, inEffect, names) {
|
|
48772
48784
|
this.partIds = partIds;
|
|
48773
48785
|
this.inEffect = inEffect;
|
|
48786
|
+
this.names = names;
|
|
48774
48787
|
}
|
|
48775
48788
|
partIds;
|
|
48776
48789
|
inEffect;
|
|
48790
|
+
names;
|
|
48777
48791
|
text;
|
|
48778
48792
|
proposal;
|
|
48793
|
+
/** QUIKTR-2448: the one send-back for a name nothing readable shows has been used. */
|
|
48794
|
+
sentBack = false;
|
|
48779
48795
|
/** The proposal recorded in this loop, if any. */
|
|
48780
48796
|
recorded() {
|
|
48781
48797
|
return this.proposal;
|
|
48782
48798
|
}
|
|
48799
|
+
uncheckedNames(migration) {
|
|
48800
|
+
if (!this.names) return [];
|
|
48801
|
+
try {
|
|
48802
|
+
return this.names(migration).map(cleanName).filter((n) => n !== "");
|
|
48803
|
+
} catch {
|
|
48804
|
+
return [];
|
|
48805
|
+
}
|
|
48806
|
+
}
|
|
48783
48807
|
/** The result for a call on the note's path; `null` for any other call (it runs as it always did). */
|
|
48784
48808
|
handle(call, ledger, limits) {
|
|
48785
48809
|
if (!NOTE_TOOLS.has(call.name) || !namesNote(call.args)) return null;
|
|
@@ -48802,8 +48826,13 @@ var DatabaseChangeNote = class {
|
|
|
48802
48826
|
const read = readProposal(content, this.partIds);
|
|
48803
48827
|
if (!read.ok) return finish({ status: "bad_args", message: read.sentence });
|
|
48804
48828
|
if (this.text === content) return finish({ status: "no_effect", message: NOTE_MESSAGES.same });
|
|
48829
|
+
const unchecked = this.uncheckedNames(read.proposal.migration);
|
|
48830
|
+
if (unchecked.length > 0 && !this.sentBack) {
|
|
48831
|
+
this.sentBack = true;
|
|
48832
|
+
return finish({ status: "bad_args", message: namesSentence(unchecked) });
|
|
48833
|
+
}
|
|
48805
48834
|
this.text = content;
|
|
48806
|
-
this.proposal = read.proposal;
|
|
48835
|
+
this.proposal = unchecked.length > 0 ? { ...read.proposal, unchecked } : read.proposal;
|
|
48807
48836
|
if (ledger.writeChars !== void 0) ledger.writeChars += content.length;
|
|
48808
48837
|
return finish({ status: "ok", message: NOTE_MESSAGES.recorded, output: { path: DATABASE_CHANGE_PATH, parts: [...read.proposal.parts] } });
|
|
48809
48838
|
}
|
|
@@ -48813,7 +48842,7 @@ function finalDatabaseChange(proposal, tree) {
|
|
|
48813
48842
|
const changed = new Set(tree.changedFiles);
|
|
48814
48843
|
const included = (path) => path !== "" && changed.has(path) && insideWriteRoot(path, tree.writeRoot) && matchesDeniedPath(path, writeDenied(tree.deniedPaths)) === null;
|
|
48815
48844
|
const schemaFileIncluded = included(proposal.schemaFile);
|
|
48816
|
-
const schemaFileSeen = proposal.schemaFile
|
|
48845
|
+
const schemaFileSeen = proposal.schemaFile !== "" && (schemaFileIncluded || tree.readPaths.includes(proposal.schemaFile) && matchesDeniedPath(proposal.schemaFile, readDenied(tree.deniedPaths)) === null);
|
|
48817
48846
|
const text3 = (value, max) => tree.scrub(value).slice(0, max);
|
|
48818
48847
|
return {
|
|
48819
48848
|
parts: proposal.parts.map((id) => ({ id, name: tree.parts.find((p) => p.id === id)?.name ?? id })),
|
|
@@ -48829,7 +48858,8 @@ function finalDatabaseChange(proposal, tree) {
|
|
|
48829
48858
|
...proposal.apply !== void 0 ? { apply: text3(proposal.apply, MAX_APPLY_CHARS) } : {},
|
|
48830
48859
|
schemaFileIncluded,
|
|
48831
48860
|
migrationFileIncluded: included(proposal.migrationFile),
|
|
48832
|
-
schemaFileSeen
|
|
48861
|
+
schemaFileSeen,
|
|
48862
|
+
...proposal.unchecked && proposal.unchecked.length > 0 ? { namesUnchecked: proposal.unchecked.slice(0, MAX_UNCHECKED).map((n) => text3(n, MAX_UNCHECKED_CHARS)) } : {}
|
|
48833
48863
|
};
|
|
48834
48864
|
}
|
|
48835
48865
|
|
|
@@ -48847,26 +48877,45 @@ var MARKER_RE = /\[(P\d+)(?:=(exists|proposed))?\]/g;
|
|
|
48847
48877
|
function isRecord4(x) {
|
|
48848
48878
|
return typeof x === "object" && x !== null && !Array.isArray(x);
|
|
48849
48879
|
}
|
|
48850
|
-
function
|
|
48851
|
-
if (
|
|
48880
|
+
function cutTo(text3, max) {
|
|
48881
|
+
if (text3.length <= max) return text3;
|
|
48882
|
+
const last = text3.charCodeAt(max - 1);
|
|
48883
|
+
const end = last >= 55296 && last <= 56319 ? max - 1 : max;
|
|
48884
|
+
return text3.slice(0, end);
|
|
48885
|
+
}
|
|
48886
|
+
function partsFromDesignCut(design) {
|
|
48887
|
+
const none = { parts: [], cut: 0 };
|
|
48888
|
+
if (!isRecord4(design) || !Array.isArray(design.parts)) return none;
|
|
48852
48889
|
const raw = design.parts;
|
|
48853
|
-
if (raw.length === 0 || raw.length > MAX_PARTS) return
|
|
48890
|
+
if (raw.length === 0 || raw.length > MAX_PARTS) return none;
|
|
48854
48891
|
const out2 = [];
|
|
48855
48892
|
const ids = /* @__PURE__ */ new Set();
|
|
48893
|
+
let cut2 = 0;
|
|
48856
48894
|
for (const p of raw) {
|
|
48857
|
-
if (!isRecord4(p)) return
|
|
48895
|
+
if (!isRecord4(p)) return none;
|
|
48858
48896
|
const { id, kind, name: name2, what } = p;
|
|
48859
|
-
if (typeof id !== "string" || !PART_ID_RE.test(id) || ids.has(id)) return
|
|
48860
|
-
if (typeof kind !== "string" || !PART_KINDS.includes(kind)) return
|
|
48861
|
-
if (typeof name2 !== "string" || name2.trim() === ""
|
|
48862
|
-
if (typeof what !== "string"
|
|
48897
|
+
if (typeof id !== "string" || !PART_ID_RE.test(id) || ids.has(id)) return none;
|
|
48898
|
+
if (typeof kind !== "string" || !PART_KINDS.includes(kind)) return none;
|
|
48899
|
+
if (typeof name2 !== "string" || name2.trim() === "") return none;
|
|
48900
|
+
if (typeof what !== "string") return none;
|
|
48901
|
+
const shortName = cutTo(name2, MAX_NAME_CHARS3);
|
|
48902
|
+
const shortWhat = cutTo(what, MAX_WHAT_CHARS);
|
|
48903
|
+
if (shortName !== name2 || shortWhat !== what) cut2 += 1;
|
|
48863
48904
|
ids.add(id);
|
|
48864
|
-
out2.push({ id, kind, name:
|
|
48905
|
+
out2.push({ id, kind, name: shortName, what: shortWhat });
|
|
48865
48906
|
}
|
|
48866
|
-
return out2;
|
|
48907
|
+
return { parts: out2, cut: cut2 };
|
|
48867
48908
|
}
|
|
48868
48909
|
function designForTargeting(design, on) {
|
|
48869
|
-
if (on
|
|
48910
|
+
if (on) {
|
|
48911
|
+
const read = partsFromDesignCut(design);
|
|
48912
|
+
if (read.parts.length > 0) {
|
|
48913
|
+
if (read.cut === 0) return { design, partsCheck: true };
|
|
48914
|
+
const raw = design.parts;
|
|
48915
|
+
const parts2 = raw.map((p, i3) => ({ ...p, name: read.parts[i3].name, what: read.parts[i3].what }));
|
|
48916
|
+
return { design: { ...design, parts: parts2 }, partsCheck: true };
|
|
48917
|
+
}
|
|
48918
|
+
}
|
|
48870
48919
|
if (!design || !Object.prototype.hasOwnProperty.call(design, "parts")) return { design, partsCheck: false };
|
|
48871
48920
|
const { parts: _parts, ...rest } = design;
|
|
48872
48921
|
void _parts;
|
|
@@ -49016,6 +49065,36 @@ function partMissingSentence(missing, opts = {}) {
|
|
|
49016
49065
|
return `${start3} ${missing[0] ? item(missing[0], true) : ""}`.slice(0, MAX_REFUSED_SENTENCE_CHARS);
|
|
49017
49066
|
}
|
|
49018
49067
|
|
|
49068
|
+
// src/sameFailureHint.ts
|
|
49069
|
+
var MAX_NAMES = 2;
|
|
49070
|
+
var MAX_HINT_CHARS = 300;
|
|
49071
|
+
var SAME_FAILURE_TAIL = " If it should now pass, check the code; if it looks unrelated (say, a 500 from set-up the test lacks), compare its set-up with the tests around it.";
|
|
49072
|
+
var collapse = (text3) => text3.replace(/\s+/g, " ").trim();
|
|
49073
|
+
var line = (text3) => collapse(
|
|
49074
|
+
(text3.split("\n").find((l) => l.trim() !== "") ?? "").replace(/\s*\[at [^\]]*\]/g, "")
|
|
49075
|
+
);
|
|
49076
|
+
function titleOf3(id) {
|
|
49077
|
+
const at2 = id.indexOf("::");
|
|
49078
|
+
return collapse(at2 >= 0 ? id.slice(at2 + 2) : id);
|
|
49079
|
+
}
|
|
49080
|
+
var cut = (text3, max) => text3.length > max ? `${text3.slice(0, Math.max(1, max - 1))}\u2026` : text3;
|
|
49081
|
+
function sameFailureHint(before, now) {
|
|
49082
|
+
const same = Object.keys(now).filter((id) => {
|
|
49083
|
+
const was = line(before[id] ?? "");
|
|
49084
|
+
return was !== "" && was === line(now[id] ?? "");
|
|
49085
|
+
});
|
|
49086
|
+
if (same.length === 0) return null;
|
|
49087
|
+
const rest = same.length - Math.min(MAX_NAMES, same.length);
|
|
49088
|
+
const more = rest > 0 ? ` and ${rest} more` : "";
|
|
49089
|
+
const head = "Your change has not changed how ";
|
|
49090
|
+
const end = ` fails (same message as before).${SAME_FAILURE_TAIL}`;
|
|
49091
|
+
const shown = same.slice(0, MAX_NAMES);
|
|
49092
|
+
const room = MAX_HINT_CHARS - head.length - end.length - more.length - shown.length * 2 - (shown.length - 1) * 2;
|
|
49093
|
+
const each = Math.max(8, Math.floor(room / shown.length));
|
|
49094
|
+
const names = shown.map((id) => `"${cut(titleOf3(id), each)}"`).join(", ");
|
|
49095
|
+
return `${head}${names}${more}${end}`;
|
|
49096
|
+
}
|
|
49097
|
+
|
|
49019
49098
|
// src/codegenLoop.ts
|
|
49020
49099
|
var CODEGEN_LOOP_CONTRACT_VERSION = "codegen-loop-1";
|
|
49021
49100
|
var CODEGEN_LOOP_2_CONTRACT_VERSION = "codegen-loop-2";
|
|
@@ -49118,8 +49197,8 @@ function previousForLoop2(withSteps) {
|
|
|
49118
49197
|
if (!run3?.messages) return previous;
|
|
49119
49198
|
const messages = {};
|
|
49120
49199
|
for (const [name2, text3] of Object.entries(run3.messages)) {
|
|
49121
|
-
const
|
|
49122
|
-
if (
|
|
49200
|
+
const line2 = firstLine(text3);
|
|
49201
|
+
if (line2) messages[name2] = line2;
|
|
49123
49202
|
}
|
|
49124
49203
|
const { messages: _whole, ...rest } = run3;
|
|
49125
49204
|
void _whole;
|
|
@@ -49190,7 +49269,7 @@ async function runCodegenLoop(args2, deps) {
|
|
|
49190
49269
|
const keepOn = notesOn && keepWorkingFilesOn();
|
|
49191
49270
|
const featureOn = notesOn && args2.conflicts !== void 0 && args2.tests !== void 0 && args2.featureTestUpdates === true && args2.phase !== "tests" && !(args2.lane?.kind === "code" && args2.lane.amend !== void 0 && args2.lane.amend.length > 0);
|
|
49192
49271
|
const databaseOn = harness && args2.databaseChange !== void 0 && args2.databaseChange.closed !== true && args2.databaseChange.parts.length > 0 && args2.phase !== "tests" && !(args2.lane?.kind === "code" && args2.lane.amend !== void 0 && args2.lane.amend.length > 0);
|
|
49193
|
-
const note = args2.databaseChange !== void 0 ? new DatabaseChangeNote(args2.databaseChange.parts.map((p) => p.id), databaseOn) : null;
|
|
49272
|
+
const note = args2.databaseChange !== void 0 ? new DatabaseChangeNote(args2.databaseChange.parts.map((p) => p.id), databaseOn, args2.databaseChange.names) : null;
|
|
49194
49273
|
const handedChange = () => {
|
|
49195
49274
|
const recorded = note?.recorded();
|
|
49196
49275
|
return recorded ? { databaseChange: recorded } : {};
|
|
@@ -49343,10 +49422,10 @@ async function runCodegenLoop(args2, deps) {
|
|
|
49343
49422
|
let linesChanged = 0;
|
|
49344
49423
|
let linesSame = 0;
|
|
49345
49424
|
let linesGone = 0;
|
|
49346
|
-
for (const [id,
|
|
49425
|
+
for (const [id, line2] of reviewed.quoted) {
|
|
49347
49426
|
const again = reviewQuote(id);
|
|
49348
49427
|
if (again === null) linesGone += 1;
|
|
49349
|
-
else if (again ===
|
|
49428
|
+
else if (again === line2) linesSame += 1;
|
|
49350
49429
|
else linesChanged += 1;
|
|
49351
49430
|
}
|
|
49352
49431
|
log({
|
|
@@ -49819,8 +49898,8 @@ async function runCodegenLoop(args2, deps) {
|
|
|
49819
49898
|
const ids = args2.redCheckIds ?? [];
|
|
49820
49899
|
const quoted2 = /* @__PURE__ */ new Map();
|
|
49821
49900
|
for (const id of ids) {
|
|
49822
|
-
const
|
|
49823
|
-
if (
|
|
49901
|
+
const line2 = reviewQuote(id);
|
|
49902
|
+
if (line2 !== null) quoted2.set(id, line2);
|
|
49824
49903
|
}
|
|
49825
49904
|
const skip = isFinal ? "final_turn" : quoted2.size === 0 ? "no_message" : tests !== null && tests.runsLeft + tests.fileRunsLeft === 0 ? "no_runs_left" : null;
|
|
49826
49905
|
if (skip !== null) {
|
|
@@ -50007,6 +50086,10 @@ async function runCodegenLoop(args2, deps) {
|
|
|
50007
50086
|
throw new CodegenLoopFailure("executor_error", void 0, err2);
|
|
50008
50087
|
}
|
|
50009
50088
|
}
|
|
50089
|
+
if (featureOn && args2.seedOwnFailures && call.name === RUN_TESTS_TOOL && isTestAnswer(result.output) && result.output.messages) {
|
|
50090
|
+
const hint = sameFailureHint(args2.seedOwnFailures, result.output.messages);
|
|
50091
|
+
if (hint) result = { ...result, message: `${result.message ?? ""} ${hint}`.trim() };
|
|
50092
|
+
}
|
|
50010
50093
|
results.push(result);
|
|
50011
50094
|
if (call.name === "read_file" && isPlainObject3(call.args) && typeof call.args.path === "string" && (result.status === "ok" || result.status === "duplicate")) {
|
|
50012
50095
|
const entry = { id: call.id, turn, path: call.args.path, ...rangeOf(call.args) };
|
|
@@ -50117,7 +50200,7 @@ function frozenFailingTarget(failingTests, frozen, textOf2) {
|
|
|
50117
50200
|
}
|
|
50118
50201
|
function testBlock(text3, token) {
|
|
50119
50202
|
const lines = text3.split("\n");
|
|
50120
|
-
const at2 = lines.flatMap((
|
|
50203
|
+
const at2 = lines.flatMap((line2, n) => line2.includes(token) ? [n] : []);
|
|
50121
50204
|
if (at2.length !== 1) return null;
|
|
50122
50205
|
let end = at2[0] + 1;
|
|
50123
50206
|
while (end < lines.length && !QP_TOKEN.test(lines[end])) end += 1;
|
|
@@ -50235,6 +50318,9 @@ async function runPhases(i3) {
|
|
|
50235
50318
|
lane: { kind: "code", testPaths: i3.testPaths, frozen: tests.frozen },
|
|
50236
50319
|
seed: tests.results,
|
|
50237
50320
|
...tests.proposals ? { seedProposals: tests.proposals } : {},
|
|
50321
|
+
// QUIKTR-2446 part B: how the run's own tests failed on the code before the change (phase 1's last whole-suite run), for the one thing the
|
|
50322
|
+
// code phase tells the AI about it: a test that still fails the same way is not failing because of the change.
|
|
50323
|
+
...tests.answer?.messages && Object.keys(tests.answer.messages).length > 0 ? { seedOwnFailures: tests.answer.messages } : {},
|
|
50238
50324
|
...i3.parts && i3.parts.length > 0 ? { parts: i3.parts } : {},
|
|
50239
50325
|
keepOnGiveUp: true,
|
|
50240
50326
|
previousAttempt: keptChange(i3.attempt, "tests_written", tests.answer, tests.steps)
|
|
@@ -50415,16 +50501,16 @@ function pathOk(p) {
|
|
|
50415
50501
|
return typeof p === "string" && p.length > 0 && p.length <= MAX_RECORD_PATH_CHARS;
|
|
50416
50502
|
}
|
|
50417
50503
|
function buildCodegenLoopRecord(loop) {
|
|
50418
|
-
let
|
|
50504
|
+
let cut2 = false;
|
|
50419
50505
|
const room = (rows) => {
|
|
50420
50506
|
const kept = [];
|
|
50421
50507
|
for (const r of rows) {
|
|
50422
50508
|
if (kept.length >= MAX_RECORD_PATHS) {
|
|
50423
|
-
|
|
50509
|
+
cut2 = true;
|
|
50424
50510
|
break;
|
|
50425
50511
|
}
|
|
50426
50512
|
if (!pathOk(r.path)) {
|
|
50427
|
-
|
|
50513
|
+
cut2 = true;
|
|
50428
50514
|
continue;
|
|
50429
50515
|
}
|
|
50430
50516
|
kept.push(r);
|
|
@@ -50443,13 +50529,13 @@ function buildCodegenLoopRecord(loop) {
|
|
|
50443
50529
|
const statusCounts = {};
|
|
50444
50530
|
for (const [k, v] of Object.entries(loop.statusCounts).slice(0, MAX_STATUS_KEYS)) {
|
|
50445
50531
|
if (k.length > 0 && k.length <= MAX_STATUS_KEY_CHARS) statusCounts[k] = whole3(v);
|
|
50446
|
-
else
|
|
50532
|
+
else cut2 = true;
|
|
50447
50533
|
}
|
|
50448
|
-
if (Object.keys(loop.statusCounts).length > MAX_STATUS_KEYS)
|
|
50534
|
+
if (Object.keys(loop.statusCounts).length > MAX_STATUS_KEYS) cut2 = true;
|
|
50449
50535
|
const reasoning = [];
|
|
50450
50536
|
for (const r of loop.reasoning) {
|
|
50451
50537
|
if (reasoning.length >= MAX_RECORD_REASONING_TURNS) {
|
|
50452
|
-
|
|
50538
|
+
cut2 = true;
|
|
50453
50539
|
break;
|
|
50454
50540
|
}
|
|
50455
50541
|
const text3 = typeof r.text === "string" ? r.text.trim() : "";
|
|
@@ -50460,7 +50546,7 @@ function buildCodegenLoopRecord(loop) {
|
|
|
50460
50546
|
const testRuns = [];
|
|
50461
50547
|
for (const t of loop.testRuns ?? []) {
|
|
50462
50548
|
if (testRuns.length >= MAX_RECORD_TEST_RUNS) {
|
|
50463
|
-
|
|
50549
|
+
cut2 = true;
|
|
50464
50550
|
break;
|
|
50465
50551
|
}
|
|
50466
50552
|
testRuns.push({
|
|
@@ -50481,7 +50567,7 @@ function buildCodegenLoopRecord(loop) {
|
|
|
50481
50567
|
const phases = [];
|
|
50482
50568
|
for (const ph of loop.phases ?? []) {
|
|
50483
50569
|
if (phases.length >= MAX_RECORD_PHASES) {
|
|
50484
|
-
|
|
50570
|
+
cut2 = true;
|
|
50485
50571
|
break;
|
|
50486
50572
|
}
|
|
50487
50573
|
if (!PHASES.has(ph.phase) || typeof ph.outcome !== "string" || ph.outcome.length === 0) continue;
|
|
@@ -50494,15 +50580,15 @@ function buildCodegenLoopRecord(loop) {
|
|
|
50494
50580
|
});
|
|
50495
50581
|
}
|
|
50496
50582
|
const refused2 = clampRefusedTurns(loop.refusedTurns);
|
|
50497
|
-
if (refused2.cut)
|
|
50583
|
+
if (refused2.cut) cut2 = true;
|
|
50498
50584
|
const attempts = [];
|
|
50499
50585
|
for (const a of loop.attempts ?? []) {
|
|
50500
50586
|
if (attempts.length >= MAX_RECORD_ATTEMPTS) {
|
|
50501
|
-
|
|
50587
|
+
cut2 = true;
|
|
50502
50588
|
break;
|
|
50503
50589
|
}
|
|
50504
50590
|
if (!Number.isInteger(a.n) || a.n < 1 || a.n > MAX_RECORD_ATTEMPTS || typeof a.outcome !== "string" || a.outcome.length === 0) {
|
|
50505
|
-
|
|
50591
|
+
cut2 = true;
|
|
50506
50592
|
continue;
|
|
50507
50593
|
}
|
|
50508
50594
|
const reason = typeof a.reason === "string" ? a.reason.slice(0, MAX_STATUS_KEY_CHARS) : "";
|
|
@@ -50552,7 +50638,7 @@ function buildCodegenLoopRecord(loop) {
|
|
|
50552
50638
|
...phases.length > 0 ? { phases } : {},
|
|
50553
50639
|
...healed ? { heal: healed } : {},
|
|
50554
50640
|
reasoning,
|
|
50555
|
-
...
|
|
50641
|
+
...cut2 ? { truncated: true } : {}
|
|
50556
50642
|
};
|
|
50557
50643
|
}
|
|
50558
50644
|
|
|
@@ -50708,8 +50794,8 @@ function pythonImports(file, text3, ix) {
|
|
|
50708
50794
|
const joined = rest ? import_node_path20.posix.join(base, rest.replace(/\./g, "/")) : base;
|
|
50709
50795
|
return [`${joined}.py`, `${joined}/__init__.py`].filter((p) => ix.set.has(p) && p !== file);
|
|
50710
50796
|
};
|
|
50711
|
-
for (const
|
|
50712
|
-
const from = /^[ \t]*from[ \t]+(\.*)([\w.]*)[ \t]+import[ \t]+(.+?)\s*$/.exec(
|
|
50797
|
+
for (const line2 of text3.split("\n")) {
|
|
50798
|
+
const from = /^[ \t]*from[ \t]+(\.*)([\w.]*)[ \t]+import[ \t]+(.+?)\s*$/.exec(line2);
|
|
50713
50799
|
if (from) {
|
|
50714
50800
|
const dots = from[1].length;
|
|
50715
50801
|
const mod = from[2];
|
|
@@ -50723,7 +50809,7 @@ function pythonImports(file, text3, ix) {
|
|
|
50723
50809
|
}
|
|
50724
50810
|
continue;
|
|
50725
50811
|
}
|
|
50726
|
-
const imp = /^[ \t]*import[ \t]+(.+?)\s*$/.exec(
|
|
50812
|
+
const imp = /^[ \t]*import[ \t]+(.+?)\s*$/.exec(line2);
|
|
50727
50813
|
if (imp) {
|
|
50728
50814
|
for (const part of imp[1].split(",")) {
|
|
50729
50815
|
const mod = part.trim().split(/\s+as\s+/)[0].trim();
|
|
@@ -50939,8 +51025,8 @@ function pairedTestPaths(codePath, listing, isTest = isTestTarget) {
|
|
|
50939
51025
|
const stem = m[1].toLowerCase();
|
|
50940
51026
|
const dir = dirOf2(codePath);
|
|
50941
51027
|
const parent = parentOf(dir);
|
|
50942
|
-
const
|
|
50943
|
-
const homes = /* @__PURE__ */ new Set([dir,
|
|
51028
|
+
const join18 = (d, leaf) => d === "" ? leaf : `${d}/${leaf}`;
|
|
51029
|
+
const homes = /* @__PURE__ */ new Set([dir, join18(dir, "__tests__"), join18(parent, "__tests__"), join18(parent, "tests"), join18(parent, "test")]);
|
|
50944
51030
|
const found = [];
|
|
50945
51031
|
for (const path of listing) {
|
|
50946
51032
|
if (!homes.has(dirOf2(path))) continue;
|
|
@@ -51320,7 +51406,7 @@ function buildCodegenLoopArgs(p, context = collectLoopContext({
|
|
|
51320
51406
|
...p.mode === "loop-tests" && p.tests && p.harness !== false && p.tools2?.notes === true && p.conflicts && p.fixFirst === true && p.runScratch ? { runScratch: p.runScratch } : {},
|
|
51321
51407
|
...p.mode === "loop-tests" && p.tests && p.harness !== false && p.tools2?.notes === true && p.conflicts && p.featureTestUpdates === true ? { featureTestUpdates: true } : {},
|
|
51322
51408
|
// QUIKTR-2445: the harness only (the loop decides where the key is in effect).
|
|
51323
|
-
...p.mode === "loop-tests" && p.tests && p.harness !== false && p.databaseChange && p.databaseChange.length > 0 ? { databaseChange: { parts: p.databaseChange } } : {},
|
|
51409
|
+
...p.mode === "loop-tests" && p.tests && p.harness !== false && p.databaseChange && p.databaseChange.length > 0 ? { databaseChange: { parts: p.databaseChange, ...p.databaseNames ? { names: p.databaseNames } : {} } } : {},
|
|
51324
51410
|
// An approved test change stands whatever version the AI Runtime speaks: a person decided it.
|
|
51325
51411
|
...p.approved && p.approved.length > 0 ? { approved: p.approved.map((r) => ({ targetPath: r.targetPath, newContent: r.newContent })) } : {}
|
|
51326
51412
|
};
|
|
@@ -51987,13 +52073,13 @@ var CALL_LINE_RE = /fetch\s*\(|\baxios\b|(?:\$|\bjQuery)\.(?:ajax|get|post|getJS
|
|
|
51987
52073
|
var NO_PATH = "(this file's route)";
|
|
51988
52074
|
function detectMentions(text3) {
|
|
51989
52075
|
const found = [];
|
|
51990
|
-
for (const
|
|
51991
|
-
const methodMatch = ROUTE_METHOD_RE.exec(
|
|
51992
|
-
const pathMatch = ROUTE_PATH_RE.exec(
|
|
51993
|
-
if (methodMatch && pathMatch && !CALL_LINE_RE.test(
|
|
52076
|
+
for (const line2 of text3.split("\n")) {
|
|
52077
|
+
const methodMatch = ROUTE_METHOD_RE.exec(line2);
|
|
52078
|
+
const pathMatch = ROUTE_PATH_RE.exec(line2);
|
|
52079
|
+
if (methodMatch && pathMatch && !CALL_LINE_RE.test(line2)) {
|
|
51994
52080
|
found.push({ method: methodMatch[1].toUpperCase(), path: pathMatch[0].replace(/:+$/, "") });
|
|
51995
52081
|
}
|
|
51996
|
-
const exportMatch = ROUTE_EXPORT_RE.exec(
|
|
52082
|
+
const exportMatch = ROUTE_EXPORT_RE.exec(line2);
|
|
51997
52083
|
if (exportMatch) {
|
|
51998
52084
|
found.push({ method: exportMatch[1].toUpperCase(), path: NO_PATH });
|
|
51999
52085
|
}
|
|
@@ -52012,9 +52098,9 @@ function surfaceCovers(surface, mention) {
|
|
|
52012
52098
|
}
|
|
52013
52099
|
function addedLines(before, after) {
|
|
52014
52100
|
const beforeLines = new Set(before.split("\n"));
|
|
52015
|
-
return after.split("\n").filter((
|
|
52101
|
+
return after.split("\n").filter((line2) => !beforeLines.has(line2)).join("\n");
|
|
52016
52102
|
}
|
|
52017
|
-
function checkApiScope(results, targets, apiChanges) {
|
|
52103
|
+
function checkApiScope(results, targets, apiChanges, existing) {
|
|
52018
52104
|
const targetsByPath = new Map(targets.map((t) => [t.path, t]));
|
|
52019
52105
|
const violations = [];
|
|
52020
52106
|
for (const { targetPath, newContent } of results) {
|
|
@@ -52035,6 +52121,7 @@ function checkApiScope(results, targets, apiChanges) {
|
|
|
52035
52121
|
}
|
|
52036
52122
|
for (const mention of detectMentions(scanned)) {
|
|
52037
52123
|
if (!apiChanges.some((c) => surfaceCovers(c.surface, mention))) {
|
|
52124
|
+
if (existing && mention.path !== NO_PATH && existing.has(mention)) continue;
|
|
52038
52125
|
violations.push({ file: targetPath, method: mention.method, path: mention.path });
|
|
52039
52126
|
}
|
|
52040
52127
|
}
|
|
@@ -52517,8 +52604,8 @@ function approvedTestsFailing(input) {
|
|
|
52517
52604
|
const examples = [];
|
|
52518
52605
|
for (const id of failingIds) {
|
|
52519
52606
|
if (examples.length >= MAX_MISFIT_EXAMPLES) break;
|
|
52520
|
-
const
|
|
52521
|
-
if (
|
|
52607
|
+
const line2 = firstLine(input.check.failureText.get(id) ?? "", void 0, MAX_MISFIT_EXAMPLE_CHARS);
|
|
52608
|
+
if (line2 && !examples.includes(line2)) examples.push(line2);
|
|
52522
52609
|
}
|
|
52523
52610
|
out2.push({ path: d.path, testTitle: d.testTitle, caseId: d.caseId, failingIds, failingRows, totalRows, examples });
|
|
52524
52611
|
}
|
|
@@ -52559,6 +52646,46 @@ function exitCodeFailedMessage() {
|
|
|
52559
52646
|
}
|
|
52560
52647
|
var EXIT_CODE_ONLY_NOTE = "The change was checked by the Test command's result only: it passed before and after the change, but no test report was found, so QuikPilot could not see individual tests or confirm that its new tests ran.";
|
|
52561
52648
|
|
|
52649
|
+
// src/existingRoutes.ts
|
|
52650
|
+
var import_node_child_process10 = require("node:child_process");
|
|
52651
|
+
var GREP_TIMEOUT_MS = 1e4;
|
|
52652
|
+
var MAX_HIT_LINES = 400;
|
|
52653
|
+
var MAX_OUTPUT_BYTES = 4e6;
|
|
52654
|
+
function anchorOf(path) {
|
|
52655
|
+
const pieces = path.split(/:[A-Za-z0-9_]+|\{[^}]+\}|\[[^\]]+\]/).filter((p) => p.length > 0);
|
|
52656
|
+
return pieces.sort((a, b) => b.length - a.length)[0] ?? "";
|
|
52657
|
+
}
|
|
52658
|
+
function routeAlreadyNamed(cwd, mention) {
|
|
52659
|
+
if (mention.path === NO_PATH) return false;
|
|
52660
|
+
const anchor = anchorOf(mention.path);
|
|
52661
|
+
if (anchor.length < 3) return false;
|
|
52662
|
+
const wanted = normalizePath(mention.path);
|
|
52663
|
+
let out2;
|
|
52664
|
+
try {
|
|
52665
|
+
out2 = (0, import_node_child_process10.execFileSync)("git", ["grep", "-I", "-n", "-F", "-e", anchor], {
|
|
52666
|
+
cwd,
|
|
52667
|
+
encoding: "utf8",
|
|
52668
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
52669
|
+
timeout: GREP_TIMEOUT_MS,
|
|
52670
|
+
maxBuffer: MAX_OUTPUT_BYTES
|
|
52671
|
+
});
|
|
52672
|
+
} catch {
|
|
52673
|
+
return false;
|
|
52674
|
+
}
|
|
52675
|
+
let seen = 0;
|
|
52676
|
+
for (const hit of out2.split("\n")) {
|
|
52677
|
+
if (hit === "") continue;
|
|
52678
|
+
if (++seen > MAX_HIT_LINES) return false;
|
|
52679
|
+
const m = /^(.*?):(\d+):(.*)$/.exec(hit);
|
|
52680
|
+
if (!m) continue;
|
|
52681
|
+
if (isTestFile(m[1])) continue;
|
|
52682
|
+
for (const found of detectMentions(m[3])) {
|
|
52683
|
+
if (found.path !== NO_PATH && found.method === mention.method && normalizePath(found.path) === wanted) return true;
|
|
52684
|
+
}
|
|
52685
|
+
}
|
|
52686
|
+
return false;
|
|
52687
|
+
}
|
|
52688
|
+
|
|
52562
52689
|
// src/testPlacementCheck.ts
|
|
52563
52690
|
function isDiscovered(targetPath, discoveredFiles) {
|
|
52564
52691
|
const normalized = targetPath.replace(/\\/g, "/");
|
|
@@ -52827,10 +52954,10 @@ function describeVanishedTests(vanished) {
|
|
|
52827
52954
|
var import_node_path24 = require("node:path");
|
|
52828
52955
|
|
|
52829
52956
|
// src/packageUse.ts
|
|
52830
|
-
var
|
|
52957
|
+
var import_node_child_process11 = require("node:child_process");
|
|
52831
52958
|
var PACKAGE_NAME = /^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/;
|
|
52832
52959
|
var FILE_TYPES = ["*.ts", "*.tsx", "*.js", "*.jsx", "*.mjs", "*.cjs", "*.mts", "*.cts"];
|
|
52833
|
-
var
|
|
52960
|
+
var GREP_TIMEOUT_MS2 = 1e4;
|
|
52834
52961
|
function importPattern(pkg) {
|
|
52835
52962
|
const escaped = pkg.replace(/[.]/g, "\\.");
|
|
52836
52963
|
return `(from|import|require)[[:space:]]*\\(?[[:space:]]*['"]${escaped}(/[^'"]*)?['"]`;
|
|
@@ -52839,10 +52966,10 @@ function packageImportedInWorkspace(pkg, root, cwd = process.cwd()) {
|
|
|
52839
52966
|
if (!PACKAGE_NAME.test(pkg)) return false;
|
|
52840
52967
|
const pathspecs = FILE_TYPES.map((type) => root ? `:(glob)${root}/**/${type}` : `:(glob)**/${type}`);
|
|
52841
52968
|
try {
|
|
52842
|
-
(0,
|
|
52969
|
+
(0, import_node_child_process11.execFileSync)("git", ["grep", "-q", "-E", "-e", importPattern(pkg), "--", ...pathspecs], {
|
|
52843
52970
|
cwd,
|
|
52844
52971
|
stdio: "ignore",
|
|
52845
|
-
timeout:
|
|
52972
|
+
timeout: GREP_TIMEOUT_MS2
|
|
52846
52973
|
});
|
|
52847
52974
|
return true;
|
|
52848
52975
|
} catch {
|
|
@@ -52897,7 +53024,13 @@ async function verifyChange(ctx, results, undoable) {
|
|
|
52897
53024
|
return fail(new Error(`QuikPilot's generated code imports packages this repository doesn't have \u2014 ${describeDependencyViolations(depCheck)}`));
|
|
52898
53025
|
}
|
|
52899
53026
|
stage = "scope";
|
|
52900
|
-
const scopeCheck = checkApiScope(results, targets, packet.design?.apiChanges ?? []
|
|
53027
|
+
const scopeCheck = checkApiScope(results, targets, packet.design?.apiChanges ?? [], {
|
|
53028
|
+
has: (mention) => {
|
|
53029
|
+
const named2 = routeAlreadyNamed(cwd, mention);
|
|
53030
|
+
if (named2) console.log(JSON.stringify({ event: "scope.existing_route", method: mention.method, path: mention.path }));
|
|
53031
|
+
return named2;
|
|
53032
|
+
}
|
|
53033
|
+
});
|
|
52901
53034
|
if (scopeCheck.blocked) {
|
|
52902
53035
|
return fail(new Error(`QuikPilot's generated code exceeds the approved design \u2014 ${describeScopeViolations(scopeCheck)}`));
|
|
52903
53036
|
}
|
|
@@ -53044,7 +53177,7 @@ ${violations.join("\n")}`);
|
|
|
53044
53177
|
}
|
|
53045
53178
|
|
|
53046
53179
|
// src/run.ts
|
|
53047
|
-
var
|
|
53180
|
+
var import_node_fs28 = require("node:fs");
|
|
53048
53181
|
|
|
53049
53182
|
// src/mapMode.ts
|
|
53050
53183
|
var MAP_ENV = "QUIKPILOT_MAP";
|
|
@@ -53117,9 +53250,9 @@ var cap = (s) => s.length <= MAX_ENTRY_CHARS ? s : `${s.slice(0, MAX_ENTRY_CHARS
|
|
|
53117
53250
|
var parentOf2 = (d) => d.includes("/") ? d.slice(0, d.lastIndexOf("/")) : "";
|
|
53118
53251
|
function clip5(text3, max) {
|
|
53119
53252
|
if (text3.length <= max) return { text: text3, truncated: false };
|
|
53120
|
-
const
|
|
53121
|
-
const nl =
|
|
53122
|
-
return { text: nl > max / 2 ?
|
|
53253
|
+
const cut2 = text3.slice(0, max);
|
|
53254
|
+
const nl = cut2.lastIndexOf("\n");
|
|
53255
|
+
return { text: nl > max / 2 ? cut2.slice(0, nl) : cut2, truncated: true };
|
|
53123
53256
|
}
|
|
53124
53257
|
function guidanceFiles(i3, perFile2, total) {
|
|
53125
53258
|
const tracked = new Set(i3.fullListing);
|
|
@@ -53282,18 +53415,18 @@ function pnpmWorkspacePatterns(text3) {
|
|
|
53282
53415
|
const out2 = [];
|
|
53283
53416
|
let inPackages = false;
|
|
53284
53417
|
for (const raw of text3.replace(/\r\n/g, "\n").split("\n")) {
|
|
53285
|
-
const
|
|
53286
|
-
if (/^packages\s*:/.test(
|
|
53418
|
+
const line2 = raw.replace(/\s+#.*$/, "");
|
|
53419
|
+
if (/^packages\s*:/.test(line2)) {
|
|
53287
53420
|
inPackages = true;
|
|
53288
53421
|
continue;
|
|
53289
53422
|
}
|
|
53290
53423
|
if (!inPackages) continue;
|
|
53291
|
-
const item = /^\s+-\s+(.+?)\s*$/.exec(
|
|
53424
|
+
const item = /^\s+-\s+(.+?)\s*$/.exec(line2);
|
|
53292
53425
|
if (item) {
|
|
53293
53426
|
out2.push(item[1].replace(/^["']|["']$/g, ""));
|
|
53294
53427
|
continue;
|
|
53295
53428
|
}
|
|
53296
|
-
if (
|
|
53429
|
+
if (line2.trim() !== "" && !/^\s/.test(line2)) inPackages = false;
|
|
53297
53430
|
}
|
|
53298
53431
|
return out2;
|
|
53299
53432
|
}
|
|
@@ -53611,14 +53744,14 @@ function writePhase0Marker(runId) {
|
|
|
53611
53744
|
}
|
|
53612
53745
|
|
|
53613
53746
|
// src/failureArtifact.ts
|
|
53614
|
-
var
|
|
53747
|
+
var import_node_child_process12 = require("node:child_process");
|
|
53615
53748
|
var import_node_fs25 = require("node:fs");
|
|
53616
53749
|
var import_node_path27 = require("node:path");
|
|
53617
53750
|
var FAILURE_ARTIFACT_DIR = "quikpilot-failure";
|
|
53618
53751
|
var REPORT_COPY = "final-test-report.xml";
|
|
53619
53752
|
var MAX_REPORT_BYTES = 5 * 1024 * 1024;
|
|
53620
53753
|
var MAX_FILES = 200;
|
|
53621
|
-
var RUNNER_VERSION = true ? "9.3.0-rc.
|
|
53754
|
+
var RUNNER_VERSION = true ? "9.3.0-rc.78" : "dev";
|
|
53622
53755
|
function safeDestination(base, repoPath) {
|
|
53623
53756
|
if (!repoPath || (0, import_node_path27.isAbsolute)(repoPath)) return null;
|
|
53624
53757
|
const destination = (0, import_node_path27.resolve)(base, repoPath);
|
|
@@ -53628,7 +53761,7 @@ function safeDestination(base, repoPath) {
|
|
|
53628
53761
|
}
|
|
53629
53762
|
var BUNDLE_FILE = "quikpilot-change.bundle";
|
|
53630
53763
|
function keepCommitBundle(repo, folder, branch) {
|
|
53631
|
-
const git3 = (args2) => (0,
|
|
53764
|
+
const git3 = (args2) => (0, import_node_child_process12.execFileSync)("git", args2, { cwd: repo, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim();
|
|
53632
53765
|
try {
|
|
53633
53766
|
if (git3(["rev-parse", "--abbrev-ref", "HEAD"]) !== branch) return null;
|
|
53634
53767
|
if (git3(["diff", "--name-only", "HEAD~1", "HEAD"]) === "") return null;
|
|
@@ -53700,12 +53833,12 @@ function writeFailureArtifact(input) {
|
|
|
53700
53833
|
}
|
|
53701
53834
|
|
|
53702
53835
|
// src/finalChange.ts
|
|
53703
|
-
var
|
|
53836
|
+
var import_node_child_process13 = require("node:child_process");
|
|
53704
53837
|
var import_node_fs26 = require("node:fs");
|
|
53705
53838
|
var import_node_path28 = require("node:path");
|
|
53706
53839
|
function changesAgainstBase(root, wanted) {
|
|
53707
53840
|
if (wanted.size === 0) return [];
|
|
53708
|
-
const status = (0,
|
|
53841
|
+
const status = (0, import_node_child_process13.execFileSync)("git", ["status", "--porcelain", "-z", "--untracked-files=all", "--no-renames"], {
|
|
53709
53842
|
cwd: root,
|
|
53710
53843
|
encoding: "utf8",
|
|
53711
53844
|
maxBuffer: 64 * 1024 * 1024
|
|
@@ -53723,6 +53856,108 @@ function changesAgainstBase(root, wanted) {
|
|
|
53723
53856
|
});
|
|
53724
53857
|
}
|
|
53725
53858
|
|
|
53859
|
+
// src/nameEvidence.ts
|
|
53860
|
+
var import_node_child_process14 = require("node:child_process");
|
|
53861
|
+
var import_node_fs27 = require("node:fs");
|
|
53862
|
+
var import_node_path29 = require("node:path");
|
|
53863
|
+
|
|
53864
|
+
// src/migrationNames.ts
|
|
53865
|
+
var PART = String.raw`(?:"[^"]+"|\x60[^\x60]+\x60|\[[^\]]+\]|[\w$]+)`;
|
|
53866
|
+
var IDENT4 = `${PART}(?:\\s*\\.\\s*${PART}){0,2}`;
|
|
53867
|
+
var ALTER = new RegExp(String.raw`\bALTER\s+TABLE\s+(?:IF\s+EXISTS\s+)?(?:ONLY\s+)?(${IDENT4})`, "gi");
|
|
53868
|
+
var CREATE = new RegExp(String.raw`\bCREATE\s+(?:(?:GLOBAL\s+|LOCAL\s+)?(?:TEMP(?:ORARY)?|UNLOGGED)\s+)?TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?(${IDENT4})`, "gi");
|
|
53869
|
+
var INDEX = new RegExp(String.raw`\bCREATE\s+(?:UNIQUE\s+)?INDEX\s+(?:CONCURRENTLY\s+)?(?:IF\s+NOT\s+EXISTS\s+)?(?:${IDENT4}\s+)?ON\s+(?:ONLY\s+)?(${IDENT4})`, "gi");
|
|
53870
|
+
var REFERENCES = new RegExp(String.raw`\bREFERENCES\s+(${IDENT4})`, "gi");
|
|
53871
|
+
var INSERT = new RegExp(String.raw`\bINSERT\s+INTO\s+(${IDENT4})`, "gi");
|
|
53872
|
+
var MAX_LABEL_CHARS = 60;
|
|
53873
|
+
function withoutComments(sql) {
|
|
53874
|
+
return sql.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/--[^\n]*/g, " ");
|
|
53875
|
+
}
|
|
53876
|
+
function parse6(raw) {
|
|
53877
|
+
const parts2 = [...raw.matchAll(new RegExp(PART, "g"))].map((m) => {
|
|
53878
|
+
const p = m[0];
|
|
53879
|
+
return /^["\x60\[]/.test(p) ? p.slice(1, -1) : p;
|
|
53880
|
+
});
|
|
53881
|
+
const table = parts2.at(-1);
|
|
53882
|
+
if (!table) return null;
|
|
53883
|
+
const schema = parts2.length >= 2 ? parts2.at(-2) : void 0;
|
|
53884
|
+
return schema ? { schema, table } : { table };
|
|
53885
|
+
}
|
|
53886
|
+
function namesOf2(re, sql) {
|
|
53887
|
+
return [...sql.matchAll(re)].flatMap((m) => {
|
|
53888
|
+
const n = parse6(m[1]);
|
|
53889
|
+
return n ? [n] : [];
|
|
53890
|
+
});
|
|
53891
|
+
}
|
|
53892
|
+
function tablesIn(migration) {
|
|
53893
|
+
const sql = withoutComments(migration);
|
|
53894
|
+
const created = new Set(namesOf2(CREATE, sql).map((n) => n.table));
|
|
53895
|
+
const seen = /* @__PURE__ */ new Set();
|
|
53896
|
+
const out2 = [];
|
|
53897
|
+
const referred = [...namesOf2(ALTER, sql), ...namesOf2(INDEX, sql), ...namesOf2(REFERENCES, sql), ...namesOf2(INSERT, sql)];
|
|
53898
|
+
const position = (n) => {
|
|
53899
|
+
const at2 = sql.indexOf(n.table);
|
|
53900
|
+
return at2 < 0 ? Number.MAX_SAFE_INTEGER : at2;
|
|
53901
|
+
};
|
|
53902
|
+
for (const name2 of referred.sort((a, b) => position(a) - position(b))) {
|
|
53903
|
+
if (created.has(name2.table)) continue;
|
|
53904
|
+
const key = `${name2.schema ?? ""}\0${name2.table}`;
|
|
53905
|
+
if (seen.has(key)) continue;
|
|
53906
|
+
seen.add(key);
|
|
53907
|
+
out2.push(name2);
|
|
53908
|
+
}
|
|
53909
|
+
return out2;
|
|
53910
|
+
}
|
|
53911
|
+
function nameLabel(name2) {
|
|
53912
|
+
const clean = (s) => s.replace(/[^\w$.\-]/g, "_");
|
|
53913
|
+
const label = name2.schema ? `${clean(name2.schema)}.${clean(name2.table)}` : clean(name2.table);
|
|
53914
|
+
return label.length > MAX_LABEL_CHARS ? label.slice(0, MAX_LABEL_CHARS) : label;
|
|
53915
|
+
}
|
|
53916
|
+
|
|
53917
|
+
// src/nameEvidence.ts
|
|
53918
|
+
var GREP_TIMEOUT_MS3 = 1e4;
|
|
53919
|
+
var MAX_FILES2 = 200;
|
|
53920
|
+
var MAX_FILE_BYTES2 = 2e6;
|
|
53921
|
+
var DOC_FILE = /\.(?:md|mdx|markdown|txt|rst|adoc|docx?)$/i;
|
|
53922
|
+
var escapeRegExp5 = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
53923
|
+
function filesNaming(word, ev, readable, denied) {
|
|
53924
|
+
let out2;
|
|
53925
|
+
try {
|
|
53926
|
+
out2 = (0, import_node_child_process14.execFileSync)("git", ["grep", "-l", "-I", "-w", "-F", "-e", word], {
|
|
53927
|
+
cwd: ev.cwd,
|
|
53928
|
+
encoding: "utf8",
|
|
53929
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
53930
|
+
timeout: GREP_TIMEOUT_MS3,
|
|
53931
|
+
maxBuffer: 4e6
|
|
53932
|
+
});
|
|
53933
|
+
} catch {
|
|
53934
|
+
return [];
|
|
53935
|
+
}
|
|
53936
|
+
return out2.split("\n").filter((f) => f !== "" && f !== DATABASE_CHANGE_PATH && !DOC_FILE.test(f) && (readable === null || readable.has(f)) && matchesDeniedPath(f, denied) === null).slice(0, MAX_FILES2);
|
|
53937
|
+
}
|
|
53938
|
+
function fileHasWord(cwd, file, word) {
|
|
53939
|
+
try {
|
|
53940
|
+
const path = (0, import_node_path29.join)(cwd, file);
|
|
53941
|
+
if ((0, import_node_fs27.statSync)(path).size > MAX_FILE_BYTES2) return false;
|
|
53942
|
+
return new RegExp(`(?<![\\w$])${escapeRegExp5(word)}(?![\\w$])`).test((0, import_node_fs27.readFileSync)(path, "utf8"));
|
|
53943
|
+
} catch {
|
|
53944
|
+
return false;
|
|
53945
|
+
}
|
|
53946
|
+
}
|
|
53947
|
+
function unfoundNames(names, ev) {
|
|
53948
|
+
const denied = readDenied(ev.deniedPaths);
|
|
53949
|
+
const readable = ev.readable ? new Set(ev.readable) : null;
|
|
53950
|
+
return names.filter((name2) => {
|
|
53951
|
+
const files = filesNaming(name2.table, ev, readable, denied);
|
|
53952
|
+
if (files.length === 0) return true;
|
|
53953
|
+
if (!name2.schema) return false;
|
|
53954
|
+
return !files.some((f) => fileHasWord(ev.cwd, f, name2.schema));
|
|
53955
|
+
});
|
|
53956
|
+
}
|
|
53957
|
+
function makeNameChecker(ev) {
|
|
53958
|
+
return (migration) => unfoundNames(tablesIn(migration), ev).map(nameLabel);
|
|
53959
|
+
}
|
|
53960
|
+
|
|
53726
53961
|
// src/testDiscovery.ts
|
|
53727
53962
|
var ABSENT = { report: "ABSENT" };
|
|
53728
53963
|
var DRIVE_RE = /^[A-Za-z]:\//;
|
|
@@ -54138,33 +54373,33 @@ var MAX_REASON_CHARS3 = 300;
|
|
|
54138
54373
|
var MAX_LOOP_READS = 50;
|
|
54139
54374
|
var MAX_FALLBACK_REASON_CHARS = 40;
|
|
54140
54375
|
function clampList(values, max, maxChars) {
|
|
54141
|
-
let
|
|
54376
|
+
let cut2 = false;
|
|
54142
54377
|
const kept = [];
|
|
54143
54378
|
for (const raw of values ?? []) {
|
|
54144
54379
|
const v = typeof raw === "string" ? raw.trim() : "";
|
|
54145
54380
|
if (v.length === 0) continue;
|
|
54146
54381
|
if (v.length > maxChars || kept.length >= max) {
|
|
54147
|
-
|
|
54382
|
+
cut2 = true;
|
|
54148
54383
|
continue;
|
|
54149
54384
|
}
|
|
54150
54385
|
kept.push(v);
|
|
54151
54386
|
}
|
|
54152
|
-
return { kept, cut };
|
|
54387
|
+
return { kept, cut: cut2 };
|
|
54153
54388
|
}
|
|
54154
54389
|
function wholeNumber2(n) {
|
|
54155
54390
|
return typeof n === "number" && Number.isInteger(n) && n >= 0 ? n : 0;
|
|
54156
54391
|
}
|
|
54157
54392
|
function clampLoop(loop) {
|
|
54158
|
-
let
|
|
54393
|
+
let cut2 = false;
|
|
54159
54394
|
const reads = [];
|
|
54160
54395
|
for (const r of loop.reads ?? []) {
|
|
54161
54396
|
if (reads.length >= MAX_LOOP_READS) {
|
|
54162
|
-
|
|
54397
|
+
cut2 = true;
|
|
54163
54398
|
break;
|
|
54164
54399
|
}
|
|
54165
54400
|
const path = typeof r.path === "string" ? r.path.trim() : "";
|
|
54166
54401
|
if (path.length === 0 || path.length > MAX_PATH_CHARS5) {
|
|
54167
|
-
|
|
54402
|
+
cut2 = true;
|
|
54168
54403
|
continue;
|
|
54169
54404
|
}
|
|
54170
54405
|
reads.push({
|
|
@@ -54176,7 +54411,7 @@ function clampLoop(loop) {
|
|
|
54176
54411
|
});
|
|
54177
54412
|
}
|
|
54178
54413
|
const refusedTurns = clampRefusedTurns(loop.refusedTurns);
|
|
54179
|
-
if (refusedTurns.cut)
|
|
54414
|
+
if (refusedTurns.cut) cut2 = true;
|
|
54180
54415
|
return {
|
|
54181
54416
|
turns: wholeNumber2(loop.turns),
|
|
54182
54417
|
toolCalls: wholeNumber2(loop.toolCalls),
|
|
@@ -54192,13 +54427,13 @@ function clampLoop(loop) {
|
|
|
54192
54427
|
...clampTotals(loop.usage) ? { usage: clampTotals(loop.usage) } : {},
|
|
54193
54428
|
reads,
|
|
54194
54429
|
...refusedTurns.rows.length > 0 ? { refusedTurns: refusedTurns.rows } : {},
|
|
54195
|
-
...
|
|
54430
|
+
...cut2 ? { truncated: true } : {}
|
|
54196
54431
|
};
|
|
54197
54432
|
}
|
|
54198
54433
|
function buildTargetingRecord(targeting, contextLog) {
|
|
54199
54434
|
let truncated = false;
|
|
54200
|
-
const note = (
|
|
54201
|
-
if (
|
|
54435
|
+
const note = (cut2) => {
|
|
54436
|
+
if (cut2) truncated = true;
|
|
54202
54437
|
};
|
|
54203
54438
|
if (targeting.outcome === "NO_TARGET") {
|
|
54204
54439
|
const record3 = { outcome: "NO_TARGET", targets: [], skippedCaseIds: [], codegenContext: [] };
|
|
@@ -54352,7 +54587,7 @@ async function run2(env2) {
|
|
|
54352
54587
|
await preloadLanguages(workspaceListing);
|
|
54353
54588
|
const readCheckoutText2 = (path) => {
|
|
54354
54589
|
try {
|
|
54355
|
-
return (0,
|
|
54590
|
+
return (0, import_node_fs28.readFileSync)(path, "utf8");
|
|
54356
54591
|
} catch {
|
|
54357
54592
|
return null;
|
|
54358
54593
|
}
|
|
@@ -54384,8 +54619,9 @@ async function run2(env2) {
|
|
|
54384
54619
|
}
|
|
54385
54620
|
const outOfScope = (packet.outOfScope ?? []).map((entry) => entry.trim()).filter((entry) => entry.length > 0);
|
|
54386
54621
|
const partsOn = partsCheckOn();
|
|
54387
|
-
const
|
|
54388
|
-
|
|
54622
|
+
const designRead = partsOn ? partsFromDesignCut(packet.design) : { parts: [], cut: 0 };
|
|
54623
|
+
const designParts = designRead.parts;
|
|
54624
|
+
if (partsOn) console.log(JSON.stringify({ event: "parts_check.on", parts: designParts.length, ...designRead.cut > 0 ? { cut: designRead.cut } : {} }));
|
|
54389
54625
|
const featureSwitch = featureTestUpdatesOn();
|
|
54390
54626
|
const setupStartedAt = Date.now();
|
|
54391
54627
|
runCommand(packet.commands.setup, "Setup");
|
|
@@ -54487,7 +54723,7 @@ async function run2(env2) {
|
|
|
54487
54723
|
);
|
|
54488
54724
|
}
|
|
54489
54725
|
const codegenMode = mapMode ? "loop-tests" : resolveCodegenMode(process.env, packet.codegenMode);
|
|
54490
|
-
const noteTaken = workspaceListing.includes(DATABASE_CHANGE_PATH) || scope.readListing.includes(DATABASE_CHANGE_PATH) || (0,
|
|
54726
|
+
const noteTaken = workspaceListing.includes(DATABASE_CHANGE_PATH) || scope.readListing.includes(DATABASE_CHANGE_PATH) || (0, import_node_fs28.existsSync)(DATABASE_CHANGE_PATH);
|
|
54491
54727
|
const proposals = designParts.length > 0 && codegenMode === "loop-tests" && !noteTaken;
|
|
54492
54728
|
if (designParts.some((p) => p.kind === "stored") && codegenMode === "loop-tests" && noteTaken) console.log(JSON.stringify({ event: "database_change.off", reason: "note_path_taken" }));
|
|
54493
54729
|
if (designParts.length > 0) {
|
|
@@ -54569,7 +54805,7 @@ async function run2(env2) {
|
|
|
54569
54805
|
...twoPhase ? { twoPhase: true, ...packet.requiredTestTypes ? { requiredTestTypes: packet.requiredTestTypes } : {} } : {},
|
|
54570
54806
|
...redReview ? { redReview: true } : {},
|
|
54571
54807
|
...codeParts.length > 0 ? { parts: codeParts } : {},
|
|
54572
|
-
...dbParts.length > 0 ? { databaseChange: dbParts } : {},
|
|
54808
|
+
...dbParts.length > 0 ? { databaseChange: dbParts, databaseNames: makeNameChecker({ cwd: process.cwd(), deniedPaths: packet.guardrails.deniedPaths, readable: scope.readListing }) } : {},
|
|
54573
54809
|
tests: {
|
|
54574
54810
|
root: process.cwd(),
|
|
54575
54811
|
command: packet.commands.test,
|
|
@@ -54760,7 +54996,8 @@ async function run2(env2) {
|
|
|
54760
54996
|
flagged: databaseChange.flagged,
|
|
54761
54997
|
schemaFileIncluded: databaseChange.schemaFileIncluded,
|
|
54762
54998
|
migrationFileIncluded: databaseChange.migrationFileIncluded,
|
|
54763
|
-
schemaFileSeen: databaseChange.schemaFileSeen
|
|
54999
|
+
schemaFileSeen: databaseChange.schemaFileSeen,
|
|
55000
|
+
namesUnchecked: databaseChange.namesUnchecked?.length ?? 0
|
|
54764
55001
|
})
|
|
54765
55002
|
);
|
|
54766
55003
|
}
|
|
@@ -54943,7 +55180,7 @@ async function runReadinessCheck(env2) {
|
|
|
54943
55180
|
// src/investigateFindings.ts
|
|
54944
55181
|
var VERDICTS = ["PRESENT", "NOT_PRESENT", "CANNOT_TELL", "NEW_BEHAVIOUR"];
|
|
54945
55182
|
var ROLES = ["entry_point", "faulty_function", "caller", "helper", "test", "other"];
|
|
54946
|
-
var
|
|
55183
|
+
var MAX_FILES3 = 12;
|
|
54947
55184
|
var MAX_CALL_PATH = 10;
|
|
54948
55185
|
var MAX_EVIDENCE = 8;
|
|
54949
55186
|
var MAX_SEARCHES = 5;
|
|
@@ -55056,7 +55293,7 @@ function verifyFindings(raw, ledger, ctx) {
|
|
|
55056
55293
|
dropped.files += 1;
|
|
55057
55294
|
continue;
|
|
55058
55295
|
}
|
|
55059
|
-
if (files.length >=
|
|
55296
|
+
if (files.length >= MAX_FILES3) continue;
|
|
55060
55297
|
const role = ROLES.includes(f.role) ? f.role : "other";
|
|
55061
55298
|
files.push({ path: f.path, role, symbols: symbolsOf(f.path, f.symbols) });
|
|
55062
55299
|
}
|