Skip to content

Commit 86e93de

Browse files
committed
fix: deep audit fixes
- Fix evolve.sh comment (4h -> 12h), fallback BIRTH_DATE, journal fallback script - Fix RSS feed date format to RFC 2822 - All tests pass, go vet clean
1 parent afc415e commit 86e93de

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

scripts/build/build_site.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,22 @@ def main():
465465
def generate_rss(days, entries):
466466
"""Generate RSS feed from journal entries."""
467467
site_url = "https://graycodeai.github.io/iterate"
468-
gh = os.environ.get("GITHUB_REPOSITORY", "GrayCodeAI/iterate")
469468

470469
items = ""
471470
for entry in entries:
472471
title = html.escape(entry["title"])
473472
body = html.escape(entry["body"][:500])
474473
day = entry["day"]
475-
date_str = entry.get("date", datetime.now().strftime("%Y-%m-%d"))
474+
# Use RFC 2822 format for pubDate
475+
date_str = entry.get("date", "")
476+
if date_str:
477+
try:
478+
dt = datetime.strptime(date_str, "%Y-%m-%d")
479+
date_str = dt.strftime("%a, %d %b %Y 00:00:00 GMT")
480+
except ValueError:
481+
date_str = datetime.now().strftime("%a, %d %b %Y %H:%M:%S GMT")
482+
else:
483+
date_str = datetime.now().strftime("%a, %d %b %Y %H:%M:%S GMT")
476484

477485
items += f"""
478486
<item>
@@ -483,14 +491,15 @@ def generate_rss(days, entries):
483491
<pubDate>{date_str}</pubDate>
484492
</item>"""
485493

494+
last_build = datetime.utcnow().strftime("%a, %d %b %Y %H:%M:%S GMT")
486495
rss = f"""<?xml version="1.0" encoding="UTF-8"?>
487496
<rss version="2.0">
488497
<channel>
489498
<title>iterate — Self-Evolving Coding Agent</title>
490499
<link>{site_url}</link>
491500
<description>A coding agent that improves itself. Every session, documented.</description>
492501
<language>en</language>
493-
<lastBuildDate>{datetime.utcnow().strftime("%a, %d %b %Y %H:%M:%S GMT")}</lastBuildDate>
502+
<lastBuildDate>{last_build}</lastBuildDate>
494503
{items}
495504
</channel>
496505
</rss>

scripts/evolution/evolve.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e
33

44
# iterate evolution pipeline: plan → implement → communicate
55
# Autonomous evolution cycle — commits directly to main.
6-
# Runs every 4h via GitHub Actions.
6+
# Runs every 12h via GitHub Actions.
77

88
REPOPATH="."
99
LOG_FILE="${REPOPATH}/.iterate/evolution.log"
@@ -49,7 +49,7 @@ if [[ -z "${OPENCODE_API_KEY:-}" ]]; then
4949
fi
5050

5151
# ── Calculate day from BIRTH_DATE ──
52-
BIRTH_DATE=$(cat "${REPOPATH}/BIRTH_DATE" 2>/dev/null || echo "2026-03-23")
52+
BIRTH_DATE=$(cat "${REPOPATH}/BIRTH_DATE" 2>/dev/null || echo "2026-03-27")
5353
SESSION_TIME=$(date -u +'%H:%M')
5454
if date -d "$BIRTH_DATE" +%s &>/dev/null 2>&1; then
5555
DAY=$(( ($(date -u +%s) - $(date -d "$BIRTH_DATE" +%s)) / 86400 ))
@@ -143,20 +143,21 @@ if grep -q "^## Day $DAY" "${REPOPATH}/docs/JOURNAL.md" 2>/dev/null; then
143143
else
144144
log "WARNING: No journal entry found for Day $DAY — writing fallback"
145145
SESSION_TIME_NOW=$(date -u +'%H:%M')
146-
ENTRY="## Day $DAY$SESSION_TIME_NOW — Evolution session\n\nEvolution session completed.\n"
147-
# Insert after header
148-
python3 -c "
146+
# Insert fallback entry after header
147+
python3 << PYEOF
149148
import sys
150149
header = '# iterate Evolution Journal\n'
150+
day = "$DAY"
151+
time_now = "$SESSION_TIME_NOW"
152+
entry = f"## Day {day} — {time_now} — Evolution session\n\nEvolution session completed.\n"
151153
with open('docs/JOURNAL.md', 'r') as f:
152154
content = f.read()
153-
entry = sys.argv[1]
154155
if not content.startswith(header):
155156
content = header + '\n' + content
156157
rest = content[len(header):].lstrip('\n')
157158
with open('docs/JOURNAL.md', 'w') as f:
158159
f.write(header + '\n' + entry + '\n' + rest)
159-
" "$(echo -e "$ENTRY")"
160+
PYEOF
160161
git add docs/JOURNAL.md
161162
git commit -m "journal: Day $DAY fallback entry" 2>/dev/null || true
162163
fi

0 commit comments

Comments
 (0)