@bugzy-ai/bugzy 1.12.1 → 1.12.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/cli/index.js CHANGED
@@ -759,9 +759,9 @@ var init_process_event = __esm({
759
759
  processEventTask = {
760
760
  slug: TASK_SLUGS.PROCESS_EVENT,
761
761
  name: "Process Event",
762
- description: "Process external system events (Jira, GitHub, Linear) using handler-defined rules to extract insights and track issues",
762
+ description: "Process webhook events by analyzing for QA relevance and queuing proposed actions for team confirmation",
763
763
  frontmatter: {
764
- description: "Process external system events (Jira, GitHub, Linear) using handler-defined rules to extract insights and track issues",
764
+ description: "Process webhook events by analyzing for QA relevance and queuing proposed actions for team confirmation",
765
765
  "argument-hint": "[event payload or description]"
766
766
  },
767
767
  steps: [
@@ -771,7 +771,9 @@ var init_process_event = __esm({
771
771
  title: "Process Event Overview",
772
772
  content: `# Process Event Command
773
773
 
774
- Process various types of events using intelligent pattern matching and historical context to maintain and evolve the testing system.`
774
+ Process webhook events from integrated systems by analyzing event content, determining appropriate QA actions, and queuing them for team confirmation.
775
+
776
+ **This task does NOT execute actions directly.** It proposes actions via the blocked-task-queue and notifies the team for confirmation. Only knowledge base updates and event history logging are performed directly.`
775
777
  },
776
778
  // Step 2: Security Notice (library)
777
779
  "security-notice",
@@ -794,7 +796,7 @@ Process various types of events using intelligent pattern matching and historica
794
796
  - **Source Control**: GitHub, GitLab
795
797
  - **Communication Tools**: Slack
796
798
 
797
- **Event structure and semantics vary by source.** Do not interpret events based on generic assumptions. Instead, load the appropriate handler file for system-specific processing rules.
799
+ **Event structure and semantics vary by source.** Use the inline event-action reference patterns and historical context to determine actions.
798
800
 
799
801
  #### Event Context to Extract:
800
802
  - **What happened**: The core event (test failed, PR merged, etc.)
@@ -915,42 +917,30 @@ Read \`.bugzy/runtime/memory/event-history.md\` to:
915
917
  - List \`./test-cases/\` for existing tests
916
918
  - Check \`.bugzy/runtime/knowledge-base.md\` for past insights
917
919
 
918
- #### 2.4 Load System-Specific Handler (REQUIRED)
919
-
920
- Based on the event source, load the handler from \`.bugzy/runtime/handlers/\`:
921
-
922
- **Step 1: Detect Event Source from Payload:**
923
- - \`com.jira-server.*\` event type prefix -> \`.bugzy/runtime/handlers/jira.md\`
924
- - \`com.recall.*\` event type prefix -> \`.bugzy/runtime/handlers/recall.md\`
925
- - \`github.*\` or GitHub webhook structure -> \`.bugzy/runtime/handlers/github.md\`
926
- - \`linear.*\` or Linear webhook -> \`.bugzy/runtime/handlers/linear.md\`
927
- - Other sources -> Check for matching handler file by source name
928
-
929
- **Step 2: Load and Read the Handler File:**
930
- The handler file contains system-specific instructions for:
931
- - Event payload structure and field meanings
932
- - Which triggers (status changes, resolutions) require specific actions
933
- - How to interpret different event types
934
- - When to invoke \`/verify-changes\`
935
- - How to update the knowledge base
936
-
937
- **Step 3: Follow Handler Instructions:**
938
- The handler file is authoritative for this event source. Follow its instructions for:
939
- - Interpreting the event payload
940
- - Determining what actions to take
941
- - Formatting responses and updates
942
-
943
- **Step 4: If No Handler Exists:**
944
- Do NOT guess or apply generic logic. Instead:
945
- 1. Inform the user that no handler exists for this event source
946
- 2. Ask how this event type should be processed
947
- 3. Suggest creating a handler file at \`.bugzy/runtime/handlers/{source}.md\`
948
-
949
- **Project-Specific Configuration:**
950
- Handlers reference \`.bugzy/runtime/project-context.md\` for project-specific rules like:
951
- - Which status transitions trigger verify-changes
952
- - Which resolutions should update the knowledge base
953
- - Which transitions to ignore`
920
+ #### 2.4 Event-Action Reference Patterns
921
+
922
+ 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.
923
+
924
+ **Jira Events:**
925
+ - **Status \u2192 "Ready to Test" / "In Testing" / "Ready for QA"**: Propose \`/verify-changes\` with issue context
926
+ - **Resolution: "Not a Bug" / "Won't Fix" / "User Error"**: Update knowledge base directly with the learning (no queue needed)
927
+ - **Bug created with relevant labels**: Propose \`/generate-test-cases\` to update related test coverage, confirm with team
928
+ - **Backlog \u2192 To Do**: No QA action needed, log to event history only
929
+
930
+ **GitHub Events:**
931
+ - **PR merged (routed to process-event)**: Propose \`/verify-changes\` for the merged changes
932
+ - **Issue closed as "won't fix"**: Update knowledge base directly with the learning
933
+ - **Issue created/updated**: Analyze for QA relevance, propose actions if applicable
934
+
935
+ **Recall.ai Events (Meeting Transcripts):**
936
+ - **QA-relevant content found**: Propose appropriate follow-up tasks (e.g., \`/generate-test-cases\`, \`/verify-changes\`)
937
+ - **No QA content** (HR meeting, offsite planning, etc.): Skip \u2014 log to event history only
938
+
939
+ **Other Events:**
940
+ - Analyze for QA relevance based on knowledge base and project context
941
+ - If action needed, propose appropriate task. If not, log and skip.
942
+
943
+ Check \`.bugzy/runtime/project-context.md\` for project-specific context that may inform action decisions.`
954
944
  },
955
945
  // Step 8: Intelligent Event Analysis (inline)
956
946
  {
@@ -970,17 +960,16 @@ Don't just match patterns - analyze the event within the full context:
970
960
  **Example Contextual Analysis**:
971
961
  \`\`\`
972
962
  Event: Jira issue PROJ-456 moved to "Ready for QA"
973
- + Handler: jira.md says "Ready for QA" triggers /verify-changes
963
+ + Reference Pattern: "Ready for QA" status suggests /verify-changes
974
964
  + History: This issue was previously in "In Progress" for 3 days
975
965
  + Knowledge: Related PR #123 merged yesterday
976
- = Decision: Invoke /verify-changes with issue context and PR reference
966
+ = Decision: Propose /verify-changes with issue context and PR reference
977
967
  \`\`\`
978
968
 
979
969
  **Pattern Recognition with Context**:
980
- - An issue resolution depends on what the handler prescribes for that status
970
+ - An issue resolution depends on the event-action reference patterns and project context
981
971
  - A duplicate event (same issue, same transition) should be skipped
982
972
  - Events from different sources about the same change should be correlated
983
- - Handler instructions take precedence over generic assumptions
984
973
 
985
974
  #### 3.2 Generate Semantic Queries
986
975
  Based on event type and content, generate 3-5 specific search queries:
@@ -1006,7 +995,7 @@ Generate tasks based on event analysis, using examples from memory as reference.
1006
995
  Analyze the event in context of ALL available information to decide what actions to take:
1007
996
 
1008
997
  **Consider the Full Context**:
1009
- - What does the handler prescribe for this event type?
998
+ - What do the event-action reference patterns suggest for this event type?
1010
999
  - How does this relate to current knowledge?
1011
1000
  - What's the state of related issues in external systems?
1012
1001
  - Is this part of a larger pattern we've been seeing?
@@ -1014,17 +1003,17 @@ Analyze the event in context of ALL available information to decide what actions
1014
1003
 
1015
1004
  **Contextual Decision Making**:
1016
1005
  The same event type can require different actions based on context:
1017
- - If handler says this status triggers verification -> Invoke /verify-changes
1006
+ - If reference pattern suggests verification -> Propose /verify-changes (queue for confirmation)
1018
1007
  - If this issue was already processed (check event history) -> Skip to avoid duplicates
1019
- - If related PR exists in knowledge base -> Include PR context in actions
1008
+ - If related PR exists in knowledge base -> Include PR context in proposed actions
1020
1009
  - If this is a recurring pattern from the same source -> Consider flagging for review
1021
- - If handler has no rule for this event type -> Ask user for guidance
1010
+ - If no clear action for this event type -> Analyze context or skip
1022
1011
 
1023
1012
  **Dynamic Task Selection**:
1024
1013
  Based on the contextual analysis, decide which tasks make sense:
1025
1014
  - **extract_learning**: When the event reveals something new about the system
1026
1015
  - **update_test_plan**: When our understanding of what to test has changed
1027
- - **update_test_cases**: When tests need to reflect new reality
1016
+ - **propose_generate_test_cases**: When tests need to reflect new reality (queued for confirmation)
1028
1017
  - **report_bug**: When we have a legitimate, impactful, reproducible issue
1029
1018
  - **skip_action**: When context shows no action needed (e.g., known issue, already fixed)
1030
1019
 
@@ -1066,13 +1055,64 @@ The issue-tracker agent will handle all aspects of issue tracking including dupl
1066
1055
  // Step 12: Execute Tasks (inline)
1067
1056
  {
1068
1057
  inline: true,
1069
- title: "Execute Tasks with Memory Updates",
1070
- content: `### Step 5: Execute Tasks with Memory Updates
1058
+ title: "Queue Proposed Actions and Notify Team",
1059
+ content: `### Step 5: Queue Proposed Actions and Notify Team
1060
+
1061
+ #### 5.1 Categorize Determined Actions
1062
+
1063
+ Separate actions into two categories:
1064
+
1065
+ **Queued Actions** (require team confirmation):
1066
+ - \`/verify-changes\`, \`/generate-test-cases\`, \`/run-tests\`, \`/explore-application\`
1067
+ - Any task that modifies tests, runs automation, or takes significant action
1068
+
1069
+ **Direct Actions** (execute immediately):
1070
+ - Knowledge base updates and learnings
1071
+ - Event history logging
1072
+ - Event processor memory updates
1073
+ - Skip decisions
1074
+
1075
+ #### 5.2 Execute Direct Actions
1076
+
1077
+ Update \`.bugzy/runtime/knowledge-base.md\` directly for learnings (e.g., "Not a Bug" resolutions).
1078
+
1079
+ #### 5.3 Queue Action Tasks
1071
1080
 
1072
- #### 5.1 Execute Each Task
1073
- Follow the standard execution logic with added context from memory.
1081
+ For each proposed action task, append one row to \`.bugzy/runtime/blocked-task-queue.md\`:
1074
1082
 
1075
- #### 5.2 Update Event Processor Memory
1083
+ | Task Slug | Question | Original Args |
1084
+ |-----------|----------|---------------|
1085
+ | /verify-changes | Verify PROJ-456 changes (moved to Ready for QA)? Related PR #123. | \`{"issue": "PROJ-456", "context": "Jira Ready to Test"}\` |
1086
+
1087
+ Rules:
1088
+ 1. Read file first (create if doesn't exist)
1089
+ 2. Each action gets its own row
1090
+ 3. **Question** must be clear and include enough context for team to decide
1091
+ 4. **Original Args** must include event source, IDs, and relevant context as JSON
1092
+
1093
+ #### 5.4 Notify Team
1094
+
1095
+ {{INVOKE_TEAM_COMMUNICATOR}} to share the outcome:
1096
+
1097
+ **If actions were queued:**
1098
+ - What event was processed
1099
+ - What actions are proposed (with brief reasoning)
1100
+ - These are awaiting confirmation
1101
+
1102
+ **If no actions queued (KB-only update or skip):**
1103
+ - What event was processed
1104
+ - What was learned or why it was skipped
1105
+ - That no action is needed from the team
1106
+
1107
+ #### 5.5 Complete Task
1108
+
1109
+ After queuing and notifying, the task is DONE. Do NOT:
1110
+ - Execute /verify-changes, /run-tests, /generate-test-cases directly
1111
+ - Wait for team response (messaging infrastructure handles that)
1112
+ - Create or modify test files
1113
+ - Run Playwright tests
1114
+
1115
+ #### 5.6 Update Event Processor Memory
1076
1116
  If new patterns discovered, append to \`.bugzy/runtime/memory/event-processor.md\`:
1077
1117
  \`\`\`markdown
1078
1118
  ### Pattern: [New Pattern Name]
@@ -1082,7 +1122,7 @@ If new patterns discovered, append to \`.bugzy/runtime/memory/event-processor.md
1082
1122
  **Example**: [This event]
1083
1123
  \`\`\`
1084
1124
 
1085
- #### 5.3 Update Event History
1125
+ #### 5.7 Update Event History
1086
1126
  Append to \`.bugzy/runtime/memory/event-history.md\`:
1087
1127
  \`\`\`markdown
1088
1128
  ## [Timestamp] - Event #[ID]
@@ -1155,7 +1195,8 @@ Create files if they don't exist:
1155
1195
  - Adjust responses based on business priorities and risk
1156
1196
 
1157
1197
  ### Smart Task Generation
1158
- - Only take actions prescribed by the handler or confirmed by the user
1198
+ - NEVER execute action tasks directly \u2014 all action tasks go through blocked-task-queue for team confirmation
1199
+ - Knowledge base updates and event history logging are the only direct operations
1159
1200
  - Document why each decision was made with full context
1160
1201
  - Skip redundant actions (e.g., duplicate events, already-processed issues)
1161
1202
  - Escalate appropriately based on pattern recognition
@@ -1625,6 +1666,19 @@ Create or update test case files in \`./test-cases/\` for the new feature:
1625
1666
  - Include: objective, preconditions, test steps, expected results
1626
1667
  - Mark \`automated: true\` for scenarios that should be automated
1627
1668
 
1669
+ ### Handle Missing Test Data
1670
+
1671
+ If the Jira issue or PR references test accounts/data (e.g., TEST_PREMIUM_USER, TEST_ADMIN_PASSWORD) that don't exist in \`.env.testdata\`:
1672
+
1673
+ 1. **DO NOT skip test creation** \u2014 missing data is not a blocker for writing tests
1674
+ 2. Add placeholder entries to \`.env.testdata\` for non-secret variables (empty value with comment)
1675
+ 3. Reference all variables as \`process.env.VAR_NAME\` in test code \u2014 they'll resolve at runtime
1676
+ 4. Create the test cases and specs normally \u2014 tests may fail until data is configured, which is expected
1677
+ 5. {{INVOKE_TEAM_COMMUNICATOR}} to notify the team about missing test data that needs to be configured
1678
+ 6. Include in the Slack message: which variables are missing, what values they need, and which tests depend on them
1679
+
1680
+ **CRITICAL**: Never conclude "manual verification required" or "BLOCKED" solely because test data is missing. Always create the test artifacts first.
1681
+
1628
1682
  ### Generate Playwright Specs
1629
1683
 
1630
1684
  {{INVOKE_TEST_CODE_GENERATOR}} to create automated test specs:
@@ -2748,6 +2802,7 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
2748
2802
  - Reference variables using \`process.env.VAR_NAME\` in tests
2749
2803
  - Add new required variables to \`.env.testdata\`
2750
2804
  - NEVER read \`.env\` file (secrets only)
2805
+ - **If a required variable is missing from \`.env.testdata\`**: Add it with an empty value and a \`# TODO: configure\` comment. Continue creating tests using \`process.env.VAR_NAME\` \u2014 tests will fail until configured, which is expected. Do NOT skip test creation because of missing data.
2751
2806
 
2752
2807
  3. ${MEMORY_READ_INSTRUCTIONS.replace(/{ROLE}/g, "test-code-generator")}
2753
2808
 
@@ -7505,7 +7560,8 @@ Before adding ANY variable to .env.testdata, check if it's a secret:
7505
7560
  1. Scan for TEST_* variable references in test plan and test cases
7506
7561
  2. For each variable found:
7507
7562
  - If name contains PASSWORD/SECRET/TOKEN/KEY -> Skip (it's a secret, goes in .env only)
7508
- - Otherwise -> Add to .env.testdata with actual value
7563
+ - If actual value is known -> Add to .env.testdata with value
7564
+ - If actual value is unknown -> Add to .env.testdata with empty value and \`# TODO: team to configure\` comment
7509
7565
  3. Preserve existing variables in .env.testdata
7510
7566
 
7511
7567
  **Example .env.testdata (non-secrets only):**