saffron-ai 0.4.2 → 0.5.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/CHANGELOG.md +181 -0
- package/README.md +9 -2
- package/dist-pkg/cli.js +101 -100
- package/package.json +4 -2
- package/skills/saffron/references/config.md +1 -1
- package/templates/saucedemo/.env.example +5 -0
- package/templates/saucedemo/features/login.saffron +37 -0
- package/templates/saucedemo/features/shared.steps.saffron +25 -0
- package/templates/saucedemo/features/shopping.saffron +20 -0
- package/templates/saucedemo/saffron.config.json +6 -0
- package/textmate/saffron/syntaxes/saffron.tmLanguage.json +53 -31
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Saffron, in one place: the `saffron-ai` runner (npm),
|
|
4
|
+
the VS Code extension (`ChathurangaJayasinghe.saffron-vscode`) and the
|
|
5
|
+
JetBrains plugin (`ai.saffron.jetbrains`). Dates are publish dates.
|
|
6
|
+
|
|
7
|
+
## 0.5.1
|
|
8
|
+
|
|
9
|
+
Released 2026-09-14.
|
|
10
|
+
|
|
11
|
+
Runner
|
|
12
|
+
|
|
13
|
+
- Example suite: `.saffron` files only, with StepSets invoked both at the
|
|
14
|
+
start of scenarios and in the middle ("Recover from a locked-out
|
|
15
|
+
login", and a checkout set that carries a data table).
|
|
16
|
+
|
|
17
|
+
Editors
|
|
18
|
+
|
|
19
|
+
- Grammar: quoted arguments, `<placeholders>` and `{env:…}` / `{date…}`
|
|
20
|
+
tokens get their own scopes, so editors colour them like Cucumber
|
|
21
|
+
parameters instead of the whole step line. Ships in the VS Code
|
|
22
|
+
extension, the JetBrains plugin and the package's TextMate bundle.
|
|
23
|
+
|
|
24
|
+
## 0.5.0
|
|
25
|
+
|
|
26
|
+
Released 2026-09-14.
|
|
27
|
+
|
|
28
|
+
Runner
|
|
29
|
+
|
|
30
|
+
- Guided first run: `saffron init` offers to install the Saucedemo example
|
|
31
|
+
suite (`--examples` / `--no-examples`): five short scenarios against the
|
|
32
|
+
public demo shop, `{env:VAR}` credentials with a `.env.example`, a
|
|
33
|
+
Scenario Outline, a data table, and a StepSet in a library file, plus a
|
|
34
|
+
matching `saffron.config.json` with `retries: 1`. Only installs into an
|
|
35
|
+
empty `features/` directory. Documented as "Your first run".
|
|
36
|
+
|
|
37
|
+
## 0.4.2
|
|
38
|
+
|
|
39
|
+
Released 2026-09-13.
|
|
40
|
+
|
|
41
|
+
Runner
|
|
42
|
+
|
|
43
|
+
- `saffron run --rerecord`: discard the selected scenarios' caches and let
|
|
44
|
+
the agent record them fresh, seeded from the other recordings. The
|
|
45
|
+
sanctioned fix for a wrong recording instead of editing cache JSON.
|
|
46
|
+
- The recorder understands every way the agent types (`fill`,
|
|
47
|
+
`pressSequentially`, `type`) and drops the clearing `fill('')` that
|
|
48
|
+
precedes typing into the same field. This was the cause of caches with an
|
|
49
|
+
empty value for a step that passes one.
|
|
50
|
+
- A fill recorded with an empty value on a step that passes a value marks
|
|
51
|
+
the proposal UNVERIFIED with the reason, even if the proof replay passed.
|
|
52
|
+
- `saffron accept --all` skips UNVERIFIED proposals; `--include-unverified`
|
|
53
|
+
overrides, and accepting a single file still works with a warning.
|
|
54
|
+
- Retries are visible: a `retried ×N` chip per step in the report and a
|
|
55
|
+
`↻` line in the terminal. Retries stay per action with backoff; they are
|
|
56
|
+
not scenario re-runs.
|
|
57
|
+
- Scenario Outline rows display as `(example N)`; report, terminal and docs
|
|
58
|
+
use plain punctuation throughout.
|
|
59
|
+
- Reports and history carry the real package version.
|
|
60
|
+
|
|
61
|
+
Docs and site
|
|
62
|
+
|
|
63
|
+
- Documentation moved to the site's Docs section, generated from the
|
|
64
|
+
runner's markdown; the previous docs page became Features; the landing
|
|
65
|
+
page was trimmed.
|
|
66
|
+
- Assertion policy documented on the Features page; cache lifecycle gained
|
|
67
|
+
the staleness and wrong-recording stages.
|
|
68
|
+
|
|
69
|
+
## 0.4.1
|
|
70
|
+
|
|
71
|
+
Released 2026-09-13.
|
|
72
|
+
|
|
73
|
+
Runner
|
|
74
|
+
|
|
75
|
+
- JetBrains highlighting without the plugin: the package ships the TextMate
|
|
76
|
+
grammar at `textmate/saffron` for Settings → Editor → TextMate Bundles.
|
|
77
|
+
- `saffron lsp` run from a terminal prints the editor setup steps instead
|
|
78
|
+
of waiting silently for a client.
|
|
79
|
+
|
|
80
|
+
Editors
|
|
81
|
+
|
|
82
|
+
- JetBrains plugin 0.1.0 (Marketplace listing 34240): `.saffron` file type,
|
|
83
|
+
bundled grammar, `saffron lsp` wired through LSP4IJ automatically.
|
|
84
|
+
- JetBrains plugin 0.1.1: the no-package fallback runs
|
|
85
|
+
`npx -p saffron-ai saffron lsp` (the bare `saffron` name resolves an
|
|
86
|
+
unrelated npm package); the install hint shows once per project; dark
|
|
87
|
+
theme file icon; verified on 2024.2 through 2026.2.
|
|
88
|
+
- VS Code extension 0.1.3: plain punctuation in README, hover and
|
|
89
|
+
diagnostic messages.
|
|
90
|
+
|
|
91
|
+
## 0.4.0
|
|
92
|
+
|
|
93
|
+
Released 2026-09-13.
|
|
94
|
+
|
|
95
|
+
Runner
|
|
96
|
+
|
|
97
|
+
- Agent skill shipped in the package (`skills/saffron/SKILL.md` plus
|
|
98
|
+
reference sheets) following the Agent Skills specification.
|
|
99
|
+
- `saffron init`: installs the skill into `.claude/skills` and
|
|
100
|
+
`.agents/skills` (Copilot and Cursor on request), registers the
|
|
101
|
+
`saffron mcp` server in `.mcp.json`, `.cursor/mcp.json` and
|
|
102
|
+
`.vscode/mcp.json`, appends a managed block to `AGENTS.md` (and
|
|
103
|
+
`CLAUDE.md` when present), and scaffolds `saffron.config.json`,
|
|
104
|
+
`features/` and the `.gitignore` entry.
|
|
105
|
+
- Multi-tag `--filter` (OR semantics, comma-separated or repeated); scenario
|
|
106
|
+
tags are written to the report JSON and `history.jsonl` so external tools
|
|
107
|
+
can key results by a test-case tag.
|
|
108
|
+
- `saffron --version` reports the real package version.
|
|
109
|
+
|
|
110
|
+
Editors
|
|
111
|
+
|
|
112
|
+
- VS Code extension 0.1.1: case- and spacing-tolerant `StepSet` keyword
|
|
113
|
+
completion plus a definition snippet.
|
|
114
|
+
- VS Code extension 0.1.2: warning and quick fix when a set name is written
|
|
115
|
+
without the `StepSet` keyword.
|
|
116
|
+
|
|
117
|
+
## 0.3.1
|
|
118
|
+
|
|
119
|
+
Released 2026-08-15.
|
|
120
|
+
|
|
121
|
+
- `saffron --version` no longer reports a hardcoded value.
|
|
122
|
+
|
|
123
|
+
## 0.3.0
|
|
124
|
+
|
|
125
|
+
Released 2026-08-12.
|
|
126
|
+
|
|
127
|
+
Runner
|
|
128
|
+
|
|
129
|
+
- Network-aware steps in plain prose: `waitForResponse` (healable) blocks
|
|
130
|
+
until a matching backend response, `expectResponse` (assertion, never
|
|
131
|
+
healed) audits that one occurred. Matchers: URL pattern, method, status
|
|
132
|
+
(exact or class), optional body pattern for polling waits. Waits match
|
|
133
|
+
from the triggering step onward, so "click and wait" never races.
|
|
134
|
+
- Recording ergonomics: native dialogs, drag-and-drop and iframes record
|
|
135
|
+
live. The dialog auto-dismiss was the orchestrator's own launching
|
|
136
|
+
Playwright client, not the MCP; agent sessions now keep dialogs visible.
|
|
137
|
+
- Positive assertions recorded without frame scoping fall back to searching
|
|
138
|
+
child frames; poll-based assertions sweep all candidates under one
|
|
139
|
+
deadline.
|
|
140
|
+
|
|
141
|
+
Editors
|
|
142
|
+
|
|
143
|
+
- VS Code extension 0.1.0 published to the Marketplace.
|
|
144
|
+
|
|
145
|
+
## 0.2.0
|
|
146
|
+
|
|
147
|
+
Released 2026-07-19.
|
|
148
|
+
|
|
149
|
+
Runner
|
|
150
|
+
|
|
151
|
+
- Secrets: `{env:VAR}` tokens resolve from the environment (or a
|
|
152
|
+
git-ignored `.env`) at replay; caches, proposals, reports and history are
|
|
153
|
+
masked back to the token; missing variables fail fast by name.
|
|
154
|
+
- Action vocabulary for real-world pages: `handleDialog`, `uploadFile`,
|
|
155
|
+
`dragTo`, and iframe-scoped targets, replaying on Chromium, Firefox and
|
|
156
|
+
WebKit.
|
|
157
|
+
- Cross-browser replay (`--browser firefox|webkit`), parallel replay
|
|
158
|
+
workers (`--workers N`), and a cheaper model for heal sessions
|
|
159
|
+
(`--heal-model`).
|
|
160
|
+
|
|
161
|
+
## 0.1.0
|
|
162
|
+
|
|
163
|
+
Released 2026-07-10.
|
|
164
|
+
|
|
165
|
+
First public release, free for any use under the Saffron Free Use License.
|
|
166
|
+
|
|
167
|
+
- Gherkin-native runner: an AI agent records each scenario once; later runs
|
|
168
|
+
replay with plain Playwright at zero tokens; runtime healing files
|
|
169
|
+
reviewable proposals; assertions are never healed.
|
|
170
|
+
- Verified proposals (zero-AI proof replay), honest cost reporting, run
|
|
171
|
+
history and trends, chronic-scenario detection.
|
|
172
|
+
- Level-1 step reuse: new recordings seed from every step already
|
|
173
|
+
recorded.
|
|
174
|
+
- Data vocabulary: `<param>` placeholders, key/value and record tables,
|
|
175
|
+
doc strings, `{date±N}` templates, captured values.
|
|
176
|
+
- Assertion policy: `strict` (default) or `adaptable-mid`; the final
|
|
177
|
+
assertion block is always strict.
|
|
178
|
+
- Step sets and the `.saffron` dialect (`StepSet:`), project-wide library
|
|
179
|
+
files, parse-time expansion.
|
|
180
|
+
- Step vocabulary tooling: `saffron steps`, `saffron mcp`, `saffron lsp`,
|
|
181
|
+
`saffron author`; behavior-proven duplicate wording detection.
|
package/README.md
CHANGED
|
@@ -33,10 +33,16 @@ Data tables and doc strings are first-class: 2-column key/value tables parameter
|
|
|
33
33
|
```bash
|
|
34
34
|
npm install --save-dev saffron-ai
|
|
35
35
|
npx playwright install chromium
|
|
36
|
-
npx saffron init # config +
|
|
36
|
+
npx saffron init # config + agent skill; offers the Saucedemo example suite
|
|
37
37
|
npx saffron run
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
+
No app of your own yet? `npx saffron init --examples` installs a handful
|
|
41
|
+
of short `.saffron` scenarios against the public demo shop at saucedemo.com
|
|
42
|
+
(login, a Scenario Outline, cart, checkout, StepSets at the start and in
|
|
43
|
+
the middle of scenarios) so the first run records and replays something
|
|
44
|
+
real.
|
|
45
|
+
|
|
40
46
|
**Built for the AI era:** the package ships an [Agent Skill](https://agentskills.io) that teaches Claude Code, Codex, Cursor, Copilot and any skill-aware agent to write Saffron tests efficiently. Reuse recorded wordings, keep assertions sacred, secrets as `{env:VAR}`, so the tests your agents write replay at zero tokens instead of paying for near-duplicate recordings.
|
|
41
47
|
|
|
42
48
|
CI tip: `saffron run --strict` treats yellow (passed-with-adaptation) as a
|
|
@@ -73,7 +79,7 @@ node dist/cli/index.js -p examples accept --all
|
|
|
73
79
|
| `saffron mcp` | Serve the vocabulary to AI assistants over stdio MCP (`search_steps`, `list_step_sets`), e.g. `claude mcp add saffron -- npx saffron mcp`. |
|
|
74
80
|
| `saffron author <prose-file> [-o out]` | Draft a `.saffron` feature file from plain-paragraph requirements, reusing the project's step vocabulary (AI; reports how many lines are seedable). |
|
|
75
81
|
| `saffron lsp` | Run the Saffron language server over stdio for JetBrains (LSP4IJ/Ultimate), Neovim, any LSP editor: badge completion, StepSet go-to-definition, hover, diagnostics. Highlighting for JetBrains comes from the bundled TextMate grammar (`textmate/saffron` in the package); run `npx saffron lsp` in a terminal for setup steps. |
|
|
76
|
-
| `saffron init [--agents list]` | Make the project agent-ready: installs the bundled **Saffron agent skill** into `.claude/skills` and `.agents/skills` (Copilot/Cursor via `--agents`), registers the `saffron mcp` server in `.mcp.json` / `.cursor/mcp.json` / `.vscode/mcp.json`, adds a managed block to `AGENTS.md`/`CLAUDE.md`, scaffolds config. |
|
|
82
|
+
| `saffron init [--agents list] [--examples]` | Make the project agent-ready (`--examples` installs the Saucedemo example suite): installs the bundled **Saffron agent skill** into `.claude/skills` and `.agents/skills` (Copilot/Cursor via `--agents`), registers the `saffron mcp` server in `.mcp.json` / `.cursor/mcp.json` / `.vscode/mcp.json`, adds a managed block to `AGENTS.md`/`CLAUDE.md`, scaffolds config. |
|
|
77
83
|
| `saffron report` | Open the latest HTML report. |
|
|
78
84
|
|
|
79
85
|
Configuration lives in `saffron.config.json` at your project root:
|
|
@@ -137,6 +143,7 @@ far is in the roadmap's "Where we are" table.
|
|
|
137
143
|
|
|
138
144
|
- [Website](https://saffron-ai.lovable.app): what Saffron is, the honesty rules, economics, quickstart
|
|
139
145
|
- [Documentation](https://saffron-ai.lovable.app/docs): the cache lifecycle, step sets & the `.saffron` dialect, the step vocabulary, and the guarantees, with diagrams
|
|
146
|
+
- [Changelog](CHANGELOG.md), also at https://saffron-ai.lovable.app/docs/changelog
|
|
140
147
|
- [Issues & questions](https://github.com/s-chathuranga-j/saffron-ai/issues)
|
|
141
148
|
- **Docs site**: `npm run docs` builds a self-contained page at
|
|
142
149
|
## License
|