Compare commits

..

1 commit

Author SHA1 Message Date
Agent
89fd7742e8 fix: feat: generic journal aspect — post-session reflection + lessons-learned context injection (#97)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-01 09:21:02 +00:00
3 changed files with 8 additions and 12 deletions

View file

@ -299,6 +299,12 @@ else
done
fi
# Track files changed for journal entry (will be populated after agent work)
FILES_CHANGED=""
if [ -n "$REMOTE_SHA" ]; then
FILES_CHANGED=$(git -C "$WORKTREE" diff "${FORGE_REMOTE}/${PRIMARY_BRANCH}..HEAD" --name-only 2>/dev/null | tr '\n' ',' | sed 's/,$//') || true
fi
# =============================================================================
# BUILD PROMPT
# =============================================================================
@ -548,9 +554,6 @@ if [ "$rc" -eq 0 ]; then
log "PR #${PR_NUMBER} merged"
issue_close "$ISSUE"
# Capture files changed for journal entry (after agent work)
FILES_CHANGED=$(git -C "$WORKTREE" diff "${FORGE_REMOTE}/${PRIMARY_BRANCH}..HEAD" --name-only 2>/dev/null | tr '\n' ',' | sed 's/,$//') || FILES_CHANGED=""
# Write journal entry post-session (before cleanup)
profile_write_journal "$ISSUE" "$ISSUE_TITLE" "merged" "$FILES_CHANGED" || true
@ -568,9 +571,6 @@ else
log "PR walk failed: ${_PR_WALK_EXIT_REASON:-unknown}"
issue_block "$ISSUE" "${_PR_WALK_EXIT_REASON:-agent_failed}"
# Capture files changed for journal entry (after agent work)
FILES_CHANGED=$(git -C "$WORKTREE" diff "${FORGE_REMOTE}/${PRIMARY_BRANCH}..HEAD" --name-only 2>/dev/null | tr '\n' ',' | sed 's/,$//') || FILES_CHANGED=""
# Write journal entry post-session (before cleanup)
outcome="blocked_${_PR_WALK_EXIT_REASON:-agent_failed}"
profile_write_journal "$ISSUE" "$ISSUE_TITLE" "$outcome" "$FILES_CHANGED" || true

View file

@ -242,7 +242,7 @@ Write the complete, rewritten lessons-learned.md content below. No preamble, no
# Extract content from JSON response
local lessons_content
lessons_content=$(printf '%s' "$output" | jq -r '.result // empty' 2>/dev/null || echo "")
lessons_content=$(printf '%s' "$output" | jq -r '.choices?[0].message?.content // empty' 2>/dev/null || echo "")
if [ -z "$lessons_content" ]; then
log "profile: failed to digest journals"
@ -258,7 +258,6 @@ Write the complete, rewritten lessons-learned.md content below. No preamble, no
# Move digested journals to archive (if any were processed)
if [ -d "$journal_dir" ]; then
mkdir -p "${journal_dir}/archive"
local archived=0
for jf in "$journal_dir"/*.md; do
[ -f "$jf" ] || continue
@ -415,7 +414,7 @@ Write the journal entry below. Use markdown format."
# Extract content from JSON response
local journal_content
journal_content=$(printf '%s' "$output" | jq -r '.result // empty' 2>/dev/null || echo "")
journal_content=$(printf '%s' "$output" | jq -r '.choices?[0].message?.content // empty' 2>/dev/null || echo "")
if [ -z "$journal_content" ]; then
log "profile: failed to write journal entry"

View file

@ -120,8 +120,5 @@ export CLAUDE_MODEL="opus"
agent_run --worktree "$WORKTREE" "$PROMPT"
log "agent_run complete"
# Write journal entry post-session
profile_write_journal "planner-run" "Planner run $(date -u +%Y-%m-%d)" "complete" "" || true
rm -f "$SCRATCH_FILE"
log "--- Planner run done ---"