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
//! The lockfile `agentstacks.lock`, read from text, checked as a whole and written back as text.
//!
//! The lock pins what an install resolved to, so one strict value type serves the reader and the
//! writer and a lock built in memory is held to the rules of one read from disk.
//!
//! # Responsibilities
//!
//! - [`Lockfile`]: the checked lock, parsed from text or built from [`LockContents`], with every list kept sorted.
//! - [`LockContents`]: the typed entries a lock is built from, in any order.
//! - [`LockedEntry`]: one locked tool or pack, with its version, origin and tree hash.
//! - [`LockedSource`]: where a locked entry came from, a git commit or a project directory.
//! - [`FileEntry`]: one file an install wrote, with its path, hash and owner.
//! - [`EntryKey`]: what identifies one entry, so the duplicate refusal can name it.
//! - [`Owner`]: the name of the pack or tool that wrote a file.
//! - [`LockError`]: the refusals of the lock with a wording of their own.
//! - [`write_lock()`]: the lock's text, with a fixed field order and one newline at the end.
//! - [`check_airsl_presence()`]: refuses a lock whose `[airsl]` section disagrees with what the locked packs need.
//!
//! # Non-responsibilities
//!
//! A missing lock is not an error here, because the reader takes text. Comparing the lock with
//! `agentstacks.toml`, or a locked hash with the content on disk, belongs to the stage that plans
//! and applies an install. Writing the text to disk belongs to the executor.
//!
//! This file is an export-only module with no executable logic, so it carries no inline tests.
pub use check_airsl_presence;
pub use EntryKey;
pub use FileEntry;
pub use LockedEntry;
pub use LockedSource;
pub use LockError;
pub use LockContents;
pub use Lockfile;
pub use Owner;
pub use write_lock;