Skip to content

fix(ci): registry monitor cold-start crash (empty latest.json)#15

Merged
Ap6pack merged 2 commits into
mainfrom
claude/fix-monitor-baseline
Jul 6, 2026
Merged

fix(ci): registry monitor cold-start crash (empty latest.json)#15
Ap6pack merged 2 commits into
mainfrom
claude/fix-monitor-baseline

Conversation

@Ap6pack

@Ap6pack Ap6pack commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Description

The first Registry Monitor run failed with JSONDecodeError: Expecting value: line 1 column 1 (char 0).

Cause: the "Restore snapshot baseline" step used git show …:latest.json > latest.json. The shell creates/truncates the redirect target before git show runs, so on a cold start (no registry-monitor data branch yet) it left an empty 0-byte latest.json, which SnapshotStore.load_latest() then tried to json.loads() → crash.

Fix: rm -f any stray baseline first, and guard with git cat-file -e before the redirect so latest.json is only written when it genuinely exists on the data branch. Cold start now correctly diffs against nothing.

The secret wiring is confirmed working — the run log showed MALWAR_ANTHROPIC_API_KEY: ***, so the LLM layer will engage once this lands.

Type of Change

  • Bug fix
  • Infrastructure / CI

Checklist

  • Workflow YAML validated
  • Isolated one-step change, no app/test code touched

🤖 Generated with Claude Code

https://claude.ai/code/session_01DNoTXU8k3pfSBzR7aJubqL


Generated by Claude Code

claude added 2 commits July 6, 2026 01:40
The first run crashed with JSONDecodeError: the restore step's '>' redirect
created an empty latest.json before 'git show' ran, and on a cold start (no
data branch yet) that 0-byte file reached SnapshotStore.load_latest().

Guard with 'git cat-file -e' *before* the redirect so the baseline file is
only written when it actually exists on the data branch, and 'rm -f' any
stray baseline first so an empty file can never reach the monitor.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DNoTXU8k3pfSBzR7aJubqL
The name 'registry-monitor' was already taken by an old feature branch
(full codebase copy) from the initial monitor development. Point the daily
sweep at a distinct 'registry-snapshots' branch instead so the snapshot
history is clean and doesn't pile on top of stale code.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DNoTXU8k3pfSBzR7aJubqL
@Ap6pack Ap6pack merged commit e7dfa3d into main Jul 6, 2026
5 checks passed
@Ap6pack Ap6pack deleted the claude/fix-monitor-baseline branch July 6, 2026 01:47
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.

2 participants