Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![크로스플랫폼 검증](https://github.com/dd3ok/codex-cleaner/actions/workflows/validate.yml/badge.svg)](https://github.com/dd3ok/codex-cleaner/actions/workflows/validate.yml)

Codex Storage Guard는 `codex-cleaner` 개인 스킬에서 안전한 읽기 전용 핵심만 남긴 도구입니다. `CODEX_HOME`을 내부 형식을 모르는 파일시스템 데이터로 측정하고, 공식 최상위 `codex doctor --json` 결과와 결합합니다. 비공개 Codex 데이터베이스나 rollout 형식을 해석하지 않으며 정리 기능도 포함하지 않습니다.
Codex Storage Guard는 `codex-cleaner` 개인 스킬에서 안전한 읽기 전용 핵심만 남긴 도구입니다. `CODEX_HOME`을 내부 형식을 모르는 파일시스템 데이터로 측정하고, 요청한 경우에만 공식 최상위 `codex doctor --json` 결과를 덧붙입니다. 비공개 Codex 데이터베이스나 rollout 형식을 해석하지 않으며 정리 기능도 포함하지 않습니다.

## 존재 이유

Expand All @@ -15,17 +15,17 @@ Codex Storage Guard는 `codex-cleaner` 개인 스킬에서 안전한 읽기 전
- 영역 이름을 하드코딩하지 않고 측정한 `CODEX_HOME` 직속 항목별 apparent bytes
- 탐색 중 확인한 가장 큰 파일
- 건너뛴 링크·mount·특수 파일·경합과 그 밖의 coverage 제한
- 인식 가능한 `codex doctor --json` 상태
- 명시적으로 요청했을 때 인식 가능한 `codex doctor --json` 상태
- `archive`, `delete`, `unarchive` 명령에 대한 3상태 capability probe
- archive와 delete 자동화를 차단하는 명시적 정책

결과는 실행 중 파일 메타데이터를 최선으로 관찰한 값입니다. 원자적 스냅샷, 실제 할당 디스크 용량, 회수 가능 용량 또는 시스템 전체 목록이 아닙니다. `CODEX_HOME` 밖에 설정된 실제 상태 루트는 탐색하지 않습니다.
결과는 실행 중 파일 메타데이터를 최선으로 관찰한 값입니다. 원자적 스냅샷, 실제 할당 디스크 용량, 회수 가능 용량 또는 시스템 전체 목록이 아닙니다. `CODEX_HOME` 밖에 설정된 실제 상태 루트는 탐색하지 않습니다. 설정의 `sqlite_home`이 `CODEX_SQLITE_HOME`보다 우선하며, `log_dir`도 외부 경로일 수 있습니다.

## Task lifecycle 경계

현재 안정 버전의 `archive`와 `delete`는 선택한 task의 하위 spawned task에도 영향을 줄 수 있지만, 같은 작업에 결박할 수 있는 영향 task 전체 미리보기는 안정 인터페이스에 없습니다. 따라서 이 스킬은 두 명령의 계획을 만들거나 실행하지 않습니다. 루트 task를 정확히 승인하거나 사용자가 위험을 수락해도 전체 영향 집합이 증명되지는 않습니다.

`unarchive`는 되돌릴 수 있지만 저장공간 정리가 아닙니다. 명시적으로 요청한 경우 공식 Codex task 인터페이스를 직접 사용합니다.
`unarchive`는 task 저장공간을 변경하며 정리 작업이 아닙니다. 이 스킬은 실행하지 않습니다. 명령이 존재하고 영구 삭제가 아니라는 사실만으로 동시성 안전성이 증명되지는 않습니다. 별도 요청은 설치 버전과 active writer 안전성을 확인한 뒤 공식 Codex task 인터페이스로만 처리합니다.

이 스킬은 원시 파일 삭제, 비공개 SQLite 스키마 검사, orphan 자산 분류, 로그 vacuum, 프로세스 종료, 프로젝트 캐시 정리 또는 플러그인 관리를 하지 않습니다.

Expand Down Expand Up @@ -58,17 +58,21 @@ Codex Storage Guard는 `codex-cleaner` 개인 스킬에서 안전한 읽기 전
git clone https://github.com/dd3ok/codex-cleaner.git
Set-Location .\codex-cleaner

$codexHome = if ($env:CODEX_HOME) {
$env:CODEX_HOME
$userHome = [Environment]::GetFolderPath('UserProfile')
$skillParent = Join-Path $userHome '.agents\skills'
$destination = Join-Path $skillParent 'codex-cleaner'
$legacy = if ($env:CODEX_HOME) {
Join-Path $env:CODEX_HOME 'skills\codex-cleaner'
} else {
Join-Path ([Environment]::GetFolderPath('UserProfile')) '.codex'
Join-Path $userHome '.codex\skills\codex-cleaner'
}
$skillParent = Join-Path $codexHome 'skills'
$destination = Join-Path $skillParent 'codex-cleaner'

if (Test-Path -LiteralPath $destination) {
throw "A codex-cleaner skill already exists at $destination. Review it before replacing it."
}
if (Test-Path -LiteralPath $legacy) {
throw "A legacy installation exists at $legacy. Move or remove it before installing to avoid duplicate skill names."
}

New-Item -ItemType Directory -Path $skillParent -Force | Out-Null
Copy-Item -LiteralPath '.\codex-cleaner' -Destination $destination -Recurse
Expand All @@ -90,7 +94,7 @@ $codex-cleaner로 Codex 저장공간을 읽기 전용으로 점검해줘.
python -I -B .\codex-cleaner\scripts\codex_storage_guard.py
```

기본값이 맞지 않을 때만 `--codex-home`, `--codex-executable`, `--top`을 사용합니다. 현재 인터페이스는 `--help`로 확인할 수 있습니다. 스크립트는 JSON assessment 하나를 표준 출력에 기록합니다.
기본값이 맞지 않을 때만 `--codex-home`, `--codex-executable`, `--top`을 사용합니다. 설치나 상태 진단까지 요청한 경우에만 `--doctor`를 추가합니다. doctor는 네트워크와 provider reachability 점검을 포함할 수 있습니다. 현재 인터페이스는 `--help`로 확인할 수 있습니다. 스크립트는 JSON assessment 하나를 표준 출력에 기록합니다. 설치된 Codex launcher를 안전하게 검증하지 못해도 불투명한 저장공간 측정은 계속하고 CLI adapter만 unavailable로 표시합니다.

## 검증

Expand Down
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![Cross-platform validation](https://github.com/dd3ok/codex-cleaner/actions/workflows/validate.yml/badge.svg)](https://github.com/dd3ok/codex-cleaner/actions/workflows/validate.yml)

Codex Storage Guard is the read-only core of the `codex-cleaner` personal skill. It measures `CODEX_HOME` as opaque filesystem data and combines that inventory with the supported top-level `codex doctor --json` result. It never parses private Codex databases or rollout formats and contains no cleanup primitive.
Codex Storage Guard is the read-only core of the `codex-cleaner` personal skill. It measures `CODEX_HOME` as opaque filesystem data and can optionally add the supported top-level `codex doctor --json` result. It never parses private Codex databases or rollout formats and contains no cleanup primitive.

## Why it exists

Expand All @@ -15,17 +15,17 @@ It reports:
- apparent bytes for every immediate child of `CODEX_HOME`, without hardcoded area names;
- the largest files observed during traversal;
- skipped links, mounts, special files, races, and other coverage limitations;
- recognized `codex doctor --json` status;
- recognized `codex doctor --json` status when explicitly requested;
- tri-state `archive`, `delete`, and `unarchive` command capability probes;
- an explicit policy that blocks archive and delete automation.

The inventory is live best-effort metadata, not an atomic snapshot, allocated-disk measurement, reclaimed-byte estimate, or system-wide inventory. Effective state roots outside `CODEX_HOME` are not traversed.
The inventory is live best-effort metadata, not an atomic snapshot, allocated-disk measurement, reclaimed-byte estimate, or system-wide inventory. Effective state roots outside `CODEX_HOME` are not traversed. Configured `sqlite_home` takes precedence over `CODEX_SQLITE_HOME`, and `log_dir` may also be external.

## Lifecycle boundary

Current stable `archive` and `delete` commands may also affect spawned descendants, while the stable command surface does not provide an affected-task preview that can be bound to the same operation. The skill therefore does not plan or run those commands. Exact root-task approval and user risk acceptance do not prove the complete impact set.

`unarchive` is reversible but is not storage cleanup. Use the official Codex task interface directly when it is explicitly requested.
`unarchive` changes task storage and is not cleanup. This skill does not run it. Command availability and reversibility do not prove concurrency safety; handle a separate unarchive request only through an official Codex task interface after checking the installed version and active-writer safety.

The skill does not delete raw files, inspect private SQLite schemas, classify orphan assets, vacuum logs, kill processes, clean project caches, or manage plugins.

Expand Down Expand Up @@ -58,17 +58,21 @@ Clone the repository and copy only the installable skill directory into your per
git clone https://github.com/dd3ok/codex-cleaner.git
Set-Location .\codex-cleaner

$codexHome = if ($env:CODEX_HOME) {
$env:CODEX_HOME
$userHome = [Environment]::GetFolderPath('UserProfile')
$skillParent = Join-Path $userHome '.agents\skills'
$destination = Join-Path $skillParent 'codex-cleaner'
$legacy = if ($env:CODEX_HOME) {
Join-Path $env:CODEX_HOME 'skills\codex-cleaner'
} else {
Join-Path ([Environment]::GetFolderPath('UserProfile')) '.codex'
Join-Path $userHome '.codex\skills\codex-cleaner'
}
$skillParent = Join-Path $codexHome 'skills'
$destination = Join-Path $skillParent 'codex-cleaner'

if (Test-Path -LiteralPath $destination) {
throw "A codex-cleaner skill already exists at $destination. Review it before replacing it."
}
if (Test-Path -LiteralPath $legacy) {
throw "A legacy installation exists at $legacy. Move or remove it before installing to avoid duplicate skill names."
}

New-Item -ItemType Directory -Path $skillParent -Force | Out-Null
Copy-Item -LiteralPath '.\codex-cleaner' -Destination $destination -Recurse
Expand All @@ -90,7 +94,7 @@ Or run the read-only script directly:
python -I -B .\codex-cleaner\scripts\codex_storage_guard.py
```

Use `--codex-home`, `--codex-executable`, or `--top` only when the defaults are not appropriate. Run `--help` for the current interface. The script emits one JSON assessment to standard output.
Use `--codex-home`, `--codex-executable`, or `--top` only when the defaults are not appropriate. Add `--doctor` only for broader installation or health diagnostics; doctor may include network and provider reachability checks. Run `--help` for the current interface. The script emits one JSON assessment to standard output. If the installed Codex launcher cannot be validated, the opaque inventory still succeeds and reports the CLI adapter as unavailable.

## Validation

Expand Down
13 changes: 8 additions & 5 deletions codex-cleaner/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Inspect Codex desktop and CLI storage without parsing private forma

# Codex Storage Guard

Measure Codex storage as opaque filesystem data and combine it with the supported top-level `codex doctor --json` result. Never turn an observation into deletion authority.
Measure Codex storage as opaque filesystem data. Optionally add the supported top-level `codex doctor --json` result when the user also requests installation or health diagnostics. Never turn an observation into deletion authority.

The read-only script is `scripts/codex_storage_guard.py`, relative to this file. Run `python <script> --help` for its current interface. Do not search the user's project for another copy.

Expand All @@ -16,18 +16,21 @@ The read-only script is `scripts/codex_storage_guard.py`, relative to this file.
- Never interpret or directly change Codex SQLite databases, rollout files, generated images, visualizations, attachments, caches, config, credentials, skills, plugins, or process state.
- Never use a path, filename, age, size, task title, or model judgment as deletion authority.
- Never claim an atomic snapshot, complete system-wide coverage, allocated disk usage, reclaimed bytes, or target-state verification.
- Treat official CLI discovery, doctor, and capability probes as advisory adapters. Preserve the opaque inventory when an adapter is unavailable or unrecognized.
- Do not create reports, plans, manifests, receipts, or retention schedulers by default.

## Inspect

Run the script once. It dynamically measures every immediate child of `CODEX_HOME`, skips links and nested mounts when observed, and does not hardcode Codex storage area names. Standard-library traversal is not race-free; report that limitation instead of claiming a link-proof snapshot.
Run the script once without `--doctor`. It dynamically measures every immediate child of `CODEX_HOME`, skips links and nested mounts when observed, and does not hardcode Codex storage area names. Standard-library traversal is not race-free; report that limitation instead of claiming a link-proof snapshot.

Add `--doctor` only when the user also requests Codex installation or health diagnostics. State that doctor is a broader redacted diagnostic that may perform network and provider reachability checks.

Summarize:

- total apparent bytes and the largest opaque areas;
- `coverage.completeWithinRoot` and every limitation;
- that coverage is limited to `CODEX_HOME` and excludes effective state roots configured elsewhere;
- doctor status/schema recognition and tri-state official task capability probes; treat `unknown` as unknown, not unsupported;
- that coverage is limited to `CODEX_HOME`; config `sqlite_home` takes precedence over `CODEX_SQLITE_HOME`, and `log_dir` may also be external;
- doctor status/schema recognition when requested and tri-state official task capability probes; treat `unknown` as unknown, not unsupported;
- that no returned record authorizes a lifecycle operation or raw-file deletion.

The capability list reports what the installed CLI exposes, not what this guard considers safe to automate.
Expand All @@ -43,7 +46,7 @@ For `archive` or `delete`:
- do not suggest protected UUIDs as an effective safeguard;
- re-evaluate only when an official stable interface can return the complete affected UUID set and conditionally apply that same set.

`unarchive` is reversible and is not storage cleanup. If the user explicitly requests it, use the official Codex task interface directly; this skill adds no wrapper.
`unarchive` is a storage mutation, not cleanup. Keep it outside this skill and do not run it. If the user asks separately, explain that command availability and reversibility do not prove concurrency safety; use only an official Codex task interface after its installed version and active-writer safety are independently established.

## Boundaries

Expand Down
Loading