kernel/spine/memo.rs
1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4// Copyright (c) 2026 2youg1 and the sprawling contributors
5
6//! The moments the plan and the record are written.
7//! The part `crates/kernel/spec/Spine.lean` specifies this module with the
8//! rest of `kernel::spine`.
9//!
10//! `Memo.md` itself carries no shape: it is the notepad for what needs
11//! recording and has no other home, so the form of an entry is the
12//! writer's to choose. What the city does fix is *when* the plan and the
13//! memo are written, and that is this module's [`WriteMoment`].
14
15use serde::{Deserialize, Serialize};
16
17/// Scope-change vocabulary: requirements move by KEEP/ADD/DROP, never by
18/// piling replacements into a bigger project.
19#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
20#[serde(rename_all = "snake_case")]
21pub enum ScopeChange {
22 Keep,
23 Add,
24 Drop,
25}
26
27/// The three moments the plan may be written.
28///
29/// Its consumer is the projection that holds the parsed tree: because
30/// the set of moments is closed, a reader can hold the tree between them
31/// instead of parsing every building's file for every question.
32#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
33#[serde(rename_all = "snake_case")]
34pub enum WriteMoment {
35 BeforeReport,
36 AfterFeedback,
37 OnPlanChange,
38}