voxam 0.1.0__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.
voxam-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jeff Nyman
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.
voxam-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,377 @@
1
+ Metadata-Version: 2.4
2
+ Name: voxam
3
+ Version: 0.1.0
4
+ Summary: An Interpreter for the Z-Machine and Glulx
5
+ Keywords: z-machine,interactive-fiction,interpreter,emulator,infocom
6
+ Author: Jeff Nyman
7
+ Author-email: Jeff Nyman <jeffnyman@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 2 - Pre-Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: End Users/Desktop
14
+ Classifier: Natural Language :: English
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Games/Entertainment
21
+ Classifier: Topic :: System :: Emulators
22
+ Classifier: Typing :: Typed
23
+ Requires-Python: >=3.12
24
+ Project-URL: Homepage, https://github.com/jeffnyman/voxam
25
+ Project-URL: Repository, https://github.com/jeffnyman/voxam
26
+ Project-URL: Issues, https://github.com/jeffnyman/voxam/issues
27
+ Description-Content-Type: text/markdown
28
+
29
+ <h1 align="center">
30
+ <img src="https://raw.githubusercontent.com/jeffnyman/voxam/main/assets/voxam-title.png" alt="Voxam">
31
+ </h1>
32
+
33
+ <p align="center">
34
+ <em>A Specification-Accurate Z-Machine Implementation</em><br />
35
+ <em>Early and Late Infocom + Modern Inform</em>
36
+ </p>
37
+
38
+ <p align="center">
39
+ <a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python-blue.svg" alt="Built with Python"></a>
40
+ <a href="https://github.com/jeffnyman/voxam/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="Voxam is released under the MIT license."></a>
41
+ </p>
42
+
43
+ <p align="center">
44
+ <a href="https://github.com/jeffnyman/voxam/actions/workflows/ci.yml"><img src="https://github.com/jeffnyman/voxam/actions/workflows/ci.yml/badge.svg" alt="CI status"></a>
45
+ <a href="https://conventionalcommits.org"><img src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-green.svg" alt="Conventional Commits: 1.0.0"></a>
46
+ </p>
47
+
48
+ <p align="center">
49
+ <a href="https://vscode.dev/github/jeffnyman/voxam"><img alt="Open with vscode" src="https://img.shields.io/static/v1?logo=visualstudiocode&label=&message=Open%20in%20Visual%20Studio%20Code&labelColor=2c2c32&color=007acc&logoColor=007acc"></a>
50
+ </p>
51
+
52
+ An interpreter for the Z-Machine, written in Python, with Glulx to
53
+ follow.
54
+
55
+ The Z-Machine is the virtual machine Infocom designed in 1979 to run
56
+ its text adventures, and which the interactive fiction community has
57
+ used ever since. Voxam reads a compiled story file and executes it,
58
+ with two guiding commitments: fidelity to the
59
+ [Z-Machine Standard](https://jeffnyman.github.io/z-machine-standard/)
60
+ -- every rule the interpreter enforces cites the section it came from
61
+ -- and reproducibility, so that a recorded play session replays
62
+ identically, forever.
63
+
64
+ Voxam is developed against the real Infocom catalog. The *Zork*
65
+ trilogy, *Cutthroats*, *Deadline*, and *Seastalker* have all been played to
66
+ winning conclusions under Voxam, several of them across multiple
67
+ releases, each verified end-to-end by the acceptance harness
68
+ described below.
69
+
70
+ <p align="center">
71
+ <img src="https://raw.githubusercontent.com/jeffnyman/voxam/main/assets/voxam-footer.png" alt="">
72
+ </p>
73
+
74
+ ## Status
75
+
76
+ Version `0.x`: early, honest, and playable.
77
+
78
+ **Works today:** story file versions 1 through 3, which cover
79
+ Infocom's 1980--1985 catalog and many modern retro-style games. That
80
+ includes the full parser and object machinery, a seeded random
81
+ number generator for reproducible sessions, status line semantics,
82
+ and an acceptance-script harness for recording and replaying whole
83
+ playthroughs.
84
+
85
+ **Under construction:** version 4 support is being built
86
+ "frontier-driven" -- games are run until they name the next missing
87
+ piece. Version 4 stories boot and identify the interpreter; the
88
+ screen model (split windows, text styles) is in progress.
89
+
90
+ **Not yet:** SAVE and RESTORE, sound, timed input, versions 5 and
91
+ up, and Glulx. For recorded sessions, seeds substitute for saves:
92
+ a script replays a whole game in moments.
93
+
94
+ ## Installation
95
+
96
+ Voxam requires Python 3.12 or later.
97
+
98
+ ```bash
99
+ pip install voxam
100
+ ```
101
+
102
+ or, as an isolated tool:
103
+
104
+ ```bash
105
+ pipx install voxam # or: uv tool install voxam
106
+ ```
107
+
108
+ Voxam ships no story files. Bring your own: the
109
+ [IF Archive](https://ifarchive.org/) hosts thousands of freely
110
+ available games, and story files you own from commercial collections
111
+ work as-is.
112
+
113
+ ## Playing stories
114
+
115
+ Point Voxam at a story file and play at the terminal:
116
+
117
+ ```bash
118
+ voxam path/to/story.z3
119
+ ```
120
+
121
+ Add `--seed` to make the dice reproducible: the same seed and the
122
+ same commands produce the same session, every time.
123
+
124
+ ```bash
125
+ voxam --seed 1137 path/to/story.z3
126
+ ```
127
+
128
+ ## Acceptance scripts
129
+
130
+ A play session can be saved as an acceptance script and replayed:
131
+
132
+ ```bash
133
+ voxam --accept some-session.accept
134
+ ```
135
+
136
+ An acceptance script is a plain text file of typed commands plus a
137
+ few directives:
138
+
139
+ ```text
140
+ ! SEED=99
141
+ ! GAME=path/to/story.z1
142
+
143
+ # Comments annotate the session; blank lines are ignored.
144
+
145
+ x me. x mailbox # inline comments start at whitespace + #
146
+ > open mailbox # the > prefix is optional transcript style
147
+ ```
148
+
149
+ The rules, line by line:
150
+
151
+ - `! KEY=VALUE` is a directive: `GAME` names the story file to run,
152
+ and `SEED` fixes the dice (a `--seed` argument overrides it). A
153
+ relative `GAME` path counts from the script's own directory, and
154
+ forward slashes work on every platform.
155
+ - `#` at the start of a line is a comment.
156
+ - An inline comment begins at whitespace followed by `#`.
157
+ - A leading `>` is optional and stripped; it also escapes the rare
158
+ command that genuinely begins with `#` or `!`. A `>` alone types
159
+ an empty line.
160
+ - A line starting with three backticks is a fence: everything until
161
+ the next fence is skipped entirely, directives included. Text
162
+ after the backticks labels the fence, and an unclosed fence skips
163
+ the rest of the file -- handy while working out a section that a
164
+ seed change will invalidate, or to replay only the start of a
165
+ longer script.
166
+ - Anything else is typed into the game exactly as written.
167
+ - When the commands run out, the session ends as if the player had
168
+ reached end of input.
169
+
170
+ While recording a longer session, `--replay` types the script and
171
+ then leaves you at the prompt instead of ending, so a
172
+ work-in-progress script catches you up to where you left off:
173
+
174
+ ```bash
175
+ voxam --replay some-session.accept
176
+ ```
177
+
178
+ ### Refusal warnings
179
+
180
+ During a replay, Voxam listens for the parser's *refusal dialect* --
181
+ responses like "You can't see any statuette here!" or "You should
182
+ close it first" that mean a recorded command did not do what it
183
+ said. Each one is reported with the script line that drew it:
184
+
185
+ ```text
186
+ voxam: line 31: 'lock door' looks refused: You should close it first.
187
+ ```
188
+
189
+ Refusals scroll past a human reader without registering, and the
190
+ missing side effect may not surface until dozens of turns later.
191
+ The warning points at the moment it happened, which turns the most
192
+ common recording bug from an archaeology expedition into a one-line
193
+ fix.
194
+
195
+ ## Development
196
+
197
+ Working on Voxam itself needs
198
+ [uv](https://docs.astral.sh/uv/) for dependency and environment
199
+ management:
200
+
201
+ ```bash
202
+ git clone https://github.com/jeffnyman/voxam.git
203
+ cd voxam
204
+ uv sync --all-groups
205
+ ```
206
+
207
+ All commands below assume that environment.
208
+
209
+ | Task | Command |
210
+ | --- | --- |
211
+ | Run the test suite | `uv run pytest` |
212
+ | Run tests without coverage | `uv run pytest --no-cov` |
213
+ | Lint | `uv run ruff check .` |
214
+ | Lint and autofix | `uv run ruff check --fix .` |
215
+ | Format | `uv run ruff format .` |
216
+ | Check formatting only | `uv run ruff format --check .` |
217
+ | Type check | `uv run mypy` |
218
+ | Build distributions | `uv build` |
219
+
220
+ ### Project conventions
221
+
222
+ - **Layout.** Source lives under `src/voxam`, tests under `tests/`. The `src`
223
+ layout ensures tests exercise the installed package rather than the working
224
+ directory.
225
+ - **Typing.** `mypy` runs in strict mode over both `src` and `tests`, and the
226
+ package ships a `py.typed` marker so downstream consumers get its types.
227
+ - **Coverage.** The suite is gated at 100% branch coverage. This is deliberate
228
+ for a project of this size; adjust `fail_under` in `pyproject.toml` if it
229
+ stops being useful.
230
+ - **Spec citations.** The `§` references in code, docstrings, and output
231
+ follow the HTML rendering of the Z-Machine Standard 1.1 vendored at
232
+ `entharion/z-machine-standard/`. Other renderings of the same
233
+ Standard, including the PDF beside it, number some paragraphs differently.
234
+ - **Line endings.** LF everywhere except Windows script files, enforced by both
235
+ `.gitattributes` and `.editorconfig`.
236
+ - **Recordings.** Complete playthroughs live under `acceptance/` in the
237
+ repository (they are not part of the installed package). They reference
238
+ games under the optional `entharion` submodule, so they replay locally
239
+ rather than in CI -- and they double as the project's archaeology notebook,
240
+ annotating where the games' published walkthroughs go wrong.
241
+
242
+ ### Pre-commit hooks
243
+
244
+ Install the hooks once, after which lint, format, and type checks run on every
245
+ commit, and commit messages are validated:
246
+
247
+ ```bash
248
+ uv run pre-commit install
249
+ ```
250
+
251
+ Every hook is a `repo: local` entry that runs its tool out of the project
252
+ environment via `uv run`, so pre-commit never clones hook repositories or
253
+ builds cached environments under `~/.cache/pre-commit`. Tool versions have a
254
+ single source of truth: `uv.lock`.
255
+
256
+ To run every hook against the whole tree:
257
+
258
+ ```bash
259
+ uv run pre-commit run --all-files
260
+ ```
261
+
262
+ ### Commit messages
263
+
264
+ Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/),
265
+ enforced at commit time by [commitizen](https://commitizen-tools.github.io/commitizen/)
266
+ through the `commit-msg` hook installed above:
267
+
268
+ ```text
269
+ feat: add object table parsing
270
+ fix(memory): reject story files shorter than the header
271
+ docs: explain the save file format
272
+ ```
273
+
274
+ To check a message by hand, or to compose one interactively:
275
+
276
+ ```bash
277
+ uv run cz check -m "feat: add object table parsing"
278
+ uv run cz commit
279
+ ```
280
+
281
+ Because the history is machine-readable, commitizen derives the next
282
+ version, tags it, and updates the changelog:
283
+
284
+ ```bash
285
+ uv run cz bump
286
+ ```
287
+
288
+ ### Reference Material (optional)
289
+
290
+ An `entharion` submodule holds the specifications and story files this
291
+ project is developed against. These are not required as part of building
292
+ and deploying Voxam, but they help during development. Voxam does not
293
+ depend on anything under `entharion/`. It is not needed to install the
294
+ project and CI does not fetch it. Git leaves submodules empty unless
295
+ asked, so a plain clone simply skips it.
296
+
297
+ If you want this reference material and if this is your first time checking
298
+ out the repo, run this command:
299
+
300
+ ```sh
301
+ git submodule update --init --recursive
302
+ ```
303
+
304
+ That will fetch the primary repository as well as its submodules:
305
+
306
+ - [frotz](https://gitlab.com/DavidGriffith/frotz)
307
+ - [ztools](https://github.com/jeffnyman/ztools)
308
+ - [reform6](https://github.com/jeffnyman/reform6)
309
+ - [ifarchive-if-specs](https://github.com/iftechfoundation/ifarchive-if-specs)
310
+ - [z-machine-standard](https://github.com/jeffnyman/z-machine-standard)
311
+
312
+ The latter is my own recomposed version of the Z-Machine Standard document,
313
+ made a little easier for me to read and consume. You can see this deployed
314
+ here:
315
+
316
+ - [Jeff's Z-Machine Standard Document](https://jeffnyman.github.io/z-machine-standard/)
317
+
318
+ To discard it again, freeing the disk space without affecting the project:
319
+
320
+ ```bash
321
+ git submodule deinit --all
322
+ ```
323
+
324
+ Dependabot tracks the pinned commit and opens a PR when upstream moves.
325
+ To move the pin by hand instead:
326
+
327
+ ```bash
328
+ git submodule update --remote entharion
329
+ git add entharion
330
+ git commit -m "chore(deps): update entharion submodule"
331
+ ```
332
+
333
+ ## 👨‍💻 Author
334
+
335
+ <p align="center">
336
+ Made with 🤍 by <a href="https://github.com/jeffnyman">Jeff Nyman</a>
337
+ </p>
338
+
339
+ <p align="center">
340
+ <img src="https://img.shields.io/badge/Python-3178C6?style=for-the-badge&logo=python&logoColor=white">
341
+ </p>
342
+
343
+ <p align="center">
344
+ <a href="https://testerstories.com" target="_blank" >
345
+ <img src="https://img.shields.io/badge/Website-Jeff%20Nyman-000000?style=social&logo=wordpress" alt="Website - Jeff Nyman">
346
+ </a>
347
+ </p>
348
+ <p align="center">
349
+ <a href="https://www.linkedin.com/in/jeffnyman/" target="_blank" >
350
+ <img src="https://img.shields.io/badge/LinkedIn-Jeff%20Nyman-0A66C2?style=social&logo=linkedin" alt="LinkedIn - Jeff Nyman">
351
+ </a>
352
+ </p>
353
+
354
+ ## ☦️ Doxazein (δοξάζειν)
355
+
356
+ <p align="center">
357
+ חֶסֶד וֶאֱמֶת אַל־יַעַזְבֻךָ קָשְׁרֵם עַל־גַּרְגְּרֹתֶיךָ כָּתְבֵם עַל־לוּחַ לִבֶּךָ
358
+ </p>
359
+
360
+ <p align="center">
361
+ "Let not mercy and truth forsake thee:<br>
362
+ bind them about thy neck;<br>
363
+ write them upon the table of thine heart."<br>
364
+ <em>Proverbs 3:3</em>
365
+ </p>
366
+
367
+ ## 🕹️ Acknowledgements
368
+
369
+ This project stands on the shoulders of the team at Infocom, the MIT-born company that invented the Z-Machine to let _Zork_, and everything that followed, run unmodified across nearly every computer of its era. Particular thanks go to Marc Blank and Joel Berez, who designed the Z-Machine's virtual architecture, and to Tim Anderson, Bruce Daniels, and Dave Lebling, whose work on _Zork_ at MIT gave the format a reason to exist. Thanks also to Graham Nelson, whose Inform language and Z-Machine Standards Document kept the format alive and well-documented long after Infocom itself was gone, making implementations like this one possible.
370
+
371
+ ## ⚖️ License
372
+
373
+ The code used in this project is licensed under the [MIT license](https://github.com/jeffnyman/quendor/blob/main/LICENSE).
374
+
375
+ **Note:** This license applies _only_ to the code in this repository. The original Z-Machine concept, design, and any original assets belong to their respective copyright holders.
376
+
377
+ ✨ Long live the classics.