tewip-ai 0.69.6 → 0.69.7

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.
@@ -21,20 +21,44 @@ export function testFor(scenario, attempted) {
21
21
  const id = clean(scenario.id);
22
22
  return id.length >= 4 ? (attempted.find((t) => clean(t).includes(id)) ?? '') : '';
23
23
  }
24
+ /**
25
+ * Why no test could be named - and what that does and does not establish.
26
+ *
27
+ * "no test in this project can be named for it, so nothing is checking it" was printed whatever the
28
+ * reason, including when **no run had been kept here at all**. Field-tested on this repository, which
29
+ * has 1,095 passing tests and a kept history belonging to a different project: all twelve scenarios
30
+ * of a real plan came back "nothing is checking it". Tewip was not looking at this project's tests,
31
+ * because it only ever sees the tests a kept run names, and it said so as though it had looked.
32
+ *
33
+ * The distinction matters because the two cases call for opposite actions: write a test, or keep
34
+ * your runs so the ones you have can be seen.
35
+ */
36
+ function notCoveredBecause(runs, knownTests) {
37
+ if (runs.length === 0) {
38
+ return 'no run has been kept for this project, so Tewip has no list of its tests to match against - this is not a claim that nothing checks it. Run `tewip explain <report>` once and ask again';
39
+ }
40
+ return `no test among the ${knownTests} that the ${runs.length} kept run(s) name matches it, so nothing Tewip can see is checking it`;
41
+ }
24
42
  /** Joins one plan to what the runs actually say. Nothing here is inferred from anything else. */
25
43
  export function tracePlan(plan, runs, records) {
26
44
  const newest = runs.at(-1);
27
45
  const attempted = newest ? Object.keys(newest.attempts ?? {}) : [];
28
46
  const everAttempted = new Set(runs.flatMap((r) => Object.keys(r.attempts ?? {})));
47
+ // A scenario's own id was matched against the **newest run only**, so a test that ran last week
48
+ // and not today could not be found at all - and the answer for it was "no test in this project can
49
+ // be named for it, so nothing is checking it", which is a different and much stronger claim than
50
+ // "it did not run today". The branch below that exists to say exactly that ("ran before but not in
51
+ // the last run") was unreachable for every scenario the plan did not name a test for.
52
+ const everyTest = [...everAttempted];
29
53
  const failures = new Map();
30
54
  for (const record of records)
31
55
  if (record.runId === newest?.runId)
32
56
  failures.set(record.testId, record);
33
57
  const scenarios = plan.scenarios.map((scenario) => {
34
- const test = testFor(scenario, attempted);
58
+ const test = testFor(scenario, everyTest);
35
59
  const base = { id: scenario.id, title: scenario.title, priority: scenario.priority ?? '', test, runId: newest?.runId ?? '', when: newest?.finishedAt ?? '' };
36
60
  if (!test) {
37
- return { ...base, standing: 'not-covered', diagnosis: '', why: 'no test in this project can be named for it, so nothing is checking it' };
61
+ return { ...base, standing: 'not-covered', diagnosis: '', why: notCoveredBecause(runs, everAttempted.size) };
38
62
  }
39
63
  if (!everAttempted.has(test)) {
40
64
  return { ...base, standing: 'never-run', runId: '', when: '', diagnosis: '', why: `${test} is named as the cover, but no run kept here has attempted it` };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tewip-ai",
3
- "version": "0.69.6",
3
+ "version": "0.69.7",
4
4
  "mcpName": "io.github.hmamut39/tewip",
5
5
  "description": "Tewip finds why each failing test failed - real bug, flaky test, environment, test data or changed selector - for any stack, from the command line, CI, or your editor.",
6
6
  "keywords": [