From fc7e9d3b890a14722c33a7a126c2f4ea34601406 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sat, 4 Apr 2026 22:10:19 -0700 Subject: [PATCH] feat: weekly activity index for cross-runtime diarization Timeline-log now writes completed events to weekly rollup files at ~/.gstack/activity/activity-YYYY-WNN.jsonl. Wintermute answering "what did I ship this week" reads one file, not 6 months of history. Only completed events go to the activity index (not started events). Old weeks are immutable. ls ~/.gstack/activity/ gives the full timeline. Co-Authored-By: Claude Opus 4.6 (1M context) --- bin/gstack-timeline-log | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/gstack-timeline-log b/bin/gstack-timeline-log index 0167a1d0..a129f03e 100755 --- a/bin/gstack-timeline-log +++ b/bin/gstack-timeline-log @@ -32,3 +32,14 @@ if ! printf '%s' "$INPUT" | bun -e "const j=JSON.parse(await Bun.stdin.text()); fi echo "$INPUT" >> "$GSTACK_HOME/projects/$SLUG/timeline.jsonl" + +# Activity index: write to weekly rollup file for cross-runtime diarization +# Only log "completed" events to the activity index (not "started") +EVENT_TYPE=$(printf '%s' "$INPUT" | bun -e "const j=JSON.parse(await Bun.stdin.text()); console.log(j.event||'')" 2>/dev/null) || true +if [ "$EVENT_TYPE" = "completed" ]; then + ACTIVITY_DIR="$GSTACK_HOME/activity" + mkdir -p "$ACTIVITY_DIR" + # ISO week number: YYYY-WNN + WEEK_FILE="$ACTIVITY_DIR/activity-$(date +%G-W%V).jsonl" + echo "$INPUT" >> "$WEEK_FILE" +fi