@yasserkhanorg/e2e-agents 1.7.6 → 1.7.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.
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/agent/git.ts"],"names":[],"mappings":"AAkHA,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,kLAAkL;IAClL,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,YAAY,GAAG,QAAQ,CAAC;CAC1C;AAED,MAAM,WAAW,gBAAgB;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AA8CD,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,eAAe,CA0D3G"}
1
+ {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/agent/git.ts"],"names":[],"mappings":"AAkHA,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,kLAAkL;IAClL,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,YAAY,GAAG,QAAQ,CAAC;CAC1C;AAED,MAAM,WAAW,gBAAgB;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAiFD,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,eAAe,CA8D3G"}
package/dist/agent/git.js CHANGED
@@ -146,6 +146,38 @@ function parseStatusLines(lines) {
146
146
  }
147
147
  return files;
148
148
  }
149
+ // Comment-line patterns by file extension.
150
+ // A diff that ONLY touches these lines is a comment-only change (typo fix, doc update).
151
+ const COMMENT_PATTERNS = [
152
+ { extensions: ['.go'], pattern: /^\s*(\/\/|\/\*|\*)/ },
153
+ { extensions: ['.ts', '.tsx', '.js', '.jsx'], pattern: /^\s*(\/\/|\/\*|\*|\*\/)/ },
154
+ { extensions: ['.py'], pattern: /^\s*#/ },
155
+ { extensions: ['.css', '.scss'], pattern: /^\s*(\/\*|\*|\*\/)/ },
156
+ ];
157
+ /**
158
+ * Check if a file's diff only changes comment lines (no code changes).
159
+ * Returns true if the diff is comment-only and can be safely excluded.
160
+ */
161
+ function isCommentOnlyDiff(file, repoRoot, baseRef) {
162
+ const diff = runGitRaw(['diff', `${baseRef}..HEAD`, '-U0', '--', file], repoRoot);
163
+ if (!diff)
164
+ return false;
165
+ const ext = file.slice(file.lastIndexOf('.'));
166
+ const commentEntry = COMMENT_PATTERNS.find((cp) => cp.extensions.includes(ext));
167
+ if (!commentEntry)
168
+ return false;
169
+ // Extract only added/removed content lines (skip diff headers)
170
+ const contentLines = diff
171
+ .split('\n')
172
+ .filter((line) => (line.startsWith('+') || line.startsWith('-')) && !line.startsWith('+++') && !line.startsWith('---'));
173
+ if (contentLines.length === 0)
174
+ return false;
175
+ // Every changed line must be a comment line
176
+ return contentLines.every((line) => {
177
+ const content = line.slice(1).trim(); // Remove +/- prefix
178
+ return content === '' || commentEntry.pattern.test(content);
179
+ });
180
+ }
149
181
  function getChangedFiles(appRoot, since, options) {
150
182
  try {
151
183
  const files = new Set();
@@ -186,6 +218,10 @@ function getChangedFiles(appRoot, since, options) {
186
218
  const filteredTestFiles = [];
187
219
  for (const f of allFiles) {
188
220
  if (isRelevantFile(f)) {
221
+ // Skip files where the diff only touches comments (typo fixes, doc updates)
222
+ if (isCommentOnlyDiff(f, repoRoot, baseRef)) {
223
+ continue;
224
+ }
189
225
  relevant.push(f);
190
226
  }
191
227
  else {
@@ -143,6 +143,38 @@ function parseStatusLines(lines) {
143
143
  }
144
144
  return files;
145
145
  }
146
+ // Comment-line patterns by file extension.
147
+ // A diff that ONLY touches these lines is a comment-only change (typo fix, doc update).
148
+ const COMMENT_PATTERNS = [
149
+ { extensions: ['.go'], pattern: /^\s*(\/\/|\/\*|\*)/ },
150
+ { extensions: ['.ts', '.tsx', '.js', '.jsx'], pattern: /^\s*(\/\/|\/\*|\*|\*\/)/ },
151
+ { extensions: ['.py'], pattern: /^\s*#/ },
152
+ { extensions: ['.css', '.scss'], pattern: /^\s*(\/\*|\*|\*\/)/ },
153
+ ];
154
+ /**
155
+ * Check if a file's diff only changes comment lines (no code changes).
156
+ * Returns true if the diff is comment-only and can be safely excluded.
157
+ */
158
+ function isCommentOnlyDiff(file, repoRoot, baseRef) {
159
+ const diff = runGitRaw(['diff', `${baseRef}..HEAD`, '-U0', '--', file], repoRoot);
160
+ if (!diff)
161
+ return false;
162
+ const ext = file.slice(file.lastIndexOf('.'));
163
+ const commentEntry = COMMENT_PATTERNS.find((cp) => cp.extensions.includes(ext));
164
+ if (!commentEntry)
165
+ return false;
166
+ // Extract only added/removed content lines (skip diff headers)
167
+ const contentLines = diff
168
+ .split('\n')
169
+ .filter((line) => (line.startsWith('+') || line.startsWith('-')) && !line.startsWith('+++') && !line.startsWith('---'));
170
+ if (contentLines.length === 0)
171
+ return false;
172
+ // Every changed line must be a comment line
173
+ return contentLines.every((line) => {
174
+ const content = line.slice(1).trim(); // Remove +/- prefix
175
+ return content === '' || commentEntry.pattern.test(content);
176
+ });
177
+ }
146
178
  export function getChangedFiles(appRoot, since, options) {
147
179
  try {
148
180
  const files = new Set();
@@ -183,6 +215,10 @@ export function getChangedFiles(appRoot, since, options) {
183
215
  const filteredTestFiles = [];
184
216
  for (const f of allFiles) {
185
217
  if (isRelevantFile(f)) {
218
+ // Skip files where the diff only touches comments (typo fixes, doc updates)
219
+ if (isCommentOnlyDiff(f, repoRoot, baseRef)) {
220
+ continue;
221
+ }
186
222
  relevant.push(f);
187
223
  }
188
224
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yasserkhanorg/e2e-agents",
3
- "version": "1.7.6",
3
+ "version": "1.7.7",
4
4
  "description": "AI-powered E2E test impact analysis, generation, and healing. Analyzes code changes to identify affected Playwright tests, detects coverage gaps, and generates or repairs specs using pluggable LLM providers (Claude, OpenAI, Ollama). Includes MCP server, traceability, and CI/CD integration.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",