Commit aedeff5
authored
[ENG-175] Fix-attempt journal and learnings distillation (#301)
* Record conformance test fix attempts in a journal and distill on pass
The per-attempt create_conformance_test_memory call is gone; the client now
records every fix attempt itself in an append-only journal so the fixer
stops repeating failed attempts.
- New conformance_fix_journal.FixAttemptJournal: one JSONL file per tested
(module, frid) under .memory/conformance_test_journal/, holding the issue
before/after each attempt, the fixer's self-reported hypothesis/approach,
files changed and a normalized diff hash. A repeated diff is marked as a
duplicate of the earlier attempt.
- FixConformanceTest sends a compact journal digest with every
/fix_conformance_tests_issue call and stores the fix_attempt_summary the
server now returns as the third response element.
- New DistillConformanceTestMemory postprocessing action (first step after
all conformance tests pass) calls /distill_conformance_test_memory once,
stores the returned key-learnings memories and deletes the journals.
Failures are best-effort: journals are kept for the next distillation.
- Removed the per-attempt memory bookkeeping: previous_conformance_tests_
issue_* and code_diff_files fields, delete_unresolved_memory_files.
Requires the codeplain-api branch of the same name (MIN_CLIENT_VERSION 0.4.0).
* Journal the prepared issue from the fix response instead of truncating raw output
The journal previously kept a blind tail (8000 chars) of the raw script
output, which for verbose runners like Maven could cut away the actual
failure while keeping noise. The fix endpoint now returns the prepared
issue it built for the fix prompt (trimmed, and LLM-summarized or truncated
when oversized), and the journal records that instead:
- Raw script output is stored untruncated on disk (debugging fidelity;
it never travels in a payload).
- Each attempt records the prepared issue the fixer actually saw; the fix
digest now carries it per attempt (capped at 2000 chars) so the fixer can
see how the issue evolved across attempts.
- The distillation payload's initial_issue prefers the prepared form and
falls back to a tail-trimmed raw output.
- issue_after is gone: a failed run's output is simply the next attempt's
raw issue, so nothing was stored twice.
Pairs with the codeplain-api commit returning the prepared issue as the
fourth element of the /fix_conformance_tests_issue response.
* Exclude open attempts from the fix digest and stop cutting prepared issues
Two defects surfaced by a live render:
- The digest sent with a fix request included the entry just opened for the
attempt being made - an empty stub the fixer has no use for. Digests (and
the distillation payload) now include only attempts whose fix has been
recorded, which also drops dangling entries an interrupted render leaves
behind.
- The 2000-char per-attempt issue cap routinely tail-truncated the server's
prepared issues - including LLM summaries purpose-built for the prompt
(~5k chars). The digest and payload caps are unified into a single
8000-char excerpt cap, so the bounded prepared form travels whole and
only the rare oversized case is trimmed.
Also opens journal files with explicit utf-8 encoding.
* Share the conformance test memory store across all modules of a project
Memory was scoped per module (<build>/<module>/.memory), so in a multi-module
requires chain every module started with empty memory and relearned the same
stack-level lessons (Maven classifier issues, logging conflicts, ...) its
predecessors had already distilled.
The MemoryManager now uses a project-level store at <build>/.memory, shared
by every module: learnings distilled while rendering one module reach all
modules rendered after it, and fix journals live there too (which also
unifies the regression case where one module fixes another module's tests).
Lifecycle: decided once per invocation, at the first module render. A render
that starts from scratch wipes the store (mirroring the previous per-module
semantics); a resumed render (--render-from past the first functionality)
keeps it, including the fix attempt journals of the interrupted run.
* Move the memory store back into each module's folder and inherit it along the module chain
The conformance test memory (distilled learnings and fix attempt journals) now lives in
<build>/<module>/.memory, next to .codeplain, code and tests. To keep learnings shared across
modules, PrepareRepositories copies the previous module's conformance_test_memory into the new
module's store on a fresh render - the same way the code repo is cloned from it. Journals do not
travel; they are transient state of one module's render.
The lifecycle needs no special handling anymore: the fresh-render wipe of the module folder
removes stale memory, and a resumed render keeps memories and journals untouched.1 parent f3a1344 commit aedeff5
14 files changed
Lines changed: 824 additions & 164 deletions
File tree
- render_machine
- actions
- tests
- tui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
| 266 | + | |
272 | 267 | | |
273 | 268 | | |
274 | | - | |
| 269 | + | |
275 | 270 | | |
276 | 271 | | |
277 | 272 | | |
| |||
282 | 277 | | |
283 | 278 | | |
284 | 279 | | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
| 280 | + | |
291 | 281 | | |
292 | 282 | | |
293 | 283 | | |
| |||
381 | 371 | | |
382 | 372 | | |
383 | 373 | | |
| 374 | + | |
384 | 375 | | |
385 | 376 | | |
386 | 377 | | |
| |||
403 | 394 | | |
404 | 395 | | |
405 | 396 | | |
| 397 | + | |
406 | 398 | | |
407 | 399 | | |
408 | 400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
0 commit comments