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
//! Stable, data-only issue and form templates.
//!
//! A *template* is a reusable definition that resolves into a normal create
//! request (`contracts/template-registry.md`, `data-model.md` ยง1). It is data โ
//! Markdown/TOML โ never executable code and never a second issue schema.
//!
//! Templates live in `tix.toml` under `[issue_templates.<stable-id>]`, keyed by
//! an **immutable ID**, with a mutable display `name`, an explicit
//! [`TemplateScope`] (repository / board / team, with no inheritance), typed
//! `defaults`, ordered `prompts`, typed `references`, and an extension area that
//! preserves unknown metadata verbatim across round trips.
//!
//! This registry is deliberately **distinct** from the legacy
//! `[templates.<name>]` section ([`crate::config::IssueTemplate`]), which is a
//! TUI New-Issue pre-fill shorthand keyed by display name with no identity or
//! scope. The stable-ID registry here is the one `tix template` and
//! `tix create --template` operate on; the two never share a key space, so a
//! name in one is never mistaken for an ID in the other.
//!
//! Persistence is the existing atomic [`crate::config::Config::save`] โ the
//! registry adds no file of its own. A project with no templates writes no
//! section, so a legacy `tix.toml` round-trips byte-identically (C-006).
pub mod management;
pub mod registry;
pub mod resolver;
pub mod validation;
pub use resolver::{CreateRequest, TemplateInput, TemplateResolution, TemplateSelection, resolve};
pub use validation::{DiagnosticKind, TemplateDiagnostic};
pub use management::{
DeleteConfirmed, TemplateAuditEvent, TemplateDefinition, TemplateDetail, TemplateMutation,
TemplateMutationKind, TemplateOutcome, TemplateService, TemplateWriteError,
};
pub use registry::{
CREATE_FIELDS, OPTIONS_SOURCES, PromptKind, ReferenceKind, Template, TemplateDefaults,
TemplateMetadata, TemplatePrompt, TemplateReference, TemplateRegistry, TemplateScope,
TemplateScopeKind,
};