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
//! Bulk issue editing — the **selection** and **typed patch** layer (WP01).
//!
//! The two things every later work package needs and neither of which may invent:
//! which issues a bulk operation acts on, and what it is being asked to change.
//! Both are built here, both are **pure with respect to the store** — resolution
//! reads, nothing writes — because `contracts/patch-plan.md` §3 requires a plan to
//! be cancellable with no file, relationship, archive or History change, and the
//! only way that is guaranteed rather than hoped for is if the value that
//! authorizes a write is built by code that cannot write.
//!
//! ## The two rules that shape everything here
//!
//! **Selection resolves once.** `Selection::issues` is an ordered snapshot taken at
//! resolution time. A later apply must not pick up an issue that appeared after
//! the preview, and must not silently drop one that went away — the contract calls
//! this out and it is the reason `Selection` owns `Vec<Issue>` rather than a query
//! to be re-run (data-model §1, contract §2).
//!
//! **Absent is not empty.** A patch value distinguishes `Unchanged`, `Set` and
//! `Clear`, so "the user did not mention labels" and "the user emptied labels" are
//! different requests. A `String` field cannot express that, which is why
//! `PatchValue` exists rather than `Option<Option<String>>` and a comment.
pub mod apply;
pub mod archive;
pub mod field_apply;
pub mod metadata;
pub mod pair;
pub mod patch;
pub mod plan;
pub mod selection;
pub use apply::{ApplyReport, ItemOutcome, apply_fields};
pub use archive::{
ARCHIVE_OWNER, ArchiveBatchRequest, ArchiveItemRequest, ArchiveOperation, apply_archive,
};
pub use pair::{PairOutcome, PairProblem, PairResolution, apply_pair};
pub use patch::{ArchiveRequest, IssuePatch, PatchProblem, PatchValue, RelationshipOp};
pub use plan::{BatchPlan, Confirmation, FieldChange, HistoryIntent, ItemPlan, PairPlan};
pub use selection::{
ScopeMetadata, Selection, SelectionScope, SelectionSource, scope_metadata, selector_number,
};