Skip to content

공식 경로 기반 온라인 자산 수집기 개선 — manifest/sha256/defer/report 추가#51

Merged
rad1092 merged 1 commit intomainfrom
codex/collect-python-assets-from-official-paths
Feb 15, 2026
Merged

공식 경로 기반 온라인 자산 수집기 개선 — manifest/sha256/defer/report 추가#51
rad1092 merged 1 commit intomainfrom
codex/collect-python-assets-from-official-paths

Conversation

@rad1092
Copy link
Copy Markdown
Owner

@rad1092 rad1092 commented Feb 15, 2026

Motivation

  • 온라인 자산(파이썬 휠, 모델, 런타임 파일)을 공식 경로에서만 안전하게 수집하고 수집 상태를 명확히 구분하기 위한 요구를 반영했습니다.
  • 수집된 항목에 대해 버전 고정과 무결성( SHA256 ) 정보를 기록해 오프라인 번들 및 설치 확률을 높이려는 목적입니다.
  • 네트워크 실패나 리디렉션 등으로 수집 불가 항목을 자동으로 보류(defer)해 후속 처리 목록으로 분리할 필요가 있었습니다.

Description

  • scripts/collect_online_assets.py를 전면 개편해 다음 기능을 추가했습니다: PyPI 휠은 name==version으로 고정하여 https://pypi.org/simple만 사용해 다운로드하고, 모델/런타임 자산은 official_base 검증(HTTPS, 동일 호스트, 경로 프리픽스) 통과 시에만 다운로드하도록 제한했습니다.
  • 수집 결과를 ManifestItem으로 표준화하고 각 파일에 대해 sha256 해시를 계산해 .online_assets/meta/collection_manifest.json에 기록하도록 했습니다.
  • 수집 상태를 collected / defer로 분류하고, installable, blocked_or_failed, defer 구분으로 집계한 리포트 .online_assets/meta/collection_report.json을 생성하도록 구현했습니다.
  • 수집 대상 스키마를 resources/online_sources.jsonwheelhouse, model_assets, runtime_assets 형태로 변경했으며 관련 문서 ONLINE_RESOURCE_COLLECTION.md를 정책(공식 경로 제한, manifest/sha256, defer/report) 기준으로 업데이트했습니다.
  • 핵심 정책 로직(공식 URL 검증 함수 _is_official_asset_url, 파일명에서 버전 추출 _extract_version_from_filename)에 대한 단위 테스트를 tests/test_collect_online_assets.py로 추가했습니다.

Testing

  • 단위 테스트: pytest -q tests/test_collect_online_assets.py을 실행해 통과했습니다 (2 passed).
  • 통합 테스트: pytest -q tests/test_cli.py tests/test_collect_online_assets.py을 실행해 통과했습니다 (14 passed total).
  • 동작 검증: python scripts/collect_online_assets.py를 실행해 매니페스트와 리포트 파일(.online_assets/meta/collection_manifest.json, .online_assets/meta/collection_report.json)이 생성됨을 확인했습니다.
  • 리포트 확인: 리포트 요약을 확인한 결과(python -c "import json;print(json.load(open('.online_assets/meta/collection_report.json'))['summary'])") 일부 항목이 네트워크 정책(403 등)으로 defer 처리되었음을 확인했습니다.

Codex Task

@rad1092 rad1092 merged commit 7dc9000 into main Feb 15, 2026
4 checks passed
@rad1092 rad1092 deleted the codex/collect-python-assets-from-official-paths branch February 15, 2026 07:29
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 578717723c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +122 to +126
if not added:
return [
ManifestItem(
category="wheelhouse",
name=pkg_name,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Mark existing wheel artifacts as collected

pip download can return success even when the destination already contains the required files (the CLI explicitly supports existing-path behavior via --exists-action), but this branch treats not added as defer; that makes reruns and overlap cases (e.g., a package already fetched as another package’s dependency) show up as blocked/failed despite installable wheels already being present, which corrupts the manifest/report status and summary counts.

Useful? React with 👍 / 👎.

status="defer",
detail=f"blocked: redirected to non-official URL ({final_url})",
)
out_path.write_bytes(resp.read())
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Stream asset bodies instead of reading them all at once

This call buffers the entire HTTP response in memory before writing it to disk, so downloading large model/runtime assets can spike memory to the full file size and fail the collector; chunked streaming to disk is needed for the new large-asset workflow introduced in this commit.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant