@codyswann/lisa 4.99.1 → 4.99.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/doctor-coderabbit-labeling.d.ts +11 -0
- package/dist/cli/doctor-coderabbit-labeling.d.ts.map +1 -0
- package/dist/cli/doctor-coderabbit-labeling.js +198 -0
- package/dist/cli/doctor-coderabbit-labeling.js.map +1 -0
- package/dist/cli/doctor-seeded-artifacts.d.ts.map +1 -1
- package/dist/cli/doctor-seeded-artifacts.js +9 -3
- package/dist/cli/doctor-seeded-artifacts.js.map +1 -1
- package/dist/core/coderabbit-labeling.d.ts +56 -0
- package/dist/core/coderabbit-labeling.d.ts.map +1 -0
- package/dist/core/coderabbit-labeling.js +121 -0
- package/dist/core/coderabbit-labeling.js.map +1 -0
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +7 -1
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/migrations/correct-lisa-coderabbit-labeling.d.ts +39 -0
- package/dist/migrations/correct-lisa-coderabbit-labeling.d.ts.map +1 -0
- package/dist/migrations/correct-lisa-coderabbit-labeling.js +136 -0
- package/dist/migrations/correct-lisa-coderabbit-labeling.js.map +1 -0
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +3 -0
- package/dist/migrations/index.js.map +1 -1
- package/package.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-doctor/SKILL.md +10 -0
- package/plugins/lisa/skills/lisa-doctor/SKILL.md +10 -0
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-doctor/SKILL.md +10 -0
- 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-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/skills/lisa-doctor/SKILL.md +10 -0
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/skills/lisa-doctor/SKILL.md +10 -0
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/skills/lisa-doctor/SKILL.md +10 -0
- 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-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-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-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-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-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-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-openclaw-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.devin-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-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-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-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-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-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-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/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/skills/lisa-doctor/SKILL.md +10 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DoctorCheck } from "./doctor.js";
|
|
2
|
+
/** Name of the labeling check as doctor reports it. */
|
|
3
|
+
export declare const CODERABBIT_LABELING_CHECK_NAME = "CodeRabbit kept off Lisa's lifecycle labels?";
|
|
4
|
+
/**
|
|
5
|
+
* Report whether this repository's CodeRabbit config can make the bot write
|
|
6
|
+
* Lisa's lifecycle, human-only, or writer-owned labels.
|
|
7
|
+
* @param targetPath - Project path to inspect
|
|
8
|
+
* @returns Doctor check result
|
|
9
|
+
*/
|
|
10
|
+
export declare function checkCoderabbitLabeling(targetPath: string): Promise<DoctorCheck>;
|
|
11
|
+
//# sourceMappingURL=doctor-coderabbit-labeling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-coderabbit-labeling.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-coderabbit-labeling.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,uDAAuD;AACvD,eAAO,MAAM,8BAA8B,iDACK,CAAC;AAsGjD;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,CAAC,CA2BtB"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `lisa doctor` check: is CodeRabbit kept off Lisa's lifecycle labels?
|
|
3
|
+
*
|
|
4
|
+
* From 2026-02-11 to 2026-03-01 Lisa wrote a `.coderabbit.yml` into every host
|
|
5
|
+
* that turned `issue_enrichment.labeling.auto_apply_labels` on with no
|
|
6
|
+
* allowlist, so the bot may apply any label the repository has — `status:*`,
|
|
7
|
+
* `human-needed`, `type:*`, `points:*` included. `deletions.json` has kept that
|
|
8
|
+
* copy ever since, and nothing read it again; a downstream host watched the
|
|
9
|
+
* bot put `status:ready` back onto claimed issues within minutes of each claim
|
|
10
|
+
* (CodySwannGT/lisa#4633). `lisa apply` now corrects an unedited Lisa copy
|
|
11
|
+
* (`migrations/correct-lisa-coderabbit-labeling`); this check is how every
|
|
12
|
+
* other affected host — an edited copy, or one the host wrote itself — finds
|
|
13
|
+
* itself.
|
|
14
|
+
*
|
|
15
|
+
* It reports and names the remedy; it edits nothing. Only `ENOENT` and
|
|
16
|
+
* `ENOTDIR` mean the file is absent. A file that exists but could not be read
|
|
17
|
+
* or parsed fails with "Could not determine", because a config this check
|
|
18
|
+
* could not read is not one with nothing in it.
|
|
19
|
+
* @module cli/doctor-coderabbit-labeling
|
|
20
|
+
*/
|
|
21
|
+
import { readFile } from "node:fs/promises";
|
|
22
|
+
import * as path from "node:path";
|
|
23
|
+
import { DEFAULT_HUMAN_ONLY_LABELS, evaluateCoderabbitLabeling, SHIPPED_CODERABBIT_CONFIG_DIGESTS, } from "../core/coderabbit-labeling.js";
|
|
24
|
+
import { isShippedVersion } from "../core/retire-unmodified.js";
|
|
25
|
+
import { getAtPath } from "../sync/json-path.js";
|
|
26
|
+
import { loadYaml } from "../utils/yaml.js";
|
|
27
|
+
import { readConfinedMergedConfig } from "./ui-confined-project-read.js";
|
|
28
|
+
/** Name of the labeling check as doctor reports it. */
|
|
29
|
+
export const CODERABBIT_LABELING_CHECK_NAME = "CodeRabbit kept off Lisa's lifecycle labels?";
|
|
30
|
+
/** The repository config file names CodeRabbit reads, in lookup order. */
|
|
31
|
+
const CONFIG_FILES = [".coderabbit.yml", ".coderabbit.yaml"];
|
|
32
|
+
/** Config path of the project's human-needed label. */
|
|
33
|
+
const HUMAN_NEEDED_PATH = "github.labels.build.human_needed";
|
|
34
|
+
/**
|
|
35
|
+
* Whether a filesystem error means the path is simply not there.
|
|
36
|
+
* @param error - Value thrown by a filesystem call
|
|
37
|
+
* @returns True for ENOENT / ENOTDIR
|
|
38
|
+
*/
|
|
39
|
+
function isAbsence(error) {
|
|
40
|
+
const code = error?.code;
|
|
41
|
+
return code === "ENOENT" || code === "ENOTDIR";
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Read every CodeRabbit config present, REJECTING when one exists but cannot
|
|
45
|
+
* be read. Both spellings are read because a repository can carry both, and
|
|
46
|
+
* which one CodeRabbit honours is not something this check can see — so
|
|
47
|
+
* either one being unsafe is a finding.
|
|
48
|
+
* @param projectRoot - Absolute project root
|
|
49
|
+
* @returns The configs present, in lookup order (empty when none)
|
|
50
|
+
* @throws {Error} When a config file exists but could not be read
|
|
51
|
+
*/
|
|
52
|
+
async function findConfigs(projectRoot) {
|
|
53
|
+
const found = await Promise.all(CONFIG_FILES.map(async (name) => await readConfig(projectRoot, name)));
|
|
54
|
+
return found.filter((config) => config !== null);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Read one CodeRabbit config, REJECTING when it exists but cannot be read.
|
|
58
|
+
* @param projectRoot - Absolute project root
|
|
59
|
+
* @param name - Config file name
|
|
60
|
+
* @returns The config, or null when the file is absent
|
|
61
|
+
* @throws {Error} When the file exists but could not be read
|
|
62
|
+
*/
|
|
63
|
+
async function readConfig(projectRoot, name) {
|
|
64
|
+
try {
|
|
65
|
+
return { name, bytes: await readFile(path.join(projectRoot, name)) };
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
if (isAbsence(error))
|
|
69
|
+
return null;
|
|
70
|
+
const code = error?.code;
|
|
71
|
+
throw new Error(`could not read ${name}: ${String(code ?? error)}`, {
|
|
72
|
+
cause: error,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Every human-only label this project uses: Lisa's default plus whatever the
|
|
78
|
+
* project configured. A config that cannot be read still protects the default.
|
|
79
|
+
* @param projectRoot - Absolute project root
|
|
80
|
+
* @returns Human-only labels
|
|
81
|
+
*/
|
|
82
|
+
async function humanOnlyLabels(projectRoot) {
|
|
83
|
+
const configured = await readConfinedMergedConfig(projectRoot)
|
|
84
|
+
.then(config => getAtPath(config, HUMAN_NEEDED_PATH))
|
|
85
|
+
.catch(() => undefined);
|
|
86
|
+
return typeof configured === "string" && configured.trim() !== ""
|
|
87
|
+
? [...new Set([...DEFAULT_HUMAN_ONLY_LABELS, configured])]
|
|
88
|
+
: [...DEFAULT_HUMAN_ONLY_LABELS];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The two remedies, stated with the project's own human-needed label.
|
|
92
|
+
* @param humanOnly - Human-only labels
|
|
93
|
+
* @returns Remedy sentence
|
|
94
|
+
*/
|
|
95
|
+
function remedies(humanOnly) {
|
|
96
|
+
const reserved = humanOnly.map(quote).join(" or ");
|
|
97
|
+
return ("Either set `issue_enrichment.labeling.auto_apply_labels: false`, or add " +
|
|
98
|
+
"`labeling_instructions` listing only the labels the bot may apply, " +
|
|
99
|
+
`naming no \`status:\`, \`type:\` or \`points:\` label and not ${reserved}`);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Wrap a label in backticks for the report.
|
|
103
|
+
* @param label - Label name
|
|
104
|
+
* @returns Quoted label
|
|
105
|
+
*/
|
|
106
|
+
function quote(label) {
|
|
107
|
+
return `\`${label}\``;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Report whether this repository's CodeRabbit config can make the bot write
|
|
111
|
+
* Lisa's lifecycle, human-only, or writer-owned labels.
|
|
112
|
+
* @param targetPath - Project path to inspect
|
|
113
|
+
* @returns Doctor check result
|
|
114
|
+
*/
|
|
115
|
+
export async function checkCoderabbitLabeling(targetPath) {
|
|
116
|
+
try {
|
|
117
|
+
const found = await findConfigs(targetPath);
|
|
118
|
+
if (found.length === 0) {
|
|
119
|
+
return ok("No .coderabbit.yml in this repository. CodeRabbit's organisation " +
|
|
120
|
+
"settings are not visible to this check; make sure they do not " +
|
|
121
|
+
"auto-apply labels either");
|
|
122
|
+
}
|
|
123
|
+
const humanOnly = await humanOnlyLabels(targetPath);
|
|
124
|
+
return verdictCheck(found.map(config => judgeFile(config, humanOnly)), humanOnly);
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
return {
|
|
128
|
+
name: CODERABBIT_LABELING_CHECK_NAME,
|
|
129
|
+
status: "fail",
|
|
130
|
+
detail: "Could not determine whether this repository's CodeRabbit config " +
|
|
131
|
+
`lets the bot apply Lisa's lifecycle labels: ${error instanceof Error ? error.message : String(error)}. Treated as a failure rather than a pass: a config that could not ` +
|
|
132
|
+
"be read is not one with nothing in it",
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Judge one located config.
|
|
138
|
+
* @param found - The located config
|
|
139
|
+
* @param humanOnly - Human-only labels
|
|
140
|
+
* @returns The file's verdict
|
|
141
|
+
* @throws {Error} When the config does not parse, or sets `auto_apply_labels`
|
|
142
|
+
* to something that is neither true nor false
|
|
143
|
+
*/
|
|
144
|
+
function judgeFile(found, humanOnly) {
|
|
145
|
+
const verdict = evaluateCoderabbitLabeling(loadYaml(found.bytes.toString("utf8")), humanOnly);
|
|
146
|
+
if (verdict.reason === "undeterminable") {
|
|
147
|
+
throw new Error(`${found.name} sets \`auto_apply_labels\` to ${JSON.stringify(verdict.value)}, which is neither true nor false`);
|
|
148
|
+
}
|
|
149
|
+
if (verdict.safe) {
|
|
150
|
+
return {
|
|
151
|
+
safe: true,
|
|
152
|
+
detail: verdict.reason === "auto-apply-off"
|
|
153
|
+
? `${found.name} does not auto-apply labels`
|
|
154
|
+
: `${found.name} allowlists no lifecycle, human-only, type or points label`,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
const cause = verdict.reason === "no-allowlist"
|
|
158
|
+
? `${found.name} turns on \`auto_apply_labels\` with no ` +
|
|
159
|
+
"`labeling_instructions` allowlist, so CodeRabbit may apply any " +
|
|
160
|
+
"label, including Lisa's `status:` lifecycle labels"
|
|
161
|
+
: `${found.name} lets CodeRabbit auto-apply ${verdict.offending
|
|
162
|
+
.map(quote)
|
|
163
|
+
.join(", ")}, which only Lisa or a human may set`;
|
|
164
|
+
const authorship = isShippedVersion(found.bytes, SHIPPED_CODERABBIT_CONFIG_DIGESTS)
|
|
165
|
+
? " Lisa wrote this file (the template it shipped from 2026-02-11 to " +
|
|
166
|
+
"2026-03-01) and it is unedited; `npx @codyswann/lisa@latest .` " +
|
|
167
|
+
"rewrites it with auto-apply off."
|
|
168
|
+
: "";
|
|
169
|
+
return { safe: false, detail: `${cause}.${authorship}` };
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Turn every file's verdict into the one check line they earn together:
|
|
173
|
+
* a failure if any file is unsafe, naming each unsafe file.
|
|
174
|
+
* @param verdicts - One verdict per config file present
|
|
175
|
+
* @param humanOnly - Human-only labels
|
|
176
|
+
* @returns Doctor check result
|
|
177
|
+
*/
|
|
178
|
+
function verdictCheck(verdicts, humanOnly) {
|
|
179
|
+
const unsafe = verdicts.filter(verdict => !verdict.safe);
|
|
180
|
+
if (unsafe.length === 0) {
|
|
181
|
+
return ok(verdicts.map(verdict => verdict.detail).join("; "));
|
|
182
|
+
}
|
|
183
|
+
const causes = unsafe.map(verdict => verdict.detail).join(" ");
|
|
184
|
+
return {
|
|
185
|
+
name: CODERABBIT_LABELING_CHECK_NAME,
|
|
186
|
+
status: "fail",
|
|
187
|
+
detail: `${causes} ${remedies(humanOnly)}`,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* A passing line for this check.
|
|
192
|
+
* @param detail - What was found
|
|
193
|
+
* @returns Doctor check result
|
|
194
|
+
*/
|
|
195
|
+
function ok(detail) {
|
|
196
|
+
return { name: CODERABBIT_LABELING_CHECK_NAME, status: "ok", detail };
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=doctor-coderabbit-labeling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-coderabbit-labeling.js","sourceRoot":"","sources":["../../src/cli/doctor-coderabbit-labeling.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,iCAAiC,GAClC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,uDAAuD;AACvD,MAAM,CAAC,MAAM,8BAA8B,GACzC,8CAA8C,CAAC;AAEjD,0EAA0E;AAC1E,MAAM,YAAY,GAAG,CAAC,iBAAiB,EAAE,kBAAkB,CAAU,CAAC;AAEtE,uDAAuD;AACvD,MAAM,iBAAiB,GAAG,kCAAkC,CAAC;AAQ7D;;;;GAIG;AACH,SAAS,SAAS,CAAC,KAAc;IAC/B,MAAM,IAAI,GAAI,KAAmC,EAAE,IAAI,CAAC;IACxD,OAAO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,EAAE,CAAC;AAC3D,CAAC;AAED;;;;;;GAMG;AACH,SAAS,YAAY,CACnB,QAAgC,EAChC,SAA4B;IAE5B,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChE,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/D,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,GAAG,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE;KAC3C,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,EAAE,CAAC,MAAc;IACxB,OAAO,EAAE,IAAI,EAAE,8BAA8B,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor-seeded-artifacts.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-seeded-artifacts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor-seeded-artifacts.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-seeded-artifacts.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CA6BjC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The six checks that ask what Lisa SEEDED into this repository, and whether
|
|
3
3
|
* what it seeded still says what it meant.
|
|
4
4
|
*
|
|
5
|
-
* They are grouped because they are one operator question asked
|
|
5
|
+
* They are grouped because they are one operator question asked six ways, and
|
|
6
6
|
* because each of them exists for the same structural reason: the write path
|
|
7
7
|
* that could have prevented the defect is reached exactly once, before the file
|
|
8
8
|
* exists. A repository that received the template earlier therefore has no
|
|
9
9
|
* signal of any kind — the seeding postinstall is skipped under CI, the file is
|
|
10
10
|
* untracked, and the tool the file disables reports only that it found nothing.
|
|
11
|
-
* A fix on the write path reaches the NEXT adoption; these
|
|
11
|
+
* A fix on the write path reaches the NEXT adoption; these six are how an
|
|
12
12
|
* existing one finds itself.
|
|
13
13
|
*
|
|
14
14
|
* `doctor-lisa-owned-artifacts` is the inverse and deliberately stays where it
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* @module cli/doctor-seeded-artifacts
|
|
21
21
|
*/
|
|
22
22
|
import { checkCdkPresetAdoption } from "./doctor-cdk-preset-adoption.js";
|
|
23
|
+
import { checkCoderabbitLabeling } from "./doctor-coderabbit-labeling.js";
|
|
23
24
|
import { checkConfigShadowing } from "./doctor-config-shadowing.js";
|
|
24
25
|
import { checkRailsDeployIntent } from "./doctor-rails-deploy-intent.js";
|
|
25
26
|
import { checkStaleManagedBanner } from "./doctor-stale-managed-banner.js";
|
|
@@ -48,6 +49,11 @@ export async function checkSeededArtifacts(targetPath) {
|
|
|
48
49
|
// stopped running; the seed fix reaches new adoptions only
|
|
49
50
|
// (CodySwannGT/lisa#4553).
|
|
50
51
|
await checkThirdPartyEvidenceSeed(targetPath),
|
|
52
|
+
// Whether a CodeRabbit config Lisa KEEPS (deletions.json) lets the bot
|
|
53
|
+
// write Lisa's lifecycle labels. Lisa shipped one that did, and the bot
|
|
54
|
+
// re-labelled claimed issues `status:ready` in a downstream host
|
|
55
|
+
// (CodySwannGT/lisa#4633).
|
|
56
|
+
await checkCoderabbitLabeling(targetPath),
|
|
51
57
|
// Whether a whole stack preset was delivered to a repository that never
|
|
52
58
|
// qualified for it. The detection fix reaches the next decision only, and
|
|
53
59
|
// the dead-code gate it skewed reports SUCCESS (CodySwannGT/lisa#3711).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor-seeded-artifacts.js","sourceRoot":"","sources":["../../src/cli/doctor-seeded-artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAGpF;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,UAAkB;IAElB,OAAO;QACL,wEAAwE;QACxE,2BAA2B;QAC3B,MAAM,oBAAoB,CAAC,UAAU,CAAC;QACtC,yEAAyE;QACzE,sEAAsE;QACtE,yDAAyD;QACzD,MAAM,sBAAsB,CAAC,UAAU,CAAC;QACxC,2EAA2E;QAC3E,wEAAwE;QACxE,oEAAoE;QACpE,2DAA2D;QAC3D,2BAA2B;QAC3B,MAAM,2BAA2B,CAAC,UAAU,CAAC;QAC7C,wEAAwE;QACxE,0EAA0E;QAC1E,wEAAwE;QACxE,MAAM,sBAAsB,CAAC,UAAU,CAAC;QACxC,qEAAqE;QACrE,yEAAyE;QACzE,4DAA4D;QAC5D,MAAM,uBAAuB,CAAC,UAAU,CAAC;KAC1C,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"doctor-seeded-artifacts.js","sourceRoot":"","sources":["../../src/cli/doctor-seeded-artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAGpF;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,UAAkB;IAElB,OAAO;QACL,wEAAwE;QACxE,2BAA2B;QAC3B,MAAM,oBAAoB,CAAC,UAAU,CAAC;QACtC,yEAAyE;QACzE,sEAAsE;QACtE,yDAAyD;QACzD,MAAM,sBAAsB,CAAC,UAAU,CAAC;QACxC,2EAA2E;QAC3E,wEAAwE;QACxE,oEAAoE;QACpE,2DAA2D;QAC3D,2BAA2B;QAC3B,MAAM,2BAA2B,CAAC,UAAU,CAAC;QAC7C,uEAAuE;QACvE,wEAAwE;QACxE,iEAAiE;QACjE,2BAA2B;QAC3B,MAAM,uBAAuB,CAAC,UAAU,CAAC;QACzC,wEAAwE;QACxE,0EAA0E;QAC1E,wEAAwE;QACxE,MAAM,sBAAsB,CAAC,UAAU,CAAC;QACxC,qEAAqE;QACrE,yEAAyE;QACzE,4DAA4D;QAC5D,MAAM,uBAAuB,CAAC,UAAU,CAAC;KAC1C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The lifecycle family. Matched by prefix, as the build intake does, so a
|
|
3
|
+
* lifecycle label a project renamed inside the family is still covered.
|
|
4
|
+
*/
|
|
5
|
+
export declare const LIFECYCLE_LABEL_PREFIX = "status:";
|
|
6
|
+
/** Families Lisa's issue writer sets itself; a bot's guess only conflicts. */
|
|
7
|
+
export declare const WRITER_OWNED_LABEL_PREFIXES: readonly string[];
|
|
8
|
+
/** Every prefix a bot must never apply. */
|
|
9
|
+
export declare const PROTECTED_LABEL_PREFIXES: readonly string[];
|
|
10
|
+
/** Roles a bot must never decide, beyond the protected prefixes. */
|
|
11
|
+
export declare const DEFAULT_HUMAN_ONLY_LABELS: readonly string[];
|
|
12
|
+
/**
|
|
13
|
+
* sha256 of every `.coderabbit.yml` Lisa ever shipped into hosts. Only one
|
|
14
|
+
* version existed: `all/copy-overwrite/.coderabbit.yml`, added at `41e69a0261`
|
|
15
|
+
* (2026-02-11) and removed at `575a3fa7ee` (2026-03-01) unchanged.
|
|
16
|
+
*/
|
|
17
|
+
export declare const SHIPPED_CODERABBIT_CONFIG_DIGESTS: ReadonlySet<string>;
|
|
18
|
+
/** What a CodeRabbit config allows the bot to do with labels. */
|
|
19
|
+
export type CoderabbitLabelingVerdict = {
|
|
20
|
+
readonly safe: true;
|
|
21
|
+
readonly reason: "auto-apply-off" | "allowlisted";
|
|
22
|
+
} | {
|
|
23
|
+
readonly safe: false;
|
|
24
|
+
readonly reason: "no-allowlist";
|
|
25
|
+
} | {
|
|
26
|
+
readonly safe: false;
|
|
27
|
+
readonly reason: "undeterminable";
|
|
28
|
+
readonly value: unknown;
|
|
29
|
+
} | {
|
|
30
|
+
readonly safe: false;
|
|
31
|
+
readonly reason: "protected-labels";
|
|
32
|
+
readonly offending: readonly string[];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Whether one label is one a bot must never apply.
|
|
36
|
+
*
|
|
37
|
+
* Case-insensitive, because GitHub matches label names that way: `Type:Bug`
|
|
38
|
+
* still lands as `type:Bug`.
|
|
39
|
+
* @param label - Label as the config spells it
|
|
40
|
+
* @param humanOnly - Exact labels reserved for humans
|
|
41
|
+
* @returns True when the label is protected
|
|
42
|
+
*/
|
|
43
|
+
export declare function isProtectedLabel(label: string, humanOnly?: readonly string[]): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Decide whether a parsed CodeRabbit config can make the bot write a
|
|
46
|
+
* protected label.
|
|
47
|
+
*
|
|
48
|
+
* CodeRabbit's own default for `auto_apply_labels` is off, so a config that
|
|
49
|
+
* never mentions it is safe, and so is an explicit `false`. Any value that is
|
|
50
|
+
* not a boolean is `undeterminable`, never safe.
|
|
51
|
+
* @param config - Parsed CodeRabbit config (any shape)
|
|
52
|
+
* @param humanOnly - Exact labels reserved for humans
|
|
53
|
+
* @returns The verdict, naming offending labels as the config spells them
|
|
54
|
+
*/
|
|
55
|
+
export declare function evaluateCoderabbitLabeling(config: unknown, humanOnly?: readonly string[]): CoderabbitLabelingVerdict;
|
|
56
|
+
//# sourceMappingURL=coderabbit-labeling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coderabbit-labeling.d.ts","sourceRoot":"","sources":["../../src/core/coderabbit-labeling.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAEhD,8EAA8E;AAC9E,eAAO,MAAM,2BAA2B,EAAE,SAAS,MAAM,EAGxD,CAAC;AAEF,2CAA2C;AAC3C,eAAO,MAAM,wBAAwB,EAAE,SAAS,MAAM,EAGrD,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAEtD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,EAAE,WAAW,CAAC,MAAM,CAEhE,CAAC;AAEH,iEAAiE;AACjE,MAAM,MAAM,yBAAyB,GACjC;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,aAAa,CAAA;CAAE,GAC1E;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;CAAE,GACzD;IACE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC,CAAC;AAEN;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,SAAS,MAAM,EAA8B,GACvD,OAAO,CAMT;AAiCD;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,OAAO,EACf,SAAS,GAAE,SAAS,MAAM,EAA8B,GACvD,yBAAyB,CAkB3B"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which labels CodeRabbit's issue enrichment must never apply by itself, and
|
|
3
|
+
* whether a parsed CodeRabbit config lets it.
|
|
4
|
+
*
|
|
5
|
+
* CodeRabbit can label issues on its own (`issue_enrichment.labeling.
|
|
6
|
+
* auto_apply_labels`). With no `labeling_instructions` allowlist it may apply
|
|
7
|
+
* any label the repository has, which includes the labels Lisa's lifecycle
|
|
8
|
+
* runs on. Lisa learned this in its own repository twice: the bot stamped
|
|
9
|
+
* `status:done` on fresh issues (CodySwannGT/lisa#2589), and later overwrote
|
|
10
|
+
* the `type:` and `points:` labels its issue writer sets (CodySwannGT/lisa#4617).
|
|
11
|
+
* Lisa had already shipped hosts the opposite configuration, and a downstream
|
|
12
|
+
* host watched the bot put `status:ready` back onto claimed issues within
|
|
13
|
+
* minutes of each claim (CodySwannGT/lisa#4633).
|
|
14
|
+
*
|
|
15
|
+
* The protected families are defined once here so the guard on Lisa's own
|
|
16
|
+
* `.coderabbit.yml` (its unit test) and the `lisa doctor` check that reads a
|
|
17
|
+
* host's copy cannot drift apart.
|
|
18
|
+
* @module core/coderabbit-labeling
|
|
19
|
+
*/
|
|
20
|
+
import { isJsonObject } from "../sync/json-path.js";
|
|
21
|
+
import { BUILD_LABEL_DEFAULTS } from "../sync/lifecycle-defaults.js";
|
|
22
|
+
/**
|
|
23
|
+
* The lifecycle family. Matched by prefix, as the build intake does, so a
|
|
24
|
+
* lifecycle label a project renamed inside the family is still covered.
|
|
25
|
+
*/
|
|
26
|
+
export const LIFECYCLE_LABEL_PREFIX = "status:";
|
|
27
|
+
/** Families Lisa's issue writer sets itself; a bot's guess only conflicts. */
|
|
28
|
+
export const WRITER_OWNED_LABEL_PREFIXES = [
|
|
29
|
+
"type:",
|
|
30
|
+
"points:",
|
|
31
|
+
];
|
|
32
|
+
/** Every prefix a bot must never apply. */
|
|
33
|
+
export const PROTECTED_LABEL_PREFIXES = [
|
|
34
|
+
LIFECYCLE_LABEL_PREFIX,
|
|
35
|
+
...WRITER_OWNED_LABEL_PREFIXES,
|
|
36
|
+
];
|
|
37
|
+
/** Roles a bot must never decide, beyond the protected prefixes. */
|
|
38
|
+
export const DEFAULT_HUMAN_ONLY_LABELS = [
|
|
39
|
+
BUILD_LABEL_DEFAULTS.human_needed,
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* sha256 of every `.coderabbit.yml` Lisa ever shipped into hosts. Only one
|
|
43
|
+
* version existed: `all/copy-overwrite/.coderabbit.yml`, added at `41e69a0261`
|
|
44
|
+
* (2026-02-11) and removed at `575a3fa7ee` (2026-03-01) unchanged.
|
|
45
|
+
*/
|
|
46
|
+
export const SHIPPED_CODERABBIT_CONFIG_DIGESTS = new Set([
|
|
47
|
+
"e7212aa8c14aefecaf98d641a3464764a4ce3c871d73a403e6cc9f6d7da77fba",
|
|
48
|
+
]);
|
|
49
|
+
/**
|
|
50
|
+
* Whether one label is one a bot must never apply.
|
|
51
|
+
*
|
|
52
|
+
* Case-insensitive, because GitHub matches label names that way: `Type:Bug`
|
|
53
|
+
* still lands as `type:Bug`.
|
|
54
|
+
* @param label - Label as the config spells it
|
|
55
|
+
* @param humanOnly - Exact labels reserved for humans
|
|
56
|
+
* @returns True when the label is protected
|
|
57
|
+
*/
|
|
58
|
+
export function isProtectedLabel(label, humanOnly = DEFAULT_HUMAN_ONLY_LABELS) {
|
|
59
|
+
const lower = label.trim().toLowerCase();
|
|
60
|
+
return (PROTECTED_LABEL_PREFIXES.some(prefix => lower.startsWith(prefix)) ||
|
|
61
|
+
humanOnly.some(name => name.toLowerCase() === lower));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The `issue_enrichment.labeling` block of a parsed config, when it is one.
|
|
65
|
+
* @param config - Parsed CodeRabbit config
|
|
66
|
+
* @returns The labeling block, or an empty object
|
|
67
|
+
*/
|
|
68
|
+
function labelingBlock(config) {
|
|
69
|
+
const enrichment = isJsonObject(config)
|
|
70
|
+
? config["issue_enrichment"]
|
|
71
|
+
: undefined;
|
|
72
|
+
const labeling = isJsonObject(enrichment)
|
|
73
|
+
? enrichment["labeling"]
|
|
74
|
+
: undefined;
|
|
75
|
+
return isJsonObject(labeling) ? labeling : {};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The labels a config's allowlist names. Entries with no string label name
|
|
79
|
+
* nothing, so they cannot make an allowlist non-empty.
|
|
80
|
+
* @param instructions - The raw `labeling_instructions` value
|
|
81
|
+
* @returns Allowlisted labels
|
|
82
|
+
*/
|
|
83
|
+
function allowlistedLabels(instructions) {
|
|
84
|
+
if (!Array.isArray(instructions))
|
|
85
|
+
return [];
|
|
86
|
+
return instructions
|
|
87
|
+
.map(entry => (isJsonObject(entry) ? entry["label"] : undefined))
|
|
88
|
+
.filter((label) => typeof label === "string" && label.trim() !== "");
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Decide whether a parsed CodeRabbit config can make the bot write a
|
|
92
|
+
* protected label.
|
|
93
|
+
*
|
|
94
|
+
* CodeRabbit's own default for `auto_apply_labels` is off, so a config that
|
|
95
|
+
* never mentions it is safe, and so is an explicit `false`. Any value that is
|
|
96
|
+
* not a boolean is `undeterminable`, never safe.
|
|
97
|
+
* @param config - Parsed CodeRabbit config (any shape)
|
|
98
|
+
* @param humanOnly - Exact labels reserved for humans
|
|
99
|
+
* @returns The verdict, naming offending labels as the config spells them
|
|
100
|
+
*/
|
|
101
|
+
export function evaluateCoderabbitLabeling(config, humanOnly = DEFAULT_HUMAN_ONLY_LABELS) {
|
|
102
|
+
const labeling = labelingBlock(config);
|
|
103
|
+
const autoApply = labeling["auto_apply_labels"];
|
|
104
|
+
if (autoApply === undefined || autoApply === false) {
|
|
105
|
+
return { safe: true, reason: "auto-apply-off" };
|
|
106
|
+
}
|
|
107
|
+
// A quoted "true", a number, or a bare `auto_apply_labels:` (null) is not
|
|
108
|
+
// something this check can read as off. How CodeRabbit coerces it is not
|
|
109
|
+
// visible here, so it must not pass as safe.
|
|
110
|
+
if (autoApply !== true) {
|
|
111
|
+
return { safe: false, reason: "undeterminable", value: autoApply };
|
|
112
|
+
}
|
|
113
|
+
const allowed = allowlistedLabels(labeling["labeling_instructions"]);
|
|
114
|
+
if (allowed.length === 0)
|
|
115
|
+
return { safe: false, reason: "no-allowlist" };
|
|
116
|
+
const offending = allowed.filter(label => isProtectedLabel(label, humanOnly));
|
|
117
|
+
return offending.length === 0
|
|
118
|
+
? { safe: true, reason: "allowlisted" }
|
|
119
|
+
: { safe: false, reason: "protected-labels", offending };
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=coderabbit-labeling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coderabbit-labeling.js","sourceRoot":"","sources":["../../src/core/coderabbit-labeling.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE;;;GAGG;AACH,MAAM,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AAK,EAAE,SAAS,CAAC,CAAC,CAAC;IAC9E,OAAO,SAAS,CAAC,MAAM,KAAK,CAAC;QAC3B,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE;QACvC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,CAAC;AAC7D,CAAC"}
|
|
@@ -41,9 +41,9 @@ export const NIGHTLY_E2E_GUARD_BEHAVIOR_CERTIFICATES = Object.freeze({
|
|
|
41
41
|
}),
|
|
42
42
|
d1b26caeaf65950e3b60ff41964d234c032c50470072e7643310b1f6722e34e6: Object.freeze({
|
|
43
43
|
contractVersion: "1.9.0",
|
|
44
|
-
packageVersions: Object.freeze(["4.99.
|
|
44
|
+
packageVersions: Object.freeze(["4.99.2"]),
|
|
45
45
|
provenances: Object.freeze([
|
|
46
|
-
"workspace package @codyswann/lisa@4.99.
|
|
46
|
+
"workspace package @codyswann/lisa@4.99.2 (typescript/copy-overwrite/scripts/check-nightly-e2e-health.mjs)",
|
|
47
47
|
]),
|
|
48
48
|
}),
|
|
49
49
|
dfd2fef680de5ef03e63075e8a61c62ca4d95cdfdff6201939b79c748d3397f6: Object.freeze({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upstream-evidence-manifest.d.ts","sourceRoot":"","sources":["../../src/core/upstream-evidence-manifest.ts"],"names":[],"mappings":"AACA,iFAAiF;AACjF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA8jGpE,CAAC;AAEL,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"upstream-evidence-manifest.d.ts","sourceRoot":"","sources":["../../src/core/upstream-evidence-manifest.ts"],"names":[],"mappings":"AACA,iFAAiF;AACjF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA8jGpE,CAAC;AAEL,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAmnVjE,CAAC;AAEL,sFAAsF;AACtF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAk6I/D,CAAC"}
|
|
@@ -709,7 +709,7 @@ export const UPSTREAM_EVIDENCE_MANIFEST = Object.freeze({
|
|
|
709
709
|
"plugins/src/base/skills/lisa-detect-tooling/SKILL.md": "6ea2b1404d5c27f8a5bec8c90ad35ed0124789b70c091869455f538a2a9debbe",
|
|
710
710
|
"plugins/src/base/skills/lisa-detect-tooling/scripts/commands.mjs": "e28bd61fdde4a336b56ae3395423026943a5816015719d31d04f0d5a0ab50eec",
|
|
711
711
|
"plugins/src/base/skills/lisa-detect-tooling/scripts/detect-tooling.mjs": "d9419814fc04c935bd7e320e85b1977c9bfc9275d9ea5fb557002ad438ee7925",
|
|
712
|
-
"plugins/src/base/skills/lisa-doctor/SKILL.md": "
|
|
712
|
+
"plugins/src/base/skills/lisa-doctor/SKILL.md": "5c90c041d9903c0eb59c224472c863ba8519e03452a634d02a19d760253ac08f",
|
|
713
713
|
"plugins/src/base/skills/lisa-drive-pr-to-merge/SKILL.md": "0edb3ea3e3a3526104c8f9bc1f488faa5036f80543873991bd07220408377309",
|
|
714
714
|
"plugins/src/base/skills/lisa-epic-triage/SKILL.md": "d02760411249bddbd396f283191fe3e82bb7b95bf9393a19a7025dc5a57c3ab7",
|
|
715
715
|
"plugins/src/base/skills/lisa-evaluation-suite/SKILL.md": "96b5c2091ccd22a565935a7b0b917f67998881b81055ce3e4d518319472eac8b",
|
|
@@ -9279,6 +9279,7 @@ export const UPSTREAM_SURFACE_MANIFEST = Object.freeze({
|
|
|
9279
9279
|
"src/cli/doctor-apply-failure.ts": true,
|
|
9280
9280
|
"src/cli/doctor-apply-freshness.ts": true,
|
|
9281
9281
|
"src/cli/doctor-cdk-preset-adoption.ts": true,
|
|
9282
|
+
"src/cli/doctor-coderabbit-labeling.ts": true,
|
|
9282
9283
|
"src/cli/doctor-coderabbit.ts": true,
|
|
9283
9284
|
"src/cli/doctor-config-shadowing.ts": true,
|
|
9284
9285
|
"src/cli/doctor-declared-contexts.ts": true,
|
|
@@ -9590,6 +9591,7 @@ export const UPSTREAM_SURFACE_MANIFEST = Object.freeze({
|
|
|
9590
9591
|
"src/core/audit.ts": true,
|
|
9591
9592
|
"src/core/bootstrap-environment.ts": true,
|
|
9592
9593
|
"src/core/cdk-preset-adoption.ts": true,
|
|
9594
|
+
"src/core/coderabbit-labeling.ts": true,
|
|
9593
9595
|
"src/core/config-shadowing.ts": true,
|
|
9594
9596
|
"src/core/config.ts": true,
|
|
9595
9597
|
"src/core/configured-learnings-path.ts": true,
|
|
@@ -9719,6 +9721,7 @@ export const UPSTREAM_SURFACE_MANIFEST = Object.freeze({
|
|
|
9719
9721
|
"src/logging/index.ts": true,
|
|
9720
9722
|
"src/logging/logger.interface.ts": true,
|
|
9721
9723
|
"src/logging/silent-logger.ts": true,
|
|
9724
|
+
"src/migrations/correct-lisa-coderabbit-labeling.ts": true,
|
|
9722
9725
|
"src/migrations/deploy-outcome-guard-edit.ts": true,
|
|
9723
9726
|
"src/migrations/deploy-outcome-guard-yaml.ts": true,
|
|
9724
9727
|
"src/migrations/ensure-audit-ignore-local-exclusions.ts": true,
|
|
@@ -9885,6 +9888,7 @@ export const UPSTREAM_SURFACE_MANIFEST = Object.freeze({
|
|
|
9885
9888
|
"tests/fixtures/ci-rework-route/reclaim-twice.json": true,
|
|
9886
9889
|
"tests/fixtures/ci-rework-route/trusted-marker.json": true,
|
|
9887
9890
|
"tests/fixtures/ci-rework-route/unbound-pr.json": true,
|
|
9891
|
+
"tests/fixtures/coderabbit-labeling/shipped-41e69a0261.coderabbit.yml.txt": true,
|
|
9888
9892
|
"tests/fixtures/dependency-internalization-kit/dependency-internalization-ticket.md": true,
|
|
9889
9893
|
"tests/fixtures/dependency-internalization-kit/version-bump-ticket.md": true,
|
|
9890
9894
|
"tests/fixtures/dependency-ownership/addition/.github/workflows/deploy.yml": true,
|
|
@@ -10487,6 +10491,7 @@ export const UPSTREAM_SURFACE_MANIFEST = Object.freeze({
|
|
|
10487
10491
|
"tests/unit/cli/doctor-apply-stale-templates.test.ts": true,
|
|
10488
10492
|
"tests/unit/cli/doctor-audit-scope.test.ts": true,
|
|
10489
10493
|
"tests/unit/cli/doctor-cdk-preset-adoption.test.ts": true,
|
|
10494
|
+
"tests/unit/cli/doctor-coderabbit-labeling.test.ts": true,
|
|
10490
10495
|
"tests/unit/cli/doctor-coderabbit.test.ts": true,
|
|
10491
10496
|
"tests/unit/cli/doctor-config-shadowing.test.ts": true,
|
|
10492
10497
|
"tests/unit/cli/doctor-declared-contexts.test.ts": true,
|
|
@@ -11137,6 +11142,7 @@ export const UPSTREAM_SURFACE_MANIFEST = Object.freeze({
|
|
|
11137
11142
|
"tests/unit/hooks/worktree-binding-runtime-assumption.test.ts": true,
|
|
11138
11143
|
"tests/unit/hooks/worktree-create-failure.test.ts": true,
|
|
11139
11144
|
"tests/unit/hooks/worktree-create.test.ts": true,
|
|
11145
|
+
"tests/unit/migrations/correct-lisa-coderabbit-labeling.test.ts": true,
|
|
11140
11146
|
"tests/unit/migrations/deploy-outcome-guard-render.test.ts": true,
|
|
11141
11147
|
"tests/unit/migrations/ensure-audit-ignore-local-exclusions-esbuild.test.ts": true,
|
|
11142
11148
|
"tests/unit/migrations/ensure-audit-ignore-local-exclusions.test.ts": true,
|