Metadata-Version: 2.4
Name: jos-core
Version: 2.1.0
Summary: Reference kernel for .jos 2.1 documents: validate, normalize, run atoms and flows (engines shell and jos), directories, PAL, per-run ledger and receipts. Python >= 3.10, 0 dependencies.
Author: JOSFOX maintainers
License: Apache-2.0
Project-URL: Repository, https://github.com/josfox-jos/jos
Project-URL: Specification, https://github.com/josfox-jos/jos-spec
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# jos-core (Python)

Reference kernel of the `.jos` 2.0 format (media type `application/vnd.jos+json`) in Python, with the same results as
the JavaScript kernel `@josfox/jos-core` on every conformance vector: `tck/compare-implementations.py` finds no
difference (results compared as JSON values, minted ids, times and durations normalized; the printed text can differ
in member order and number spelling, `5.0` against `5`, never in a value). Since 2.0.0-rc.8 there is no exception: a
number an IEEE 754 double does not keep makes the document invalid in both engines (the former `jcs-numbers`
exception). Python 3.10 or later, no dependencies.

```
jos-core validate <file|dir> --json
jos-core run <file|dir> --json --runs <dir>
jos-core version --json
jos-core --version        # one line, the same as the JavaScript kernel: jos-core <version> (.jos 2.0.0)
```

As a library: `import jos_core; r = jos_core.run_file('hello.jos')` reads the file once and runs it with `dir` and
`source` (its octets); `jos_core.run(doc, cwd=..., dir=..., source=data)` is the same with a document already parsed.
A 0.0.7 document sealed by a detached manifest (`security.integrity_ref`) is verified over the octets it was parsed
from, so `run()` needs `dir` and `source` for it (else code 5); `verify_legacy_ref(doc, data, dir)` is that check alone.

Stability: validation, normalization, runs of atoms and flows, directories (`.jos/` folders), PAL and the per-run
ledger are the stable contract of 2.0.0. JOSID Graph 0.1.0 (the module `jos_core.facts`, the `jos-core facts` commands
and `run --graph`) is experimental: it may change in 2.1 without a major version and is not part of that contract.
JOSDB, the embedded store, is not in 2.0.0; it arrives with 2.1.

The specification, its schemas and the Test Compatibility Kit are in `josfox-jos/jos-spec`. License: Apache-2.0.
Copyright JOSFOX LLC.
