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
//! The `list` **projection** layer — rendering a declared `Constitution` to text, JSON, and
//! Markdown. Pure projection (PROJECT.md): it observes nothing and never reacts; the reaction
//! layer (`run`/`dispatch`/`gate`) lives in the parent `runner`. Split out so the projection
//! surface grows here as capabilities and formats are added, not inside the shell.
use crateConstitution;
pub use list_document;
pub use projection_gate;
pub use list_markdown;
pub use *;
// Test-only: a projection test pins markdown's hand-maintained `STRUCTURAL` key list against
// `boundary_json_base`'s emitted keys (guarding the list from drift).
pub use boundary_params;
/// Render a constitution as the human- and agent-readable Markdown summary of its declared law —
/// the same projection `list --format markdown` prints, returned as a `String` for library
/// callers (e.g. to generate an agent-context artifact). It composes the same internal projector,
/// so it carries no less than the JSON and never reacts; it adds nothing of its own (no preamble,
/// no trailing newline), so it equals the CLI output byte for byte.
///
/// **Format stability.** This Markdown layout is intended for display, review, and LLM context.
/// It is **not** a machine-stable contract and **may evolve in any compatible release** to improve
/// readability or imitability (e.g. foregrounding a boundary's `reason`). Consumers that need a
/// stable, machine-parseable projection MUST use the JSON projection (`list --format json`)
/// instead — depending on the exact Markdown shape is unsupported.
///
/// ```
/// use tianheng::prelude::*;
/// let c = Constitution::new("my-project").boundary(
/// CrateBoundary::crate_("my-core")
/// .deny_external_dependencies()
/// .because("my-core stays dependency-light"),
/// );
/// let md = tianheng::constitution_markdown(&c);
/// assert!(md.contains("# Constitution: my-project"));
/// assert!(md.contains("my-core stays dependency-light"));
/// // Write it where an agent will read it, e.g.:
/// // std::fs::write("AGENTS.my-project-law.md", md)?;
/// ```