feat: scienting-math/1 sources and derived/math.jsonl; lode references; stress fixes
Math content may say its source is in scienting-math/1's canonical TeX (form, in no hash); derived/math.jsonl holds papermath's tree, symbols and issues, and the validator now checks derived files. A symbol annotation names its symbol by key; lode claim references use lode's tag and pin syntax. The zip reader refuses entries zipfile cannot read, and checkpoint lines end in LF only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017R7sgDNvUGWY2zFPCq2JH6
This commit is contained in:
40 files changed
+750
-63
No files matched your search
+26
-1
@@ -7,7 +7,7 @@ A change to any computed value is a breaking change and needs a new major versio
|
||||
The first release.
|
||||
|
||||
- The specification, in chapters 0 to 23, covering every format: 32 formats, of which 19 are `candidate` and 13 `provisional`.
|
||||
- 42 JSON Schemas, using a keyword subset that independent validators read alike.
|
||||
- 43 JSON Schemas, using a keyword subset that independent validators read alike.
|
||||
- Tables for SQLite, Dolt and PostgreSQL, a team's store, and the SQLite bundle with full-text search.
|
||||
- The JSON-LD context for layers, and registries of formats, rules, download-stamp rules and default stage requirements.
|
||||
- Test vectors for every computed value, from canonical JSON to anchor resolution, grading and the target set of targeted F3.
|
||||
@@ -61,3 +61,28 @@ They are minor changes too: new operations, enumeration values and optional prop
|
||||
Like an emend, neither lowers a leaf's level, and a receipt keeps counting across all three ([spec/08 §8.1–8.2](spec/08-fidelity.md#82-levels), `receipts.carried_hashes`).
|
||||
- The rules `correction.emend`, `correction.relink`, `correction.resolve` and `doc.correction.resolution` are registered, the `corrections` table's CHECK takes the three operations ([sql/doc.sql](sql/doc.sql)), `corrections.State` carries the reference records, and `paperspec stress` walks the three operations with their invariants.
|
||||
`corrections.jsonl` gains thirteen cases and `projections.jsonl` and `projection-groups.jsonl` two each; no existing case changes.
|
||||
|
||||
Four more, asked for by papermath, which defines the math form `scienting-math/1`, and by lode, the claim store whose claims and symbols layers point at.
|
||||
The first two are minor changes: an optional property, a derived file and its schema, with no hash, ID or key of an existing file changed.
|
||||
The last two make some files that were valid invalid, which [spec/00](spec/00-introduction.md) calls breaking; they are made now because no release of `scienting-doc/1` or `scienting-layer/1` has been tagged, and a reference worth changing is changed before one is ([CONTRIBUTING.md](CONTRIBUTING.md#releasing), item 4).
|
||||
|
||||
- Math forms ([spec/03 §3.7](spec/03-nodes.md#37-math-forms), [spec/09 §9.4](spec/09-figures-tables-equations.md#94-the-math-form), `node.schema.json`, `runs.schema.json`, `mathForm` in `common.schema.json`): an equation's content and a `math` run may carry `form`, whose one value, `scienting-math/1`, says that the source is canonical TeX; the notation is then `tex`.
|
||||
A consumer may rely on the source being canonical and idempotent, carrying no label, and on everything else being derived from it.
|
||||
`form` enters no content value ([spec/05 §5.2](spec/05-hashes.md#52-own-content)): own content leaves it out of math runs (`paperspec.hashing`), an equation's own content never held more than its notation and source, and no projection reads it, so adding `form` to a source already in the form changes no hash, ID or anchor, while respelling a source changes it as any edit does.
|
||||
Because a complex formula's key compares sources, a producer aligning a reading in a form with another reading respells the other's math first.
|
||||
`hashes.jsonl` gains a case, `math-form`, whose values `paperspec check` also computes without `form`; the rule `doc.math.form` is registered for validators that implement the form, which the reference validator does not.
|
||||
- `derived/math.jsonl` ([spec/12 §12.7](spec/12-package.md#127-derived-files), [spec/09 §9.4](spec/09-figures-tables-equations.md#94-the-math-form), `math.schema.json`): one line per formula, `{node, run, tool, form, tree, symbols, complete, issues, label?}`, papermath's reading without the canonical TeX, which is the source; `run` is null for an equation, as in `derived/mathml.jsonl`, and `label` is omitted when the source has no `\tag`.
|
||||
A tree node is an array whose first item is its kind; the schema takes any lowercase kind and issue code, so the form can add some in a minor version, and lists the 47 kinds and six codes of version 1.
|
||||
The validator now checks derived files: each line against its schema, that it names a formula of the package (`doc.derived.node`), that a math line's formula is TeX and its `complete` and `symbols` agree with its tree (`doc.derived.math`), and that a checks-only package carries none (`doc.policy.withheld`), since a tree or MathML reads the withheld text.
|
||||
The main example gains `derived/math.jsonl`, papermath 0.1.0's reading of its equation and of two math runs, copied by hand because the oracle does not implement the form; `paperspec check` validates fourteen variants of it, and no fixture's hashes change.
|
||||
There are now 43 schemas, which the 0.1.0 entry above, held to the repository by `paperspec check`, states too.
|
||||
- Claim references ([spec/18 §18.4](spec/18-layers.md#184-bodies), [spec/02 §2.4](spec/02-model.md#24-work-and-document-keys), [spec/20](spec/20-projects.md), `claimRef` and `claimPin` in `common.schema.json`): the `source` of a `claim-link` or `symbol` body, a `lode:` identifier in `same_as`, and a project's claim step are lode references, `lode:<tag>` or `lode:<host>/<tag>` with the tag eight Crockford base32 capitals, and a `pin` is the reference, `@` and six lowercase hex digits of the claim's statement hash, as lode writes them.
|
||||
A slug such as `lode:amber/k-bond`, which lode may rename, was valid before and is not now.
|
||||
The fixtures' `lode:amber/k-bond` and `illustrative-pin` become `lode:272XTX7C` and `lode:272XTX7C@02f47b`, the claim `amber/k-bond` of lode's example store, which changes the claim link's record ID, the layer receipt and `project.json`.
|
||||
- Symbol keys ([spec/18 §18.4](spec/18-layers.md#184-bodies), `annotation.schema.json`, the `key` term of the JSON-LD context, `sct:symbolKey`): a `symbol` body names its symbol by `key`, its `scienting-math/1` key, besides the span its target selects, so a symbol is found across papers and matched to its claim by key; a `symbol` body without `key` was valid before and is not now.
|
||||
The example layer gains a proposed symbol annotation on `$K_r$`, with the key `K_{r}`.
|
||||
- Three failures of `paperspec stress` with the seeds 1, 2 and 7, in code the earlier changes did not touch.
|
||||
The zip reader let `zipfile`'s own errors escape on an archive it cannot read, such as `NotImplementedError` for an entry that needs zip version 9.8; `paperspec.package.read_zip` now refuses every such archive with `package.zip.entry` ([spec/12 §12.2](spec/12-package.md#122-paths)), and `paperspec check` crafts one of each kind.
|
||||
A checkpoint note was split into lines with `str.splitlines`, which also breaks at U+000B and other separators and so accepted a note whose last newline was replaced by one; [spec/23 §23.2](spec/23-log.md#232-checkpoints) now says every line ends in U+000A alone, `paperspec.log.parse_checkpoint` splits on it, and `paperspec check` tries ten other separators.
|
||||
The third was the stress harness's own: a truncation could cut a file at its full length, leaving the package unchanged and valid, so it now always shortens the file.
|
||||
So was a fourth, with 1000 rounds: the random walk of corrections could delete the body section, leaving nothing to correct and too few corrections accepted, so a delete now leaves at least eight nodes.
|
||||
Reference in new issue
Block a user