@abubakarsiddiik/qa 0.0.0-stage → 0.1.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.
Files changed (67) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +32 -2
  3. package/dist/checks.d.ts +18 -0
  4. package/dist/checks.d.ts.map +1 -0
  5. package/dist/checks.js +88 -0
  6. package/dist/checks.js.map +1 -0
  7. package/dist/config.d.ts +57 -0
  8. package/dist/config.d.ts.map +1 -0
  9. package/dist/config.js +143 -0
  10. package/dist/config.js.map +1 -0
  11. package/dist/errors.d.ts +8 -0
  12. package/dist/errors.d.ts.map +1 -0
  13. package/dist/errors.js +12 -0
  14. package/dist/errors.js.map +1 -0
  15. package/dist/fixtures.d.ts +19 -0
  16. package/dist/fixtures.d.ts.map +1 -0
  17. package/dist/fixtures.js +103 -0
  18. package/dist/fixtures.js.map +1 -0
  19. package/dist/git.d.ts +6 -0
  20. package/dist/git.d.ts.map +1 -0
  21. package/dist/git.js +32 -0
  22. package/dist/git.js.map +1 -0
  23. package/dist/harness.d.ts +23 -0
  24. package/dist/harness.d.ts.map +1 -0
  25. package/dist/harness.js +140 -0
  26. package/dist/harness.js.map +1 -0
  27. package/dist/index.d.ts +15 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +15 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/mcp-stdio.d.ts +2 -0
  32. package/dist/mcp-stdio.d.ts.map +1 -0
  33. package/dist/mcp-stdio.js +23 -0
  34. package/dist/mcp-stdio.js.map +1 -0
  35. package/dist/mcp.d.ts +13 -0
  36. package/dist/mcp.d.ts.map +1 -0
  37. package/dist/mcp.js +223 -0
  38. package/dist/mcp.js.map +1 -0
  39. package/dist/plan.d.ts +33 -0
  40. package/dist/plan.d.ts.map +1 -0
  41. package/dist/plan.js +80 -0
  42. package/dist/plan.js.map +1 -0
  43. package/dist/report.d.ts +10 -0
  44. package/dist/report.d.ts.map +1 -0
  45. package/dist/report.js +67 -0
  46. package/dist/report.js.map +1 -0
  47. package/dist/runner.d.ts +77 -0
  48. package/dist/runner.d.ts.map +1 -0
  49. package/dist/runner.js +542 -0
  50. package/dist/runner.js.map +1 -0
  51. package/dist/service.d.ts +84 -0
  52. package/dist/service.d.ts.map +1 -0
  53. package/dist/service.js +301 -0
  54. package/dist/service.js.map +1 -0
  55. package/dist/spec.d.ts +512 -0
  56. package/dist/spec.d.ts.map +1 -0
  57. package/dist/spec.js +325 -0
  58. package/dist/spec.js.map +1 -0
  59. package/dist/store.d.ts +148 -0
  60. package/dist/store.d.ts.map +1 -0
  61. package/dist/store.js +438 -0
  62. package/dist/store.js.map +1 -0
  63. package/dist/types.d.ts +9 -0
  64. package/dist/types.d.ts.map +1 -0
  65. package/dist/types.js +2 -0
  66. package/dist/types.js.map +1 -0
  67. package/package.json +49 -3
@@ -0,0 +1,103 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { QaError } from "./errors.js";
3
+ export function loadFixtures(path) {
4
+ if (!existsSync(path))
5
+ return {};
6
+ let parsed;
7
+ try {
8
+ parsed = JSON.parse(readFileSync(path, "utf8"));
9
+ }
10
+ catch (error) {
11
+ throw new QaError("fixture_missing", `${path} is not valid JSON: ${error.message}`);
12
+ }
13
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
14
+ throw new QaError("fixture_missing", `${path} must contain a JSON object`);
15
+ }
16
+ const fixtures = {};
17
+ for (const [name, value] of Object.entries(parsed)) {
18
+ if (value === null || typeof value !== "object" || Array.isArray(value)) {
19
+ throw new QaError("fixture_missing", `fixture "${name}" must be an object`);
20
+ }
21
+ fixtures[name] = value;
22
+ }
23
+ return fixtures;
24
+ }
25
+ const PLACEHOLDER = /\$\{(fixture|env)\.([A-Za-z0-9_.-]+)\}/g;
26
+ /**
27
+ * Resolve `${fixture.user.email}` and `${env.QA_PASSWORD}` in any JSON value.
28
+ *
29
+ * A missing fixture or environment variable is a typed failure, never the
30
+ * literal placeholder. Secrets are redacted before anything is written.
31
+ */
32
+ export function resolveValues(value, context) {
33
+ if (typeof value === "string")
34
+ return resolveString(value, context);
35
+ if (Array.isArray(value))
36
+ return value.map((item) => resolveValues(item, context));
37
+ if (value !== null && typeof value === "object") {
38
+ const result = {};
39
+ for (const [key, item] of Object.entries(value)) {
40
+ result[key] = resolveValues(item, context);
41
+ }
42
+ return result;
43
+ }
44
+ return value;
45
+ }
46
+ function resolveString(value, context) {
47
+ return value.replace(PLACEHOLDER, (_match, scope, path) => {
48
+ if (scope === "env") {
49
+ const found = context.env[path];
50
+ if (found === undefined) {
51
+ throw new QaError("fixture_missing", `environment variable ${path} is not set`);
52
+ }
53
+ return found;
54
+ }
55
+ const [name, ...rest] = path.split(".");
56
+ const fixture = name === undefined ? undefined : context.fixtures[name];
57
+ if (fixture === undefined) {
58
+ throw new QaError("fixture_missing", `fixture "${name ?? path}" is not defined`);
59
+ }
60
+ let current = fixture;
61
+ for (const segment of rest) {
62
+ if (current === null || typeof current !== "object") {
63
+ throw new QaError("fixture_missing", `fixture "${path}" has no value`);
64
+ }
65
+ current = current[segment];
66
+ }
67
+ if (current === undefined) {
68
+ throw new QaError("fixture_missing", `fixture "${path}" has no value`);
69
+ }
70
+ return String(current);
71
+ });
72
+ }
73
+ /** Replace every configured secret-like token in a string. */
74
+ export function redactText(value, redact) {
75
+ let result = value;
76
+ for (const token of redact) {
77
+ if (token.length === 0)
78
+ continue;
79
+ const pattern = new RegExp(escapeRegExp(token), "gi");
80
+ result = result.replace(pattern, "[redacted]");
81
+ }
82
+ return result;
83
+ }
84
+ /** Deep-redact values whose key looks secret. */
85
+ export function redactValues(value, redact) {
86
+ if (typeof value === "string")
87
+ return redactText(value, redact);
88
+ if (Array.isArray(value))
89
+ return value.map((item) => redactValues(item, redact));
90
+ if (value !== null && typeof value === "object") {
91
+ const result = {};
92
+ for (const [key, item] of Object.entries(value)) {
93
+ const secretKey = redact.some((token) => key.toLowerCase().includes(token.toLowerCase()));
94
+ result[key] = secretKey ? "[redacted]" : redactValues(item, redact);
95
+ }
96
+ return result;
97
+ }
98
+ return value;
99
+ }
100
+ function escapeRegExp(value) {
101
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
102
+ }
103
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../src/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAUtC,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IAEjC,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,OAAO,CAAC,iBAAiB,EAAE,GAAG,IAAI,uBAAwB,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IACjG,CAAC;IAED,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3E,MAAM,IAAI,OAAO,CAAC,iBAAiB,EAAE,GAAG,IAAI,6BAA6B,CAAC,CAAC;IAC7E,CAAC;IAED,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAiC,CAAC,EAAE,CAAC;QAC9E,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACxE,M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 * Files changed relative to `baseRef`, including staged, unstaged, and
3
+ * untracked files. A missing git repo is an empty diff, not a crash.
4
+ */
5
+ export declare function gitChangedFiles(root: string, baseRef: string): string[];
6
+ //# sourceMappingURL=git.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAyBvE"}
package/dist/git.js ADDED
@@ -0,0 +1,32 @@
1
+ import { execFileSync } from "node:child_process";
2
+ /**
3
+ * Files changed relative to `baseRef`, including staged, unstaged, and
4
+ * untracked files. A missing git repo is an empty diff, not a crash.
5
+ */
6
+ export function gitChangedFiles(root, baseRef) {
7
+ const files = new Set();
8
+ const run = (args) => {
9
+ try {
10
+ return execFileSync("git", args, {
11
+ cwd: root,
12
+ encoding: "utf8",
13
+ stdio: ["ignore", "pipe", "ignore"],
14
+ })
15
+ .split("\n")
16
+ .map((line) => line.trim())
17
+ .filter((line) => line.length > 0);
18
+ }
19
+ catch {
20
+ return [];
21
+ }
22
+ };
23
+ for (const path of run(["diff", "--name-only", "--relative", `${baseRef}...HEAD`])) {
24
+ files.add(path);
25
+ }
26
+ for (const path of run(["diff", "--name-only", "--relative"]))
27
+ files.add(path);
28
+ for (const path of run(["ls-files", "--others", "--exclude-standard"]))
29
+ files.add(path);
30
+ return [...files].sort();
31
+ }
32
+ //# sourceMappingURL=git.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,OAAe;IAC3D,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAEhC,MAAM,GAAG,GAAG,CAAC,IAAc,EAAY,EAAE;QACvC,IAAI,CAAC;YACH,OAAO,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE;gBAC/B,GAAG,EAAE,IAAI;gBACT,QAAQ,EAAE,MAAM;gBAChB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;aACpC,CAAC;iBACC,KAAK,CAAC,IAAI,CAAC;iBACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;iBAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACvC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,OAAO,SAAS,CAAC,CAAC,EAAE,CAAC;QACnF,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;QAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/E,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,oBAAoB,CAAC,CAAC;QAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAExF,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,23 @@
1
+ export type HarnessName = "claude" | "codex" | "cursor" | "opencode" | "gemini" | "vscode" | "unknown";
2
+ export type QaInitOptions = {
3
+ root: string;
4
+ baseUrl?: string;
5
+ force?: boolean;
6
+ };
7
+ export type QaInitResult = {
8
+ root: string;
9
+ files: string[];
10
+ skipped: string[];
11
+ harnesses: HarnessName[];
12
+ mcpSnippet: string;
13
+ };
14
+ declare const MCP_SNIPPET: string;
15
+ /**
16
+ * Wire QA into a coding harness: config, dirs, skill, ignore rules, and the
17
+ * MCP entry. It never overwrites a file without `force`.
18
+ */
19
+ export declare function qaInit(options: QaInitOptions): QaInitResult;
20
+ export declare function detectHarnesses(root: string): HarnessName[];
21
+ export declare const QA_SKILL = "---\nname: portolan-qa\ndescription: Generate, run, and repair end-to-end tests against the local app with Portolan QA. Use after code changes, when the user asks to test a flow, or when a test fails. The runner is deterministic; you author and repair the cases.\n---\n\n# Portolan QA\n\nThe app under test is local. Cases are JSON files under `qa/cases/`. Runs and\nevidence live under `.portolan/`. You are the test author; the runner replays\nwhat you write.\n\n## The loop\n\n1. After a change, call `qa_plan` with `changed: true`. It returns the cases\n the diff touches and any case that is not verified.\n2. Run the selection with `qa_run`. Do not run the whole suite unless asked.\n3. On a failure, call `qa_result` for the case. Read `fail_code`, the failed\n step, expected vs actual, and the evidence paths. Branch on the code:\n - `assertion_failed` \u2014 the app or the expectation is wrong.\n - `not_found`, `stale_ref`, `not_interactive` \u2014 the UI moved; repair the\n locator, then verify.\n - `harness_error` \u2014 the app or browser is not ready; call `qa_doctor`.\n - `unknown_outcome` \u2014 a write may have happened. Stop. Do not retry.\n4. Fix the app or the case, then rerun the affected case.\n\n## Authoring\n\n- Write one case per file with `qa_case_write`. The id must match the path:\n `auth/login` lives in `qa/cases/auth/login.json`.\n- Prefer semantic targets: `{ role, name }`, `{ label }`, or `{ test_id }`.\n Never use CSS selectors.\n- Assert with `expect` checks: `url`, `visible`, `absent`, `text`, `value`.\n- Reference fixtures as `${fixture.user.email}` and secrets as\n `${env.QA_PASSWORD}`. Never write a secret into a case.\n- A new case is written as `draft`. Call `qa_verify` to replay it on fresh\n sessions; only then is it `verified`.\n- Editing a verified case makes it a draft again. That is correct.\n\n## Rules\n\n- Never mark a case verified by editing its JSON. Use `qa_verify`.\n- Never run unverified cases in CI without `allow_unverified`.\n- Never retry a write whose result is `unknown_outcome`.\n- Keep evidence out of git; `.portolan/` is ignored.\n- If the diff selects nothing, say so and ask whether to run a suite.\n";
22
+ export { MCP_SNIPPET };
23
+ //# sourceMappingURL=harness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../src/harness.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,QAAA,MAAM,WAAW,QAWZ,CAAC;AAEN;;;GAGG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,YAAY,CAuD3D;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CAY3D;AAmBD,eAAO,MAAM,QAAQ,oqEA6CpB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,140 @@
1
+ import { appendFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { DEFAULT_QA_CONFIG, QA_CONFIG_FILE, QA_CONFIG_KEY } from "./config.js";
4
+ const MCP_SNIPPET = `${JSON.stringify({
5
+ mcpServers: {
6
+ "portolan-qa": {
7
+ command: "npx",
8
+ args: ["-y", "-p", "@abubakarsiddiik/qa", "portolan-qa"],
9
+ },
10
+ },
11
+ }, null, 2)}\n`;
12
+ /**
13
+ * Wire QA into a coding harness: config, dirs, skill, ignore rules, and the
14
+ * MCP entry. It never overwrites a file without `force`.
15
+ */
16
+ export function qaInit(options) {
17
+ const root = options.root;
18
+ const force = options.force ?? false;
19
+ const files = [];
20
+ const skipped = [];
21
+ const write = (path, body) => {
22
+ if (existsSync(path) && !force) {
23
+ skipped.push(path);
24
+ return;
25
+ }
26
+ mkdirSync(join(path, ".."), { recursive: true });
27
+ writeFileSync(path, body, "utf8");
28
+ files.push(path);
29
+ };
30
+ const configPath = join(root, QA_CONFIG_FILE);
31
+ const config = readConfig(configPath);
32
+ const existingQa = config[QA_CONFIG_KEY] !== null &&
33
+ typeof config[QA_CONFIG_KEY] === "object" &&
34
+ !Array.isArray(config[QA_CONFIG_KEY])
35
+ ? config[QA_CONFIG_KEY]
36
+ : {};
37
+ config[QA_CONFIG_KEY] = {
38
+ ...existingQa,
39
+ baseUrl: options.baseUrl ??
40
+ (typeof existingQa.baseUrl === "string" ? existingQa.baseUrl : DEFAULT_QA_CONFIG.baseUrl),
41
+ };
42
+ write(configPath, `${JSON.stringify(config, null, 2)}\n`);
43
+ mkdirSync(join(root, DEFAULT_QA_CONFIG.cases), { recursive: true });
44
+ mkdirSync(join(root, DEFAULT_QA_CONFIG.suites), { recursive: true });
45
+ const skillPath = join(root, "skills", "portolan-qa", "SKILL.md");
46
+ write(skillPath, QA_SKILL);
47
+ const harnesses = detectHarnesses(root);
48
+ if (harnesses.includes("claude")) {
49
+ write(join(root, ".mcp.json"), MCP_SNIPPET);
50
+ }
51
+ const ignorePath = join(root, ".gitignore");
52
+ const ignore = existsSync(ignorePath) ? readFileSync(ignorePath, "utf8") : "";
53
+ if (!ignore.split("\n").some((line) => line.trim() === ".portolan/")) {
54
+ if (ignore.length > 0 && !ignore.endsWith("\n"))
55
+ appendFileSync(ignorePath, "\n", "utf8");
56
+ appendFileSync(ignorePath, ".portolan/\n", "utf8");
57
+ files.push(ignorePath);
58
+ }
59
+ return { root, files, skipped, harnesses, mcpSnippet: MCP_SNIPPET };
60
+ }
61
+ export function detectHarnesses(root) {
62
+ const found = [];
63
+ const has = (path) => existsSync(join(root, path));
64
+ if (has(".claude") || has("CLAUDE.md"))
65
+ found.push("claude");
66
+ if (has(".codex") || has("AGENTS.md"))
67
+ found.push("codex");
68
+ if (has(".cursor") || has(".cursorrules"))
69
+ found.push("cursor");
70
+ if (has("opencode.json") || has("opencode.jsonc") || has(".opencode"))
71
+ found.push("opencode");
72
+ if (has(".gemini") || has("GEMINI.md"))
73
+ found.push("gemini");
74
+ if (has(".vscode"))
75
+ found.push("vscode");
76
+ return found.length === 0 ? ["unknown"] : found;
77
+ }
78
+ function readConfig(path) {
79
+ if (!existsSync(path))
80
+ return {};
81
+ let parsed;
82
+ try {
83
+ parsed = JSON.parse(readFileSync(path, "utf8"));
84
+ }
85
+ catch (error) {
86
+ throw new Error(`${path} is not valid JSON: ${error.message}`);
87
+ }
88
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
89
+ throw new Error(`${path} must contain a JSON object`);
90
+ }
91
+ return parsed;
92
+ }
93
+ export const QA_SKILL = `---
94
+ name: portolan-qa
95
+ description: Generate, run, and repair end-to-end tests against the local app with Portolan QA. Use after code changes, when the user asks to test a flow, or when a test fails. The runner is deterministic; you author and repair the cases.
96
+ ---
97
+
98
+ # Portolan QA
99
+
100
+ The app under test is local. Cases are JSON files under \`qa/cases/\`. Runs and
101
+ evidence live under \`.portolan/\`. You are the test author; the runner replays
102
+ what you write.
103
+
104
+ ## The loop
105
+
106
+ 1. After a change, call \`qa_plan\` with \`changed: true\`. It returns the cases
107
+ the diff touches and any case that is not verified.
108
+ 2. Run the selection with \`qa_run\`. Do not run the whole suite unless asked.
109
+ 3. On a failure, call \`qa_result\` for the case. Read \`fail_code\`, the failed
110
+ step, expected vs actual, and the evidence paths. Branch on the code:
111
+ - \`assertion_failed\` — the app or the expectation is wrong.
112
+ - \`not_found\`, \`stale_ref\`, \`not_interactive\` — the UI moved; repair the
113
+ locator, then verify.
114
+ - \`harness_error\` — the app or browser is not ready; call \`qa_doctor\`.
115
+ - \`unknown_outcome\` — a write may have happened. Stop. Do not retry.
116
+ 4. Fix the app or the case, then rerun the affected case.
117
+
118
+ ## Authoring
119
+
120
+ - Write one case per file with \`qa_case_write\`. The id must match the path:
121
+ \`auth/login\` lives in \`qa/cases/auth/login.json\`.
122
+ - Prefer semantic targets: \`{ role, name }\`, \`{ label }\`, or \`{ test_id }\`.
123
+ Never use CSS selectors.
124
+ - Assert with \`expect\` checks: \`url\`, \`visible\`, \`absent\`, \`text\`, \`value\`.
125
+ - Reference fixtures as \`\${fixture.user.email}\` and secrets as
126
+ \`\${env.QA_PASSWORD}\`. Never write a secret into a case.
127
+ - A new case is written as \`draft\`. Call \`qa_verify\` to replay it on fresh
128
+ sessions; only then is it \`verified\`.
129
+ - Editing a verified case makes it a draft again. That is correct.
130
+
131
+ ## Rules
132
+
133
+ - Never mark a case verified by editing its JSON. Use \`qa_verify\`.
134
+ - Never run unverified cases in CI without \`allow_unverified\`.
135
+ - Never retry a write whose result is \`unknown_outcome\`.
136
+ - Keep evidence out of git; \`.portolan/\` is ignored.
137
+ - If the diff selects nothing, say so and ask whether to run a suite.
138
+ `;
139
+ export { MCP_SNIPPET };
140
+ //# sourceMappingURL=harness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"harness.js","sourceRoot":"","sources":["../src/harness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7F,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAyB/E,MAAM,WAAW,GAAG,GAAG,IAAI,CAAC,SAAS,CACnC;IACE,UAA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AAC,SAAS,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAEzC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAClD,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC9B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IAEjC,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,uBAAwB,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3E,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,6BAA6B,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,MAAiC,CAAC;AAC3C,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CvB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ export * from "./checks.js";
2
+ export * from "./config.js";
3
+ export * from "./errors.js";
4
+ export * from "./fixtures.js";
5
+ export * from "./git.js";
6
+ export * from "./harness.js";
7
+ export * from "./mcp.js";
8
+ export * from "./plan.js";
9
+ export * from "./report.js";
10
+ export * from "./runner.js";
11
+ export * from "./service.js";
12
+ export * from "./spec.js";
13
+ export * from "./store.js";
14
+ export * from "./types.js";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ export * from "./checks.js";
2
+ export * from "./config.js";
3
+ export * from "./errors.js";
4
+ export * from "./fixtures.js";
5
+ export * from "./git.js";
6
+ export * from "./harness.js";
7
+ export * from "./mcp.js";
8
+ export * from "./plan.js";
9
+ export * from "./report.js";
10
+ export * from "./runner.js";
11
+ export * from "./service.js";
12
+ export * from "./spec.js";
13
+ export * from "./store.js";
14
+ export * from "./types.js";
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=mcp-stdio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-stdio.d.ts","sourceRoot":"","sources":["../src/mcp-stdio.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
2
+ import { loadQaConfig } from "./config.js";
3
+ import { createQaMcpServer } from "./mcp.js";
4
+ import { QaService } from "./service.js";
5
+ /**
6
+ * stdio entry point. stdout belongs to the protocol, so nothing is printed.
7
+ */
8
+ const { config } = loadQaConfig();
9
+ const service = new QaService(config);
10
+ const server = createQaMcpServer(service);
11
+ await server.connect(new StdioServerTransport());
12
+ const shutdown = async () => {
13
+ try {
14
+ await server.close();
15
+ service.close();
16
+ }
17
+ finally {
18
+ process.exit(0);
19
+ }
20
+ };
21
+ process.on("SIGINT", shutdown);
22
+ process.on("SIGTERM", shutdown);
23
+ //# sourceMappingURL=mcp-stdio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-stdio.js","sourceRoot":"","sources":["../src/mcp-stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;GAEG;AACH,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE,CAAC;AAClC,MAAM,OAAO,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC;AACtC,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAE1C,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;AAEjD,MAAM,QAAQ,GAAG,KAAK,IAAmB,EAAE;IACzC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACrB,OAAO,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC/B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC"}
package/dist/mcp.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { QaService } from "./service.js";
3
+ export type QaMcpDeps = {
4
+ service?: QaService;
5
+ };
6
+ /**
7
+ * The QA MCP server. It is separate from the site-map server so a coding
8
+ * agent sees only the QA tools and pays only for them.
9
+ */
10
+ export declare function createQaMcpServer(service: QaService, deps?: QaMcpDeps): McpServer;
11
+ /** Connect a QA MCP server to stdio. Used by `portolan qa mcp`. */
12
+ export declare function startQaMcpServer(service: QaService): Promise<McpServer>;
13
+ //# sourceMappingURL=mcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOpE,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,cAAc,CAAC;AAKzD,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAkDF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,GAAE,SAAc,GAAG,SAAS,CAoQrF;AAED,mEAAmE;AACnE,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAI7E"}