Skip to content

fix: skills-sync reports stale, not current, when the fetch failed - #79

Merged
fatherlinux merged 1 commit into
mainfrom
fix/skills-sync-stale-state
Nov 18, 2026
Merged

fatherlinux merged 1 commit into
mainfrom
fix/skills-sync-stale-state

Conversation

@fatherlinux

Copy link
Copy Markdown
Member

On dolza, every fetch of josui's skills checkout fails because the gateway answers 401. developer-skills-sync still compared HEAD with a local origin/main that no fetch had refreshed, and wrote state=current with fetched=0 for weeks (a268).

The fix: when this pass's clone or fetch fails and HEAD equals origin, the script now writes state=stale. drift_since works as it does for any other drift: it carries over from the last pass, or starts now. check_skills_sync.sh treats every state other than current as drift. A persistently failing fetch therefore WARNs after 1h and goes CRITICAL after 6h, with no change in nagios-agent. A single failed pass stays inside the 1h grace. A read-only checkout never fetches, so it is unchanged.

Tests in tests/test_skills_sync.py:

  • A failed fetch with HEAD == origin gives stale. drift_since stays stable across passes and fetched carries over.
  • Restoring the remote brings the next pass back to current, with drift_since=0 and a new fetched.
  • The old assertion that a failed fetch still read current is removed. It encoded the bug.

sdlc pytest: 149 passed. I skipped CodeQL locally on this 4 GB seat; CI runs it.

Seat rule: I'm not merging this myself. It's for Prime after review.

🤖 Generated with Claude Code

https://claude.ai/code/session_01R7Y1jgQzPHsAyyjYY7kKir

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gatehouse found no issues.

Full review.

2 finding(s) dropped: their evidence is not in the diff.

A checkout whose every fetch fails (dolza's josui gets a 401 from the
gateway) compared HEAD with a local origin/main no fetch had refreshed and
wrote state=current with fetched=0 for weeks (a268). When this pass's clone
or fetch failed, HEAD equal to origin now writes state=stale, aged from
drift_since, so check_skills_sync.sh warns after 1h and goes critical
after 6h with no change on the nagios side. A read-only checkout, which
never fetches, is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R7Y1jgQzPHsAyyjYY7kKir
@fatherlinux
fatherlinux force-pushed the fix/skills-sync-stale-state branch from 93f43cd to 6d7fad0 Compare November 18, 2026 02:59

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gatehouse found no issues.

Full review.

3 finding(s) dropped: their evidence is not in the diff.

@fatherlinux
fatherlinux merged commit 7be4d4e into main Nov 18, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant