@bugzy-ai/bugzy 1.18.1 → 1.18.3

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/index.js CHANGED
@@ -221,6 +221,7 @@ var TASK_SLUGS = {
221
221
  RUN_TESTS: "run-tests",
222
222
  VERIFY_CHANGES: "verify-changes",
223
223
  TRIAGE_RESULTS: "triage-results",
224
+ EXPLORE_TEST_CODEBASE: "explore-test-codebase",
224
225
  /** @deprecated Use ONBOARD_TESTING instead */
225
226
  FULL_TEST_COVERAGE: "onboard-testing"
226
227
  };
@@ -2110,6 +2111,95 @@ Output this JSON as the final result of the task.`
2110
2111
  dependentTasks: []
2111
2112
  };
2112
2113
 
2114
+ // src/tasks/library/explore-test-codebase.ts
2115
+ var exploreTestCodebaseTask = {
2116
+ slug: TASK_SLUGS.EXPLORE_TEST_CODEBASE,
2117
+ name: "Explore Test Codebase",
2118
+ description: "Analyze external test repository to understand framework, coverage, and conventions",
2119
+ frontmatter: {
2120
+ description: "Analyze external test codebase for BYOT onboarding",
2121
+ "argument-hint": "--focus [area]"
2122
+ },
2123
+ steps: [
2124
+ // Step 1: Overview (inline)
2125
+ {
2126
+ inline: true,
2127
+ title: "Explore Test Codebase Overview",
2128
+ content: `Analyze the external test repository to understand the testing framework, test coverage, conventions, and codebase structure. This task is triggered during BYOT (Bring Your Own Tests) onboarding to help Bugzy understand the customer's existing test suite.`
2129
+ },
2130
+ // Step 2: Security Notice
2131
+ "security-notice",
2132
+ // Step 3: Arguments (inline)
2133
+ {
2134
+ inline: true,
2135
+ title: "Arguments",
2136
+ content: `**Arguments**: $ARGUMENTS
2137
+
2138
+ **Parse:**
2139
+ - **focus**: specific area to analyze (default: comprehensive)`
2140
+ },
2141
+ // Setup
2142
+ "load-project-context",
2143
+ "read-knowledge-base",
2144
+ // Core analysis
2145
+ "analyze-test-codebase",
2146
+ // Generate results parser for normalizing test output
2147
+ "create-results-parser",
2148
+ // Optional: explore the app itself if URL is available
2149
+ {
2150
+ inline: true,
2151
+ title: "App Exploration (Optional)",
2152
+ content: `If the project has an app URL configured (check \`.bugzy/runtime/project-context.md\` or env vars for TEST_APP_HOST), {{INVOKE_BROWSER_AUTOMATION}} to briefly explore the application:
2153
+
2154
+ 1. Navigate to the app URL
2155
+ 2. Identify main navigation and key pages
2156
+ 3. Map discovered features to test coverage from the codebase analysis
2157
+ 4. Note any features that appear untested
2158
+
2159
+ This step helps correlate what the tests cover with what the application actually contains. Skip if no app URL is available.`,
2160
+ conditionalOnSubagent: "browser-automation"
2161
+ },
2162
+ // Generate output
2163
+ {
2164
+ inline: true,
2165
+ title: "Commit Analysis Results",
2166
+ content: `Commit analysis artifacts to the **parent project repository** (the workspace root).
2167
+
2168
+ **IMPORTANT \u2014 Do NOT stage the \`tests\` submodule.** The \`tests/\` directory is an external git submodule. Any changes made inside it (e.g., \`reporters/parse-results.ts\`, \`tests/CLAUDE.md\`) will be committed and pushed to the external repo automatically by the post-execution handler. Staging the submodule in the parent would record a local-only commit SHA that doesn't exist on the remote, causing a broken reference.
2169
+
2170
+ **What to commit in the parent repo:**
2171
+ 1. \`git add .bugzy/\` \u2014 the test codebase analysis report and runtime files
2172
+ 2. Do NOT run \`git add .\` or \`git add tests\` \u2014 this would stage the submodule pointer
2173
+ 3. \`git commit -m "chore: analyze external test codebase"\`
2174
+
2175
+ These artifacts will be available to all future task executions for this project.`
2176
+ },
2177
+ // Team Communication (conditional)
2178
+ {
2179
+ inline: true,
2180
+ title: "Team Communication",
2181
+ content: `{{INVOKE_TEAM_COMMUNICATOR}} to notify the team about the test codebase analysis:
2182
+
2183
+ \`\`\`
2184
+ 1. Post a summary of the analysis findings
2185
+ 2. Include key information:
2186
+ - Test framework and runner identified
2187
+ - Number of test files and estimated test cases
2188
+ - Feature areas covered by existing tests
2189
+ - Any gaps or areas without test coverage
2190
+ 3. Ask if the analysis looks accurate
2191
+ 4. Use appropriate channel and threading
2192
+ \`\`\``,
2193
+ conditionalOnSubagent: "team-communicator"
2194
+ },
2195
+ // Maintenance
2196
+ "update-knowledge-base"
2197
+ ],
2198
+ requiredSubagents: ["browser-automation"],
2199
+ optionalSubagents: ["team-communicator"],
2200
+ dependentTasks: []
2201
+ };
2202
+
2113
2203
  // src/tasks/index.ts
2114
2204
  var TASK_TEMPLATES = {
2115
2205
  [TASK_SLUGS.GENERATE_TEST_CASES]: generateTestCasesTask,
@@ -2120,7 +2210,8 @@ var TASK_TEMPLATES = {
2120
2210
  [TASK_SLUGS.VERIFY_CHANGES]: verifyChangesTask,
2121
2211
  [TASK_SLUGS.ONBOARD_TESTING]: onboardTestingTask,
2122
2212
  [TASK_SLUGS.EXPLORE_APPLICATION]: exploreApplicationTask,
2123
- [TASK_SLUGS.TRIAGE_RESULTS]: triageResultsTask
2213
+ [TASK_SLUGS.TRIAGE_RESULTS]: triageResultsTask,
2214
+ [TASK_SLUGS.EXPLORE_TEST_CODEBASE]: exploreTestCodebaseTask
2124
2215
  };
2125
2216
  function getTaskTemplate(slug) {
2126
2217
  return TASK_TEMPLATES[slug];
@@ -5403,6 +5494,89 @@ Requirements clear? \u2192 YES \u2192 Quick Exploration \u2192 Matches? \u2192 Y
5403
5494
  tags: ["exploration", "protocol", "adaptive"]
5404
5495
  };
5405
5496
 
5497
+ // src/tasks/steps/exploration/analyze-test-codebase.ts
5498
+ var analyzeTestCodebaseStep = {
5499
+ id: "analyze-test-codebase",
5500
+ title: "Analyze Test Codebase",
5501
+ category: "exploration",
5502
+ content: `## Analyze External Test Codebase
5503
+
5504
+ Thoroughly analyze the customer's external test repository to understand their testing framework, conventions, coverage, and codebase structure.
5505
+
5506
+ ### Step 1: Check for CLAUDE.md
5507
+
5508
+ Look for a \`CLAUDE.md\` file in the test repository root (\`./tests/CLAUDE.md\` or \`./CLAUDE.md\`). If it exists, read it to understand the project's documented conventions, setup instructions, and testing patterns.
5509
+
5510
+ ### Step 2: Scan Directory Structure
5511
+
5512
+ Examine the repository structure to understand organization:
5513
+ - List top-level directories and files
5514
+ - Identify test directories (e.g., \`tests/\`, \`__tests__/\`, \`e2e/\`, \`spec/\`, \`cypress/\`)
5515
+ - Note configuration files (e.g., \`playwright.config.ts\`, \`cypress.config.ts\`, \`jest.config.js\`, \`vitest.config.ts\`)
5516
+ - Check \`package.json\` for test scripts and dependencies
5517
+
5518
+ ### Step 3: Identify Test Framework
5519
+
5520
+ Determine the testing framework from configuration files and dependencies:
5521
+ - **Playwright**: \`playwright.config.ts\`, \`@playwright/test\` in dependencies
5522
+ - **Cypress**: \`cypress.config.ts\`, \`cypress\` in dependencies
5523
+ - **Jest**: \`jest.config.js\`, \`jest\` in dependencies
5524
+ - **Vitest**: \`vitest.config.ts\`, \`vitest\` in dependencies
5525
+ - **Other**: Check for \`mocha\`, \`ava\`, \`tap\`, custom runners
5526
+
5527
+ Note the test runner, assertion library, and any additional tooling (e.g., \`msw\`, \`testing-library\`, page objects).
5528
+
5529
+ ### Step 4: Catalog Test Coverage
5530
+
5531
+ Analyze test files to understand what's being tested:
5532
+ - Read test file names and directory organization
5533
+ - Parse \`describe()\` / \`it()\` / \`test()\` blocks to understand test structure
5534
+ - Group tests by feature area (e.g., authentication, checkout, user management)
5535
+ - Count total test files and approximate number of test cases
5536
+ - Note any skipped or pending tests
5537
+
5538
+ ### Step 5: Document Conventions
5539
+
5540
+ Identify testing patterns and conventions:
5541
+ - **Naming patterns**: How test files are named (e.g., \`*.spec.ts\`, \`*.test.ts\`, \`*.e2e.ts\`)
5542
+ - **Page Objects / Fixtures**: Look for page object patterns, custom fixtures, or helper utilities
5543
+ - **Data management**: How test data is handled (fixtures, factories, seeds)
5544
+ - **Environment configuration**: How environments are configured (.env files, config objects)
5545
+ - **CI integration**: Check for CI config files (GitHub Actions, CircleCI, etc.)
5546
+
5547
+ ### Step 6: Generate Summary
5548
+
5549
+ Create a structured summary of findings and commit it to the project repository:
5550
+
5551
+ \`\`\`
5552
+ File: .bugzy/runtime/test-codebase-analysis.md
5553
+
5554
+ Contents:
5555
+ - Framework: [name and version]
5556
+ - Test runner: [runner]
5557
+ - Total test files: [count]
5558
+ - Estimated test cases: [count]
5559
+ - Feature areas covered: [list]
5560
+ - Key conventions: [summary]
5561
+ - Directory structure: [overview]
5562
+ - Notable patterns: [page objects, fixtures, etc.]
5563
+ \`\`\`
5564
+
5565
+ ### Step 7: Generate CLAUDE.md (if missing)
5566
+
5567
+ If the external test repository does NOT have a \`CLAUDE.md\`, generate a framework-appropriate draft based on the analysis findings:
5568
+ - Include discovered framework and runner
5569
+ - Document build/run commands from package.json
5570
+ - Note key conventions discovered
5571
+ - Include directory structure overview
5572
+ - Save as a draft for customer review
5573
+
5574
+ **Important**: Do NOT use the Playwright-specific template \u2014 generate content based on what was actually discovered in the repository.
5575
+
5576
+ Commit the analysis results to the project repo so they are available for future task executions.`,
5577
+ tags: ["exploration", "byot", "analysis"]
5578
+ };
5579
+
5406
5580
  // src/tasks/steps/clarification/clarification-protocol.ts
5407
5581
  var clarificationProtocolStep = {
5408
5582
  id: "clarification-protocol",
@@ -6584,6 +6758,7 @@ var STEP_LIBRARY = {
6584
6758
  "gather-documentation": gatherDocumentationStep,
6585
6759
  // Exploration
6586
6760
  "exploration-protocol": explorationProtocolStep,
6761
+ "analyze-test-codebase": analyzeTestCodebaseStep,
6587
6762
  // Clarification
6588
6763
  "clarification-protocol": clarificationProtocolStep,
6589
6764
  // Execution