Skip to content

v0.3.0 - Safe thread archive repair

Latest

Choose a tag to compare

@cku3987 cku3987 released this 19 Aug 09:12
78cf75c

Highlights

  • Add thread-ID-based archive repair for an older active Codex thread that remains visible after the supported archive action fails.
  • Add scripts/repair_thread_archive.py, which runs read-only by default and requires both the resolved current thread ID and --apply before changing state.
  • Back up the active SQLite database, target rollout, global state, compatibility index, and config before repair.
  • Normalize legacy Windows \\?\ paths for filesystem access while preserving the database's stored path style.
  • Copy and hash the archived rollout before updating only rollout_path, archived, and archived_at for the selected thread.
  • Verify SQLite integrity and require app-level active-list, archived-list, and conversation-read checks before reporting success.
  • Update the skill routing, UI metadata, flow diagram, and English and Korean documentation.

Safety boundaries

The repair helper refuses to run when:

  • the target is the current thread;
  • the current thread ID was not supplied for an apply operation;
  • thread_source is not user;
  • more than one top-level state database contains the target;
  • the schema is unsupported;
  • the rollout is missing or outside sessions;
  • the archive destination has a different size or SHA-256.

Archive repair is not deletion. It preserves the conversation, leaves global UI state and compatibility indexes unchanged, and creates a recoverable backup before mutation.

Validation

  • 9 Windows regression tests passed, including the real-world recovery case where a matching archive copy already exists after an interrupted attempt.
  • Python compilation passed.
  • Codex quick_validate.py passed.
  • A live read-only check against the repaired thread returned already_archived and resolved its archived rollout.
  • SVG XML parsing and git diff --check passed.
  • All changed text files were verified as UTF-8 without BOM, CRLF only, with no replacement-character corruption.

Upgrade

Ask Codex to install or update the skill from:

$skill-installer Install the skill from https://github.com/cku3987/codex-local-cleanup-skill/tree/main/codex-local-cleanup

한국어 요약

공식 아카이브 기능이 실패한 뒤에도 활성 목록에 남아 있는 구형 세션을 ID로 지정해 안전하게 복구할 수 있습니다. 기본 실행은 읽기 전용이며, 실제 적용 전 현재 세션 제외 확인과 자동 백업을 수행합니다. 대상 세션 JSONL을 해시 검증한 뒤 아카이브로 옮기고 해당 스레드의 아카이브 필드만 갱신합니다. 현재 세션, subagent·automation, 다중 DB, 경로 이탈, 파일 불일치 사례는 자동으로 거부합니다.