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
//! Decide schema: deliberation primitive shared across faculties.
//!
//! A *decision* is a small append-only deliberation: a title + optional
//! context, zero-or-more pro factors, zero-or-more con factors, and an
//! eventual resolution (outcome text + finished_at timestamp). Decisions
//! can be linked to whatever they're *about* via `decide::about` — a mail
//! draft, a compass goal, an arbitrary topic — and other faculties gate
//! their own high-stakes actions on a resolved decision.
//!
//! The point isn't to *extract* a machine-readable verdict from the
//! decision (the outcome is free-form text and remains so); the point is
//! to nudge the deliberation into existence. `decide resolve` itself
//! enforces the "≥1 pro AND ≥1 con" gate (with `--force` as the explicit
//! bypass — a resolved decision with no factors is by definition a
//! forced one, no separate flag needed in the schema). Downstream
//! faculties just check "is it resolved?" and trust the system.
//!
//! Most metadata is reused: `metadata::name` for the decision's title
//! and a factor's text, `metadata::description` for longer context,
//! `metadata::created_at` for proposal time, `metadata::finished_at`
//! for resolution time, `metadata::tag` for kind markers. Only three
//! attrs are unique to decide.
use id_hex;
use *;
pub const DEFAULT_BRANCH: &str = "decide";
/// Marks an entity as a deliberation (a decision proposal, possibly
/// resolved). Always has a `metadata::name` (title) and
/// `metadata::created_at`; gains `decide::outcome` and
/// `metadata::finished_at` when resolved.
pub const KIND_DECISION: Id = id_hex!;
/// Marks an entity as a "for" factor — a reason to take the decided
/// action. Always linked to its parent decision via `factor::about_decision`.
/// The factor's own content lives in `metadata::name` (one-liner) and
/// optionally `metadata::description` (longer).
pub const KIND_PRO: Id = id_hex!;
/// Marks an entity as an "against" factor — a reason not to, or a
/// risk to consider. Mirror-image of KIND_PRO.
pub const KIND_CON: Id = id_hex!;
/// Attributes unique to decide. Title/description/timestamps are
/// reused from `metadata::*`.
/// Attributes unique to factors (pros and cons share the same
/// attribute layout; the kind tag tells them apart).