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