@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/index.js CHANGED
@@ -417,6 +417,9 @@ Before invoking the agent, identify the test cases for the current area:
417
417
  - Existing automated tests: ./tests/specs/
418
418
  - Existing Page Objects: ./tests/pages/
419
419
 
420
+ **Knowledge Base Patterns (MUST APPLY):**
421
+ 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.
422
+
420
423
  **The agent should:**
421
424
  1. Read the manual test case files for this area
422
425
  2. Check existing Page Object infrastructure for this area
@@ -425,6 +428,7 @@ Before invoking the agent, identify the test cases for the current area:
425
428
  5. For each test case marked \`automated: true\`:
426
429
  - Create automated Playwright test in ./tests/specs/
427
430
  - Update the manual test case file to reference the automated test path
431
+ - Apply ALL knowledge base patterns listed above (timing, selectors, assertions)
428
432
  6. Run and iterate on each test until it passes or fails with a product bug
429
433
  7. Update .env.testdata with any new variables
430
434
 
@@ -1386,7 +1390,9 @@ Extract the following from arguments:
1386
1390
  "read-knowledge-base",
1387
1391
  // Step 5: Test Execution Strategy (library)
1388
1392
  "read-test-strategy",
1389
- // Step 6: Identify Tests (inline - task-specific)
1393
+ // Step 6: Clarification Protocol (library)
1394
+ "clarification-protocol",
1395
+ // Step 7: Identify Tests (inline - task-specific)
1390
1396
  {
1391
1397
  inline: true,
1392
1398
  title: "Identify Automated Tests to Run",
@@ -1604,7 +1610,9 @@ Store the detected trigger for use in output routing:
1604
1610
  - Set variable: \`TRIGGER_SOURCE\` = [GITHUB_PR | SLACK_MESSAGE | CI_CD | MANUAL]
1605
1611
  - This determines output formatting and delivery channel`
1606
1612
  },
1607
- // Step 6: Extract Context (inline)
1613
+ // Step 6: Clarification Protocol (library)
1614
+ "clarification-protocol",
1615
+ // Step 7: Extract Context (inline)
1608
1616
  {
1609
1617
  inline: true,
1610
1618
  title: "Extract Context Based on Trigger",
@@ -6088,6 +6096,8 @@ Before proceeding, read the curated knowledge base to inform your work:
6088
6096
  - Build on existing understanding
6089
6097
  - Maintain consistency with established practices
6090
6098
 
6099
+ 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.
6100
+
6091
6101
  **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.`,
6092
6102
  tags: ["setup", "context"]
6093
6103
  };
@@ -6226,6 +6236,16 @@ Determine exploration depth based on requirement quality:
6226
6236
  - **Vague:** "Fix the sorting in todo list page. The items are mixed up for premium users."
6227
6237
  - **Unclear:** "Improve the dashboard performance. Users say it's slow."
6228
6238
 
6239
+ ### Maturity Adjustment
6240
+
6241
+ If the Clarification Protocol determined project maturity, adjust exploration depth:
6242
+
6243
+ - **New project**: Default one level deeper than requirement clarity suggests (Clear \u2192 Moderate, Vague \u2192 Deep)
6244
+ - **Growing project**: Use requirement clarity as-is (standard protocol)
6245
+ - **Mature project**: Trust knowledge base \u2014 can stay at suggested depth or go one level shallower if KB covers the feature
6246
+
6247
+ **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.
6248
+
6229
6249
  ### Quick Exploration (1-2 min)
6230
6250
 
6231
6251
  **When:** Requirements CLEAR
@@ -6457,6 +6477,33 @@ Before starting, check if this task is resuming from a blocked clarification:
6457
6477
 
6458
6478
  3. **If no clarification in $ARGUMENTS:** Proceed normally with ambiguity detection below.
6459
6479
 
6480
+ ### Assess Project Maturity
6481
+
6482
+ 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.
6483
+
6484
+ **Measure maturity from runtime artifacts:**
6485
+
6486
+ | Signal | New | Growing | Mature |
6487
+ |--------|-----|---------|--------|
6488
+ | \`knowledge-base.md\` | < 80 lines (template) | 80-300 lines | 300+ lines |
6489
+ | \`memory/\` files | 0 files | 1-3 files | 4+ files, >5KB each |
6490
+ | Test cases in \`test-cases/\` | 0 | 1-6 | 7+ |
6491
+ | Exploration reports | 0 | 1 | 2+ |
6492
+
6493
+ **Steps:**
6494
+ 1. Read \`.bugzy/runtime/knowledge-base.md\` and count lines
6495
+ 2. List \`.bugzy/runtime/memory/\` directory and count files
6496
+ 3. List \`test-cases/\` directory and count \`.md\` files (exclude README)
6497
+ 4. Count exploration reports in \`exploration-reports/\`
6498
+ 5. Classify: If majority of signals = New \u2192 **New**; majority Mature \u2192 **Mature**; otherwise \u2192 **Growing**
6499
+
6500
+ **Maturity adjusts your question threshold:**
6501
+ - **New**: Ask for CRITICAL + HIGH + MEDIUM severity (gather information aggressively)
6502
+ - **Growing**: Ask for CRITICAL + HIGH severity (standard protocol)
6503
+ - **Mature**: Ask for CRITICAL only (handle HIGH with documented assumptions)
6504
+
6505
+ **CRITICAL severity ALWAYS triggers a question, regardless of maturity level.**
6506
+
6460
6507
  ### Detect Ambiguity
6461
6508
 
6462
6509
  Scan for ambiguity signals:
@@ -6483,8 +6530,8 @@ If ambiguity is detected, assess its severity:
6483
6530
 
6484
6531
  | Severity | Characteristics | Examples | Action |
6485
6532
  |----------|----------------|----------|--------|
6486
- | **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 |
6487
- | **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 |
6533
+ | **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 |
6534
+ | **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 |
6488
6535
  | **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] |
6489
6536
  | **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 |
6490
6537
 
@@ -6585,18 +6632,26 @@ Tasks waiting for clarification responses.
6585
6632
 
6586
6633
  ### Wait or Proceed Based on Severity
6587
6634
 
6588
- **CRITICAL/HIGH \u2192 STOP and Wait:**
6589
- - Do NOT create tests, run tests, or make assumptions
6590
- - Wait for clarification, resume after answer
6635
+ **Use your maturity assessment to adjust thresholds:**
6636
+ - **New project**: STOP for CRITICAL + HIGH + MEDIUM
6637
+ - **Growing project**: STOP for CRITICAL + HIGH (default)
6638
+ - **Mature project**: STOP for CRITICAL only; handle HIGH with documented assumptions
6639
+
6640
+ **When severity meets your STOP threshold:**
6641
+ - You MUST call team-communicator (Slack) to ask the question \u2014 do NOT just mention it in your text output
6642
+ - Do NOT create tests, run tests, or make assumptions about the unclear aspect
6643
+ - Do NOT silently adapt by working around the issue (e.g., running other tests instead)
6644
+ - Do NOT invent your own success criteria when none are provided
6645
+ - Register the blocked task and wait for clarification
6591
6646
  - *Rationale: Wrong assumptions = incorrect tests, false results, wasted time*
6592
6647
 
6593
- **MEDIUM \u2192 Proceed with Documented Assumptions:**
6648
+ **When severity is below your STOP threshold \u2192 Proceed with Documented Assumptions:**
6594
6649
  - Perform moderate exploration, document assumptions, proceed with creation/execution
6595
6650
  - Ask clarification async (team-communicator), mark results "based on assumptions"
6596
6651
  - Update tests after clarification received
6597
6652
  - *Rationale: Waiting blocks progress; documented assumptions allow forward movement with later corrections*
6598
6653
 
6599
- **LOW \u2192 Proceed and Mark:**
6654
+ **LOW \u2192 Always Proceed and Mark:**
6600
6655
  - Proceed with creation/execution, mark gaps [TO BE CLARIFIED] or [ASSUMED]
6601
6656
  - Mention in report but don't prioritize, no blocking
6602
6657
  - *Rationale: Details don't affect strategy/results significantly*
@@ -6624,11 +6679,12 @@ When reporting test results, always include an "Ambiguities" section if clarific
6624
6679
 
6625
6680
  ## Remember
6626
6681
 
6627
- - **Block for CRITICAL/HIGH** - Never proceed with assumptions on unclear core requirements
6682
+ - **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
6683
+ - **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
6628
6684
  - **Ask correctly > guess poorly** - Specific questions lead to specific answers
6629
- - **Document MEDIUM assumptions** - Track what you assumed and why
6685
+ - **Never invent success criteria** - If the task says "improve" or "fix" without metrics, ask what "done" looks like
6630
6686
  - **Check memory first** - Avoid re-asking previously answered questions
6631
- - **Specific questions \u2192 specific answers** - Vague questions get vague answers`,
6687
+ - **Maturity adjusts threshold, not judgment** - Even in mature projects, CRITICAL always triggers a question`,
6632
6688
  tags: ["clarification", "protocol", "ambiguity"]
6633
6689
  };
6634
6690