@plune-ai/cairn 0.4.1 → 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.
Files changed (114) hide show
  1. package/README.md +49 -256
  2. package/dist/agent/graph.d.ts +24 -0
  3. package/dist/agent/graph.d.ts.map +1 -1
  4. package/dist/agent/graph.js +74 -2
  5. package/dist/agent/graph.js.map +1 -1
  6. package/dist/agent/index.d.ts +15 -1
  7. package/dist/agent/index.d.ts.map +1 -1
  8. package/dist/agent/index.js +110 -10
  9. package/dist/agent/index.js.map +1 -1
  10. package/dist/artifacts/index.d.ts +21 -0
  11. package/dist/artifacts/index.d.ts.map +1 -1
  12. package/dist/artifacts/index.js +58 -1
  13. package/dist/artifacts/index.js.map +1 -1
  14. package/dist/artifacts/report.d.ts +8 -0
  15. package/dist/artifacts/report.d.ts.map +1 -1
  16. package/dist/artifacts/report.js +47 -0
  17. package/dist/artifacts/report.js.map +1 -1
  18. package/dist/browser/backends/playwright-lib.d.ts +12 -0
  19. package/dist/browser/backends/playwright-lib.d.ts.map +1 -1
  20. package/dist/browser/backends/playwright-lib.js +48 -3
  21. package/dist/browser/backends/playwright-lib.js.map +1 -1
  22. package/dist/browser/recovery.d.ts +42 -0
  23. package/dist/browser/recovery.d.ts.map +1 -0
  24. package/dist/browser/recovery.js +62 -0
  25. package/dist/browser/recovery.js.map +1 -0
  26. package/dist/browser/types.d.ts +7 -0
  27. package/dist/browser/types.d.ts.map +1 -1
  28. package/dist/cli/index.d.ts.map +1 -1
  29. package/dist/cli/index.js +34 -12
  30. package/dist/cli/index.js.map +1 -1
  31. package/dist/codegen/journey-setup.d.ts +14 -0
  32. package/dist/codegen/journey-setup.d.ts.map +1 -0
  33. package/dist/codegen/journey-setup.js +69 -0
  34. package/dist/codegen/journey-setup.js.map +1 -0
  35. package/dist/core/modalities/explore.d.ts.map +1 -1
  36. package/dist/core/modalities/explore.js +12 -2
  37. package/dist/core/modalities/explore.js.map +1 -1
  38. package/dist/design/critique.d.ts +86 -0
  39. package/dist/design/critique.d.ts.map +1 -0
  40. package/dist/design/critique.js +62 -0
  41. package/dist/design/critique.js.map +1 -0
  42. package/dist/design/schema.d.ts +74 -0
  43. package/dist/design/schema.d.ts.map +1 -1
  44. package/dist/design/schema.js +22 -0
  45. package/dist/design/schema.js.map +1 -1
  46. package/dist/design/style.d.ts +18 -0
  47. package/dist/design/style.d.ts.map +1 -0
  48. package/dist/design/style.js +34 -0
  49. package/dist/design/style.js.map +1 -0
  50. package/dist/eval/coverage.d.ts +49 -0
  51. package/dist/eval/coverage.d.ts.map +1 -0
  52. package/dist/eval/coverage.js +60 -0
  53. package/dist/eval/coverage.js.map +1 -0
  54. package/dist/eval/gap-cases.d.ts +21 -0
  55. package/dist/eval/gap-cases.d.ts.map +1 -0
  56. package/dist/eval/gap-cases.js +27 -0
  57. package/dist/eval/gap-cases.js.map +1 -0
  58. package/dist/eval/legend.d.ts +3 -3
  59. package/dist/eval/legend.js +3 -3
  60. package/dist/eval/pilot.d.ts +4 -1
  61. package/dist/eval/pilot.d.ts.map +1 -1
  62. package/dist/eval/pilot.js +9 -2
  63. package/dist/eval/pilot.js.map +1 -1
  64. package/dist/flow/crawl.d.ts +66 -0
  65. package/dist/flow/crawl.d.ts.map +1 -0
  66. package/dist/flow/crawl.js +0 -0
  67. package/dist/flow/crawl.js.map +1 -0
  68. package/dist/flow/journey.d.ts +25 -0
  69. package/dist/flow/journey.d.ts.map +1 -0
  70. package/dist/flow/journey.js +51 -0
  71. package/dist/flow/journey.js.map +1 -0
  72. package/dist/flow/setup.d.ts +85 -0
  73. package/dist/flow/setup.d.ts.map +1 -0
  74. package/dist/flow/setup.js +65 -0
  75. package/dist/flow/setup.js.map +1 -0
  76. package/dist/fs/run-dir.d.ts +29 -0
  77. package/dist/fs/run-dir.d.ts.map +1 -0
  78. package/dist/fs/run-dir.js +113 -0
  79. package/dist/fs/run-dir.js.map +1 -0
  80. package/dist/llm/schema-lint.d.ts +9 -0
  81. package/dist/llm/schema-lint.d.ts.map +1 -0
  82. package/dist/llm/schema-lint.js +42 -0
  83. package/dist/llm/schema-lint.js.map +1 -0
  84. package/dist/observe/parse-aria.d.ts.map +1 -1
  85. package/dist/observe/parse-aria.js +11 -2
  86. package/dist/observe/parse-aria.js.map +1 -1
  87. package/dist/prompts/local/index.d.ts.map +1 -1
  88. package/dist/prompts/local/index.js +8 -0
  89. package/dist/prompts/local/index.js.map +1 -1
  90. package/dist/prompts/local/pilot-review.d.ts +1 -1
  91. package/dist/prompts/local/pilot-review.d.ts.map +1 -1
  92. package/dist/prompts/local/pilot-review.js +2 -1
  93. package/dist/prompts/local/pilot-review.js.map +1 -1
  94. package/dist/prompts/local/qa-case-critique.d.ts +8 -0
  95. package/dist/prompts/local/qa-case-critique.d.ts.map +1 -0
  96. package/dist/prompts/local/qa-case-critique.js +34 -0
  97. package/dist/prompts/local/qa-case-critique.js.map +1 -0
  98. package/dist/prompts/local/qa-gap-cases.d.ts +7 -0
  99. package/dist/prompts/local/qa-gap-cases.d.ts.map +1 -0
  100. package/dist/prompts/local/qa-gap-cases.js +22 -0
  101. package/dist/prompts/local/qa-gap-cases.js.map +1 -0
  102. package/dist/prompts/local/qa-journey-from-flow.d.ts +7 -0
  103. package/dist/prompts/local/qa-journey-from-flow.d.ts.map +1 -0
  104. package/dist/prompts/local/qa-journey-from-flow.js +29 -0
  105. package/dist/prompts/local/qa-journey-from-flow.js.map +1 -0
  106. package/dist/prompts/local/qa-setup-planner.d.ts +6 -0
  107. package/dist/prompts/local/qa-setup-planner.d.ts.map +1 -0
  108. package/dist/prompts/local/qa-setup-planner.js +28 -0
  109. package/dist/prompts/local/qa-setup-planner.js.map +1 -0
  110. package/dist/safety/guardrails.d.ts +36 -0
  111. package/dist/safety/guardrails.d.ts.map +1 -0
  112. package/dist/safety/guardrails.js +60 -0
  113. package/dist/safety/guardrails.js.map +1 -0
  114. package/package.json +1 -1
package/README.md CHANGED
@@ -11,306 +11,97 @@
11
11
  [![node](https://img.shields.io/badge/node-%3E%3D20-brightgreen)](package.json)
12
12
  [![license](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
13
13
 
14
- <!-- Inline player badge (optional): `asciinema upload docs/demo/cairn.cast`, then replace the line below
15
- with [![Cairn demo](https://asciinema.org/a/<id>.svg)](https://asciinema.org/a/<id>) — see docs/demo/. -->
16
14
  ▶ **Demo:** [`docs/demo/cairn.cast`](docs/demo/cairn.cast) — play with `asciinema play docs/demo/cairn.cast`
17
15
 
18
- > Autonomous QA agent (Node.js / TypeScript) that logs into a web app with a saved session, explores
19
- > pages (ARIA snapshot + screenshot), designs methodology-based UI test cases (ISO/IEC/IEEE 29119-4),
20
- > generates runnable `@playwright/test` code, self-validates and self-repairs, and **self-improves**
21
- > via Langfuse. A portable utility (CLI + library) for embedding into other TypeScript projects.
16
+ Autonomous QA agent (Node.js / TypeScript) that logs into a web app with a saved session, explores
17
+ pages (ARIA snapshot + screenshot), designs methodology-based UI test cases (ISO/IEC/IEEE 29119-4),
18
+ generates runnable `@playwright/test` code, self-validates, self-repairs, and **self-improves** via
19
+ Langfuse. A portable CLI + library for embedding into other TypeScript projects.
22
20
 
23
- **Cairn is the generation layer** — it produces tests across surfaces (UI today; API / unit / docs planned),
24
- each arriving by demand, one at a time. A separate **Plune** layer owns record / management / eval.
21
+ **Cairn is the generation layer** — it produces tests across surfaces (UI today; API / unit / docs
22
+ planned), each arriving by demand. A separate **Plune** layer owns record / management / eval.
25
23
 
26
- > **Renamed from Lex-Bot → Cairn.** The old `lex-bot` command and the `@plune-ai/lex-bot` package still
27
- > work — the CLI prints a one-line deprecation notice — but switch to `cairn` / `@plune-ai/cairn`; the old
28
- > names will be removed in 1–2 releases. Legacy `LEX_`/`LEXBOT_` env vars still work too; prefer `CAIRN_`.
24
+ > **Renamed Lex-Bot → Cairn.** The old `lex-bot` command and `@plune-ai/lex-bot` package still work
25
+ > (the CLI prints a one-line deprecation notice) — prefer `cairn` / `@plune-ai/cairn`. Legacy
26
+ > `LEX_`/`LEXBOT_` env vars still work too; prefer `CAIRN_`.
29
27
 
30
28
  ## What it does
31
29
 
32
- Point it at a URL (behind login, with a saved Playwright `storageState`) and it will:
30
+ Point it at a URL (behind login, with a saved Playwright `storageState`) and it will **observe** (ARIA
31
+ + screenshot + interactive elements), **ground** (verify every locator, explore tabs/views, probe safe
32
+ state transitions — so it tests what is *actually* there, not hallucinations), **design** 29119-4 cases
33
+ (EP / BVA / decision-table / state-transition / error-guessing), **generate & validate** POM-style
34
+ `@playwright/test` specs with **self-repair** (keep-best: a repair never makes the suite worse), and
35
+ **judge & learn** (deterministic scorers + an LLM judge + a holistic **Pilot** verdict, traced to Langfuse).
33
36
 
34
- 1. **Observe** — navigate, wait for SPA hydration, capture an ARIA snapshot + screenshot, extract interactive elements.
35
- 2. **Ground** — verify every locator (`getByRole().count()`), explore tabs/views (multi-state), probe safe state transitions — so it tests what is *actually* there, not hallucinations.
36
- 3. **Design** — write methodology-based test cases (29119-4: EP / BVA / decision-table / state-transition / error-guessing), steered by an optional checklist and domain knowledge files.
37
- 4. **Generate & validate** — emit POM-style `@playwright/test` specs (role-based locators, `test.step`), run them, classify pass/fail/flaky, and **self-repair** failures (with keep-best: a repair never makes the suite worse).
38
- 5. **Judge & learn** — deterministic scorers + an LLM judge + a holistic **Pilot** verdict + semantic checklist coverage, all traced to Langfuse; accumulate the best cases across runs.
37
+ It writes two kinds of case: **ATC** (*Automatable* — code is generated) and **MTC** (*Manual* — full
38
+ submits, security/XSS, visual/UX, irreversible actions — left for a human).
39
39
 
40
40
  ## Two decoupled modes
41
41
 
42
- - **`design`** — explore + write test cases as Markdown files (`ATC-*` automatable / `MTC-*` manual) with recorded selectors. **No code.** Review them as a human, automate later.
43
- - **`automate`** — generate `@playwright/test` code from approved `ATC-*` cases (skips `MTC-*` manual ones).
42
+ - **`design`** — explore + write cases as Markdown (`ATC-*` / `MTC-*`) with recorded selectors. **No code.**
43
+ - **`automate`** — generate `@playwright/test` code from approved `ATC-*` cases (skips `MTC-*`).
44
44
  - **`explore`** — the full pipeline at once (cases → code → validation → repair → Pilot verdict).
45
45
 
46
- ## How it works — the full cycle
47
-
48
- New to this? The bot writes two kinds of test case:
49
- - **ATC** (*Automatable Test Case*) — the bot is confident it can drive reliably (read-only checks, verified locators) → it generates Playwright code for these.
50
- - **MTC** (*Manual Test Case*) — needs a human (full form submits, security/XSS, visual/UX, irreversible actions) → left for you to run by hand.
51
-
52
- The typical flow:
53
-
54
- 1. **Capture a session** (once) — log in so the bot can reach pages behind auth.
55
- 2. **Design** — the bot studies the page and writes test cases (`ATC-*` / `MTC-*` `.md` files with recorded selectors). No code yet.
56
- 3. **Review** — you read the cases (in the TUI: *Browse past runs* → open a run → *Cases*).
57
- 4. **Promote** *(optional)* — reviewed an `MTC` and decided it's actually automatable? `cairn promote …` (or `a` in the TUI) converts it to an `ATC` in place. It's then picked up by automate.
58
- 5. **Automate** — generate `@playwright/test` code from the `ATC` cases.
59
- 6. **Validate** — run the generated tests, classify pass/fail/flaky, and self-repair failures.
60
-
61
- `explore` runs steps 2–6 in one go; `design` + `automate` split them so you can review (and promote) in between. Full walkthrough: **[docs/getting-started.md](docs/getting-started.md)**.
46
+ Full walkthrough: **[Getting started](docs/getting-started.md)**.
62
47
 
63
48
  ## Install
64
49
 
65
50
  ```bash
66
51
  npm install -g @plune-ai/cairn # global CLI → run `cairn …`
67
- # …or local / library install:
68
- npm install @plune-ai/cairn # → run via `npx cairn …`
52
+ # …or local / library: npm install @plune-ai/cairn → run via `npx cairn …`
69
53
 
70
- # one-time: download the Chromium build Cairn drives (NOT shipped inside the npm package)
71
- cairn install-browsers # uses Cairn's OWN Playwright → always the right Chromium revision
72
- # …or skip the download entirely and drive your installed Google Chrome: pass --channel chrome
54
+ cairn install-browsers # one-time: the Chromium Cairn drives (its OWN Playwright revision)
73
55
  ```
74
56
 
75
- Requires Node.js 20+. Copy `.env.example` → `.env` and fill in your keys.
76
-
77
- > **Two ways to invoke.** A **global** install (`-g`) puts `cairn` on your PATH, so `cairn design …` works
78
- > anywhere. A **local** install does *not* — run it as **`npx cairn design …`** from the folder where you
79
- > installed it. The examples below use the bare `cairn`; prefix them with `npx` if you installed locally.
80
- >
81
- > **Browsers are a separate download.** `npm install` pulls the Playwright *library* but not its *browser
82
- > binaries*. Run **`cairn install-browsers`** once — it uses Cairn's own Playwright, so the Chromium
83
- > revision always matches what Cairn launches. Prefer your existing Chrome? Skip the download and pass
84
- > **`--channel chrome`** (this is also how Cairn coexists with a project that already ships its *own*
85
- > Playwright). Otherwise `explore` / `automate --validate` stop early with a clear *"Playwright browsers
86
- > are not installed"* message that prints both fixes — run **`cairn doctor`** any time to see the state.
57
+ Requires Node.js 20+. Copy `.env.example` → `.env` and add your keys. Browsers are a **separate
58
+ download** — run `cairn install-browsers` once, or pass `--channel chrome` to drive your installed
59
+ Chrome with **zero download** (also the simplest path for OAuth and for projects that already ship
60
+ Playwright). `cairn doctor` diagnoses the setup. See **[Authenticated targets](docs/sessions.md)** and
61
+ **[Configuration](docs/configuration.md)**.
87
62
 
88
63
  ## Quickstart
89
64
 
90
- > Installed locally (without `-g`)? Prefix every `cairn …` below with `npx` (e.g. `npx cairn design …`).
65
+ > Installed locally (without `-g`)? Prefix every `cairn …` below with `npx`.
91
66
 
92
67
  ```bash
93
- # 0. One-time: download the browser Cairn drives (skip if you already ran it during install,
94
- # or skip entirely and add --channel chrome to drive your installed Google Chrome)
95
- cairn install-browsers
96
-
97
- # 1. Capture a session (opens a browser to log in)
68
+ # 1. Capture a login session once (a browser opens — log in, then press Enter)
98
69
  cairn session capture --url https://app.example.com/login --name myapp
99
70
 
100
71
  # 2. Design test cases (no code) — review the .md files it writes
101
72
  cairn design --url https://app.example.com/page --session myapp --checklist plan.md
102
73
 
103
- # 3. (optional) Promote a manual case you decided is automatable: MTC → ATC
104
- cairn promote --run runs/<id> --cases MTC-LOGIN-001
105
-
106
- # 4. Automate the approved (ATC) cases → @playwright/test code, and run them
74
+ # 3. Automate the approved (ATC) cases → @playwright/test code, and run them
107
75
  cairn automate --run runs/<id> --validate --session myapp
108
76
 
109
77
  # …or do everything at once:
110
78
  cairn explore --url https://app.example.com/page --session myapp --checklist plan.md
111
79
  ```
112
80
 
113
- The `--checklist` file steers **what** the bot tests (and is scored as coverage). Copy
114
- [`examples/plan.md`](examples/plan.md) — a ready-to-run checklist for `https://plune.ai/cairn` — as a starting point.
115
-
116
- Add `--fresh` (on `design` and `explore`) to **ignore prior runs of the same URL**. By default a 2nd+
117
- run on a URL reuses its *previously stable* cases as context and generates only the **delta** (new
118
- cases), so re-runs get smaller. `--fresh` skips that and generates a **full set** every time — useful
119
- for clean A/B comparisons. In the TUI it's the "Ignore prior-run experience for this URL?" toggle (default **no**).
120
-
121
- New here? Read the **[Getting started guide](docs/getting-started.md)** — it walks the whole cycle with explanations.
122
-
123
- ## Authenticated targets
124
-
125
- Cairn explores your app **as a logged-in user**. You capture the login **once** into a Playwright
126
- `storageState` (cookies + localStorage); every later run reuses it — no credentials in code, no
127
- re-login per run.
128
-
129
- ```bash
130
- # 1. Capture once — a real browser opens; log in by hand, then press Enter.
131
- cairn session capture --url https://your-app.example.com/login --name myapp
132
-
133
- # 2. Point Cairn at any page behind that login, reusing the session.
134
- cairn explore --url https://your-app.example.com/dashboard --session myapp
135
- ```
136
-
137
- - **Pointing Cairn at your OWN gated app?** That's the intended flow — capture against your login page, then `explore` / `design` any authenticated page with `--session <name>`.
138
- - **OAuth / Google login** (blocks automated browsers): add `--channel chrome` to drive your real Google Chrome. `--channel` works on `session capture`, `observe`, `design`, `explore`, and `automate --validate` — and needs **no bundled-Chromium download**, so it's also the simplest way to run inside a project that already has its own Playwright. (Without a channel, Cairn uses the bundled Chromium from `cairn install-browsers`.)
139
- - **Manage sessions:** `cairn session ls` lists saved sessions; `cairn session rm <name>` deletes one. (`cairn login` is a shorthand for `cairn session capture`.)
140
- - **Already have a `storageState.json`?** Skip capture and pass it directly: `--session-file ./path/to/state.json`.
141
- - **Expired session?** If the first page Cairn sees looks like a login screen, it stops with a clear *re-capture* message instead of exploring the sign-in page.
142
- - **Secrets hygiene:** sessions live in `.auth/` (matching `*.storageState.json`), which is **gitignored** — never committed. Treat the files like passwords.
143
-
144
- > Working inside the repo? `npm run session:save -- --url <u> --name <s>` still works — it's a thin wrapper over the same capture logic that ships as `cairn session capture`.
145
-
146
- ## Interactive TUI (optional)
147
-
148
- Run `cairn` with **no arguments** in a terminal to open the interactive TUI (built with Ink / React-for-CLI).
149
- Ink and React are **optional dependencies** — a default install omits them to keep the footprint small.
150
- Install them once to enable the TUI:
151
-
152
- ```bash
153
- npm install ink react ink-select-input ink-spinner ink-text-input
154
- ```
155
-
156
- Then:
81
+ `--checklist` steers **what** the bot tests (and is scored as coverage) — copy
82
+ [`examples/plan.md`](examples/plan.md) as a starting point. Add `--fresh` to ignore prior runs of a URL,
83
+ `--style <pack>` to restyle cases ([Prompts & styles](docs/prompts-and-styles.md)), or `--critique` to
84
+ prune weak cases and top up technique gaps. (Git Bash: quote `--run 'runs/<id>'` or use the bare id.)
157
85
 
158
- ```bash
159
- cairn # launches the terminal UI (requires the Ink packages above)
160
- ```
86
+ ## Interactive TUI
161
87
 
162
- Pick a command (explore / design / automate), fill parameters (URL, session, checklist, style, fresh) via a
163
- guided form, watch a **live dashboard** of the pipeline stages as the run progresses, read the result summary
164
- (scores, green %, Pilot verdict, test cases), and **browse past runs** in `./runs` — opening any run to
165
- read its test cases, report and logs.
166
-
167
- The commands below stay available for scripting/CI; in a non-interactive (piped/CI) shell, `cairn` with
168
- no arguments prints help instead of starting the UI. If the Ink packages are not installed, `cairn` with
169
- no arguments also falls back to printing help.
88
+ Run `cairn` with **no arguments** in a terminal for a guided UI (launcher → form → live dashboard →
89
+ result summary → past-run browser). Ink/React are optional deps — see **[docs/tui.md](docs/tui.md)**.
170
90
 
171
91
  ## Commands
172
92
 
173
93
  | Command | Purpose |
174
94
  |---|---|
175
- | `cairn session capture --url <loginUrl> --name <s>` | Capture a login session once → `.auth/` (`cairn login` is a shorthand; `session ls` / `session rm`) |
95
+ | `cairn session capture --url <loginUrl> --name <s>` | Capture a login session → `.auth/` (`cairn login` is a shorthand; `session ls` / `rm`) |
176
96
  | `cairn observe --url <u> [--session <s>]` | ARIA snapshot + interactive elements + screenshot |
177
- | `cairn design --url <u> --session <s> [--checklist <f>] [--style <s>] [--fresh]` | Test cases only (ATC/MTC `.md` + selectors), no code |
97
+ | `cairn design --url <u> --session <s> [--checklist <f>] [--style <s>] [--fresh] [--critique]` | Test cases only (ATC/MTC `.md` + selectors), no code |
178
98
  | `cairn automate --run <dir> [--validate --session <s>]` | `@playwright/test` from `ATC-*` cases |
179
99
  | `cairn promote --run <dir> --cases <ids> [--session <s>]` | Promote manual MTC case(s) to ATC (.md only; then `automate`) |
180
- | `cairn explore --url <u> --session <s> [--checklist <f>] [--fresh]` | Full pipeline (cases → code → validate → repair → Pilot) |
100
+ | `cairn explore --url <u> --session <s> [--checklist <f>] [--fresh] [--critique]` | Full pipeline (cases → code → validate → repair → Pilot) |
181
101
  | `cairn experiment --dataset <d> --candidate name=file` | Compare prompt versions on a dataset |
182
102
 
183
103
  > `lex-bot <command>` still runs every command above (deprecated alias — prints a notice, then runs `cairn`).
184
104
 
185
- ## Configuration (env)
186
-
187
- | Var | Purpose |
188
- |---|---|
189
- | `LLM_PROFILE` | `anthropic` \| `openrouter` \| `mixed` (per-tier default models) |
190
- | `LLM_ROUTING` | per-role preset: `fast` (Groq worker) \| `volume` (OpenRouter worker) — see [Role routing](#role-routing) |
191
- | `ANTHROPIC_API_KEY` / `OPENROUTER_API_KEY` / `GROQ_API_KEY` | provider keys (per profile / routing) |
192
- | `QA_TESTCASE_LANG` | test-case language (default `English`; e.g. `Ukrainian`, `uk`) |
193
- | `LANGFUSE_BASE_URL` / `LANGFUSE_PUBLIC_KEY` / `LANGFUSE_SECRET_KEY` | Langfuse — **cloud or self-hosted** (optional; see [below](#optional-langfuse)) |
194
- | `BROWSER_BACKEND` | `lib` (in-process Playwright) \| `cli` |
195
- | `BROWSER_CHANNEL` | `chrome`/`msedge` → drive a system browser (helps with OAuth; **no bundled-Chromium download**, and coexists with a host project's own Playwright). Per-command flag: `--channel`. |
196
- | `MAX_REPAIR` | repair attempts (default 2) |
197
-
198
- - **Env var prefix:** every variable above is read as-is **or** with a `CAIRN_` prefix (e.g. `CAIRN_LLM_PROFILE`, `CAIRN_MAX_REPAIR`). Legacy `LEX_`/`LEXBOT_` prefixes still work but print a one-time deprecation warning — prefer `CAIRN_`.
199
- - <a id="role-routing"></a>**Role routing (`LLM_ROUTING`, optional):** layer a cheap **worker** over any profile while keeping the strong **reasoner**. One flag picks where the mechanical steps (identify-elements, generate-code/repair) run:
200
- - `fast` → worker on **Groq** `llama-3.3-70b-versatile` — lowest latency/cost, OpenAI-compatible tool-calling.
201
- - `volume` → worker on **OpenRouter** `deepseek/deepseek-chat` — model breadth.
202
- - default (unset) → the profile's own per-tier models.
203
-
204
- In **every** preset the reasoner (design test cases + Pilot verdict) stays on **Anthropic** `claude-opus-4-8` for judgment quality, and the cheap `judge` scorer keeps the profile tier (routing never touches it). Override any role with `CAIRN_ROLE_WORKER` / `CAIRN_ROLE_REASONER=provider:model`; pass `--routing <preset>` on `explore`/`design`/`automate` to set it per run. Per-run **per-role cost** (tokens + $) is printed in the run summary.
205
- - **Domain knowledge:** put `*.md` files in `./knowledge/` with a `url:` front-matter to inject credentials/validation rules into design.
206
- - **Prompt overrides:** drop `./prompts/<name>.md` to override any built-in prompt without rebuilding.
207
-
208
- ## Metrics
209
-
210
- Every run scores itself. The numbers appear in the console (`=== Metrics ===`), in each run's
211
- `report.md` (with a one-line meaning per metric), and in Langfuse when configured. **↑ = higher is
212
- better, ↓ = lower is better.** `case_redundancy` and `flaky_ratio` are the **only** "lower is better"
213
- metrics — every other metric is higher-is-better.
214
-
215
- <!-- KEEP IN SYNC with src/eval/legend.ts (METRIC_LEGEND) — same metric names, directions, and blurbs. -->
216
-
217
- **Deterministic** (computed from run data, no LLM):
218
-
219
- | metric | direction | meaning |
220
- |---|---|---|
221
- | `runs_green` | ↑ higher is better | Share of generated tests that pass on validation. |
222
- | `flaky_ratio` | ↓ lower is better | Share of tests classified flaky (inconsistent pass/fail). |
223
- | `verified_ratio` | ↑ higher is better | Share of identified elements that resolve to exactly one element (unique locator). |
224
- | `grounding` | ↑ higher is better | Share of cases whose element refs all point to real on-page elements (no hallucinated refs). |
225
- | `locator_quality` | ↑ higher is better | Share of user-facing locators (getByRole/Label/Text…) vs fragile (.locator/getByTestId). |
226
- | `locator_robustness` | ↑ higher is better | Weighted selector strength: role 1.0 > label/text 0.8 > test-id 0.5 > css 0. |
227
- | `technique_coverage` | ↑ higher is better | Distinct test techniques used out of the 6 (ISO/IEC/IEEE 29119-4). |
228
- | `case_redundancy` | ↓ lower is better | Share of cases that are near-duplicates of another (0 = all distinct). |
229
-
230
- **Judge** (LLM-scored):
231
-
232
- | metric | direction | meaning |
233
- |---|---|---|
234
- | `test_case_quality` | ↑ higher is better | Holistic quality of the cases (clarity, correctness, usefulness). |
235
- | `methodology_adherence` | ↑ higher is better | How well the cases follow the testing methodology. |
236
- | `checklist_coverage` | ↑ higher is better | Semantic coverage of the provided checklist by the cases. |
237
-
238
- (The holistic **Pilot** verdict is separate — a pass / needs-work / fail judgment on the whole run, not a 0–1 score.)
239
-
240
- ## Cost benchmark
241
-
242
- What does a run cost on each [routing preset](#role-routing)? The table below is generated by
243
- `npm run bench`: it runs `cairn explore` against a fixed target once per preset and reads the per-run
244
- cost ledger (tokens + $) already written into each run's `report.json` (L1-01) — it re-prices nothing.
245
- Treat the numbers as an **approximate, single-run snapshot** (LLM token counts vary run-to-run).
246
-
247
- <!-- BENCHMARK:START -->
248
- <!-- Generated by `npm run bench` — do not edit between the BENCHMARK markers by hand. -->
249
-
250
- _Snapshot: 2026-06-13 · commit `a2906cf` · profile `anthropic` · MAX_REPAIR=0 · target: `https://demoqa.com/text-box` (no session) · approximate, single-run._
251
-
252
- | Preset | Worker | Reasoner | Tokens/run | $/run | Wall-clock/run | $/hour† |
253
- |---|---|---|---|---|---|---|
254
- | `default` | claude-haiku-4-5+claude-sonnet-4-6 | claude-opus-4-8 | 27,191 | $0.2854 | 390.6s | $2.63 |
255
- | `volume` | deepseek/deepseek-chat | claude-opus-4-8 | 13,923 | $0.1209 | 58.2s | $7.48 |
256
- | `fast` | llama-3.3-70b-versatile | claude-opus-4-8 | n/a — run failed: 400 Failed to call a function. Please adjust your prompt. See 'fail… | — | — | — |
257
-
258
- † **$/hour is an extrapolation**, not a steady-state rate: `$/run × (3600 / seconds-per-run)` — the cost if runs fired back-to-back for an hour. Real throughput varies with target complexity, retries, and provider latency.
259
-
260
- Reproduce: `npm run bench -- --url https://demoqa.com/text-box --session <name>`
261
-
262
- > Token counts vary run-to-run (LLM nondeterminism). OpenRouter/Groq prices are approximate and movable ([ADR-0002](docs/adr/0002-llm-anthropic-tiering.md)); Anthropic prices follow the published rates. `$/run` is `—` when a model has no configured price (tokens are still counted).
263
- <!-- BENCHMARK:END -->
264
-
265
- Regenerate it yourself — you need the provider keys for the presets you want measured and, ideally, a
266
- [captured session](#authenticated-targets) so the target is a real page rather than `example.com`:
267
-
268
- ```bash
269
- npm run bench -- --url https://your-app.example.com/dashboard --session myapp --write
270
- ```
271
-
272
- For reproducibility the benchmark **pins `LLM_PROFILE=anthropic` and `MAX_REPAIR=0`** (both shown in the
273
- snapshot line) instead of inheriting your `.env` — so `default` always means the same baseline and the
274
- [reasoner stays on Opus in every preset](#role-routing); only the worker changes. Override with
275
- `--profile <p>` / `--max-repair <n>`. A preset whose provider key is unset is **skipped** and shown as
276
- `n/a`, so a partial run (e.g. only `ANTHROPIC_API_KEY` available) still produces a useful table.
277
-
278
- ## Optional: Langfuse
279
-
280
- Langfuse is **entirely optional** — leave the `LANGFUSE_*` variables unset and the bot runs fully offline.
281
- Everything core still works: `observe` / `design` / `automate` / `explore`, locator grounding, the LLM judge,
282
- deterministic scorers, self-repair, and results-level learning (best cases are read from local
283
- `runs/<id>/report.json`). Prompts fall back to the built-in defaults — override any of them with `./prompts/<name>.md`.
284
-
285
- Set the three `LANGFUSE_*` variables to **additionally** get: traces in the Langfuse UI, scores/datasets
286
- recorded centrally, and versioned prompts (with production labels & A/B prompt experiments via `cairn experiment`).
287
-
288
- Tracing ships as an **optional add-on** (0.3.3): the `@langfuse/*` / `@opentelemetry/*` packages are no
289
- longer part of the default install — that keeps the footprint small and `npm audit` clean. Install them
290
- once to enable it:
291
-
292
- ```bash
293
- npm install @langfuse/client @langfuse/langchain @langfuse/otel @langfuse/tracing @opentelemetry/api @opentelemetry/sdk-node
294
- ```
295
-
296
- If the `LANGFUSE_*` variables are set but the packages aren't installed, Cairn prints a one-line hint and
297
- keeps running **without** tracing — it never crashes a run over telemetry.
298
-
299
- **Cloud or self-hosted — same setup.** Langfuse Cloud and a self-hosted instance are configured identically:
300
- you only pass the host URL and the API keys, nothing else changes.
301
-
302
- ```bash
303
- # Pick ONE base URL:
304
- LANGFUSE_BASE_URL=https://cloud.langfuse.com # Langfuse Cloud (EU)
305
- # LANGFUSE_BASE_URL=https://us.cloud.langfuse.com # Langfuse Cloud (US)
306
- # LANGFUSE_BASE_URL=https://langfuse.your-host.tld # self-hosted
307
- LANGFUSE_PUBLIC_KEY=pk-lf-...
308
- LANGFUSE_SECRET_KEY=sk-lf-...
309
- ```
310
-
311
- > Enablement is all-or-nothing: Langfuse turns on only when **all three** variables are set; otherwise
312
- > telemetry is a no-op and the bot behaves exactly as offline.
313
-
314
105
  ## Library API
315
106
 
316
107
  ```ts
@@ -321,6 +112,14 @@ const result = await runDesign({ url, config, sessionName: "myapp", checklistTex
321
112
  // result.testCases, result.testCaseFiles, result.scores
322
113
  ```
323
114
 
115
+ ## Documentation
116
+
117
+ - **[Getting started](docs/getting-started.md)** — step-by-step onboarding (session → design → review → promote → automate → validate).
118
+ - **[Authenticated targets](docs/sessions.md)** · **[Configuration & role routing](docs/configuration.md)** · **[Prompts & styles](docs/prompts-and-styles.md)** · **[Interactive TUI](docs/tui.md)**
119
+ - **[Metrics](docs/metrics.md)** · **[Cost benchmark](docs/cost.md)** · **[Langfuse](docs/langfuse.md)**
120
+ - **[Architecture overview](docs/architecture/overview.md)** — the plain async pipeline, locator grounding, self-improvement.
121
+ - **[Architecture Decision Records](docs/adr/)** — why it's built this way (0001–0013).
122
+
324
123
  ## Development
325
124
 
326
125
  ```bash
@@ -330,12 +129,6 @@ npm run test:coverage
330
129
  npm run lint
331
130
  ```
332
131
 
333
- ## Documentation
334
-
335
- - **[Getting started](docs/getting-started.md)** — step-by-step onboarding (session → design → review → promote → automate → validate), written for people new to the tool.
336
- - **[Architecture overview](docs/architecture/overview.md)** — how the agent works inside (the plain async pipeline, locator grounding, self-improvement).
337
- - **[Architecture Decision Records](docs/adr/)** — why it's built this way (0001–0013, incl. the interactive TUI, the `@playwright/test` output format, the Lex-Bot → Cairn rename, the Apache-2.0 relicense, and the drop of LangGraph in 0.4.0).
338
-
339
132
  ## License
340
133
 
341
- Apache-2.0 (relicensed from GPL-3.0 in 0.3.0 — see [`docs/adr/0012`](docs/adr/0012-relicense-to-apache-2.0.md)). Methodology prompts ported from `AZANIR/qa-skills` (see `docs/adr/0008`).
134
+ Apache-2.0 (relicensed from GPL-3.0 in 0.3.0 — see [`docs/adr/0012`](docs/adr/0012-relicense-to-apache-2.0.md)). Methodology prompts ported from `AZANIR/qa-skills` (see [`docs/adr/0008`](docs/adr/0008-methodology-port-from-qa-skills.md)).
@@ -1,6 +1,10 @@
1
1
  import { type PageStudy } from "../observe/index.js";
2
2
  import { type PageAnalysis } from "../analyze/index.js";
3
3
  import { type TestCase } from "../design/index.js";
4
+ import { type CritiqueDelta } from "../design/critique.js";
5
+ import { type FlowGraph } from "../flow/crawl.js";
6
+ import { type SetupPlan } from "../flow/setup.js";
7
+ import type { JourneyCase } from "../design/schema.js";
4
8
  import { type GeneratedSuite } from "../codegen/index.js";
5
9
  import { type Transition } from "../probe/index.js";
6
10
  import type { ValidationReport } from "../validate/index.js";
@@ -15,6 +19,18 @@ export interface ExploreDeps {
15
19
  analyzeInvoke: StructuredInvoke;
16
20
  designInvoke: StructuredInvoke;
17
21
  codegenInvoke: StructuredInvoke;
22
+ /** #82: worker-tier invoker for the design-time self-critique pass. Absent → pass is skipped. */
23
+ critiqueInvoke?: StructuredInvoke;
24
+ /** #82: run the self-critique pass (prune + technique top-up). Conservative default: off. */
25
+ critique?: boolean;
26
+ /** #59: follow in-app navigation, build a page/flow graph, design multi-page journey cases. Opt-in. */
27
+ flow?: boolean;
28
+ /** #59: max pages to crawl when `flow` is on (page cap — cost guardrail). Default 1 (single page). */
29
+ maxPages?: number;
30
+ /** #60: plan + emit starting-state setup (fixtures / API seed) for journeys. Opt-in. */
31
+ setup?: boolean;
32
+ /** #60: worker-tier invoker for setup planning (precondition extraction). Absent → no setup. */
33
+ setupInvoke?: StructuredInvoke;
18
34
  useVision: boolean;
19
35
  checklistText?: string;
20
36
  knowledgeText?: string;
@@ -63,6 +79,14 @@ export interface ExploreOutcome {
63
79
  stoppedEarly: boolean;
64
80
  /** Repair attempts actually run (0 = green on the first try, or maxRepair=0 or codeless). */
65
81
  attempts: number;
82
+ /** #82: before/after delta of the self-critique pass (undefined when the pass didn't run). */
83
+ critique?: CritiqueDelta;
84
+ /** #59: the page/flow graph crawled when `flow` is on (undefined for single-page runs). */
85
+ flowGraph?: FlowGraph;
86
+ /** #59: multi-page journey cases designed from the graph (undefined for single-page runs). */
87
+ journeys?: JourneyCase[];
88
+ /** #60: per-journey structured setup plans (undefined unless `setup` ran). */
89
+ setupPlans?: SetupPlan[];
66
90
  }
67
91
  /** Sprint 3: observe → identify → design → generateCode → validate ⇄ repair (bounded by maxRepair). */
68
92
  export declare function runExploreGraph(deps: ExploreDeps, init: {
@@ -1 +1 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/agent/graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,q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AAY,EAAE,OAAO,CAAC;IACtB,6FAA6F;IAC7F,QAAQ,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,2FAA2F;IAC3F,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;CAC1B;AAED,uGAAuG;AACvG,wBAAsB,eAAe,CACnC,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACnC,OAAO,CAAC,cAAc,CAAC,CAyQzB"}
@@ -2,6 +2,11 @@ import { capture } from "../observe/index.js";
2
2
  import { parseAriaSnapshot } from "../observe/parse-aria.js";
3
3
  import { analyzePage } from "../analyze/index.js";
4
4
  import { designTestCases } from "../design/index.js";
5
+ import { critiqueCases } from "../design/critique.js";
6
+ import { crawlFlow } from "../flow/crawl.js";
7
+ import { designJourneys } from "../flow/journey.js";
8
+ import { planSetup } from "../flow/setup.js";
9
+ import { buildJourneySetupSuite } from "../codegen/journey-setup.js";
5
10
  import { generateSuite } from "../codegen/index.js";
6
11
  import { probeTransitions } from "../probe/index.js";
7
12
  import { looksLikeLoginPage, expiredSessionMessage } from "../session/index.js";
@@ -114,7 +119,7 @@ export async function runExploreGraph(deps, init) {
114
119
  deps.onProgress?.(`probeInteractions — transitions observed: ${transitions.length}`);
115
120
  // ── designTestCases ───────────────────────────────────────────────────────
116
121
  deps.onProgress?.("designTestCases — designing cases (LLM reasoning, may take ~a minute)…");
117
- const testCases = await designTestCases({
122
+ let testCases = await designTestCases({
118
123
  study,
119
124
  pageSemantics: analysis.pageSemantics,
120
125
  checklistText: deps.checklistText,
@@ -126,6 +131,28 @@ export async function runExploreGraph(deps, init) {
126
131
  language: deps.languageText,
127
132
  }, { invoke: deps.designInvoke, prompts: deps.prompts });
128
133
  deps.onProgress?.(`designTestCases — generated ${testCases.length} cases`);
134
+ // ── critique (opt-in, #82) ────────────────────────────────────────────────
135
+ // One cheap worker-tier pass that prunes weak cases + tops up under-represented techniques.
136
+ // Best-effort: a critique failure must never sink a run that already has a valid design set.
137
+ let critique;
138
+ if (deps.critique && deps.critiqueInvoke && testCases.length > 0) {
139
+ deps.onProgress?.("critique — pruning weak cases + topping up technique gaps (worker)…");
140
+ try {
141
+ const out = await critiqueCases({
142
+ testCases,
143
+ pageSemantics: analysis.pageSemantics,
144
+ knownRefs: verified.filter((v) => v.count >= 1).map((v) => v.ref),
145
+ language: deps.languageText,
146
+ }, { invoke: deps.critiqueInvoke, prompts: deps.prompts });
147
+ testCases = out.cases;
148
+ critique = out.delta;
149
+ deps.onProgress?.(`critique — pruned ${critique.pruned}, topped up ${critique.toppedUp}; ` +
150
+ `technique coverage ${critique.techniqueCoverageBefore.toFixed(2)}→${critique.techniqueCoverageAfter.toFixed(2)}`);
151
+ }
152
+ catch {
153
+ // critique is best-effort — keep the original design set on any failure.
154
+ }
155
+ }
129
156
  // Durability: persist the cases NOW (best-effort), mirroring onStudy (#38) — a kill during the later
130
157
  // codegen/validate phase (minutes for explore) must not lose what we already designed.
131
158
  try {
@@ -134,9 +161,50 @@ export async function runExploreGraph(deps, init) {
134
161
  catch {
135
162
  // durability is best-effort — never let it break the run.
136
163
  }
164
+ // ── flow exploration (opt-in, #59) ────────────────────────────────────────
165
+ // Crawl in-app navigation → page/flow graph → multi-page journey cases. Runs AFTER per-page design
166
+ // so single-page output is unchanged; best-effort so a crawl failure can't sink the per-page cases.
167
+ let flowGraph;
168
+ let journeys;
169
+ let setupPlans;
170
+ if (deps.flow && (deps.maxPages ?? 1) > 1) {
171
+ deps.onProgress?.(`flow — crawling up to ${deps.maxPages} pages (reusing the session)…`);
172
+ try {
173
+ const startNode = { url: study.url, study, verified: verified.filter((v) => v.count >= 1), transitions };
174
+ flowGraph = await crawlFlow(startNode, { gateway: deps.gateway, onProgress: deps.onProgress }, { maxPages: deps.maxPages ?? 1 });
175
+ deps.onProgress?.(`flow — graph: ${flowGraph.nodes.length} pages, ${flowGraph.edges.length} transitions`);
176
+ journeys = await designJourneys({ graph: flowGraph, language: deps.languageText }, { invoke: deps.designInvoke, prompts: deps.prompts });
177
+ deps.onProgress?.(`flow — ${journeys.length} journey case(s) spanning ≥2 pages`);
178
+ // #60: plan the starting-state setup per journey + emit runnable journey specs (fixtures / seed).
179
+ if (deps.setup && deps.setupInvoke && journeys.length > 0) {
180
+ deps.onProgress?.("flow — planning starting-state setup for journeys (worker)…");
181
+ setupPlans = [];
182
+ for (const j of journeys) {
183
+ try {
184
+ setupPlans.push(await planSetup({ journey: j, pageSemantics: analysis.pageSemantics }, { invoke: deps.setupInvoke, prompts: deps.prompts }));
185
+ }
186
+ catch {
187
+ setupPlans.push({ preconditions: [] }); // a planning failure → an empty (no-precondition) spec
188
+ }
189
+ }
190
+ try {
191
+ const suite = buildJourneySetupSuite(journeys, setupPlans, flowGraph, study.url);
192
+ const written = await deps.runWriter.writeJourneySpecs(suite.files);
193
+ deps.onProgress?.(`flow — wrote ${written.length} journey spec(s) with setup → journeys/`);
194
+ }
195
+ catch {
196
+ // best-effort: a write failure must not sink the run
197
+ }
198
+ }
199
+ }
200
+ catch (e) {
201
+ const msg = e instanceof Error ? e.message.split("\n")[0] : String(e);
202
+ deps.onProgress?.(`flow — skipped (${msg})`); // best-effort: keep the per-page cases
203
+ }
204
+ }
137
205
  // ── codeless short-circuit ────────────────────────────────────────────────
138
206
  if (deps.codeless) {
139
- return { study, analysis, verified, transitions, testCases, stoppedEarly: false, attempts: 0 };
207
+ return { study, analysis, verified, transitions, testCases, stoppedEarly: false, attempts: 0, critique, flowGraph, journeys, setupPlans };
140
208
  }
141
209
  // ── generate → validate → repair (reuse runRepairLoop) ───────────────────
142
210
  const genAndWrite = async (repairHint) => {
@@ -178,6 +246,10 @@ export async function runExploreGraph(deps, init) {
178
246
  bestValidation,
179
247
  stoppedEarly,
180
248
  attempts,
249
+ critique,
250
+ flowGraph,
251
+ journeys,
252
+ setupPlans,
181
253
  };
182
254
  }
183
255
  //# sourceMappingURL=graph.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph.js","sourceRoot":"","sources":["../../src/agent/graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAkB,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAqB,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAiB,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAuB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAiEjD,uGAAuG;AACvG,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,IAAiB,EACjB,IAAoC;IAEpC,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAErB,4EAA4E;IAC5E,IAAI,CAAC,UAAU,EAAE,CAAC,yCAAyC,CAAC,CAAC;IAC7D,IAAI,KAAgB,CAAC;IACrB,IAAI,CAAC;QACH,KAAK,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,8FAA8F;QAC9F,MAAM,IAAI,GAAG,oBAAoB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC1C,IAAI,CAAC,UAAU,EAAE,CAAC,aAAa,IAAI,EAAE,CAA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