Skip to main content

humanize_cli_core/
constants.rs

1//! Constants used throughout the Humanize plugin.
2
3/// Environment variable for the Claude Code plugin root directory.
4pub const ENV_CLAUDE_PLUGIN_ROOT: &str = "CLAUDE_PLUGIN_ROOT";
5
6/// Environment variable for the project directory.
7pub const ENV_CLAUDE_PROJECT_DIR: &str = "CLAUDE_PROJECT_DIR";
8
9/// Environment variable to bypass Codex sandbox (dangerous).
10pub const ENV_CODEX_BYPASS_SANDBOX: &str = "HUMANIZE_CODEX_BYPASS_SANDBOX";
11
12/// Default maximum iterations for RLCR loops.
13pub const DEFAULT_MAX_ITERATIONS: u32 = 42;
14
15/// Default Codex model.
16pub const DEFAULT_CODEX_MODEL: &str = "gpt-5.4";
17
18/// Default Codex effort level.
19pub const DEFAULT_CODEX_EFFORT: &str = "xhigh";
20
21/// Default Codex timeout in seconds.
22pub const DEFAULT_CODEX_TIMEOUT_SECS: u64 = 5400;
23
24/// State file names.
25pub mod state_files {
26    pub const STATE_MD: &str = "state.md";
27    pub const FINALIZE_STATE_MD: &str = "finalize-state.md";
28    pub const COMPLETE_STATE_MD: &str = "complete-state.md";
29    pub const CANCEL_STATE_MD: &str = "cancel-state.md";
30    pub const STOP_STATE_MD: &str = "stop-state.md";
31    pub const MAXITER_STATE_MD: &str = "maxiter-state.md";
32    pub const UNEXPECTED_STATE_MD: &str = "unexpected-state.md";
33    pub const APPROVE_STATE_MD: &str = "approve-state.md";
34    pub const MERGED_STATE_MD: &str = "merged-state.md";
35    pub const CLOSED_STATE_MD: &str = "closed-state.md";
36}
37
38/// Signal files for session handshake.
39pub mod signal_files {
40    pub const PENDING_SESSION_ID: &str = ".pending-session-id";
41}
42
43/// YAML frontmatter delimiters.
44pub const YAML_FRONTMATTER_START: &str = "---";
45pub const YAML_FRONTMATTER_END: &str = "---";
46
47/// Maximum JSON nesting depth allowed.
48pub const MAX_JSON_DEPTH: usize = 30;
49
50/// Terminal state file names for RLCR loops.
51pub const RLCR_TERMINAL_STATES: &[&str] = &[
52    "complete-state.md",
53    "stop-state.md",
54    "maxiter-state.md",
55    "unexpected-state.md",
56    "cancel-state.md",
57];
58
59/// Terminal state file names for PR loops.
60pub const PR_TERMINAL_STATES: &[&str] = &[
61    "approve-state.md",
62    "maxiter-state.md",
63    "merged-state.md",
64    "closed-state.md",
65    "cancel-state.md",
66];