@bugzy-ai/bugzy 1.12.4 → 1.13.1

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
@@ -260,6 +260,9 @@ Before invoking the agent, identify the test cases for the current area:
260
260
  - Existing automated tests: ./tests/specs/
261
261
  - Existing Page Objects: ./tests/pages/
262
262
 
263
+ **Knowledge Base Patterns (MUST APPLY):**
264
+ Include ALL relevant testing patterns from the knowledge base that apply to this area. For example, if the KB documents timing behaviors (animation delays, loading states), selector gotchas, or recommended assertion approaches \u2014 list them here explicitly and instruct the agent to use the specific patterns described (e.g., specific assertion methods with specific timeouts). The test-code-generator does not have access to the knowledge base, so you MUST relay the exact patterns and recommended code approaches.
265
+
263
266
  **The agent should:**
264
267
  1. Read the manual test case files for this area
265
268
  2. Check existing Page Object infrastructure for this area
@@ -268,6 +271,7 @@ Before invoking the agent, identify the test cases for the current area:
268
271
  5. For each test case marked \`automated: true\`:
269
272
  - Create automated Playwright test in ./tests/specs/
270
273
  - Update the manual test case file to reference the automated test path
274
+ - Apply ALL knowledge base patterns listed above (timing, selectors, assertions)
271
275
  6. Run and iterate on each test until it passes or fails with a product bug
272
276
  7. Update .env.testdata with any new variables
273
277
 
@@ -1261,7 +1265,9 @@ Extract the following from arguments:
1261
1265
  "read-knowledge-base",
1262
1266
  // Step 5: Test Execution Strategy (library)
1263
1267
  "read-test-strategy",
1264
- // Step 6: Identify Tests (inline - task-specific)
1268
+ // Step 6: Clarification Protocol (library)
1269
+ "clarification-protocol",
1270
+ // Step 7: Identify Tests (inline - task-specific)
1265
1271
  {
1266
1272
  inline: true,
1267
1273
  title: "Identify Automated Tests to Run",
@@ -1487,7 +1493,9 @@ Store the detected trigger for use in output routing:
1487
1493
  - Set variable: \`TRIGGER_SOURCE\` = [GITHUB_PR | SLACK_MESSAGE | CI_CD | MANUAL]
1488
1494
  - This determines output formatting and delivery channel`
1489
1495
  },
1490
- // Step 6: Extract Context (inline)
1496
+ // Step 6: Clarification Protocol (library)
1497
+ "clarification-protocol",
1498
+ // Step 7: Extract Context (inline)
1491
1499
  {
1492
1500
  inline: true,
1493
1501
  title: "Extract Context Based on Trigger",
@@ -6455,6 +6463,8 @@ Before proceeding, read the curated knowledge base to inform your work:
6455
6463
  - Build on existing understanding
6456
6464
  - Maintain consistency with established practices
6457
6465
 
6466
+ 3. **Relay to subagents**: Subagents do NOT read the knowledge base directly. When delegating work, you MUST include relevant KB patterns in your delegation message \u2014 especially testing patterns (timing, selectors, assertion approaches) that affect test reliability.
6467
+
6458
6468
  **Note:** The knowledge base may not exist yet or may be empty. If it doesn't exist or is empty, proceed without this context and help build it as you work.`,
6459
6469
  tags: ["setup", "context"]
6460
6470
  };
@@ -6598,6 +6608,16 @@ Determine exploration depth based on requirement quality:
6598
6608
  - **Vague:** "Fix the sorting in todo list page. The items are mixed up for premium users."
6599
6609
  - **Unclear:** "Improve the dashboard performance. Users say it's slow."
6600
6610
 
6611
+ ### Maturity Adjustment
6612
+
6613
+ If the Clarification Protocol determined project maturity, adjust exploration depth:
6614
+
6615
+ - **New project**: Default one level deeper than requirement clarity suggests (Clear \u2192 Moderate, Vague \u2192 Deep)
6616
+ - **Growing project**: Use requirement clarity as-is (standard protocol)
6617
+ - **Mature project**: Trust knowledge base \u2014 can stay at suggested depth or go one level shallower if KB covers the feature
6618
+
6619
+ **Always verify features exist before testing them.** If exploration reveals that a referenced page or feature does not exist in the application, this is CRITICAL severity \u2014 escalate via the Clarification Protocol regardless of maturity level. Do NOT silently adapt or work around the missing feature.
6620
+
6601
6621
  ### Quick Exploration (1-2 min)
6602
6622
 
6603
6623
  **When:** Requirements CLEAR
@@ -6830,6 +6850,33 @@ Before starting, check if this task is resuming from a blocked clarification:
6830
6850
 
6831
6851
  3. **If no clarification in $ARGUMENTS:** Proceed normally with ambiguity detection below.
6832
6852
 
6853
+ ### Assess Project Maturity
6854
+
6855
+ Before detecting ambiguity, assess how well you know this project. Maturity determines how aggressively you should ask questions \u2014 new projects require more questions, mature projects can rely on accumulated knowledge.
6856
+
6857
+ **Measure maturity from runtime artifacts:**
6858
+
6859
+ | Signal | New | Growing | Mature |
6860
+ |--------|-----|---------|--------|
6861
+ | \`knowledge-base.md\` | < 80 lines (template) | 80-300 lines | 300+ lines |
6862
+ | \`memory/\` files | 0 files | 1-3 files | 4+ files, >5KB each |
6863
+ | Test cases in \`test-cases/\` | 0 | 1-6 | 7+ |
6864
+ | Exploration reports | 0 | 1 | 2+ |
6865
+
6866
+ **Steps:**
6867
+ 1. Read \`.bugzy/runtime/knowledge-base.md\` and count lines
6868
+ 2. List \`.bugzy/runtime/memory/\` directory and count files
6869
+ 3. List \`test-cases/\` directory and count \`.md\` files (exclude README)
6870
+ 4. Count exploration reports in \`exploration-reports/\`
6871
+ 5. Classify: If majority of signals = New \u2192 **New**; majority Mature \u2192 **Mature**; otherwise \u2192 **Growing**
6872
+
6873
+ **Maturity adjusts your question threshold:**
6874
+ - **New**: Ask for CRITICAL + HIGH + MEDIUM severity (gather information aggressively)
6875
+ - **Growing**: Ask for CRITICAL + HIGH severity (standard protocol)
6876
+ - **Mature**: Ask for CRITICAL only (handle HIGH with documented assumptions)
6877
+
6878
+ **CRITICAL severity ALWAYS triggers a question, regardless of maturity level.**
6879
+
6833
6880
  ### Detect Ambiguity
6834
6881
 
6835
6882
  Scan for ambiguity signals:
@@ -6856,8 +6903,8 @@ If ambiguity is detected, assess its severity:
6856
6903
 
6857
6904
  | Severity | Characteristics | Examples | Action |
6858
6905
  |----------|----------------|----------|--------|
6859
- | **CRITICAL** | Expected behavior undefined/contradictory; test outcome unpredictable; core functionality unclear; success criteria missing; multiple interpretations = different strategies | "Fix the issue" (what issue?), "Improve performance" (which metrics?), "Fix sorting in todo list" (by date? priority? completion status?) | **STOP** - Seek clarification before proceeding |
6860
- | **HIGH** | Core underspecified but direction clear; affects majority of scenarios; vague success criteria; assumptions risky | "Fix ordering" (sequence OR visibility?), "Add validation" (what? messages?), "Update dashboard" (which widgets?) | **STOP** - Seek clarification before proceeding |
6906
+ | **CRITICAL** | Expected behavior undefined/contradictory; test outcome unpredictable; core functionality unclear; success criteria missing; multiple interpretations = different strategies; **referenced page/feature does not exist in the application** | "Fix the issue" (what issue?), "Improve performance" (which metrics?), "Fix sorting in todo list" (by date? priority? completion status?), "Test the Settings page" (no Settings page exists), "Verify the checkout flow" (no checkout page found) | **STOP** - You MUST ask via team-communicator before proceeding |
6907
+ | **HIGH** | Core underspecified but direction clear; affects majority of scenarios; vague success criteria; assumptions risky | "Fix ordering" (sequence OR visibility?), "Add validation" (what? messages?), "Update dashboard" (which widgets?) | **STOP** - You MUST ask via team-communicator before proceeding |
6861
6908
  | **MEDIUM** | Specific details missing; general requirements clear; affects subset of cases; reasonable low-risk assumptions possible; wrong assumption = test updates not strategy overhaul | Missing field labels, unclear error message text, undefined timeouts, button placement not specified, date formats unclear | **PROCEED** - (1) Moderate exploration, (2) Document assumptions: "Assuming X because Y", (3) Proceed with creation/execution, (4) Async clarification (team-communicator), (5) Mark [ASSUMED: description] |
6862
6909
  | **LOW** | Minor edge cases; documentation gaps don't affect execution; optional/cosmetic elements; minimal impact | Tooltip text, optional field validation, icon choice, placeholder text, tab order | **PROCEED** - (1) Mark [TO BE CLARIFIED: description], (2) Proceed, (3) Mention in report "Minor Details", (4) No blocking/async clarification |
6863
6910
 
@@ -6958,18 +7005,26 @@ Tasks waiting for clarification responses.
6958
7005
 
6959
7006
  ### Wait or Proceed Based on Severity
6960
7007
 
6961
- **CRITICAL/HIGH \u2192 STOP and Wait:**
6962
- - Do NOT create tests, run tests, or make assumptions
6963
- - Wait for clarification, resume after answer
7008
+ **Use your maturity assessment to adjust thresholds:**
7009
+ - **New project**: STOP for CRITICAL + HIGH + MEDIUM
7010
+ - **Growing project**: STOP for CRITICAL + HIGH (default)
7011
+ - **Mature project**: STOP for CRITICAL only; handle HIGH with documented assumptions
7012
+
7013
+ **When severity meets your STOP threshold:**
7014
+ - You MUST call team-communicator (Slack) to ask the question \u2014 do NOT just mention it in your text output
7015
+ - Do NOT create tests, run tests, or make assumptions about the unclear aspect
7016
+ - Do NOT silently adapt by working around the issue (e.g., running other tests instead)
7017
+ - Do NOT invent your own success criteria when none are provided
7018
+ - Register the blocked task and wait for clarification
6964
7019
  - *Rationale: Wrong assumptions = incorrect tests, false results, wasted time*
6965
7020
 
6966
- **MEDIUM \u2192 Proceed with Documented Assumptions:**
7021
+ **When severity is below your STOP threshold \u2192 Proceed with Documented Assumptions:**
6967
7022
  - Perform moderate exploration, document assumptions, proceed with creation/execution
6968
7023
  - Ask clarification async (team-communicator), mark results "based on assumptions"
6969
7024
  - Update tests after clarification received
6970
7025
  - *Rationale: Waiting blocks progress; documented assumptions allow forward movement with later corrections*
6971
7026
 
6972
- **LOW \u2192 Proceed and Mark:**
7027
+ **LOW \u2192 Always Proceed and Mark:**
6973
7028
  - Proceed with creation/execution, mark gaps [TO BE CLARIFIED] or [ASSUMED]
6974
7029
  - Mention in report but don't prioritize, no blocking
6975
7030
  - *Rationale: Details don't affect strategy/results significantly*
@@ -6997,11 +7052,12 @@ When reporting test results, always include an "Ambiguities" section if clarific
6997
7052
 
6998
7053
  ## Remember
6999
7054
 
7000
- - **Block for CRITICAL/HIGH** - Never proceed with assumptions on unclear core requirements
7055
+ - **STOP means STOP** - When you hit a STOP threshold, you MUST call team-communicator to ask via Slack. Do NOT silently adapt, skip, or work around the issue
7056
+ - **Non-existent features = CRITICAL** - If a page, component, or feature referenced in the task does not exist, this is always CRITICAL severity \u2014 ask what was meant
7001
7057
  - **Ask correctly > guess poorly** - Specific questions lead to specific answers
7002
- - **Document MEDIUM assumptions** - Track what you assumed and why
7058
+ - **Never invent success criteria** - If the task says "improve" or "fix" without metrics, ask what "done" looks like
7003
7059
  - **Check memory first** - Avoid re-asking previously answered questions
7004
- - **Specific questions \u2192 specific answers** - Vague questions get vague answers`,
7060
+ - **Maturity adjusts threshold, not judgment** - Even in mature projects, CRITICAL always triggers a question`,
7005
7061
  tags: ["clarification", "protocol", "ambiguity"]
7006
7062
  };
7007
7063