supipowers 0.3.0 → 0.5.0
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/package.json +1 -1
- package/skills/fix-pr/SKILL.md +99 -0
- package/skills/qa-strategy/SKILL.md +103 -21
- package/src/commands/fix-pr.ts +324 -0
- package/src/commands/qa.ts +232 -148
- package/src/commands/supi.ts +2 -1
- package/src/config/defaults.ts +1 -0
- package/src/config/schema.ts +1 -0
- package/src/fix-pr/config.ts +36 -0
- package/src/fix-pr/prompt-builder.ts +201 -0
- package/src/fix-pr/scripts/diff-comments.sh +33 -0
- package/src/fix-pr/scripts/fetch-pr-comments.sh +25 -0
- package/src/fix-pr/scripts/trigger-review.sh +36 -0
- package/src/fix-pr/scripts/wait-and-check.sh +37 -0
- package/src/fix-pr/types.ts +71 -0
- package/src/index.ts +2 -0
- package/src/qa/config.ts +43 -0
- package/src/qa/matrix.ts +84 -0
- package/src/qa/prompt-builder.ts +212 -0
- package/src/qa/scripts/detect-app-type.sh +68 -0
- package/src/qa/scripts/discover-routes.sh +143 -0
- package/src/qa/scripts/ensure-playwright.sh +38 -0
- package/src/qa/scripts/run-e2e-tests.sh +99 -0
- package/src/qa/scripts/start-dev-server.sh +46 -0
- package/src/qa/scripts/stop-dev-server.sh +36 -0
- package/src/qa/session.ts +39 -55
- package/src/qa/types.ts +97 -0
- package/src/storage/fix-pr-sessions.ts +59 -0
- package/src/storage/qa-sessions.ts +9 -9
- package/src/types.ts +1 -70
- package/src/qa/detector.ts +0 -61
- package/src/qa/phases/discovery.ts +0 -34
- package/src/qa/phases/execution.ts +0 -65
- package/src/qa/phases/matrix.ts +0 -41
- package/src/qa/phases/reporting.ts +0 -71
- package/src/qa/report.ts +0 -22
- package/src/qa/runner.ts +0 -46
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { QaSessionLedger } from "../../types.js";
|
|
2
|
-
|
|
3
|
-
export function buildReportingPrompt(ledger: QaSessionLedger): string {
|
|
4
|
-
const passed = ledger.results.filter((r) => r.status === "pass").length;
|
|
5
|
-
const failed = ledger.results.filter((r) => r.status === "fail").length;
|
|
6
|
-
const skipped = ledger.results.filter((r) => r.status === "skip").length;
|
|
7
|
-
const total = ledger.results.length;
|
|
8
|
-
|
|
9
|
-
const failedList = ledger.results
|
|
10
|
-
.filter((r) => r.status === "fail")
|
|
11
|
-
.map((r) => {
|
|
12
|
-
const test = ledger.tests.find((t) => t.id === r.testId);
|
|
13
|
-
return `- ${test?.testName ?? r.testId}: ${r.error ?? "no error captured"}`;
|
|
14
|
-
})
|
|
15
|
-
.join("\n");
|
|
16
|
-
|
|
17
|
-
const matrixSummary = ledger.matrix.length > 0
|
|
18
|
-
? ledger.matrix
|
|
19
|
-
.map((m) => `- ${m.requirement}: ${m.coverage} coverage (${m.testIds.length} tests)`)
|
|
20
|
-
.join("\n")
|
|
21
|
-
: "No traceability matrix available.";
|
|
22
|
-
|
|
23
|
-
const sections: string[] = [
|
|
24
|
-
"# QA Phase: Reporting",
|
|
25
|
-
"",
|
|
26
|
-
`Framework: ${ledger.framework}`,
|
|
27
|
-
`Session: ${ledger.id}`,
|
|
28
|
-
"",
|
|
29
|
-
"## Execution Summary",
|
|
30
|
-
"",
|
|
31
|
-
`- Total: ${total}`,
|
|
32
|
-
`- Passed: ${passed}`,
|
|
33
|
-
`- Failed: ${failed}`,
|
|
34
|
-
`- Skipped: ${skipped}`,
|
|
35
|
-
`- Pass rate: ${total > 0 ? Math.round((passed / total) * 100) : 0}%`,
|
|
36
|
-
"",
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
if (failed > 0) {
|
|
40
|
-
sections.push("## Failed Tests", "", failedList, "");
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
sections.push(
|
|
44
|
-
"## Traceability Matrix",
|
|
45
|
-
"",
|
|
46
|
-
matrixSummary,
|
|
47
|
-
"",
|
|
48
|
-
"## Task",
|
|
49
|
-
"",
|
|
50
|
-
"Analyze the test results and traceability matrix above. Produce a QA report summary that includes:",
|
|
51
|
-
"",
|
|
52
|
-
"1. Overall assessment of test health",
|
|
53
|
-
"2. Coverage gaps identified from the matrix",
|
|
54
|
-
"3. Recommendations for improving coverage",
|
|
55
|
-
"4. Risk areas where failures cluster",
|
|
56
|
-
"",
|
|
57
|
-
"## Expected Output",
|
|
58
|
-
"",
|
|
59
|
-
"Write a JSON object to the QA session ledger's `report` field:",
|
|
60
|
-
"",
|
|
61
|
-
"```json",
|
|
62
|
-
`{ "generatedAt": "ISO timestamp", "total": ${total}, "passed": ${passed}, "failed": ${failed}, "skipped": ${skipped}, "passRate": ${total > 0 ? Math.round((passed / total) * 100) : 0}, "failedTests": [...], "coverageSummary": "free-text analysis" }`,
|
|
63
|
-
"```",
|
|
64
|
-
"",
|
|
65
|
-
"## After Completion",
|
|
66
|
-
"",
|
|
67
|
-
"Update the QA session ledger with the report, mark the reporting phase as completed. The QA pipeline is now complete.",
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
return sections.join("\n");
|
|
71
|
-
}
|
package/src/qa/report.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
|
|
4
|
-
export interface QaReport {
|
|
5
|
-
timestamp: string;
|
|
6
|
-
framework: string;
|
|
7
|
-
scope: string;
|
|
8
|
-
totalTests: number;
|
|
9
|
-
passed: number;
|
|
10
|
-
failed: number;
|
|
11
|
-
skipped: number;
|
|
12
|
-
failures: { name: string; file: string; error: string }[];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function saveQaReport(cwd: string, report: QaReport): string {
|
|
16
|
-
const dir = path.join(cwd, ".omp", "supipowers", "reports");
|
|
17
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
18
|
-
const filename = `qa-${report.timestamp.slice(0, 10)}.json`;
|
|
19
|
-
const filePath = path.join(dir, filename);
|
|
20
|
-
fs.writeFileSync(filePath, JSON.stringify(report, null, 2) + "\n");
|
|
21
|
-
return filePath;
|
|
22
|
-
}
|
package/src/qa/runner.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export function buildQaRunPrompt(
|
|
2
|
-
command: string,
|
|
3
|
-
scope: "all" | "changed" | "e2e",
|
|
4
|
-
changedFiles?: string[]
|
|
5
|
-
): string {
|
|
6
|
-
const sections: string[] = ["# QA Pipeline", ""];
|
|
7
|
-
|
|
8
|
-
switch (scope) {
|
|
9
|
-
case "all":
|
|
10
|
-
sections.push(`Run the full test suite: \`${command}\``);
|
|
11
|
-
break;
|
|
12
|
-
case "changed":
|
|
13
|
-
sections.push(
|
|
14
|
-
"Run tests related to changed files only:",
|
|
15
|
-
...(changedFiles ?? []).map((f) => `- ${f}`),
|
|
16
|
-
"",
|
|
17
|
-
`Base command: \`${command}\``,
|
|
18
|
-
"Filter to only tests relevant to the files above."
|
|
19
|
-
);
|
|
20
|
-
break;
|
|
21
|
-
case "e2e":
|
|
22
|
-
sections.push(
|
|
23
|
-
"Run end-to-end tests only.",
|
|
24
|
-
"Use Playwright or the configured E2E framework.",
|
|
25
|
-
"Command: `npx playwright test`"
|
|
26
|
-
);
|
|
27
|
-
break;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
sections.push(
|
|
31
|
-
"",
|
|
32
|
-
"Report results in this format:",
|
|
33
|
-
"- Total tests: N",
|
|
34
|
-
"- Passed: N",
|
|
35
|
-
"- Failed: N",
|
|
36
|
-
"- Skipped: N",
|
|
37
|
-
"",
|
|
38
|
-
"For each failure, include:",
|
|
39
|
-
"- Test name",
|
|
40
|
-
"- File path",
|
|
41
|
-
"- Error message",
|
|
42
|
-
"- Stack trace (first 5 lines)"
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
return sections.join("\n");
|
|
46
|
-
}
|