@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.
@@ -767,9 +767,9 @@ var init_process_event = __esm({
767
767
  processEventTask = {
768
768
  slug: TASK_SLUGS.PROCESS_EVENT,
769
769
  name: "Process Event",
770
- description: "Process external system events (Jira, GitHub, Linear) using handler-defined rules to extract insights and track issues",
770
+ description: "Process webhook events by analyzing for QA relevance and queuing proposed actions for team confirmation",
771
771
  frontmatter: {
772
- description: "Process external system events (Jira, GitHub, Linear) using handler-defined rules to extract insights and track issues",
772
+ description: "Process webhook events by analyzing for QA relevance and queuing proposed actions for team confirmation",
773
773
  "argument-hint": "[event payload or description]"
774
774
  },
775
775
  steps: [
@@ -779,7 +779,9 @@ var init_process_event = __esm({
779
779
  title: "Process Event Overview",
780
780
  content: `# Process Event Command
781
781
 
782
- Process various types of events using intelligent pattern matching and historical context to maintain and evolve the testing system.`
782
+ Process webhook events from integrated systems by analyzing event content, determining appropriate QA actions, and queuing them for team confirmation.
783
+
784
+ **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.`
783
785
  },
784
786
  // Step 2: Security Notice (library)
785
787
  "security-notice",
@@ -802,7 +804,7 @@ Process various types of events using intelligent pattern matching and historica
802
804
  - **Source Control**: GitHub, GitLab
803
805
  - **Communication Tools**: Slack
804
806
 
805
- **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.
807
+ **Event structure and semantics vary by source.** Use the inline event-action reference patterns and historical context to determine actions.
806
808
 
807
809
  #### Event Context to Extract:
808
810
  - **What happened**: The core event (test failed, PR merged, etc.)
@@ -923,42 +925,30 @@ Read \`.bugzy/runtime/memory/event-history.md\` to:
923
925
  - List \`./test-cases/\` for existing tests
924
926
  - Check \`.bugzy/runtime/knowledge-base.md\` for past insights
925
927
 
926
- #### 2.4 Load System-Specific Handler (REQUIRED)
927
-
928
- Based on the event source, load the handler from \`.bugzy/runtime/handlers/\`:
929
-
930
- **Step 1: Detect Event Source from Payload:**
931
- - \`com.jira-server.*\` event type prefix -> \`.bugzy/runtime/handlers/jira.md\`
932
- - \`com.recall.*\` event type prefix -> \`.bugzy/runtime/handlers/recall.md\`
933
- - \`github.*\` or GitHub webhook structure -> \`.bugzy/runtime/handlers/github.md\`
934
- - \`linear.*\` or Linear webhook -> \`.bugzy/runtime/handlers/linear.md\`
935
- - Other sources -> Check for matching handler file by source name
936
-
937
- **Step 2: Load and Read the Handler File:**
938
- The handler file contains system-specific instructions for:
939
- - Event payload structure and field meanings
940
- - Which triggers (status changes, resolutions) require specific actions
941
- - How to interpret different event types
942
- - When to invoke \`/verify-changes\`
943
- - How to update the knowledge base
944
-
945
- **Step 3: Follow Handler Instructions:**
946
- The handler file is authoritative for this event source. Follow its instructions for:
947
- - Interpreting the event payload
948
- - Determining what actions to take
949
- - Formatting responses and updates
950
-
951
- **Step 4: If No Handler Exists:**
952
- Do NOT guess or apply generic logic. Instead:
953
- 1. Inform the user that no handler exists for this event source
954
- 2. Ask how this event type should be processed
955
- 3. Suggest creating a handler file at \`.bugzy/runtime/handlers/{source}.md\`
956
-
957
- **Project-Specific Configuration:**
958
- Handlers reference \`.bugzy/runtime/project-context.md\` for project-specific rules like:
959
- - Which status transitions trigger verify-changes
960
- - Which resolutions should update the knowledge base
961
- - Which transitions to ignore`
928
+ #### 2.4 Event-Action Reference Patterns
929
+
930
+ 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.
931
+
932
+ **Jira Events:**
933
+ - **Status \u2192 "Ready to Test" / "In Testing" / "Ready for QA"**: Propose \`/verify-changes\` with issue context
934
+ - **Resolution: "Not a Bug" / "Won't Fix" / "User Error"**: Update knowledge base directly with the learning (no queue needed)
935
+ - **Bug created with relevant labels**: Propose \`/generate-test-cases\` to update related test coverage, confirm with team
936
+ - **Backlog \u2192 To Do**: No QA action needed, log to event history only
937
+
938
+ **GitHub Events:**
939
+ - **PR merged (routed to process-event)**: Propose \`/verify-changes\` for the merged changes
940
+ - **Issue closed as "won't fix"**: Update knowledge base directly with the learning
941
+ - **Issue created/updated**: Analyze for QA relevance, propose actions if applicable
942
+
943
+ **Recall.ai Events (Meeting Transcripts):**
944
+ - **QA-relevant content found**: Propose appropriate follow-up tasks (e.g., \`/generate-test-cases\`, \`/verify-changes\`)
945
+ - **No QA content** (HR meeting, offsite planning, etc.): Skip \u2014 log to event history only
946
+
947
+ **Other Events:**
948
+ - Analyze for QA relevance based on knowledge base and project context
949
+ - If action needed, propose appropriate task. If not, log and skip.
950
+
951
+ Check \`.bugzy/runtime/project-context.md\` for project-specific context that may inform action decisions.`
962
952
  },
963
953
  // Step 8: Intelligent Event Analysis (inline)
964
954
  {
@@ -978,17 +968,16 @@ Don't just match patterns - analyze the event within the full context:
978
968
  **Example Contextual Analysis**:
979
969
  \`\`\`
980
970
  Event: Jira issue PROJ-456 moved to "Ready for QA"
981
- + Handler: jira.md says "Ready for QA" triggers /verify-changes
971
+ + Reference Pattern: "Ready for QA" status suggests /verify-changes
982
972
  + History: This issue was previously in "In Progress" for 3 days
983
973
  + Knowledge: Related PR #123 merged yesterday
984
- = Decision: Invoke /verify-changes with issue context and PR reference
974
+ = Decision: Propose /verify-changes with issue context and PR reference
985
975
  \`\`\`
986
976
 
987
977
  **Pattern Recognition with Context**:
988
- - An issue resolution depends on what the handler prescribes for that status
978
+ - An issue resolution depends on the event-action reference patterns and project context
989
979
  - A duplicate event (same issue, same transition) should be skipped
990
980
  - Events from different sources about the same change should be correlated
991
- - Handler instructions take precedence over generic assumptions
992
981
 
993
982
  #### 3.2 Generate Semantic Queries
994
983
  Based on event type and content, generate 3-5 specific search queries:
@@ -1014,7 +1003,7 @@ Generate tasks based on event analysis, using examples from memory as reference.
1014
1003
  Analyze the event in context of ALL available information to decide what actions to take:
1015
1004
 
1016
1005
  **Consider the Full Context**:
1017
- - What does the handler prescribe for this event type?
1006
+ - What do the event-action reference patterns suggest for this event type?
1018
1007
  - How does this relate to current knowledge?
1019
1008
  - What's the state of related issues in external systems?
1020
1009
  - Is this part of a larger pattern we've been seeing?
@@ -1022,17 +1011,17 @@ Analyze the event in context of ALL available information to decide what actions
1022
1011
 
1023
1012
  **Contextual Decision Making**:
1024
1013
  The same event type can require different actions based on context:
1025
- - If handler says this status triggers verification -> Invoke /verify-changes
1014
+ - If reference pattern suggests verification -> Propose /verify-changes (queue for confirmation)
1026
1015
  - If this issue was already processed (check event history) -> Skip to avoid duplicates
1027
- - If related PR exists in knowledge base -> Include PR context in actions
1016
+ - If related PR exists in knowledge base -> Include PR context in proposed actions
1028
1017
  - If this is a recurring pattern from the same source -> Consider flagging for review
1029
- - If handler has no rule for this event type -> Ask user for guidance
1018
+ - If no clear action for this event type -> Analyze context or skip
1030
1019
 
1031
1020
  **Dynamic Task Selection**:
1032
1021
  Based on the contextual analysis, decide which tasks make sense:
1033
1022
  - **extract_learning**: When the event reveals something new about the system
1034
1023
  - **update_test_plan**: When our understanding of what to test has changed
1035
- - **update_test_cases**: When tests need to reflect new reality
1024
+ - **propose_generate_test_cases**: When tests need to reflect new reality (queued for confirmation)
1036
1025
  - **report_bug**: When we have a legitimate, impactful, reproducible issue
1037
1026
  - **skip_action**: When context shows no action needed (e.g., known issue, already fixed)
1038
1027
 
@@ -1074,13 +1063,64 @@ The issue-tracker agent will handle all aspects of issue tracking including dupl
1074
1063
  // Step 12: Execute Tasks (inline)
1075
1064
  {
1076
1065
  inline: true,
1077
- title: "Execute Tasks with Memory Updates",
1078
- content: `### Step 5: Execute Tasks with Memory Updates
1066
+ title: "Queue Proposed Actions and Notify Team",
1067
+ content: `### Step 5: Queue Proposed Actions and Notify Team
1068
+
1069
+ #### 5.1 Categorize Determined Actions
1070
+
1071
+ Separate actions into two categories:
1072
+
1073
+ **Queued Actions** (require team confirmation):
1074
+ - \`/verify-changes\`, \`/generate-test-cases\`, \`/run-tests\`, \`/explore-application\`
1075
+ - Any task that modifies tests, runs automation, or takes significant action
1076
+
1077
+ **Direct Actions** (execute immediately):
1078
+ - Knowledge base updates and learnings
1079
+ - Event history logging
1080
+ - Event processor memory updates
1081
+ - Skip decisions
1082
+
1083
+ #### 5.2 Execute Direct Actions
1084
+
1085
+ Update \`.bugzy/runtime/knowledge-base.md\` directly for learnings (e.g., "Not a Bug" resolutions).
1086
+
1087
+ #### 5.3 Queue Action Tasks
1079
1088
 
1080
- #### 5.1 Execute Each Task
1081
- Follow the standard execution logic with added context from memory.
1089
+ For each proposed action task, append one row to \`.bugzy/runtime/blocked-task-queue.md\`:
1082
1090
 
1083
- #### 5.2 Update Event Processor Memory
1091
+ | Task Slug | Question | Original Args |
1092
+ |-----------|----------|---------------|
1093
+ | /verify-changes | Verify PROJ-456 changes (moved to Ready for QA)? Related PR #123. | \`{"issue": "PROJ-456", "context": "Jira Ready to Test"}\` |
1094
+
1095
+ Rules:
1096
+ 1. Read file first (create if doesn't exist)
1097
+ 2. Each action gets its own row
1098
+ 3. **Question** must be clear and include enough context for team to decide
1099
+ 4. **Original Args** must include event source, IDs, and relevant context as JSON
1100
+
1101
+ #### 5.4 Notify Team
1102
+
1103
+ {{INVOKE_TEAM_COMMUNICATOR}} to share the outcome:
1104
+
1105
+ **If actions were queued:**
1106
+ - What event was processed
1107
+ - What actions are proposed (with brief reasoning)
1108
+ - These are awaiting confirmation
1109
+
1110
+ **If no actions queued (KB-only update or skip):**
1111
+ - What event was processed
1112
+ - What was learned or why it was skipped
1113
+ - That no action is needed from the team
1114
+
1115
+ #### 5.5 Complete Task
1116
+
1117
+ After queuing and notifying, the task is DONE. Do NOT:
1118
+ - Execute /verify-changes, /run-tests, /generate-test-cases directly
1119
+ - Wait for team response (messaging infrastructure handles that)
1120
+ - Create or modify test files
1121
+ - Run Playwright tests
1122
+
1123
+ #### 5.6 Update Event Processor Memory
1084
1124
  If new patterns discovered, append to \`.bugzy/runtime/memory/event-processor.md\`:
1085
1125
  \`\`\`markdown
1086
1126
  ### Pattern: [New Pattern Name]
@@ -1090,7 +1130,7 @@ If new patterns discovered, append to \`.bugzy/runtime/memory/event-processor.md
1090
1130
  **Example**: [This event]
1091
1131
  \`\`\`
1092
1132
 
1093
- #### 5.3 Update Event History
1133
+ #### 5.7 Update Event History
1094
1134
  Append to \`.bugzy/runtime/memory/event-history.md\`:
1095
1135
  \`\`\`markdown
1096
1136
  ## [Timestamp] - Event #[ID]
@@ -1163,7 +1203,8 @@ Create files if they don't exist:
1163
1203
  - Adjust responses based on business priorities and risk
1164
1204
 
1165
1205
  ### Smart Task Generation
1166
- - Only take actions prescribed by the handler or confirmed by the user
1206
+ - NEVER execute action tasks directly \u2014 all action tasks go through blocked-task-queue for team confirmation
1207
+ - Knowledge base updates and event history logging are the only direct operations
1167
1208
  - Document why each decision was made with full context
1168
1209
  - Skip redundant actions (e.g., duplicate events, already-processed issues)
1169
1210
  - Escalate appropriately based on pattern recognition
@@ -1633,6 +1674,19 @@ Create or update test case files in \`./test-cases/\` for the new feature:
1633
1674
  - Include: objective, preconditions, test steps, expected results
1634
1675
  - Mark \`automated: true\` for scenarios that should be automated
1635
1676
 
1677
+ ### Handle Missing Test Data
1678
+
1679
+ 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\`:
1680
+
1681
+ 1. **DO NOT skip test creation** \u2014 missing data is not a blocker for writing tests
1682
+ 2. Add placeholder entries to \`.env.testdata\` for non-secret variables (empty value with comment)
1683
+ 3. Reference all variables as \`process.env.VAR_NAME\` in test code \u2014 they'll resolve at runtime
1684
+ 4. Create the test cases and specs normally \u2014 tests may fail until data is configured, which is expected
1685
+ 5. {{INVOKE_TEAM_COMMUNICATOR}} to notify the team about missing test data that needs to be configured
1686
+ 6. Include in the Slack message: which variables are missing, what values they need, and which tests depend on them
1687
+
1688
+ **CRITICAL**: Never conclude "manual verification required" or "BLOCKED" solely because test data is missing. Always create the test artifacts first.
1689
+
1636
1690
  ### Generate Playwright Specs
1637
1691
 
1638
1692
  {{INVOKE_TEST_CODE_GENERATOR}} to create automated test specs:
@@ -2756,6 +2810,7 @@ var CONTENT2 = `You are an expert Playwright test automation engineer specializi
2756
2810
  - Reference variables using \`process.env.VAR_NAME\` in tests
2757
2811
  - Add new required variables to \`.env.testdata\`
2758
2812
  - NEVER read \`.env\` file (secrets only)
2813
+ - **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.
2759
2814
 
2760
2815
  3. ${MEMORY_READ_INSTRUCTIONS.replace(/{ROLE}/g, "test-code-generator")}
2761
2816
 
@@ -7513,7 +7568,8 @@ Before adding ANY variable to .env.testdata, check if it's a secret:
7513
7568
  1. Scan for TEST_* variable references in test plan and test cases
7514
7569
  2. For each variable found:
7515
7570
  - If name contains PASSWORD/SECRET/TOKEN/KEY -> Skip (it's a secret, goes in .env only)
7516
- - Otherwise -> Add to .env.testdata with actual value
7571
+ - If actual value is known -> Add to .env.testdata with value
7572
+ - If actual value is unknown -> Add to .env.testdata with empty value and \`# TODO: team to configure\` comment
7517
7573
  3. Preserve existing variables in .env.testdata
7518
7574
 
7519
7575
  **Example .env.testdata (non-secrets only):**