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
//! The operator's standing instructions, given to every session.
//!
//! A project says how to work on that project, in its own `AGENTS.md`, and the
//! agent reads that by itself. This is the other half: what the person running
//! the daemon wants of every session, whatever repository it is working in and
//! whether or not that repository says anything at all.
//!
//! The text is carried in the block already appended to the agent's system
//! prompt rather than written into the agent's configuration directory. That
//! directory's name belongs to the agent and is overridable, so writing there
//! would be a guess that fails silently; the appended block is a path errand
//! passes itself and can be sure of.
/// Heading the rules are given under, so the agent can tell them apart.
pub const RULES_HEADING: &str = "## House rules";
/// The rules as they reach the agent, or none when there are none.
///
/// Whitespace-only counts as none. A file that has been emptied is an operator
/// saying there are no rules, and a heading over nothing reads as an omission.
/// The rules as written, so they can be scrubbed back out of what is reported.
///
/// The block is handed to the agent as a file, because that is how a system
/// prompt is appended, and that file necessarily sits where the agent can read
/// it. So a session that reads its own prompt back, out of curiosity or by
/// listing its state directory, would otherwise put the operator's rules into
/// the channel and the transcript. They are instructions rather than secrets,
/// but they are the operator's and not the thread's, and the same reporting
/// path is already wrapped for scrubbing.
///
/// Read fresh rather than held, so editing the file reaches the next session
/// the same way the rules themselves do.
///
/// Returns nothing when there are no rules, which is not a failure: a scrub
/// list with nothing in it simply scrubs nothing.