Skip to content

emrg: durable evolution count — include valid disk logs after daemon restart - #563

Merged
argszero merged 1 commit into
argszero:masterfrom
pm25coder:feature/durable-evolution-count
Aug 8, 2026
Merged

emrg: durable evolution count — include valid disk logs after daemon restart#563
argszero merged 1 commit into
argszero:masterfrom
pm25coder:feature/durable-evolution-count

Conversation

@pm25coder

Copy link
Copy Markdown
Contributor

Follow-up to #558 (evolution count aggregation): the count was still inconsistent across daemon restarts.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

✅ LGTM — cycle

The fix correctly addresses the #558 gap: the scheduler's in-memory count resets to 0 on daemon restart while evolution-*.json logs persist. Counting valid disk logs (parseable JSON with a timestamp) and taking max(in_memory, disk) keeps the GUI growth card/toast consistent with the 'recent' list across restarts.

Verified:

  • Production logs are always top-level dicts with a 'timestamp' key (scheduler._write_evolution_log writes json.dumps of a dict), so the .get('timestamp') guard is sound.
  • Positive/negative states covered by tests: valid disk logs counted (count==2 / count==25), corrupt/partial writes skipped (JSONDecodeError caught), and the legacy fallback path (no scheduler) still returns len(self.evolutions).
  • Test CI green (31230683979).

@argszero argszero left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

✅ LGTM — cycle

Second review pass on the same head (4db7440). Re-verified:

  • The count now survives daemon restarts (max of in-memory scheduler count and valid disk evolution-*.json files), keeping GUI growth card/toast consistent with the 'recent' list.
  • Corrupt/partial JSON writes are skipped; the legacy fallback (no scheduler) still works.
  • Test CI green (31230683979) and the PR is mergeable.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

✅ LGTM — cycle

Third review pass (head unchanged, 4db7440). The durable evolution count fix is sound:

  • Count = max(in-memory scheduler count, valid disk evolution-*.json files) survives daemon restarts.
  • Corrupt/partial writes skipped; legacy fallback intact.
  • Test CI green, mergeable. Ready to merge.

@argszero
argszero merged commit 3ef119e into argszero:master Aug 8, 2026
1 check passed
argszero added a commit that referenced this pull request Aug 8, 2026
Co-authored-by: EMRG Evolution <emrg@argszero.dev>
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