3.1 KiB
3.1 KiB
name, description, version, author, license, platforms, metadata
| name | description | version | author | license | platforms | metadata | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| gitea-repository-cache-bootstrap | 새 Gitea repository cache를 안전하게 초기화한다. | 0.2.0 | genichin, Hermes Agent | MIT |
|
|
Gitea Repository Cache Bootstrap
새 Gitea repository cache를 생성하거나 기존 cache가 초기화됐는지 검증한다. Gitea 인증과 readback은 Gitea authenticated access 운영 지침, 모든 경로, lock과 Git 규칙은 Repository cache 운영 지침만 정본으로 사용하며 이 스킬에 복제하거나 완화하지 않는다.
사용 시점
- canonical 문서에서 계산한
<harness-root>/repositories/<owner>/<repository>/repository.git이 없을 때 - 정확한
owner/repository의 cache 초기화를 요청받았을 때 - 기존 cache가 해당 Gitea repository의 유효한 bare mirror인지 확인할 때
Issue 본문 변경, comment 작성, checkout, worktree 생성 또는 source 수정에는 사용하지 않는다.
절차
read_file로 linked canonical 문서operations/repository-cache.md를 새로 읽고 실제 문서 경로에서<harness-root>와 repository cache root를 계산·검증한다.- 요청에서 exact
owner/repository를 추출하고 canonical 지침의 identifier·path 검증을 수행한다. - Canonical authenticated Gitea API adapter로 role identity, exact repository metadata, clone URL, default branch와 SHA를 읽는다.
- canonical bootstrap lock을 획득하고 target 상태를 다시 확인한다.
- target이 없으면 canonical 신규 cache 초기화 절차를 그대로 수행한다. target이 있으면 삭제하거나 덮어쓰지 않고 canonical 기존 cache 검증 절차를 수행한다.
- final target을 새로 읽어 path safety, bare 상태, remote identity, default branch와 SHA를 검증한다.
- credential helper와 현재 run의 staging이 남지 않았는지 확인하고 lock을 역순으로 해제한다.
- local 결과와 Gitea authoritative evidence를 분리해 보고한다.
실패 처리
- canonical 지침을 읽을 수 없거나 대상이 불명확하면 아무것도 생성하지 않는다.
- malformed, symlink, identity drift 또는 SHA drift 상태를 자동 수정하지 않는다.
- clone/fetch 결과가 불확실하면 completed로 보고하지 않는다.
- 현재 run 소유임을 증명할 수 없는 staging이나 target을 삭제하지 않는다.
- credential을 inherited environment나 다른 role에서 fallback하지 않는다.
검증
완료 전에 다음을 모두 확인한다.
- 현재 작업에서
operations/repository-cache.md를 읽었다. - Gitea identity와 exact repository metadata가 확인됐다.
- final
repository.git이 bare mirror다. - remote identity가 exact
owner/repository와 일치한다. - Gitea와 local default-branch SHA가 일치한다.
- final path의 유형, ownership과 permissions가 canonical 지침을 충족한다.
- staging, credential helper와 획득한 advisory lock이 남지 않았다.
- Gitea external write가 발생하지 않았다.