Skip to content

onlyworlds.okf: the OKF exporter (0.6.0, waits on B10) - #2

Merged
tmoosting merged 5 commits into
mainfrom
okf-port
Oct 17, 2026
Merged

tmoosting merged 5 commits into
mainfrom
okf-port

Conversation

@tmoosting

@tmoosting tmoosting commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

onlyworlds.okf: a world folder to an Open Knowledge Format (OKF v0.2) bundle, ported from schema-dist's okf-exporter (8d0f92f, Keel #191) into the package, which is its agreed home (h29 #6375, #6376).

  • Behind an extra: pip install "onlyworlds[okf]" (PyYAML). The core stays dependency-free; import onlyworlds loads no yaml.
  • Reads through read_folder, the package's one folder reader.
  • Kinds, sections, link targets and the pin's keys come from the package's generated tables (the generator grew six tables from the vendored dist; --check passes). No runtime walk import.
  • The branch's 24 tests ported, plus tests for the package's conditions and for each change below. Each of the six mutants from the review makes a test fail, and one more of mine (integer 0 as unset) does too.
  • It no longer matches the branch's output byte for byte, on purpose (from the #360 sweep's gap read, Skeld h58 #6516): no generated actor (OKF §7's human: rule against a folder that does not say who wrote what), in-prose ow:// references become bundle links, and a line that already begins with a backslash is escaped too. Each change has a test that a mutant fails.

Draft until the Captain has read #360's scoping (B10, h29 #6453). Merge and release 0.6.0 then.

🤖 Generated with Claude Code

tmoosting and others added 2 commits October 17, 2026 02:05
…porter 8d0f92f (Keel #191)

export_okf(folder, out_dir) and `python -m onlyworlds.okf FOLDER OUT-DIR`.
Same behaviour as walk/okf_export.py, every review fix carried (every
splitlines() break quoted, unreadable and dot-prefixed files noted and
skipped, world.json time_range_current fallback and x_*/snapshot_* carry,
api dropped, undeclared keys and unknown kinds noted, wrong-type and null
links noted and left out, heading lines escaped, generated.by explained).
On the example world the bundle is byte-identical to the branch's run on
the same pinned dist (dist.23).

The four conditions: dependencies = [] stays and PyYAML is the new `okf`
extra (import onlyworlds loads no yaml; a test asserts it). The folder is
read only through read_folder: skipped files, ignored dirs, duplicates and
in_both_layouts become notes or the duplicate-id error. The schema comes
from _schema.py: the generator now emits BASE_FIELDS, WORLD_FIELDS,
SECTIONS, LINK_TARGETS, GENERIC_LINKS and EXTENSION_PREFIXES from the
vendored walk (decode_schema) and lint_folder, cross-checked against
FIELD_KINDS and GENERIC_PAIRS; known keys are push.NOT_SENT. The 24 tests
ported to tests/test_okf.py on the vendored Hyperion, plus two for the
conditions; the six mutants each fail at least one test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…orlds-py/<version>); dotfiles and a null time_current are the reader's now (0.5.1), so the exporter's own dotfile handling goes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tmoosting and others added 3 commits October 17, 2026 10:55
…so `# x` and `\# x` no longer export the same (found by reading a bundle back, OKF sweep #360); a test watched failing with the old pattern

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… folder does not say who wrote them), in-prose ow:// references become links into the bundle (an absent id stays and is listed as unresolved); CHANGELOG and README say how the port now differs from the branch (Skeld's gap read for #360, h58 #6516). Four mutants, each failing a test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…door); a test fails when a schema bump puts a frontmatter field on a key OKF defines (watched failing with supertype added to the set); the README's line is the sweep's: a valid OKF 0.2 bundle at one pinned commit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmoosting
tmoosting marked this pull request as ready for review October 17, 2026 10:38
@tmoosting
tmoosting merged commit d467969 into main Oct 17, 2026
3 checks passed
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