liteagents 2.12.0 → 2.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/README.md +6 -3
- package/installer/package-manager.js +1 -1
- package/package.json +1 -1
- package/packages/ampcode/agents/context-builder.md +1 -1
- package/packages/ampcode/commands/remember/AGENT_RULES.md +329 -0
- package/packages/ampcode/commands/{friction → remember}/friction.js +14 -14
- package/packages/ampcode/commands/remember.md +119 -27
- package/packages/ampcode/commands/stash.md +1 -1
- package/packages/claude/agents/context-builder.md +4 -4
- package/packages/claude/commands/remember/AGENT_RULES.md +329 -0
- package/packages/claude/commands/{friction → remember}/friction.js +14 -14
- package/packages/claude/commands/remember.md +119 -27
- package/packages/claude/commands/stash.md +1 -1
- package/packages/droid/commands/remember/AGENT_RULES.md +329 -0
- package/packages/droid/commands/{friction → remember}/friction.js +14 -14
- package/packages/droid/commands/remember.md +119 -27
- package/packages/droid/commands/stash.md +1 -1
- package/packages/droid/droids/context-builder.md +1 -1
- package/packages/opencode/agent/context-builder.md +1 -1
- package/packages/opencode/command/remember/AGENT_RULES.md +329 -0
- package/packages/opencode/command/{friction → remember}/friction.js +14 -14
- package/packages/opencode/command/remember.md +119 -27
- package/packages/opencode/command/stash.md +1 -1
- package/packages/subagentic-manual.md +9 -2
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* node friction.js <sessions-directory>
|
|
7
7
|
* node friction.js ~/.claude/projects/-home-hamr-PycharmProjects-liteagents/
|
|
8
8
|
*
|
|
9
|
-
* Outputs (all in .opencode/friction/):
|
|
9
|
+
* Outputs (all in .opencode/remember/friction/):
|
|
10
10
|
* friction_analysis.json - Per-session analysis
|
|
11
11
|
* friction_summary.json - Aggregate stats
|
|
12
12
|
* friction_raw.jsonl - Raw signals
|
|
@@ -1483,7 +1483,7 @@ function analyzeMain(sessionsDir) {
|
|
|
1483
1483
|
}
|
|
1484
1484
|
|
|
1485
1485
|
// Create output dir
|
|
1486
|
-
const outputDir = '.opencode/friction';
|
|
1486
|
+
const outputDir = '.opencode/remember/friction';
|
|
1487
1487
|
fs.mkdirSync(outputDir, { recursive: true });
|
|
1488
1488
|
|
|
1489
1489
|
// Process each session
|
|
@@ -1641,12 +1641,12 @@ function analyzeMain(sessionsDir) {
|
|
|
1641
1641
|
|
|
1642
1642
|
// Output files
|
|
1643
1643
|
console.log('Outputs:');
|
|
1644
|
-
console.log(' \uD83D\uDCCA .opencode/friction/report.md (detailed analysis)');
|
|
1645
|
-
console.log(' \uD83D\uDCCB .opencode/friction/antigen_review.md (clustered failure patterns)');
|
|
1646
|
-
console.log(` \uD83D\uDCC1 .opencode/friction/*.json (raw data: ${allSignals.length} signals, ${analyses.length} sessions)`);
|
|
1644
|
+
console.log(' \uD83D\uDCCA .opencode/remember/friction/report.md (detailed analysis)');
|
|
1645
|
+
console.log(' \uD83D\uDCCB .opencode/remember/friction/antigen_review.md (clustered failure patterns)');
|
|
1646
|
+
console.log(` \uD83D\uDCC1 .opencode/remember/friction/*.json (raw data: ${allSignals.length} signals, ${analyses.length} sessions)`);
|
|
1647
1647
|
console.log();
|
|
1648
1648
|
|
|
1649
|
-
console.log('Next: Review .opencode/friction/report.md');
|
|
1649
|
+
console.log('Next: Review .opencode/remember/friction/report.md');
|
|
1650
1650
|
console.log('='.repeat(60));
|
|
1651
1651
|
|
|
1652
1652
|
if (errors.length > 0) {
|
|
@@ -2196,9 +2196,9 @@ function clusterCandidates(allCandidates) {
|
|
|
2196
2196
|
|
|
2197
2197
|
function extractMain(sessionsDir) {
|
|
2198
2198
|
// Load friction analysis
|
|
2199
|
-
const analysisFile = '.opencode/friction/friction_analysis.json';
|
|
2199
|
+
const analysisFile = '.opencode/remember/friction/friction_analysis.json';
|
|
2200
2200
|
if (!fs.existsSync(analysisFile)) {
|
|
2201
|
-
console.log('Error: Run friction analysis first to generate .opencode/friction/friction_analysis.json');
|
|
2201
|
+
console.log('Error: Run friction analysis first to generate .opencode/remember/friction/friction_analysis.json');
|
|
2202
2202
|
return 1;
|
|
2203
2203
|
}
|
|
2204
2204
|
|
|
@@ -2211,7 +2211,7 @@ function extractMain(sessionsDir) {
|
|
|
2211
2211
|
}
|
|
2212
2212
|
|
|
2213
2213
|
// Load raw signals
|
|
2214
|
-
const rawFile = '.opencode/friction/friction_raw.jsonl';
|
|
2214
|
+
const rawFile = '.opencode/remember/friction/friction_raw.jsonl';
|
|
2215
2215
|
let signals = [];
|
|
2216
2216
|
if (fs.existsSync(rawFile)) {
|
|
2217
2217
|
const rawContent = fs.readFileSync(rawFile, 'utf-8');
|
|
@@ -2266,7 +2266,7 @@ function extractMain(sessionsDir) {
|
|
|
2266
2266
|
console.log();
|
|
2267
2267
|
|
|
2268
2268
|
// Save outputs
|
|
2269
|
-
const outputDir = '.opencode/friction';
|
|
2269
|
+
const outputDir = '.opencode/remember/friction';
|
|
2270
2270
|
fs.mkdirSync(outputDir, { recursive: true });
|
|
2271
2271
|
|
|
2272
2272
|
// Raw candidates (kept for debugging)
|
|
@@ -2340,7 +2340,7 @@ function extractMain(sessionsDir) {
|
|
|
2340
2340
|
});
|
|
2341
2341
|
|
|
2342
2342
|
fs.writeFileSync(path.join(outputDir, 'antigen_review.md'), reviewLines.join(''));
|
|
2343
|
-
console.log('Output: .opencode/friction/antigen_review.md\n');
|
|
2343
|
+
console.log('Output: .opencode/remember/friction/antigen_review.md\n');
|
|
2344
2344
|
|
|
2345
2345
|
return 0;
|
|
2346
2346
|
}
|
|
@@ -2358,7 +2358,7 @@ Usage:
|
|
|
2358
2358
|
node friction.js <sessions-directory>
|
|
2359
2359
|
node friction.js ~/.claude/projects/-home-hamr-PycharmProjects-liteagents/
|
|
2360
2360
|
|
|
2361
|
-
Outputs (all in .opencode/friction/):
|
|
2361
|
+
Outputs (all in .opencode/remember/friction/):
|
|
2362
2362
|
friction_analysis.json - Per-session analysis
|
|
2363
2363
|
friction_summary.json - Aggregate stats
|
|
2364
2364
|
friction_raw.jsonl - Raw signals
|
|
@@ -2385,7 +2385,7 @@ Outputs (all in .opencode/friction/):
|
|
|
2385
2385
|
analyzeMain(sessionsDir);
|
|
2386
2386
|
|
|
2387
2387
|
// Check if analysis produced output
|
|
2388
|
-
const analysisFile = '.opencode/friction/friction_analysis.json';
|
|
2388
|
+
const analysisFile = '.opencode/remember/friction/friction_analysis.json';
|
|
2389
2389
|
if (!fs.existsSync(analysisFile)) {
|
|
2390
2390
|
console.log('\nNo analysis output. Check session directory.');
|
|
2391
2391
|
return 1;
|
|
@@ -2401,7 +2401,7 @@ Outputs (all in .opencode/friction/):
|
|
|
2401
2401
|
console.log(' DONE');
|
|
2402
2402
|
console.log('='.repeat(60));
|
|
2403
2403
|
|
|
2404
|
-
const reviewFile = '.opencode/friction/antigen_review.md';
|
|
2404
|
+
const reviewFile = '.opencode/remember/friction/antigen_review.md';
|
|
2405
2405
|
if (fs.existsSync(reviewFile)) {
|
|
2406
2406
|
console.log('\nReview your antigens:');
|
|
2407
2407
|
console.log(` cat ${reviewFile}`);
|
|
@@ -10,10 +10,17 @@ Run friction analysis, then consolidate session stashes + friction antigens into
|
|
|
10
10
|
- Favor straightforward, minimal implementations first and add complexity only when requested or clearly required.
|
|
11
11
|
- Keep changes tightly scoped to the requested outcome.
|
|
12
12
|
- **Precision over recall for hot memory.** A false antigen loaded into `@MEMORY.md` steers every future session. When unsure, record as a low-confidence episode — do not promote.
|
|
13
|
+
- **Mid-tier model, not hardcoded.** Steps 2/3/4a delegate to a mid-tier model — capable of
|
|
14
|
+
semantic judgment, cheaper/faster than your top reasoning tier (e.g. Claude's Sonnet vs
|
|
15
|
+
Opus). Use whatever your tool designates as that balanced default; never hardcode a
|
|
16
|
+
vendor-specific model name.
|
|
17
|
+
- **Batch independent subagent calls.** Step 2's per-stash extractions are independent of
|
|
18
|
+
each other — spawn them concurrently (parallel/background subagent calls in one turn)
|
|
19
|
+
where your tool supports it, instead of processing stashes one at a time.
|
|
13
20
|
|
|
14
21
|
**What it does**
|
|
15
22
|
|
|
16
|
-
Reads all raw material (`.opencode/stash/*.md` + `.opencode/friction/antigen_clusters.json`), extracts durable facts, episodes, and behavioral antigens into a single `.opencode/
|
|
23
|
+
Reads all raw material (`.opencode/stash/*.md` + `.opencode/remember/friction/antigen_clusters.json`), extracts durable facts, episodes, and behavioral antigens into a single `.opencode/remember/MEMORY.md`, then injects a managed memory section into `AGENTS.md`.
|
|
17
24
|
|
|
18
25
|
**Steps**
|
|
19
26
|
|
|
@@ -23,7 +30,7 @@ Reads all raw material (`.opencode/stash/*.md` + `.opencode/friction/antigen_clu
|
|
|
23
30
|
project are behavioral lessons worth keeping everywhere. So point it at the tool's
|
|
24
31
|
**global sessions root** (all projects), not a per-project directory.
|
|
25
32
|
|
|
26
|
-
- **Locate `friction.js`** — it is bundled next to this command at `
|
|
33
|
+
- **Locate `friction.js`** — it is bundled next to this command at `remember/friction.js`
|
|
27
34
|
(the same directory as `remember.md`, whether installed or run from the package). If it
|
|
28
35
|
exists nowhere, skip to step 1 (stash-only) and tell the user friction.js is missing.
|
|
29
36
|
- **Resolve the global sessions root** — probe this list top-to-bottom, use the first that
|
|
@@ -41,7 +48,7 @@ Reads all raw material (`.opencode/stash/*.md` + `.opencode/friction/antigen_clu
|
|
|
41
48
|
> will resolve but yield no signals until friction learns their formats — open an issue
|
|
42
49
|
> to request one: https://github.com/hamr0/liteagents/issues
|
|
43
50
|
- **Run** `node <friction.js> "<resolved-root>"`. friction writes its output to
|
|
44
|
-
`.opencode/friction/` in the current project.
|
|
51
|
+
`.opencode/remember/friction/` in the current project.
|
|
45
52
|
- **On any miss — loud, never silent.** If no root resolves, or friction errors, or it
|
|
46
53
|
finds no usable sessions, print this and continue with stash-only consolidation:
|
|
47
54
|
> ⚠️ Friction didn't run — no sessions found. To enable it, open this command file
|
|
@@ -49,27 +56,41 @@ Reads all raw material (`.opencode/stash/*.md` + `.opencode/friction/antigen_clu
|
|
|
49
56
|
> list in step 0, then re-run `/remember`. Consolidating stashes only this time.
|
|
50
57
|
|
|
51
58
|
1. **Gather sources**
|
|
59
|
+
- **Legacy layout migration (one-time, loud).** Older versions used `.opencode/memory/` and
|
|
60
|
+
`.opencode/friction/`. If either exists: move the pipeline files
|
|
61
|
+
`.opencode/memory/{MEMORY.md,ledger.json,.processed}` → `.opencode/remember/`, and **discard**
|
|
62
|
+
the old `.opencode/friction/` contents entirely — friction regenerates all of its output
|
|
63
|
+
fresh every run (step 0 has already rebuilt it in `.opencode/remember/friction/` by the time
|
|
64
|
+
migration runs; stale copies carry no unique information and moving them would overwrite
|
|
65
|
+
fresh output). **Move only those pipeline files** — anything else in `.opencode/memory/`
|
|
66
|
+
(e.g. user-owned rule files) stays where it is. Remove the old dirs only if empty, update the managed MEMORY section in AGENTS.md to
|
|
67
|
+
the new reference (step 5), and tell the user exactly what moved.
|
|
68
|
+
- **Bootstrap `AGENT_RULES.md` (one-time, silent-if-present).** If
|
|
69
|
+
`.opencode/remember/AGENT_RULES.md` does not exist, copy it from the bundled template next
|
|
70
|
+
to this command (`remember/AGENT_RULES.md`, same directory as `friction.js`). If it
|
|
71
|
+
already exists, leave it untouched — never overwrite, even if the bundled template
|
|
72
|
+
changes in a later version; it becomes user-owned the moment it lands in the project.
|
|
52
73
|
- Read all `.opencode/stash/*.md` files in the current project
|
|
53
|
-
- Read friction output written in step 0: `.opencode/friction/antigen_clusters.json` (preferred) or `.opencode/friction/antigen_review.md` (fallback)
|
|
54
|
-
- Read existing `.opencode/
|
|
55
|
-
- Read processed manifest at `.opencode/
|
|
74
|
+
- Read friction output written in step 0: `.opencode/remember/friction/antigen_clusters.json` (preferred) or `.opencode/remember/friction/antigen_review.md` (fallback)
|
|
75
|
+
- Read existing `.opencode/remember/MEMORY.md` if it exists — create dir if missing
|
|
76
|
+
- Read processed manifest at `.opencode/remember/.processed` — skip already-processed stashes
|
|
56
77
|
- If no unprocessed stashes AND friction produced no new antigens, report "nothing to consolidate" and stop
|
|
57
78
|
|
|
58
|
-
2. **Extract from unprocessed stashes** (
|
|
59
|
-
- For each unprocessed stash, call
|
|
79
|
+
2. **Extract from unprocessed stashes** (spawn one subagent per stash, in parallel — see Guardrails)
|
|
80
|
+
- For each unprocessed stash, call the mid-tier model (see Guardrails) to extract:
|
|
60
81
|
- **FACTS** (atomic, one-line): stable preferences, decisions, corrections, explicit "remember this"
|
|
61
82
|
- **EPISODE** (3-5 bullet narrative): what was the goal, what was tried, outcome, lesson
|
|
62
83
|
- **SKIP**: code details, file paths, errors, mechanical steps, LLM responses
|
|
63
84
|
- Collect all new facts and episodes
|
|
64
85
|
|
|
65
86
|
3. **Merge into MEMORY.md**
|
|
66
|
-
- Read existing `.opencode/
|
|
67
|
-
- **Facts section**: call
|
|
87
|
+
- Read existing `.opencode/remember/MEMORY.md` and parse its sections (## Facts, ## Episodes, ## Antigens)
|
|
88
|
+
- **Facts section**: call the mid-tier model with existing facts + newly extracted facts
|
|
68
89
|
- Rules: new updates replace old, contradictions keep new version, duplicates dropped
|
|
69
90
|
- Keep facts atomic, one line each
|
|
70
91
|
- **Episodes section**: append new episode entries (append-only, timestamped, no dedup)
|
|
71
92
|
- **Antigens section**: only update from friction output (step 4)
|
|
72
|
-
- Write merged result to `.opencode/
|
|
93
|
+
- Write merged result to `.opencode/remember/MEMORY.md` in the format under step 6.
|
|
73
94
|
|
|
74
95
|
4. **Distill friction into antigens** (only if friction output exists)
|
|
75
96
|
|
|
@@ -83,9 +104,9 @@ Reads all raw material (`.opencode/stash/*.md` + `.opencode/friction/antigen_clu
|
|
|
83
104
|
> *themselves*). **You work from these short quotes — never re-read the session
|
|
84
105
|
> logs.** Friction's lexical grouping and flags are hints, not the verdict.
|
|
85
106
|
|
|
86
|
-
- Read `.opencode/friction/antigen_clusters.json`.
|
|
107
|
+
- Read `.opencode/remember/friction/antigen_clusters.json`.
|
|
87
108
|
- **4a. Classify target, then semantically consolidate** (the parts lexical matching can't do).
|
|
88
|
-
Call
|
|
109
|
+
Call the mid-tier model with the cluster quotes + their `preceding`/`projects`/`sessions`/`self_suspect`
|
|
89
110
|
(NOT the logs), and have it:
|
|
90
111
|
1. **Decide the target of each reaction — agent or self.** Drop *self/context*
|
|
91
112
|
corrections where the user redirected themselves ("wrong project", "wrong window",
|
|
@@ -114,21 +135,80 @@ Reads all raw material (`.opencode/stash/*.md` + `.opencode/friction/antigen_clu
|
|
|
114
135
|
- **High** (5+ sessions) → loaded hot via `@MEMORY.md`
|
|
115
136
|
- **Medium** (3-4 sessions) → recorded under Antigens, *not* loaded hot
|
|
116
137
|
- **Low** (<3 sessions) → keep as Episode only
|
|
138
|
+
- **Recurrence tiers bind everything, including LLM-merged groups:** merging consolidates
|
|
139
|
+
evidence, it never elevates it — a merged group's tier comes from its combined
|
|
140
|
+
distinct-session count (e.g. a 2-session merged group is still Low → Episode + ledger
|
|
141
|
+
`observing`, not an antigen entry in MEMORY.md).
|
|
117
142
|
- **Never auto-promote.** Only High-confidence (5+ sessions) antigens load hot. A
|
|
118
143
|
single dramatic correction is an Episode, not an antigen.
|
|
119
144
|
- Update the Antigens section in MEMORY.md (promote/demote based on new recurrence).
|
|
145
|
+
- **4c. Update the antigen ledger** (`.opencode/remember/ledger.json`) — the evidence trail
|
|
146
|
+
linking each rule to the mistake it targets and whether it is working. Create it as
|
|
147
|
+
`{"version": 1, "entries": []}` if missing. It is JSON for exact matching — bookkeeping
|
|
148
|
+
only, never injected into context as guidance (MEMORY.md is what gets read; the ledger
|
|
149
|
+
is what gets checked).
|
|
120
150
|
|
|
121
|
-
|
|
151
|
+
Entry shape:
|
|
152
|
+
```json
|
|
153
|
+
{ "id": "ag-001", "class": "claimed-done-not-verified",
|
|
154
|
+
"class_hints": ["says pushed but", "none got it"],
|
|
155
|
+
"status": "observing|hot|rejected|escalated",
|
|
156
|
+
"rule": "<current phrasing>",
|
|
157
|
+
"attempts": [{ "n": 1, "rule": "<phrasing>", "adopted": "YYYY-MM-DD", "outcome": "active|failed" }],
|
|
158
|
+
"evidence": { "sessions": 0, "projects": [], "quotes": [], "last_seen": "YYYY-MM-DD" },
|
|
159
|
+
"recurred_while_hot": 0,
|
|
160
|
+
"history": [{ "date": "YYYY-MM-DD", "event": "<transition>" }] }
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
For each surviving antigen from 4a/4b, match against existing entries by `class_hints`
|
|
164
|
+
(the mistake class, not the rule wording — rules change, the class doesn't):
|
|
165
|
+
- **No match** → new entry, `status: "observing"`, attempt 1, history "candidate (N sessions)".
|
|
166
|
+
- **Match, `observing`** → merge evidence (sessions, quotes, projects, last_seen).
|
|
167
|
+
Crosses the 4b hot threshold → `status: "hot"`, history "promoted to hot (N sessions)".
|
|
168
|
+
- **Match, `hot`** → the mistake happened *while its rule was loaded*:
|
|
169
|
+
`recurred_while_hot += 1`, merge evidence, history "recurred while hot (count)".
|
|
170
|
+
- At `recurred_while_hot >= 2`: the phrasing failed. Mark the current attempt
|
|
171
|
+
`outcome: "failed"`, draft attempt n+1 — it must differ from **every** prior
|
|
172
|
+
attempt's text in this entry (failed attempts are the rejected-edit buffer: never
|
|
173
|
+
re-propose one verbatim) — replace `rule`, update MEMORY.md's Antigens section,
|
|
174
|
+
reset `recurred_while_hot` to 0.
|
|
175
|
+
- If 2 attempts have already failed and the antigen persists → `status: "escalated"`:
|
|
176
|
+
remove the rule from MEMORY.md's hot section, record a Fact instead ("persistent
|
|
177
|
+
failure mode: <class> — no phrasing reduces it"), and flag it in the step-7 report.
|
|
178
|
+
**Flag, don't act** — the user decides: enforcement (a hook, where the tool has
|
|
179
|
+
them) or accepted limit.
|
|
180
|
+
- **Match, `escalated`/`rejected`** (rejected = user veto) → merge evidence only; never re-propose.
|
|
181
|
+
|
|
182
|
+
Consistency: MEMORY.md's Antigens section is the render; the ledger is the record —
|
|
183
|
+
after 4c every hot antigen in MEMORY.md has a matching `hot` ledger entry. Mutations
|
|
184
|
+
are append-friendly: merge evidence and change status, never delete entries or history
|
|
185
|
+
lines. If ledger.json is malformed, say so loudly, move it aside as
|
|
186
|
+
`ledger.json.bad-<date>`, and start fresh — never silently overwrite.
|
|
187
|
+
|
|
188
|
+
5. **Inject memory + rules references into AGENTS.md**
|
|
122
189
|
- Compose the section between `<!-- MEMORY:START -->` and `<!-- MEMORY:END -->` markers:
|
|
123
190
|
```
|
|
124
191
|
<!-- MEMORY:START -->
|
|
125
|
-
|
|
192
|
+
@.opencode/remember/MEMORY.md
|
|
126
193
|
<!-- MEMORY:END -->
|
|
127
194
|
```
|
|
128
|
-
- The
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
195
|
+
- The reference is an **explicit path** (`@.opencode/remember/MEMORY.md`) — `@`-references
|
|
196
|
+
resolve relative to the file containing them, so a bare `@MEMORY.md` in the project root
|
|
197
|
+
would point at a nonexistent root-level file. Claude loads the full file directly, so no
|
|
198
|
+
inline duplication is needed
|
|
199
|
+
- If `.opencode/remember/AGENT_RULES.md` exists (bootstrapped in step 1), compose a second,
|
|
200
|
+
independent section between `<!-- AGENT_RULES:START -->` and `<!-- AGENT_RULES:END -->`
|
|
201
|
+
markers:
|
|
202
|
+
```
|
|
203
|
+
<!-- AGENT_RULES:START -->
|
|
204
|
+
Consult when building something new or adding a feature — a standards guide, not hot
|
|
205
|
+
context like MEMORY.md above:
|
|
206
|
+
@.opencode/remember/AGENT_RULES.md
|
|
207
|
+
<!-- AGENT_RULES:END -->
|
|
208
|
+
```
|
|
209
|
+
- Each marker pair is independent: if AGENTS.md already has a given pair, replace the
|
|
210
|
+
section between them; if not, append it at the end; if no AGENTS.md exists, create one
|
|
211
|
+
containing whichever section(s) apply
|
|
132
212
|
|
|
133
213
|
```markdown
|
|
134
214
|
# Project Memory
|
|
@@ -153,19 +233,31 @@ Reads all raw material (`.opencode/stash/*.md` + `.opencode/friction/antigen_clu
|
|
|
153
233
|
```
|
|
154
234
|
|
|
155
235
|
6. **Update processed manifest**
|
|
156
|
-
- Append paths of newly processed stashes to `.opencode/
|
|
236
|
+
- Append paths of newly processed stashes to `.opencode/remember/.processed`
|
|
157
237
|
|
|
158
|
-
7. **Report to user**
|
|
238
|
+
7. **Report to user** — print it AND write the same content to `.opencode/remember/report.md`
|
|
239
|
+
(overwritten each run; the ledger keeps history — the report is just the latest snapshot)
|
|
159
240
|
- Number of stashes processed
|
|
160
241
|
- Facts count (total, new)
|
|
161
242
|
- Episodes count (total, new)
|
|
162
243
|
- Antigens count by confidence tier, with how many newly promoted to hot
|
|
244
|
+
- Ledger lines — one per non-observing entry: id, short rule, status, recurrences since
|
|
245
|
+
adoption. Highlight rephrased (RECURRED) and ESCALATED entries; escalations need a
|
|
246
|
+
user decision, e.g.:
|
|
247
|
+
```
|
|
248
|
+
ledger: ag-001 "verify live after publish" hot, 0 recurrences since 2026-07-10
|
|
249
|
+
ledger: ag-003 "don't commit per change" RECURRED while hot (2/2) → rephrased, attempt 2
|
|
250
|
+
ledger: ag-002 "literal scoped ask" ESCALATED → Fact; 2 phrasings failed. Hook or accept?
|
|
251
|
+
```
|
|
252
|
+
- If AGENT_RULES.md was bootstrapped this run, say so (one line)
|
|
163
253
|
- Confirm MEMORY.md and AGENTS.md updated
|
|
164
254
|
|
|
165
|
-
**File locations (all project-local)**
|
|
166
|
-
- Memory file: `.opencode/memory/MEMORY.md` (single source of truth, referenced as @MEMORY.md)
|
|
255
|
+
**File locations (all project-local — two dirs: `/stash` owns `.opencode/stash/`, `/remember` owns `.opencode/remember/`)**
|
|
167
256
|
- Stash files: `.opencode/stash/*.md`
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
257
|
+
- Memory file: `.opencode/remember/MEMORY.md` (single source of truth, referenced as `@.opencode/remember/MEMORY.md`)
|
|
258
|
+
- Rules template: `.opencode/remember/AGENT_RULES.md` (bootstrapped once from the bundled package template on first `/remember` run, never overwritten again — user-owned after that; referenced as `@.opencode/remember/AGENT_RULES.md`)
|
|
259
|
+
- Antigen ledger: `.opencode/remember/ledger.json` (per-rule evidence trail: class, status, attempts/rejected-buffer, recurrence-while-hot)
|
|
260
|
+
- Consolidation report: `.opencode/remember/report.md` (latest step-7 report, overwritten each run)
|
|
261
|
+
- Processed manifest: `.opencode/remember/.processed`
|
|
262
|
+
- Friction output (transient, regenerated each run): `.opencode/remember/friction/` — `antigen_clusters.json` (preferred input), `antigen_review.md` (fallback), plus raw analysis files
|
|
263
|
+
- Output: `AGENTS.md` (managed MEMORY section, plus an AGENT_RULES section once bootstrapped)
|
|
@@ -18,7 +18,7 @@ Save session context for compaction recovery or handoffs.
|
|
|
18
18
|
4. Creates stash file in `.opencode/stash/`
|
|
19
19
|
5. Enables context restoration after compaction
|
|
20
20
|
6. **Consolidation nudge** — after saving, count the unprocessed backlog:
|
|
21
|
-
`unprocessed = (files in .opencode/stash/*.md) − (entries in .opencode/
|
|
21
|
+
`unprocessed = (files in .opencode/stash/*.md) − (entries in .opencode/remember/.processed)`
|
|
22
22
|
(a missing `.processed` manifest means 0 processed). If `unprocessed >= 5`, end with one line:
|
|
23
23
|
> 📝 N stashes since last consolidation — run `/remember` to fold them into memory.
|
|
24
24
|
|
|
@@ -161,10 +161,17 @@ and wiring the memory into your agent config file.
|
|
|
161
161
|
stored; running `/remember` clears the backlog.
|
|
162
162
|
2. **`/remember`** - Runs friction analysis first (best-effort — scores sessions across *all* your
|
|
163
163
|
projects from the tool's global sessions root, clusters failures into antigens), then
|
|
164
|
-
consolidates stashes + antigens into `…/
|
|
164
|
+
consolidates stashes + antigens into `…/remember/MEMORY.md` and injects `@MEMORY.md` into the
|
|
165
165
|
**per-tool agent config — `CLAUDE.md` (Claude Code), `AGENTS.md` (Droid / OpenCode), or
|
|
166
166
|
`AGENT.md` (Ampcode)** — so every future session loads it. Each package writes to its own
|
|
167
|
-
tool's config file; the global probe list only governs which logs friction *reads*.
|
|
167
|
+
tool's config file; the global probe list only governs which logs friction *reads*. Per-stash
|
|
168
|
+
extraction runs as concurrent subagent calls on a mid-tier model — no vendor-specific model
|
|
169
|
+
name hardcoded, so it works with whatever your tool has configured.
|
|
170
|
+
3. **`AGENT_RULES.md` bootstrap** - On first `/remember` run, if `…/remember/AGENT_RULES.md`
|
|
171
|
+
doesn't exist, it's copied from a bundled standards-guide template — never overwritten again
|
|
172
|
+
after that, so local edits persist — and injected into the agent config via its own
|
|
173
|
+
independent marker pair. It's a guide to consult when building something new, separate from
|
|
174
|
+
the MEMORY.md hot-context block above.
|
|
168
175
|
|
|
169
176
|
**Result:** Project-local memory that accumulates across sessions — no external dependencies, no databases, just markdown.
|
|
170
177
|
|