Skip to content

fix(cola-avatar-pack): degraded mode consistency and data integrity#22

Merged
0xFANGO merged 4 commits intomainfrom
fix/check-python-env
Apr 8, 2026
Merged

fix(cola-avatar-pack): degraded mode consistency and data integrity#22
0xFANGO merged 4 commits intomainfrom
fix/check-python-env

Conversation

@latentflux42
Copy link
Copy Markdown
Contributor

Summary

  • Strict output rules: add normal/degraded conditional branches (GIF vs PNG, profile_card vs base_image, completion text)
  • Phase 4 initial avatar.json: split into two templates — degraded omits avatar@2x and profile_card
  • Phase 7 files rebuild: only write files that pass test -f, preventing avatar.json from claiming non-existent files
  • Degraded curl commands: add test -s validation + auto-retry in Phase 4 and Phase 6
  • SKILL.md file checks: replace hardcoded .gif extension with avatar.json files field lookup (fixes dead loop in degraded mode)
  • SKILL.md terminology: "GIF 先行" → "表情先行", mode-agnostic wording throughout
  • Rarity fallback: default to common when python3 unavailable in degraded mode
  • Single-expression regen: add executable degraded path with curl example and avatar.json update rule
  • rembg label: "可选增强" → "可选依赖,效果显著优于 flood-fill"
  • Name regex: \s → literal space to reject tab/newline characters

Test plan

  • Normal mode full flow: prereq → Phase 1-7, verify avatar.json contains all files and all exist on disk
  • Degraded mode full flow: simulate python3 missing, verify .png output, no @2x, no profile_card in avatar.json
  • Partial failure: simulate curl failure for one expression in Phase 6, verify avatar.json omits the failed file
  • SKILL.md expression usage: verify file check reads from avatar.json in both normal and degraded mode
  • Single expression regen: test in both normal (process_avatar.py) and degraded (curl) mode
  • Name validation: confirm tab/newline rejected, spaces and CJK accepted

🤖 Generated with Claude Code

latentflux42 and others added 4 commits April 8, 2026 17:33
- Add base_image existence check before Phase 5 — redirect to full
  flow (Phase 1) if self-portrait was never generated
- Rewrite prerequisites with proper check chain: ColaOS env → python3
  → Pillow → rembg (optional). Each step lets Cola attempt installation
  and verifies before proceeding
- Add degraded mode for when python3/Pillow unavailable: skip
  process_avatar.py, save listenhub raw images as static PNGs
- Define degraded output contract: no GIF animation, no profile card,
  no dual sizes, adjusted user-facing copy and avatar.json schema

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…s, avatar.json, and curl handling

- Add normal/degraded conditional branches to strict output rules (GIF vs PNG, profile_card vs base_image)
- Split Phase 4 initial avatar.json into two templates — degraded omits avatar@2x and profile_card
- Phase 7 now rebuilds files field instead of appending, preventing stale keys
- Add test -s validation + retry to degraded curl commands in Phase 4 and Phase 6
- Relabel rembg from "可选增强" to "可选依赖" to reflect its actual importance

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…sed file checks, rarity fallback

- Add complete degraded single-expression regen steps with curl example and
  avatar.json update rule (was one-line summary)
- Replace hardcoded .gif terminology in SKILL.md with avatar.json-driven
  file lookup (prevents dead loop in degraded mode)
- Default rarity to 'common' when python3 unavailable in degraded mode

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…n name regex

- Phase 7 files rebuild now requires test -f before writing each key,
  preventing avatar.json from claiming files that failed to generate
- Name validation regex: \s → literal space to reject tab/newline chars

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@0xFANGO 0xFANGO merged commit e66fbf3 into main Apr 8, 2026
1 check passed
@latentflux42 latentflux42 deleted the fix/check-python-env branch April 16, 2026 09:21
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