@codyswann/lisa 4.17.6 → 4.17.8
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/all/copy-contents/gitignore +6 -0
- package/dist/cli/doctor-reconciliation.d.ts +15 -0
- package/dist/cli/doctor-reconciliation.d.ts.map +1 -0
- package/dist/cli/doctor-reconciliation.js +123 -0
- package/dist/cli/doctor-reconciliation.js.map +1 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +7 -0
- package/dist/cli/doctor.js.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +6 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/lisa.d.ts.map +1 -1
- package/dist/core/lisa.js +15 -1
- package/dist/core/lisa.js.map +1 -1
- package/dist/core/reconciliation-report.d.ts +100 -0
- package/dist/core/reconciliation-report.d.ts.map +1 -0
- package/dist/core/reconciliation-report.js +178 -0
- package/dist/core/reconciliation-report.js.map +1 -0
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +8 -2
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/utils/postinstall-trampoline-report-source.d.ts +50 -0
- package/dist/utils/postinstall-trampoline-report-source.d.ts.map +1 -0
- package/dist/utils/postinstall-trampoline-report-source.js +113 -0
- package/dist/utils/postinstall-trampoline-report-source.js.map +1 -0
- package/dist/utils/postinstall-trampoline-source.d.ts +65 -0
- package/dist/utils/postinstall-trampoline-source.d.ts.map +1 -0
- package/dist/utils/postinstall-trampoline-source.js +312 -0
- package/dist/utils/postinstall-trampoline-source.js.map +1 -0
- package/dist/utils/postinstall-trampoline.d.ts +4 -2
- package/dist/utils/postinstall-trampoline.d.ts.map +1 -1
- package/dist/utils/postinstall-trampoline.js +5 -197
- package/dist/utils/postinstall-trampoline.js.map +1 -1
- package/package.json +2 -2
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/typescript/copy-overwrite/scripts/check-skipped-required-checks.mjs +121 -44
|
@@ -1156,9 +1156,9 @@ export function resolveRepoSlug(repo, env = process.env) {
|
|
|
1156
1156
|
* carried no `CodeRabbit` status at all, 40 times out of 40. A guard keyed on
|
|
1157
1157
|
* the merge commit would have read "absent" on every one of them.
|
|
1158
1158
|
*
|
|
1159
|
-
* Returns undefined rather than throwing.
|
|
1160
|
-
*
|
|
1161
|
-
*
|
|
1159
|
+
* Returns undefined rather than throwing. The settlement reader treats that as
|
|
1160
|
+
* an unreadable snapshot and retries; it never evaluates evidence until this
|
|
1161
|
+
* function names one concrete commit.
|
|
1162
1162
|
*
|
|
1163
1163
|
* @param {string|number} pr - Pull request number
|
|
1164
1164
|
* @param {string} [repo] - `OWNER/NAME`, or undefined to resolve it
|
|
@@ -1202,17 +1202,31 @@ export function citeHeadSha(headSha) {
|
|
|
1202
1202
|
}
|
|
1203
1203
|
|
|
1204
1204
|
/**
|
|
1205
|
-
* Reads one `gh api`
|
|
1205
|
+
* Reads every page from one `gh api` list route.
|
|
1206
1206
|
*
|
|
1207
|
-
*
|
|
1208
|
-
*
|
|
1207
|
+
* `gh api --paginate` invokes `--jq` once per response page. Encoding each
|
|
1208
|
+
* page's selected rows with `@json` keeps one parseable array per output line,
|
|
1209
|
+
* including when a description itself contains newlines.
|
|
1210
|
+
*
|
|
1211
|
+
* @param {string} endpoint - REST endpoint, including `per_page=100`
|
|
1212
|
+
* @param {string} query - jq expression that selects an array from one page
|
|
1213
|
+
* @returns {object[]} The selected rows from every page
|
|
1209
1214
|
*/
|
|
1210
|
-
function
|
|
1211
|
-
const
|
|
1212
|
-
|
|
1215
|
+
function ghApiPaginatedArray(endpoint, query) {
|
|
1216
|
+
const raw = boundedExecFileSync(
|
|
1217
|
+
"gh",
|
|
1218
|
+
["api", endpoint, "--paginate", "--jq", `${query} | @json`],
|
|
1219
|
+
{ encoding: "utf8" }
|
|
1213
1220
|
);
|
|
1214
|
-
|
|
1215
|
-
|
|
1221
|
+
return raw
|
|
1222
|
+
.split("\n")
|
|
1223
|
+
.map(line => line.trim())
|
|
1224
|
+
.filter(Boolean)
|
|
1225
|
+
.flatMap(line => {
|
|
1226
|
+
const page = JSON.parse(line);
|
|
1227
|
+
if (!Array.isArray(page)) throw new TypeError("page is not an array");
|
|
1228
|
+
return page;
|
|
1229
|
+
});
|
|
1216
1230
|
}
|
|
1217
1231
|
|
|
1218
1232
|
/**
|
|
@@ -1259,26 +1273,7 @@ export function fetchChecksViaApi(pr, repo, cause) {
|
|
|
1259
1273
|
],
|
|
1260
1274
|
{ encoding: "utf8" }
|
|
1261
1275
|
).trim();
|
|
1262
|
-
|
|
1263
|
-
"api",
|
|
1264
|
-
`repos/${slug}/commits/${sha}/status`,
|
|
1265
|
-
"--jq",
|
|
1266
|
-
"[.statuses[] | {name: .context, state: .state, description: .description}]",
|
|
1267
|
-
]);
|
|
1268
|
-
const runs = ghApiArray([
|
|
1269
|
-
"api",
|
|
1270
|
-
`repos/${slug}/commits/${sha}/check-runs?per_page=100`,
|
|
1271
|
-
"--jq",
|
|
1272
|
-
'[.check_runs[] | {name: .name, conclusion: .conclusion, description: (.output.title // "")}]',
|
|
1273
|
-
]);
|
|
1274
|
-
return [
|
|
1275
|
-
...statuses.map(row =>
|
|
1276
|
-
normalizeCheckRow(row.name, row.state, row.description)
|
|
1277
|
-
),
|
|
1278
|
-
...runs.map(row =>
|
|
1279
|
-
normalizeCheckRow(row.name, row.conclusion, row.description)
|
|
1280
|
-
),
|
|
1281
|
-
];
|
|
1276
|
+
return fetchChecksForCommit(sha, slug);
|
|
1282
1277
|
} catch (error) {
|
|
1283
1278
|
throw new Error(
|
|
1284
1279
|
`check-skipped-required-checks: could not read checks for PR ${pr} in ${slug}. \`gh pr checks\` failed (${why}) — which is what a missing \`actions: read\` looks like, because it resolves the rollup through \`checkSuite.workflowRun\` and exits non-zero with empty output — and the commit-status fallback also failed (${error instanceof Error ? error.message : String(error)}). NOBODY LOOKED at this pull request; that is not the same as nothing being wrong with it.`
|
|
@@ -1286,6 +1281,42 @@ export function fetchChecksViaApi(pr, repo, cause) {
|
|
|
1286
1281
|
}
|
|
1287
1282
|
}
|
|
1288
1283
|
|
|
1284
|
+
/**
|
|
1285
|
+
* Reads the evidence-bearing rows for one exact commit.
|
|
1286
|
+
*
|
|
1287
|
+
* The vacuity arm settles a pull request over time, but the rows themselves are
|
|
1288
|
+
* commit data. Keeping this reader SHA-addressed prevents a branch push from
|
|
1289
|
+
* changing the object underneath an in-flight inspection.
|
|
1290
|
+
*
|
|
1291
|
+
* @param {string} sha - Exact commit whose statuses and check runs to read
|
|
1292
|
+
* @param {string|undefined} repo - `OWNER/NAME`, or undefined to resolve it
|
|
1293
|
+
* @returns {Array<{name: string, state: string, bucket?: string, description?: string}>} The checks
|
|
1294
|
+
*/
|
|
1295
|
+
export function fetchChecksForCommit(sha, repo) {
|
|
1296
|
+
const slug = resolveRepoSlug(repo);
|
|
1297
|
+
if (slug === undefined) {
|
|
1298
|
+
throw new Error(
|
|
1299
|
+
`check-skipped-required-checks: cannot read commit ${sha} without an OWNER/NAME. Pass \`--repo=OWNER/NAME\`, or set GITHUB_REPOSITORY.`
|
|
1300
|
+
);
|
|
1301
|
+
}
|
|
1302
|
+
const statuses = ghApiPaginatedArray(
|
|
1303
|
+
`repos/${slug}/commits/${sha}/status?per_page=100`,
|
|
1304
|
+
"[.statuses[] | {name: .context, state: .state, description: .description}]"
|
|
1305
|
+
);
|
|
1306
|
+
const runs = ghApiPaginatedArray(
|
|
1307
|
+
`repos/${slug}/commits/${sha}/check-runs?per_page=100`,
|
|
1308
|
+
'[.check_runs[] | {name: .name, conclusion: .conclusion, description: (.output.title // "")}]'
|
|
1309
|
+
);
|
|
1310
|
+
return [
|
|
1311
|
+
...statuses.map(row =>
|
|
1312
|
+
normalizeCheckRow(row.name, row.state, row.description)
|
|
1313
|
+
),
|
|
1314
|
+
...runs.map(row =>
|
|
1315
|
+
normalizeCheckRow(row.name, row.conclusion, row.description)
|
|
1316
|
+
),
|
|
1317
|
+
];
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1289
1320
|
/**
|
|
1290
1321
|
* Puts one row from either API route into the shape this file evaluates.
|
|
1291
1322
|
*
|
|
@@ -1365,25 +1396,74 @@ function sleepSync(ms) {
|
|
|
1365
1396
|
* @param {object} declaration - The per-repo declaration
|
|
1366
1397
|
* @param {string|number} pr - Pull request number
|
|
1367
1398
|
* @param {string|undefined} repo - `OWNER/NAME`, or undefined
|
|
1368
|
-
* @param {{timeoutSeconds?: number, intervalSeconds?: number, fetch?: Function, now?: Function, sleep?: Function}} [options] -
|
|
1399
|
+
* @param {{timeoutSeconds?: number, intervalSeconds?: number, fetch?: Function, now?: Function, sleep?: Function, headSha?: Function}} [options] -
|
|
1369
1400
|
* Injection seams; the suite drives the whole loop through them so nothing
|
|
1370
1401
|
* here has to sleep in real time
|
|
1371
|
-
* @returns {{checks: object[], settled: boolean}} The rows, and
|
|
1402
|
+
* @returns {{checks: object[], settled: boolean, headSha: string|undefined}} The rows, whether they settled, and the head they were read at
|
|
1372
1403
|
*/
|
|
1373
1404
|
export function fetchSettledChecks(declaration, pr, repo, options = {}) {
|
|
1374
1405
|
const timeoutMs = (options.timeoutSeconds ?? SETTLE_TIMEOUT_SECONDS) * 1000;
|
|
1375
1406
|
const intervalMs =
|
|
1376
1407
|
(options.intervalSeconds ?? SETTLE_INTERVAL_SECONDS) * 1000;
|
|
1377
|
-
const read =
|
|
1408
|
+
const read =
|
|
1409
|
+
options.fetch ??
|
|
1410
|
+
((_request, slug, headSha) => {
|
|
1411
|
+
if (headSha === undefined) {
|
|
1412
|
+
throw new Error(
|
|
1413
|
+
"check-skipped-required-checks: cannot read review evidence without a concrete head commit."
|
|
1414
|
+
);
|
|
1415
|
+
}
|
|
1416
|
+
return fetchChecksForCommit(headSha, slug);
|
|
1417
|
+
});
|
|
1418
|
+
const resolveHead = options.headSha ?? resolveHeadSha;
|
|
1378
1419
|
const clock = options.now ?? Date.now;
|
|
1379
1420
|
const sleep = options.sleep ?? sleepSync;
|
|
1380
1421
|
const deadline = clock() + timeoutMs;
|
|
1381
|
-
|
|
1382
|
-
|
|
1422
|
+
|
|
1423
|
+
// Bracket every roster read with head reads. `gh pr checks` targets the PR's
|
|
1424
|
+
// current head but does not return the SHA it used, and the permission-light
|
|
1425
|
+
// fallback resolves the head internally. A push between either route and a
|
|
1426
|
+
// later provenance lookup used to make findings cite a commit whose checks
|
|
1427
|
+
// were never evaluated. Matching observations on both sides bind the roster
|
|
1428
|
+
// to that head; a mismatch is discarded and re-read, never reported.
|
|
1429
|
+
const snapshot = () => {
|
|
1430
|
+
const before = resolveHead(pr, repo);
|
|
1431
|
+
if (before === undefined) {
|
|
1432
|
+
return {
|
|
1433
|
+
checks: [],
|
|
1434
|
+
headSha: undefined,
|
|
1435
|
+
stable: false,
|
|
1436
|
+
after: undefined,
|
|
1437
|
+
};
|
|
1438
|
+
}
|
|
1439
|
+
const checks = read(pr, repo, before);
|
|
1440
|
+
const after = resolveHead(pr, repo);
|
|
1441
|
+
return {
|
|
1442
|
+
checks,
|
|
1443
|
+
headSha: before,
|
|
1444
|
+
stable: after !== undefined && before === after,
|
|
1445
|
+
after,
|
|
1446
|
+
};
|
|
1447
|
+
};
|
|
1448
|
+
|
|
1449
|
+
let observed = snapshot();
|
|
1450
|
+
while (
|
|
1451
|
+
(!observed.stable || !checksSettled(declaration, observed.checks)) &&
|
|
1452
|
+
clock() < deadline
|
|
1453
|
+
) {
|
|
1383
1454
|
sleep(Math.min(intervalMs, deadline - clock()));
|
|
1384
|
-
|
|
1455
|
+
observed = snapshot();
|
|
1385
1456
|
}
|
|
1386
|
-
|
|
1457
|
+
if (!observed.stable) {
|
|
1458
|
+
throw new Error(
|
|
1459
|
+
`check-skipped-required-checks: the pull request head changed while its checks were being read (${observed.headSha ?? "unresolved"} -> ${observed.after ?? "unresolved"}). Refusing to attach one commit's review evidence to another; re-read the pull request after the push settles.`
|
|
1460
|
+
);
|
|
1461
|
+
}
|
|
1462
|
+
return {
|
|
1463
|
+
checks: observed.checks,
|
|
1464
|
+
settled: checksSettled(declaration, observed.checks),
|
|
1465
|
+
headSha: observed.headSha,
|
|
1466
|
+
};
|
|
1387
1467
|
}
|
|
1388
1468
|
|
|
1389
1469
|
/**
|
|
@@ -1660,6 +1740,7 @@ export function inspectVacuity(argv, declaration, options = {}) {
|
|
|
1660
1740
|
fetch: options.fetch,
|
|
1661
1741
|
now: options.now,
|
|
1662
1742
|
sleep: options.sleep,
|
|
1743
|
+
headSha: options.headSha,
|
|
1663
1744
|
});
|
|
1664
1745
|
} catch (error) {
|
|
1665
1746
|
return { ...empty, refusal: vacuityRefusal({ declaration, pr, error }) };
|
|
@@ -1669,18 +1750,14 @@ export function inspectVacuity(argv, declaration, options = {}) {
|
|
|
1669
1750
|
if (refusal !== null) {
|
|
1670
1751
|
return { ...empty, settled: read.settled, refusal };
|
|
1671
1752
|
}
|
|
1672
|
-
// Resolved here rather than inside a fetch path, so the commit is named
|
|
1673
|
-
// whichever route read the checks — `gh pr checks` does not return it, and
|
|
1674
|
-
// only the permission-light fallback was resolving it at all.
|
|
1675
|
-
const headSha = (options.headSha ?? resolveHeadSha)(pr, repo);
|
|
1676
1753
|
const evaluated = evaluateVacuousChecks(declaration, read.checks, {
|
|
1677
1754
|
trustRequiredContexts: options.trustRequiredContexts,
|
|
1678
|
-
headSha,
|
|
1755
|
+
headSha: read.headSha,
|
|
1679
1756
|
});
|
|
1680
1757
|
return {
|
|
1681
1758
|
pr,
|
|
1682
1759
|
prSource: source,
|
|
1683
|
-
headSha,
|
|
1760
|
+
headSha: read.headSha,
|
|
1684
1761
|
checked: evaluated.checked,
|
|
1685
1762
|
violations: evaluated.violations,
|
|
1686
1763
|
settled: read.settled,
|