qatools-cli 1.2.11 → 1.2.13

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 (2) hide show
  1. package/package.json +30 -27
  2. package/qatools.js +35 -27
package/package.json CHANGED
@@ -1,27 +1,30 @@
1
- {
2
- "name": "qatools-cli",
3
- "version": "1.2.11",
4
- "description": "CLI for QA Tools — requirements, epics, sprints, sessions, App Context sync, project agenda. The companion to qa-tools.com.",
5
- "scripts": {
6
- "release": "npm version patch --no-git-tag-version && npm publish",
7
- "release:minor": "npm version minor --no-git-tag-version && npm publish"
8
- },
9
- "bin": {
10
- "qatools": "qatools.js"
11
- },
12
- "files": [
13
- "qatools.js"
14
- ],
15
- "keywords": [
16
- "qa",
17
- "testing",
18
- "claude",
19
- "ai",
20
- "test-management"
21
- ],
22
- "license": "MIT",
23
- "dependencies": {
24
- "firebase": "^11.0.0",
25
- "commander": "^12.0.0"
26
- }
27
- }
1
+ {
2
+ "name": "qatools-cli",
3
+ "version": "1.2.13",
4
+ "description": "CLI for QA Tools — requirements, epics, sprints, sessions, App Context sync, project agenda. The companion to qa-tools.com.",
5
+ "scripts": {
6
+ "release": "npm version patch --no-git-tag-version && npm publish",
7
+ "release:minor": "npm version minor --no-git-tag-version && npm publish"
8
+ },
9
+ "bin": {
10
+ "qatools": "qatools.js"
11
+ },
12
+ "files": [
13
+ "qatools.js"
14
+ ],
15
+ "keywords": [
16
+ "qa",
17
+ "testing",
18
+ "claude",
19
+ "ai",
20
+ "test-management"
21
+ ],
22
+ "license": "MIT",
23
+ "dependencies": {
24
+ "firebase": "^11.0.0",
25
+ "commander": "^12.0.0"
26
+ },
27
+ "overrides": {
28
+ "@grpc/grpc-js": "^1.14.6"
29
+ }
30
+ }
package/qatools.js CHANGED
@@ -708,7 +708,8 @@ program
708
708
  const res = (await httpsCallable(functions, "uploadTestRun")({ projectId, run: meta, results })).data;
709
709
  console.log(`Uploaded run ${res.runId}.`);
710
710
  for (const r of res.requirements) {
711
- const change = r.statusAfter !== r.statusBefore ? ` ${r.statusBefore} → ${r.statusAfter}` : "";
711
+ const change = r.statusAfter !== r.statusBefore ? ` ${r.statusBefore} → ${r.statusAfter}`
712
+ : r.manualPending ? " stays implemented — manual tests in an approved protocol remain" : "";
712
713
  const sig = r.signal ? ` signal ${r.signal}` : "";
713
714
  console.log(` ${r.failed ? "✗" : "✓"} ${r.key}: ${r.ran - r.failed}/${r.ran} passed${r.skipped ? `, ${r.skipped} skipped` : ""}${change}${sig}`);
714
715
  }
@@ -937,6 +938,8 @@ program
937
938
  .description("List templates and their review status")
938
939
  .option("--project <id>", "Target project ID (overrides default)")
939
940
  .option("--status <status>", "Filter: draft, pending_review, approved, rejected")
941
+ .option("--json", "Output as JSON with sections and test cases (stdout)")
942
+ .option("-o, --output <file>", "Write JSON with sections and test cases to file")
940
943
  .option("-e, --email <email>", "Login email")
941
944
  .option("-p, --password <password>", "Login password")
942
945
  .action(async (options) => {
@@ -947,8 +950,15 @@ program
947
950
 
948
951
  const listTemplates = httpsCallable(functions, "listTemplates");
949
952
  try {
950
- const result = await listTemplates({ projectId, status: options.status || null });
953
+ const full = !!(options.json || options.output);
954
+ const result = await listTemplates({ projectId, status: options.status || null, includeSections: full });
951
955
  const templates = result.data.templates;
956
+ if (options.json) { console.log(JSON.stringify(templates, null, 2)); process.exit(0); }
957
+ if (options.output) {
958
+ fs.writeFileSync(options.output, JSON.stringify(templates, null, 2));
959
+ console.log(`Written ${templates.length} template${templates.length !== 1 ? "s" : ""} to ${options.output}`);
960
+ process.exit(0);
961
+ }
952
962
  if (templates.length === 0) {
953
963
  console.log("No templates found.");
954
964
  } else {
@@ -973,8 +983,9 @@ program
973
983
  .option("--epic <key>", "Only reqs linked to this epic")
974
984
  .option("--no-epic", "Only reqs WITHOUT an epic")
975
985
  .option("--type <type>", "Filter by type: functional, non-functional")
976
- .option("--with-coverage", "Only reqs that have at least one test case in any template")
977
- .option("--without-coverage", "Only reqs with NO test coverage")
986
+ .option("--with-coverage", "Only reqs with test coverage (see --coverage-source)")
987
+ .option("--without-coverage", "Only reqs with NO test coverage (see --coverage-source)")
988
+ .option("--coverage-source <source>", "What counts as coverage: template (manual test cases), automated (qatools test-report runs) or any", "any")
978
989
  .option("--include-superseded", "Include superseded reqs (hidden by default)")
979
990
  .option("--json", "Output as JSON to stdout (machine-readable)")
980
991
  .option("-o, --output <file>", "Write JSON output to file")
@@ -1009,27 +1020,21 @@ program
1009
1020
  // Type
1010
1021
  if (options.type) reqs = reqs.filter(r => r.type === options.type);
1011
1022
 
1012
- // Coverage filters require loading templates
1013
- if (options.withCoverage || options.withoutCoverage) {
1014
- const listTemplates = httpsCallable(functions, "listTemplates");
1015
- const tplResult = await listTemplates({ projectId, status: null });
1016
- // listTemplates returns summary only — we need full templates for test cases
1017
- // Use the full templates list via a different path: load each template (or rely on coverage server-side later)
1018
- // For now: scan template summaries for requirementKey if present, otherwise we have to fall back
1019
- const covered = new Set();
1020
- for (const t of (tplResult.data.templates || [])) {
1021
- // Some template responses include sections, others only summaries
1022
- for (const sec of (t.sections || [])) {
1023
- for (const test of (sec.tests || [])) {
1024
- if (test.requirementKey) covered.add(test.requirementKey);
1025
- }
1026
- }
1027
- }
1028
- if (options.withCoverage) reqs = reqs.filter(r => covered.has(r.key));
1029
- if (options.withoutCoverage) reqs = reqs.filter(r => !covered.has(r.key));
1030
- if (covered.size === 0 && (options.withCoverage || options.withoutCoverage)) {
1031
- console.error("Note: listTemplates returned no test-case data. Coverage filter may be unreliable. Use the web app for accurate coverage.");
1032
- }
1023
+ // Coverage per key from the backend: manual test cases + latest automated run (cli.requirement-coverage)
1024
+ const source = options.coverageSource || "any";
1025
+ if (!["template", "automated", "any"].includes(source)) { console.error("--coverage-source must be template, automated or any"); process.exit(1); }
1026
+ const wantsCoverage = options.withCoverage || options.withoutCoverage || options.json || options.output;
1027
+ if (wantsCoverage) {
1028
+ const { data } = await httpsCallable(functions, "requirementCoverage")({ projectId });
1029
+ const none = { manualTests: 0, approvedManualTests: 0, automated: null };
1030
+ reqs = reqs.map(r => ({ ...r, coverage: data.coverage[r.key] || none }));
1031
+ const covered = (r) => {
1032
+ const c = r.coverage;
1033
+ const manual = c.manualTests > 0, auto = !!c.automated;
1034
+ return source === "template" ? manual : source === "automated" ? auto : manual || auto;
1035
+ };
1036
+ if (options.withCoverage) reqs = reqs.filter(covered);
1037
+ if (options.withoutCoverage) reqs = reqs.filter(r => !covered(r));
1033
1038
  }
1034
1039
 
1035
1040
  // Output
@@ -1045,7 +1050,8 @@ program
1045
1050
  for (const r of reqs) {
1046
1051
  const badge = r.status === "rejected" ? "❌" : r.status === "approved" ? "✅" : r.status === "in_progress" ? "🔨" : r.status === "tested" ? "🟢" : r.status === "implemented" ? "🟡" : r.status === "superseded" ? "🗑" : "📝";
1047
1052
  const epic = r.epicKey ? ` epic:${r.epicKey}` : ' (no epic)';
1048
- console.log(` ${badge} [${r.key}]${epic} ${r.title} (${r.status})`);
1053
+ const cov = r.coverage ? ` [manual ${r.coverage.manualTests}${r.coverage.automated ? `, automated ${r.coverage.automated.ran - r.coverage.automated.failed}/${r.coverage.automated.ran}` : ""}]` : "";
1054
+ console.log(` ${badge} [${r.key}]${epic} ${r.title} (${r.status})${cov}`);
1049
1055
  if (r.reviewComment) console.log(` 💬 ${r.reviewComment}`);
1050
1056
  }
1051
1057
  }
@@ -3740,6 +3746,8 @@ const mcpTools = [
3740
3746
  sprintId: mcpStr("Existing sprint ID (or use newSprintRef)"),
3741
3747
  newSprintRef: mcpStr("ref of a sprint in newSprints"),
3742
3748
  reason: mcpStr("Why this requirement goes in this sprint"),
3749
+ selfVerification: mcpStr("How you will verify it yourself, e.g. 'unit tests for X + API call Y' (sprint.ai-planning-self-verification)"),
3750
+ manualOnly: { type: "boolean", description: "true when you cannot verify it yourself at all — then testProtocols must have a test for it" },
3743
3751
  },
3744
3752
  required: ["requirementId", "reason"],
3745
3753
  additionalProperties: false,
@@ -4077,7 +4085,7 @@ Follow these steps in order:
4077
4085
  - Per sprint, plan roughly averageDonePerCompletedSprint requirements (from sprint_velocity), counting what is already planned there. If there is no history, say so and propose a conservative number. Mention averageCompletionRate (the share of planned requirements that usually gets done) in the proposal.
4078
4086
  - Carry-over: a sprint is overdue when its end date (releaseDate) is before today and it is not completed. Requirements in an overdue sprint that are approved or in progress are candidates to MOVE to an open sprint; they keep their status and assignee, and the reason names the overdue sprint. Never move requirements out of a sprint that has not passed its end date.
4079
4087
  - If the requirements don't fit in the existing sprints, propose new sprints (name + end date) — don't create them yet.
4080
- 3. Present the proposal as a table: sprint | requirement key | title | reason (priority / epic dependency / capacity). Show moves out of overdue sprints as their own rows, marked as moves, separate from newly planned requirements. Also list what you deliberately left out and why, and any dependency conflicts you found.
4088
+ 3. Present the proposal as a table: sprint | requirement key | title | reason (priority / epic dependency / capacity) | Claude verifies by (how you will verify it yourself — unit/integration tests, an API call, a build check — or "manual tests only" when you can't). Pass the same text as selfVerification on each propose_sprint_plan row, and manualOnly true for the "manual tests only" ones (the protocol must then have a test for them). Show moves out of overdue sprints as their own rows, marked as moves, separate from newly planned requirements. Also list what you deliberately left out and why, and any dependency conflicts you found.
4081
4089
  4. STOP and ask the user: approve here, or save it as a proposal to decide later in qa-tools? Change nothing before that. Apply any adjustments the user asks for and show the table again.
4082
4090
  - If nobody is there to answer (an unattended run), or the user chooses "later": call propose_sprint_plan with the same rows, and report the result. Do not apply anything yourself.
4083
4091
  5. After approval in this conversation: create_sprint for any new sprints, then update_requirement with sprintId for each planned requirement. Report each change and any refusal verbatim — never retry a refused change in a different way.