Repository navigation
Conversation
Signed-off-by: Tee8z <tee8z@protonmail.com>
|
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: true
|
|
Independent review of 6282988, equivalent to the reviewed unpublished 99ab225e8 foundation: no blocking finding. Snapshot and terminal requests/approvals remain distinct typed capabilities. Approval binds the pending request, immutable scope, requester, expiry and current posting/delegation authority. Encrypted result receipts verify signer, recipient, scope, approval ID, expiration, ciphertext length and signed hash; AEAD also binds the approval/scope/requester. Keys and file bytes stay outside plaintext audit records, and download locations derive from the same-community ciphertext hash. The Git preflight bounds input, references, object count, declared/inflated bytes, delta base/result sizes, aggregate reconstruction and time before Git import. It refuses external prerequisites and replacement refs; documentation explicitly requires later Git integrity/inventory checks and bounded safe extraction. Full locally available history versus worktree-only exclusions matches the user's decision. This layer does not claim archive export or runtime behavior. Independently ran all four snapshot SDK tests successfully. A separate real-Git probe exercised delta-packed SHA-1 and SHA-256 bundles (24 objects, 8/14 deltas) and matched expanded object inventories exactly. The author's six production-guard mutations fail; restored tests pass. Worker-based publication preserves the reviewed source unchanged. Minimalism 9/10, elegance 9/10, correctness 9/10. Archive/transfer consumers, atomic acceptance claims, integration and human acceptance remain separate prerequisites. |
Add a distinct owner-approved snapshot capability so permission to open a terminal cannot silently authorize exporting a workspace. The SDK defines pending requests, owner approvals, metadata-only audit, encrypted result receipts, and a bounded Git-bundle preflight. This layer does not package, upload, extract, or expose a snapshot command; those consumers follow separately.
Snapshot mode uses existing stored kind 30624 with
snapshot:<session>:...coordinates and separate Pending/Grant types. Fresh XChaCha20-Poly1305 keys encrypt each blob; NIP-44 wraps its key, nonce, ciphertext hash, exact length and expiry only to the requester. Associated data binds the owner approval, sandbox scope and requester. Accepted audit events carry a unique attempt ID, and callers must persist/retry that exact signed event. The subsequent atomic-claim relay layer enforces single use.The preflight follows Git's bundle and pack specifications. It reads fixed-size zlib output and rejects excessive declared object/delta expansion before Git imports bytes. It also rejects external prerequisites, partial-clone capabilities, replacement refs, invalid compression and incomplete packs. The later archive consumer must validate actual Git integrity and shallow boundaries before restoration, enforce filesystem/work budgets, and scan the exact staged artifact.
Bounds: one-hour-or-shorter approval, 100 MiB ciphertext blob, 256 MiB source/expanded Git data, 200,000 Git objects, 50,000 source files/references and a 30-second pack preflight. Consumers can lower the expansion budget. They must check actual free space and explicit local work budgets; this layer does not claim to detect Kubernetes emptyDir quota.
The user chose full locally available scanned history. Historical versioned content stays in
git bundle --all HEAD, while the working-tree copy excludes private paths. Shallow-boundary metadata must preserve available history without implicit fetch/unshallow; unborn HEADs require explicit refusal until supported. No forge credential or clone is required for restoration. See NIP-SA.Validation: 289 core tests, 357 SDK tests and 2 integration tests pass; core/SDK all-target Clippy passes with warnings denied; formatting, diff checks and desktop/GPUI locked metadata checks pass. Six production mutations fail: terminal/snapshot capability mixing, signed hash omission, receipt-signature omission, expanded-byte budget removal, object-count cap removal and delta result-size omission. The regression covers a real local Git bundle, local-only branch and shallow-clone bundle. Independent review additionally verified real delta-packed SHA-1 and SHA-256 bundles (24 objects each, 8/14 deltas), with exact expanded-byte inventory matching Git.
Stack: gateway #154 → terminal SDK #159 → CLI #163 → worker #166 → this snapshot wire foundation. The subsequent atomic-claim and ACP server layers consume this foundation; packaging/extraction follows separately.
The diff is 988 changed lines against #166. Independent agent review found no blockers. The rebased feature diff is equivalent to the reviewed commit, excluding only index hashes and hunk positions; targeted protocol tests, Clippy, formatting and all three locked metadata checks pass again after the base move. Keep this PR in draft: runtime/CLI consumers and human testing remain pending. Full repository CI has known base issues tracked separately, and the parent task's local full CI is blocked by missing native Tauri GLib development libraries. No deployment, tunnel, broker, substrate exec or model request is introduced.