@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.
@@ -89,6 +89,7 @@ var init_constants = __esm({
89
89
  RUN_TESTS: "run-tests",
90
90
  VERIFY_CHANGES: "verify-changes",
91
91
  TRIAGE_RESULTS: "triage-results",
92
+ EXPLORE_TEST_CODEBASE: "explore-test-codebase",
92
93
  /** @deprecated Use ONBOARD_TESTING instead */
93
94
  FULL_TEST_COVERAGE: "onboard-testing"
94
95
  };
@@ -2052,6 +2053,103 @@ Output this JSON as the final result of the task.`
2052
2053
  }
2053
2054
  });
2054
2055
 
2056
+ // src/tasks/library/explore-test-codebase.ts
2057
+ var exploreTestCodebaseTask;
2058
+ var init_explore_test_codebase = __esm({
2059
+ "src/tasks/library/explore-test-codebase.ts"() {
2060
+ "use strict";
2061
+ init_cjs_shims();
2062
+ init_constants();
2063
+ exploreTestCodebaseTask = {
2064
+ slug: TASK_SLUGS.EXPLORE_TEST_CODEBASE,
2065
+ name: "Explore Test Codebase",
2066
+ description: "Analyze external test repository to understand framework, coverage, and conventions",
2067
+ frontmatter: {
2068
+ description: "Analyze external test codebase for BYOT onboarding",
2069
+ "argument-hint": "--focus [area]"
2070
+ },
2071
+ steps: [
2072
+ // Step 1: Overview (inline)
2073
+ {
2074
+ inline: true,
2075
+ title: "Explore Test Codebase Overview",
2076
+ 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.`
2077
+ },
2078
+ // Step 2: Security Notice
2079
+ "security-notice",
2080
+ // Step 3: Arguments (inline)
2081
+ {
2082
+ inline: true,
2083
+ title: "Arguments",
2084
+ content: `**Arguments**: $ARGUMENTS
2085
+
2086
+ **Parse:**
2087
+ - **focus**: specific area to analyze (default: comprehensive)`
2088
+ },
2089
+ // Setup
2090
+ "load-project-context",
2091
+ "read-knowledge-base",
2092
+ // Core analysis
2093
+ "analyze-test-codebase",
2094
+ // Generate results parser for normalizing test output
2095
+ "create-results-parser",
2096
+ // Optional: explore the app itself if URL is available
2097
+ {
2098
+ inline: true,
2099
+ title: "App Exploration (Optional)",
2100
+ 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:
2101
+
2102
+ 1. Navigate to the app URL
2103
+ 2. Identify main navigation and key pages
2104
+ 3. Map discovered features to test coverage from the codebase analysis
2105
+ 4. Note any features that appear untested
2106
+
2107
+ This step helps correlate what the tests cover with what the application actually contains. Skip if no app URL is available.`,
2108
+ conditionalOnSubagent: "browser-automation"
2109
+ },
2110
+ // Generate output
2111
+ {
2112
+ inline: true,
2113
+ title: "Commit Analysis Results",
2114
+ content: `Commit analysis artifacts to the **parent project repository** (the workspace root).
2115
+
2116
+ **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.
2117
+
2118
+ **What to commit in the parent repo:**
2119
+ 1. \`git add .bugzy/\` \u2014 the test codebase analysis report and runtime files
2120
+ 2. Do NOT run \`git add .\` or \`git add tests\` \u2014 this would stage the submodule pointer
2121
+ 3. \`git commit -m "chore: analyze external test codebase"\`
2122
+
2123
+ These artifacts will be available to all future task executions for this project.`
2124
+ },
2125
+ // Team Communication (conditional)
2126
+ {
2127
+ inline: true,
2128
+ title: "Team Communication",
2129
+ content: `{{INVOKE_TEAM_COMMUNICATOR}} to notify the team about the test codebase analysis:
2130
+
2131
+ \`\`\`
2132
+ 1. Post a summary of the analysis findings
2133
+ 2. Include key information:
2134
+ - Test framework and runner identified
2135
+ - Number of test files and estimated test cases
2136
+ - Feature areas covered by existing tests
2137
+ - Any gaps or areas without test coverage
2138
+ 3. Ask if the analysis looks accurate
2139
+ 4. Use appropriate channel and threading
2140
+ \`\`\``,
2141
+ conditionalOnSubagent: "team-communicator"
2142
+ },
2143
+ // Maintenance
2144
+ "update-knowledge-base"
2145
+ ],
2146
+ requiredSubagents: ["browser-automation"],
2147
+ optionalSubagents: ["team-communicator"],
2148
+ dependentTasks: []
2149
+ };
2150
+ }
2151
+ });
2152
+
2055
2153
  // src/tasks/index.ts
2056
2154
  var tasks_exports = {};
2057
2155
  __export(tasks_exports, {
@@ -2088,6 +2186,7 @@ var init_tasks = __esm({
2088
2186
  init_onboard_testing();
2089
2187
  init_explore_application();
2090
2188
  init_triage_results();
2189
+ init_explore_test_codebase();
2091
2190
  init_constants();
2092
2191
  TASK_TEMPLATES = {
2093
2192
  [TASK_SLUGS.GENERATE_TEST_CASES]: generateTestCasesTask,
@@ -2098,7 +2197,8 @@ var init_tasks = __esm({
2098
2197
  [TASK_SLUGS.VERIFY_CHANGES]: verifyChangesTask,
2099
2198
  [TASK_SLUGS.ONBOARD_TESTING]: onboardTestingTask,
2100
2199
  [TASK_SLUGS.EXPLORE_APPLICATION]: exploreApplicationTask,
2101
- [TASK_SLUGS.TRIAGE_RESULTS]: triageResultsTask
2200
+ [TASK_SLUGS.TRIAGE_RESULTS]: triageResultsTask,
2201
+ [TASK_SLUGS.EXPLORE_TEST_CODEBASE]: exploreTestCodebaseTask
2102
2202
  };
2103
2203
  }
2104
2204
  });
@@ -5834,6 +5934,90 @@ Requirements clear? \u2192 YES \u2192 Quick Exploration \u2192 Matches? \u2192 Y
5834
5934
  tags: ["exploration", "protocol", "adaptive"]
5835
5935
  };
5836
5936
 
5937
+ // src/tasks/steps/exploration/analyze-test-codebase.ts
5938
+ init_cjs_shims();
5939
+ var analyzeTestCodebaseStep = {
5940
+ id: "analyze-test-codebase",
5941
+ title: "Analyze Test Codebase",
5942
+ category: "exploration",
5943
+ content: `## Analyze External Test Codebase
5944
+
5945
+ Thoroughly analyze the customer's external test repository to understand their testing framework, conventions, coverage, and codebase structure.
5946
+
5947
+ ### Step 1: Check for CLAUDE.md
5948
+
5949
+ 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.
5950
+
5951
+ ### Step 2: Scan Directory Structure
5952
+
5953
+ Examine the repository structure to understand organization:
5954
+ - List top-level directories and files
5955
+ - Identify test directories (e.g., \`tests/\`, \`__tests__/\`, \`e2e/\`, \`spec/\`, \`cypress/\`)
5956
+ - Note configuration files (e.g., \`playwright.config.ts\`, \`cypress.config.ts\`, \`jest.config.js\`, \`vitest.config.ts\`)
5957
+ - Check \`package.json\` for test scripts and dependencies
5958
+
5959
+ ### Step 3: Identify Test Framework
5960
+
5961
+ Determine the testing framework from configuration files and dependencies:
5962
+ - **Playwright**: \`playwright.config.ts\`, \`@playwright/test\` in dependencies
5963
+ - **Cypress**: \`cypress.config.ts\`, \`cypress\` in dependencies
5964
+ - **Jest**: \`jest.config.js\`, \`jest\` in dependencies
5965
+ - **Vitest**: \`vitest.config.ts\`, \`vitest\` in dependencies
5966
+ - **Other**: Check for \`mocha\`, \`ava\`, \`tap\`, custom runners
5967
+
5968
+ Note the test runner, assertion library, and any additional tooling (e.g., \`msw\`, \`testing-library\`, page objects).
5969
+
5970
+ ### Step 4: Catalog Test Coverage
5971
+
5972
+ Analyze test files to understand what's being tested:
5973
+ - Read test file names and directory organization
5974
+ - Parse \`describe()\` / \`it()\` / \`test()\` blocks to understand test structure
5975
+ - Group tests by feature area (e.g., authentication, checkout, user management)
5976
+ - Count total test files and approximate number of test cases
5977
+ - Note any skipped or pending tests
5978
+
5979
+ ### Step 5: Document Conventions
5980
+
5981
+ Identify testing patterns and conventions:
5982
+ - **Naming patterns**: How test files are named (e.g., \`*.spec.ts\`, \`*.test.ts\`, \`*.e2e.ts\`)
5983
+ - **Page Objects / Fixtures**: Look for page object patterns, custom fixtures, or helper utilities
5984
+ - **Data management**: How test data is handled (fixtures, factories, seeds)
5985
+ - **Environment configuration**: How environments are configured (.env files, config objects)
5986
+ - **CI integration**: Check for CI config files (GitHub Actions, CircleCI, etc.)
5987
+
5988
+ ### Step 6: Generate Summary
5989
+
5990
+ Create a structured summary of findings and commit it to the project repository:
5991
+
5992
+ \`\`\`
5993
+ File: .bugzy/runtime/test-codebase-analysis.md
5994
+
5995
+ Contents:
5996
+ - Framework: [name and version]
5997
+ - Test runner: [runner]
5998
+ - Total test files: [count]
5999
+ - Estimated test cases: [count]
6000
+ - Feature areas covered: [list]
6001
+ - Key conventions: [summary]
6002
+ - Directory structure: [overview]
6003
+ - Notable patterns: [page objects, fixtures, etc.]
6004
+ \`\`\`
6005
+
6006
+ ### Step 7: Generate CLAUDE.md (if missing)
6007
+
6008
+ If the external test repository does NOT have a \`CLAUDE.md\`, generate a framework-appropriate draft based on the analysis findings:
6009
+ - Include discovered framework and runner
6010
+ - Document build/run commands from package.json
6011
+ - Note key conventions discovered
6012
+ - Include directory structure overview
6013
+ - Save as a draft for customer review
6014
+
6015
+ **Important**: Do NOT use the Playwright-specific template \u2014 generate content based on what was actually discovered in the repository.
6016
+
6017
+ Commit the analysis results to the project repo so they are available for future task executions.`,
6018
+ tags: ["exploration", "byot", "analysis"]
6019
+ };
6020
+
5837
6021
  // src/tasks/steps/clarification/clarification-protocol.ts
5838
6022
  init_cjs_shims();
5839
6023
  var clarificationProtocolStep = {
@@ -7037,6 +7221,7 @@ var STEP_LIBRARY = {
7037
7221
  "gather-documentation": gatherDocumentationStep,
7038
7222
  // Exploration
7039
7223
  "exploration-protocol": explorationProtocolStep,
7224
+ "analyze-test-codebase": analyzeTestCodebaseStep,
7040
7225
  // Clarification
7041
7226
  "clarification-protocol": clarificationProtocolStep,
7042
7227
  // Execution