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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//! What:
//! The gateway credential of the standards review as it travels from the wrapper to the service: a value that prints as
//! redacted, is read from the wrapper's own environment, and is carried only in the in-memory `work` message over the
//! user-only socket.
//! Why:
//! The credential must not reach the on-disk work item, a unit file or the manager's environment, and must not appear in
//! a log line by accident. A type whose `Debug` output hides the value keeps it out of every `{:?}` the code or a test
//! prints; reading it takes the explicit `expose`. Nothing here depends on the network client, so the wrapper's client
//! path may use it.
//!
//! In TS you'd write (pseudocode):
//! ```ts
//! const key = reviewKeyFrom(process.env); // sent in the message, never written to disk
//! ```
/// The credential variable, and the stop-hook credential used when it is unset.
pub const KEY_VARIABLES: = ;
/// What:
/// A non-empty credential. `Debug` prints a placeholder; only `expose` returns the text.
/// Why:
/// An empty value is the same as no value (the script fails with "no key" on `''`), so one type states both.
///
/// In TS you'd write (pseudocode):
/// ```ts
/// class ReviewKey { toString() { return '<redacted>' } }
/// ```
;
/// Methods over a key.
/// Debug output never carries the value.
/// What:
/// The credential the script would use: the first variable that is set, even to an empty text, else the second.
/// Why:
/// `??` in the script falls back only for an unset variable, so an empty first value means "no key", not the second.
///
/// In TS you'd write (pseudocode):
/// ```ts
/// process.env.SHADOW_REVIEW_LLMGATEWAY_API_KEY ?? process.env.STOP_REMINDER_LLMGATEWAY_API_KEY ?? ''
/// ```
/// Key controls stay out of the release executable.