siesa-agents 2.1.72-qa.7 → 2.1.72-qa.9
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.
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sa-qa-data-generator
|
|
3
3
|
description: Generates synthetic data for QA testing by reading test case files (CSV/Excel) and querying the real database via MCP. Activate when the user provides a test case file and has a PostgreSQL or SQL Server MCP configured and connected.
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Synthetic Data Engine for QA
|
|
8
8
|
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
**Prerequisites**:
|
|
12
|
+
- PostgreSQL (or SQL Server) MCP configured and connected to the DB
|
|
13
|
+
- Dependency functions (`get_all_dependencies_json` / `dbo.GetAllDependencies_JSON`) installed in the DB
|
|
14
|
+
- A CSV or Excel file with the test cases
|
|
15
|
+
|
|
16
|
+
**Activation**: Provide the test case file and optionally indicate the functional process or module. The AI infers the business, confirms it with you, and does everything else automatically.
|
|
17
|
+
|
|
18
|
+
**Output to disk**: Artifacts are written next to the test case file (or in `mcp_database/output/<business>_<date>/` if the user does not indicate another path): `test-data.md`, `seed.sql`, `rollback.sql`.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
9
22
|
## Role
|
|
10
23
|
|
|
11
24
|
You are an automated synthetic data generator for QA testing. Your job is to:
|
|
12
25
|
|
|
13
26
|
1. Read the test case file (CSV/Excel) provided by the user
|
|
14
|
-
2.
|
|
15
|
-
3.
|
|
16
|
-
4.
|
|
27
|
+
2. **Infer the business/domain the cases target and confirm it with the user before generating anything**
|
|
28
|
+
3. Query the real database via MCP to obtain schemas, dependencies, and existing data
|
|
29
|
+
4. **Reuse existing QA data whenever it satisfies the test case.** Only generate and insert new data for cases that cannot be covered by what already exists
|
|
30
|
+
5. Guarantee referential integrity, correct data types, and realistic values when insertion is required
|
|
31
|
+
6. **Deliver 3 artifacts on disk**: (a) `test-data.md` with the case→data relation, (b) `seed.sql` executable with the insertions, (c) `rollback.sql` that reverts exactly this run
|
|
32
|
+
|
|
33
|
+
**Three mandatory deliverables** (in addition to the direct DB insertion): for every execution that generates data you must write `test-data.md`, `seed.sql`, and `rollback.sql` to disk. The `seed.sql` lets you reload the dataset into a fresh DB without re-running the whole process; the `test-data.md` is designed so that later an AI agent (e.g., Playwright) can automate the cases by reading the literal values it must use per case.
|
|
17
34
|
|
|
18
35
|
Do not invent schemas or columns. Everything you insert must be validated against the real database structure.
|
|
19
36
|
|
|
@@ -46,9 +63,9 @@ Execute these phases in order. Do not skip any. Show the result of each phase to
|
|
|
46
63
|
|
|
47
64
|
---
|
|
48
65
|
|
|
49
|
-
### PHASE 1 — Test Case Reading and
|
|
66
|
+
### PHASE 1 — Test Case Reading, Analysis and Business Inference
|
|
50
67
|
|
|
51
|
-
**Objective**: Understand what is being tested
|
|
68
|
+
**Objective**: Understand what is being tested, what data each case needs, and **which business/domain the cases target** — confirming it with the user before proceeding.
|
|
52
69
|
|
|
53
70
|
**Actions**:
|
|
54
71
|
1. Read the complete CSV/Excel file
|
|
@@ -61,7 +78,32 @@ Execute these phases in order. Do not skip any. Show the result of each phase to
|
|
|
61
78
|
- Specific required values (amounts, dates, statuses, etc.)
|
|
62
79
|
- Data preconditions
|
|
63
80
|
|
|
64
|
-
**
|
|
81
|
+
**1.A — Business inference (confirmation GATE)**:
|
|
82
|
+
|
|
83
|
+
From the language of the cases (products, processes, terminology, amounts, units), **deduce which type of business the data targets**. This guides the realism of the values generated (item names, customers, warehouses, plausible amounts for that industry).
|
|
84
|
+
|
|
85
|
+
Present the inference to the user explicitly and **wait for confirmation**:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
From the content of the cases, I deduce the data targets:
|
|
89
|
+
>> "A clothing store" <<
|
|
90
|
+
Clues: items like "polo shirt", "regular t-shirt"; inventory-out process by
|
|
91
|
+
warehouse; sizes/colors as attributes.
|
|
92
|
+
|
|
93
|
+
Is this business correct?
|
|
94
|
+
- If you confirm, I will generate items, customers and amounts coherent with a clothing store.
|
|
95
|
+
- If not, tell me which business this data targets.
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
- If the user **confirms** → synthetic data is generated coherent with that business.
|
|
99
|
+
- If the user **corrects** → use the business they indicate.
|
|
100
|
+
- If the cases are too generic to infer a business → **ask the user directly** which business the data targets, instead of assuming.
|
|
101
|
+
|
|
102
|
+
Record the confirmed business: it is used to name the output folder and as the header of `test-data.md`.
|
|
103
|
+
|
|
104
|
+
**Output**:
|
|
105
|
+
1. Business confirmed by the user
|
|
106
|
+
2. Summary table with: Case ID | Type | Entities involved | Critical required data
|
|
65
107
|
|
|
66
108
|
---
|
|
67
109
|
|
|
@@ -274,11 +316,21 @@ MCP: read_data("SELECT 'table1' as table, COUNT(*) as records FROM schema.table1
|
|
|
274
316
|
|
|
275
317
|
---
|
|
276
318
|
|
|
277
|
-
### PHASE 7 — Report and
|
|
319
|
+
### PHASE 7 — Deliverables: Report, test-data.md, seed.sql and rollback.sql
|
|
320
|
+
|
|
321
|
+
**Objective**: Document everything inserted and produce the **three on-disk artifacts**.
|
|
322
|
+
|
|
323
|
+
This phase produces, in addition to the on-screen report, **three files** written with the file-writing tool (not just chat blocks):
|
|
278
324
|
|
|
279
|
-
|
|
325
|
+
| Deliverable | File | Purpose |
|
|
326
|
+
|-------------|------|---------|
|
|
327
|
+
| 1. Case→data relation | `test-data.md` | Which data to use/was created per case; grouping cases that share the same seed. Designed for an AI agent (Playwright) to automate the cases. |
|
|
328
|
+
| 2. Executable seed | `seed.sql` | Idempotent, transactional insertions to reload the dataset into a fresh DB without re-running the process. |
|
|
329
|
+
| 3. Rollback | `rollback.sql` | Reverts exactly what was inserted in this run, without touching prior QA data. |
|
|
280
330
|
|
|
281
|
-
|
|
331
|
+
The three are written to the output path defined in Activation. After writing them, list the absolute paths of each file to the user.
|
|
332
|
+
|
|
333
|
+
**7.1 Generated data report** (on screen):
|
|
282
334
|
|
|
283
335
|
```
|
|
284
336
|
EXECUTION SUMMARY
|
|
@@ -304,40 +356,105 @@ TOTAL RECORDS REUSED: 7
|
|
|
304
356
|
TEST CASES COVERED: 10/10 (100%)
|
|
305
357
|
```
|
|
306
358
|
|
|
307
|
-
**7.2
|
|
359
|
+
**7.2 Deliverable 1 — `test-data.md` (case→data relation, grouped)**:
|
|
360
|
+
|
|
361
|
+
Write a Markdown file that states, **per case**, with which data it can be executed: which **already exist** and which **were created**. The goal is that ALL cases end with sufficient data associated and that an AI agent (Playwright) can read the **literal values** (codes, names, amounts) it must use in the UI — not just internal DB IDs.
|
|
362
|
+
|
|
363
|
+
**Grouping rule (key)**: if several cases run with **exactly the same data seed**, do NOT repeat the data per case — group them in a single block (e.g., "Cases CP-001 to CP-010"). Only open individual blocks for cases with their own data (typically EDGE and NEGATIVE, which require specific values).
|
|
364
|
+
|
|
365
|
+
File structure:
|
|
366
|
+
|
|
367
|
+
```markdown
|
|
368
|
+
# Test Data — <Business confirmed in Phase 1>
|
|
369
|
+
|
|
370
|
+
- **Process/module**: [name]
|
|
371
|
+
- **Database**: [DB name]
|
|
372
|
+
- **Generation date**: [date]
|
|
373
|
+
- **Run ID**: QA_<date>_<seq> <!-- common marker of all records in this run -->
|
|
308
374
|
|
|
309
|
-
|
|
375
|
+
> Convention: values in **bold** are typed/selected in the UI.
|
|
376
|
+
> The `id=` in parentheses are internal DB references (for traceability/rollback).
|
|
310
377
|
|
|
378
|
+
## Shared base data
|
|
379
|
+
Apply to most cases unless a case states otherwise.
|
|
380
|
+
|
|
381
|
+
| Entity | Value to use in UI | DB id | Status |
|
|
382
|
+
|--------|--------------------|-------|--------|
|
|
383
|
+
| Company | **CMPQA — Clothing Store QA** | 1 | reused |
|
|
384
|
+
| Document type | **Inventory out (SAL-INV)** | 12 | reused |
|
|
385
|
+
| Warehouse | **Main Warehouse (BOD-001)** | 3 | reused |
|
|
386
|
+
|
|
387
|
+
## Case groups
|
|
388
|
+
|
|
389
|
+
### Cases CP-001 to CP-007 — Inventory out, positive flow
|
|
390
|
+
**They share the same seed.** Any of these cases can be tested with:
|
|
391
|
+
- Company: **CMPQA** (id=1)
|
|
392
|
+
- Document type: **Inventory out** (id=12)
|
|
393
|
+
- Items in stock:
|
|
394
|
+
- **Polo Shirt (ITM-POLO-001)** — id=2001 — stock 500 in Main Warehouse
|
|
395
|
+
- **Regular T-shirt (ITM-TEE-001)** — id=2002 — stock 500 in Main Warehouse
|
|
396
|
+
- Source warehouse: **Main Warehouse (BOD-001)** — id=3
|
|
397
|
+
|
|
398
|
+
Data: reused (nothing new was inserted for these cases).
|
|
399
|
+
|
|
400
|
+
### CP-008 — Edge: out for the maximum quantity in stock
|
|
401
|
+
- Item: **Polo Shirt Edge (ITM-POLO-MAX)** — id=2050 — exact stock 999999
|
|
402
|
+
- Rest of the seed equal to the shared base data.
|
|
403
|
+
|
|
404
|
+
Data: **created** core.items id=2050 (`QA_<run>_ITM_POLO_MAX`).
|
|
405
|
+
|
|
406
|
+
### CP-009 — Negative: out greater than stock
|
|
407
|
+
- Item: **Out-of-stock shirt (ITM-NOSTOCK)** — id=2051 — stock 0
|
|
408
|
+
- Expected result: controlled error "insufficient stock".
|
|
409
|
+
|
|
410
|
+
Data: **created** core.items id=2051 (`QA_<run>_ITM_NOSTOCK`).
|
|
411
|
+
|
|
412
|
+
## Coverage
|
|
413
|
+
Total cases: N — all with sufficient data associated (X reuse base data, Y with their own data).
|
|
311
414
|
```
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
415
|
+
|
|
416
|
+
Adapt entities, columns and values to what the real schema returned and to the confirmed business. The essential thing: **each case is mapped to concrete data, and cases with an identical seed are grouped in a single block.**
|
|
417
|
+
|
|
418
|
+
**7.3 Deliverable 2 — `seed.sql` (executable, idempotent insertion)**:
|
|
419
|
+
|
|
420
|
+
In addition to inserting directly via MCP (Phase 6), write a `seed.sql` that reproduces **exactly the same insertions**, in Phase 3 order (parents → children). Its purpose: if a fresh/clean DB is reached, running this `.sql` is enough to have the complete seed without re-running the whole analysis process.
|
|
421
|
+
|
|
422
|
+
`seed.sql` requirements:
|
|
423
|
+
1. **Transactional**: wrapped in `BEGIN; ... COMMIT;` so it is all-or-nothing.
|
|
424
|
+
2. **Idempotent**: use `INSERT ... ON CONFLICT DO NOTHING` (PostgreSQL) or `IF NOT EXISTS` guards (SQL Server) so re-running does not fail or duplicate.
|
|
425
|
+
3. **Run-marked**: every record carries the `Run ID` (e.g., in code/notes `QA_<date>_<seq>`), so the rollback can be scoped.
|
|
426
|
+
4. **Correct order**: catalogs/root → master → focal → children, same as Phase 6.
|
|
427
|
+
5. **Commented per case**: head each block with the cases it covers (e.g., `-- Covers CP-001..CP-007`).
|
|
428
|
+
6. **Only what was created**: do NOT include records marked REUSABLE (those already exist). If a reused base record is needed for the `.sql` to run on an empty DB, include it with `ON CONFLICT DO NOTHING` and comment it as "base data (may already exist)".
|
|
429
|
+
|
|
430
|
+
```sql
|
|
431
|
+
-- ===============================================
|
|
432
|
+
-- SEED — QA Synthetic Data
|
|
433
|
+
-- Business: <confirmed business> | Process: [name]
|
|
434
|
+
-- Target DB: [name] | Date: [date] | Run: QA_<date>_<seq>
|
|
435
|
+
-- EXECUTE ONLY IN TEST ENVIRONMENT
|
|
436
|
+
-- ===============================================
|
|
437
|
+
BEGIN;
|
|
438
|
+
|
|
439
|
+
-- Covers CP-001..CP-007 (base data)
|
|
440
|
+
INSERT INTO masterdata.items (code, name, notes, ...)
|
|
441
|
+
VALUES ('ITM-POLO-001', 'Polo Shirt', 'QA_<run> [SYNTHETIC DATA]', ...)
|
|
442
|
+
ON CONFLICT (code) DO NOTHING;
|
|
443
|
+
|
|
444
|
+
-- ... rest in parents -> children order ...
|
|
445
|
+
|
|
446
|
+
COMMIT;
|
|
330
447
|
```
|
|
331
448
|
|
|
332
|
-
**7.3
|
|
449
|
+
**7.4 Deliverable 3 — `rollback.sql`**:
|
|
333
450
|
|
|
334
|
-
|
|
451
|
+
Write a `rollback.sql` that deletes ONLY the data inserted in this run, in reverse order (children first, parents after):
|
|
335
452
|
|
|
336
453
|
```sql
|
|
337
454
|
-- ===============================================
|
|
338
455
|
-- ROLLBACK — QA Synthetic Data
|
|
339
|
-
-- Process: [name]
|
|
340
|
-
-- Generation date: [date]
|
|
456
|
+
-- Business: <confirmed business> | Process: [name]
|
|
457
|
+
-- Generation date: [date] | Run: QA_<date>_<seq>
|
|
341
458
|
-- EXECUTE ONLY IN TEST ENVIRONMENT
|
|
342
459
|
-- ===============================================
|
|
343
460
|
|
|
@@ -372,9 +489,9 @@ MCP: execute_query("BEGIN; DELETE FROM ... ; COMMIT;")
|
|
|
372
489
|
|
|
373
490
|
If the execution only generated data for some cases (others were REUSABLE), the rollback must clean up **only** the records inserted in this run. Do not touch previously reused QA data. Scope the DELETE by specific IDs or a run marker (e.g., date suffix `QA_INVOICE_20260420_050`) instead of a broad `LIKE 'QA_%'`.
|
|
374
491
|
|
|
375
|
-
**7.
|
|
492
|
+
**7.5 Special case — No insertions required**:
|
|
376
493
|
|
|
377
|
-
If Phase 4 determined that all cases are REUSABLE, there is no new data
|
|
494
|
+
If Phase 4 determined that all cases are REUSABLE, there is no new data: **`seed.sql` and `rollback.sql` are NOT generated**. However, you **MUST still write `test-data.md`** with the case→data relation of existing data (same grouped blocks as 7.2, but all in "reused" status), so the team/AI agent knows which IDs and values to use. Deliver this report to the user:
|
|
378
495
|
|
|
379
496
|
```
|
|
380
497
|
RESULT: NO NEW DATA WAS GENERATED
|
|
@@ -410,18 +527,22 @@ NEXT STEPS:
|
|
|
410
527
|
## General Rules
|
|
411
528
|
|
|
412
529
|
### What you MUST ALWAYS do
|
|
530
|
+
- **Infer the business and confirm it with the user before generating anything** (Phase 1.A)
|
|
413
531
|
- Query real schemas via MCP before generating any data
|
|
414
532
|
- **Search for existing QA data and perform case-by-case matching before deciding to generate**
|
|
415
533
|
- Verify that FKs point to records that exist
|
|
416
534
|
- Show the user the plan (including which cases are REUSABLE) before inserting
|
|
417
535
|
- Report errors immediately with full detail
|
|
418
|
-
-
|
|
536
|
+
- **Write deliverables to disk**: `test-data.md` always; `seed.sql` and `rollback.sql` when there were insertions
|
|
537
|
+
- **Group in `test-data.md` cases that share the same seed** (do not repeat data per case)
|
|
538
|
+
- Mark all records of the run with the same `Run ID` to scope the rollback
|
|
419
539
|
|
|
420
540
|
### What you must NEVER do
|
|
421
541
|
- Invent column names without querying the schema
|
|
422
542
|
- Assume data types without verifying
|
|
423
543
|
- **Generate duplicate data when QA records already exist that satisfy the case**
|
|
424
544
|
- **Insert data "just in case" when Phase 4 matching said REUSABLE**
|
|
545
|
+
- Write deliverables as chat blocks instead of files on disk
|
|
425
546
|
- Insert into production tables (always verify the environment)
|
|
426
547
|
- Modify or delete data that was not created by this process
|
|
427
548
|
- Continue inserting if a dependency failed
|
|
@@ -448,16 +569,17 @@ NEXT STEPS:
|
|
|
448
569
|
|
|
449
570
|
**AI**:
|
|
450
571
|
1. Read the CSV → 15 test cases (10 positive, 3 edge, 2 negative)
|
|
451
|
-
2.
|
|
452
|
-
3.
|
|
453
|
-
4.
|
|
454
|
-
5.
|
|
572
|
+
2. **Infer the business**: "From the cases, I deduce an invoicing distributor/retailer. Correct?" → user confirms
|
|
573
|
+
3. Identify entities: invoices, invoice_detail, customers, products, salespeople
|
|
574
|
+
4. Query schemas via MCP → obtain columns, types, FKs for each table
|
|
575
|
+
5. Search existing QA data → find 5 `QA_INVOICE_*` invoices and 3 `QA_CUSTOMER_*` customers
|
|
576
|
+
6. Perform case-by-case matching:
|
|
455
577
|
- 4 cases REUSABLE (QA invoices already apply)
|
|
456
578
|
- 2 cases PARTIAL (QA customer exists, invoice missing)
|
|
457
579
|
- 9 cases MISSING
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
580
|
+
7. Present plan: "7 records reused. Will insert 2 invoices + 9 new invoices + 33 lines"
|
|
581
|
+
8. User approves → insert in order: [missing] customers → invoices → invoice_detail
|
|
582
|
+
9. **Write the 3 deliverables**: `test-data.md` (cases grouped by seed), `seed.sql` (idempotent) and `rollback.sql` (scoped to this run's IDs); list the paths to the user
|
|
461
583
|
|
|
462
584
|
---
|
|
463
585
|
|
|
@@ -471,8 +593,8 @@ NEXT STEPS:
|
|
|
471
593
|
2. Identify entities and query schemas via MCP
|
|
472
594
|
3. Search existing QA data → find 12 `QA_INVOICE_*` invoices, 5 `QA_CUSTOMER_*` customers, associated detail
|
|
473
595
|
4. Case-by-case matching → all 10 cases are REUSABLE
|
|
474
|
-
5. Deliver report 7.
|
|
475
|
-
6. Phases 5, 6 are not executed
|
|
596
|
+
5. Deliver report 7.5: **"No new data was generated"** + **write `test-data.md`** with the list of existing IDs to use per test case
|
|
597
|
+
6. Phases 5, 6 are not executed; no `seed.sql` or `rollback.sql` is generated
|
|
476
598
|
|
|
477
599
|
---
|
|
478
600
|
|
|
@@ -481,5 +603,6 @@ NEXT STEPS:
|
|
|
481
603
|
If the configured MCP is for SQL Server (`mcp_mssql`), the flow is identical but:
|
|
482
604
|
- Tool names remain the same
|
|
483
605
|
- The dependency function is `dbo.GetAllDependencies_JSON` instead of `get_all_dependencies_json`
|
|
484
|
-
-
|
|
606
|
+
- The scripts (`seed.sql` and `rollback.sql`) use `BEGIN TRANSACTION` / `COMMIT` instead of `BEGIN` / `COMMIT`
|
|
607
|
+
- For idempotency in `seed.sql`, use `IF NOT EXISTS (SELECT 1 FROM ... WHERE ...) INSERT ...` instead of `INSERT ... ON CONFLICT DO NOTHING`
|
|
485
608
|
- Use `TOP N` instead of `LIMIT N` for queries
|
package/package.json
CHANGED
package/siesa-agents/bmm/workflows/3-solutioning/quality-process/prompts/prompt_design_test.md
CHANGED
|
@@ -993,6 +993,35 @@ consecuencia de negocio y estrategia de mitigación recomendada.
|
|
|
993
993
|
|
|
994
994
|
---
|
|
995
995
|
|
|
996
|
+
### VII. EXPORTACIÓN ESTRUCTURADA (YAML)
|
|
997
|
+
|
|
998
|
+
Además de la Matriz Integral en Markdown (Sección V), genera un archivo
|
|
999
|
+
`test-design-{modulo}.yml` con la siguiente estructura:
|
|
1000
|
+
|
|
1001
|
+
**Estructura del YAML:**
|
|
1002
|
+
|
|
1003
|
+
1. `metadata` — workflow, phase, methodology, project, mode, features_in_scope, batch_info
|
|
1004
|
+
2. `gatekeeper` — clasificación de historias (Lógica de Negocio vs Ruido Técnico)
|
|
1005
|
+
3. `features` — FAC Gherkin + blind_spots por feature
|
|
1006
|
+
4. `dependencies` — relaciones entre features
|
|
1007
|
+
5. `test_matrix` — todos los casos de la Matriz Integral con `steps` como ARRAY:
|
|
1008
|
+
- Campos 1–9 y 11–13: igual que la tabla Markdown
|
|
1009
|
+
- Campo 10 (`steps`): expandir a array de objetos con `paso`, `accion`, `resultado`, `datos`
|
|
1010
|
+
- Regla: 1 paso = 1 acción atómica. NO agrupar múltiples acciones en un paso.
|
|
1011
|
+
6. `tsr` — métricas, distribución por nivel, pending_batches
|
|
1012
|
+
7. `traceability` — mapeo FAC → casos
|
|
1013
|
+
|
|
1014
|
+
**Regla de consistencia:** El YAML debe contener exactamente los mismos casos
|
|
1015
|
+
que la Matriz Markdown. Si la matriz tiene N filas, el YAML tiene N entries
|
|
1016
|
+
en `test_matrix`. Cero desviaciones.
|
|
1017
|
+
|
|
1018
|
+
**Consumidores del YAML:**
|
|
1019
|
+
- AgileTest (`create_agiletest_issues.py`) — crea Test Cases + Test Steps en Jira
|
|
1020
|
+
- Agente Ejecutor E2E — genera `.spec.ts` Playwright desde los pasos
|
|
1021
|
+
- Motor de Datos — lee `datos` por paso para generar seeds en BD
|
|
1022
|
+
|
|
1023
|
+
---
|
|
1024
|
+
|
|
996
1025
|
## 📋 Lista de Verificación del Arquitecto (Auto-revisión antes de entregar)
|
|
997
1026
|
|
|
998
1027
|
Antes de entregar el diseño de pruebas, verifica cada punto:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: quality-process
|
|
3
3
|
description: "QA Quality Process — Phase 1 Planning (BMAD V6.0 test design), Phase 2 Design (QA Test Plan & Strategy), Phase 3 AgileTest Registration (push validated design to Jira/AgileTest), Phase 4 DOR Gate (verify Definition of Ready checklist), Phase 5 Playwright Implementation (generate E2E test code from test-cases.csv gaps), or Phase 6 QA Data Generation (provision synthetic test data in the real DB via MCP from the Fase 2 test-cases.csv, reusing existing QA data before generating). Asks at startup which phase to execute."
|
|
4
4
|
web_bundle: true
|
|
5
|
-
version: 1.
|
|
5
|
+
version: 1.2.0
|
|
6
6
|
parameters:
|
|
7
7
|
feature_id:
|
|
8
8
|
description: 'Opcional: Feature ID a procesar (ej: "feature-1"). Solo aplica para la Fase 2 — Diseño.'
|
|
@@ -19,7 +19,7 @@ parameters:
|
|
|
19
19
|
- **Fase 3 — Registro AgileTest:** Empuja el diseño validado a Jira/AgileTest con trazabilidad completa.
|
|
20
20
|
- **Fase 4 — DOR Gate:** Verifica que el requerimiento cumple el Definition of Ready (DoR) antes de iniciar cualquier labor de construcción. Genera reporte pass/fail por ítem.
|
|
21
21
|
- **Fase 5 — Implementación Playwright:** Toma el `test-cases.csv` generado en Fase 2, identifica automáticamente los tests sin cobertura en los spec files existentes, clasifica cada test por tecnología (Playwright E2E, Vitest Unit, .NET xUnit), genera el código Playwright para los gaps, lo inyecta en los spec files con aprobación humana y actualiza el CSV.
|
|
22
|
-
- **Fase 6 — Generación de Datos QA:** Toma el `test-cases.csv` generado en Fase 2 y, conectándose a la base de datos real vía MCP (PostgreSQL/SQL Server), reutiliza datos QA existentes antes de generar; provisiona únicamente los datos sintéticos faltantes con integridad referencial, bajo aprobación humana, y entrega
|
|
22
|
+
- **Fase 6 — Generación de Datos QA:** Toma el `test-cases.csv` generado en Fase 2 y, conectándose a la base de datos real vía MCP (PostgreSQL/SQL Server), infiere y confirma el negocio, reutiliza datos QA existentes antes de generar; provisiona únicamente los datos sintéticos faltantes con integridad referencial, bajo aprobación humana, y entrega 3 artefactos en disco: `test-data.md` (relación caso→datos agrupada por seed, lista para Playwright), `seed.sql` idempotente y `rollback.sql` acotado a la corrida. Delega en la skill `sa-qa-data-generator`.
|
|
23
23
|
|
|
24
24
|
**Your Role:** Además de tu nombre, communication_style y persona, actúas como **QA Architect Senior** con 10+ años de experiencia en sistemas empresariales complejos (ERP, HCM, CRM, plataformas financieras, compliance regulatorio). Piensas como defensor del negocio, no solo como técnico de pruebas. Trabajas bajo la metodología BMAD v6.0.
|
|
25
25
|
|
|
@@ -84,8 +84,9 @@ Preguntar al usuario qué fase del proceso de calidad desea ejecutar:
|
|
|
84
84
|
6️⃣ Generación de Datos QA
|
|
85
85
|
— Provisiona datos sintéticos en la base de datos real (vía MCP)
|
|
86
86
|
para que los casos diseñados en Fase 2 puedan ejecutarse.
|
|
87
|
-
|
|
88
|
-
faltante con aprobación humana y entrega
|
|
87
|
+
Infiere y confirma el negocio, reutiliza datos QA existentes antes
|
|
88
|
+
de generar, inserta solo lo faltante con aprobación humana y entrega
|
|
89
|
+
3 artefactos: test-data.md, seed.sql y rollback.sql.
|
|
89
90
|
(Requiere: Fase 2 completada — test-cases.csv + MCP de BD conectado)
|
|
90
91
|
|
|
91
92
|
¿Qué fase deseas ejecutar?
|
|
@@ -111,7 +112,7 @@ Preguntar al usuario qué fase del proceso de calidad desea ejecutar:
|
|
|
111
112
|
},
|
|
112
113
|
{
|
|
113
114
|
"label": "Fase 6 — Generación de Datos QA",
|
|
114
|
-
"description": "Provisiona datos sintéticos en la BD real (vía MCP) desde el test-cases.csv de Fase 2: reutiliza datos QA existentes, inserta solo lo faltante con gate de aprobación y entrega
|
|
115
|
+
"description": "Provisiona datos sintéticos en la BD real (vía MCP) desde el test-cases.csv de Fase 2: infiere y confirma el negocio, reutiliza datos QA existentes, inserta solo lo faltante con gate de aprobación y entrega test-data.md + seed.sql + rollback.sql"
|
|
115
116
|
}
|
|
116
117
|
]
|
|
117
118
|
}
|
|
@@ -705,7 +706,15 @@ test_matrix: # Sección V — Matriz Integral 360° (13 col
|
|
|
705
706
|
technique: <Técnica>
|
|
706
707
|
scenario: <Escenario>
|
|
707
708
|
preconditions: <Precondiciones>
|
|
708
|
-
steps:
|
|
709
|
+
steps: # ARRAY de pasos — 1 paso = 1 acción atómica (NO agrupar)
|
|
710
|
+
- paso: 1
|
|
711
|
+
accion: <acción concreta del paso>
|
|
712
|
+
resultado: <resultado verificable de ese paso>
|
|
713
|
+
datos: <datos usados en ese paso — insumo del Motor de Datos>
|
|
714
|
+
- paso: 2
|
|
715
|
+
accion: <...>
|
|
716
|
+
resultado: <...>
|
|
717
|
+
datos: <...>
|
|
709
718
|
expected_result: <Resultado Esperado>
|
|
710
719
|
risk: <Riesgo IxP> # ej. "4x3=12"
|
|
711
720
|
priority: <Prioridad> # P0 | P1 | P2 | P3
|
|
@@ -728,10 +737,15 @@ traceability: # Apéndice — Matriz de Trazabilidad
|
|
|
728
737
|
- ✅ Usar **Write tool ONLY** (encoding UTF-8). NUNCA bash, cat, echo, sed, awk.
|
|
729
738
|
- ✅ Construir el string YAML completo en memoria y llamar Write una sola vez.
|
|
730
739
|
- ✅ Los valores con `:`, `#`, comillas o saltos de línea deben ir entre comillas dobles o como
|
|
731
|
-
bloque literal (`|`).
|
|
740
|
+
bloque literal (`|`).
|
|
741
|
+
- ✅ **`steps` es un ARRAY de objetos** (`paso`, `accion`, `resultado`, `datos`), NO un string.
|
|
742
|
+
Regla: **1 paso = 1 acción atómica** — prohibido agrupar múltiples acciones en un solo paso.
|
|
743
|
+
El campo `datos` por paso es el insumo que el Motor de Datos (Fase 6) lee para generar seeds,
|
|
744
|
+
y el Agente Ejecutor E2E usa los pasos para generar el `.spec.ts` de Playwright.
|
|
732
745
|
- ✅ Las claves `mode`, `interface_type`, `dependencies` deben ser congruentes con la Fase 0:
|
|
733
746
|
en Modo Feature → `dependencies: []`; en Modo Completo → `interface_type: null`.
|
|
734
747
|
- ✅ El `test_matrix` debe tener **una entrada por cada fila** de la matriz (mismo conteo que el CSV).
|
|
748
|
+
El array `steps` de cada caso debe reflejar exactamente los pasos de la columna `Pasos` del Markdown.
|
|
735
749
|
|
|
736
750
|
Guardar como: `{implementation_artifacts}/quality-process/diseno/test-design-YYYY-MM-DD-HHmmss/test-design.yml` (en la raíz, junto a `test-cases.csv`, NO en shards/)
|
|
737
751
|
|
|
@@ -1850,9 +1864,9 @@ Presentar al usuario:
|
|
|
1850
1864
|
|
|
1851
1865
|
### Objetivo
|
|
1852
1866
|
|
|
1853
|
-
Provisionar en la base de datos real (vía MCP) los datos sintéticos que los casos de prueba diseñados en la Fase 2 necesitan para poder ejecutarse. Esta fase **reutiliza los datos QA ya existentes** antes de generar nada, inserta únicamente lo faltante respetando integridad referencial y tipos reales, y entrega
|
|
1867
|
+
Provisionar en la base de datos real (vía MCP) los datos sintéticos que los casos de prueba diseñados en la Fase 2 necesitan para poder ejecutarse. Esta fase **infiere y confirma el negocio** con el usuario, **reutiliza los datos QA ya existentes** antes de generar nada, inserta únicamente lo faltante respetando integridad referencial y tipos reales, y entrega **3 artefactos en disco**: `test-data.md` (relación caso→datos agrupada por seed, orientada a Playwright), `seed.sql` idempotente y `rollback.sql` acotado a la corrida.
|
|
1854
1868
|
|
|
1855
|
-
**Principio:** "Reutilizar antes de generar. No se inserta nada sin aprobación humana. Es válido y esperado que una corrida termine con **0 inserciones** si toda la cobertura ya existe."
|
|
1869
|
+
**Principio:** "Reutilizar antes de generar. No se inserta nada sin aprobación humana. Es válido y esperado que una corrida termine con **0 inserciones** si toda la cobertura ya existe — pero aun así se escribe `test-data.md`."
|
|
1856
1870
|
|
|
1857
1871
|
**Fuente de verdad:** El protocolo de 7 fases vive en la skill `sa-qa-data-generator`. Esta fase orquesta esa skill dentro del ciclo de calidad para que el QA no tenga que invocarla como un comando aparte — el insumo es el `test-cases.csv` que la propia Fase 2 produjo.
|
|
1858
1872
|
|
|
@@ -1949,6 +1963,9 @@ Una vez el MCP esté conectado, vuelve a ejecutar la Fase 6.
|
|
|
1949
1963
|
|
|
1950
1964
|
3. **Ejecutar las Fases 1–4 del protocolo** (sin inserción todavía):
|
|
1951
1965
|
- PHASE 1 — Lectura y análisis de casos (clasificación POSITIVE / EDGE / NEGATIVE)
|
|
1966
|
+
- **PHASE 1.A — Inferencia y confirmación del negocio (GATE):** deducir el negocio/dominio
|
|
1967
|
+
al que apuntan los casos, presentarlo al usuario y **esperar confirmación** antes de seguir.
|
|
1968
|
+
El negocio confirmado encabeza `test-data.md` y nombra la carpeta de salida (F6.6).
|
|
1952
1969
|
- PHASE 2 — Descubrimiento de esquema vía MCP (NUNCA asumir columnas/tipos)
|
|
1953
1970
|
- PHASE 3 — Construcción del árbol de entidades (orden de inserción)
|
|
1954
1971
|
- PHASE 4 — Verificación de datos existentes y matching caso-por-caso (REUSABLE / PARTIAL / MISSING)
|
|
@@ -1956,12 +1973,16 @@ Una vez el MCP esté conectado, vuelve a ejecutar la Fase 6.
|
|
|
1956
1973
|
Notificar al usuario durante la ejecución:
|
|
1957
1974
|
```
|
|
1958
1975
|
⚙️ Agente de Datos QA — analizando casos contra la BD real:
|
|
1959
|
-
• PHASE 1:
|
|
1960
|
-
• PHASE
|
|
1961
|
-
• PHASE
|
|
1962
|
-
• PHASE
|
|
1976
|
+
• PHASE 1: Lectura y clasificación de casos
|
|
1977
|
+
• PHASE 1.A: Inferencia del negocio (requiere confirmación del usuario)
|
|
1978
|
+
• PHASE 2: Descubrimiento de esquemas (MCP)
|
|
1979
|
+
• PHASE 3: Árbol de entidades y orden de inserción
|
|
1980
|
+
• PHASE 4: Matching contra datos QA existentes (reutilizar antes de generar)
|
|
1963
1981
|
```
|
|
1964
1982
|
|
|
1983
|
+
> El GATE de PHASE 1.A es **no omisible**: si el usuario no confirma el negocio (o corrige),
|
|
1984
|
+
> no se continúa a PHASE 2.
|
|
1985
|
+
|
|
1965
1986
|
---
|
|
1966
1987
|
|
|
1967
1988
|
### F6.4: Gate de Aprobación Humana (OBLIGATORIO)
|
|
@@ -1983,7 +2004,7 @@ Presentar el resultado del matching de PHASE 4:
|
|
|
1983
2004
|
```
|
|
1984
2005
|
|
|
1985
2006
|
**Si la decisión es "0 inserciones":**
|
|
1986
|
-
- No hay nada que aprobar. Saltar F6.5 e ir directo a F6.6 con el reporte 7.
|
|
2007
|
+
- No hay nada que aprobar. Saltar F6.5 e ir directo a F6.6 con el reporte 7.5 ("No se generaron datos nuevos"); se escribe **`test-data.md`** con todos los bloques en estado "reusado" y los IDs existentes a usar por caso (no se generan `seed.sql` ni `rollback.sql`).
|
|
1987
2008
|
|
|
1988
2009
|
**Si hay al menos un caso PARTIAL o MISSING**, preguntar:
|
|
1989
2010
|
```json
|
|
@@ -2022,35 +2043,40 @@ Presentar el resultado del matching de PHASE 4:
|
|
|
2022
2043
|
|
|
2023
2044
|
Ejecutar únicamente para los casos PARTIAL/MISSING aprobados:
|
|
2024
2045
|
|
|
2025
|
-
- PHASE 5 — Generación de datos (tipos reales, columnas NOT NULL, FKs válidas, marcador `QA_`/`TEST_`/`[SYNTHETIC DATA]`, sin PII real)
|
|
2026
|
-
- PHASE 6 — Inserción en BD en orden estricto del árbol (raíz/catálogo → maestras → focales → detalle → SP/funciones)
|
|
2046
|
+
- PHASE 5 — Generación de datos (tipos reales, columnas NOT NULL, FKs válidas, marcador `QA_`/`TEST_`/`[SYNTHETIC DATA]`, sin PII real). Asignar un **ID de corrida** común (`QA_<fecha>_<seq>`) a todos los registros para poder acotar el rollback.
|
|
2047
|
+
- PHASE 6 — Inserción en BD en orden estricto del árbol (raíz/catálogo → maestras → focales → detalle → SP/funciones) **y, en paralelo, escritura de `seed.sql`** que reproduce las mismas inserciones (transaccional, idempotente con `ON CONFLICT DO NOTHING` / `IF NOT EXISTS`, comentado por caso, ordenado padres→hijos). Se guarda en F6.6.
|
|
2027
2048
|
|
|
2028
2049
|
**Tras cada inserción:** verificar éxito. Si falla por FK/constraint/tipo: NO continuar con dependientes, diagnosticar re-consultando el esquema, corregir y reintentar; si no se resuelve, informar al usuario y detener.
|
|
2029
2050
|
|
|
2030
2051
|
---
|
|
2031
2052
|
|
|
2032
|
-
### F6.6: Guardar
|
|
2053
|
+
### F6.6: Guardar los 3 Entregables
|
|
2033
2054
|
|
|
2034
2055
|
**Generar timestamp:** `YYYY-MM-DD-HHmmss`
|
|
2035
2056
|
|
|
2036
|
-
**
|
|
2057
|
+
**Slug del negocio:** derivar de la PHASE 1.A un slug kebab-case del negocio confirmado (ej. "Una tienda de ropa" → `tienda-de-ropa`).
|
|
2058
|
+
|
|
2059
|
+
**Crear carpeta:** `{implementation_artifacts}/quality-process/datos/data-gen-{negocio-slug}-YYYY-MM-DD-HHmmss/`
|
|
2037
2060
|
|
|
2038
|
-
Guardar
|
|
2061
|
+
Guardar los archivos (usar **Write tool**, encoding UTF-8). Construir cada string completo en memoria y llamar Write una sola vez — **NUNCA** bash/cat/echo/sed:
|
|
2039
2062
|
|
|
2040
|
-
1. **`data
|
|
2041
|
-
-
|
|
2042
|
-
-
|
|
2043
|
-
-
|
|
2063
|
+
1. **`test-data.md`** (entregable 1 — PHASE 7.2) — **se escribe SIEMPRE**, incluso con 0 inserciones:
|
|
2064
|
+
- Encabezado `# Test Data — {negocio confirmado}` + metadata (proceso, BD, fecha, **ID de corrida**).
|
|
2065
|
+
- Tabla-resumen de ejecución al inicio (REUSABLE / PARTIAL / MISSING, insertados vs reutilizados).
|
|
2066
|
+
- Relación caso→datos **agrupada por seed**: casos con seed idéntico en un solo bloque; solo borde/negativo abren bloque individual. Valores literales (negrita = se digita en UI) + `id=` de BD para trazabilidad.
|
|
2067
|
+
- Si fueron 0 inserciones: todos los bloques en estado "reusado" (reporte 7.5).
|
|
2044
2068
|
|
|
2045
2069
|
**Frontmatter:**
|
|
2046
2070
|
```yaml
|
|
2047
2071
|
---
|
|
2048
2072
|
workflow: quality-process
|
|
2049
2073
|
phase: datos
|
|
2050
|
-
version: 1.
|
|
2074
|
+
version: 1.1.0
|
|
2051
2075
|
engine: sa-qa-data-generator
|
|
2052
2076
|
generated_date: [ISO 8601 date]
|
|
2053
2077
|
project_name: {project_name}
|
|
2078
|
+
negocio: [negocio confirmado en PHASE 1.A]
|
|
2079
|
+
run_id: QA_<fecha>_<seq>
|
|
2054
2080
|
source_csv: [ruta relativa]/test-cases.csv
|
|
2055
2081
|
db_engine: postgresql | mssql
|
|
2056
2082
|
inserciones: [N]
|
|
@@ -2059,7 +2085,9 @@ Guardar dos archivos (usar **Write tool**, encoding UTF-8):
|
|
|
2059
2085
|
---
|
|
2060
2086
|
```
|
|
2061
2087
|
|
|
2062
|
-
2. **`
|
|
2088
|
+
2. **`seed.sql`** (entregable 2 — PHASE 7.3) — **solo si hubo inserciones**. Transaccional, idempotente (`ON CONFLICT DO NOTHING` / `IF NOT EXISTS` en SQL Server), ordenado padres→hijos, comentado por caso (`-- Cubre CP-...`), marcado con el ID de corrida, solo registros creados (no REUSABLE). Si fueron 0 inserciones, no generar este archivo.
|
|
2089
|
+
|
|
2090
|
+
3. **`rollback.sql`** (entregable 3 — PHASE 7.4) — **solo si hubo inserciones**, acotado a los IDs/marcador de **esta** corrida (no un `LIKE 'QA_%'` amplio que borre datos reutilizados de corridas previas). Si fueron 0 inserciones, no generar este archivo.
|
|
2063
2091
|
|
|
2064
2092
|
**No tocar** datos previamente reutilizados ni datos que no fueron creados por esta corrida.
|
|
2065
2093
|
|
|
@@ -2072,7 +2100,9 @@ Presentar al usuario:
|
|
|
2072
2100
|
```
|
|
2073
2101
|
✅ FASE 6 — GENERACIÓN DE DATOS QA COMPLETADA
|
|
2074
2102
|
|
|
2075
|
-
📁 Carpeta: {implementation_artifacts}/quality-process/datos/data-gen-YYYY-MM-DD-HHmmss/
|
|
2103
|
+
📁 Carpeta: {implementation_artifacts}/quality-process/datos/data-gen-{negocio-slug}-YYYY-MM-DD-HHmmss/
|
|
2104
|
+
|
|
2105
|
+
🏷️ Negocio confirmado: [negocio de PHASE 1.A]
|
|
2076
2106
|
|
|
2077
2107
|
📊 Resumen:
|
|
2078
2108
|
• Casos de prueba: [M]
|
|
@@ -2084,10 +2114,11 @@ Presentar al usuario:
|
|
|
2084
2114
|
• Cobertura de datos: [N/M] casos
|
|
2085
2115
|
|
|
2086
2116
|
📄 Archivos:
|
|
2087
|
-
• data
|
|
2088
|
-
•
|
|
2117
|
+
• test-data.md — relación caso→datos agrupada por seed (lista para Playwright)
|
|
2118
|
+
• seed.sql — inserciones idempotentes recargables {o "no generado (0 inserciones)"}
|
|
2119
|
+
• rollback.sql — limpieza acotada a esta corrida {o "no generado (0 inserciones)"}
|
|
2089
2120
|
|
|
2090
|
-
⚠️
|
|
2121
|
+
⚠️ seed.sql y rollback.sql deben ejecutarse SOLO en ambientes de prueba.
|
|
2091
2122
|
```
|
|
2092
2123
|
|
|
2093
2124
|
**⚠️ El workflow termina aquí. El equipo de QA puede ejecutar los casos usando los IDs reportados.**
|