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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//! v2.6: how injected memory is framed to the reader.
//!
//! MemSyco-Bench (arXiv 2607.01071) reports the uncomfortable result that most
//! memory systems score *worse* on their sycophancy track than using no memory
//! at all. The mechanism is not that the memories are wrong more often than
//! they are right — it is that a retrieved memory arrives looking like ground
//! truth, so the model defers to it over evidence directly in front of it. A
//! memory saying "the config lives at `config/app.toml`" beats the agent's own
//! `ls` showing it does not, because nothing in the injection said which of the
//! two wins.
//!
//! Kimetsu's own framing was the plain header `"Kimetsu brain relevant
//! knowledge for this task:"`. "Knowledge" is exactly the wrong word for it:
//! what the brain holds is *what was recorded*, at some past moment, by someone
//! or something that believed it then.
//!
//! ## The precision this needs
//!
//! Over-hedging is not the fix, and would cost more than it saves. An agent
//! told "here is something that might be wrong" ignores memory, which is the
//! whole product. The framing has to say which questions memory settles and
//! which it does not, because those are genuinely different:
//!
//! * Memory *is* authoritative about **what was decided, learned, or agreed** —
//! a convention, a preference, a lesson from a real failure. There is no
//! other source for those; the repository does not record why.
//! * Memory is *not* authoritative about **what the code currently is**. The
//! working tree is, and it has moved since the memory was written. Every
//! memory-versus-reality conflict is of this second kind.
//!
//! So the rule is one sentence and it is a rule about conflicts, not a
//! disclaimer: prefer what you can observe now over what was recorded then.
//! That is exactly the deference MemSyco measures, inverted.
//!
//! Model-free — this is a string.
/// Header for the per-turn context injection.
///
/// The date the memory was recorded is not in the header because it is not
/// known per-bundle; capsules carry their own dates when the question is about
/// time (see [`crate::ordering`]).
pub const CONTEXT_HEADER: &str = "Recorded in this project's Kimetsu brain. These are prior conclusions, not \
observations of the current tree — where one conflicts with what you can \
check now, what you can check now wins:";
/// Header for a proactive mid-work injection.
///
/// Shorter than [`CONTEXT_HEADER`] on purpose: the proactive hook interrupts
/// work that is already underway, on a budget of roughly one capsule, and a
/// three-line preamble around a one-line memory is the injection reading as
/// noise.
pub const PROACTIVE_SUFFIX: &str = " (recorded previously — verify before acting on it)";
/// Guidance handed to an MCP client alongside a context bundle.
///
/// The MCP surface has no fixed render, so the framing has to travel as an
/// instruction rather than as a header the client is guaranteed to print.
pub const MCP_HOW_TO_USE: &str = "Capsule summaries are prior conclusions recorded in this project's brain, not \
observations of the current working tree. They are the authority on what was \
decided, learned, or preferred — the repository does not record why. They are \
not the authority on what the code is now: where a capsule conflicts with what \
you can check in the tree, prefer what you can check. Memory capsules are \
durable brain state; repo_file and repo_manifest capsules point to likely \
relevant files and manifests.";