---
title: "treestore-json — Mova code model"
description: "Mova code model of tools/treestore/src/json.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/tools/treestore/src/json.rs.groupant/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Research](https://md.research.elamur.ai/free/en/) · **Groupants**

This page as HTML: <https://groupants.elamur.ai/free/en/mova/tools/treestore/src/json.rs.groupant/>

# treestore-json

The groupant beside tools/treestore/src/json.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.

## Facts

- **kind:** groupant
- **status:** partial source bound model
- **source:** [`tools/treestore/src/json.rs`](https://github.com/ElamurAI/mova-free/blob/main/tools/treestore/src/json.rs)
- **repository folder:** [`tools/treestore/src/json.rs.groupant`](https://github.com/ElamurAI/mova-free/tree/main/tools/treestore/src/json.rs.groupant)

> **Implementation material.** A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.

## Components

| component | label | where |
|---|---|---|
| **Approximant** | partial | [Approximant](#approximant) |
| **Ast** | partial | `syntax.json` |
| **Composition** | partial | [Composition](#composition) |
| **Cost** | symbolic source derived | [Invariant](#invariant) |
| **Descriptant** | present | [Descriptant](#descriptant) |
| **Invariant** | partial | [Invariant](#invariant) |
| **Tests** | executed bounded checks | [Tests](#tests) |

## Obernants

The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.

| relation | type | label | where |
|---|---|---|---|
| Behavior complement | behavior complement | partial source derived model | [Behavior complement](#behavior-complement) |
| Reverse reconstruction | reverse reconstruction | partial source derived model | [Reverse reconstruction](#reverse-reconstruction) |

## Model text


### Descriptant

The top level of a compact JSON object as written: (key, value byte span) of each member, so a record is cut into an
envelope and coded string fields and put back byte for byte without re-serialising the rest. Epoch 2026-11-06.

### Approximant

members(s) scans one object: `{` key `:` value (`,` key `:` value)* `}` with no whitespace; a string ends at the first
unescaped quote; containers end at depth 0 skipping strings; scalars end before `,` `}` `]`. plain_string(raw) =
Some(v) iff serde_json reads raw as v and serde_json writes v as raw.

### Invariant

For s accepted by members: concatenating `{`, the members as `"key":value` joined by `,`, and `}` gives s. plain_string
is a partial inverse of escape: escape(plain_string(r)) = r. Cost O(|s|).

### Composition

codec::encode replaces the spans of coded fields by `null`; codec::decode finds the same keys in the envelope and puts
escape(field) back.

### Behavior complement

Does not validate JSON (a malformed scalar is accepted as a span), does not accept whitespace or escaped keys (the
record then stays whole in the envelope), does not normalise numbers or key order.

### Reverse reconstruction

From the member list and the original string the input is recovered exactly (spans are positions in it); from a
decoded string value alone, its raw JSON is recovered only when plain_string holds (canonical escaping).

### Tests

`json::tests::members_and_strings`: nested containers and escaped quotes; negative controls (array, whitespace,
non-canonical escape).

## Provenance

- **source SHA-256:** `627c4c9a9753b761…`
- **repository commit:** `f55191f0d47f`
