Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 29 additions & 99 deletions .agents/workflows/bugReport.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,119 +2,49 @@
description: Evidence-first workflow for turning logs, screenshots, and brief context into a concise Jira-ready bug report
---

# Purpose
# Rules

Use this workflow to convert bug evidence into a compact report.

Allowed input:
- user context
- screenshots
- logs
- trace snippets
- console errors
- network errors
- directly relevant code references

Reporting only:
- Do not propose fixes or a test plan.
- Do not invent root cause, environment, or steps.

# Core Rules

- Report only confirmed facts from prompt, screenshots, logs, CLI, MCP, or code.
- Put anything likely but unproven in `Unverified`.
- Prefer concrete evidence over interpretation.
- Summarize noisy logs to the smallest useful line.
- Separate `Actual` from `Expected`.
- If details are missing, still write the report and note the gap in `Repro Notes`.
- Ask follow-up questions only if the report would otherwise be misleading.
- Report only confirmed facts (prompt, screenshots, logs, CLI, MCP, code). No fixes, test plans, or unproven root causes.
- Unproven-but-likely details → `Unverified`. Missing details → note in `Repro Notes`, don't block.
- Keep evidence minimal: exact error text, failed requests, stack lines, short log excerpts.
- Ask follow-ups only if the report would otherwise be misleading.

# Analysis Order

1. Identify the affected feature, page, API, or component.
2. Classify the issue: UI, functional, backend/API, performance/stability, access, or install/upgrade/config.
3. Extract only proof: visible error text, broken UI state, timestamp, failed request, stack line, or log line.
1. Identify affected feature / page / API / component.
2. Classify: UI | functional | backend/API | performance/stability | access | install/upgrade/config.
3. Extract proof: error text, broken UI state, timestamp, failed request, stack/log line.
4. State user impact.
5. Infer the shortest credible repro steps from provided evidence only.
5. Infer shortest credible repro steps from evidence only.
6. State expected behavior from context and normal product behavior.
7. Set severity conservatively.

# Input Rules

## Screenshots

- Capture visible page names, URLs, controls, and exact error text.
- Describe only what is visible.
- Mark an element as missing only when the intended element is clear.
- Reference the screenshot in `Evidence`.

## Logs

- Keep only the smallest lines that prove failure.
- Prefer explicit errors, status codes, timeouts, connection failures, and service names.
- Do not paste large log blocks.
- Move suspected root cause to `Unverified`.

## Minimal Context
7. Set severity conservatively (lowest that matches confirmed impact).

- Do not block on missing details.
- Provide a constrained title, minimal steps, explicit evidence, and note gaps in `Repro Notes`.
# Title format

# Severity
`[Component] Short factual description` — no root-cause guesses.

Choose the lowest severity that matches confirmed impact.

- `Critical`: data loss, security issue, complete outage, blocked install/upgrade, or unusable core workflow with no workaround
- `Urgent`: primary workflow broken, repeated hard failure, or severe impact with impractical workaround
- `High`: strong functional impact, incorrect results, partial workflow breakage, or major usability degradation
- `Medium`: limited functional issue, secondary workflow problem, or contained UI/behavior issue
- `Low`: cosmetic or low-impact polish issue

Default to `Medium` if impact is unclear.

# Title

- Format: `[Component] Short factual description`
- Do not include root-cause guesses.

Examples:
- `[Dashboards] Filter panel stays blank after reload`
- `[Backup] Restore action returns 500`

# Output Format

Provide exactly these sections:
# Output

- **Title**: `[Component] Short bug description`
- **Summary**: 2-3 short lines covering the defect and impact
- **Severity**: `Critical|Urgent|High|Medium|Low`
- **Steps to Reproduce**:
1. Step one
2. Step two
- **Actual**: Confirmed observed behavior
- **Expected**: Intended user-visible behavior
- **Evidence**: Short proof bullets
- **Unverified**: Only if needed
- **Repro Notes**: Missing details, consistency, timing, role, environment, or workaround notes

# Evidence Rules

Keep `Evidence` compact.

Examples:
- `Screenshot: settings-page-error.png shows "Failed to load user"`
- `Log: pmm-managed timeout waiting for inventory sync`
- `API: GET /v1/inventory/nodes returned 500`
- `Console: TypeError on dashboard load`

Avoid full stack traces, long logs, broad narratives, and unsupported root-cause claims.
- **Summary**: 2-3 lines — defect + impact
- **Severity**: `Critical|Urgent|High|Medium|Low`. Default `Medium` when impact is unclear.
- **Component**: affected PMM area
- **Steps to Reproduce**: numbered
- **Actual**: confirmed observed behavior (evidence-backed)
- **Expected**: intended user-visible behavior (not a fix)
- **Evidence**: short proof bullets
- **Unverified**: _(only if needed)_
- **Repro Notes**: missing details, consistency, timing, role, environment, workaround

# Final Check

- Title names the affected component.
- Severity matches confirmed impact.
- Steps are reproducible or clearly partial.
- `Actual` is supported by evidence.
- `Expected` describes behavior, not a fix.
- Uncertain points appear only in `Unverified`.
- Keep the report short enough to paste into Jira without cleanup.
- [ ] Title names the affected component
- [ ] Severity matches confirmed impact
- [ ] Steps are reproducible or clearly partial
- [ ] `Actual` is supported by evidence
- [ ] `Expected` describes behavior, not a fix
- [ ] Uncertain points appear only in `Unverified`
- [ ] Short enough to paste into Jira without cleanup
29 changes: 14 additions & 15 deletions .agents/workflows/mcpRules.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,27 @@
description: Execution, browser, and locator strategy rules for PMM Playwright tasks
---

# Execution & Context
- Execute directly; DO NOT output plans or reasoning unless blocked.
- Search first, read smallest possible files second (prefer nearby tests, POMs, helpers).
- NO broad repo scans.
# Execution
- Execute directly. No plans or reasoning unless blocked.
- Search first; read smallest possible files (prefer nearby tests, POMs, helpers). No broad repo scans.

# API Setup
- Use PMM REST API to build test state; use UI ONLY to verify behavior.
- Check `apiIndex.md` first for routes. Open `pmmApi.json` ONLY for precise schema definitions.
- Use PMM REST API to build state; UI only to verify behavior.
- Check `apiIndex.md` first. Open `pmmApi.json` only for precise schema definitions.

# Login
- Follow `pmmLogin.md`.
- Basic Auth headers ONLY.
- NEVER use the UI login form or `/graph/login` (except when debugging auth).
- Follow `pmmLogin.md`. Basic Auth headers only.
- Never use the UI login form or `/graph/login` (except when debugging auth).

# Browser interactions
- Batch multiple actions (fills, clicks, asserts) into one `mcp_playwright_browser_run_code` call.
- Use `browser_wait_for` or Playwright assertions. NO manual sleeps.
# Browser
- Batch multiple actions (fills, clicks, asserts) into one `browser_run_code` call.
- Use `browser_wait_for` or Playwright assertions. No manual sleeps.
- Do not reload or re-authenticate unless state explicitly demands it.
- If blocked, `browser_snapshot` once, stop, and reassess.
- If blocked: `browser_snapshot` once, stop, reassess.
- After navigation: verify expected route and visible page-specific content/controls. HTTP `200` alone is not a valid assertion.

# Locators & POM
- Priority: `getByTestId` > `getByRole` > `getByLabel` > `getByPlaceholder`.
- Reuse existing POM locators.
- If missing: do EXACTLY ONE DOM discovery pass, then update the POM. NEVER re-evaluate the same page's DOM.
- AVOID: `nth()`, `first()`, `last()`, dynamic XPath, and text-heavy selectors.
- If missing: one DOM discovery pass update POM. Never re-evaluate the same page's DOM.
- Avoid: `nth()`, `first()`, `last()`, dynamic XPath, text-heavy selectors.
33 changes: 21 additions & 12 deletions .agents/workflows/pmmLogin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,36 @@
description: PMM Login using basic Auth headers
---

- NEVER use UI login form.
- Use Basic Auth header via `mcp_playwright_browser_run_code`.
- DO NOT pass plain credentials in the URL string.
**Resolve credentials by context:**
- From `pmm-manual-test`: use user-provided PMM instance URL, `ADMIN_USERNAME=admin`, `ADMIN_PASSWORD=pmm3admin!`
- Standalone: use root `.env` — `PMM_UI_URL`, `ADMIN_USERNAME` (default `admin`), `ADMIN_PASSWORD`

**`<PRECOMPUTED_AUTH>`** = base64 of `ADMIN_USERNAME:ADMIN_PASSWORD` computed outside MCP (no `Buffer`, no `btoa`, no credentials in URL).

```javascript
async (page) => {
const base = "https://127.0.0.1";
const auth = Buffer.from("admin:admin").toString("base64");
const base = "<PMM_UI_URL>";
const auth = "<PRECOMPUTED_AUTH>";

await page.context().setExtraHTTPHeaders({ Authorization: `Basic ${auth}` });

await page.route("**/api/user/auth-tokens/rotate", async (route) => {
await route.fulfill({
body: "{}",
await page.route("**/api/user/auth-tokens/rotate", (route) =>
route.fulfill({ body: "{}", contentType: "application/json", status: 200 }),
);
await page.route("**/v1/users/me", (route) =>
route.fulfill({
body: JSON.stringify({
alerting_tour_completed: true,
product_tour_completed: true,
snoozed_pmm_version: "",
user_id: 1,
}),
contentType: "application/json",
status: 200,
});
});
}),
);

await page.goto(`${base}/pmm-ui/help`);
};
```

- Reply `Done` immediately after logging in. NO extra info.
Reply `Done`.
48 changes: 20 additions & 28 deletions .agents/workflows/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,52 @@
description: Playwright handoff report
---

# Core Rules
# Rules

- Output ONLY a structured exploration report using a template.
- NO speculative plans, raw DOM dumps, reasoning, or Playwright code generation.
- If blocked execution: Stop immediately, report blocker.
- PREFER `[API]` for state creation. Use `[Auth]` only for session state. Use `[Nav]` for URL routing. Use `[UI]` inside pages.
- Output ONLY a structured report using the template below.
- No speculative plans, raw DOM dumps, reasoning, or Playwright code generation.
- If blocked: stop immediately, report blocker.
- Prefer `[API]` for state creation. Use `[Auth]` for session state. `[Nav]` for URL routing. `[UI]` inside pages.

# Output Format
# Output Template

## Steps

- Ordered execution trace (e.g. `1. [API] Stop session`, `2. [Nav] Admin path`).
Ordered execution trace e.g. `1. [API] Stop session`, `2. [Nav] /pmm-ui/inventory`

## Key Locators

- Element | Purpose | Locator
| Element | Purpose | Locator |

## State (Before & After)

- URL
- Values/Selections
- Visible Errors/Messages
- _(Log changed/relevant fields ONLY)_
- Values / Selections
- Visible Errors / Messages
_(changed or relevant fields only)_

## Assertions

- `Verify:` Behavior that happened.
- `Assert:` Playwright check needed.
- `Verify:` behavior that happened
- `Assert:` Playwright check needed

## Stability notes
## Stability Notes

- Log: dynamic IDs, long waits, flake risk, useful traces.
Dynamic IDs, long waits, flake risk, useful traces.

---

# Templates (Pick One)
# Templates

## POM Discovery

- **Steps:** `[Nav]`, `[UI]`
- **Locators:** New elements.
- **State:** Before/After visual limits.
- **Stability:** Selectors, loads.
Steps: `[Nav]`, `[UI]` · Locators: new elements · Stability: selectors, loads

## API Setup

- **Steps:** `[API]`, then `[UI]/[Nav]` checks.
- **Locators:** Verification elements.
- **Assertion:** End-state expectation.
- **Stability:** Race conditions.
Steps: `[API]` then `[UI]/[Nav]` checks · Locators: verification elements · Assertion: end-state · Stability: race conditions

## Bug Investigation

- **Steps:** `[Auth]`, `[Nav]`, `[UI]`
- **State:** Before/After (highlight explicit error!).
- **Stability:** Intermittent triggers.
- **IMPORTANT:** If a bug is confirmed, use `bugReport.md` (`/bugReport`) to format the report.
Steps: `[Auth]`, `[Nav]`, `[UI]` · State: before/after (highlight error) · Stability: intermittent triggers
→ If bug confirmed: use `bugReport.md` (`/bugReport`) to format the report.
Loading
Loading