[verified] Gate mirror fetch on attached worktree topology
This commit is contained in:
@@ -153,10 +153,15 @@ python3 <harness-root>/harness/lib/managed_lock_broker.py probe \
|
||||
1. Issue workflow는 broker Issue lease를 유지한 채 같은 handle에 `acquire_repository`를 request한다. 별도 승인된 non-Issue workflow는 해당 workflow에 명시된 상위 lock과 repository lock 순서를 따른다.
|
||||
2. target과 `repository.git`의 path, ownership, permissions와 bare 상태를 다시 검증한다.
|
||||
3. `origin`의 canonical owner/repository identity가 요청과 일치하는지 확인한다. URL 문자열의 credential이나 transport hostname만으로 identity를 판정하지 않는다.
|
||||
4. 명시적으로 검증한 origin에서 mirror refs를 prune/fetch한다. 임의 remote 교체, force reset 또는 다른 repository 재사용은 금지한다.
|
||||
5. Gitea에서 default branch와 SHA를 다시 읽고 local ref와 일치하는지 확인한다.
|
||||
6. 일치한 exact SHA를 이번 작업의 pinned source revision으로 기록한다.
|
||||
7. Issue workflow는 같은 handle에 `release_repository`를 request한다. 별도 non-Issue workflow는 자신의 repository lock을 명시된 순서로 해제한다.
|
||||
4. 같은 repository lock을 유지한 상태에서 fetch 직전에 아래 read-only preflight를 실행하고 exit 0인 경우에만 다음 단계로 진행한다. `ADMITTED_GIT_DIR`은 위 path·bare·remote admission에서 확인한 exact canonical absolute `repository.git` 경로이며 helper의 PASS가 admission·인증·lock 소유 증명을 대신하지 않는다.
|
||||
```sh
|
||||
python3 -B "$HARNESS_ROOT/harness/lib/repository_prefetch.py" --git-dir "$ADMITTED_GIT_DIR"
|
||||
```
|
||||
Helper는 canonical harness의 `test_inventory_binding.py`에 있는 기존 fixed `/usr/bin/git`, no-symlink directory FD와 bounded reader를 재사용한다. `rev-parse --is-bare-repository`와 `worktree list --porcelain -z`만 조회하며 조회별 5초·64 MiB 출력 한도를 유지한다. Bare 자체의 record와 detached linked worktree는 attached branch로 오인하지 않는다. 등록된 linked worktree가 branch에 붙어 있으면 branch 이름 규칙과 무관하게 모든 exact branch·worktree path를 JSON `attached_worktrees`로 반환해 exit 1로 차단한다. 경로의 공백·개행은 NUL 구분으로 보존하고 JSON에서 escape한다. 조회 실패·malformed·지원하지 않는 결과는 안전한 reason code와 exit 2로 차단하며 Git stderr는 출력하지 않는다. Attached 상태의 자동 repair, detach·reset·worktree prune·ref 삭제·force fetch는 금지하고 운영자에게 해당 경로를 보고한다. 실패는 fetch를 승인하지 않으며 기존 lock/cleanup 계약대로 종료한다. Cooperative lock 아래의 pre-fetch 관찰이지 외부 프로세스의 무단 변경에 대한 sandbox나 원자적 fetch 보장이 아니다.
|
||||
5. Preflight PASS 뒤 명시적으로 검증한 origin에서 mirror refs를 prune/fetch한다. 임의 remote 교체, force reset 또는 다른 repository 재사용은 금지한다.
|
||||
6. Gitea에서 default branch와 SHA를 다시 읽고 local ref와 일치하는지 확인한다.
|
||||
7. 일치한 exact SHA를 이번 작업의 pinned source revision으로 기록한다.
|
||||
8. Issue workflow는 같은 handle에 `release_repository`를 request한다. 별도 non-Issue workflow는 자신의 repository lock을 명시된 순서로 해제한다.
|
||||
|
||||
## Issue worktree 모델
|
||||
|
||||
|
||||
Reference in New Issue
Block a user