@ia-qa/self-healing 1.6.16 → 1.7.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 (60) hide show
  1. package/README.md +120 -1
  2. package/TUTORIAL.md +31 -4
  3. package/dist/browser/resolve.d.ts +20 -0
  4. package/dist/browser/resolve.js +78 -0
  5. package/dist/browser/resolve.js.map +1 -0
  6. package/dist/cli/args.js +4 -3
  7. package/dist/cli/args.js.map +1 -1
  8. package/dist/cli/audit.d.ts +40 -0
  9. package/dist/cli/audit.js +77 -32
  10. package/dist/cli/audit.js.map +1 -1
  11. package/dist/cli/baseline.js +16 -2
  12. package/dist/cli/baseline.js.map +1 -1
  13. package/dist/cli/check.d.ts +50 -1
  14. package/dist/cli/check.js +63 -25
  15. package/dist/cli/check.js.map +1 -1
  16. package/dist/cli/diff.d.ts +21 -1
  17. package/dist/cli/diff.js +143 -25
  18. package/dist/cli/diff.js.map +1 -1
  19. package/dist/cli/discover.js +9 -0
  20. package/dist/cli/discover.js.map +1 -1
  21. package/dist/cli/fix.js +33 -0
  22. package/dist/cli/fix.js.map +1 -1
  23. package/dist/cli/index.js +53 -2
  24. package/dist/cli/index.js.map +1 -1
  25. package/dist/cli/ingest.d.ts +7 -1
  26. package/dist/cli/ingest.js +17 -8
  27. package/dist/cli/ingest.js.map +1 -1
  28. package/dist/cli/login.d.ts +28 -0
  29. package/dist/cli/login.js +179 -0
  30. package/dist/cli/login.js.map +1 -0
  31. package/dist/cli/map.d.ts +19 -3
  32. package/dist/cli/map.js +191 -17
  33. package/dist/cli/map.js.map +1 -1
  34. package/dist/config.d.ts +68 -0
  35. package/dist/config.js +94 -1
  36. package/dist/config.js.map +1 -1
  37. package/dist/crawl.d.ts +2 -0
  38. package/dist/crawl.js +13 -4
  39. package/dist/crawl.js.map +1 -1
  40. package/dist/fixEngine.d.ts +23 -0
  41. package/dist/fixEngine.js +27 -0
  42. package/dist/fixEngine.js.map +1 -1
  43. package/dist/ingest.d.ts +35 -0
  44. package/dist/ingest.js +32 -0
  45. package/dist/ingest.js.map +1 -1
  46. package/dist/launcher.d.ts +7 -0
  47. package/dist/launcher.js +4 -4
  48. package/dist/launcher.js.map +1 -1
  49. package/dist/mcp/server.d.ts +370 -1
  50. package/dist/mcp/server.js +196 -1
  51. package/dist/mcp/server.js.map +1 -1
  52. package/dist/resolution.d.ts +96 -0
  53. package/dist/resolution.js +197 -0
  54. package/dist/resolution.js.map +1 -0
  55. package/dist/ui/page.js +10 -0
  56. package/dist/ui/page.js.map +1 -1
  57. package/dist/ui/server.js +66 -0
  58. package/dist/ui/server.js.map +1 -1
  59. package/package.json +1 -1
  60. package/skills/ia-qa-heal/SKILL.md +25 -1
@@ -50,14 +50,18 @@ exists only in a state nothing captured (behind a tab, a modal, a mode toggle).
50
50
  |---|---|
51
51
  | "my tests broke — fix them" | `run` (capture during their suite → diff → confirm → fix → re-run to verify) |
52
52
  | "did anything drift?" | `diff` → PASS/FIX/BLOCK (the CI gate) |
53
+ | "the suite already ran with `IAQA_CAPTURE=1`" | `diff` — **on its own**. It picks up `.capture/` and never opens a browser. Do *not* re-run `run`, and never `map` (that re-captures from scratch, without the session the suite had) |
54
+ | "their suite takes 20 min and `run` runs it twice" | `run --no-verify` — the second run is the post-fix verification, and it is optional. Say what they lose: the exit code then reflects the diff, not a re-proved green suite |
53
55
  | "day one, no baseline — is my suite still valid?" | `audit` |
54
56
  | "is the app I mapped even sound?" | `check` (dead links · unnamed elements · name collisions · orphan pages) |
55
- | "which pages am I *not* covering?" | `discover` (`--sitemap` / `--crawl`; suggests only) |
57
+ | "which pages am I *not* covering?" | `discover` (`--sitemap` / `--crawl`; suggests only). Behind a login `--sitemap` sees nothing — `--crawl` is the one that works, and it reuses the session |
56
58
  | "give me the app's structure" | `graph --format mermaid\|svg\|json\|markdown` |
57
59
  | "apply the rewrites" | `fix` — `--dry-run` first, always |
58
60
  | "what do my tests actually use?" | `ingest` |
61
+ | "their Page Objects are CSS — the diff says nothing is referenced" | `ingest` **then** `map`. The bindings in `mapping/_resolved/` are what connect their `.btn-primary` to the contract's `#pay-now`; without `usage.json` there are none, and every row reads `not referenced by your tests` |
59
62
  | "is this getting better or worse?" | `history` (`--json`) — the trend no single run can reconstruct |
60
63
  | "gate my pipeline on it" | `diff --junit <file>` — every major CI charts the trend natively |
64
+ | `map` says "login wall" / the app is behind SSO | if a storageState already exists (most authenticated Playwright suites write one in `globalSetup`): `--session <file>`, `IAQA_SESSION`, or `"session"` in config.json — no second login. Otherwise tell the human to run `ia-qa-heal login` — **you cannot do it** (§4.12) |
61
65
  | "let me look at it / decide myself" | tell the human to run `ia-qa-heal ui` — **do not run it yourself** (§4.8) |
62
66
  | first-time setup | write `.ia-qa/config.json` directly — `init` is a TTY wizard and **will refuse in your shell** |
63
67
 
@@ -127,6 +131,26 @@ clicking the wrong thing), or a name-drift finding that is not attributable.
127
131
  invents a trend out of a capture artifact. `history --json` and the `heal_history` MCP tool
128
132
  both hand you that exclusion — pass it on rather than presenting the series as complete.
129
133
 
134
+ 12. **Never try to log a suite in yourself.** When `map` reports a login wall it prints the whole
135
+ remedy: a filled-in `auth` block when the form is readable, and the fact that a form fill
136
+ cannot pass SSO with MFA, a consent screen or a magic link. Read past the first line before
137
+ concluding anything. For everything a form cannot answer there is exactly one step, and it
138
+ belongs to the human: `ia-qa-heal login` opens a visible browser, they log in once, and the
139
+ session is reused by `map`. It refuses without a TTY and under CI — that refusal is aimed at
140
+ you. Never ask for their password, never put a credential in `config.json` (it holds `secrets`
141
+ *references* to env/SSM, never values), and never commit `.ia-qa/session.json` — it is a live
142
+ session, gitignored on creation. For CI, the reproducible paths are `auth` and capture-during-
143
+ run (`IAQA_CAPTURE=1` + `testCommand`), never a saved session.
144
+
145
+ 13. **Never rewrite a selector whose binding did not simply break.** `diff` reports four
146
+ outcomes for the strings a suite writes, and only one — the element is still there,
147
+ the string no longer reaches it — is repaired. A string that now reaches a *different*
148
+ element is the worst finding in the tool: the test **passes** and acts on the wrong
149
+ thing. Rewriting it would cement that. Neither is a selector matching several
150
+ elements, or one whose element is gone. And a selector that matches something the
151
+ contract does not hold (a row, a cell, a container) is **not** a finding — it is most
152
+ of a real Page Object, and it is proof the selector works.
153
+
130
154
  ## 5. What leaves the machine
131
155
 
132
156
  Nothing, except: requests to the user's **own** `baseUrl` (`check`'s link half, `discover --crawl`