Happy Path Story
Developers build it. Fistron turns it into a test story, then into a test.
The developer knows what a new feature should do; the tester gets a diff and a ticket and has to work it out again. A Happy Path Story closes that gap: a short text of what must at least work, in plain words, that Fistron drafts from what the developer built. The developer does not write it, only checks and confirms it. It stays in the repository beside the code, and QE gets it with the request (ADR 0191).
A story has four parts, with no required syntax:
- what the feature does, in a sentence or two;
- what must be in place: the environment, data, accounts, settings;
- the steps, as a person or a test would do them;
- what should happen.
Before you start
- Fistron on your machine (
fistron), in your coding assistant (fistron mcp --engineer) or reviewing your requests in CI. - For a draft in words: a model for the role
authoring(Configure models (LLM endpoints)), within your data classes and model policy. Without one, Fistron gives a template with what it knows from the change, and you fill it in. - Every plan has the story’s draft and its confirmation, Individual too.
For developers: draft it, check it, confirm it
When the feature works on your branch:
fistron happy-path draft
Fistron reads your change against its base (the commits, what is not
committed yet, the new files), the ticket’s acceptance criteria when you
give its reading (--ticket issue-reading.json from fistron issue read), and your project’s confirmed stories, so the draft is written in
your team’s language. It writes the draft to
docs/happy-path/<name>.md and commits nothing.
$ fistron happy-path draft --base main --no-model
Fistron: the Happy Path Story “A discount at checkout” drafted by template
written to docs/happy-path/a-discount-at-checkout.md; nothing is committed
0 cases it does not cover, for QE, in fistron-happy-path/happy-path-story.json
the model was not asked: the template
then: check docs/happy-path/a-discount-at-checkout.md, then: fistron happy-path confirm docs/happy-path/a-discount-at-checkout.md
Read the draft as you would a colleague’s description of your feature,
and correct it. A model’s draft is labelled as one (drafted_by); what
it could not know it leaves in brackets, and so does the template. Fill
those in yourself, then confirm it:
fistron happy-path confirm docs/happy-path/a-discount-at-checkout.md
git add docs/happy-path/a-discount-at-checkout.md
The confirmation records who (--by, else git’s user), when, and what the
story covers: the files and functions of your change, which Fistron
watches later. Fistron refuses to confirm a story that still has a line in
brackets. Commit the story with the change; the request carries it.
- Your own words: a file you write yourself in
docs/happy-path/, without Fistron’s header, is a confirmed story too: confirmed by committing it. - In your coding assistant: ask it for the story of your feature. It
calls Fistron’s
happy_path_draft, shows you the text and what the story does not cover, and writes the file only with your consent. You confirm the story yourself, in your terminal; the assistant never does. - Before you open the request:
fistron happy-path check(with--titleand--labelas the request will have them) says what its review will say of the stories.
What the happy path does not cover
With every story Fistron lists apart, as suggestions for QE, what the story leaves out: the error states, the limits, the permissions, the upgrades, the settings and the combinations your change’s lines point at (an error raised, a check of a permission, a validation, a migration, a setting read). Each says where it comes from, Fistron’s rules or the model, and the line that suggested it. The list is never in your file: a story is the minimum that must work, never the whole of testing.
For QE: the story with the request
The review of the request (fistron review request, or Fistron’s review
in your CI) reads the stories of its head and says:
| What you see | When |
|---|---|
| The story, with who confirmed it and when | the change has a confirmed story |
| A draft offered in the review’s summary, with the command that keeps it | a feature’s change without a story |
happy_path_draft (a note) |
the change’s story is still a draft |
happy_path_outdated (a note) |
the change touches what a confirmed story covers, but not the story |
happy_path_missing (a warning, like missing evidence) |
your change policy requires a story, and a feature’s change has none |
What the happy path does not cover is in the summary too, folded, for you to pick from.
In Fistron, the review’s page (Pull and merge requests › The results) has the tab The Happy Path Story beside The review: the story Fistron drafted, to Copy the story or Download the file, the change’s stories with who confirmed them, what may be outdated, and What this happy path does not cover. Its What to do now gives the command for your working copy; Fistron writes nothing to your branch.
For QE: the test from the story
With a confirmed story and your suite’s map (Map your suite and plan the missing tests), Fistron has the test written:
fistron happy-path test docs/happy-path/a-discount-at-checkout.md --suite-map <suite-map.json>
The test is written from your suite’s own step definitions and helpers;
a step none of them does is written and labelled generated, for you to
review closely. The feature is tagged @happy-path:<name> and names the
story’s file, and your project’s rules for new tests apply. Fistron
checks it, then fistron propose test --repository <owner/name> --record <record> opens it as a pull or
merge request for you to review and merge, run in your CI
(Get new tests proposed); Fistron never merges.
Fistron never writes a test from a draft.
When your project has no end-to-end suite (a command-line tool with unit tests only), or you want a unit test, name a file the story covers:
fistron happy-path test docs/happy-path/pull-an-image.md --suite-map <suite-map.json> --unit acmectl/cmd/pull.go
The test is written beside the file’s tests, with your project’s own
assert helpers (a Go project’s testutils.AssertEquals), and names the
story in a comment. Go, Python and Java to begin with; the map names the
unit tests under Unit tests of the product’s code. Without a scenario
in the suite, a story’s test is a unit test of the first file it covers.
A step no test can take (a mail that arrives, a device, a person’s
judgement) is left out of the test and written as a checklist,
happy-path-checklist.md, each step with the evidence to keep. Do it as a
manual verification.
The test’s record (Proposed tests, Documents) says how much of it your suite had already, each piece with where it comes from, the test, and the steps left By hand, and gives the command that proposes it.
The project’s stories are under Test plan › Happy Path Stories: each by its newest review, confirmed, a draft or possibly outdated, with the request it is in, its ticket and its test. The one to look at first is in What to do now.
Keeping it true
When a later change touches a file or a function a confirmed story covers and leaves the story as it was, its review says the story may be outdated, with the command that drafts it again:
fistron happy-path draft --name a-discount-at-checkout --update
The story is then a draft until it is confirmed again. A test that names
a story (@happy-path:<name>) is said as possibly outdated when its story
changes.
Require a story for new features (optional)
Off by default. A team turns it on in .fistron/change-policy.toml:
[happy_path]
directory = "docs/happy-path"
required = true
features = { labels = ["feature", "enhancement"], titles = ["feat"] }
A change is a feature’s when its request has one of the labels, or its
title’s type is one of the titles (feat: ..., feat(cart): ...). Such a
change needs a confirmed story, its own or one whose covers it touches.
Without one its review reports happy_path_missing and offers the draft;
the gate decides as for any other finding. The reference:
happy-path.md.
Troubleshooting
- “… is confirmed: update drafts it again”: a confirmed story is
drafted again only on purpose:
--name <name> --update. - “… parts still to fill in”: the draft left a line in brackets; write what it asks, then confirm.
- “… written by the closed core’s test-author”: the test from a story needs the core (Individual on your own repositories, Team, Business, Enterprise); the story and its review do not.
- The draft is a template, not words: no model for the role
authoring,--no-model, or the change’s data class above what the model may receive; the draft’s notes say which.