diff --git a/CHANGELOG.md b/CHANGELOG.md index b899b6dae5..dfbdcb2f84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,41 @@ # Changelog +## [1.5.1.1] - 2026-04-21 + +## **Live merge conflict markers were sitting in `/context-save` for two days. Gone now.** + +The v1.0.1.0 rename from `/checkpoint` to `/context-save` + `/context-restore` (#1064, 2026-04-19) landed with unresolved `<<<<<<<` / `=======` / `>>>>>>>` markers still in `context-save/SKILL.md.tmpl`. Git paused the merge, the human committed without resolving, nobody noticed because the markers render as prose text in the agent's prompt rather than breaking anything at runtime. Anyone running `/context-save` since then was feeding Claude a prompt with live Git conflict syntax in the middle of it. This fix deletes the markers and the stale duplicated "Resume flow" block, which already lives correctly in `context-restore/SKILL.md.tmpl` as "Restore flow". First PR from a new community contributor. + +### The numbers that matter + +Source: `git diff main..HEAD` on this branch, `git show 12260262` for the original rename commit. + +| Metric | Before | After | +|--------|--------|-------| +| Merge conflict marker lines in `context-save/SKILL.md.tmpl` | 3 | 0 | +| Dead duplicate content lines (the old "Resume flow" block) | 97 | 0 | +| Total lines removed (template + generated output) | — | 200 | +| Days the broken prompt lived in main | 2 | 0 | +| Net lines of behavior changed | — | 0 | + +Pure cleanup. No CLI flag, no new test, no runtime behavior change. Agents running `/context-save` get a prompt that no longer contains Git conflict syntax. That is the entire change. + +### What this means for gstack users + +If you used `/context-save` between 2026-04-19 and 2026-04-21, the skill still worked (markers rendered as text, Claude ignored them), but the prompt you were feeding the agent was uglier than it should have been. After `/gstack-upgrade`, the prompt is clean. Nothing else changes. If you want the flipside — loading a saved context in a fresh session — that lives in `/context-restore`, which was never affected by this conflict. + +### Itemized changes + +#### Fixed + +- **Removed unresolved Git merge-conflict markers** from `context-save/SKILL.md.tmpl` (lines 201-300 in the pre-fix file). The three marker lines (`<<<<<<< HEAD:checkpoint/SKILL.md.tmpl`, `=======`, `>>>>>>> origin/main:context-save/SKILL.md.tmpl`) are gone. +- **Deleted the stale duplicate "Resume flow" block** that the conflict was straddling. The same behavior is correctly implemented as "Restore flow" in `context-restore/SKILL.md.tmpl:59` — no functionality is lost. +- **Regenerated** `context-save/SKILL.md` for the claude host via `bun run gen:skill-docs` so the published skill matches the template. + +#### For contributors + +- This was caught while exploring a separate `/office-hours` pointer-file proposal, which was dropped after realizing the real bug was already sitting in main. If you're reading this to understand gstack first-PR surface area, the repo will happily surface live bugs to anyone who reads the templates carefully. Keep looking. + ## [1.5.1.0] - 2026-04-20 ## **Three visible bugs in v1.4.0.0 /make-pdf, all fixed.** diff --git a/VERSION b/VERSION index 50b4d2630a..09b3107949 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.1.0 +1.5.1.1 diff --git a/context-save/SKILL.md b/context-save/SKILL.md index 8a022652f8..b2b692141b 100644 --- a/context-save/SKILL.md +++ b/context-save/SKILL.md @@ -955,106 +955,6 @@ Restore later with /context-restore. --- -<<<<<<< HEAD:checkpoint/SKILL.md.tmpl -## Resume flow - -### Step 1: Find checkpoints - -```bash -eval "$(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null)" && mkdir -p ~/.gstack/projects/$SLUG -CHECKPOINT_DIR="$HOME/.gstack/projects/$SLUG/checkpoints" -if [ -d "$CHECKPOINT_DIR" ]; then - find "$CHECKPOINT_DIR" -maxdepth 1 -name "*.md" -type f 2>/dev/null | xargs ls -1t 2>/dev/null | head -20 -else - echo "NO_CHECKPOINTS" -fi -``` - -List checkpoints from **all branches** (checkpoint files contain the branch name -in their frontmatter, so all files in the directory are candidates). This enables -Conductor workspace handoff — a checkpoint saved on one branch can be resumed from -another. - -### Step 1.5: Check for WIP commit context (continuous checkpoint mode) - -If `CHECKPOINT_MODE` was `"continuous"` during prior work, the branch may have -`WIP:` commits with structured `[gstack-context]` blocks in their bodies. These -are a second recovery trail alongside the markdown checkpoint files. - -```bash -_BRANCH=$(git branch --show-current 2>/dev/null) -# Detect if this branch has any WIP commits against the nearest remote ancestor -_BASE=$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD origin/master 2>/dev/null) -if [ -n "$_BASE" ]; then - WIP_COMMITS=$(git log "$_BASE"..HEAD --grep="^WIP:" --format="%H" 2>/dev/null | head -20) - if [ -n "$WIP_COMMITS" ]; then - echo "WIP_COMMITS_FOUND" - # Extract [gstack-context] blocks from each WIP commit body - for SHA in $WIP_COMMITS; do - echo "--- commit $SHA ---" - git log -1 "$SHA" --format="%s%n%n%b" 2>/dev/null | \ - awk '/\[gstack-context\]/,/\[\/gstack-context\]/ { print }' - done - else - echo "NO_WIP_COMMITS" - fi -fi -``` - -If `WIP_COMMITS_FOUND`: Read the extracted `[gstack-context]` blocks. Each block -represents a logical unit of prior work with Decisions/Remaining/Tried/Skill. -Merge these with the markdown checkpoint file to reconstruct session state. The -git history shows the chronological arc; the markdown checkpoint shows the -intentional save points. Both matter. - -**Important:** Do NOT delete WIP commits during resume. They remain the recovery -trail until /ship squashes them into clean commits during PR creation. - -### Step 2: Load checkpoint - -If the user specified a checkpoint (by number, title fragment, or date), find the -matching file. Otherwise, load the **most recent** checkpoint. - -Read the checkpoint file and present a summary: - -``` -RESUMING CHECKPOINT -════════════════════════════════════════ -Title: {title} -Branch: {branch from checkpoint} -Saved: {timestamp, human-readable} -Duration: Last session was {formatted duration} (if available) -Status: {status} -════════════════════════════════════════ - -### Summary -{summary from checkpoint} - -### Remaining Work -{remaining work items from checkpoint} - -### Notes -{notes from checkpoint} -``` - -If the current branch differs from the checkpoint's branch, note this: -"This checkpoint was saved on branch `{branch}`. You are currently on -`{current branch}`. You may want to switch branches before continuing." - -### Step 3: Offer next steps - -After presenting the checkpoint, ask via AskUserQuestion: - -- A) Continue working on the remaining items -- B) Show the full checkpoint file -- C) Just needed the context, thanks - -If A, summarize the first remaining work item and suggest starting there. - ---- - -======= ->>>>>>> origin/main:context-save/SKILL.md.tmpl ## List flow ### Step 1: Gather saved contexts diff --git a/context-save/SKILL.md.tmpl b/context-save/SKILL.md.tmpl index 0854baf33b..8343873f09 100644 --- a/context-save/SKILL.md.tmpl +++ b/context-save/SKILL.md.tmpl @@ -198,106 +198,6 @@ Restore later with /context-restore. --- -<<<<<<< HEAD:checkpoint/SKILL.md.tmpl -## Resume flow - -### Step 1: Find checkpoints - -```bash -{{SLUG_SETUP}} -CHECKPOINT_DIR="$HOME/.gstack/projects/$SLUG/checkpoints" -if [ -d "$CHECKPOINT_DIR" ]; then - find "$CHECKPOINT_DIR" -maxdepth 1 -name "*.md" -type f 2>/dev/null | xargs ls -1t 2>/dev/null | head -20 -else - echo "NO_CHECKPOINTS" -fi -``` - -List checkpoints from **all branches** (checkpoint files contain the branch name -in their frontmatter, so all files in the directory are candidates). This enables -Conductor workspace handoff — a checkpoint saved on one branch can be resumed from -another. - -### Step 1.5: Check for WIP commit context (continuous checkpoint mode) - -If `CHECKPOINT_MODE` was `"continuous"` during prior work, the branch may have -`WIP:` commits with structured `[gstack-context]` blocks in their bodies. These -are a second recovery trail alongside the markdown checkpoint files. - -```bash -_BRANCH=$(git branch --show-current 2>/dev/null) -# Detect if this branch has any WIP commits against the nearest remote ancestor -_BASE=$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD origin/master 2>/dev/null) -if [ -n "$_BASE" ]; then - WIP_COMMITS=$(git log "$_BASE"..HEAD --grep="^WIP:" --format="%H" 2>/dev/null | head -20) - if [ -n "$WIP_COMMITS" ]; then - echo "WIP_COMMITS_FOUND" - # Extract [gstack-context] blocks from each WIP commit body - for SHA in $WIP_COMMITS; do - echo "--- commit $SHA ---" - git log -1 "$SHA" --format="%s%n%n%b" 2>/dev/null | \ - awk '/\[gstack-context\]/,/\[\/gstack-context\]/ { print }' - done - else - echo "NO_WIP_COMMITS" - fi -fi -``` - -If `WIP_COMMITS_FOUND`: Read the extracted `[gstack-context]` blocks. Each block -represents a logical unit of prior work with Decisions/Remaining/Tried/Skill. -Merge these with the markdown checkpoint file to reconstruct session state. The -git history shows the chronological arc; the markdown checkpoint shows the -intentional save points. Both matter. - -**Important:** Do NOT delete WIP commits during resume. They remain the recovery -trail until /ship squashes them into clean commits during PR creation. - -### Step 2: Load checkpoint - -If the user specified a checkpoint (by number, title fragment, or date), find the -matching file. Otherwise, load the **most recent** checkpoint. - -Read the checkpoint file and present a summary: - -``` -RESUMING CHECKPOINT -════════════════════════════════════════ -Title: {title} -Branch: {branch from checkpoint} -Saved: {timestamp, human-readable} -Duration: Last session was {formatted duration} (if available) -Status: {status} -════════════════════════════════════════ - -### Summary -{summary from checkpoint} - -### Remaining Work -{remaining work items from checkpoint} - -### Notes -{notes from checkpoint} -``` - -If the current branch differs from the checkpoint's branch, note this: -"This checkpoint was saved on branch `{branch}`. You are currently on -`{current branch}`. You may want to switch branches before continuing." - -### Step 3: Offer next steps - -After presenting the checkpoint, ask via AskUserQuestion: - -- A) Continue working on the remaining items -- B) Show the full checkpoint file -- C) Just needed the context, thanks - -If A, summarize the first remaining work item and suggest starting there. - ---- - -======= ->>>>>>> origin/main:context-save/SKILL.md.tmpl ## List flow ### Step 1: Gather saved contexts diff --git a/package.json b/package.json index 4103bb7ac3..b979813faa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gstack", - "version": "1.5.1.0", + "version": "1.5.1.1", "description": "Garry's Stack — Claude Code skills + fast headless browser. One repo, one install, entire AI engineering workflow.", "license": "MIT", "type": "module",