Skip to main content

nomograph_workflow/
lib.rs

1//! nomograph-workflow — shared layer between claim-substrate tools.
2//!
3//! Extracted from duplicated adapter code in synthesist and lattice
4//! (both tools wrapped `nomograph_claim::Store` with near-identical
5//! thin adapters). Consolidated here so:
6//!
7//! - `Store` (the adapter) is a single source of truth. When
8//!   `nomograph_claim::Store` evolves, synthesist and lattice pick up
9//!   the change through one file, not two.
10//! - The [`phase`] state machine (workflow phases) has a clear owner.
11//!   Future tools (seer) can call `workflow::phase::check_phase` to
12//!   enforce the same rules synthesist does.
13//! - v1 legacy detection lives in one place; every tool that reads a
14//!   project directory picks up the same prescriptive migration error.
15//!
16//! # What belongs here
17//!
18//! Things that MORE THAN ONE nomograph tool needs, AND that are tied
19//! to the claim substrate's conventions. In practice:
20//!
21//! - The `<repo_root>/claims/` discovery walk (same for every tool)
22//! - The `user:local:<user>[:session]` asserter convention
23//! - Schema validation at the append boundary
24//! - The phase state machine (synthesist + future seer)
25//! - Legacy-v1 detection
26//! - Cross-tool helpers: `parse_tree_spec`, `today`, `json_out`
27//!
28//! # What does NOT belong here
29//!
30//! - Per-tool CLI handlers (stay in synthesist / lattice)
31//! - Tool-specific claim types (Campaign, etc. — still just appended
32//!   through `Store::append` with a [`ClaimType`](nomograph_claim::ClaimType))
33
34pub mod helpers;
35pub mod legacy;
36pub mod phase;
37pub mod store;
38
39pub use helpers::{json_out, parse_tree_spec, today};
40pub use legacy::{find_legacy_v1_db, legacy_migration_error};
41pub use phase::{Phase, check_phase};
42pub use store::{CLAIMS_DIR, Store};