git_policy_cli/policy/mod.rs
1//! What:
2//! The policy engine:
3//! the registry,
4//! triggers,
5//! events,
6//! the passes over candidates and direct fixes.
7//! Why:
8//! Policies are the reason the wrapper exists,
9//! so the engine and its shared pieces have one home.
10//!
11//! In TS you'd write (pseudocode):
12//! ```ts
13//! // policy/index.ts: one `export * from './file'` per module below.
14//! ```
15
16/// JSONL event rendering for wrapper-made diagnostics.
17pub mod diagnostics;
18
19/// The fixed registry of shipped policies.
20pub mod policy_registry;
21
22/// Lifecycle triggers and the trigger set of every shipped policy.
23pub mod policy_trigger;
24
25/// Policy events and their JSON Lines rendering.
26pub mod policy_events;
27
28/// A pathname as events report it:
29/// text,
30/// plus base64 `pathBytes` when it is not UTF-8.
31pub mod event_path;
32
33/// Exact repository path bytes as the operating system takes them, and as text for messages.
34pub mod path_bytes;
35
36/// Ordered policy execution for one lifecycle point.
37pub mod policy_engine;
38
39/// The bounded loop that repeats a pass after corrections changed candidate content.
40pub mod policy_convergence;
41
42/// The intent-guessing hint that follows a finding, an engine failure or a notice.
43pub mod event_hints;
44
45/// The shipped policies as checks over rule cores and repository facts.
46pub mod policy_checks;
47
48/// What a lifecycle offers content policies,
49/// and its candidates once prepared.
50pub mod policy_content;
51
52/// The built-in final-newline policy:
53/// canonical final LF,
54/// preserved paths,
55/// findings.
56pub mod policy_final_newline;
57
58/// The optional root-context policy:
59/// no top-level `CONTEXT.md` enters the index.
60pub mod policy_root_context;
61
62/// The optional catalog-specifier policy over the shared rule crate:
63/// every dependency in a tracked `package.json` is a catalog or workspace reference.
64pub mod policy_catalog_specifiers;
65
66/// The optional forbidden-strings policy over the linked scanner,
67/// with redacted findings.
68pub mod policy_forbidden_strings;
69
70/// Installing a direct fix's corrections into the worktree,
71/// all or none.
72pub mod direct_fix_install;
73
74/// The direct fix:
75/// converge corrections in memory,
76/// then install them.
77pub mod direct_fix;
78
79/// The fixed argument transforms of a forwarded command,
80/// in order.
81pub mod policy_transforms;
82
83/// One complete pass:
84/// built-in policies,
85/// fixed transforms,
86/// optional policies.
87pub mod policy_pass;
88
89/// The work of the installed cli-git that is not ported,
90/// and the refusal notice.
91pub mod unported;
92
93/// A scripted repository-facts provider for unit tests;
94/// never in the release build.
95#[cfg(test)]
96pub(crate) mod policy_test_support;