Skip to content

feat: explicit test scenarios - #15

Open
NejcS wants to merge 6 commits into
mainfrom
feat/explicit-test-scenarios
Open

NejcS wants to merge 6 commits into
mainfrom
feat/explicit-test-scenarios

Conversation

@NejcS

@NejcS NejcS commented Oct 19, 2026 •

Copy link
Copy Markdown

plain-parser reads the current ***plain syntax: # func-id headings in functional specs and test plain files with explicit test scenarios.

Functional specs
A functionality starts with a # <func-id> heading. Its body is one statement line and the bullets indented under it. A func-id has only lowercase letters, digits and hyphens, and is unique in its module.

Test plain files
A test plain file binds to one functionality with module: and func_id: in its frontmatter. It has a conformance tests section and an acceptance tests section. Each scenario is a # <scenario-id> heading followed by free text, which the parser keeps as written. The parser reads every .plain file under tests next to the module, or under the folders given with --test-dir or the config key test-dir. It checks that each file binds to an existing functionality, that the concepts in the scenarios are defined, that linked files exist, and that scenario-ids are unique per functionality.

Completeness
When the config names a conformance-tests-script, every functionality of every module in the chain needs at least one conformance scenario. The error names the functionality as <module>:<func-id> and the add-test-scenarios skill.

Old syntax
A flush-left - list in functional specs and an acceptance tests section in a core spec are errors. The message gives the file, the line and the migrate-plain-syntax skill.

Parse output
plain-parser parse prints format version 2. Each functionality carries its id, its text and its scenarios, and a new test_plain_files map lists every test plain file with the functionality it binds to. A reader of format version 1 must be updated. Today only plain-forge reads the output, and it reads only the exit code.

Before it works for users
A release with a vX.Y.Z tag publishes the package to PyPI. After that, plain-healthcheck in plain-forge can run its parser step again. The codeplain client and backend keep their own parser copies until phase 3.

@NejcS NejcS changed the title feat: explicit test scenarios (ENG-190, phase 2) feat: explicit test scenarios Oct 19, 2026
NejcS added 6 commits October 19, 2026 14:33
A functionality is a `# <func-id>` heading followed by its body: a prose
statement line and the `- ` bullets indented under it. The parse result
entry carries the id, the body markdown, its linked resources and empty
conformance and acceptance test lists.

A flush-left `- ` list in functional specs, and an acceptance tests or
conformance tests section in a core spec, are the old syntax; the error
names the migrate-plain-syntax skill. The nested acceptance test code is
removed and every fixture is converted.
A func-id has only lowercase letters, digits and hyphens and is unique in
its module. The errors name the line, the module and, for a duplicate,
the line of the first use.
get_frids yields the func-ids in file order, and the helpers that take a
frid take a func-id. get_specifications_for_frid returns the conformance
and acceptance scenarios of the functionality, and collect_linked_resources
covers the links in them. The legacy tree walk over sections, ID and
Heading is removed.
A test plain file binds to one functionality with the frontmatter keys
module and func_id and holds a conformance tests section followed by an
acceptance tests section. A scenario is a `# <scenario-id>` heading and
its text, kept verbatim. Liquid and linked resources work as in a core
spec; the concepts of the scenarios are checked once the bound module is
known.
Every .plain file under the test folders is read as a test plain file,
bound to a module of the chain and one of its func-ids, checked against
the concepts of that module, and merged into the functionality in
discovery order. With conformance-tests-script in the config, every
functionality needs a conformance scenario; the error names it as
<module>:<func-id> and the add-test-scenarios skill. The config keys
test-dir and conformance-tests-script are read like template-dir.
check and parse take --test-dir, repeatable, which overrides the test-dir
config key and the default tests folder. The parse output is format
version 2: the functionality trees carry the merged scenarios, resources
covers the links in them, and test_plain_files maps each file to the
functionality it binds to. The README describes the new syntax.
@NejcS
NejcS force-pushed the feat/explicit-test-scenarios branch from ffc460d to 9d2c4b1 Compare October 19, 2026 12:35

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant