Step reuse and seeding
Like a maturing Cucumber suite, a maturing Saffron project accumulates
steps that new scenarios share ("I click continue on guest information
page"). Saffron builds a derived step index over all committed caches,
keyed by exact step text: author-declared identity, Cucumber-style,
plus quoted-value generalization: I enter "admin" in the username field seeds from a recording of I enter "bob" in the username field,
substituting the new quoted value wherever the recorded one appears as an
exact action-field value (partial matches and ambiguous duplicates bail
out rather than guess). Data-table steps seed when their table keys match. When
recording a new scenario, every seeded island of steps replays zero-AI
on the live browser and a bounded agent segment (max 3 per scenario)
records each gap: novel steps can sit anywhere, not just at the end.
Agent segments carry a hard stop rule before the next island; overshoot is
adopted from the agent's own recording rather than double-executed, and
captured values flow across segments. The composed result still
proof-replays end-to-end before the proposal is filed. Per-scenario caches remain the source of truth, so
scenarios stay free to diverge, and divergence is instrumented (reported
per run) as the evidence base for a future shared step library. A seeded
recording that fails to replay in the new scenario's context truncates
the seed there and is re-recorded fresh, with the divergence noted in the
proposal. Measured live: a 6-step scenario with a 4-step shared Background
recorded for $0.79 / 10 AI calls / 33s, vs $1.16 / 17 / 61s unseeded.
Disable with --no-reuse / "reuseSteps": false.