sela-core 1.0.6 → 1.0.7
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 +1 -1
- package/dist/config/ConfigLoader.d.ts +1 -0
- package/dist/config/ConfigLoader.d.ts.map +1 -1
- package/dist/config/ConfigLoader.js +10 -0
- package/dist/config/DryRunGuard.d.ts +14 -0
- package/dist/config/DryRunGuard.d.ts.map +1 -0
- package/dist/config/DryRunGuard.js +79 -0
- package/dist/config/SelaConfig.d.ts +15 -1
- package/dist/config/SelaConfig.d.ts.map +1 -1
- package/dist/config/SelaConfig.js +27 -1
- package/dist/engine/SelaEngine.d.ts +12 -9
- package/dist/engine/SelaEngine.d.ts.map +1 -1
- package/dist/engine/SelaEngine.js +249 -72
- package/dist/errors/SelaError.d.ts +133 -0
- package/dist/errors/SelaError.d.ts.map +1 -0
- package/dist/errors/SelaError.js +155 -0
- package/dist/fixtures/expectProxy.d.ts.map +1 -1
- package/dist/fixtures/expectProxy.js +7 -0
- package/dist/fixtures/index.d.ts +7 -1
- package/dist/fixtures/index.d.ts.map +1 -1
- package/dist/fixtures/index.js +15 -0
- package/dist/fixtures/proxyTag.d.ts +12 -0
- package/dist/fixtures/proxyTag.d.ts.map +1 -0
- package/dist/fixtures/proxyTag.js +45 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/reporter/SelaReporter.d.ts +110 -0
- package/dist/reporter/SelaReporter.d.ts.map +1 -0
- package/dist/reporter/SelaReporter.js +328 -0
- package/dist/services/ASTSourceUpdater.d.ts +19 -0
- package/dist/services/ASTSourceUpdater.d.ts.map +1 -1
- package/dist/services/ASTSourceUpdater.js +173 -29
- package/dist/services/HealReportService.d.ts +42 -0
- package/dist/services/HealReportService.d.ts.map +1 -1
- package/dist/services/HealReportService.js +80 -1
- package/dist/services/HealingCacheService.d.ts +135 -0
- package/dist/services/HealingCacheService.d.ts.map +1 -0
- package/dist/services/HealingCacheService.js +460 -0
- package/dist/services/InitializerUpdater.d.ts.map +1 -1
- package/dist/services/InitializerUpdater.js +20 -1
- package/dist/services/IntentAuditor.d.ts +18 -1
- package/dist/services/IntentAuditor.d.ts.map +1 -1
- package/dist/services/IntentAuditor.js +19 -6
- package/dist/services/InteractiveReview.d.ts +24 -0
- package/dist/services/InteractiveReview.d.ts.map +1 -0
- package/dist/services/InteractiveReview.js +218 -0
- package/dist/services/LLMService.d.ts +17 -1
- package/dist/services/LLMService.d.ts.map +1 -1
- package/dist/services/LLMService.js +18 -8
- package/dist/services/PRAutomationService.d.ts +14 -1
- package/dist/services/PRAutomationService.d.ts.map +1 -1
- package/dist/services/PRAutomationService.js +260 -69
- package/dist/services/PendingPromptLedger.d.ts +44 -0
- package/dist/services/PendingPromptLedger.d.ts.map +1 -0
- package/dist/services/PendingPromptLedger.js +180 -0
- package/dist/services/ReportGenerator.d.ts +70 -0
- package/dist/services/ReportGenerator.d.ts.map +1 -0
- package/dist/services/ReportGenerator.js +191 -0
- package/dist/services/SafetyGuard.d.ts +27 -1
- package/dist/services/SafetyGuard.d.ts.map +1 -1
- package/dist/services/SafetyGuard.js +58 -12
- package/dist/services/SourceUpdater.d.ts.map +1 -1
- package/dist/services/SourceUpdater.js +44 -13
- package/dist/services/WorkspaceSnapshotService.d.ts +71 -0
- package/dist/services/WorkspaceSnapshotService.d.ts.map +1 -0
- package/dist/services/WorkspaceSnapshotService.js +202 -0
- package/dist/utils/IsolatedDiff.d.ts +45 -0
- package/dist/utils/IsolatedDiff.d.ts.map +1 -0
- package/dist/utils/IsolatedDiff.js +379 -0
- package/package.json +71 -67
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// src/reporter/SelaReporter.ts
|
|
3
|
+
//
|
|
4
|
+
// SelaReporter — Playwright Reporter implementation that drives the
|
|
5
|
+
// Sela heal-and-report pipeline at the reporter layer instead of the
|
|
6
|
+
// fixture teardown layer. The fixture path remains the primary trigger
|
|
7
|
+
// for in-test heals; this reporter is the SAFETY NET for worker crashes,
|
|
8
|
+
// timeouts, and any failure mode that skips fixture teardown.
|
|
9
|
+
//
|
|
10
|
+
// Responsibilities:
|
|
11
|
+
// 1. onBegin — flips SELA_REPORTER_ACTIVE so future fixture-aware code
|
|
12
|
+
// can detect that a reporter is present.
|
|
13
|
+
// 2. onTestEnd — extracts the first PNG screenshot from
|
|
14
|
+
// TestResult.attachments and converts it to Base64 IMMEDIATELY.
|
|
15
|
+
// Playwright's temp folder is cleaned up between runs, so the
|
|
16
|
+
// bytes MUST be captured into memory before the reporter loop ends.
|
|
17
|
+
// 3. onEnd — checks for ANTHROPIC_API_KEY (surfaces a friendly
|
|
18
|
+
// SelaError(LLMService, NO_API_KEY) when missing instead of
|
|
19
|
+
// crashing), flushes pending screenshots onto matching FAILED
|
|
20
|
+
// events, and invokes SelaEngine.commitUpdates() so the HTML
|
|
21
|
+
// report + PR automation still fire even when the fixture
|
|
22
|
+
// teardown never ran.
|
|
23
|
+
//
|
|
24
|
+
// Clean Architecture: zero business logic — IO + aggregation only.
|
|
25
|
+
// Heal decisions live in SelaEngine, validation in ReportGenerator,
|
|
26
|
+
// rendering in HealReportService.
|
|
27
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
28
|
+
if (k2 === undefined) k2 = k;
|
|
29
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
30
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
31
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
32
|
+
}
|
|
33
|
+
Object.defineProperty(o, k2, desc);
|
|
34
|
+
}) : (function(o, m, k, k2) {
|
|
35
|
+
if (k2 === undefined) k2 = k;
|
|
36
|
+
o[k2] = m[k];
|
|
37
|
+
}));
|
|
38
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
39
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
40
|
+
}) : function(o, v) {
|
|
41
|
+
o["default"] = v;
|
|
42
|
+
});
|
|
43
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
44
|
+
var ownKeys = function(o) {
|
|
45
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
46
|
+
var ar = [];
|
|
47
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
48
|
+
return ar;
|
|
49
|
+
};
|
|
50
|
+
return ownKeys(o);
|
|
51
|
+
};
|
|
52
|
+
return function (mod) {
|
|
53
|
+
if (mod && mod.__esModule) return mod;
|
|
54
|
+
var result = {};
|
|
55
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
56
|
+
__setModuleDefault(result, mod);
|
|
57
|
+
return result;
|
|
58
|
+
};
|
|
59
|
+
})();
|
|
60
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
61
|
+
exports.SelaReporter = void 0;
|
|
62
|
+
const fs = __importStar(require("fs"));
|
|
63
|
+
const path = __importStar(require("path"));
|
|
64
|
+
const HealReportService_js_1 = require("../services/HealReportService.js");
|
|
65
|
+
const singleton_js_1 = require("../engine/singleton.js");
|
|
66
|
+
const SelaError_js_1 = require("../errors/SelaError.js");
|
|
67
|
+
const PendingPromptLedger_js_1 = require("../services/PendingPromptLedger.js");
|
|
68
|
+
const InteractiveReview_js_1 = require("../services/InteractiveReview.js");
|
|
69
|
+
// ───────────────────────────────────────────────────────────────────
|
|
70
|
+
// SelaReporter
|
|
71
|
+
// ───────────────────────────────────────────────────────────────────
|
|
72
|
+
class SelaReporter {
|
|
73
|
+
engine;
|
|
74
|
+
report;
|
|
75
|
+
logger;
|
|
76
|
+
skipApiKeyCheck;
|
|
77
|
+
cwd;
|
|
78
|
+
readLedger;
|
|
79
|
+
clearLedger;
|
|
80
|
+
runReview;
|
|
81
|
+
isCi;
|
|
82
|
+
/**
|
|
83
|
+
* Screenshots that arrived before a matching FailedEvent existed in
|
|
84
|
+
* the shared report. Re-flushed once at onEnd time so worker-crash
|
|
85
|
+
* scenarios (no fixture teardown ⇒ no engine-side FailedEvent yet)
|
|
86
|
+
* still get their visual context attached.
|
|
87
|
+
*
|
|
88
|
+
* Key shape: `${normalisedSourceFile}::${testTitle}`.
|
|
89
|
+
*/
|
|
90
|
+
pendingScreenshots = new Map();
|
|
91
|
+
/**
|
|
92
|
+
* Mirror of the failures the reporter observed, kept so external
|
|
93
|
+
* consumers (and tests) can audit what the reporter saw without
|
|
94
|
+
* having to subscribe to the entire Playwright Reporter API.
|
|
95
|
+
*/
|
|
96
|
+
failures = [];
|
|
97
|
+
constructor(opts = {}) {
|
|
98
|
+
this.engine = (opts.engine ?? singleton_js_1.sharedEngine);
|
|
99
|
+
this.report = opts.report ?? HealReportService_js_1.sharedHealReport;
|
|
100
|
+
this.skipApiKeyCheck = opts.skipApiKeyCheck ?? false;
|
|
101
|
+
this.logger = opts.logger ?? {
|
|
102
|
+
info: (m) => console.log(m),
|
|
103
|
+
warn: (m) => console.warn(m),
|
|
104
|
+
error: (m) => console.error(m),
|
|
105
|
+
};
|
|
106
|
+
this.cwd = opts.cwd ?? process.cwd();
|
|
107
|
+
this.readLedger = opts.readLedger ?? PendingPromptLedger_js_1.readPendingPromptsLedger;
|
|
108
|
+
this.clearLedger = opts.clearLedger ?? PendingPromptLedger_js_1.clearPendingPromptsLedger;
|
|
109
|
+
this.runReview =
|
|
110
|
+
opts.runReview ??
|
|
111
|
+
((entries) => (0, InteractiveReview_js_1.runInteractiveReview)({ entries }));
|
|
112
|
+
this.isCi = opts.isCi ?? defaultIsCi;
|
|
113
|
+
}
|
|
114
|
+
// ─────────────────────────────────────────────────────────────
|
|
115
|
+
// Playwright Reporter API
|
|
116
|
+
// ─────────────────────────────────────────────────────────────
|
|
117
|
+
onBegin(_config, _suite) {
|
|
118
|
+
// Signal to future fixture-aware code that a reporter is driving
|
|
119
|
+
// finalisation. Today the fixture still calls engine.commitUpdates()
|
|
120
|
+
// itself; the env flag is reserved for the planned dedup guard.
|
|
121
|
+
process.env.SELA_REPORTER_ACTIVE = "1";
|
|
122
|
+
}
|
|
123
|
+
onTestEnd(test, result) {
|
|
124
|
+
if (result.status !== "failed" && result.status !== "timedOut")
|
|
125
|
+
return;
|
|
126
|
+
const sourceFile = test.location?.file ?? "";
|
|
127
|
+
const sourceLine = test.location?.line;
|
|
128
|
+
const testTitle = test.title;
|
|
129
|
+
const base64Png = this.extractScreenshotBase64(result);
|
|
130
|
+
if (base64Png) {
|
|
131
|
+
// First try to attach immediately — the engine may have already
|
|
132
|
+
// recorded the FailedEvent during fixture teardown for in-test
|
|
133
|
+
// heal failures. This is the happy path.
|
|
134
|
+
const matched = this.report.attachFailureScreenshot({ sourceFile: this.normalisePath(sourceFile), testTitle }, base64Png);
|
|
135
|
+
if (matched === 0) {
|
|
136
|
+
// No matching FailedEvent yet — buffer for the onEnd retry. This
|
|
137
|
+
// covers worker-crash and fixture-skip cases where the engine
|
|
138
|
+
// never got a chance to record the FailedEvent in-flight.
|
|
139
|
+
const key = this.pendingKey(sourceFile, testTitle);
|
|
140
|
+
this.pendingScreenshots.set(key, base64Png);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
this.failures.push({
|
|
144
|
+
sourceFile,
|
|
145
|
+
sourceLine,
|
|
146
|
+
testTitle,
|
|
147
|
+
status: result.status,
|
|
148
|
+
hasScreenshot: !!base64Png,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
async onEnd(_result) {
|
|
152
|
+
if (!this.skipApiKeyCheck && !process.env.ANTHROPIC_API_KEY) {
|
|
153
|
+
const err = new SelaError_js_1.SelaError({
|
|
154
|
+
subsystem: "LLMService",
|
|
155
|
+
code: SelaError_js_1.LLM_SERVICE_CODES.NO_API_KEY,
|
|
156
|
+
reason: "ANTHROPIC_API_KEY not set — SelaReporter cannot drive the heal pipeline. " +
|
|
157
|
+
"Set the env var (or remove the reporter entry from playwright.config.ts).",
|
|
158
|
+
});
|
|
159
|
+
// Graceful degradation: surface the error and continue flushing
|
|
160
|
+
// any report content the fixture path already produced.
|
|
161
|
+
this.logger.warn(err.message);
|
|
162
|
+
}
|
|
163
|
+
// Late-bind any screenshots that arrived before their FailedEvents.
|
|
164
|
+
this.flushPendingScreenshots();
|
|
165
|
+
try {
|
|
166
|
+
await this.engine.commitUpdates();
|
|
167
|
+
}
|
|
168
|
+
catch (err) {
|
|
169
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
170
|
+
this.logger.error(`[Sela] reporter commitUpdates failed: ${msg}`);
|
|
171
|
+
}
|
|
172
|
+
// ── Local DX — Interactive review drain ──────────────────────
|
|
173
|
+
//
|
|
174
|
+
// Workers serialise their mutated FileSnapshots to
|
|
175
|
+
// `<cwd>/.sela/pending-prompts/*.json` because they have no TTY.
|
|
176
|
+
// The reporter (main process, has stdin/stdout) drains that ledger
|
|
177
|
+
// here, prompts the developer for each fix, then deletes the dir.
|
|
178
|
+
//
|
|
179
|
+
// CI runs skip this entirely — PR automation already handled the
|
|
180
|
+
// mutations on its isolated branch.
|
|
181
|
+
if (!this.isCi()) {
|
|
182
|
+
try {
|
|
183
|
+
const entries = this.readLedger(this.cwd);
|
|
184
|
+
if (entries.length > 0) {
|
|
185
|
+
// Banner on stderr so Playwright's stdout summary cannot
|
|
186
|
+
// mask it. Visible to the developer even if the readline
|
|
187
|
+
// prompt itself races with terminal redraws.
|
|
188
|
+
process.stderr.write(`\n[Sela] 🔧 Local DX review starting (${entries.length} fix${entries.length > 1 ? "es" : ""} pending)\n`);
|
|
189
|
+
await this.runReview(entries);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
catch (err) {
|
|
193
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
194
|
+
this.logger.error(`[Sela] interactive review failed: ${msg}`);
|
|
195
|
+
}
|
|
196
|
+
finally {
|
|
197
|
+
try {
|
|
198
|
+
this.clearLedger(this.cwd);
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
// Cleanup failures are non-fatal — the next run will overwrite.
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
// CI path: drop the ledger so a follow-up local run doesn't replay
|
|
207
|
+
// mutations from a previous CI session.
|
|
208
|
+
try {
|
|
209
|
+
this.clearLedger(this.cwd);
|
|
210
|
+
}
|
|
211
|
+
catch {
|
|
212
|
+
// ignore
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/** Reporter prints nothing of its own — Playwright stdio stays clean. */
|
|
217
|
+
printsToStdio() {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
// ─────────────────────────────────────────────────────────────
|
|
221
|
+
// Internals (exposed for testing — prefixed underscore is the
|
|
222
|
+
// convention used elsewhere in the codebase for proxy back-doors).
|
|
223
|
+
// ─────────────────────────────────────────────────────────────
|
|
224
|
+
/**
|
|
225
|
+
* Walk every buffered pending screenshot and try to attach it to a
|
|
226
|
+
* now-existing FailedEvent. Successfully-attached entries are
|
|
227
|
+
* removed; unmatched entries are dropped (the matching FailedEvent
|
|
228
|
+
* never arrived — most likely worker crashed before the engine
|
|
229
|
+
* could record one).
|
|
230
|
+
*
|
|
231
|
+
* Returns the number of FailedEvents touched.
|
|
232
|
+
*/
|
|
233
|
+
flushPendingScreenshots() {
|
|
234
|
+
let total = 0;
|
|
235
|
+
for (const [key, base64] of Array.from(this.pendingScreenshots.entries())) {
|
|
236
|
+
const sepIndex = key.indexOf("::");
|
|
237
|
+
if (sepIndex < 0) {
|
|
238
|
+
this.pendingScreenshots.delete(key);
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
const filePart = key.slice(0, sepIndex);
|
|
242
|
+
const titlePart = key.slice(sepIndex + 2);
|
|
243
|
+
const matched = this.report.attachFailureScreenshot({ sourceFile: filePart, testTitle: titlePart }, base64);
|
|
244
|
+
if (matched > 0) {
|
|
245
|
+
total += matched;
|
|
246
|
+
this.pendingScreenshots.delete(key);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return total;
|
|
250
|
+
}
|
|
251
|
+
/** Test hook — read-only snapshot of recorded failures. */
|
|
252
|
+
getRecordedFailures() {
|
|
253
|
+
return this.failures.slice();
|
|
254
|
+
}
|
|
255
|
+
/** Test hook — number of screenshots still waiting for a FailedEvent. */
|
|
256
|
+
getPendingScreenshotCount() {
|
|
257
|
+
return this.pendingScreenshots.size;
|
|
258
|
+
}
|
|
259
|
+
// ─────────────────────────────────────────────────────────────
|
|
260
|
+
// Private helpers
|
|
261
|
+
// ─────────────────────────────────────────────────────────────
|
|
262
|
+
pendingKey(sourceFile, testTitle) {
|
|
263
|
+
return `${this.normalisePath(sourceFile)}::${testTitle}`;
|
|
264
|
+
}
|
|
265
|
+
normalisePath(p) {
|
|
266
|
+
if (!p)
|
|
267
|
+
return "";
|
|
268
|
+
try {
|
|
269
|
+
const abs = path.isAbsolute(p) ? p : path.resolve(process.cwd(), p);
|
|
270
|
+
const rel = path.relative(process.cwd(), abs);
|
|
271
|
+
return (rel || abs).split("\\").join("/");
|
|
272
|
+
}
|
|
273
|
+
catch {
|
|
274
|
+
return p.split("\\").join("/");
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Convert the first PNG attachment on a TestResult into a Base64
|
|
279
|
+
* string immediately. Prefers an in-memory `body` when Playwright
|
|
280
|
+
* already inlined the bytes (faster, no IO); falls back to reading
|
|
281
|
+
* the attachment `path` synchronously BEFORE Playwright has a chance
|
|
282
|
+
* to clean up its temp folder.
|
|
283
|
+
*/
|
|
284
|
+
extractScreenshotBase64(result) {
|
|
285
|
+
const attachments = result.attachments ?? [];
|
|
286
|
+
for (const att of attachments) {
|
|
287
|
+
const contentType = (att.contentType ?? "").toLowerCase();
|
|
288
|
+
const looksLikePng = contentType.includes("png") ||
|
|
289
|
+
(att.name ?? "").toLowerCase().includes("screenshot") ||
|
|
290
|
+
((att.path ?? "").toLowerCase().endsWith(".png"));
|
|
291
|
+
if (!looksLikePng)
|
|
292
|
+
continue;
|
|
293
|
+
// Playwright >= 1.46 sometimes inlines the body for small images.
|
|
294
|
+
const inline = att.body;
|
|
295
|
+
if (inline && inline.length > 0) {
|
|
296
|
+
return Buffer.isBuffer(inline)
|
|
297
|
+
? inline.toString("base64")
|
|
298
|
+
: Buffer.from(inline).toString("base64");
|
|
299
|
+
}
|
|
300
|
+
if (att.path) {
|
|
301
|
+
try {
|
|
302
|
+
const bytes = fs.readFileSync(att.path);
|
|
303
|
+
return bytes.toString("base64");
|
|
304
|
+
}
|
|
305
|
+
catch {
|
|
306
|
+
// Temp file already gone — nothing we can do.
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return undefined;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
exports.SelaReporter = SelaReporter;
|
|
314
|
+
/**
|
|
315
|
+
* Mirror of the CI detection used by `SelaEngine.commitUpdates()`.
|
|
316
|
+
* Accepts the standard `CI=1`/`CI=true` convention; everything else
|
|
317
|
+
* (empty string, undefined, `0`, `false`) is Local DX mode.
|
|
318
|
+
*/
|
|
319
|
+
function defaultIsCi() {
|
|
320
|
+
const raw = process.env.CI;
|
|
321
|
+
if (raw === undefined || raw === null)
|
|
322
|
+
return false;
|
|
323
|
+
const v = String(raw).trim().toLowerCase();
|
|
324
|
+
return v !== "" && v !== "0" && v !== "false";
|
|
325
|
+
}
|
|
326
|
+
// Default export so Playwright can resolve `reporter: [['sela-core/reporter']]`
|
|
327
|
+
// without needing the consumer to spell out the named import.
|
|
328
|
+
exports.default = SelaReporter;
|
|
@@ -25,6 +25,25 @@ export declare class ASTSourceUpdater {
|
|
|
25
25
|
private project;
|
|
26
26
|
readonly advisoryBuffer: AdvisoryBuffer;
|
|
27
27
|
flushAdvisories(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Centralised write hook for every ts-morph `saveSync` call in this class.
|
|
30
|
+
* When `SELA_DRY_RUN` is active the AST mutation stays in memory but the
|
|
31
|
+
* on-disk file is left untouched — the heal pipeline can still compute a
|
|
32
|
+
* candidate diff via `sourceFile.getFullText()` and the report layer
|
|
33
|
+
* tags the event with `dryRun: true`.
|
|
34
|
+
*/
|
|
35
|
+
private _persistChanges;
|
|
36
|
+
scanFailFastDirective(caller: CallerContext): {
|
|
37
|
+
failFast: boolean;
|
|
38
|
+
matchedComment?: string;
|
|
39
|
+
matchedLine?: number;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Convenience helper — runs `scanFailFastDirective` and throws the
|
|
43
|
+
* canonical SelaError when the directive is present. Used by SelaEngine
|
|
44
|
+
* as the very first gate inside `heal()`.
|
|
45
|
+
*/
|
|
46
|
+
enforceFailFastDirective(caller: CallerContext): void;
|
|
28
47
|
constructor();
|
|
29
48
|
private readonly WRAPPER_IDENTIFIERS;
|
|
30
49
|
private readonly STRUCTURAL_ROLES;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ASTSourceUpdater.d.ts","sourceRoot":"","sources":["../../src/services/ASTSourceUpdater.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ASTSourceUpdater.d.ts","sourceRoot":"","sources":["../../src/services/ASTSourceUpdater.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C,OAAO,EAAE,cAAc,EAAgB,MAAM,mBAAmB,CAAC;AAOjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAMtD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kGAAkG;IAClG,mBAAmB,CAAC,EAA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