Skip to content

feat: source build system, CI pipeline, Containerfile#22

Closed
BcKmini wants to merge 1 commit into
mainfrom
feat/claw-code-build-system
Closed

feat: source build system, CI pipeline, Containerfile#22
BcKmini wants to merge 1 commit into
mainfrom
feat/claw-code-build-system

Conversation

@BcKmini

@BcKmini BcKmini commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Summary

Replaces binary-download install with a local source build, adds a full CI quality gate, and introduces a scripts/ utility folder.

  • install.sh rewritten: 7-step colored progress UI, builds binary from rust/ via cargo build --workspace, auto-clone when run via curl, --update flag, prerequisite checks, built-in troubleshooting guide
  • scripts/dogfood-build.sh: build with GIT_SHA provenance verification — fails loudly with full output if SHA mismatches
  • scripts/validate-agents.sh: lint all agent MD files (non-empty, required sections, no duplicate IDs)
  • scripts/fmt.sh: unified cargo fmt + ruff format runner with --check mode for CI
  • .github/workflows/ci.yml: PR gate — validate-agents → fmt → clippy → test → Windows smoke → dogfood build (Swatinem/rust-cache + cancel-in-progress)
  • Containerfile: Docker/Podman image for reproducible builds (rust:bookworm base)
  • Makefile: dogfood, container, validate, fmt-check targets

Closes #21

Test plan

  • bash install.sh --no-binary completes without error on macOS/Linux
  • bash scripts/validate-agents.sh passes for all existing agents
  • bash scripts/fmt.sh --check exits 0 (skips gracefully when no Rust workspace yet)
  • CI workflow triggers on push to feat/** and all jobs pass
  • make dogfood works once a rust/ workspace is present

🤖 Generated with Claude Code

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 컨테이너 환경 지원 추가 (Docker/Podman 기반 빌드 및 배포 가능)
  • 개선

    • 설치 프로세스 개선: 소스 코드에서 직접 빌드하는 방식으로 변경되어 최신 기능을 즉시 설치 가능
    • 에이전트 유효성 검증 강화로 설정 파일 무결성 보장
  • Chores

    • CI/CD 파이프라인 구성 (자동화된 테스트 및 검증 추가)
    • 빌드 및 포맷팅 자동화 스크립트 추가

- install.sh: full rewrite with step-by-step colored UI, source build,
  prereq checks, --update flag, auto-clone, troubleshooting guide
- scripts/dogfood-build.sh: provenance-checked build with GIT_SHA injection
- scripts/validate-agents.sh: lint agent MD files
- scripts/fmt.sh: unified Rust + Python formatter
- .github/workflows/ci.yml: PR gate with fmt, clippy, test, Windows smoke
- Containerfile: Docker/Podman image for reproducible source builds
- Makefile: dogfood, container, validate, fmt-check targets

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

install.sh를 배포 아카이브 다운로드 방식에서 소스 클론+빌드 방식으로 전면 재작성하고, 에이전트 MD 검증(validate-agents.sh), 통합 포맷(fmt.sh), 프로비넌스 빌드(dogfood-build.sh) 스크립트를 신규 추가했습니다. GitHub Actions CI 워크플로, Containerfile, Makefile 타겟도 함께 구성되었습니다.

Changes

소스 빌드 및 CI 파이프라인 구축

Layer / File(s) Summary
에이전트 MD 검증 스크립트
scripts/validate-agents.sh
agents/ 디렉터리의 NN-name.md 파일들을 순회하며 중복 번호, 빈 파일, H2 섹션 존재를 검사하고 --strict 플래그 시 경고를 실패로 처리합니다.
통합 포맷 스크립트
scripts/fmt.sh
--check 모드와 적용 모드 양쪽에서 cargo fmt(Rust)와 ruff format(Python)을 순차 실행하고 실패 카운트를 누적해 CI 종료 코드로 반영합니다.
도그푸드 빌드 및 프로비넌스 검증
scripts/dogfood-build.sh
빌드 시 GIT_SHA를 주입하고, 빌드된 바이너리의 version 출력에서 추출한 SHA를 HEAD rev-parse --short 값과 비교해 프로비넌스를 검증합니다.
install.sh 핵심 구조 재작성
install.sh (lines 3–190)
배너·도움말·트러블슈팅 출력 함수, 컬러 출력 셋업, 단계 카운터, 전역 변수, 인자 파싱(--release/--debug/--no-binary/--no-verify/--update), EXIT 트랩, OS 감지 및 네이티브 Windows 종료 처리가 재작성됩니다.
install.sh 설치 단계 구현
install.sh (lines 191–388)
사전 조건 검사, 리포지토리 클론/풀, Rust 워크스페이스 빌드 및 claude-tools 복사, agents/commands/tools 파일 복사, 검증 및 PATH 경고 출력으로 이루어진 설치 단계 전체를 구현합니다.
CI 워크플로, Containerfile, Makefile 타겟
.github/workflows/ci.yml, Containerfile, Makefile
CI에 validate-agents/fmt/clippy/test/windows-smoke/dogfood 잡을 추가하고, Containerfile로 컨테이너 릴리즈 빌드 파이프라인을 정의하며, Makefile에 fmt-check/dogfood/container/validate 타겟을 추가합니다.

Sequence Diagram(s)

sequenceDiagram
  participant User as 사용자
  participant InstallSH as install.sh
  participant Git as git clone/pull
  participant Cargo as cargo build
  participant FS as 파일시스템

  User->>InstallSH: bash install.sh [옵션]
  InstallSH->>InstallSH: OS 감지 및 전제조건 검사
  InstallSH->>Git: 로컬 리포 없으면 clone / --update면 pull
  Git-->>InstallSH: REPO_DIR 확정
  InstallSH->>Cargo: cargo build --workspace
  Cargo-->>InstallSH: target/<profile>/claude-tools
  InstallSH->>FS: claude-tools → BIN_DIR 복사
  InstallSH->>FS: agents/*.md, commands/*.md, tools/*.py 복사
  InstallSH->>InstallSH: 에이전트 존재 검증 + claude-tools --version
  InstallSH-->>User: 완료 메시지 + PATH 미포함 경고
Loading
sequenceDiagram
  participant Push as git push
  participant CI as GitHub Actions
  participant DogfoodSH as dogfood-build.sh
  participant Binary as claude-tools binary
  participant ValidateSH as validate-agents.sh

  Push->>CI: 워크플로 트리거
  CI->>CI: validate-agents / fmt / clippy / test (병렬)
  CI->>DogfoodSH: dogfood 잡 실행 (fmt+clippy+test 완료 후)
  DogfoodSH->>Binary: cargo build + GIT_SHA 주입
  Binary-->>DogfoodSH: sha:<SHA> 보고
  DogfoodSH->>DogfoodSH: HEAD SHA와 비교 검증
  DogfoodSH->>ValidateSH: validate-agents.sh (빌드 산출물 기준)
  ValidateSH-->>CI: 검증 결과
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐇 토끼가 코드를 심었어요,
소스에서 자라는 바이너리!
cargo build로 SHA를 새기고,
CI가 꼼꼼히 지켜봐요 🔍
에이전트 파일도 통과! ✅
이제 설치는 투명하게~
🌿 출처가 있는 세상, 만세!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 PR의 주요 변경사항인 소스 빌드 시스템, CI 파이프라인, Containerfile 추가를 명확하게 요약하고 있습니다.
Linked Issues check ✅ Passed PR은 Issue #21의 모든 주요 요구사항을 충족합니다: install.sh 재작성, dogfood-build.sh/validate-agents.sh/fmt.sh 추가, CI 파이프라인 구현, Containerfile 추가, Makefile 업데이트.
Out of Scope Changes check ✅ Passed 모든 변경사항이 Issue #21의 소스 빌드 시스템과 CI 파이프라인 구현에 직접적으로 관련되어 있으며, 범위를 벗어난 변경은 없습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/claw-code-build-system

Comment @coderabbitai help to get the list of available commands and usage tips.

@BcKmini BcKmini changed the title feat: claw-code style build system — source build, CI pipeline, Containerfile feat: source build system, CI pipeline, Containerfile Jun 18, 2026
@BcKmini BcKmini closed this Jun 18, 2026
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.

feat: Upgrade build system — source build, CI pipeline, Containerfile

1 participant