Compare commits
1 commit
89fd7742e8
...
ee99f185e6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee99f185e6 |
3 changed files with 12 additions and 8 deletions
|
|
@ -299,12 +299,6 @@ else
|
||||||
done
|
done
|
||||||
fi
|
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
|
# BUILD PROMPT
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
@ -554,6 +548,9 @@ if [ "$rc" -eq 0 ]; then
|
||||||
log "PR #${PR_NUMBER} merged"
|
log "PR #${PR_NUMBER} merged"
|
||||||
issue_close "$ISSUE"
|
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)
|
# Write journal entry post-session (before cleanup)
|
||||||
profile_write_journal "$ISSUE" "$ISSUE_TITLE" "merged" "$FILES_CHANGED" || true
|
profile_write_journal "$ISSUE" "$ISSUE_TITLE" "merged" "$FILES_CHANGED" || true
|
||||||
|
|
||||||
|
|
@ -571,6 +568,9 @@ else
|
||||||
log "PR walk failed: ${_PR_WALK_EXIT_REASON:-unknown}"
|
log "PR walk failed: ${_PR_WALK_EXIT_REASON:-unknown}"
|
||||||
issue_block "$ISSUE" "${_PR_WALK_EXIT_REASON:-agent_failed}"
|
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)
|
# Write journal entry post-session (before cleanup)
|
||||||
outcome="blocked_${_PR_WALK_EXIT_REASON:-agent_failed}"
|
outcome="blocked_${_PR_WALK_EXIT_REASON:-agent_failed}"
|
||||||
profile_write_journal "$ISSUE" "$ISSUE_TITLE" "$outcome" "$FILES_CHANGED" || true
|
profile_write_journal "$ISSUE" "$ISSUE_TITLE" "$outcome" "$FILES_CHANGED" || true
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,7 @@ Write the complete, rewritten lessons-learned.md content below. No preamble, no
|
||||||
|
|
||||||
# Extract content from JSON response
|
# Extract content from JSON response
|
||||||
local lessons_content
|
local lessons_content
|
||||||
lessons_content=$(printf '%s' "$output" | jq -r '.choices?[0].message?.content // empty' 2>/dev/null || echo "")
|
lessons_content=$(printf '%s' "$output" | jq -r '.result // empty' 2>/dev/null || echo "")
|
||||||
|
|
||||||
if [ -z "$lessons_content" ]; then
|
if [ -z "$lessons_content" ]; then
|
||||||
log "profile: failed to digest journals"
|
log "profile: failed to digest journals"
|
||||||
|
|
@ -258,6 +258,7 @@ Write the complete, rewritten lessons-learned.md content below. No preamble, no
|
||||||
|
|
||||||
# Move digested journals to archive (if any were processed)
|
# Move digested journals to archive (if any were processed)
|
||||||
if [ -d "$journal_dir" ]; then
|
if [ -d "$journal_dir" ]; then
|
||||||
|
mkdir -p "${journal_dir}/archive"
|
||||||
local archived=0
|
local archived=0
|
||||||
for jf in "$journal_dir"/*.md; do
|
for jf in "$journal_dir"/*.md; do
|
||||||
[ -f "$jf" ] || continue
|
[ -f "$jf" ] || continue
|
||||||
|
|
@ -414,7 +415,7 @@ Write the journal entry below. Use markdown format."
|
||||||
|
|
||||||
# Extract content from JSON response
|
# Extract content from JSON response
|
||||||
local journal_content
|
local journal_content
|
||||||
journal_content=$(printf '%s' "$output" | jq -r '.choices?[0].message?.content // empty' 2>/dev/null || echo "")
|
journal_content=$(printf '%s' "$output" | jq -r '.result // empty' 2>/dev/null || echo "")
|
||||||
|
|
||||||
if [ -z "$journal_content" ]; then
|
if [ -z "$journal_content" ]; then
|
||||||
log "profile: failed to write journal entry"
|
log "profile: failed to write journal entry"
|
||||||
|
|
|
||||||
|
|
@ -120,5 +120,8 @@ export CLAUDE_MODEL="opus"
|
||||||
agent_run --worktree "$WORKTREE" "$PROMPT"
|
agent_run --worktree "$WORKTREE" "$PROMPT"
|
||||||
log "agent_run complete"
|
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"
|
rm -f "$SCRATCH_FILE"
|
||||||
log "--- Planner run done ---"
|
log "--- Planner run done ---"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue