feat(20f): journal digestion formula — condense old journals into lessons learned #89

Closed
opened 2026-04-01 06:32:43 +00:00 by dev-bot · 1 comment
Collaborator

Parent

Part of #20 — agent .profile repo.

What to do

Create a formula formulas/digest-journal.toml that condenses accumulated journal entries into abstract, transferable lessons.

Digestion formula

The formula receives an agent's .profile repo path and:

  1. Read all journal/issue-*.md files
  2. Read existing knowledge/lessons-learned.md (if any)
  3. Identify recurring patterns, common failures, successful strategies across journal entries
  4. Rewrite knowledge/lessons-learned.md with condensed lessons (not append — full rewrite each time)
  5. Archive digested journal files (move to journal/archive/)

Abstraction and size constraints

lessons-learned.md must be:

  • Hard capped at 2KB — the digestion formula must stay within this limit. If lessons exceed 2KB, the formula must prioritize and drop the least transferable ones.
  • Abstract, not specific — lessons should be patterns and heuristics, not references to specific issues or files. Good: "Always validate SOPS decryption output before sourcing — treat failures as fatal." Bad: "In issue #61 we found that lib/env.sh line 32 had an unsafe eval."
  • Transferable — a lesson should help with future work the agent has never seen, not just repeat past work. If a lesson only applies to one file or one situation, it is not worth keeping.

Gardener integration (trigger mechanism)

The gardener needs to know when to trigger digestion. Add to formulas/run-gardener.toml (as a new step or addition to an existing step):

  1. List all Forgejo users that have a .profile repo:
    for each user in admin/users:
      check if repos/<login>/.profile exists
      if yes, count files in journal/ (exclude archive/)
    
  2. If journal count > 10 for any agent, dispatch digestion:
    • Run formulas/digest-journal.toml with the agent's .profile repo as context
    • Or file an action issue that triggers digestion (if the gardener cannot run formulas directly)

Note on context injection

Reading lessons-learned.md into agent context at session start is handled by #97 (profile_load_lessons). This issue only covers writing and maintaining the file.

Affected files

  • formulas/digest-journal.toml (new)
  • formulas/run-gardener.toml (update — add journal accumulation check + trigger)
  • gardener/gardener-run.sh (may need update if trigger requires new context)

Acceptance criteria

  • Digestion formula produces knowledge/lessons-learned.md from journal entries
  • lessons-learned.md is hard capped at 2KB
  • Lessons are abstract and transferable (no specific issue numbers or file paths)
  • Full rewrite each digestion (not append)
  • Digested journals moved to journal/archive/
  • Gardener checks journal accumulation for all agents with .profile repos
  • Gardener triggers digestion when journal count > 10
  • CI green

Dependencies

Depends on #97 (generic journal aspect — journal entries must exist to digest).

## Parent Part of #20 — agent .profile repo. ## What to do Create a formula `formulas/digest-journal.toml` that condenses accumulated journal entries into abstract, transferable lessons. ### Digestion formula The formula receives an agent's .profile repo path and: 1. Read all `journal/issue-*.md` files 2. Read existing `knowledge/lessons-learned.md` (if any) 3. Identify recurring patterns, common failures, successful strategies across journal entries 4. **Rewrite** `knowledge/lessons-learned.md` with condensed lessons (not append — full rewrite each time) 5. Archive digested journal files (move to `journal/archive/`) ### Abstraction and size constraints `lessons-learned.md` must be: - **Hard capped at 2KB** — the digestion formula must stay within this limit. If lessons exceed 2KB, the formula must prioritize and drop the least transferable ones. - **Abstract, not specific** — lessons should be patterns and heuristics, not references to specific issues or files. Good: "Always validate SOPS decryption output before sourcing — treat failures as fatal." Bad: "In issue #61 we found that lib/env.sh line 32 had an unsafe eval." - **Transferable** — a lesson should help with future work the agent has never seen, not just repeat past work. If a lesson only applies to one file or one situation, it is not worth keeping. ### Gardener integration (trigger mechanism) The gardener needs to know when to trigger digestion. Add to `formulas/run-gardener.toml` (as a new step or addition to an existing step): 1. List all Forgejo users that have a `.profile` repo: ``` for each user in admin/users: check if repos/<login>/.profile exists if yes, count files in journal/ (exclude archive/) ``` 2. If journal count > 10 for any agent, dispatch digestion: - Run `formulas/digest-journal.toml` with the agent's .profile repo as context - Or file an action issue that triggers digestion (if the gardener cannot run formulas directly) ### Note on context injection Reading `lessons-learned.md` into agent context at session start is handled by #97 (`profile_load_lessons`). This issue only covers writing and maintaining the file. ## Affected files - `formulas/digest-journal.toml` (new) - `formulas/run-gardener.toml` (update — add journal accumulation check + trigger) - `gardener/gardener-run.sh` (may need update if trigger requires new context) ## Acceptance criteria - [ ] Digestion formula produces `knowledge/lessons-learned.md` from journal entries - [ ] lessons-learned.md is hard capped at 2KB - [ ] Lessons are abstract and transferable (no specific issue numbers or file paths) - [ ] Full rewrite each digestion (not append) - [ ] Digested journals moved to `journal/archive/` - [ ] Gardener checks journal accumulation for all agents with .profile repos - [ ] Gardener triggers digestion when journal count > 10 - [ ] CI green ## Dependencies Depends on #97 (generic journal aspect — journal entries must exist to digest).
dev-bot added the
backlog
label 2026-04-01 06:32:43 +00:00
Author
Collaborator

Absorbed into #97. Digestion now happens inline in profile_load_lessons() — before session start, if >10 journals accumulated, a claude -p one-shot digests them into lessons-learned.md. No separate formula, no gardener trigger, no out-of-band scheduling.

Absorbed into #97. Digestion now happens inline in `profile_load_lessons()` — before session start, if >10 journals accumulated, a `claude -p` one-shot digests them into lessons-learned.md. No separate formula, no gardener trigger, no out-of-band scheduling.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: johba/disinto#89
No description provided.