@bugzy-ai/bugzy 1.18.1 → 1.18.2
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/cli/index.cjs +184 -1
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +184 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +174 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +174 -1
- package/dist/index.js.map +1 -1
- package/dist/tasks/index.cjs +90 -1
- package/dist/tasks/index.cjs.map +1 -1
- package/dist/tasks/index.d.cts +1 -0
- package/dist/tasks/index.d.ts +1 -0
- package/dist/tasks/index.js +90 -1
- package/dist/tasks/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -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,101 @@ 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 all analysis artifacts to the project repository:
|
|
2115
|
+
|
|
2116
|
+
1. The test codebase analysis report (\`.bugzy/runtime/test-codebase-analysis.md\`)
|
|
2117
|
+
2. Any generated CLAUDE.md draft (if the external repo was missing one)
|
|
2118
|
+
|
|
2119
|
+
Use a clear commit message: "chore: analyze external test codebase"
|
|
2120
|
+
|
|
2121
|
+
These artifacts will be available to all future task executions for this project.`
|
|
2122
|
+
},
|
|
2123
|
+
// Team Communication (conditional)
|
|
2124
|
+
{
|
|
2125
|
+
inline: true,
|
|
2126
|
+
title: "Team Communication",
|
|
2127
|
+
content: `{{INVOKE_TEAM_COMMUNICATOR}} to notify the team about the test codebase analysis:
|
|
2128
|
+
|
|
2129
|
+
\`\`\`
|
|
2130
|
+
1. Post a summary of the analysis findings
|
|
2131
|
+
2. Include key information:
|
|
2132
|
+
- Test framework and runner identified
|
|
2133
|
+
- Number of test files and estimated test cases
|
|
2134
|
+
- Feature areas covered by existing tests
|
|
2135
|
+
- Any gaps or areas without test coverage
|
|
2136
|
+
3. Ask if the analysis looks accurate
|
|
2137
|
+
4. Use appropriate channel and threading
|
|
2138
|
+
\`\`\``,
|
|
2139
|
+
conditionalOnSubagent: "team-communicator"
|
|
2140
|
+
},
|
|
2141
|
+
// Maintenance
|
|
2142
|
+
"update-knowledge-base"
|
|
2143
|
+
],
|
|
2144
|
+
requiredSubagents: ["browser-automation"],
|
|
2145
|
+
optionalSubagents: ["team-communicator"],
|
|
2146
|
+
dependentTasks: []
|
|
2147
|
+
};
|
|
2148
|
+
}
|
|
2149
|
+
});
|
|
2150
|
+
|
|
2055
2151
|
// src/tasks/index.ts
|
|
2056
2152
|
var tasks_exports = {};
|
|
2057
2153
|
__export(tasks_exports, {
|
|
@@ -2088,6 +2184,7 @@ var init_tasks = __esm({
|
|
|
2088
2184
|
init_onboard_testing();
|
|
2089
2185
|
init_explore_application();
|
|
2090
2186
|
init_triage_results();
|
|
2187
|
+
init_explore_test_codebase();
|
|
2091
2188
|
init_constants();
|
|
2092
2189
|
TASK_TEMPLATES = {
|
|
2093
2190
|
[TASK_SLUGS.GENERATE_TEST_CASES]: generateTestCasesTask,
|
|
@@ -2098,7 +2195,8 @@ var init_tasks = __esm({
|
|
|
2098
2195
|
[TASK_SLUGS.VERIFY_CHANGES]: verifyChangesTask,
|
|
2099
2196
|
[TASK_SLUGS.ONBOARD_TESTING]: onboardTestingTask,
|
|
2100
2197
|
[TASK_SLUGS.EXPLORE_APPLICATION]: exploreApplicationTask,
|
|
2101
|
-
[TASK_SLUGS.TRIAGE_RESULTS]: triageResultsTask
|
|
2198
|
+
[TASK_SLUGS.TRIAGE_RESULTS]: triageResultsTask,
|
|
2199
|
+
[TASK_SLUGS.EXPLORE_TEST_CODEBASE]: exploreTestCodebaseTask
|
|
2102
2200
|
};
|
|
2103
2201
|
}
|
|
2104
2202
|
});
|
|
@@ -5834,6 +5932,90 @@ Requirements clear? \u2192 YES \u2192 Quick Exploration \u2192 Matches? \u2192 Y
|
|
|
5834
5932
|
tags: ["exploration", "protocol", "adaptive"]
|
|
5835
5933
|
};
|
|
5836
5934
|
|
|
5935
|
+
// src/tasks/steps/exploration/analyze-test-codebase.ts
|
|
5936
|
+
init_cjs_shims();
|
|
5937
|
+
var analyzeTestCodebaseStep = {
|
|
5938
|
+
id: "analyze-test-codebase",
|
|
5939
|
+
title: "Analyze Test Codebase",
|
|
5940
|
+
category: "exploration",
|
|
5941
|
+
content: `## Analyze External Test Codebase
|
|
5942
|
+
|
|
5943
|
+
Thoroughly analyze the customer's external test repository to understand their testing framework, conventions, coverage, and codebase structure.
|
|
5944
|
+
|
|
5945
|
+
### Step 1: Check for CLAUDE.md
|
|
5946
|
+
|
|
5947
|
+
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.
|
|
5948
|
+
|
|
5949
|
+
### Step 2: Scan Directory Structure
|
|
5950
|
+
|
|
5951
|
+
Examine the repository structure to understand organization:
|
|
5952
|
+
- List top-level directories and files
|
|
5953
|
+
- Identify test directories (e.g., \`tests/\`, \`__tests__/\`, \`e2e/\`, \`spec/\`, \`cypress/\`)
|
|
5954
|
+
- Note configuration files (e.g., \`playwright.config.ts\`, \`cypress.config.ts\`, \`jest.config.js\`, \`vitest.config.ts\`)
|
|
5955
|
+
- Check \`package.json\` for test scripts and dependencies
|
|
5956
|
+
|
|
5957
|
+
### Step 3: Identify Test Framework
|
|
5958
|
+
|
|
5959
|
+
Determine the testing framework from configuration files and dependencies:
|
|
5960
|
+
- **Playwright**: \`playwright.config.ts\`, \`@playwright/test\` in dependencies
|
|
5961
|
+
- **Cypress**: \`cypress.config.ts\`, \`cypress\` in dependencies
|
|
5962
|
+
- **Jest**: \`jest.config.js\`, \`jest\` in dependencies
|
|
5963
|
+
- **Vitest**: \`vitest.config.ts\`, \`vitest\` in dependencies
|
|
5964
|
+
- **Other**: Check for \`mocha\`, \`ava\`, \`tap\`, custom runners
|
|
5965
|
+
|
|
5966
|
+
Note the test runner, assertion library, and any additional tooling (e.g., \`msw\`, \`testing-library\`, page objects).
|
|
5967
|
+
|
|
5968
|
+
### Step 4: Catalog Test Coverage
|
|
5969
|
+
|
|
5970
|
+
Analyze test files to understand what's being tested:
|
|
5971
|
+
- Read test file names and directory organization
|
|
5972
|
+
- Parse \`describe()\` / \`it()\` / \`test()\` blocks to understand test structure
|
|
5973
|
+
- Group tests by feature area (e.g., authentication, checkout, user management)
|
|
5974
|
+
- Count total test files and approximate number of test cases
|
|
5975
|
+
- Note any skipped or pending tests
|
|
5976
|
+
|
|
5977
|
+
### Step 5: Document Conventions
|
|
5978
|
+
|
|
5979
|
+
Identify testing patterns and conventions:
|
|
5980
|
+
- **Naming patterns**: How test files are named (e.g., \`*.spec.ts\`, \`*.test.ts\`, \`*.e2e.ts\`)
|
|
5981
|
+
- **Page Objects / Fixtures**: Look for page object patterns, custom fixtures, or helper utilities
|
|
5982
|
+
- **Data management**: How test data is handled (fixtures, factories, seeds)
|
|
5983
|
+
- **Environment configuration**: How environments are configured (.env files, config objects)
|
|
5984
|
+
- **CI integration**: Check for CI config files (GitHub Actions, CircleCI, etc.)
|
|
5985
|
+
|
|
5986
|
+
### Step 6: Generate Summary
|
|
5987
|
+
|
|
5988
|
+
Create a structured summary of findings and commit it to the project repository:
|
|
5989
|
+
|
|
5990
|
+
\`\`\`
|
|
5991
|
+
File: .bugzy/runtime/test-codebase-analysis.md
|
|
5992
|
+
|
|
5993
|
+
Contents:
|
|
5994
|
+
- Framework: [name and version]
|
|
5995
|
+
- Test runner: [runner]
|
|
5996
|
+
- Total test files: [count]
|
|
5997
|
+
- Estimated test cases: [count]
|
|
5998
|
+
- Feature areas covered: [list]
|
|
5999
|
+
- Key conventions: [summary]
|
|
6000
|
+
- Directory structure: [overview]
|
|
6001
|
+
- Notable patterns: [page objects, fixtures, etc.]
|
|
6002
|
+
\`\`\`
|
|
6003
|
+
|
|
6004
|
+
### Step 7: Generate CLAUDE.md (if missing)
|
|
6005
|
+
|
|
6006
|
+
If the external test repository does NOT have a \`CLAUDE.md\`, generate a framework-appropriate draft based on the analysis findings:
|
|
6007
|
+
- Include discovered framework and runner
|
|
6008
|
+
- Document build/run commands from package.json
|
|
6009
|
+
- Note key conventions discovered
|
|
6010
|
+
- Include directory structure overview
|
|
6011
|
+
- Save as a draft for customer review
|
|
6012
|
+
|
|
6013
|
+
**Important**: Do NOT use the Playwright-specific template \u2014 generate content based on what was actually discovered in the repository.
|
|
6014
|
+
|
|
6015
|
+
Commit the analysis results to the project repo so they are available for future task executions.`,
|
|
6016
|
+
tags: ["exploration", "byot", "analysis"]
|
|
6017
|
+
};
|
|
6018
|
+
|
|
5837
6019
|
// src/tasks/steps/clarification/clarification-protocol.ts
|
|
5838
6020
|
init_cjs_shims();
|
|
5839
6021
|
var clarificationProtocolStep = {
|
|
@@ -7037,6 +7219,7 @@ var STEP_LIBRARY = {
|
|
|
7037
7219
|
"gather-documentation": gatherDocumentationStep,
|
|
7038
7220
|
// Exploration
|
|
7039
7221
|
"exploration-protocol": explorationProtocolStep,
|
|
7222
|
+
"analyze-test-codebase": analyzeTestCodebaseStep,
|
|
7040
7223
|
// Clarification
|
|
7041
7224
|
"clarification-protocol": clarificationProtocolStep,
|
|
7042
7225
|
// Execution
|