fix(project): stage saves before atomic publication - #970
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueNote Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough프로젝트 저장 형식을 Changes프로젝트 형식과 IPC 계약
안전한 파일 영속성
Estimated code review effort: 5 (Critical) | ~120 minutes Merge Risk: 🟡 Moderate · up to A concurrent replacement during an existing-project save can cause another file to be deleted during rollback. Resolve the identity-safe cleanup path before merge. Sequence Diagram(s)sequenceDiagram
participant Renderer as Renderer
participant Tauri as Tauri 명령
participant Format as ProjectDocument 검증기
participant Persistence as project_persistence
participant FileSystem as 파일 시스템
participant Journal as 게시 저널
Renderer->>Tauri: save_project 또는 load_project 요청
Tauri->>Format: 프로젝트 문서 검증 또는 파싱
Format-->>Tauri: 검증된 ProjectDocument
Tauri->>Persistence: 저장·로드 요청
Persistence->>Journal: 기존 게시 상태 복구
alt 저장
Persistence->>FileSystem: stage 작성 및 동기화
Persistence->>Journal: prepared 저널 기록
Persistence->>FileSystem: 원자적 교체 또는 no-replace 게시
Persistence->>Journal: published 저널 정리
else 로드
Persistence->>FileSystem: no-follow 방식으로 읽기
FileSystem-->>Persistence: 제한된 UTF-8 내용
Persistence->>Format: 버전 문서와 소스 참조 검증
Format-->>Renderer: ProjectDocument 반환
end
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 77.98% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 168 functions across 24 files. (10 skipped: 10 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@opencode-agent Please perform the required independent review on exact current head |
Advances #962 on the existing Project Persistence owner. This remains the canonical storage/format/desktop-bridge dependency-root slice; descendants consolidate here without force-push or loss of unique tests/contracts.
Exact current identity
314ddeae7b775a4957594b599358c8255617eb2e.841e1c9b7329dba6d0ff16daecc009a2c3face0c(fix/audio-resource-policy-781).8893a9251c6b448a059e72d7b4d175b1956a47b8.841e1c... -> 8893a92...is nowahead,behind_by=0, with merge base exactly841e1c...; predecessor checks/reviews/approvals do not transfer.Ordinary Resource Admission adoption
Retargeting #970 onto #866 correctly exposed a dirty stack instead of treating the prerequisite as inherited GREEN. The overlap was repaired without force-push or destructive rebase:
7b2ade1370bda67e28372a090264abd708c5dc14moves desktop-core back to the canonicalsrc/root.rscrate root selected by fix(audio): establish canonical local-audio resource policy #866.ce81744e49f3f8ff56d848708f9b0232cbfce245integrates Project Persistenceproject_formatexports into that one crate root.548c46e9f3716229cda3c55318049939fa960760removes the duplicatecrate_root.rswrapper.2a27d308994f2b49af8e4f384eed21898ece4f18reconciles the five overlapping files. Resource Admission keeps the real app-owned audio materialization/publication/size+SHA-256 verification/native identity state; Project Persistence keeps staged crash-safe project publication/recovery and v3 document admission. The desktop bridge keeps fix(audio): establish canonical local-audio resource policy #866's encoded-byte policy and fix(project): stage saves before atomic publication #970's renderer error-redaction/project-document contract.8893a9251c6b448a059e72d7b4d175b1956a47b8is a non-force two-parent adoption commit with parents fix(project): stage saves before atomic publication #970 and exact fix(audio): establish canonical local-audio resource policy #866. Its tree starts from fix(audio): establish canonical local-audio resource policy #866 and overlays the reconciled Project Persistence delta, so fix(audio): establish canonical local-audio resource policy #866-only files/tests/contracts are not silently dropped.Project Persistence truth
Draft/unreleased format v3 retains
preferences.selectedPlaybackSource = full_mix | vocals | bass | drums | otherand an optional path-freesourceReferencewith a BandScope project id, fixed app-owned artifact name, admitted extension, bounded byte length and canonical lowercase SHA-256. No user filesystem path or revocable playback capability is durable project truth. Legacy/v1/v2 migration remains deterministic and never invents source evidence.Persisted
.bscopev3 input may contain asourceReference, but renderer IPC may not author one. Native RED37ea9a5a68a7c140d13689c552e61849ebe5a6c6/ fix01c09cf96b3e3eb71e57ec1f2193283af76a4149and renderer RED4ea8c2a69088682da581c8ca125626d077f0044a/ fix0268568eb56e33f5dafb26c98b10a61eab9e86b0keep that trust boundary fail closed.Resource Admission handoff now present in ancestry
#866 production code owns bounded local-audio staging, app-owned
source.<extension>publication, same-publication size+SHA-256 verification,LocalAudioPublicationIdentity, and native retention keyed by the BandScope-minted project id. #970 consumes that foundation rather than copying hashing or materialization logic.The next causal Project Persistence slice is no longer ancestry adoption. It is a native save adapter with an explicit ephemeral project-aggregate selector: renderer may identify the already-minted project aggregate for a Save action, but may not submit a path, digest, artifact name, byte count, or
sourceReference. Native code must look up the retained #866 identity for that project id and inject the typed v3sourceReferenceinside the native boundary immediately beforeproject_content_for_document. A globallast selected projectshortcut is not acceptable because multiple project aggregates can coexist.Restart then resolves only that app-owned artifact, re-establishes regular/no-link containment and bounded size/SHA-256 plus applicable decode/admission, reconstructs a fresh bootstrap, and only then lets #1160 resolve persisted
selectedPlaybackSourceagainst fresh stem availability. A missing preferred stem fails closed to Full mix.Existing Project Persistence controls
The branch retains staged/synchronized 5 MiB project publication and recovery, no-follow/final-component identity controls, Windows file-identity checks, replacement journals, migration fixtures, passive renderer record/accessor/trap admission, and Security Notes governance. Known residual work includes descriptor-bound parent authority, global startup recovery, autosave/known-good backup UX, downgrade/application-rollback policy, and exhaustive crash/kill/disk-full/power-loss fault injection.
Verification / merge gate
8893a925...is a new exact head. Fresh hosted workflows/check-runs must materialize and reach terminal success on this SHA before any GREEN claim. Keep Draft. Ready/merge additionally requires Windows/macOS persistence/build/security evidence, zero valid unresolved findings, qualifying independent non-author last-push approval, a satisfiable protected-context contract, the native source-reference save/reopen handoff where required for the advertised v3 source persistence, and an explicit downgrade/application-rollback decision. No self-approval, bypass, force-push, destructive rebase, gate weakening, finding suppression, or predecessor evidence transfer.