@appliqation/heal-selector 0.1.0 → 0.1.1
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/README.md +14 -14
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
# Appliqation Heal-Selector
|
|
2
2
|
|
|
3
|
-
**Heals one broken Playwright selector in an existing, already-working script
|
|
3
|
+
**Heals one broken Playwright selector in an existing, already-working script: narrow and token-efficient, never a full regenerate.**
|
|
4
4
|
|
|
5
|
-
Point it at a script, the selector that's failing, and why
|
|
5
|
+
Point it at a script, the selector that's failing, and why. It decides whether that's genuine selector staleness (heal it) or a real behaviour change (decline, not a healing case), verifies its answer against the live page's own accessibility tree, and only ever patches the one line, only after a real `npx playwright test` run confirms the fix actually works.
|
|
6
6
|
|
|
7
7
|
## Why this exists
|
|
8
8
|
|
|
9
|
-
A test-set regression run naturally sorts into three buckets: canonical scripts that still pass (nothing to do), test cases with no canonical script at all (a job for [`appliqation-scriptgen`](https://github.com/appliqation/scriptgen)), and canonical scripts that just started failing. That third bucket is ambiguous by nature
|
|
9
|
+
A test-set regression run naturally sorts into three buckets: canonical scripts that still pass (nothing to do), test cases with no canonical script at all (a job for [`appliqation-scriptgen`](https://github.com/appliqation/scriptgen)), and canonical scripts that just started failing. That third bucket is ambiguous by nature: did the *app* regress, or did the *script* just go stale (a renamed id, a restructured DOM, the same element findable a different way)? Regenerating the whole script from scratch to answer that is wasteful when the real fix is one selector. This agent is built specifically for that bucket.
|
|
10
10
|
|
|
11
11
|
## The one rule that matters more than anything else here
|
|
12
12
|
|
|
13
|
-
**This agent must never "heal" a selector by finding one that merely makes the assertion pass again.** That's worse than leaving it broken
|
|
13
|
+
**This agent must never "heal" a selector by finding one that merely makes the assertion pass again.** That's worse than leaving it broken: it fails silently and looks like success. A heal only happens once the model has established, from real evidence, that the new selector targets the *same semantic element* the original one did:
|
|
14
14
|
|
|
15
|
-
- **Accessibility role + accessible name**, read from the live page itself
|
|
16
|
-
- **The test case's own expected-result text**, from Appliqation
|
|
17
|
-
- **Recorded session data**, when a caller happens to have it
|
|
15
|
+
- **Accessibility role + accessible name**, read from the live page itself (the primary signal, always available).
|
|
16
|
+
- **The test case's own expected-result text**, from Appliqation, cross-checked against any candidate element.
|
|
17
|
+
- **Recorded session data**, when a caller happens to have it (a bonus signal, never required).
|
|
18
18
|
|
|
19
19
|
No confident match means no heal. It reports a clear decline instead, touches nothing, and hands off to a human or [`appliqation-defect-fix`](https://github.com/appliqation/defect-fix).
|
|
20
20
|
|
|
@@ -29,33 +29,33 @@ Create a `.env` file (in whatever directory you'll run it from) with:
|
|
|
29
29
|
|
|
30
30
|
```
|
|
31
31
|
APPQ_API_KEY=your-appliqation-api-key # read-only is enough
|
|
32
|
-
ANTHROPIC_API_KEY=your-anthropic-key # or OPENAI_API_KEY
|
|
32
|
+
ANTHROPIC_API_KEY=your-anthropic-key # or OPENAI_API_KEY (pick one)
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
36
|
appliqation-heal-selector heal \
|
|
37
37
|
--test-case-uuid 2424-8e61a1f0-4bba-4b7b-8fe5-f8ae19e65026 \
|
|
38
38
|
--script-path tests/appliqation/scenario-2424/8e61a1f0.spec.ts \
|
|
39
|
-
--failure "Locator #subscribe-btn not found
|
|
39
|
+
--failure "Locator #subscribe-btn not found, likely renamed or restructured" \
|
|
40
40
|
--environment Stage \
|
|
41
41
|
--repo-path /path/to/your/checkout
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
Add `--json`/`--ci` for a structured summary. The exit code is 0 only when a patch was written *and* independently verified by a real, post-patch test run
|
|
44
|
+
Add `--json`/`--ci` for a structured summary. The exit code is 0 only when a patch was written *and* independently verified by a real, post-patch test run. A decline, or an unverified attempt, both exit non-zero; the JSON summary's `declined` field tells them apart.
|
|
45
45
|
|
|
46
46
|
## Configuration
|
|
47
47
|
|
|
48
|
-
Copy `.env.example` to `.env`. Requires `APPQ_API_KEY` (read-only access is sufficient
|
|
48
|
+
Copy `.env.example` to `.env`. Requires `APPQ_API_KEY` (read-only access is sufficient; this agent never calls an appq write tool) and one of `ANTHROPIC_API_KEY`/`OPENAI_API_KEY`.
|
|
49
49
|
|
|
50
50
|
## Running this safely
|
|
51
51
|
|
|
52
|
-
This agent has real filesystem write access (scoped to `--repo-path`, path-escape and symlink protected), a real shell (allowlisted to a targeted `npx playwright test` and nothing else
|
|
52
|
+
This agent has real filesystem write access (scoped to `--repo-path`, path-escape and symlink protected), a real shell (allowlisted to a targeted `npx playwright test` and nothing else; no package installation, no bootstrap commands), and a real browser. It never calls an Appliqation write tool and never touches git. A separate agent ([`appliqation-pr-raise`](https://github.com/appliqation/pr-raise)) is responsible for committing and pushing whatever this one patches.
|
|
53
53
|
|
|
54
54
|
**Run this inside a container with an egress allowlist**, same as every agent in this family. This process only ever legitimately needs to reach:
|
|
55
55
|
|
|
56
56
|
- your LLM provider (`api.anthropic.com` or `api.openai.com`)
|
|
57
57
|
- your configured `APPQ_ORIGIN` (`appq.appliqation.io` by default)
|
|
58
|
-
- the site under test
|
|
58
|
+
- the site under test (whatever `--environment` resolves to)
|
|
59
59
|
|
|
60
60
|
Anything else this process tries to reach is unexpected and worth investigating.
|
|
61
61
|
|
|
@@ -75,4 +75,4 @@ See `CLAUDE.md` for a map of this repo if you're working in it with an AI coding
|
|
|
75
75
|
|
|
76
76
|
## License
|
|
77
77
|
|
|
78
|
-
MIT
|
|
78
|
+
MIT. See [LICENSE](./LICENSE).
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appliqation/heal-selector",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Standalone agent that heals one broken Playwright selector in an existing script
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Standalone agent that heals one broken Playwright selector in an existing script: narrow and token-efficient, never a full regenerate. Verifies a healed selector targets the same semantic element (accessibility role + name, the test case's own expected_result) before touching anything; declines rather than guesses.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|