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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//! The AWL provenance a `.aion` archive can carry: the authored document and
//! the schema files that document imports.
//!
//! # Archive layout
//!
//! Two entry families share the `awl/` prefix, and both are rooted at the
//! DOCUMENT'S OWN DIRECTORY — the same root an AWL checker resolves
//! `schema("…")` imports against:
//!
//! ```text
//! awl/document/<filename> exactly one entry; the authored `.awl` file
//! awl/schema/<relative path> zero or more; each imported schema file
//! ```
//!
//! The document entry keeps the original filename verbatim, and every schema
//! entry keeps the document-relative path the document itself names, nesting
//! included. That is what lets a consumer stage the pair back onto a
//! filesystem and re-check the document exactly as it was checked when it was
//! deployed: the source's `schema("schemas/brief.schema.json")` line resolves
//! against the staged tree unchanged.
//!
//! # This is provenance, never identity
//!
//! An archived document does NOT participate in package identity. Two
//! packages whose beams, manifest, and contract agree have the SAME
//! [`crate::ContentHash`] whether one carries AWL source and the other does
//! not, and whether their carried source differs. See [`crate::hash`] for the
//! identity law this is a declared instance of; it is pinned by
//! `awl_source_inclusion_does_not_change_manifest_version` in
//! `crate::builder`.
use BTreeMap;
pub const AWL_DOCUMENT_PREFIX: &str = "awl/document/";
pub const AWL_SCHEMA_PREFIX: &str = "awl/schema/";
/// The authored AWL document an archive was built from, with the schema files
/// it imports.
///
/// The document is text (an AWL document is UTF-8 by construction — the lexer
/// works on `&str`), so a consumer can parse it without re-validating an
/// encoding. Schema files stay bytes: they are staged back onto a filesystem
/// verbatim, and re-encoding them would change what the checker reads.