@codyswann/lisa 5.11.0 → 5.12.0

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.
Files changed (76) hide show
  1. package/all/copy-overwrite/scripts/review-evidence-event.mjs +7 -1
  2. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  3. package/dist/core/lisa-owned-hash-ledger.js +18 -0
  4. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  5. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  6. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  7. package/dist/core/upstream-evidence-manifest.js +6 -5
  8. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  9. package/expo/create-only/.github/required-checks.json +1 -0
  10. package/nestjs/create-only/.github/required-checks.json +1 -0
  11. package/package.json +4 -4
  12. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  13. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  14. package/plugins/lisa-agy/plugin.json +1 -1
  15. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  16. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  17. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  18. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  19. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  20. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  21. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  22. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  23. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  24. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  25. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  26. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  27. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  28. package/plugins/lisa-expo-agy/plugin.json +1 -1
  29. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  31. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  33. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  35. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  36. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  38. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  39. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  40. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  42. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  43. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  47. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  49. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  50. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  53. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  54. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  56. package/plugins/lisa-rails-agy/plugin.json +1 -1
  57. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  61. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  63. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  64. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  68. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  70. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  71. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  73. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  75. package/typescript/copy-overwrite/scripts/check-skipped-required-checks.mjs +271 -8
  76. package/typescript/create-only/.github/required-checks.json +1 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "5.11.0",
3
+ "version": "5.12.0",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "5.11.0",
3
+ "version": "5.12.0",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1039,7 +1039,10 @@ export function loadDeclaration(rootDir) {
1039
1039
  `check-skipped-required-checks: ${DECLARATION_PATH} does not exist. This guard rests on two REVIEWED SNAPSHOTS that cannot be derived from the repository — the ruleset's required contexts, and what each \`skip_jobs\` token silences. Create it (Lisa ships a seed) rather than deleting the guard.`
1040
1040
  );
1041
1041
  }
1042
- const declaration = JSON.parse(readFileSync(path, "utf8"));
1042
+ const declaration = withGateReviewers(
1043
+ JSON.parse(readFileSync(path, "utf8")),
1044
+ gateReviewers(rootDir)
1045
+ );
1043
1046
  assertRequiredDeclarationKeys(declaration);
1044
1047
  assertDeclarationCollections(declaration);
1045
1048
  assertRequiredContextsByBranch(declaration);
@@ -1052,6 +1055,226 @@ export function loadDeclaration(rootDir) {
1052
1055
  return declaration;
1053
1056
  }
1054
1057
 
1058
+ /** Repo-relative path of the project's Lisa config, which holds the gates. */
1059
+ const LISA_CONFIG_PATH = ".lisa.config.json";
1060
+
1061
+ /**
1062
+ * @typedef {Record<string, {proof?: string[], no_work?: string[]}>} GateVocabularies
1063
+ * Description vocabulary per reviewer context, as read from the gates config.
1064
+ */
1065
+
1066
+ /**
1067
+ * The third-party reviewers `.lisa.config.json` declares, as description
1068
+ * vocabularies keyed by the awaited context (CodySwannGT/lisa#4914).
1069
+ *
1070
+ * A reviewer is a gate whose pull-request entry awaits a context and marks it
1071
+ * `evidence.reviewer: true` — the same reading as `configuredReviewers` in
1072
+ * `check-third-party-review-evidence.mjs`. That script ships from the `all/`
1073
+ * template and this one from `typescript/`, so a host can carry either without
1074
+ * the other; the reading is repeated here rather than imported, and a unit test
1075
+ * holds the two to the same answer.
1076
+ *
1077
+ * Reviewers come back in two sets. `checks` must post a check, so they are
1078
+ * evidence-bearing. `reviewBy` are proven by `evidence.review_by`: the prover
1079
+ * reads their `await` check first and falls back to their submitted review only
1080
+ * when they posted none, so a check they DO post is still examined for a hollow
1081
+ * green — but one that never posted is not a finding, because a review is
1082
+ * that reviewer's evidence.
1083
+ *
1084
+ * No config means no reviewers. A config that does not parse, or a reviewer
1085
+ * gate whose phrases are malformed, is refused: this guard would otherwise
1086
+ * examine fewer reviewers, or other words, than the project declared and say
1087
+ * nothing.
1088
+ * @param {string} rootDir - Repository root
1089
+ * @returns {{checks: GateVocabularies, reviewBy: GateVocabularies}} Vocabulary per reviewer context
1090
+ * @throws {Error} When `.lisa.config.json` does not parse or a reviewer gate's phrases are malformed
1091
+ */
1092
+ function gateReviewers(rootDir) {
1093
+ const path = resolveWithinRoot(rootDir, LISA_CONFIG_PATH, "the Lisa config");
1094
+ /** @type {{checks: GateVocabularies, reviewBy: GateVocabularies}} */
1095
+ const reviewers = { checks: {}, reviewBy: {} };
1096
+ if (!existsSync(path)) return reviewers;
1097
+ let config;
1098
+ try {
1099
+ config = JSON.parse(readFileSync(path, "utf8"));
1100
+ } catch (error) {
1101
+ throw new Error(
1102
+ `check-skipped-required-checks: ${LISA_CONFIG_PATH} is not readable (${/** @type {Error} */ (error).message}). Its gates declare the third-party reviewers this guard examines, so it refuses rather than examining none of them.`
1103
+ );
1104
+ }
1105
+ for (const [gateId, gate] of Object.entries(config?.gates ?? {})) {
1106
+ if (!isPlainObject(gate)) continue;
1107
+ const entry = gate["pull-request"];
1108
+ if (!isPlainObject(entry)) continue;
1109
+ const evidence = entry.evidence;
1110
+ if (evidence?.reviewer !== true) continue;
1111
+ if (typeof entry.await !== "string" || entry.await.trim() === "") continue;
1112
+ const vocabulary = {};
1113
+ for (const list of ["proof", "no_work"]) {
1114
+ if (evidence[list] === undefined) continue;
1115
+ assertGatePhrases(gateId, list, evidence[list]);
1116
+ vocabulary[list] = evidence[list];
1117
+ }
1118
+ // A gate pinned by `posted_by` never takes the review route (#4916), so it
1119
+ // must post its check: evidence-bearing, as the prover reads it.
1120
+ const set =
1121
+ entry.posted_by === undefined &&
1122
+ typeof evidence.review_by === "string" &&
1123
+ evidence.review_by.trim() !== ""
1124
+ ? reviewers.reviewBy
1125
+ : reviewers.checks;
1126
+ set[entry.await] = mergeVocabulary(set[entry.await] ?? {}, vocabulary);
1127
+ }
1128
+ // A context another gate requires to post a check is evidence-bearing, and
1129
+ // judging it twice would report one hollow green as two. It is judged once,
1130
+ // reading both gates' phrases.
1131
+ for (const name of Object.keys(reviewers.checks)) {
1132
+ if (!Object.hasOwn(reviewers.reviewBy, name)) continue;
1133
+ reviewers.checks[name] = mergeVocabulary(
1134
+ reviewers.checks[name],
1135
+ reviewers.reviewBy[name]
1136
+ );
1137
+ delete reviewers.reviewBy[name];
1138
+ }
1139
+ return reviewers;
1140
+ }
1141
+
1142
+ /**
1143
+ * Whether a value is a non-null, non-array object.
1144
+ * @param {unknown} value - Any value
1145
+ * @returns {boolean} True for a plain object
1146
+ */
1147
+ function isPlainObject(value) {
1148
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1149
+ }
1150
+
1151
+ /**
1152
+ * Refuses a reviewer gate's phrase list unless it is an array of non-blank
1153
+ * strings, naming the gate it came from so the fix lands in the right file.
1154
+ * @param {string} gateId - The gate's id in `.lisa.config.json`
1155
+ * @param {string} list - `proof` or `no_work`
1156
+ * @param {unknown} phrases - The declared value
1157
+ * @returns {void}
1158
+ * @throws {Error} When the list is malformed
1159
+ */
1160
+ function assertGatePhrases(gateId, list, phrases) {
1161
+ if (
1162
+ !Array.isArray(phrases) ||
1163
+ phrases.some(
1164
+ phrase =>
1165
+ typeof phrase !== "string" || normalizeDescription(phrase) === ""
1166
+ )
1167
+ ) {
1168
+ throw new Error(
1169
+ `check-skipped-required-checks: ${LISA_CONFIG_PATH} \`gates.${gateId}.pull-request.evidence.${list}\` must be an array of non-empty description strings.`
1170
+ );
1171
+ }
1172
+ }
1173
+
1174
+ /**
1175
+ * Two vocabularies for one check, as one: each phrase list is the union of
1176
+ * both, in order, without repeats. Phrases only ever ADD to the shipped
1177
+ * defaults, so a union is the reading that keeps both declarations' meaning.
1178
+ *
1179
+ * A list `left` holds that is not an array is kept as it is, so
1180
+ * `assertEvidenceBearingChecks` still refuses it rather than seeing the other
1181
+ * declaration's valid list in its place.
1182
+ * @param {Record<string, unknown>} left - One vocabulary
1183
+ * @param {Record<string, unknown>} right - The other
1184
+ * @returns {Record<string, unknown>} The combined vocabulary
1185
+ */
1186
+ function mergeVocabulary(left, right) {
1187
+ const merged = { ...left };
1188
+ for (const list of ["proof", "no_work"]) {
1189
+ if (right[list] === undefined) continue;
1190
+ if (left[list] === undefined) merged[list] = right[list];
1191
+ else if (Array.isArray(left[list]) && Array.isArray(right[list]))
1192
+ merged[list] = [...new Set([...left[list], ...right[list]])];
1193
+ }
1194
+ return merged;
1195
+ }
1196
+
1197
+ /**
1198
+ * The phrases each check run is decoded with: the evidence-bearing checks'
1199
+ * and the review_by checks', unioned per name (#4914). A review_by run decoded
1200
+ * without its gate's phrases would miss a declared no-work title and read as
1201
+ * proved.
1202
+ * @param {object} declaration - The loaded declaration.
1203
+ * @returns {Record<string, object>} Phrases by check name.
1204
+ */
1205
+ export function decodingVocabulary(declaration) {
1206
+ const evidence =
1207
+ /** @type {{evidence_bearing_checks?: Record<string, object>|null, review_by_checks?: Record<string, object>|null}} */ (
1208
+ declaration
1209
+ );
1210
+ const merged = { ...evidence.evidence_bearing_checks };
1211
+ for (const [name, vocabulary] of Object.entries(
1212
+ evidence.review_by_checks ?? {}
1213
+ )) {
1214
+ const existing = merged[name];
1215
+ merged[name] =
1216
+ existing && typeof existing === "object"
1217
+ ? mergeVocabulary(existing, vocabulary ?? {})
1218
+ : (vocabulary ?? {});
1219
+ }
1220
+ return merged;
1221
+ }
1222
+
1223
+ /**
1224
+ * The declaration with the gates config's reviewers added
1225
+ * (CodySwannGT/lisa#4914).
1226
+ *
1227
+ * The gates config is where a project names its reviewer; a project switching
1228
+ * vendors edits it and this guard follows. Reviewers that must post a check
1229
+ * join `evidence_bearing_checks`; names already there keep working, and a name
1230
+ * declared in both reads both vocabularies. Reviewers proven by
1231
+ * `evidence.review_by` go to `review_by_checks`, which only the vacuity arm
1232
+ * reads and only for a check they actually posted — see
1233
+ * {@link evaluateVacuousChecks}. With no reviewer gate the declaration is
1234
+ * returned as is.
1235
+ * @param {object} declaration - Parsed `.github/required-checks.json`
1236
+ * @param {{checks: GateVocabularies, reviewBy: GateVocabularies}} reviewers - From {@link gateReviewers}
1237
+ * @returns {object} The declaration to validate and judge
1238
+ */
1239
+ function withGateReviewers(declaration, reviewers) {
1240
+ const declared = declaration.evidence_bearing_checks;
1241
+ // A malformed declared value is left for `assertEvidenceBearingChecks` to
1242
+ // refuse, instead of being papered over by the gates' entries.
1243
+ if (declared !== undefined && declared !== null && !isPlainObject(declared))
1244
+ return declaration;
1245
+ const checks = { ...declared };
1246
+ for (const [name, vocabulary] of Object.entries(reviewers.checks)) {
1247
+ if (!Object.hasOwn(checks, name)) checks[name] = vocabulary;
1248
+ // Likewise a malformed declared entry, `null` included, stays as written.
1249
+ else if (isPlainObject(checks[name]))
1250
+ checks[name] = mergeVocabulary(checks[name], vocabulary);
1251
+ }
1252
+ /** @type {GateVocabularies} */
1253
+ const reviewBy = {};
1254
+ for (const [name, vocabulary] of Object.entries(reviewers.reviewBy)) {
1255
+ // A name `evidence_bearing_checks` declares must post a check; it is
1256
+ // judged there, reading the review_by gate's phrases too.
1257
+ if (!Object.hasOwn(checks, name)) reviewBy[name] = vocabulary;
1258
+ else if (isPlainObject(checks[name]))
1259
+ checks[name] = mergeVocabulary(checks[name], vocabulary);
1260
+ }
1261
+ // `review_by_checks` is derived from the gates and nowhere else, so a copy
1262
+ // written into the declaration by hand is not read.
1263
+ const base = Object.fromEntries(
1264
+ Object.entries(declaration).filter(([key]) => key !== "review_by_checks")
1265
+ );
1266
+ return {
1267
+ ...base,
1268
+ ...((declared === undefined || declared === null) &&
1269
+ Object.keys(checks).length === 0
1270
+ ? {}
1271
+ : { evidence_bearing_checks: checks }),
1272
+ ...(Object.keys(reviewBy).length === 0
1273
+ ? {}
1274
+ : { review_by_checks: reviewBy }),
1275
+ };
1276
+ }
1277
+
1055
1278
  /**
1056
1279
  * Validate reasoned registration deferrals against the set actually judged.
1057
1280
  * This only removes absence/registration observations. GitHub still requires
@@ -1698,8 +1921,20 @@ export function evaluateVacuousChecks(declaration, checks, options = {}) {
1698
1921
  });
1699
1922
  if (violation !== null) violations.push(violation);
1700
1923
  }
1924
+ // A reviewer proven by its submitted review (`evidence.review_by`, #4914) is
1925
+ // judged only on a check it actually posted: a hollow green from it is as
1926
+ // hollow as anyone's, but posting nothing is how that reviewer works.
1927
+ const reviewedBy = reportedReviewByChecks(declaration, checks);
1928
+ for (const [name, entry] of reviewedBy) {
1929
+ const violation = evaluateEvidenceBearingCheck(name, entry, checks, {
1930
+ at,
1931
+ required,
1932
+ trustRequired,
1933
+ });
1934
+ if (violation !== null) violations.push(violation);
1935
+ }
1701
1936
 
1702
- return { violations, checked: entries.length };
1937
+ return { violations, checked: entries.length + reviewedBy.length };
1703
1938
  }
1704
1939
 
1705
1940
  /**
@@ -4500,8 +4735,28 @@ export function declaredEvidenceChecks(declaration) {
4500
4735
  * @returns {boolean} True when nothing declared is still in flight
4501
4736
  */
4502
4737
  export function checksSettled(declaration, checks) {
4503
- return declaredEvidenceChecks(declaration).every(name =>
4504
- checkSettled(checks.find(check => check.name === name))
4738
+ return (
4739
+ declaredEvidenceChecks(declaration).every(name =>
4740
+ checkSettled(checks.find(check => check.name === name))
4741
+ ) &&
4742
+ reportedReviewByChecks(declaration, checks).every(([name]) =>
4743
+ checkSettled(checks.find(check => check.name === name))
4744
+ )
4745
+ );
4746
+ }
4747
+
4748
+ /**
4749
+ * The `review_by_checks` entries whose context posted a row (#4914). One that
4750
+ * posted nothing is neither a finding nor still in flight: that reviewer's
4751
+ * evidence is its submitted review, which the review-evidence prover reads.
4752
+ *
4753
+ * @param {object} declaration - The per-repo declaration
4754
+ * @param {ReadonlyArray<{name: string}>} checks - Rows
4755
+ * @returns {Array<[string, object]>} Name and vocabulary of each reported one
4756
+ */
4757
+ function reportedReviewByChecks(declaration, checks) {
4758
+ return Object.entries(declaration.review_by_checks ?? {}).filter(([name]) =>
4759
+ checks.some(check => check.name === name)
4505
4760
  );
4506
4761
  }
4507
4762
 
@@ -4565,8 +4820,7 @@ export function fetchSettledChecks(declaration, pr, repo, options = {}) {
4565
4820
  return fetchChecksForCommit(
4566
4821
  headSha,
4567
4822
  slug,
4568
- /** @type {{evidence_bearing_checks?: ReviewEvidenceChecks|null}} */
4569
- (declaration).evidence_bearing_checks ?? {}
4823
+ decodingVocabulary(declaration)
4570
4824
  );
4571
4825
  });
4572
4826
  const resolveHead = options.headSha ?? resolveHeadSha;
@@ -4587,6 +4841,9 @@ export function fetchSettledChecks(declaration, pr, repo, options = {}) {
4587
4841
  );
4588
4842
  // A substitute is useful only at the head it was actually read for. Pending
4589
4843
  // rows still wait, and a missing required reviewer still needs a real row.
4844
+ // A review_by reviewer's check that posted is waited for like any other
4845
+ // (#4914); one that posted nothing is not in flight — see
4846
+ // {@link reportedReviewByChecks}.
4590
4847
  const evidenceReady = observed =>
4591
4848
  declaredEvidenceChecks(declaration).every(name => {
4592
4849
  const found = observed.checks.find(check => check.name === name);
@@ -4596,7 +4853,10 @@ export function fetchSettledChecks(declaration, pr, repo, options = {}) {
4596
4853
  observed.headSha === options.substituteHead &&
4597
4854
  options.substitutes?.has(name))
4598
4855
  );
4599
- });
4856
+ }) &&
4857
+ reportedReviewByChecks(declaration, observed.checks).every(([name]) =>
4858
+ checkSettled(observed.checks.find(check => check.name === name))
4859
+ );
4600
4860
 
4601
4861
  // Bracket checks with coherent head/base observations. The early substitute
4602
4862
  // read can supply the first observation without another metadata request.
@@ -4828,7 +5088,10 @@ export function vacuityRefusal(input) {
4828
5088
  reason: `PR #${pr} reported ZERO checks of any kind. A pull request with no checks and a pull request whose checks are all honest produce the same silence from this arm, so it refuses rather than picking one. Confirm the token can read checks (\`actions: read\` for the \`gh pr checks\` rollup, or \`checks: read\` + \`statuses: read\` for the fallback) before believing this.`,
4829
5089
  };
4830
5090
  }
4831
- if (declaredEvidenceChecks(declaration).length === 0) {
5091
+ if (
5092
+ declaredEvidenceChecks(declaration).length === 0 &&
5093
+ Object.keys(declaration.review_by_checks ?? {}).length === 0
5094
+ ) {
4832
5095
  return {
4833
5096
  kind: VACUITY_REFUSALS.noneDeclared,
4834
5097
  reason: `\`evidence_bearing_checks\` in ${DECLARATION_PATH} is empty, so this repository has declared that NO check's green means anything reviewed the code — and the vacuity arm examined nothing on PR #${pr}. If that is true, say so by removing the arm from your workflow. If it is not, name the checks by their exact check names: \`"evidence_bearing_checks": { "<reviewer check name>": {} }\`.`,
@@ -18,6 +18,7 @@
18
18
  "It reads `gh pr checks --json name,state,bucket,description`, the only route that carries the description for a legacy commit status like CodeRabbit's, and falls back to the commit-status API when the token lacks `actions: read` (`gh pr checks` resolves the rollup through `checkSuite.workflowRun`, and without that scope it exits non-zero with EMPTY STDOUT — a failure shaped like a content problem that never says the word \"permission\").",
19
19
  "IT REFUSES RATHER THAN REPORTING AN EMPTY INSPECTION. An unresolvable pull request, a `gh` it could not read, a roster with no checks in it, or an empty `evidence_bearing_checks` all print the same \"nothing vacuous here\" that a genuinely clean run prints — so the guard fails instead and names which of the four it hit (`vacuity_pr_unresolved`, `vacuity_checks_unreadable`, `vacuity_no_checks_reported`, `vacuity_none_declared`). A refusal is NOT a finding: NOBODY LOOKED and THE REVIEW WAS FAKE are opposite facts, and a single red job would otherwise report them identically.",
20
20
  "`evidence_bearing_checks` names the checks whose GREEN is supposed to mean something reviewed the code. Use `{}` to accept the shipped description vocabulary, or add `proof` / `no_work` arrays to extend it — extensions ADD to the defaults, they do not replace them. Undeclared checks are never examined, because most CI jobs ship an empty description and flagging them all would bury the one finding that matters.",
21
+ "A THIRD-PARTY REVIEWER DECLARED IN `.lisa.config.json` IS EVIDENCE-BEARING TOO (CodySwannGT/lisa#4914): every `gates.<id>.pull-request` with `evidence.reviewer: true` adds its `await` context here at load time, with that gate's `evidence.proof` / `evidence.no_work` phrases (a name in both reads both). So the gates config is where the reviewer is named, and the review-evidence prover reads the same gates. `CodeRabbit` stays below because Lisa seeds no reviewer gate for a new project. To switch vendors, declare the new reviewer gate in `.lisa.config.json` and delete `CodeRabbit` from this list once, so it is not reported as never having reported. A gate proven by `evidence.review_by` and not pinned by `posted_by` (its reviewer may answer with a pull-request review instead of a check) is not added here unless this list already names it: its `await` check is examined for a hollow green whenever it reports, and one that never reports is not a finding, because the review-evidence prover then reads the submitted review.",
21
22
  "This arm REPORTS AND NEVER BLOCKS, in every enforcement mode. A review bot can go hollow because an org-wide SPENDING CAP was hit, and a gate that reddens every PR on a billing state is worse than the one it criticises. What it changes is what you may CLAIM: a PR carrying a `vacuous_required_check` finding has not been shown to be reviewed, so do not record it as reviewed. Once you have made the governance call, `--fail-on-vacuous` is the supported way to ask for an exit code — add it to the command in `review-evidence.yml`, instead of writing a wrapper that reads `--json`.",
22
23
  "PER-BRANCH SETS (CodySwannGT/lisa#4484). `required_contexts` is the UNION across every protected branch, which is the wrong set for judging which required contexts did NOT REPORT on one pull request: a context only `dev` requires was reported absent on every staging-base pull request. Optionally add `required_contexts_by_branch: { \"<branch>\": [ ...contexts ] }`, each set transcribed byte for byte from `gh api repos/OWNER/NAME/rules/branches/<branch> --jq '.[] | select(.type==\"required_status_checks\") | .parameters.required_status_checks[].context'` (read access only). The absent arm judges the PR against its current base (`--base`, else current metadata from the existing PR head read). If current metadata is unreadable it uses only a matching PR/repository event (`GITHUB_BASE_REF`, else `pull_request.base.ref`). A rerun replays the old event, so matching identity alone does not establish the current base. Head/base observations bracket each check read; a retarget retries within the same settlement deadline, and registration and absence share the resulting selection. Without a set for that base it falls back to the union — same findings as before — and says so as `required_contexts_branch_fallback`; every run prints which set it used. Every per-branch context must also appear in `required_contexts`, and the one `baseline_fetched_at` stamp covers both."
23
24
  ],