@bugzy-ai/bugzy 1.18.0 → 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.
Files changed (59) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +273 -273
  3. package/dist/cli/index.cjs +227 -5
  4. package/dist/cli/index.cjs.map +1 -1
  5. package/dist/cli/index.js +226 -4
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/index.cjs +214 -2
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.js +214 -2
  10. package/dist/index.js.map +1 -1
  11. package/dist/subagents/index.cjs.map +1 -1
  12. package/dist/subagents/index.js.map +1 -1
  13. package/dist/subagents/metadata.cjs.map +1 -1
  14. package/dist/subagents/metadata.js.map +1 -1
  15. package/dist/tasks/index.cjs +130 -2
  16. package/dist/tasks/index.cjs.map +1 -1
  17. package/dist/tasks/index.d.cts +1 -0
  18. package/dist/tasks/index.d.ts +1 -0
  19. package/dist/tasks/index.js +130 -2
  20. package/dist/tasks/index.js.map +1 -1
  21. package/package.json +95 -95
  22. package/templates/init/.bugzy/runtime/handlers/messages/feedback.md +178 -178
  23. package/templates/init/.bugzy/runtime/handlers/messages/question.md +122 -122
  24. package/templates/init/.bugzy/runtime/handlers/messages/status.md +146 -146
  25. package/templates/init/.bugzy/runtime/knowledge-base.md +61 -61
  26. package/templates/init/.bugzy/runtime/knowledge-maintenance-guide.md +97 -97
  27. package/templates/init/.bugzy/runtime/project-context.md +35 -35
  28. package/templates/init/.bugzy/runtime/subagent-memory-guide.md +87 -87
  29. package/templates/init/.bugzy/runtime/templates/event-examples.md +194 -194
  30. package/templates/init/.bugzy/runtime/templates/test-plan-template.md +50 -50
  31. package/templates/init/.bugzy/runtime/templates/test-result-schema.md +498 -498
  32. package/templates/init/.claude/settings.json +28 -28
  33. package/templates/init/.env.testdata +18 -18
  34. package/templates/init/.gitignore-template +24 -24
  35. package/templates/init/AGENTS.md +155 -155
  36. package/templates/init/CLAUDE.md +157 -157
  37. package/templates/init/test-runs/README.md +45 -45
  38. package/templates/init/tests/CLAUDE.md +193 -193
  39. package/templates/init/tests/docs/test-execution-strategy.md +535 -535
  40. package/templates/init/tests/docs/testing-best-practices.md +724 -724
  41. package/templates/playwright/BasePage.template.ts +190 -190
  42. package/templates/playwright/auth.setup.template.ts +89 -89
  43. package/templates/playwright/dataGenerators.helper.template.ts +148 -148
  44. package/templates/playwright/dateUtils.helper.template.ts +96 -96
  45. package/templates/playwright/pages.fixture.template.ts +50 -50
  46. package/templates/playwright/playwright.config.template.ts +97 -97
  47. package/templates/playwright/reporters/__tests__/bugzy-reporter-failure-classification.test.ts +299 -299
  48. package/templates/playwright/reporters/__tests__/bugzy-reporter-manifest-merge.test.ts +329 -329
  49. package/templates/playwright/reporters/__tests__/playwright.config.ts +5 -5
  50. package/templates/playwright/reporters/bugzy-reporter.ts +784 -784
  51. package/dist/templates/init/.bugzy/runtime/knowledge-base.md +0 -61
  52. package/dist/templates/init/.bugzy/runtime/knowledge-maintenance-guide.md +0 -97
  53. package/dist/templates/init/.bugzy/runtime/project-context.md +0 -35
  54. package/dist/templates/init/.bugzy/runtime/subagent-memory-guide.md +0 -87
  55. package/dist/templates/init/.bugzy/runtime/templates/test-plan-template.md +0 -50
  56. package/dist/templates/init/.bugzy/runtime/templates/test-result-schema.md +0 -498
  57. package/dist/templates/init/.bugzy/runtime/test-execution-strategy.md +0 -535
  58. package/dist/templates/init/.bugzy/runtime/testing-best-practices.md +0 -632
  59. package/dist/templates/init/.gitignore-template +0 -25
@@ -17,6 +17,7 @@ var TASK_SLUGS = {
17
17
  RUN_TESTS: "run-tests",
18
18
  VERIFY_CHANGES: "verify-changes",
19
19
  TRIAGE_RESULTS: "triage-results",
20
+ EXPLORE_TEST_CODEBASE: "explore-test-codebase",
20
21
  /** @deprecated Use ONBOARD_TESTING instead */
21
22
  FULL_TEST_COVERAGE: "onboard-testing"
22
23
  };
@@ -689,7 +690,29 @@ Read \`.bugzy/runtime/memory/event-history.md\` to:
689
690
  - List \`./test-cases/\` for existing tests
690
691
  - Check \`.bugzy/runtime/knowledge-base.md\` for past insights
691
692
 
692
- #### 2.4 Event-Action Reference Patterns
693
+ #### 2.4 Knowledge Base: Drafted vs Real Tests (BYOT)
694
+
695
+ When the project uses an external test repository, maintain two sections in \`.bugzy/runtime/knowledge-base.md\`:
696
+
697
+ **Drafted Tests** (Open PRs \u2014 tests not yet merged):
698
+ \`\`\`markdown
699
+ ### Drafted Tests
700
+ | PR | Branch | Tests Added | Status | Date |
701
+ |----|--------|-------------|--------|------|
702
+ | #12 | bugzy/verify-changes-a1b2c3d4 | login.spec.ts, checkout.spec.ts | Open | 2026-02-13 |
703
+ \`\`\`
704
+
705
+ **Active Tests** (Merged \u2014 tests are part of the test suite):
706
+ \`\`\`markdown
707
+ ### Active Tests
708
+ | File | What it tests | Source PR | Merged |
709
+ |------|---------------|-----------|--------|
710
+ | login.spec.ts | Login flow with valid/invalid credentials | #12 | 2026-02-13 |
711
+ \`\`\`
712
+
713
+ Move entries from Drafted \u2192 Active Tests when PRs are merged. Remove entries when PRs are closed without merge.
714
+
715
+ #### 2.5 Event-Action Reference Patterns
693
716
 
694
717
  Use these as reference patterns for common events. The webhook routing system already handles events with specific default tasks (e.g., deployment_status \u2192 /run-tests). Process-event receives events that need analysis.
695
718
 
@@ -708,6 +731,23 @@ Use these as reference patterns for common events. The webhook routing system al
708
731
  - **QA-relevant content found**: Propose appropriate follow-up tasks (e.g., \`/generate-test-cases\`, \`/verify-changes\`)
709
732
  - **No QA content** (HR meeting, offsite planning, etc.): Skip \u2014 log to event history only
710
733
 
734
+ **External Test Repo Events** (BYOT - events from the customer's external test repository):
735
+ - **PR opened by Bugzy** (\`com.github.external_repo.pull_request\`, \`action: "opened"\`, branch starts with \`bugzy/\`):
736
+ Log to Knowledge Base under "Drafted Tests". No action task needed \u2014 just record the PR number, branch, and what tests were added.
737
+ - **PR review submitted** (\`com.github.external_repo.pull_request_review\`):
738
+ If changes were requested \u2192 queue \`/verify-changes\` with \`{"existingPrBranch": "{head.ref}", "context": "PR review feedback: {review.body}"}\`.
739
+ The execution will iterate on the existing branch, push fixes, and skip PR creation.
740
+ - **PR comment** (\`com.github.external_repo.pull_request_comment\`):
741
+ Read the comment. If it contains actionable feedback, queue \`/verify-changes\`
742
+ with \`{"existingPrBranch": "{issue.pull_request.head.ref}"}\`.
743
+ - **PR merged** (\`com.github.external_repo.pull_request\`, \`action: "closed"\`, \`merged: true\`):
744
+ Update Knowledge Base: move entries from "Drafted Tests" to "Active Tests". Notify team of new test coverage.
745
+ The submodule pointer update happens automatically via the container (\`updateSubmoduleToLatest\`).
746
+ - **PR closed without merge** (\`com.github.external_repo.pull_request\`, \`action: "closed"\`, \`merged: false\`):
747
+ Remove from Knowledge Base "Drafted Tests". Notify team that tests were rejected.
748
+ - **Direct push to main** (\`com.github.external_repo.push\`, ref is main/master):
749
+ Update Knowledge Base if test files were affected. Submodule pointer update is automatic.
750
+
711
751
  **Other Events:**
712
752
  - Analyze for QA relevance based on knowledge base and project context
713
753
  - If action needed, propose appropriate task. If not, log and skip.
@@ -1867,6 +1907,93 @@ Output this JSON as the final result of the task.`
1867
1907
  dependentTasks: []
1868
1908
  };
1869
1909
 
1910
+ // src/tasks/library/explore-test-codebase.ts
1911
+ var exploreTestCodebaseTask = {
1912
+ slug: TASK_SLUGS.EXPLORE_TEST_CODEBASE,
1913
+ name: "Explore Test Codebase",
1914
+ description: "Analyze external test repository to understand framework, coverage, and conventions",
1915
+ frontmatter: {
1916
+ description: "Analyze external test codebase for BYOT onboarding",
1917
+ "argument-hint": "--focus [area]"
1918
+ },
1919
+ steps: [
1920
+ // Step 1: Overview (inline)
1921
+ {
1922
+ inline: true,
1923
+ title: "Explore Test Codebase Overview",
1924
+ 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.`
1925
+ },
1926
+ // Step 2: Security Notice
1927
+ "security-notice",
1928
+ // Step 3: Arguments (inline)
1929
+ {
1930
+ inline: true,
1931
+ title: "Arguments",
1932
+ content: `**Arguments**: $ARGUMENTS
1933
+
1934
+ **Parse:**
1935
+ - **focus**: specific area to analyze (default: comprehensive)`
1936
+ },
1937
+ // Setup
1938
+ "load-project-context",
1939
+ "read-knowledge-base",
1940
+ // Core analysis
1941
+ "analyze-test-codebase",
1942
+ // Generate results parser for normalizing test output
1943
+ "create-results-parser",
1944
+ // Optional: explore the app itself if URL is available
1945
+ {
1946
+ inline: true,
1947
+ title: "App Exploration (Optional)",
1948
+ 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:
1949
+
1950
+ 1. Navigate to the app URL
1951
+ 2. Identify main navigation and key pages
1952
+ 3. Map discovered features to test coverage from the codebase analysis
1953
+ 4. Note any features that appear untested
1954
+
1955
+ This step helps correlate what the tests cover with what the application actually contains. Skip if no app URL is available.`,
1956
+ conditionalOnSubagent: "browser-automation"
1957
+ },
1958
+ // Generate output
1959
+ {
1960
+ inline: true,
1961
+ title: "Commit Analysis Results",
1962
+ content: `Commit all analysis artifacts to the project repository:
1963
+
1964
+ 1. The test codebase analysis report (\`.bugzy/runtime/test-codebase-analysis.md\`)
1965
+ 2. Any generated CLAUDE.md draft (if the external repo was missing one)
1966
+
1967
+ Use a clear commit message: "chore: analyze external test codebase"
1968
+
1969
+ These artifacts will be available to all future task executions for this project.`
1970
+ },
1971
+ // Team Communication (conditional)
1972
+ {
1973
+ inline: true,
1974
+ title: "Team Communication",
1975
+ content: `{{INVOKE_TEAM_COMMUNICATOR}} to notify the team about the test codebase analysis:
1976
+
1977
+ \`\`\`
1978
+ 1. Post a summary of the analysis findings
1979
+ 2. Include key information:
1980
+ - Test framework and runner identified
1981
+ - Number of test files and estimated test cases
1982
+ - Feature areas covered by existing tests
1983
+ - Any gaps or areas without test coverage
1984
+ 3. Ask if the analysis looks accurate
1985
+ 4. Use appropriate channel and threading
1986
+ \`\`\``,
1987
+ conditionalOnSubagent: "team-communicator"
1988
+ },
1989
+ // Maintenance
1990
+ "update-knowledge-base"
1991
+ ],
1992
+ requiredSubagents: ["browser-automation"],
1993
+ optionalSubagents: ["team-communicator"],
1994
+ dependentTasks: []
1995
+ };
1996
+
1870
1997
  // src/tasks/index.ts
1871
1998
  var TASK_TEMPLATES = {
1872
1999
  [TASK_SLUGS.GENERATE_TEST_CASES]: generateTestCasesTask,
@@ -1877,7 +2004,8 @@ var TASK_TEMPLATES = {
1877
2004
  [TASK_SLUGS.VERIFY_CHANGES]: verifyChangesTask,
1878
2005
  [TASK_SLUGS.ONBOARD_TESTING]: onboardTestingTask,
1879
2006
  [TASK_SLUGS.EXPLORE_APPLICATION]: exploreApplicationTask,
1880
- [TASK_SLUGS.TRIAGE_RESULTS]: triageResultsTask
2007
+ [TASK_SLUGS.TRIAGE_RESULTS]: triageResultsTask,
2008
+ [TASK_SLUGS.EXPLORE_TEST_CODEBASE]: exploreTestCodebaseTask
1881
2009
  };
1882
2010
  function getTaskTemplate(slug) {
1883
2011
  return TASK_TEMPLATES[slug];