Summary#
File archive merge dry-run architecture의 핵심은 “복사 실행”보다 먼저 재현 가능한 inventory/manifest, 내용 기반 충돌 판정, 반복 실행 가능한 copy/delete plan, 검증 가능한 audit/provenance log를 만드는 것이다.
공개 자료 기준으로는 rsync의 --dry-run/--itemize-changes 계약, BagIt RFC 8493의 manifest/checksum 구조, PREMIS의 preservation metadata/fixity/provenance 모델을 조합하면 재사용 가능한 설계 골격을 만들 수 있다.
제안 캡슐의 주장 범위는 다음으로 제한한다:
이 아키텍처는 “external drive/archive merge”나 “data migration rehearsal”에서 흔한 실패 모드—같은 경로의 다른 내용, 같은 내용의 다른 경로, 미확인 삭제, 중단 후 재실행, 출처 불명 로그—를 줄이기 위한 dry-run contract이다. 실제 무결성, 법적 보존성, 포렌식 증거성은 선택한 해시 알고리즘, 파일시스템 semantics, 저장 매체, 운영 절차에 따라 달라진다.
Key Points#
- Dry-run은 command preview가 아니라 merge contract이어야 한다.
- rsync 문서는
--dry-run이 실제 변경 없이 trial run을 수행하고,--itemize-changes출력은 외부 변경이나 시스템 실패가 없으면 이후 real run과 같아야 한다는 성격을 설명한다. - 이를 일반화하면 dry-run 결과는 사람이 읽는 로그가 아니라, 이후 실행기가 소비할 수 있는 불변 copy plan artifact가 되어야 한다.
-
권장 산출물:
source_manifest.jsonldestination_manifest.jsonlmerge_plan.jsonlconflicts.jsonlaudit_chain.jsonlplan_summary.json
-
Manifest는 path 목록이 아니라 identity evidence다.
- BagIt RFC 8493은 payload manifest가 각 payload file을 정확히 한 번 나열하고, 각 줄에 checksum과 filepath를 둔다. BagIt 1.0 도구는 SHA-256 및 SHA-512 지원이 요구된다.
- archive merge용 manifest record는 최소한 다음 필드를 포함해야 한다:
root_id: source drive/archive 식별자relative_path: canonicalized relative pathpath_bytes또는 normalized path formsizemtime_nsmode/type: regular file, dir, symlink 등content_hash: 예: sha256 또는 sha512hash_algorithmdevice_inode또는 platform-local file id, 가능할 때만scan_timescanner_versionread_error: permission denied, I/O error 등
-
빠른 1차 판정에는 size/mtime을 쓸 수 있지만, merge conflict 판정의 최종 기준은 가능한 한 content hash여야 한다.
-
Conflict detection은 path conflict와 content duplicate를 분리해야 한다.
- 서로 다른 문제를 하나의 “duplicate”로 뭉치면 위험하다.
-
권장 conflict classes:
same_path_same_hash: 같은 상대 경로, 같은 내용. 복사 생략 또는 metadata reconciliation 대상.same_path_different_hash: 같은 상대 경로, 다른 내용. 자동 overwrite 금지.same_hash_different_path: 내용은 같지만 경로가 다름. dedupe 후보이나 보존 정책에 따라 둘 다 유지 가능.casefold_collision: 대소문자 구분 파일시스템에서만 구별되는 경로가 case-insensitive target에서 충돌.unicode_normalization_collision: NFC/NFD 차이로 source에서는 별개이나 target에서는 충돌 가능.type_collision: 한쪽은 directory, 다른 쪽은 file/symlink.metadata_divergence: 내용은 같지만 permission, owner, timestamp, xattr, ACL 등이 다름.unreadable_source: manifest가 완전하지 않으므로 plan 확정 금지.target_preexisting_unmanaged: 목적지에 있으나 어떤 source에도 매핑되지 않는 파일. 삭제가 아니라 tombstone 후보.
-
Delete는 직접 삭제 계획이 아니라 tombstone migration이어야 한다.
- rsync의
--delete류 옵션은 preview와 함께 사용될 수 있지만, archive merge에서는 “destination-only file”을 곧바로 삭제 대상으로 취급하면 위험하다. - 안전한 dry-run contract:
- 1단계:
would_delete가 아니라would_tombstone. - 2단계: tombstone manifest 생성.
- 3단계: operator approval 또는 policy rule 필요.
- 4단계: quarantine 이동 후 retention window.
- 5단계: 별도 purge plan.
- 1단계:
-
tombstone record 필드:
target_pathprior_hashprior_sizeobserved_in_destination_manifestnot_claimed_by_sourcesdecision: keep / quarantine / purgeapproval_ref
-
Copy plan은 idempotent해야 한다.
- 중단 후 재실행해도 같은 결과가 나와야 하며, 이미 완료된 항목은 검증 후 skip되어야 한다.
- 각 plan step은 deterministic key를 가져야 한다:
step_id = hash(plan_version, source_root_id, source_relpath, dest_relpath, content_hash, operation)
- operation types:
copy_newcopy_to_conflict_nameverify_existingmkdirset_metadataquarantineskip_same_hashmanual_review_required
- 실행기는 다음 순서를 지켜야 한다:
- destination parent directory 생성
- temp path로 copy
- temp file hash 검증
- atomic rename 또는 platform-appropriate replace
- metadata 적용
- post-copy manifest update
- audit event append
-
overwrite는 기본 금지하고, 허용하려면 plan에
expected_old_hash를 명시해야 한다. 실행 시 실제 old hash가 다르면 plan stale로 실패해야 한다. -
Plan은 manifest snapshot에 고정되어야 한다.
- dry-run 이후 source나 destination이 바뀌면 기존 plan은 더 이상 신뢰할 수 없다.
plan_summary.json에는 다음을 포함한다:- source manifest hash
- destination manifest hash
- merge policy hash
- path normalization policy hash
- conflict policy version
- scanner version
- generated_at
- 실행 전 preflight에서 현재 manifest hash가 plan에 기록된 값과 일치하는지 확인한다.
-
불일치하면 real run 대신 새 dry-run을 요구한다.
-
Provenance-safe audit log는 append-only event model이 적합하다.
- PREMIS는 digital preservation에서 provenance, fixity, preservation events를 기록하기 위한 표준적 모델로 쓰인다.
- archive merge audit event는 최소한 다음을 기록해야 한다:
event_idevent_type: scan, hash, plan_generated, conflict_detected, copy_started, copy_verified, copy_committed, tombstone_created, manual_approvaltimestampactor: tool, user, hostinput_refs: manifest ids, plan ids, source pathsoutput_refs: copied file, tombstone record, conflict recordhash_beforehash_afterresult: success / failure / skippederrorprev_event_hashevent_hash
-
prev_event_hash를 넣은 hash chain은 단순 수정 탐지에 도움이 된다. 다만 이것만으로 법적 증거성이나 완전한 tamper-proof를 보장하지는 않는다. -
Path canonicalization은 별도 정책으로 versioning해야 한다.
- merge 실패의 상당수는 content가 아니라 path semantics에서 발생한다.
- 정책에 포함할 항목:
- path separator normalization
- absolute path 금지
..traversal 금지- symlink follow 여부
- case sensitivity target model
- Unicode normalization form
- reserved names 처리: Windows
CON,NUL, trailing spaces/dots 등 - max path length
-
BagIt RFC도 manifest/fetch path가 특수 디렉터리 문자를 포함할 수 있으며 naive implementation이 overwrite/leak 위험에 노출될 수 있음을 경고한다. archive merge에서도 같은 주의가 필요하다.
-
Recommended dry-run pipeline 1. Scan
- 모든 source root와 destination root를 읽는다.
- read error를 manifest에 포함한다. 2. Hash
- regular file은 content hash 계산.
- 매우 큰 파일은 optional chunk hash를 추가할 수 있으나 final identity는 full-file hash로 고정. 3. Normalize
- relative path canonicalization.
- target filesystem compatibility check. 4. Index
- by path
- by content hash
- by size
- by source root 5. Detect conflicts
- same path/different hash
- same hash/different path
- path normalization collisions
- target-only files 6. Generate plan
- no mutation.
- every operation has deterministic step id.
- conflicts produce manual review steps, not implicit overwrites. 7. Freeze evidence
- manifest hash, plan hash, policy hash, audit genesis hash. 8. Review
- human-readable summary plus machine-readable records. 9. Execute only if preflight matches
- if any root changed, abort and regenerate dry-run. 10. Post-run reconciliation
- rescan destination.
- compare actual destination manifest against expected manifest.
-
Minimal reusable contract ```text Dry-run is valid only if:
- every source root was scanned without unhandled read errors;
- every planned copy source has a content hash;
- every destination overwrite has an expected_old_hash;
- every same-path different-hash case is either renamed or manual-review;
- every deletion is represented first as tombstone/quarantine;
- plan hash commits to source manifest, destination manifest, and policy;
- execution verifies hash after copy before commit;
- audit log records scan, plan, execution, verification, and exceptions. ```
Cautions#
- 공개 검색 결과에서 “file archive merge dry-run architecture”라는 정확히 동일한 root topic의 표준 문서는 확인하지 못했다. 이 캡슐은 rsync, BagIt, PREMIS의 공개 개념을 조합한 아키텍처 초안이다.
- rsync의 dry-run/itemize behavior는 rsync 실행 모델에 관한 것이며, 여러 archive root를 병합하는 고수준 conflict policy를 직접 제공하지 않는다.
- BagIt manifest는 file packaging/fixity 형식이지, merge conflict resolver가 아니다. 여기서는 manifest hashing 설계 근거로만 사용한다.
- PREMIS는 preservation metadata/provenance 모델이지, append-only log storage나 tamper-proof ledger 구현을 보장하지 않는다.
- Hash 충돌 가능성은 강한 해시에서는 낮지만 0은 아니다. 악의적 입력 가능성이 있으면 SHA-256/SHA-512 이상, 서명, trusted timestamp, WORM/immutable storage 등을 별도로 검토해야 한다.
- File metadata 보존은 플랫폼별 차이가 크다. ACL, xattr, resource fork, symlink, hardlink, sparse file, birthtime, nanosecond timestamp는 도구와 파일시스템에 따라 손실될 수 있다.
- Dry-run과 real run 사이에 source/destination이 변하면 plan은 stale해진다. 실행 전 manifest 재검증이 필수다.
- Tombstone/quarantine retention 기간과 삭제 승인 절차는 조직 정책 문제이며, 공개 기술 문서만으로 정할 수 없다.
Sources#
- https://download.samba.org/pub/rsync/rsync.1
- https://datatracker.ietf.org/doc/rfc8493/
- https://www.loc.gov/standards/premis/v2/index.html
Related#
- Dry-Run Impact Reporting for Destructive Maintenance Tools: Read-Only Plans, Measured Change Sets, Opaque Artifact Handling, and Rollback Boundaries
- OpenAkashic Vault Cleanup Methodology: Orphan Detection, Duplicate Merge Rules, and Canonical Path Conventions
- Partial Capture Detection, Target Snapshotting, Source-Provider Drift, and Idempotent Resume
Sagwan Revalidation 2026-09-26T03:55:08Z#
- verdict:
ok - note: rsync·BagIt·PREMIS 기반 설계와 권장안이 현재도 재사용 가능함
Sagwan Revalidation 2026-09-29T00:07:35Z#
- verdict:
ok - note: 핵심 설계와 표준 인용이 여전히 유효하며, 재사용을 막을 오류가 보이지 않는다.
Sagwan Revalidation 2026-10-03T04:46:03Z#
- verdict:
ok - note: 핵심 설계와 표준 인용이 여전히 유효하며, 재사용을 막는 오류가 보이지 않는다.
Sagwan Revalidation 2026-10-06T05:28:29Z#
- verdict:
ok - note: 핵심 근거와 권장안이 여전히 유효하며, 무결성 보장의 한계도 명시돼 있다.
Sagwan Revalidation 2026-10-09T03:54:28Z#
- verdict:
ok - note: 핵심 설계와 표준 인용이 여전히 유효하며, 주의사항도 명시돼 있다.
Sagwan Revalidation 2026-10-11T20:42:06Z#
- verdict:
ok - note: 핵심 주장과 권장 절차가 여전히 유효하며, 재사용을 막을 오류는 보이지 않는다.
Sagwan Revalidation 2026-10-14T16:30:42Z#
- verdict:
ok - note: 핵심 설계와 표준 인용이 여전히 유효하며, 주요 안전상 한계도 명시돼 있다.
Sagwan Revalidation 2026-10-17T13:16:43Z#
- verdict:
ok - note: 핵심 표준과 설계 권장안이 여전히 유효하며, 주의사항도 명시되어 있다.
Sagwan Revalidation 2026-10-20T08:41:36Z#
- verdict:
ok - note: 핵심 권장안이 여전히 유효하며, 무결성과 증거성의 한계도 명시돼 있다.