sela-core 0.1.0-alpha.38 → 0.1.0-alpha.39

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.
@@ -1 +1 @@
1
- {"version":3,"file":"RegressionManifestService.d.ts","sourceRoot":"","sources":["../../src/services/RegressionManifestService.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AAExE,oEAAoE;AACpE,MAAM,WAAW,wBAAwB;IACvC,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,cAAc,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,wBAAwB,EAAE,CAAC;CACrC;AAMD,qBAAa,yBAAyB;IACpC,+DAA+D;IAC/D,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,wBAAwB,EAAE;IAexE;;;;OAIG;IACH,MAAM,CAAC,aAAa,CAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,wBAAwB,EAAE,GAClC,MAAM,GAAG,IAAI;IAYhB;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB;IAkBzD,OAAO,CAAC,MAAM,CAAC,QAAQ;CAqDxB;AAED;;;;GAIG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;gBAEzC,QAAQ,EAAE,kBAAkB;IAIxC,yEAAyE;IACzE,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB;IAMrD;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAY3E"}
1
+ {"version":3,"file":"RegressionManifestService.d.ts","sourceRoot":"","sources":["../../src/services/RegressionManifestService.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AAExE,oEAAoE;AACpE,MAAM,WAAW,wBAAwB;IACvC,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,cAAc,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,wBAAwB,EAAE,CAAC;CACrC;AAMD,qBAAa,yBAAyB;IACpC,+DAA+D;IAC/D,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,wBAAwB,EAAE;IAexE;;;;OAIG;IACH,MAAM,CAAC,aAAa,CAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,wBAAwB,EAAE,GAClC,MAAM,GAAG,IAAI;IAYhB;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB;IAkBzD,OAAO,CAAC,MAAM,CAAC,QAAQ;CAqDxB;AAED;;;;GAIG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;gBAEzC,QAAQ,EAAE,kBAAkB;IAIxC,yEAAyE;IACzE,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB;IAMrD;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CA0B3E"}
@@ -172,18 +172,31 @@ class RegressionInjector {
172
172
  */
173
173
  lookup(filePath, line, oldSelector) {
174
174
  const f = normalizePath(filePath).toLowerCase();
175
- const candidates = this.records.filter((r) => {
175
+ // Primary: match on line + file (precise call-site).
176
+ const lineCandidates = this.records.filter((r) => {
176
177
  if (r.failureLine !== line)
177
178
  return false;
178
179
  const rf = normalizePath(r.sourceFile).toLowerCase();
179
180
  return f === rf || f.endsWith(rf) || rf.endsWith(f);
180
181
  });
181
- if (candidates.length === 0)
182
- return null;
183
- const exact = candidates.find((r) => r.oldSelector === oldSelector);
184
- if (exact)
185
- return exact.healedSelector;
186
- return candidates.length === 1 ? candidates[0].healedSelector : null;
182
+ if (lineCandidates.length > 0) {
183
+ const exact = lineCandidates.find((r) => r.oldSelector === oldSelector);
184
+ if (exact)
185
+ return exact.healedSelector;
186
+ if (lineCandidates.length === 1)
187
+ return lineCandidates[0].healedSelector;
188
+ }
189
+ // Fallback: shared locators — multiple tests in the same file fail at
190
+ // different lines but share the same broken selector. The manifest stores
191
+ // failureLine from the FIRST failure only, so subsequent tests miss the
192
+ // line match. Widen to selector + file so every caller gets injected.
193
+ const selectorMatch = this.records.find((r) => {
194
+ if (r.oldSelector !== oldSelector)
195
+ return false;
196
+ const rf = normalizePath(r.sourceFile).toLowerCase();
197
+ return f === rf || f.endsWith(rf) || rf.endsWith(f);
198
+ });
199
+ return selectorMatch?.healedSelector ?? null;
187
200
  }
188
201
  }
189
202
  exports.RegressionInjector = RegressionInjector;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sela-core",
3
- "version": "0.1.0-alpha.38",
3
+ "version": "0.1.0-alpha.39",
4
4
  "description": "AI self-healing Playwright wrapper - drop-in replacement for @playwright/test",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",