1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! `InputValueLog` — on-disk shape of [`super::InputValue`].
//!
//! Mirrors `InputValue`'s recursive tree but every leaf becomes a
//! [`LogReference`] to its own file. Object/Array branches preserve
//! structure as `IndexMap<String, LogReference>` and
//! `Vec<LogReference>` respectively — each value/element references
//! a per-leaf file (which itself may be a sub-tree if the original
//! child was an Object or Array; in that case the file's content is
//! the serialized `InputValueLog` of that sub-tree).
//!
//! Per-leaf file naming: paths nest under
//! `<route_base>/input/<dotted-key-path>/<id>.<ext>` so the on-disk
//! layout mirrors the input tree shape directly.
//!
//! Three top-level variants, JSON-distinguishable when untagged:
//!
//! - `Reference` (object with `"type":"reference","path":"…"`) — the
//! leaf was a primitive (`String`/`Integer`/`Number`/`Boolean`) or
//! a `RichContentPart`. The referenced file contains the value
//! itself (raw text for strings, JSON for everything else).
//! - `Object` (JSON map of refs) — the original was
//! [`super::InputValue::Object`].
//! - `Array` (JSON list of refs) — the original was
//! [`super::InputValue::Array`].
//!
//! Readers branching on JSON shape can pattern-match in that order
//! without ambiguity (LogReference has a known `"type"` discriminator;
//! Object and Array are map vs list at the JSON level).
use IndexMap;
use JsonSchema;
use ;
use crateLogReference;