tewip-ai 0.4.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/QUICKSTART.md +2 -1
- package/README.md +47 -5
- package/TEAM-GUIDE.md +239 -234
- package/dist/cli/tewip.js +85 -3
- package/dist/engine/autofix/code-command.js +107 -0
- package/dist/engine/autofix/code-fix.js +196 -0
- package/dist/engine/autofix/code-propose.js +39 -0
- package/dist/engine/autofix/code-target.js +138 -0
- package/dist/engine/autofix/data.js +73 -0
- package/dist/engine/autofix/fix-data.js +70 -0
- package/dist/engine/autofix/fix-wait.js +68 -0
- package/dist/engine/autofix/waits.js +83 -0
- package/dist/engine/design/design-command.js +83 -0
- package/dist/engine/design/drift.js +141 -0
- package/dist/engine/design/figma.js +83 -0
- package/dist/engine/design/frame.js +157 -0
- package/dist/engine/import/log.js +66 -0
- package/dist/engine/infra-errors.js +62 -0
- package/dist/engine/quality/frameworks.js +10 -9
- package/dist/engine/quality/mutation.js +158 -0
- package/dist/engine/quality/write-command.js +3 -2
- package/dist/engine/quality/write-verify.js +27 -1
- package/dist/engine/rules.js +21 -1
- package/dist/engine/work/jira-command.js +93 -0
- package/dist/engine/work/jira.js +105 -0
- package/dist/scripts/explain.js +11 -4
- package/package.json +1 -1
package/QUICKSTART.md
CHANGED
|
@@ -27,7 +27,8 @@ If your config already uses a reporter list in CI, add `['blob']` to it.
|
|
|
27
27
|
```yaml
|
|
28
28
|
permissions:
|
|
29
29
|
pull-requests: write # the diagnosis comment
|
|
30
|
-
issues: write
|
|
30
|
+
issues: write
|
|
31
|
+
actions: read # so it can read a failed job's log when no report was written # the grouped environment issue
|
|
31
32
|
contents: write # only if you turn autofix on
|
|
32
33
|
|
|
33
34
|
steps:
|
package/README.md
CHANGED
|
@@ -6,10 +6,10 @@ It works for every stack: Node.js (node:test, Jest, Vitest, Mocha), Python (pyte
|
|
|
6
6
|
|
|
7
7
|
| Where | How |
|
|
8
8
|
|---|---|
|
|
9
|
-
| **Terminal** | `npm install -g tewip
|
|
9
|
+
| **Terminal** | `npm install -g tewip-ai`, then `tewip explain report.xml`, `tewip ci owner/repo --pr 12`, `tewip mcp` |
|
|
10
10
|
| **VS Code, Cursor, Windsurf, VSCodium** | the Tewip extension: registers Tewip with the editor's AI assistant and adds *Explain a test report* and *Why did CI fail on this branch?* |
|
|
11
11
|
| **JetBrains, Claude, other AI assistants** | add the MCP server `tewip mcp` (see [editor setup](#use-it-from-your-editor-any-ide-that-speaks-mcp)) |
|
|
12
|
-
| **Any model** | OpenAI, Claude, Gemini, Azure, or a model on your own machine with Ollama (no account, nothing leaves the computer): `TEWIP_PROVIDER` |
|
|
12
|
+
| **Any model** | OpenAI, Claude, Gemini, Azure, or a model on your own machine with Ollama (no account, nothing leaves the computer): `TEWIP_PROVIDER` |
|
|
13
13
|
| **GitHub CI** | the Tewip Action: a comment on every pull request, an optional merge gate, verified fix PRs ([QUICKSTART](QUICKSTART.md)) |
|
|
14
14
|
|
|
15
15
|
Formerly *triage-agent*: the repository moved to `hmamut39/tewip`, and GitHub redirects the old address. See [ROADMAP.md](ROADMAP.md) for the plan.
|
|
@@ -18,8 +18,8 @@ Formerly *triage-agent*: the repository moved to `hmamut39/tewip`, and GitHub re
|
|
|
18
18
|
|
|
19
19
|
## Use it in your project
|
|
20
20
|
|
|
21
|
-
**Giving it to your team (or another company): [TEAM-GUIDE.md](TEAM-GUIDE.md)** — what to install, what each role uses it for, and what it never does.
|
|
22
|
-
|
|
21
|
+
**Giving it to your team (or another company): [TEAM-GUIDE.md](TEAM-GUIDE.md)** — what to install, what each role uses it for, and what it never does.
|
|
22
|
+
|
|
23
23
|
**Putting it on a real repository: [QUICKSTART.md](QUICKSTART.md)** — ten minutes, copy-paste, and what to check on the first failing run.
|
|
24
24
|
|
|
25
25
|
### 1. In GitHub CI (developers, SDETs, DevOps)
|
|
@@ -39,6 +39,7 @@ permissions:
|
|
|
39
39
|
contents: write # only needed for autofix
|
|
40
40
|
pull-requests: write
|
|
41
41
|
issues: write
|
|
42
|
+
actions: read # lets it read the failed job's log when no test report was written
|
|
42
43
|
|
|
43
44
|
steps:
|
|
44
45
|
# ... checkout, install, npx playwright test ...
|
|
@@ -56,6 +57,7 @@ On every run, the action:
|
|
|
56
57
|
- **DevOps:** collects environment failures (server errors, connection resets, outages) in **one** GitHub issue, and each new run adds a single grouped comment to it.
|
|
57
58
|
- **Fixes (`autofix: true`):** for drifted locators that the deterministic rule matched to a renamed element, it rewrites the locator, re-runs that test, and opens a separate pull request with the changes that passed. It never merges and never edits application code.
|
|
58
59
|
- **Every role:** uploads all role views as the `tewip-report` artifact.
|
|
60
|
+
- **When the job dies before any test runs** (an image that would not pull, a runner out of disk, a service container that never came up): it reads the failed job's log and names the cause, instead of leaving a red X with no explanation.
|
|
59
61
|
- **History:** keeps the run history in the Actions cache, never in git.
|
|
60
62
|
- **Corrections:** reply to the agent's comment with `/triage CATEGORY #n reason` (e.g. `/triage TIMING #2 flaky on CI`). It stores that with the history and, next time that test fails the same way, gives the person's answer instead of its own, naming them and their reason. A corrected failure also costs nothing: it never goes to the model again.
|
|
61
63
|
|
|
@@ -89,7 +91,7 @@ The repository needs "Allow GitHub Actions to create and approve pull requests"
|
|
|
89
91
|
| "What should I fix first from the last run?" | `triage_board` (SDET) · `pr_impact` (developer) |
|
|
90
92
|
| "Is the test environment broken?" | `environment_report` (DevOps / SRE) |
|
|
91
93
|
| "Can we release?" | `release_readiness` (business / UAT) |
|
|
92
|
-
| "Where is our test suite fragile?" | `quality_report` (senior / principal) · `architecture_report` (architect) · `risk_digest` (lead) |
|
|
94
|
+
| "Where is our test suite fragile?" | `quality_report` (senior / principal) · `architecture_report` (architect) · `risk_digest` (lead) |
|
|
93
95
|
| "Write a test plan for the checkout feature in C:\work\shop" | `test_plan`: risks and scenarios grounded in that project's tests, code and pages; saved in its `.tewip` folder |
|
|
94
96
|
|
|
95
97
|
Setup, after `npm install`:
|
|
@@ -143,6 +145,46 @@ tewip write --only CO-002,CO-004 --framework pytest
|
|
|
143
145
|
- **`tewip plan`** reads what is really there: the tests you already have (in any language), the change (`--diff main...HEAD`), the live pages (what a user sees on each page, via Playwright), and the failures Tewip has diagnosed in this project before. The plan lists risks and scenarios by priority. A claim that a scenario is "already covered" is checked against your real test names, and dropped if no such test exists. Saved to `.tewip/plans/` as Markdown to review and JSON for `write`.
|
|
144
146
|
- **`tewip write`** writes each scenario as a test in **your** framework and style: Playwright, Cypress, WebdriverIO, Angular, Jest, Vitest, pytest (with Selenium or Playwright), JUnit on Maven or Gradle (Selenium, Spring Boot), .NET or Go. It copies the style of an existing test and uses only elements seen on the real page. Front-end apps get component tests the way their own tests are written: React, Vue or Svelte with Testing Library under Jest or Vitest, and Angular through `ng test` (Karma and Jasmine, or Vitest). A project with both e2e and unit tests gets browser tests when the plan read pages, and unit or component tests when it did not. Then it runs the test. A draft is **kept only if** it passes every run (3 by default) **and** fails once its main check is broken on purpose, because a test that cannot fail is worse than no test. A failing draft is repaired from the real error, twice at most. If the test looks right and the app does something else, Tewip reports a **possible bug** instead of weakening the test until it passes. Kept tests are new files beside yours, for you to review and commit; nothing is committed, and no application code is touched.
|
|
145
147
|
|
|
148
|
+
## Check the page against the design (Phase 11, new)
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
tewip design "https://www.figma.com/design/KEY/Checkout?node-id=12-34" --url http://localhost:3000/checkout
|
|
152
|
+
tewip design frame.json --frame "Sign in" # a saved frame, no Figma token needed
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Tewip reads the frame (Figma's REST API, read only, `TEWIP_FIGMA_TOKEN`) and the running page
|
|
156
|
+
(its accessibility snapshot, which is what a screen reader and a test both see), and says where they
|
|
157
|
+
disagree: `the design says button "Sign in", the page says button "Log in"`. It checks the words the
|
|
158
|
+
design specifies, the controls its layer names imply, and the regions its sections imply - never
|
|
159
|
+
pixels, colours or spacing, because a design tool and a browser do not measure those the same way.
|
|
160
|
+
No model is called, so it costs nothing and answers the same way every time.
|
|
161
|
+
|
|
162
|
+
Measured on four real design/page pairs (a public repository's Figma exports and the pages built
|
|
163
|
+
from them): 38 checks, **0 differences reported on pages that match their design**, and **8 of 8
|
|
164
|
+
injected drifts caught** - a renamed button, a dropped sentence, a region that stopped being marked
|
|
165
|
+
up. No designer has judged the output yet, so the roadmap's own metric is still open.
|
|
166
|
+
|
|
167
|
+
## Fix the code, but only when the tests prove it (Phase 12, new, opt-in)
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
tewip fix --code report.xml # shows the patch; your files are left as they were
|
|
171
|
+
tewip fix --code report.xml --apply # leaves the proved change in your working tree
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Tewip has refused to touch application code since day one. This is the one exception, and it only
|
|
175
|
+
runs when you type `--code`. It takes a failure **it** diagnosed as a real bug (0.85 confidence or
|
|
176
|
+
more), finds the file the failure points at, asks for the smallest change, and then proves it: the
|
|
177
|
+
failing test must pass **and** the whole suite must still pass. It will not edit tests,
|
|
178
|
+
configuration, CI files, lockfiles, migrations or anything with secrets in it, because a test going
|
|
179
|
+
green after changing those proves nothing. If it cannot prove a change, it explains the bug instead
|
|
180
|
+
and puts your file back byte for byte. It never commits and never merges.
|
|
181
|
+
|
|
182
|
+
Measured by replaying **8 real bug fixes** from a public repository (unjs/ufo): the commit before
|
|
183
|
+
each fix, with only that fix's tests, so the real bug reproduces. **4 of 8 got a change proved by
|
|
184
|
+
the tests, 4 of 4 in the same file the developers changed, each a one-liner doing what the
|
|
185
|
+
developers' own fix does. 0 wrong fixes were offered** - the other four were refused (three times
|
|
186
|
+
the model wanted a 50-line rewrite, which the size rule threw away).
|
|
187
|
+
|
|
146
188
|
## Where it has been tried
|
|
147
189
|
|
|
148
190
|
| Project | How | Result |
|
package/TEAM-GUIDE.md
CHANGED
|
@@ -1,234 +1,239 @@
|
|
|
1
|
-
# Using Tewip in your team
|
|
2
|
-
|
|
3
|
-
**Tewip reads your failing tests and tells you why each one failed** — a real bug, a flaky test, a
|
|
4
|
-
broken environment, bad test data, or a renamed element on the page — with the evidence for each
|
|
5
|
-
answer and one next step. It also writes test plans and new tests, and checks them by running them.
|
|
6
|
-
|
|
7
|
-
It works with any language and any test framework, because it reads the test report your CI already
|
|
8
|
-
produces (JUnit XML, which almost every runner can write) — Java, .NET, Python, JavaScript and
|
|
9
|
-
TypeScript, Go, Ruby, PHP, Rust, and the browser and mobile tools on top of them.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## 1.
|
|
14
|
-
|
|
15
|
-
Tewip is
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
- `
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
- `tewip
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
- The
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
- The
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
- It **never
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
- It **never
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
1
|
+
# Using Tewip in your team
|
|
2
|
+
|
|
3
|
+
**Tewip reads your failing tests and tells you why each one failed** — a real bug, a flaky test, a
|
|
4
|
+
broken environment, bad test data, or a renamed element on the page — with the evidence for each
|
|
5
|
+
answer and one next step. It also writes test plans and new tests, and checks them by running them.
|
|
6
|
+
|
|
7
|
+
It works with any language and any test framework, because it reads the test report your CI already
|
|
8
|
+
produces (JUnit XML, which almost every runner can write) — Java, .NET, Python, JavaScript and
|
|
9
|
+
TypeScript, Go, Ruby, PHP, Rust, and the browser and mobile tools on top of them.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 1. How to get it
|
|
14
|
+
|
|
15
|
+
Tewip is published on the npm registry, free and open source (Apache-2.0):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g tewip-ai
|
|
19
|
+
tewip --help
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The package is called `tewip-ai`; the command you type is `tewip`.
|
|
23
|
+
|
|
24
|
+
Nothing else is needed: no account with anyone, no licence key, and nothing of yours is sent to the
|
|
25
|
+
author. The source is at <https://github.com/hmamut39/tewip>, so a company that needs to own the
|
|
26
|
+
tool can keep its own copy instead.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. What you need on your machine
|
|
31
|
+
|
|
32
|
+
- **Node.js 22.18 or newer** (`node --version`). This is the only hard requirement.
|
|
33
|
+
- **A model** — *optional, and it does not have to be OpenAI*. Without any model, Tewip still works:
|
|
34
|
+
its built-in rules answer most failures on their own. With one, the harder failures get an answer
|
|
35
|
+
too, and `plan` and `write` become available. Pick whichever your company already allows:
|
|
36
|
+
|
|
37
|
+
| You have | Set this |
|
|
38
|
+
|---|---|
|
|
39
|
+
| OpenAI | `TEWIP_API_KEY=sk-...` |
|
|
40
|
+
| Claude (Anthropic) | `TEWIP_PROVIDER=anthropic` and `TEWIP_API_KEY=...` |
|
|
41
|
+
| Gemini (Google) | `TEWIP_PROVIDER=google` and `TEWIP_API_KEY=...` |
|
|
42
|
+
| Azure OpenAI | `TEWIP_PROVIDER=azure`, `TEWIP_BASE_URL=<your deployment URL>`, `TEWIP_API_KEY=...` |
|
|
43
|
+
| **Nothing, and no account** | `TEWIP_PROVIDER=ollama` — install [Ollama](https://ollama.com), run `ollama pull qwen3:8b`. The model runs on your own machine and no data leaves it |
|
|
44
|
+
| OpenRouter, Groq, Together, vLLM, LM Studio | `TEWIP_PROVIDER=custom`, `TEWIP_BASE_URL=...`, `TEWIP_API_KEY=...` |
|
|
45
|
+
|
|
46
|
+
Each person (or CI job) pays for their own model usage. There is no Tewip service in between and
|
|
47
|
+
no account with anyone to create.
|
|
48
|
+
- **The GitHub CLI (`gh`), logged in** — only for `tewip ci`, which fetches a report from GitHub.
|
|
49
|
+
|
|
50
|
+
### Privacy, in plain words
|
|
51
|
+
|
|
52
|
+
This matters for a company laptop, so it is stated exactly:
|
|
53
|
+
|
|
54
|
+
- Without a model, **Tewip sends nothing anywhere**. It runs entirely on your machine. The same is
|
|
55
|
+
true with `TEWIP_PROVIDER=ollama`, which runs the model locally.
|
|
56
|
+
- With a hosted model (OpenAI, Claude, Gemini, Azure), it sends only the **failure text** (the error
|
|
57
|
+
message and the test name) of the failures its rules could not settle, to that provider and
|
|
58
|
+
nowhere else. It never sends your source code.
|
|
59
|
+
- `tewip plan` and `tewip write` do send more: the feature description you type, the names of your
|
|
60
|
+
tests, and the related test and source files, because they cannot write a useful test without
|
|
61
|
+
them. Use these two only where your company allows an AI service to read source code.
|
|
62
|
+
- Tewip stores its history in a `.tewip` folder inside your project. Add `.tewip/` to `.gitignore`.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 3. Install
|
|
67
|
+
|
|
68
|
+
### The command line (works everywhere: any OS, any CI, any company)
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm install -g tewip-ai
|
|
72
|
+
tewip --help # check it worked
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### VS Code, Cursor, Windsurf or VSCodium
|
|
76
|
+
|
|
77
|
+
1. Open the Extensions panel.
|
|
78
|
+
2. Search for **Tewip** and install it.
|
|
79
|
+
(Until the Marketplace listing is live, use the `.vsix` file instead: `…` menu → **Install from VSIX…**)
|
|
80
|
+
|
|
81
|
+
You now have two commands (press `Ctrl+Shift+P` and type "Tewip"):
|
|
82
|
+
|
|
83
|
+
- **Tewip: Explain a test report…** — pick a test report file, get the diagnosis.
|
|
84
|
+
- **Tewip: Why did CI fail on this branch?** — reads the report from your GitHub CI run.
|
|
85
|
+
|
|
86
|
+
The extension also connects Tewip to your editor's AI assistant, so you can just ask it questions
|
|
87
|
+
in plain language ("why did the checkout test fail?").
|
|
88
|
+
|
|
89
|
+
### JetBrains (IntelliJ, WebStorm, PyCharm, Rider), Claude, or any other AI assistant
|
|
90
|
+
|
|
91
|
+
Add one MCP server entry. The command is `tewip mcp`. Example for Claude Code:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
claude mcp add tewip -- tewip mcp
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### GitHub CI
|
|
98
|
+
|
|
99
|
+
```yaml
|
|
100
|
+
- name: Tewip
|
|
101
|
+
if: always()
|
|
102
|
+
uses: hmamut39/tewip@main # option C: point this at your own copy
|
|
103
|
+
with:
|
|
104
|
+
junit-report: report.xml # a file, or a folder of them
|
|
105
|
+
openai-api-key: ${{ secrets.OPENAI_API_KEY }} # optional
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
On every failing run it comments on the pull request, writes the triage board into the run summary,
|
|
109
|
+
collects environment failures in one issue, and (optionally) opens a fix pull request.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 4. What you can actually do with it
|
|
114
|
+
|
|
115
|
+
| Command | What it does | When you use it |
|
|
116
|
+
|---|---|---|
|
|
117
|
+
| `tewip explain report.xml` | Explains every failing test in a report: cause, confidence, evidence, next step | Right after a test run fails, local or CI |
|
|
118
|
+
| `tewip explain job.log` | Reads a CI job log when the job died before any test ran, and names the cause (image pull, disk, container, runner) | "CI is red but there are no test results" |
|
|
119
|
+
| `tewip ci owner/repo --pr 12` | The same, for a GitHub pull request, without leaving the terminal | "Why is CI red on my PR?" |
|
|
120
|
+
| `tewip plan "<feature>"` | Writes a test plan: risks, scenarios by priority, what is already covered, what to automate next | Before building or testing a feature |
|
|
121
|
+
| `tewip write` | Turns the plan's scenarios into real tests in your own framework, and keeps only the ones that pass repeatedly **and** fail when their check is broken on purpose | When you know what to test but not how to write it |
|
|
122
|
+
| `tewip plan --issue PROJ-123` | Plans from the Jira ticket itself: its description and acceptance criteria | "Here's the story, what should we test?" |
|
|
123
|
+
| `tewip jira plan.json --project PROJ` | Files the plan's scenarios as test-case tickets, linked to the story | Handing work to the team |
|
|
124
|
+
| `tewip fix --code report.xml` | Opt-in: proposes the smallest change to application code for a real bug, and keeps it only if the failing test passes and the whole suite still passes | "It is a real bug and I want a starting patch" |
|
|
125
|
+
| `tewip design <figma link> --url <page>` | Compares a Figma frame against the running page: the words the design specifies and the controls its layer names imply | "Did we build what was designed?" |
|
|
126
|
+
| `tewip mcp` | Serves all of the above to your editor's AI assistant | Set up once |
|
|
127
|
+
|
|
128
|
+
Notes that save you time:
|
|
129
|
+
|
|
130
|
+
- `explain` needs a report file. Any runner can write one: `pytest --junitxml=report.xml`,
|
|
131
|
+
`jest --reporters=jest-junit`, `mvn test` (Surefire writes them by itself), `dotnet test --logger trx`.
|
|
132
|
+
- `write` never touches your application code. It only adds new test files, and you review and
|
|
133
|
+
commit them yourself.
|
|
134
|
+
- Everything it writes locally goes to the `.tewip` folder in your project.
|
|
135
|
+
- `tewip jira` shows what it *would* file and creates nothing until you add `--create`. It never
|
|
136
|
+
files the same scenario twice, and never moves, assigns or closes a ticket.
|
|
137
|
+
- `tewip design` needs a Figma read token (`TEWIP_FIGMA_TOKEN`), or a frame saved as JSON if you
|
|
138
|
+
would rather not create one. It compares words, controls and page regions - never pixels, colours
|
|
139
|
+
or spacing, because a design tool and a browser do not measure those the same way.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 5. Which role uses which part
|
|
144
|
+
|
|
145
|
+
**Developer** — "is this failure my fault?"
|
|
146
|
+
- `tewip ci your-org/repo --pr 12`, or the editor command *Why did CI fail on this branch?*
|
|
147
|
+
- In CI, the pull request comment tells you which failures your change likely caused and which it
|
|
148
|
+
did not, with the reason.
|
|
149
|
+
|
|
150
|
+
**QA engineer / SDET** — the daily driver
|
|
151
|
+
- `tewip explain` for the triage board: every failing test grouped by what to do next (fix the
|
|
152
|
+
locator, stabilise the test, fix the data, file a bug, re-run the environment).
|
|
153
|
+
- `tewip plan` before writing tests for a feature, then `tewip write` to draft them.
|
|
154
|
+
- Correct it when it is wrong: reply to its pull-request comment with `/triage TIMING #2 flaky on CI`.
|
|
155
|
+
It remembers that and answers with your decision next time, naming you.
|
|
156
|
+
|
|
157
|
+
**DevOps / SRE** — "is the pipeline broken, or the code?"
|
|
158
|
+
- Environment failures (a service that was down, a refused connection, a container that never
|
|
159
|
+
started, a missing emulator) are collected in **one** issue instead of paging you per test.
|
|
160
|
+
- The merge gate (`gate: real-failures`) blocks a merge only for real failures, and lets known
|
|
161
|
+
noise through — so a broken test environment does not stop the team.
|
|
162
|
+
|
|
163
|
+
**Engineering manager / team lead**
|
|
164
|
+
- The release readiness view, in plain words: READY, WAIT or NOT READY, and which product areas are
|
|
165
|
+
broken.
|
|
166
|
+
- The risk digest: which areas got worse between the first and second half of the period.
|
|
167
|
+
|
|
168
|
+
**Software architect / principal engineer**
|
|
169
|
+
- The architecture view: fragile areas, single commits that broke many suites, failing service
|
|
170
|
+
dependencies.
|
|
171
|
+
- The quality view: flakiness hotspots and test-design debt, ranked by the CI time they waste.
|
|
172
|
+
|
|
173
|
+
**Designer, and the developer building from a design**
|
|
174
|
+
- `tewip design <figma link> --url http://localhost:3000` after building a screen: it lists what the
|
|
175
|
+
design says and what the page says, side by side, so a renamed button or a dropped sentence is
|
|
176
|
+
found before review.
|
|
177
|
+
|
|
178
|
+
**Security** — planned, not built yet (`tewip secure`, Phase 9 in ROADMAP.md).
|
|
179
|
+
|
|
180
|
+
Managers, architects and leads do not need to install anything: those views are produced by the CI
|
|
181
|
+
job and kept in a GitHub issue, or can be asked for through an AI assistant.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 6. What Tewip will never do
|
|
186
|
+
|
|
187
|
+
These are enforced in the code, not promises in a document:
|
|
188
|
+
|
|
189
|
+
- It **never edits your application code** unless you run `tewip fix --code` yourself. Even then it
|
|
190
|
+
changes nothing it cannot prove: the failing test must pass and the whole suite must still pass,
|
|
191
|
+
or your file goes back exactly as it was. It will not edit tests, configuration, CI files,
|
|
192
|
+
lockfiles or migrations at all.
|
|
193
|
+
- It **never merges anything**. Fixes are opened as a pull request for a person to review.
|
|
194
|
+
- It **never keeps a test it has not proved**: a written test is kept only if it passed every run
|
|
195
|
+
and failed when its main check was deliberately broken.
|
|
196
|
+
- It **never reports a bug it cannot show you**: a "possible bug" must quote the real output of the
|
|
197
|
+
run.
|
|
198
|
+
- It **never silently accepts a report it cannot read**. It says so, instead of reporting "no
|
|
199
|
+
failures" for a run that failed.
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## 7. What it costs
|
|
204
|
+
|
|
205
|
+
The built-in rules are free and answer most failures. Only what they cannot settle goes to the AI
|
|
206
|
+
model, and every answer is cached, so asking twice costs nothing. Every run prints its own cost.
|
|
207
|
+
|
|
208
|
+
Measured examples: a run of 41 real failures cost about 30 seconds of model time; writing 10 tests
|
|
209
|
+
for a feature costs roughly $0.50 to $1.50 in OpenAI usage.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 8. How good is it, honestly
|
|
214
|
+
|
|
215
|
+
On six sets of real failures from public projects (WordPress Gutenberg, Supabase, JupyterLab and
|
|
216
|
+
others), Tewip's answers were right **86% to 99.7%** of the time, depending on the project.
|
|
217
|
+
|
|
218
|
+
Two caveats the project states openly:
|
|
219
|
+
|
|
220
|
+
- Those labels were written by an AI reviewer, not by a human expert, so treat them as provisional.
|
|
221
|
+
- When Tewip says it is 70% sure, it is right about 90% of the time — it is *under*-confident, which
|
|
222
|
+
is the safer direction, but it means it sometimes asks for a human where it did not need to.
|
|
223
|
+
|
|
224
|
+
The full numbers, including what is **not** measured yet, are in `eval/README.md` and `ROADMAP.md`.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## 9. If something goes wrong
|
|
229
|
+
|
|
230
|
+
| What you see | What it means |
|
|
231
|
+
|---|---|
|
|
232
|
+
| `tewip: command not found` | The npm install did not finish, or your PATH does not include npm's global folder |
|
|
233
|
+
| `no test report Tewip can read` | The file is not JUnit XML, NUnit or TRX. Make your runner write JUnit XML |
|
|
234
|
+
| `writing a plan needs a model` | `plan` and `write` need a model: the message lists every way to set one up |
|
|
235
|
+
| `Playwright is not installed in this project` | Only affects reading live pages for `plan`/`write`; everything else still works |
|
|
236
|
+
| Tewip says a failure is UNKNOWN | It refuses to guess. With an API key set, fewer failures end up here |
|
|
237
|
+
|
|
238
|
+
Questions, or you think a diagnosis is wrong: tell Hasan — a wrong answer with its evidence is the
|
|
239
|
+
most useful thing you can send, because corrections are how it gets better.
|