sela-core 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/ErrorHandler.d.ts +1 -1
  3. package/dist/cli/ErrorHandler.js +14 -14
  4. package/dist/cli/commands/bulk.d.ts +1 -1
  5. package/dist/cli/commands/bulk.d.ts.map +1 -1
  6. package/dist/cli/commands/bulk.js +51 -33
  7. package/dist/cli/commands/init.d.ts +1 -1
  8. package/dist/cli/commands/init.d.ts.map +1 -1
  9. package/dist/cli/commands/init.js +26 -18
  10. package/dist/cli/commands/showReport.d.ts +1 -1
  11. package/dist/cli/commands/showReport.d.ts.map +1 -1
  12. package/dist/cli/commands/showReport.js +12 -10
  13. package/dist/cli/commands/status.d.ts +1 -1
  14. package/dist/cli/commands/status.d.ts.map +1 -1
  15. package/dist/cli/commands/status.js +8 -8
  16. package/dist/cli/commands/sync.d.ts +1 -1
  17. package/dist/cli/commands/sync.d.ts.map +1 -1
  18. package/dist/cli/commands/sync.js +38 -30
  19. package/dist/cli/index.js +9 -9
  20. package/dist/cli/ui/DnaTable.d.ts +1 -1
  21. package/dist/cli/ui/DnaTable.d.ts.map +1 -1
  22. package/dist/cli/ui/DnaTable.js +23 -16
  23. package/dist/cli/ui/RefactorWizard.d.ts +3 -3
  24. package/dist/cli/ui/RefactorWizard.d.ts.map +1 -1
  25. package/dist/cli/ui/RefactorWizard.js +108 -82
  26. package/dist/config/ConfigLoader.d.ts +3 -2
  27. package/dist/config/ConfigLoader.d.ts.map +1 -1
  28. package/dist/config/ConfigLoader.js +23 -13
  29. package/dist/config/DryRunGuard.d.ts +14 -0
  30. package/dist/config/DryRunGuard.d.ts.map +1 -0
  31. package/dist/config/DryRunGuard.js +79 -0
  32. package/dist/config/SelaConfig.d.ts +26 -16
  33. package/dist/config/SelaConfig.d.ts.map +1 -1
  34. package/dist/config/SelaConfig.js +54 -22
  35. package/dist/engine/HealingRegistry.d.ts +1 -1
  36. package/dist/engine/HealingRegistry.js +3 -3
  37. package/dist/engine/SelaEngine.d.ts +13 -10
  38. package/dist/engine/SelaEngine.d.ts.map +1 -1
  39. package/dist/engine/SelaEngine.js +292 -101
  40. package/dist/errors/SelaError.d.ts +132 -0
  41. package/dist/errors/SelaError.d.ts.map +1 -0
  42. package/dist/errors/SelaError.js +154 -0
  43. package/dist/fixtures/expectProxy.d.ts +1 -1
  44. package/dist/fixtures/expectProxy.d.ts.map +1 -1
  45. package/dist/fixtures/expectProxy.js +17 -10
  46. package/dist/fixtures/index.d.ts +7 -1
  47. package/dist/fixtures/index.d.ts.map +1 -1
  48. package/dist/fixtures/index.js +26 -11
  49. package/dist/fixtures/proxyTag.d.ts +12 -0
  50. package/dist/fixtures/proxyTag.d.ts.map +1 -0
  51. package/dist/fixtures/proxyTag.js +45 -0
  52. package/dist/index.d.ts +8 -6
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +9 -4
  55. package/dist/reporter/SelaReporter.d.ts +143 -0
  56. package/dist/reporter/SelaReporter.d.ts.map +1 -0
  57. package/dist/reporter/SelaReporter.js +428 -0
  58. package/dist/services/ASTSourceUpdater.d.ts +20 -1
  59. package/dist/services/ASTSourceUpdater.d.ts.map +1 -1
  60. package/dist/services/ASTSourceUpdater.js +257 -89
  61. package/dist/services/ArgumentTypeAnalyzer.js +7 -7
  62. package/dist/services/BlastRadiusAnalyzer.d.ts.map +1 -1
  63. package/dist/services/BlastRadiusAnalyzer.js +5 -2
  64. package/dist/services/ChainValidator.js +22 -22
  65. package/dist/services/CrossFileHealer.js +7 -7
  66. package/dist/services/DefinitionTracer.d.ts +1 -1
  67. package/dist/services/DefinitionTracer.d.ts.map +1 -1
  68. package/dist/services/DefinitionTracer.js +28 -13
  69. package/dist/services/DnaEditorService.d.ts +2 -2
  70. package/dist/services/DnaEditorService.d.ts.map +1 -1
  71. package/dist/services/DnaEditorService.js +81 -62
  72. package/dist/services/DnaIndexService.d.ts +1 -1
  73. package/dist/services/DnaIndexService.d.ts.map +1 -1
  74. package/dist/services/DnaIndexService.js +14 -14
  75. package/dist/services/HealReportService.d.ts +43 -1
  76. package/dist/services/HealReportService.d.ts.map +1 -1
  77. package/dist/services/HealReportService.js +108 -25
  78. package/dist/services/HealingAdvisory.js +1 -1
  79. package/dist/services/HealingCacheService.d.ts +135 -0
  80. package/dist/services/HealingCacheService.d.ts.map +1 -0
  81. package/dist/services/HealingCacheService.js +460 -0
  82. package/dist/services/HealthReportService.d.ts +1 -1
  83. package/dist/services/HealthReportService.d.ts.map +1 -1
  84. package/dist/services/HealthReportService.js +25 -25
  85. package/dist/services/InitializerUpdater.d.ts.map +1 -1
  86. package/dist/services/InitializerUpdater.js +20 -1
  87. package/dist/services/IntentAuditor.d.ts +18 -1
  88. package/dist/services/IntentAuditor.d.ts.map +1 -1
  89. package/dist/services/IntentAuditor.js +50 -26
  90. package/dist/services/InteractiveReview.d.ts +15 -0
  91. package/dist/services/InteractiveReview.d.ts.map +1 -0
  92. package/dist/services/InteractiveReview.js +125 -0
  93. package/dist/services/LLMService.d.ts +18 -2
  94. package/dist/services/LLMService.d.ts.map +1 -1
  95. package/dist/services/LLMService.js +33 -23
  96. package/dist/services/PRAutomationService.d.ts +14 -1
  97. package/dist/services/PRAutomationService.d.ts.map +1 -1
  98. package/dist/services/PRAutomationService.js +287 -92
  99. package/dist/services/PendingPromptLedger.d.ts +44 -0
  100. package/dist/services/PendingPromptLedger.d.ts.map +1 -0
  101. package/dist/services/PendingPromptLedger.js +180 -0
  102. package/dist/services/ReportGenerator.d.ts +70 -0
  103. package/dist/services/ReportGenerator.d.ts.map +1 -0
  104. package/dist/services/ReportGenerator.js +191 -0
  105. package/dist/services/SafetyGuard.d.ts +30 -7
  106. package/dist/services/SafetyGuard.d.ts.map +1 -1
  107. package/dist/services/SafetyGuard.js +85 -116
  108. package/dist/services/SnapshotService.js +5 -5
  109. package/dist/services/SourceLinkService.d.ts +2 -2
  110. package/dist/services/SourceLinkService.d.ts.map +1 -1
  111. package/dist/services/SourceLinkService.js +31 -22
  112. package/dist/services/SourceUpdater.d.ts +1 -1
  113. package/dist/services/SourceUpdater.d.ts.map +1 -1
  114. package/dist/services/SourceUpdater.js +66 -34
  115. package/dist/services/TemplateDiffService.d.ts.map +1 -1
  116. package/dist/services/TemplateDiffService.js +18 -15
  117. package/dist/services/WorkspaceSnapshotService.d.ts +71 -0
  118. package/dist/services/WorkspaceSnapshotService.d.ts.map +1 -0
  119. package/dist/services/WorkspaceSnapshotService.js +200 -0
  120. package/dist/types/index.d.ts +1 -1
  121. package/dist/utils/IsolatedDiff.d.ts +45 -0
  122. package/dist/utils/IsolatedDiff.d.ts.map +1 -0
  123. package/dist/utils/IsolatedDiff.js +382 -0
  124. package/package.json +71 -67
@@ -20,7 +20,7 @@ exports.ALL_LOCATOR_METHODS = new Set([
20
20
  // ArgumentTypeAnalyzer
21
21
  //
22
22
  // Classifies the first argument of a Playwright locator CallExpression.
23
- // Stateless no file I/O, no side effects.
23
+ // Stateless - no file I/O, no side effects.
24
24
  // ═══════════════════════════════════════════════════════════════════
25
25
  class ArgumentTypeAnalyzer {
26
26
  /**
@@ -64,28 +64,28 @@ class ArgumentTypeAnalyzer {
64
64
  // Private helpers
65
65
  // ─────────────────────────────────────────────────────────────────
66
66
  static classifyNode(node) {
67
- // Plain string value is self-contained in this node.
67
+ // Plain string - value is self-contained in this node.
68
68
  if (ts_morph_1.Node.isStringLiteral(node) ||
69
69
  ts_morph_1.Node.isNoSubstitutionTemplateLiteral(node)) {
70
70
  return "STRING_LITERAL";
71
71
  }
72
- // Template with ${...} spans static segments are healable, spans are not.
72
+ // Template with ${...} spans - static segments are healable, spans are not.
73
73
  if (ts_morph_1.Node.isTemplateExpression(node)) {
74
74
  return "TEMPLATE_LITERAL";
75
75
  }
76
- // Bare variable name must trace to declaration.
76
+ // Bare variable name - must trace to declaration.
77
77
  if (ts_morph_1.Node.isIdentifier(node)) {
78
78
  return "IDENTIFIER";
79
79
  }
80
- // OBJECT.property must trace to object literal property value.
80
+ // OBJECT.property - must trace to object literal property value.
81
81
  if (ts_morph_1.Node.isPropertyAccessExpression(node)) {
82
82
  return "PROPERTY_ACCESS";
83
83
  }
84
- // fn(...) must enter function body to find return value.
84
+ // fn(...) - must enter function body to find return value.
85
85
  if (ts_morph_1.Node.isCallExpression(node)) {
86
86
  return "CALL_EXPRESSION";
87
87
  }
88
- // Binary expressions, conditionals, spreads, etc. not healable here.
88
+ // Binary expressions, conditionals, spreads, etc. - not healable here.
89
89
  return "COMPLEX";
90
90
  }
91
91
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BlastRadiusAnalyzer.d.ts","sourceRoot":"","sources":["../../src/services/BlastRadiusAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAc,MAAM,UAAU,CAAC;AAMjE,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAElD,MAAM,WAAW,iBAAiB;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,IAAI,EAAE,SAAS,CAAC;CACjB;AAWD,qBAAa,mBAAmB;IAC9B,MAAM,CAAC,OAAO,CACZ,eAAe,EAAE,IAAI,EACrB,WAAW,EAAE,UAAU,EACvB,QAAQ,EAAE,OAAO,GAChB,iBAAiB;IAgBpB,OAAO,CAAC,MAAM,CAAC,SAAS;IAwDxB,OAAO,CAAC,MAAM,CAAC,WAAW;IAY1B,OAAO,CAAC,MAAM,CAAC,UAAU;CAiB1B"}
1
+ {"version":3,"file":"BlastRadiusAnalyzer.d.ts","sourceRoot":"","sources":["../../src/services/BlastRadiusAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAc,MAAM,UAAU,CAAC;AAMjE,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAElD,MAAM,WAAW,iBAAiB;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,IAAI,EAAE,SAAS,CAAC;CACjB;AAWD,qBAAa,mBAAmB;IAC9B,MAAM,CAAC,OAAO,CACZ,eAAe,EAAE,IAAI,EACrB,WAAW,EAAE,UAAU,EACvB,QAAQ,EAAE,OAAO,GAChB,iBAAiB;IAgBpB,OAAO,CAAC,MAAM,CAAC,SAAS;IA2DxB,OAAO,CAAC,MAAM,CAAC,WAAW;IAY1B,OAAO,CAAC,MAAM,CAAC,UAAU;CAiB1B"}
@@ -8,7 +8,7 @@ const ts_morph_1 = require("ts-morph");
8
8
  // Before mutating a definition-site node, determine how many tests
9
9
  // reference it. Uses ts-morph's findReferences() for cross-file
10
10
  // accuracy. On any analysis failure, defaults to risk:'low' and logs
11
- // a warning never blocks healing due to analysis error.
11
+ // a warning - never blocks healing due to analysis error.
12
12
  // ═══════════════════════════════════════════════════════════════════
13
13
  class BlastRadiusAnalyzer {
14
14
  static analyze(declarationNode, _sourceFile, _project) {
@@ -35,7 +35,10 @@ class BlastRadiusAnalyzer {
35
35
  risk: "low",
36
36
  };
37
37
  }
38
- const refs = nameNode.getProject().getLanguageService().findReferences(nameNode);
38
+ const refs = nameNode
39
+ .getProject()
40
+ .getLanguageService()
41
+ .findReferences(nameNode);
39
42
  const affectedFilesSet = new Set();
40
43
  let totalRefs = 0;
41
44
  // Key = filePath:startLine of the enclosing test() / it() call.
@@ -6,11 +6,11 @@
6
6
  //
7
7
  // Runs 5 sequential guards before any AST mutation occurs:
8
8
  //
9
- // [1] SchemaValidator required fields, no unknown segment types
10
- // [2] TypeFlowValidator tracks Locator|FrameLocator state
11
- // [3] ReceiverValidator root must match original chain's receiver
12
- // [4] PlacementValidator filter() / nth() / first() only after Locator
13
- // [5] SemanticUpgrader upgrades flat CSS to semantic where possible
9
+ // [1] SchemaValidator - required fields, no unknown segment types
10
+ // [2] TypeFlowValidator - tracks Locator|FrameLocator state
11
+ // [3] ReceiverValidator - root must match original chain's receiver
12
+ // [4] PlacementValidator - filter() / nth() / first() only after Locator
13
+ // [5] SemanticUpgrader - upgrades flat CSS to semantic where possible
14
14
  //
15
15
  // Each guard returns a ValidationResult. The pipeline short-circuits on
16
16
  // the first REJECT, falling back to the original flat-CSS strategy.
@@ -139,7 +139,7 @@ const VALID_ARIA_ROLES = new Set([
139
139
  "generic",
140
140
  ]);
141
141
  // ─────────────────────────────────────────────────────────────────
142
- // GUARD 1 Schema Validator
142
+ // GUARD 1 - Schema Validator
143
143
  // ─────────────────────────────────────────────────────────────────
144
144
  function schemaValidate(segments) {
145
145
  if (!Array.isArray(segments) || segments.length === 0) {
@@ -226,7 +226,7 @@ function schemaValidate(segments) {
226
226
  return { valid: true };
227
227
  }
228
228
  // ─────────────────────────────────────────────────────────────────
229
- // GUARD 2 Type Flow Validator
229
+ // GUARD 2 - Type Flow Validator
230
230
  //
231
231
  // Simulates the chain execution, tracking whether the current
232
232
  // expression is a Locator, FrameLocator, or Page/unknown.
@@ -266,13 +266,13 @@ function typeFlowValidate(segments, rootType) {
266
266
  if (currentType === "FrameLocator") {
267
267
  return {
268
268
  valid: false,
269
- reason: "chain ends on FrameLocator assertions require a Locator at the end",
269
+ reason: "chain ends on FrameLocator - assertions require a Locator at the end",
270
270
  };
271
271
  }
272
272
  return { valid: true };
273
273
  }
274
274
  // ─────────────────────────────────────────────────────────────────
275
- // GUARD 3 Receiver Validator
275
+ // GUARD 3 - Receiver Validator
276
276
  //
277
277
  // The first segment's effective receiver must be compatible with
278
278
  // the original code's root receiver. Prevents `page.getByRole()`
@@ -284,14 +284,14 @@ function receiverValidate(segments, originalRootReceiver, proposedRootReceiver)
284
284
  // If both are "page" or both are the same variable, we're fine
285
285
  if (orig === proposed)
286
286
  return { valid: true };
287
- // "page" is a global receiver the AI sometimes proposes it even when
287
+ // "page" is a global receiver - the AI sometimes proposes it even when
288
288
  // the original chain was scoped. This is only acceptable if the original
289
289
  // chain itself started from "page".
290
290
  const PAGE_RECEIVERS = new Set(["page", "context", "browser"]);
291
291
  if (PAGE_RECEIVERS.has(proposed) && !PAGE_RECEIVERS.has(orig)) {
292
292
  return {
293
293
  valid: false,
294
- reason: `receiver mismatch: original chain rooted at "${orig}" but proposed chain starts from "${proposed}" this would change element scope`,
294
+ reason: `receiver mismatch: original chain rooted at "${orig}" but proposed chain starts from "${proposed}" - this would change element scope`,
295
295
  };
296
296
  }
297
297
  // If the original root is a local variable and proposed is different,
@@ -299,14 +299,14 @@ function receiverValidate(segments, originalRootReceiver, proposedRootReceiver)
299
299
  // We allow this since sometimes variables are renamed but semantically
300
300
  // equivalent.
301
301
  if (!PAGE_RECEIVERS.has(orig) && !PAGE_RECEIVERS.has(proposed)) {
302
- // Both are custom variables trust the AI's context
303
- console.warn(`[ChainValidator] ⚠️ Receiver mismatch: "${orig}" vs "${proposed}" proceeding cautiously`);
302
+ // Both are custom variables - trust the AI's context
303
+ console.warn(`[ChainValidator] ⚠️ Receiver mismatch: "${orig}" vs "${proposed}" - proceeding cautiously`);
304
304
  return { valid: true };
305
305
  }
306
306
  return { valid: true };
307
307
  }
308
308
  // ─────────────────────────────────────────────────────────────────
309
- // GUARD 4 Placement Validator
309
+ // GUARD 4 - Placement Validator
310
310
  //
311
311
  // Validates placement-sensitive rules:
312
312
  // - filter/first/last/nth must follow a Locator-producing segment
@@ -322,7 +322,7 @@ function placementValidate(segments) {
322
322
  if (prev.type === "frameLocator") {
323
323
  return {
324
324
  valid: false,
325
- reason: `segment[${i}] .${seg.type}() placed immediately after frameLocator() invalid`,
325
+ reason: `segment[${i}] .${seg.type}() placed immediately after frameLocator() - invalid`,
326
326
  };
327
327
  }
328
328
  }
@@ -335,7 +335,7 @@ function placementValidate(segments) {
335
335
  if (!hasAnyPredicate) {
336
336
  return {
337
337
  valid: false,
338
- reason: `segment[${i}] filter() has all-empty predicates would be a no-op`,
338
+ reason: `segment[${i}] filter() has all-empty predicates - would be a no-op`,
339
339
  };
340
340
  }
341
341
  }
@@ -343,16 +343,16 @@ function placementValidate(segments) {
343
343
  return { valid: true };
344
344
  }
345
345
  // ─────────────────────────────────────────────────────────────────
346
- // GUARD 5 Semantic Upgrader
346
+ // GUARD 5 - Semantic Upgrader
347
347
  //
348
348
  // Opportunistically upgrades flat CSS locator segments to semantic
349
349
  // equivalents following Playwright's priority hierarchy:
350
350
  // 1. getByTestId (data-testid)
351
351
  // 2. getByRole (aria role inference from CSS)
352
352
  // 3. getByLabel (form elements)
353
- // 4. locator (CSS unchanged)
353
+ // 4. locator (CSS - unchanged)
354
354
  //
355
- // This guard NEVER rejects it only upgrades and returns the
355
+ // This guard NEVER rejects - it only upgrades and returns the
356
356
  // possibly-improved segments.
357
357
  // ─────────────────────────────────────────────────────────────────
358
358
  const ROLE_BY_TAG = {
@@ -396,12 +396,12 @@ function tryUpgradeToSemantic(seg) {
396
396
  return { type: "getByRole", role };
397
397
  }
398
398
  }
399
- // Priority 3b: button[type="submit"] or button.classname still a button role
399
+ // Priority 3b: button[type="submit"] or button.classname - still a button role
400
400
  const buttonMatch = css.match(/^button(?:[.[#][^\s]*)?$/);
401
401
  if (buttonMatch) {
402
402
  return { type: "getByRole", role: "button" };
403
403
  }
404
- // Priority 4: has-text() convert to getByText
404
+ // Priority 4: has-text() - convert to getByText
405
405
  const hasTextMatch = css.match(/^.*:has-text\(["']([^"']+)["']\)$/);
406
406
  if (hasTextMatch) {
407
407
  return { type: "getByText", text: hasTextMatch[1] };
@@ -506,7 +506,7 @@ class ChainValidator {
506
506
  // Guard 2: Type flow
507
507
  const effectiveRootType = rootType === "unknown" ? "Locator" : rootType;
508
508
  // For Page-level (page.xxx), the root is not yet a Locator/FrameLocator
509
- // we treat the first segment as the producer.
509
+ // - we treat the first segment as the producer.
510
510
  const isPageReceiver = originalRootReceiver === "page" ||
511
511
  originalRootReceiver === "context" ||
512
512
  originalRootReceiver === "browser";
@@ -45,12 +45,12 @@ const InitializerUpdater_js_1 = require("./InitializerUpdater.js");
45
45
  // then delegates mutation to InitializerUpdater.
46
46
  //
47
47
  // Entry point: CrossFileHealer.heal()
48
- // modulePath the import specifier string (e.g. "./constants")
49
- // symbolName the exported identifier name (e.g. "SHARED_SEL")
50
- // oldValue the current string value (used for verification)
51
- // newValue the replacement value
52
- // callerFilePath absolute path of the file containing the import
53
- // project the shared ASTSourceUpdater Project instance
48
+ // modulePath - the import specifier string (e.g. "./constants")
49
+ // symbolName - the exported identifier name (e.g. "SHARED_SEL")
50
+ // oldValue - the current string value (used for verification)
51
+ // newValue - the replacement value
52
+ // callerFilePath - absolute path of the file containing the import
53
+ // project - the shared ASTSourceUpdater Project instance
54
54
  // ═══════════════════════════════════════════════════════════════════
55
55
  const DEPTH_GUARD = 3;
56
56
  class CrossFileHealer {
@@ -91,7 +91,7 @@ class CrossFileHealer {
91
91
  if (!traceResult.found) {
92
92
  // Follow re-export chains (barrel files).
93
93
  if (traceResult.crossFile) {
94
- console.log(`[CrossFileHealer] 🔄 "${symbolName}" re-exported from "${traceResult.modulePath}" following chain`);
94
+ console.log(`[CrossFileHealer] 🔄 "${symbolName}" re-exported from "${traceResult.modulePath}" - following chain`);
95
95
  return CrossFileHealer.heal(traceResult.modulePath, traceResult.symbolName, newValue, externalPath, project, depth + 1);
96
96
  }
97
97
  return {
@@ -3,7 +3,7 @@ export type TraceResult = {
3
3
  found: true;
4
4
  targetNode: Node;
5
5
  targetFile: SourceFile;
6
- /** The enclosing VariableDeclaration or PropertyAssignment used by BlastRadiusAnalyzer. */
6
+ /** The enclosing VariableDeclaration or PropertyAssignment - used by BlastRadiusAnalyzer. */
7
7
  declarationNode?: Node;
8
8
  } | {
9
9
  found: false;
@@ -1 +1 @@
1
- {"version":3,"file":"DefinitionTracer.d.ts","sourceRoot":"","sources":["../../src/services/DefinitionTracer.ts"],"names":[],"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AAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAcxC,qBAAa,gBAAgB;IAK3B,MAAM,CAAC,eAAe,CACpB,cAAc,EAAE,IAAI,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,MAAM,EAClB,KAAK,SAAI,GACR,WAAW;IA0Fd,MAAM,CAAC,mBAAmB,CACxB,cAAc,EAAE,IAAI,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,MAAM,GACjB,WAAW;IA+Ed,MAAM,CAAC,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,WAAW;CAkC5E;AASD,qBAAa,wBAAwB;IACnC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,GAAG,kBAAkB;CAmF3E"}
@@ -5,8 +5,8 @@ const ts_morph_1 = require("ts-morph");
5
5
  // ═══════════════════════════════════════════════════════════════════
6
6
  // DefinitionTracer
7
7
  //
8
- // T-5: traceIdentifier follow bare variable name to its initializer.
9
- // T-6: tracePropertyAccess follow OBJECT.prop to the property value.
8
+ // T-5: traceIdentifier - follow bare variable name to its initializer.
9
+ // T-6: tracePropertyAccess - follow OBJECT.prop to the property value.
10
10
  //
11
11
  // In-file first; signals crossFile when symbol comes from an import.
12
12
  // Never does I/O beyond what ts-morph provides on the given SourceFile.
@@ -42,9 +42,14 @@ class DefinitionTracer {
42
42
  }
43
43
  console.log(`[DefinitionTracer] ✅ traceIdentifier: "${symbolName}" → ` +
44
44
  `${init.getKindName()} @ ${sourceFile.getBaseName()}:${init.getStartLineNumber()}`);
45
- return { found: true, targetNode: init, targetFile: sourceFile, declarationNode: decl };
45
+ return {
46
+ found: true,
47
+ targetNode: init,
48
+ targetFile: sourceFile,
49
+ declarationNode: decl,
50
+ };
46
51
  }
47
- // 2. Symbol not in file check import declarations.
52
+ // 2. Symbol not in file - check import declarations.
48
53
  const imported = findImportedSymbol(sourceFile, symbolName);
49
54
  if (imported) {
50
55
  console.log(`[DefinitionTracer] 🌐 traceIdentifier: "${symbolName}" comes from "${imported.modulePath}" (cross-file)`);
@@ -71,7 +76,7 @@ class DefinitionTracer {
71
76
  }
72
77
  }
73
78
  catch {
74
- // Language service unavailable not an error.
79
+ // Language service unavailable - not an error.
75
80
  }
76
81
  return {
77
82
  found: false,
@@ -115,7 +120,7 @@ class DefinitionTracer {
115
120
  reason: `"${objectName}" initializer is not an ObjectLiteralExpression (got ${init?.getKindName() ?? "none"})`,
116
121
  };
117
122
  }
118
- // ts-morph getProperty(name) returns the first matching property.
123
+ // ts-morph getProperty(name) - returns the first matching property.
119
124
  const prop = init.getProperty(propName);
120
125
  if (!prop || !ts_morph_1.Node.isPropertyAssignment(prop)) {
121
126
  return {
@@ -135,10 +140,15 @@ class DefinitionTracer {
135
140
  console.log(`[DefinitionTracer] ✅ tracePropertyAccess: "${objectName}.${propName}" → ` +
136
141
  `${valueNode.getKindName()} "${valueNode.getText()}" ` +
137
142
  `@ ${sourceFile.getBaseName()}:${valueNode.getStartLineNumber()}`);
138
- return { found: true, targetNode: valueNode, targetFile: sourceFile, declarationNode: prop };
143
+ return {
144
+ found: true,
145
+ targetNode: valueNode,
146
+ targetFile: sourceFile,
147
+ declarationNode: prop,
148
+ };
139
149
  }
140
150
  // ─────────────────────────────────────────────────────────────────
141
- // traceByName used by CrossFileHealer
151
+ // traceByName - used by CrossFileHealer
142
152
  //
143
153
  // Like traceIdentifier but takes a plain symbol name string instead
144
154
  // of an Identifier node. Searches the entire file (no callerLine
@@ -166,7 +176,12 @@ class DefinitionTracer {
166
176
  }
167
177
  console.log(`[DefinitionTracer] ✅ traceByName: "${symbolName}" → ` +
168
178
  `${init.getKindName()} @ ${sourceFile.getBaseName()}:${init.getStartLineNumber()}`);
169
- return { found: true, targetNode: init, targetFile: sourceFile, declarationNode: decl };
179
+ return {
180
+ found: true,
181
+ targetNode: init,
182
+ targetFile: sourceFile,
183
+ declarationNode: decl,
184
+ };
170
185
  }
171
186
  }
172
187
  exports.DefinitionTracer = DefinitionTracer;
@@ -241,7 +256,7 @@ class FunctionalReturnAnalyzer {
241
256
  }
242
257
  return {
243
258
  kind: "complex",
244
- reason: `"${calleeName}" return expression is ${returnExpr.getKindName()} not directly healable`,
259
+ reason: `"${calleeName}" return expression is ${returnExpr.getKindName()} - not directly healable`,
245
260
  };
246
261
  }
247
262
  }
@@ -316,7 +331,7 @@ function findFunctionBody(sourceFile, fnName) {
316
331
  const arrow = init;
317
332
  const params = arrow.getParameters().map((p) => p.getName());
318
333
  const body = arrow.getBody();
319
- // Concise body: (role) => `...` body IS the return expression.
334
+ // Concise body: (role) => `...` - body IS the return expression.
320
335
  if (!ts_morph_1.Node.isBlock(body)) {
321
336
  return { returnExpr: body, params, line: decl.getStartLineNumber() };
322
337
  }
@@ -338,13 +353,13 @@ function findFunctionBody(sourceFile, fnName) {
338
353
  return null;
339
354
  }
340
355
  function extractReturnExpression(body) {
341
- // Concise arrow body the node itself is the return value.
356
+ // Concise arrow body - the node itself is the return value.
342
357
  if (!ts_morph_1.Node.isBlock(body))
343
358
  return body;
344
359
  // Block body: search for ReturnStatement.
345
360
  const returnStmts = body.getDescendantsOfKind(ts_morph_1.SyntaxKind.ReturnStatement);
346
361
  if (returnStmts.length === 0)
347
362
  return null;
348
- // Use the first one for conditional returns we signal COMPLEX upstream.
363
+ // Use the first one - for conditional returns we signal COMPLEX upstream.
349
364
  return returnStmts[0].getExpression() ?? null;
350
365
  }
@@ -1,4 +1,4 @@
1
- import type { ElementSnapshotV2 } from '../types/index.js';
1
+ import type { ElementSnapshotV2 } from "../types/index.js";
2
2
  export interface ValidationResult {
3
3
  valid: boolean;
4
4
  errors: string[];
@@ -9,7 +9,7 @@ export interface DnaSnapshotExtended extends ElementSnapshotV2 {
9
9
  sourceFile?: string;
10
10
  sourceLine?: number;
11
11
  lastHealed?: string | null;
12
- status?: 'healed' | 'broken';
12
+ status?: "healed" | "broken";
13
13
  originalSelector?: string;
14
14
  healedSelector?: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