interaction-check 0.1.0a6__tar.gz

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.
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0a6 / v0.1.0-alpha.6 — unpublished candidate
4
+
5
+ - Prepare PyPI metadata, installation instructions and a manual Trusted Publishing
6
+ workflow. Its default mode builds and checks packages without uploading them.
7
+ - Publish only from a matching version tag, with separate build and upload jobs.
8
+ - CLI/report version advances to `0.1.0a6`; schema 1, protocol 1 and runtime behavior
9
+ are unchanged from alpha.5. Existing GitHub archives and tags remain unchanged.
10
+
11
+ ## 0.1.0a5 / v0.1.0-alpha.5
12
+
13
+ - Export each state-mismatch prefix with `--failure-dir`, without replacing expected
14
+ states or overwriting an existing output directory. JSON reports link to saved files.
15
+ - Add a native-test handoff guide using the executable pyee and XState examples.
16
+ - Add wheel/sdist packaging and the `interaction-check` command, with zero runtime
17
+ dependencies. `--version` works without an adapter. Python metadata/report versions
18
+ now use the standard Python spelling `0.1.0a5` (previous report: `0.1.0-alpha.4`).
19
+ - Schema 1, JSONL protocol 1, comparison rules and adapter commands are unchanged.
20
+
21
+ Published as a GitHub prerelease on 26 October 2026; not published on PyPI.
22
+ See the [alpha compatibility policy](docs/RELEASING.md#alpha-compatibility) before upgrading.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 PerchAnton
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ include README.md PACKAGE.md CHANGELOG.md LICENSE-MIT LICENSE-APACHE
2
+ include test_*.py
3
+ include tools/check_distribution.py
4
+ include docs/NATIVE_TESTS.md docs/RELEASING.md
@@ -0,0 +1,47 @@
1
+ # interaction-check
2
+
3
+ A small Python command-line tool that replays semantic JSON event sequences against
4
+ an explicitly selected local adapter. Python 3.10+; **zero runtime dependencies**.
5
+ Licensed under MIT OR Apache-2.0. Experimental alpha: formats and CLI may still change.
6
+
7
+ ## Installation
8
+
9
+ Install a published copy of this prerelease from PyPI:
10
+
11
+ ```sh
12
+ python -m pip install 'interaction-check==0.1.0a6'
13
+ ```
14
+
15
+ An exact version selects this prerelease without opting into all future prereleases.
16
+ Use a virtual environment. On Windows, the same command works with `py -m pip`.
17
+ For other distribution options and current publication status, see the
18
+ [project README](https://github.com/PerchAnton/interaction-check#install-the-released-command).
19
+
20
+ ## Usage
21
+
22
+ ```sh
23
+ interaction-check --version
24
+ interaction-check --failure-dir failures --trace --report report.json scenario.json -- path/to/adapter
25
+ ```
26
+
27
+ The adapter is a trusted program you select; it receives events as JSONL and returns
28
+ states. Expected states are never sent to it. Each scenario starts a fresh process.
29
+ The runner is not a sandbox and does not download or discover adapters automatically.
30
+
31
+ `--failure-dir` creates a **new** directory containing numbered JSON scenarios through
32
+ the first state mismatch. Expectations stay unchanged. These are checked prefixes, not
33
+ automatically minimized or independently verified reproductions. Re-run an export with
34
+ the same adapter revision. Crashes, timeouts and malformed protocol replies do not
35
+ produce a guessed state-mismatch scenario.
36
+
37
+ The installed wheel contains the runner and its licenses. Examples and application
38
+ adapters remain in the repository and may have their own dependencies. The separate
39
+ Rust library edit-session is not required.
40
+
41
+ - [Scenario and adapter protocol](https://github.com/PerchAnton/interaction-check#scenario-format)
42
+ - [Worked XState example](https://github.com/PerchAnton/interaction-check/tree/main/examples/xstate)
43
+ - [Moving a useful scenario into a native test](https://github.com/PerchAnton/interaction-check/blob/main/docs/NATIVE_TESTS.md)
44
+ - [Measured benefits and costs](https://github.com/PerchAnton/interaction-check/blob/main/docs/VALUE.md)
45
+
46
+ If a normal project test is simpler, keep that test. Replay is useful when sharing an
47
+ event sequence and a consistent report earns the adapter and runner maintenance cost.
@@ -0,0 +1,68 @@
1
+ Metadata-Version: 2.4
2
+ Name: interaction-check
3
+ Version: 0.1.0a6
4
+ Summary: Replay semantic event sequences against explicit local adapters
5
+ Author: PerchAnton
6
+ License-Expression: MIT OR Apache-2.0
7
+ Project-URL: Repository, https://github.com/PerchAnton/interaction-check
8
+ Project-URL: Documentation, https://github.com/PerchAnton/interaction-check#readme
9
+ Project-URL: Issues, https://github.com/PerchAnton/interaction-check/issues
10
+ Project-URL: Changelog, https://github.com/PerchAnton/interaction-check/blob/main/CHANGELOG.md
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Software Development :: Testing
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE-MIT
19
+ License-File: LICENSE-APACHE
20
+ Dynamic: license-file
21
+
22
+ # interaction-check
23
+
24
+ A small Python command-line tool that replays semantic JSON event sequences against
25
+ an explicitly selected local adapter. Python 3.10+; **zero runtime dependencies**.
26
+ Licensed under MIT OR Apache-2.0. Experimental alpha: formats and CLI may still change.
27
+
28
+ ## Installation
29
+
30
+ Install a published copy of this prerelease from PyPI:
31
+
32
+ ```sh
33
+ python -m pip install 'interaction-check==0.1.0a6'
34
+ ```
35
+
36
+ An exact version selects this prerelease without opting into all future prereleases.
37
+ Use a virtual environment. On Windows, the same command works with `py -m pip`.
38
+ For other distribution options and current publication status, see the
39
+ [project README](https://github.com/PerchAnton/interaction-check#install-the-released-command).
40
+
41
+ ## Usage
42
+
43
+ ```sh
44
+ interaction-check --version
45
+ interaction-check --failure-dir failures --trace --report report.json scenario.json -- path/to/adapter
46
+ ```
47
+
48
+ The adapter is a trusted program you select; it receives events as JSONL and returns
49
+ states. Expected states are never sent to it. Each scenario starts a fresh process.
50
+ The runner is not a sandbox and does not download or discover adapters automatically.
51
+
52
+ `--failure-dir` creates a **new** directory containing numbered JSON scenarios through
53
+ the first state mismatch. Expectations stay unchanged. These are checked prefixes, not
54
+ automatically minimized or independently verified reproductions. Re-run an export with
55
+ the same adapter revision. Crashes, timeouts and malformed protocol replies do not
56
+ produce a guessed state-mismatch scenario.
57
+
58
+ The installed wheel contains the runner and its licenses. Examples and application
59
+ adapters remain in the repository and may have their own dependencies. The separate
60
+ Rust library edit-session is not required.
61
+
62
+ - [Scenario and adapter protocol](https://github.com/PerchAnton/interaction-check#scenario-format)
63
+ - [Worked XState example](https://github.com/PerchAnton/interaction-check/tree/main/examples/xstate)
64
+ - [Moving a useful scenario into a native test](https://github.com/PerchAnton/interaction-check/blob/main/docs/NATIVE_TESTS.md)
65
+ - [Measured benefits and costs](https://github.com/PerchAnton/interaction-check/blob/main/docs/VALUE.md)
66
+
67
+ If a normal project test is simpler, keep that test. Replay is useful when sharing an
68
+ event sequence and a consistent report earns the adapter and runner maintenance cost.
@@ -0,0 +1,281 @@
1
+ # interaction-check
2
+
3
+ Replay a semantic event sequence and inspect each checked state. A standalone Python
4
+ development tool that uses an explicit local adapter. It can test consumers with or
5
+ without the separate [edit-session](https://github.com/PerchAnton/edit-session) Rust library.
6
+
7
+ [![CI](https://github.com/PerchAnton/interaction-check/actions/workflows/ci.yml/badge.svg?branch=main&event=push)](https://github.com/PerchAnton/interaction-check/actions/workflows/ci.yml)
8
+ [![Replay evidence](https://github.com/PerchAnton/interaction-check/actions/workflows/evidence.yml/badge.svg?branch=main&event=push)](https://github.com/PerchAnton/interaction-check/actions/workflows/evidence.yml)
9
+
10
+ **[Download](#current-prerelease)** · **[Install](#install-the-released-command)** · **[Export a failure](#export-a-failure-and-keep-a-native-test)** · **[Evidence](#evidence-and-trade-offs)** · **[License](#license)**
11
+
12
+ ## Current prerelease
13
+
14
+ **[v0.1.0-alpha.5](https://github.com/PerchAnton/interaction-check/releases/tag/v0.1.0-alpha.5) · released 26 October 2026 · Python 3.10+**
15
+
16
+ **[Download the wheel](https://github.com/PerchAnton/interaction-check/releases/download/v0.1.0-alpha.5/interaction_check-0.1.0a5-py3-none-any.whl)** · [Source archive](https://github.com/PerchAnton/interaction-check/releases/download/v0.1.0-alpha.5/interaction_check-0.1.0a5.tar.gz) · [SHA-256 checksums](https://github.com/PerchAnton/interaction-check/releases/download/v0.1.0-alpha.5/SHA256SUMS) · [Changelog](CHANGELOG.md)
17
+
18
+ ![interaction-check alpha 5, released 26 October 2026: 0 runtime dependencies, 49 runner tests, 12.6 KiB wheel. Replay a scenario, export its original expectations through the first mismatch, and manually translate useful behavior into a native test.](docs/assets/release.svg)
19
+
20
+ Release snapshot: **49 runner tests**, **0 runtime dependencies**, **12.6 KiB wheel
21
+ (12,937 bytes)**. [Exact files, hashes and release CI](docs/evidence/release-alpha5.json).
22
+ These are dated release facts; the CI badges above track current main. The handoff is
23
+ manual, and an export must be replayed before sharing. Examples and adapters are separate.
24
+
25
+ Trying the alpha? [Report a bug](https://github.com/PerchAnton/interaction-check/issues/new?template=bug_report.yml)
26
+ with your runner and adapter versions, or read the [alpha compatibility policy](docs/RELEASING.md#alpha-compatibility).
27
+
28
+ ## Install the released command
29
+
30
+ **PyPI candidate: `0.1.0a6` (not published yet).** The [publishing guide](docs/RELEASING.md#registry-publication)
31
+ records the remaining account setup and verification. After publication, installation
32
+ will be `python -m pip install 'interaction-check==0.1.0a6'` in a virtual environment.
33
+ Until then, use the existing GitHub release below.
34
+
35
+ Download the wheel above, then run these commands in its directory:
36
+
37
+ ```sh
38
+ python -m venv .venv
39
+ .venv/bin/python -m pip install ./interaction_check-0.1.0a5-py3-none-any.whl
40
+ .venv/bin/interaction-check --version
41
+ ```
42
+
43
+ On Windows use `.venv\Scripts\python.exe` and `.venv\Scripts\interaction-check.exe`.
44
+ For a source checkout, use `python -m pip install .` inside your virtual environment.
45
+ The installed command uses Python version spelling `0.1.0a5`. Packages are available
46
+ from GitHub Releases; there is no PyPI publication. Start with the
47
+ [XState walkthrough](examples/xstate/README.md) or the [native-test guide](docs/NATIVE_TESTS.md).
48
+
49
+ ## Evidence and trade-offs
50
+
51
+ <details>
52
+ <summary>Open measured results, comparisons and sources</summary>
53
+
54
+ ![interaction-check evidence: zero third-party Python packages; 49 runner and six Node tests pass; PdfCraft passes ten scenarios and 79 steps. The focused XState install has one lockfile package entry versus 120 in the earlier bundle. Native tests have a 74.6 ms median and replay 183.9 ms across 30 paired samples; replay is slower in this pilot.](docs/assets/overview.svg)
55
+
56
+ ### The numbers behind the overview
57
+
58
+ Evidence snapshot: **26 October 2026**. CI badges are live; the graphic and counts are
59
+ dated results. The runner count includes eight alpha 5 export/CLI tests; Node,
60
+ PdfCraft and timing figures retain their earlier 26 October evidence. Package counts describe the example installation; timings describe the
61
+ same three example scenarios on one macOS arm64 machine.
62
+
63
+ | Measure | Recorded result | Source and scope |
64
+ | --- | --- | --- |
65
+ | Runner Python dependencies | **0 third-party packages** | [Runner source](interaction_check.py); adapters have their own requirements |
66
+ | Verification tests | **49 Python + 6 Node pass** | [Runner checks](docs/VALIDATION.md), [native example tests](examples/xstate/native.test.mjs), [adapter tests](examples/xstate/adapter.test.mjs) |
67
+ | Real PdfCraft replay | **10 scenarios / 79 steps pass** | [State report](docs/evidence/pdfcraft-alpha4.json); real widgets and engine, proposed integration |
68
+ | Focused XState installation | **120 → 1 package entries; −99.2%** | [Lockfile comparison](docs/VALUE.md#a-smaller-installation-for-one-example); excludes unrelated examples and formatter; XState is unchanged |
69
+ | Median / p95 execution time | **Native: 74.6 / 80.5 ms; replay: 183.9 / 191.9 ms** | [30 paired samples](docs/evidence/xstate.json), [method](docs/VALUE.md#measured-execution-overhead); startup included, install and JSON report writes excluded |
70
+ | Controlled example mutations | **3/3 detected by both methods** | [Three deliberate defects](docs/VALUE.md#does-it-detect-wrong-behavior); not upstream bugs or a general coverage score |
71
+
72
+ Replay is **2.46× slower** in this small pilot. Its value is a shareable trace and common
73
+ failure report. Native tests also need only XState; fewer total lines of code or faster
74
+ application behavior are not demonstrated.
75
+
76
+ **Experimental, 0.1.0a5 (alpha 5).** Maintained by [PerchAnton](https://github.com/PerchAnton).
77
+ No PyPI release or upstream adoption is claimed. The first adapter uses a fixed
78
+ edit-session revision and commits through PhotoCraft's actual `Session` command API;
79
+ consumer-owned adapters also exercise the real PhotoCraft and PdfCraft dialogs.
80
+
81
+ </details>
82
+
83
+ ## A useful outcome can be one native test
84
+
85
+ ![Pyee native test audit: unchanged source passes 53 original tests or 54 with the candidate. A deliberate remove-after-callback mutation passes the original 53 tests but fails the new reentrant-once test. No current upstream bug or adoption is claimed.](docs/assets/pyee-coverage.svg)
86
+
87
+ Following [maintainer feedback](https://github.com/jfhbrook/pyee/issues/226#issuecomment-6409488443),
88
+ we checked the full pyee suite and translated one external trace into a native pytest
89
+ candidate. On the pinned source: **53/53 existing tests pass; 54/54 with the candidate**.
90
+ One deliberate local mutation escapes the original suite but is caught by the added test.
91
+ The candidate needs **no new dependency** in pyee and no interaction-check runner.
92
+
93
+ [Test, method, raw results and reproduction](examples/pyee/README.md).
94
+ This is one demonstrated coverage gap, not a current pyee bug, a general coverage score
95
+ or upstream adoption. These are pyee suite counts, separate from our 49 runner tests.
96
+
97
+ ## Start with one reviewable reproduction
98
+
99
+ The [XState walkthrough](examples/xstate/README.md) includes three small traces, the
100
+ expected state after every event and a failure you can reproduce. Its focused install
101
+ contains **1 npm package instead of the 120 entries in our earlier multi-consumer
102
+ lockfile**. The Python runner itself still uses only the standard library.
103
+
104
+ Use `--trace --report result.json` to retain each checked event, expectation and actual
105
+ state. A failing report includes the checked prefix and the first mismatching state.
106
+ This makes a regression report readable before someone runs the reproduction.
107
+
108
+ [Measured value and trade-offs](docs/VALUE.md) includes native tests, source counts,
109
+ 30 paired timing samples and three controlled mutations. Both test paths detect all
110
+ three mutations; native tests are shorter and faster here. The reason to choose replay
111
+ is a shareable trace and common report format. Upstream adoption remains unconfirmed.
112
+
113
+ ## Proposed PhotoCraft UI consumer
114
+
115
+ [PhotoCraft PR #9190](https://github.com/storytold/photocraft/pull/9190) adds a PhotoCraft-owned
116
+ adapter that drives the shipped Edit Selected Guides dialog, egui canvas/dialog frames, control
117
+ field setter and real Session. Its CI fetches this runner at
118
+ `f8d4282d61576ffe78d18553c642d215887e2d9f`; Python is not an application runtime dependency.
119
+ [Ten scenarios / 44 steps](https://github.com/PerchAnton/photocraft/tree/46b4a183d5f44035bbc216dcf6196701bcb45bc9/tests/interactions/guide-edit)
120
+ pass locally, covering preview, commit, Cancel/Escape, invalid input, no-ops and stale drafts.
121
+ This consumer patch is awaiting maintainer review; upstream adoption is not claimed.
122
+
123
+ ## Proposed PdfCraft UI consumer
124
+
125
+ [PdfCraft PR #4594](https://github.com/storytold/pdfcraft/pull/4594) uses this runner for **Document Properties**.
126
+ Its runtime draft lifecycle uses edit-session; this runner checks the resulting UI and engine state.
127
+ Description, Initial View and Custom values share a draft bound to document identity,
128
+ edit generation and permissions. `check_live` rejects stale input after edits, Undo/Redo,
129
+ reload or a document switch; the existing engine commits one atomic batch. Cancel,
130
+ Escape and no-ops do not add history. Failed engine edits retain the form for correction.
131
+ Clean inspection tabs retain their existing live refresh without rebasing typed input.
132
+
133
+ The consumer owns a [real UI adapter](https://github.com/PerchAnton/pdfcraft/blob/535d990d10832baf3b0a64910c51b280c224bd5c/crates/ui-egui/examples/properties_scenarios.rs)
134
+ and [10 scenarios / 79 steps](https://github.com/PerchAnton/pdfcraft/tree/535d990d10832baf3b0a64910c51b280c224bd5c/tests/interactions/document-properties),
135
+ replayed by interaction-check, including save/reopen and preservation of custom metadata.
136
+ Local scoped UI tests, strict Clippy, assets, parity and wasm checks pass. Both dependencies
137
+ are pinned; upstream review of the source-policy exception and adoption is pending.
138
+ See [reproduction instructions](https://github.com/PerchAnton/pdfcraft/blob/535d990d10832baf3b0a64910c51b280c224bd5c/docs/document-properties-sessions.md).
139
+
140
+ ## Run
141
+
142
+ Requires Python 3.10+ (tested with Python 3.14 on macOS arm64).
143
+
144
+ ```sh
145
+ python3 -m unittest -v
146
+ cargo build --locked --manifest-path adapters/photocraft/Cargo.toml
147
+ python3 interaction_check.py --report result.json --junit result.xml scenarios/photocraft/*.json -- \
148
+ adapters/photocraft/target/debug/edit-session-photocraft-probe
149
+ ```
150
+
151
+ The Rust adapters need Rust 1.99+ (tested with 1.99.1). For the bundled PhotoCraft adapter,
152
+ Cargo fetches both Rust repositories at fixed commits; no sibling checkout or path override is required.
153
+ See the [adapter README](adapters/photocraft/README.md). Each scenario starts a fresh process. Exit 0
154
+ means all scenarios passed and requested reports were written; 1 means a scenario or report
155
+ write failed; invalid CLI usage exits 2.
156
+
157
+ ## Reports for CI
158
+
159
+ Add `--trace` with `--report FILE` for per-step JSON evidence. Each entry has `step`
160
+ (1-based), `event`, `expect`, `actual`, and `passed`; a mismatch also has `differences`.
161
+ Only checked steps up to the first mismatch are included. Later events may already have
162
+ executed: this is post-execution checking, not stop-on-first-failure execution. Malformed
163
+ replies have no invented state; process crashes/timeouts do not produce a checked trace.
164
+ The option does not change JSONL requests, default compact reports, or JUnit output.
165
+ Reports include the event/state values chosen by the adapter; review them before sharing.
166
+
167
+ `--report FILE` writes JSON and `--junit FILE` writes JUnit XML; either or both are optional.
168
+ JUnit contains one test case per scenario, failure details and captured adapter stderr,
169
+ including failed assertions, invalid replies, nonzero exits and timeouts. The Python API
170
+ exposes these diagnostics as `CheckError.stderr`; JSON reports use `stderr`, and JUnit
171
+ uses `system-err`. Scenario failures keep their declared name and source path in both formats. If the
172
+ input cannot be parsed, its filename is used instead. A failed scenario does not prevent
173
+ the remaining scenarios from running or the reports from being written.
174
+
175
+ Each report is replaced atomically after a complete write. Create parent directories first.
176
+ Report paths that refer to a scenario input or to the other report (including existing
177
+ symlinks/hard links) are rejected before starting an adapter. Report write failures produce
178
+ a diagnostic on stderr and exit 1, even when every scenario passed. Characters forbidden by
179
+ XML 1.0 are replaced with U+FFFD in JUnit; the JSON report preserves the original strings.
180
+
181
+ ## Export a failure and keep a native test
182
+
183
+ ```sh
184
+ python3 interaction_check.py --failure-dir failures --report report.json scenario.json -- path/to/adapter
185
+ python3 interaction_check.py failures/0001.json -- path/to/adapter
186
+ ```
187
+
188
+ `--failure-dir` creates a new directory and writes each failing scenario through its
189
+ first state mismatch. It preserves expectations and metadata; JSON reports link to
190
+ the saved files. Numbered filenames follow input order. Successful runs create no
191
+ scenario files. Existing directories are refused to avoid mixing old and new failures.
192
+
193
+ The export is a checked prefix, not an automatically minimized or rerun reproduction.
194
+ Re-run it with the same adapter revision. Crashes, timeouts and protocol errors keep
195
+ their diagnostics instead of exporting a guessed assertion failure. The
196
+ [native-test guide](docs/NATIVE_TESTS.md) shows how to move useful pyee and XState
197
+ behavior into the consumer's normal tests, without retaining a runner dependency.
198
+
199
+ ## Scenario format
200
+
201
+ ```json
202
+ {
203
+ "schema": 1,
204
+ "name": "Cancel a preview without changing history",
205
+ "steps": [
206
+ {"event": {"op": "begin"}, "expect": {"undo_depth": 0, "error": null}},
207
+ {"event": {"op": "preview", "value": 0.5},
208
+ "expect": {"committed": 1, "preview": 0.5, "undo_depth": 0, "error": null}},
209
+ {"event": {"op": "cancel"},
210
+ "expect": {"committed": 1, "preview": null, "undo_depth": 0, "error": null}}
211
+ ]
212
+ }
213
+ ```
214
+
215
+ Each request is a JSON line with `protocol: 1`, an integer `id`, and `event`.
216
+ The adapter returns exactly one JSON line per request with the same `protocol`/`id` and a
217
+ `state` object, then exits at stdin EOF. Logs go to stderr. Expectations are never sent to
218
+ the adapter. Objects match recursively by expected fields, including objects inside arrays.
219
+ Arrays must have the same length and order; each element uses the same matching rules.
220
+ Booleans are distinct from numbers. Missing fields are distinct from null.
221
+ Non-finite numbers, duplicate keys, missing/extra replies, wrong IDs, adapter crashes,
222
+ timeouts and malformed JSON fail the run.
223
+
224
+ JSONL records are separated by LF (CRLF also works), with an optional final newline.
225
+ Unicode line separators inside a JSON string are data, not record boundaries. Extra blank
226
+ lines are invalid. Inputs and replies allow at most 64 nested objects/arrays and must use
227
+ Unicode scalar values (no unpaired surrogates); malformed data fails with a diagnostic.
228
+
229
+ The whole scenario's events are sent in order. The adapter must process them sequentially
230
+ and finish each event before replying. This is semantic replay, not timed pointer playback.
231
+ Use a custom adapter to translate events into `egui_kittest` interactions or an app protocol.
232
+
233
+ ## Existing tools and scope
234
+
235
+ Keep `egui_kittest` for widget/accessibility/pixel tests, `teatest` for Bubble Tea, and
236
+ `proptest` for input generation. This prototype adds a portable trace plus explicit assertions
237
+ and a machine-readable report; it does not replace those tools or discover bugs by itself.
238
+
239
+ The bundled engine-only PhotoCraft adapter drives real commands and history in a headless process. It does
240
+ not connect to the live application's UI or test its renderer, saved files or native input.
241
+ Upstream adoption is pending. The [PdfCraft adapter](adapters/pdfcraft/README.md) is owned
242
+ by the consumer repository and also uses engine save/reopen. No Bubbles adapter,
243
+ auto-recording or shrinking is implemented.
244
+
245
+ Adapters are trusted local test programs, launched without a shell. A per-scenario timeout
246
+ defaults to five seconds. Input is limited to 1 MiB. Stdin and output capture use temporary
247
+ files so a non-reading adapter cannot block input delivery and logs do not grow in RAM.
248
+ While the adapter runs, stdout and stderr sizes are checked about every 50 ms; either
249
+ stream exceeding 1 MiB stops the adapter. A final check also catches fast-exiting writers.
250
+ At most 1 MiB of stderr is retained in a failure report.
251
+
252
+ Polling is not a hard disk quota: a fast writer can overshoot between checks. This is not
253
+ a sandbox. Timeout, output-limit handling and cancellation stop and reap the direct
254
+ adapter process, not a tree of spawned descendants. Adapters must manage their children.
255
+
256
+ ## Evidence
257
+
258
+ - [PdfCraft UI report](reports/pdfcraft-properties.json): ten scenarios / 79 steps; see the
259
+ [adapter instructions](adapters/pdfcraft/README.md) for immutable source pins and replay.
260
+
261
+ - [Alpha 2 review and regression checks](docs/VALIDATION.md): Unicode JSONL, report safety,
262
+ JUnit, bounded JSON nesting and compatibility with existing PhotoCraft adapters.
263
+ - [Current PhotoCraft Session scenarios](photocraft-session-report.json): eight scenarios,
264
+ 41 steps, using the published Git dependency and real command dispatch. Each step also
265
+ checks the command journal count, so previews and no-op commits cannot silently send edits.
266
+ - [Earlier PhotoCraft component scenarios](photocraft-report.json): eight scenarios against
267
+ the original Document/History adapter, before switching to Session dispatch.
268
+ - [Earlier deliberate mutation](mutation-report.json): expected failures after disabling context
269
+ protection in a temporary library copy. Stale-target and undo-back-to-original scenarios
270
+ detect a wrong document mutation/history change. A third scenario detects the changed error.
271
+ - [Detailed validation](https://github.com/PerchAnton/edit-session/blob/main/docs/VALIDATION.md).
272
+
273
+ The same runner now passes real UI scenarios in both proposed consumers. The next milestone
274
+ is maintainer review of their behavior and dependency policy; this is not a claim of upstream adoption.
275
+
276
+ ## License
277
+
278
+ Licensed under either the [MIT license](LICENSE-MIT) or the
279
+ [Apache License, Version 2.0](LICENSE-APACHE), at your option.
280
+ Unless explicitly stated otherwise, contributions submitted for inclusion are offered
281
+ under the same dual license.