[verified] docs: harden Gitea access and release contracts

This commit is contained in:
2026-09-30 16:39:33 +09:00
parent c05b4226bf
commit c50440b81b
8 changed files with 191 additions and 61 deletions
@@ -1,7 +1,7 @@
---
name: gitea-repository-cache-bootstrap
description: 새 Gitea repository cache를 안전하게 초기화한다.
version: 0.1.0
version: 0.2.0
author: genichin, Hermes Agent
license: MIT
platforms: [linux]
@@ -13,11 +13,11 @@ metadata:
# Gitea Repository Cache Bootstrap
새 Gitea repository cache를 생성하거나 기존 cache가 초기화됐는지 검증한다. 모든 경로, lock, Git 및 credential 규칙은 [Repository cache 운영 지침](../../../../operations/repository-cache.md)만 정본으로 사용하며 이 스킬에 복제하거나 완화하지 않는다.
새 Gitea repository cache를 생성하거나 기존 cache가 초기화됐는지 검증한다. Gitea 인증과 readback은 [Gitea authenticated access 운영 지침](../../../../operations/gitea-access.md), 모든 경로, lock과 Git 규칙은 [Repository cache 운영 지침](../../../../operations/repository-cache.md)만 정본으로 사용하며 이 스킬에 복제하거나 완화하지 않는다.
## 사용 시점
- `/opt/data/gitea-agent/repositories/<owner>/<repository>/repository.git`이 없을 때
- canonical 문서에서 계산한 `<harness-root>/repositories/<owner>/<repository>/repository.git`이 없을 때
- 정확한 `owner/repository`의 cache 초기화를 요청받았을 때
- 기존 cache가 해당 Gitea repository의 유효한 bare mirror인지 확인할 때
@@ -25,9 +25,9 @@ Issue 본문 변경, comment 작성, checkout, worktree 생성 또는 source 수
## 절차
1. `read_file`로 linked canonical 문서 `operations/repository-cache.md`를 새로 읽는다.
1. `read_file`로 linked canonical 문서 `operations/repository-cache.md`를 새로 읽고 실제 문서 경로에서 `<harness-root>`와 repository cache root를 계산·검증한다.
2. 요청에서 exact `owner/repository`를 추출하고 canonical 지침의 identifier·path 검증을 수행한다.
3. Gitea MCP로 authenticated role, exact repository metadata, clone URL, default branch와 SHA를 읽는다.
3. Canonical authenticated Gitea API adapter로 role identity, exact repository metadata, clone URL, default branch와 SHA를 읽는다.
4. canonical bootstrap lock을 획득하고 target 상태를 다시 확인한다.
5. target이 없으면 canonical 신규 cache 초기화 절차를 그대로 수행한다. target이 있으면 삭제하거나 덮어쓰지 않고 canonical 기존 cache 검증 절차를 수행한다.
6. final target을 새로 읽어 path safety, bare 상태, remote identity, default branch와 SHA를 검증한다.