diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ed50f4..d52b480 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,8 +12,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 + - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 with: node-version-file: .nvmrc cache: npm @@ -30,8 +30,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 + - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 with: node-version-file: .nvmrc cache: npm diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6f070ef..14b0656 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - uses: github/codeql-action/init@b7351df727350dca84cb9d725d57dcf5bc82ba26 # v3 with: languages: javascript-typescript diff --git a/.gitignore b/.gitignore index 59468b6..a41dc00 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ test-results/ *.tsbuildinfo .DS_Store .vercel +docs/assets/submission/proofrestore-demo-silent.webm +docs/assets/submission/proofrestore-narration-neural.mp3 diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index 7ca5100..0000000 --- a/AGENTS.md +++ /dev/null @@ -1,1123 +0,0 @@ -# ProofRestore — Codex Execution Brief - -## Mission - -Build **ProofRestore**, a polished OpenAI hackathon project that proves whether a backup can actually be recovered before disaster strikes. - -The product must analyze backup history, verify integrity, simulate a restore without modifying real files, detect hidden failures and retention risks, and generate an evidence-backed **Proof of Recoverability** report. - -Time is extremely limited. Treat this as a focused product sprint: - -- Core product complete within roughly 48 hours -- Remaining time reserved for testing, fixing, polishing, deployment, demo recording, and submission -- Reject scope creep -- Do not stop at planning: inspect, implement, run, test, fix, and verify - ---- - -## Product identity - -**Name:** ProofRestore - -**Tagline:** Know your backup will restore before you need it. - -**Elevator pitch:** - -> ProofRestore verifies whether backups can truly be recovered, simulates restores safely, detects hidden failures, and produces evidence-backed proof before disaster strikes. - -**Core message:** - -> Backup success is not recovery success. - ---- - -## Lead-agent behavior - -Act as the principal engineer and execution lead. - -Use GPT-5.6 Sol for: - -- architecture -- critical implementation -- deterministic recovery logic -- integration -- difficult debugging -- final review - -Use subagents aggressively for independent work, preferably in isolated worktrees or clearly separated file ownership. - -Suitable subagent assignments: - -1. Manifest schema and architecture -2. Deterministic recovery engine -3. Demo dataset and fixtures -4. Product UI -5. OpenAI integration -6. Tests and adversarial review -7. Accessibility and UX review -8. Documentation and submission readiness - -The lead agent must: - -- inspect every subagent result -- prevent overlapping edits -- integrate changes -- resolve conflicts -- run all validation commands -- reject weak or incomplete work -- keep the project within scope - -Do not ask unnecessary questions. Make sensible documented decisions unless blocked by credentials, secrets, or destructive actions. - ---- - -## Required user experience - -The primary demo flow must work reliably: - -1. User opens ProofRestore -2. User clicks **Explore demo vault** -3. Dashboard shows: - - **Backup status: Completed** - - **Recoverability status: At risk** -4. User searches for `Thesis-Final.docx` -5. User asks: - - “Can I recover my thesis from Tuesday evening?” -6. ProofRestore resolves: - - the file path - - the requested point in time - - the correct snapshot -7. Deterministic code verifies: - - object availability - - hash integrity - - version eligibility - - conflicts -8. User runs a restore simulation -9. Product shows: - - files to restore - - files to overwrite - - files to skip - - unavailable files - - warnings - - total recoverable size -10. User opens exact evidence for the verdict -11. User generates a **Proof of Recoverability** report -12. Demo ends with: - -- **Backups should not require faith.** - -The full demo path should fit comfortably within two minutes. - ---- - -## Trust boundary - -This is non-negotiable. - -### AI may - -- interpret natural-language recovery requests -- extract likely paths and dates -- preserve ambiguity -- ask for clarification when genuinely required -- summarize deterministic results -- explain technical findings -- generate report prose from verified result data - -### AI must never decide - -- whether a file exists -- whether an object is available -- whether a hash matches -- whether a snapshot is valid -- whether a file is recoverable -- which restore action is safe -- whether the overall request succeeds - -### Deterministic code must decide - -- snapshot selection -- path resolution -- object availability -- hash validation -- size consistency -- restore actions -- conflicts -- retention risks -- byte totals -- item-level verdicts -- request-level verdict -- evidence references - -Every claim shown in the UI must trace back to deterministic evidence. - ---- - -## MVP scope - -### Build - -- polished welcome screen -- built-in realistic demo vault -- JSON manifest import -- manifest validation -- vault health dashboard -- snapshot history -- file search -- historical version timeline -- point-in-time recovery -- deterministic recoverability engine -- restore dry run -- integrity findings -- retention-risk findings -- evidence viewer -- optional natural-language request parsing -- manual fallback controls -- Proof of Recoverability report -- responsive UI -- tests -- deployment-ready configuration -- README -- architecture documentation -- sample environment file - -### Do not build - -- authentication -- billing -- database unless absolutely necessary -- actual destructive restoration -- cloud-provider integrations -- background daemons -- encryption -- multi-user collaboration -- mobile-native clients -- browser extensions -- VaultSync integration -- arbitrary backup-provider compatibility -- production-scale upload infrastructure -- internal multi-agent framework inside the product -- features that do not improve the hackathon demo - ---- - -## Recommended stack - -Unless the repository already has a strong compatible foundation, use: - -- Next.js App Router -- TypeScript strict mode -- Tailwind CSS -- Zod -- OpenAI Responses API -- Vitest -- React Testing Library where useful -- Playwright for one critical end-to-end flow if time permits -- no database -- Vercel-compatible deployment - -Keep dependencies minimal. - ---- - -## Suggested repository structure - -```text -app/ - api/ - interpret/ - components/ - demo/ - recovery/ - reports/ - types/ - utils/ - -tests/ - fixtures/ - recovery/ - integration/ - -docs/ - plan.md - development-log.md - demo-script.md - architecture.md - -public/ -``` - -Adjust to the actual framework, but preserve clear separation between: - -- deterministic engine -- UI -- AI layer -- demo fixtures -- reports -- tests - ---- - -## Manifest model - -Create a versioned schema. - -### VaultManifest - -- `schemaVersion` -- `vaultId` -- `vaultName` -- `generatedAt` -- `source` -- `snapshots` -- `objects` -- `retentionPolicy` -- optional `destinationState` - -### Snapshot - -- `id` -- `createdAt` -- `completedAt` -- `status`: `complete | partial | failed` -- `jobReportedSuccess` -- `files` -- `warnings` -- `metadata` - -### SnapshotFile - -- `path` -- `type`: `file | directory` -- `size` -- `modifiedAt` -- `expectedHash` -- `objectId` -- optional `tags` - -### StoredObject - -- `id` -- `observedHash` -- `size` -- `availability`: `available | missing | corrupted` -- `storageLocation` -- `verificationTimestamp` - -### RetentionPolicy - -- `mode` -- `keepLast` -- `keepDaily` -- `keepWeekly` -- explicit or derived expiry data - -### DestinationState - -Used for dry-run conflict analysis: - -- path -- current hash -- current size -- modified timestamp - -Use UTC internally and ISO 8601 timestamps. - ---- - -## Demo vault - -Create a built-in vault named: - -**Flavio's MacBook Backup** - -Use synthetic, non-sensitive content. - -Include at least six snapshots across several days. - -Include paths such as: - -```text -Documents/ -Documents/University/ -Documents/University/Thesis-Final.docx -Documents/University/Research-Notes.md -Pictures/ -Projects/ -Projects/Client-Presentation.pptx -Desktop/ -Finance/ -``` - -Required scenarios: - -### A. Successful recovery - -`Thesis-Final.docx` has multiple historical versions. - -A valid Tuesday-evening version must be fully recoverable. - -### B. Silent corruption - -A later file version references an object whose observed hash differs from the expected hash. - -### C. Missing object - -A snapshot reports success but references an object that does not exist. - -### D. Retention risk - -The last healthy copy of one important file is scheduled to expire soon. - -### E. Partial folder recovery - -A folder is mostly recoverable, but at least one child is unavailable. - -### F. Overwrite conflict - -The restore destination contains a newer or different version of at least one selected file. - -### G. Misleading success - -At least one backup job reports success while recoverability analysis finds a real problem. - -The dataset must be deterministic, readable, and covered by tests. - ---- - -## Deterministic recovery engine - -Implement the trusted core as framework-independent TypeScript modules using pure functions where practical. - -### Snapshot selection - -Support: - -- exact snapshot ID -- latest snapshot at or before requested time -- closest eligible snapshot -- explicit failure when no eligible snapshot exists - -### Path resolution - -Support: - -- exact file path -- normalized separators -- documented case sensitivity -- folder-recursive recovery -- safe path validation -- rejection of dangerous traversal paths - -### Integrity evaluation - -For each file, verify: - -- referenced object exists -- object is available -- expected hash is present -- observed hash matches expected hash -- size matches where available - -### Item verdicts - -Use a clear enum such as: - -- `verified` -- `recoverable_with_warning` -- `unavailable` -- `corrupted` -- `unknown` - -### Request verdicts - -Use: - -- `fully_recoverable` -- `partially_recoverable` -- `unrecoverable` - -### Restore actions - -Use: - -- `create` -- `overwrite` -- `skip_identical` -- `conflict` -- `unavailable` -- `create_directory` - -### Evidence model - -Every decision must produce evidence entries. - -Suggested codes: - -- `snapshot_selected` -- `snapshot_not_found` -- `path_found` -- `path_not_found` -- `object_found` -- `object_missing` -- `object_unavailable` -- `hash_match` -- `hash_mismatch` -- `size_match` -- `size_mismatch` -- `destination_identical` -- `destination_conflict` -- `retention_expiry` -- `healthy_copy_survives` -- `last_healthy_copy_at_risk` - -Each evidence item should include: - -- stable ID -- code -- severity -- concise message -- referenced entities -- supporting values - -### Totals - -Calculate: - -- selected items -- recoverable items -- unavailable items -- conflicts -- selected bytes -- recoverable bytes -- operation count - -### Retention analysis - -Determine: - -- last known healthy version -- scheduled expiry -- whether another healthy copy survives -- urgency level - -### Safety - -The engine must never write, overwrite, delete, restore, or execute anything. - -It only returns plans and reports. - ---- - -## OpenAI integration - -Implement an optional server-side natural-language interpreter. - -It must convert requests such as: - -- “Can I recover my thesis from Tuesday evening?” -- “Restore Documents as it looked before yesterday's failed sync.” -- “Which important files are no longer recoverable?” -- “Show what would be overwritten.” -- “Can I get the presentation back from July 15?” - -into structured output. - -Suggested shape: - -```ts -type InterpretedRecoveryRequest = { - intent: - | "recover_path" - | "find_unrecoverable" - | "show_conflicts" - | "inspect_history"; - pathQuery?: string; - resolvedPath?: string; - requestedDateTime?: string; - dateInterpretation?: string; - includeChildren: boolean; - destinationMode: "safe_copy" | "original_location"; - needsClarification: boolean; - clarificationQuestion?: string; -}; -``` - -Rules: - -- use structured outputs -- never let the model return a recoverability verdict -- provide only valid path candidates when possible -- preserve ambiguity -- do not fabricate paths -- do not expose API keys -- send minimal data -- implement timeout handling -- implement malformed-response handling -- provide a complete no-key fallback -- the core demo must work without an API key - ---- - -## Product screens - -### 1. Welcome - -Primary CTA: - -**Explore demo vault** - -Secondary CTA: - -**Import backup manifest** - -Hero: - -**Know your backup will restore before you need it.** - -Supporting copy: - -**ProofRestore verifies backup history, simulates recovery, and shows the evidence behind every result.** - -### 2. Vault health - -Show the central contrast: - -- **Backup completed** -- **Recoverability at risk** - -Metrics: - -- snapshots -- protected files -- verified files -- integrity issues -- retention risks -- last restore test - -### 3. Recovery investigation - -Large prompt: - -**What do you need to recover?** - -Provide examples and manual controls. - -### 4. File timeline - -Show historical versions with: - -- timestamp -- snapshot status -- integrity -- size -- retention state -- recoverability - -### 5. Recovery result - -Show: - -- overall verdict -- selected snapshot -- selected path -- integrity status -- copy count -- warnings -- evidence - -### 6. Restore simulation - -Group results into: - -- Will restore -- Will overwrite -- Will skip -- Cannot recover -- Warnings - -Primary CTA: - -**Run restore simulation** - -### 7. Proof report - -Primary CTA: - -**Generate proof report** - -Support downloadable Markdown or HTML. Both are preferable if simple. - ---- - -## Visual direction - -The product should feel like a serious reliability and forensic tool. - -Use: - -- dark navy or near-black shell -- neutral surfaces -- clear status hierarchy -- restrained accent usage -- green only for verified evidence -- amber for risk -- red for confirmed failure -- compact technical details -- accessible contrast -- responsive layouts -- polished empty/loading/error states - -Avoid: - -- generic glowing AI gradients -- excessive glassmorphism -- decorative complexity -- slow animations -- marketing-heavy copy -- cluttered dashboards - -Do not overuse the words: - -- AI -- intelligent -- revolutionary -- agent - ---- - -## Report requirements - -Generate a **Proof of Recoverability** report with: - -- title -- vault name -- generated timestamp -- original request -- selected recovery point -- overall verdict -- summary metrics -- recoverable files -- unavailable files -- conflicts -- integrity findings -- retention warnings -- restore plan -- evidence appendix -- methodology -- explicit statement that this is a simulation - -The deterministic template is mandatory. - -AI-generated prose is optional and may only summarize deterministic result data. - -Escape all imported text safely. - ---- - -## Tests - -At minimum, test: - -- exact snapshot selection -- latest snapshot before time -- request before earliest snapshot -- missing path -- successful historical file recovery -- missing object -- corrupted object -- matching hash -- mismatching hash -- recursive folder recovery -- partial folder recovery -- identical destination skip -- overwrite conflict -- total byte calculations -- final healthy copy retention risk -- healthy alternative copy surviving -- successful job with hidden recovery failure -- evidence IDs and evidence codes -- report generation -- malformed manifest rejection -- path traversal rejection - -Use fixed timestamps and avoid locale-dependent behavior. - -Add an integration test for: - -```text -demo vault -→ Thesis-Final.docx -→ Tuesday evening -→ valid snapshot -→ fully recoverable -→ restore plan generated -``` - -Add one Playwright end-to-end test for the main demo path if setup remains lightweight. - ---- - -## Security and privacy - -- validate all imports -- limit upload size -- reject dangerous paths -- never execute imported content -- never read arbitrary local filesystem paths -- never expose environment variables -- do not send full manifests to OpenAI -- safely render imported strings -- prevent HTML injection -- sanitize or avoid raw HTML rendering -- document demo limitations - ---- - -## Execution phases - -### Phase 0 — Inspect and initialize - -- inspect repository -- inspect git status -- identify existing stack -- preserve useful work -- initialize app if empty -- establish scripts -- enable strict TypeScript -- add `.env.example` -- create `docs/plan.md` -- create `docs/development-log.md` -- create `docs/demo-script.md` - -### Phase 1 — Trusted core - -- schema -- types -- demo dataset -- snapshot selection -- path resolution -- integrity evaluation -- restore planning -- evidence model -- retention checks -- unit tests - -Exit condition: - -Every demo scenario is proven by tests. - -### Phase 2 — Complete deterministic product - -- demo vault loading -- dashboard -- search -- timeline -- manual recovery controls -- verdict -- simulation -- evidence -- report - -Exit condition: - -The entire demo works with no OpenAI API key. - -### Phase 3 — AI assistance - -- Responses API route -- structured output -- natural-language parser -- fallback -- errors -- deterministic handoff - -Exit condition: - -AI interprets intent only. - -### Phase 4 — Polish - -- responsive design -- keyboard accessibility -- focus states -- loading states -- empty states -- error states -- concise copy -- visual cleanup - -### Phase 5 — Verification - -Run and fix: - -```bash -npm run format -npm run lint -npm run typecheck -npm test -npm run build -``` - -Also run the end-to-end test if configured. - -Test: - -- clean browser -- API-key path -- no-key path -- valid imported manifest -- malformed manifest -- full demo sequence - -### Phase 6 — Submission readiness - -Finish: - -- README -- architecture documentation -- Mermaid diagram -- AI/deterministic boundary explanation -- setup instructions -- testing instructions -- known limitations -- screenshots checklist -- demo script -- development log -- deployment instructions - ---- - -## Required documentation - -### `docs/plan.md` - -Maintain: - -- current phase -- completed tasks -- next tasks -- risks -- decisions -- blocked items - -### `docs/development-log.md` - -Maintain: - -- meaningful implementation milestones -- agent contributions -- major technical decisions -- testing milestones -- fixes -- Codex collaboration notes - -### `docs/demo-script.md` - -Maintain: - -- exact click path -- narration -- expected result at each step -- timing target -- fallback plan - -### README - -Include: - -- product overview -- problem -- solution -- architecture -- deterministic trust boundary -- OpenAI usage -- local setup -- environment variables -- test commands -- build command -- deployment -- demo flow -- limitations -- hackathon development note - ---- - -## Agent ownership plan - -Use non-overlapping ownership. - -### Agent A — Schema and architecture - -Own: - -- manifest schema -- core types -- architecture document -- edge-case catalog - -### Agent B — Recovery engine - -Own: - -- snapshot selection -- path resolution -- integrity checks -- restore planning -- verdict logic -- evidence -- retention -- engine tests - -Use a high-capability model. - -### Agent C — Demo dataset - -Own: - -- demo manifest -- fixtures -- scenario expectations -- fixture validation - -### Agent D — UI - -Own: - -- welcome -- dashboard -- investigation flow -- timeline -- results -- simulation -- evidence viewer -- report screen - -Do not modify engine internals without coordination. - -### Agent E — OpenAI layer - -Own: - -- API route -- structured request parsing -- environment handling -- fallback -- mocked tests - -### Agent F — Adversarial testing - -Review: - -- false-positive recovery -- timestamp edges -- path normalization -- folder recursion -- conflict logic -- retention logic -- misleading-success scenario - -### Agent G — Accessibility and UX - -Review: - -- keyboard flow -- labels -- focus -- contrast -- responsive behavior -- error clarity -- copy - -### Agent H — Documentation - -Own: - -- README -- architecture -- demo script -- submission notes -- development log cleanup - -The lead agent integrates all work and runs final verification. - ---- - -## Working discipline - -At each major milestone: - -1. inspect git diff -2. run formatter -3. run lint -4. run typecheck -5. run tests -6. run production build -7. repair failures -8. update documentation -9. commit a coherent checkpoint - -Do not: - -- leave placeholder content -- hide failing tests -- report completion before the build passes -- rewrite unrelated files -- add speculative features -- create dead code -- postpone all testing until the end - -Suggested commits: - -```text -chore: initialize ProofRestore hackathon project -feat: add manifest schema and demo vault -feat: implement deterministic recoverability engine -feat: add restore simulation and evidence model -feat: build recovery investigation interface -feat: add natural language request parsing -test: cover recovery and retention edge cases -docs: prepare ProofRestore submission materials -``` - ---- - -## First mandatory milestone - -Before UI polish, complete this exact path: - -```text -Explore demo vault -→ find Thesis-Final.docx -→ select Tuesday evening -→ select valid historical snapshot -→ verify integrity -→ return fully recoverable -→ generate deterministic restore plan -``` - -This must work without OpenAI. - -Required commands must pass: - -```bash -npm run lint -npm run typecheck -npm test -npm run build -``` - ---- - -## Start now - -1. Read this entire file. -2. Inspect the repository and environment. -3. Create or update `docs/plan.md`. -4. Summarize the repository state briefly. -5. Assign independent subagents. -6. Implement the trusted core first. -7. Continue autonomously. -8. Stop only for a real credential, secret, destructive action, or architectural blocker. -9. Do not wait for approval between normal implementation phases. -10. Do not claim completion until the production build and main demo flow both succeed. diff --git a/README.md b/README.md index 7cec9f5..3fd4616 100644 --- a/README.md +++ b/README.md @@ -67,10 +67,6 @@ flowchart LR More detail is available in [docs/architecture.md](docs/architecture.md), including the request sequence and security boundary. -### Future VaultSync integration - -ProofRestore is designed to remain a standalone verifier while becoming an optional native VaultSync step after a backup, from backup history, or on demand. The repositories should stay separate and integrate through a released JSON evidence contract—not Git submodules or shared internal storage. The phased design, exporter CLI, native workflow, contract versioning, and optional local bridge are documented in [docs/vaultsync-integration.md](docs/vaultsync-integration.md). - ## Deterministic trust boundary Natural-language interpretation may identify an intent, candidate path, requested time, recursion preference, and destination mode. It may preserve ambiguity or request clarification. @@ -149,13 +145,12 @@ The Chromium E2E suite passes 8/8. It covers the demo vault through thesis selec ## Submission media -The checked-in scripts reproduce the cover, eight gallery states, the paced pointer-enabled screen recording, and the final narrated MP4 assembly: +The checked-in scripts reproduce the cover, eight gallery states, and the paced pointer-enabled visual recording: ```bash npm run build npm run capture:submission npm run record:demo -FFMPEG_PATH=/path/to/ffmpeg npm run assemble:demo ``` - [3:2 project cover](docs/assets/submission/cover-1500x1000.png) @@ -169,7 +164,7 @@ FFMPEG_PATH=/path/to/ffmpeg npm run assemble:demo - [Recovery Lab with injected corruption and evidence](docs/assets/submission/07-recovery-lab-result-1600x900.png) - [Final narrated demo with selectable captions and visible pointer](docs/assets/submission/proofrestore-demo-final.mp4) -The editable source assets are the silent WebM recording, neural narration MP3, [SRT captions](docs/assets/submission/proofrestore-demo-captions.srt), and [demo-narration.txt](docs/demo-narration.txt). The final 1:55 cut is 1600×900 H.264 with normalized 48 kHz stereo AAC audio, smooth recorder-controlled scrolling, human-like pointer movement and click pulses, and a default English caption track that viewers can enable or disable. It covers both the mandatory thesis recovery and the hands-on Recovery Lab. The narration uses Microsoft Edge's `en-US-AndrewMultilingualNeural` voice, gently retimed to match the final interaction sequence, and is disclosed in the first caption. Upload the SRT separately because video hosts may discard embedded subtitles during transcoding. Exact rebuild and publishing steps are in [docs/media-production.md](docs/media-production.md). +The repository retains only the publication MP4, [SRT captions](docs/assets/submission/proofrestore-demo-captions.srt), and [narration source](docs/demo-narration.txt)—not large intermediate audio or silent-video renders. The final 1:55 cut is 1600×900 H.264 with normalized 48 kHz stereo AAC audio, smooth recorder-controlled scrolling, human-like pointer movement and click pulses, and a default English caption track that viewers can enable or disable. It covers both the mandatory thesis recovery and the hands-on Recovery Lab. The narration uses Microsoft Edge's `en-US-AndrewMultilingualNeural` voice and is disclosed in the first caption. Upload the SRT separately because video hosts may discard embedded subtitles during transcoding. Publishing checks are in [docs/media-production.md](docs/media-production.md). ## Manifest import diff --git a/docs/DEVPOST_STORY_DRAFT.md b/docs/DEVPOST_STORY_DRAFT.md index 2159f70..3c56516 100644 --- a/docs/DEVPOST_STORY_DRAFT.md +++ b/docs/DEVPOST_STORY_DRAFT.md @@ -87,10 +87,10 @@ Finally, backup completion is a statement about a job, not the future ability to ## What's next for ProofRestore -- a versioned evidence contract and read-only VaultSync exporter so recoverability verification can run optionally after backup, from history, or on demand while both repositories remain independent; +- a versioned evidence contract so backup tools can export recoverability evidence without sharing internal storage; - adapters for other backup formats and providers; - scheduled restore simulations; -- integration with VaultSync and other backup tools; +- adapters for backup tools and formats; - isolated test restores into disposable environments; - signed recovery reports; - team and compliance workflows; diff --git a/docs/assets/submission/proofrestore-demo-silent.webm b/docs/assets/submission/proofrestore-demo-silent.webm deleted file mode 100644 index 5112387..0000000 Binary files a/docs/assets/submission/proofrestore-demo-silent.webm and /dev/null differ diff --git a/docs/assets/submission/proofrestore-narration-neural.mp3 b/docs/assets/submission/proofrestore-narration-neural.mp3 deleted file mode 100644 index e42c959..0000000 Binary files a/docs/assets/submission/proofrestore-narration-neural.mp3 and /dev/null differ diff --git a/docs/demo-script.md b/docs/demo-script.md index 590ff45..a1d66ab 100644 --- a/docs/demo-script.md +++ b/docs/demo-script.md @@ -138,8 +138,8 @@ Explore demo vault - Clear prior downloads so `proof-of-recoverability.md` is easy to identify. - Keep browser zoom at 100%; the automated recorder renders a high-contrast pointer and click pulse into the page. - Rehearse once with the network disconnected; the primary flow should be unchanged. -- To reproduce the checked-in media after a production build, run `npm run capture:submission`, `npm run record:demo`, regenerate narration as documented, and run `npm run assemble:demo`. -- The publication MP4, silent WebM, neural narration MP3, SRT captions, and source text live in `docs/assets/submission/` and `docs/demo-narration.txt`. +- To reproduce the gallery and visual recording after a production build, run `npm run capture:submission` and `npm run record:demo`. +- The repository retains the publication MP4, SRT captions, and narration source. Large intermediate audio and silent-video renders are intentionally excluded. - Use only `proofrestore-demo-final.mp4` for submission. Attach `proofrestore-demo-captions.srt` separately on the host and verify that CC remains toggleable after transcoding. See [media-production.md](media-production.md). ## Fallback plan diff --git a/docs/development-log.md b/docs/development-log.md index 0a424d4..db2d8af 100644 --- a/docs/development-log.md +++ b/docs/development-log.md @@ -85,18 +85,14 @@ ### Final integration and media pass -- Documented a two-repository VaultSync roadmap based on a released language-neutral evidence contract, a read-only destination scanner/exporter, cross-repository conformance fixtures, and an optional later loopback bridge; Git submodules and shared internal storage are explicitly rejected. - Made repeated corruption injection fail safely instead of flipping the same byte back to its healthy value. - Added separate Recovery Lab setup/safety and corruption/evidence gallery images. - Re-cut the complete demo to 1:45 with a warm conversational neural voice, selectable English captions, visible pointer/click pulses, and a concise hands-on Recovery Lab sequence. -- Added reproducible final MP4 assembly and documented the voice, rate, ffmpeg settings, caption publishing step, and source artifacts. -- Removed duplicate, obsolete, subtitle-free, and permanently captioned video intermediates after verifying the final MP4 and retained rebuild sources. +- Documented the final voice, caption publishing step, and retained publication artifacts. +- Removed duplicate, obsolete, subtitle-free, permanently captioned, and large production intermediates after verifying the final MP4. -### VaultSync study, public release hardening, and final video +### Public release hardening and final video -- Studied `/Users/flavio/Developer/VaultSync.nosync` read-only and left its clean `release/v1.8.4` worktree unchanged. The resulting repository study maps Core, CLI, UI, persistence, snapshot, retention, and backup-format seams to a future versioned evidence exporter. -- Confirmed that the current VaultSync verifier cannot serve as ProofRestore's evidence source: it selects only the latest project snapshot, does not persist item-level failures, and cannot repair historical deferred hashes without rereading the actual backup destination. -- Refined the future integration to begin with one explicit persisted backup and one reachable unencrypted destination, then add folder, ZIP, and encrypted content readers behind a common read-only interface. No submodule or shared database is proposed. - Replaced audience-specific video language with generic user language and rebuilt the recorder with seeded Bézier pointer paths, off-center clicks, human dwell timing, and smooth recorder-only scrolling. - Reassembled and fully decoded a 1:55, 1600×900 H.264 final video with natural 48 kHz stereo narration and an optional embedded English caption track; retimed both tracks across the full visual sequence, inspected representative frames, and verified the embedded captions match the SRT source. - Added the MIT license, `SECURITY.md`, `CONTRIBUTING.md`, CODEOWNERS, pull-request guidance, Dependabot, CodeQL, SHA-pinned Actions, and strict browser security headers. diff --git a/docs/media-production.md b/docs/media-production.md index 9d2d552..efb5979 100644 --- a/docs/media-production.md +++ b/docs/media-production.md @@ -9,37 +9,9 @@ npm run build npm run record:demo ``` -The recorder starts the production application, captures the complete demo and Recovery Lab path at 1600×900, and writes `proofrestore-demo-silent.webm`. It renders its own high-contrast pointer and click pulse because headless recordings do not contain the operating-system cursor. +The recorder starts the production application, captures the complete demo and Recovery Lab path at 1600×900, and writes a temporary `proofrestore-demo-silent.webm`. It renders its own high-contrast pointer and click pulse because headless recordings do not contain the operating-system cursor. The silent render and generated narration audio are production intermediates and are intentionally not retained in the public repository. -## Rebuild the natural narration - -The checked-in narration was generated with Microsoft Edge neural text-to-speech using: - -- voice: `en-US-AndrewMultilingualNeural`; -- rate: `+10%`; -- source: `docs/demo-narration.txt`. - -Install the `edge-tts` Python package in an isolated environment, then run: - -```bash -python3 -m edge_tts \ - --file docs/demo-narration.txt \ - --voice en-US-AndrewMultilingualNeural \ - --rate=+10% \ - --write-media docs/assets/submission/proofrestore-narration-neural.mp3 -``` - -The curated SRT remains checked in separately so caption wording, line length, timing, and the AI-narration disclosure can be reviewed before publication. - -## Assemble the publication MP4 - -Install ffmpeg or point `FFMPEG_PATH` at an ffmpeg executable, then run: - -```bash -npm run assemble:demo -``` - -The script encodes H.264 video, normalizes narration to a target of −16 LUFS with a −1.5 dB true-peak ceiling, exports 48 kHz stereo AAC, embeds the SRT as a default English `mov_text` track, and enables MP4 fast start. +The checked-in narration source uses Microsoft Edge's `en-US-AndrewMultilingualNeural` voice in the final cut. The curated SRT remains alongside the publication MP4 so caption wording, timing, and the AI-narration disclosure can be reviewed and uploaded independently. ## Publishing check diff --git a/docs/plan.md b/docs/plan.md index 6900f0b..8d2e2dc 100644 --- a/docs/plan.md +++ b/docs/plan.md @@ -25,8 +25,7 @@ Phase 6 in progress — redesigned submission package deployed; final Devpost pu - Rebuilt the interface as a focused four-stage workflow: health, recovery request, restore simulation, and proof report. - Made safe copy the default destination, exposed exact snapshot and recursion controls, separated content recoverability from restore safety, and added deterministic provenance to results. - Captured the 3:2 cover and eight gallery states from the production flow, including Recovery Lab setup/safety and corruption/evidence views. -- Recorded a 1:55 narrated 1600×900 MP4 covering the core recovery flow and Recovery Lab, plus its editable silent WebM, natural neural MP3, selectable SRT captions, and narration script. -- Completed a read-only study of VaultSync's Core, CLI, UI, persistence, verification, snapshot, retention, and backup-format seams; documented a safe evidence-export contract without changing the VaultSync repository. +- Recorded a 1:55 narrated 1600×900 MP4 covering the core recovery flow and Recovery Lab, with selectable SRT captions and a retained narration script. - Added an MIT license, public security policy, contribution guidance, CodeQL and Dependabot configuration, SHA-pinned Actions, patched PostCSS resolution, and browser security headers. - Rebuilt the recorder with deterministic human-like pointer paths, intentional dwell/click timing, and smooth recorder-only scrolling while preserving reduced-motion behavior in the product. - Deployed the safe deterministic build to https://proofrestore.vercel.app and smoke-tested its homepage and no-key interpreter endpoint. diff --git a/docs/vaultsync-integration.md b/docs/vaultsync-integration.md deleted file mode 100644 index 0ab7d8a..0000000 --- a/docs/vaultsync-integration.md +++ /dev/null @@ -1,169 +0,0 @@ -# VaultSync integration roadmap - -## Decision - -VaultSync and ProofRestore should remain separate repositories and separate products. VaultSync owns backup creation and history; ProofRestore owns the recoverability contract and deterministic verification. The integration boundary is a versioned JSON evidence manifest, not a shared database, copied engine, or Git submodule. - -```text -VaultSync backup records -+ read-only scan of the actual backup destination -→ versioned ProofRestore manifest -→ ProofRestore validation and deterministic verification -→ verdict, evidence, simulation, and report -``` - -This lets VaultSync offer an optional native **Verify with ProofRestore** step after backup, from backup history, or on demand while ProofRestore remains independently usable. - -This roadmap was corrected after a read-only study of VaultSync `release/v1.8.4` at commit `d5bd54f`. See [vaultsync-repository-study.md](vaultsync-repository-study.md) for the code-backed findings and current prerequisites. - -## Why not Git submodules - -Submodules would couple checkout and release workflows, complicate CI, and encourage the applications to depend on each other's internal models. They do not provide a useful boundary between a TypeScript web application and VaultSync's implementation language. - -ProofRestore should instead publish immutable contract releases containing: - -- a canonical JSON Schema; -- valid and adversarial fixtures; -- producer conformance rules; -- migration notes and checksums. - -VaultSync pins an exact contract release and checksum. Cross-repository CI tests released contracts or tags, never a moving branch. If several products eventually produce ProofRestore evidence, only the language-neutral schema, fixtures, and protocol documentation may move into a small third contract repository. - -## Ownership - -### ProofRestore owns - -- Manifest schema and semantic rules -- Compatibility policy and fixtures -- Validation and deterministic recovery engine -- Evidence codes, verdict semantics, and reports -- Producer conformance tests - -### VaultSync owns - -- Mapping VaultSync backup records to contract DTOs -- Read-only inspection of the actual backup destination -- Decryption through its existing local read pipeline when required -- CLI and native UI entry points -- Scheduling and user consent - -VaultSync must not copy the ProofRestore engine or expose its SQLite database, credentials, absolute storage paths, or decrypted content. ProofRestore should not create or mutate VaultSync backups. - -## Required evidence mapping - -| VaultSync observation | ProofRestore field | -| ------------------------------------------------------------- | --------------------------------------- | -| Backup job/project | Vault and snapshot metadata | -| Trustworthy non-empty hash captured for the selected snapshot | `expectedHash` | -| Fresh hash from re-reading stored backup bytes | `observedHash` | -| Actual stored byte count and availability | Stored object evidence | -| Successful persisted backup row | Complete/reported-success snapshot only | -| Count-based retention and protection flags | Keep-last/protection context | -| Optional current project scan | `destinationState` | - -A source snapshot hash alone is not independent recovery evidence. The exporter must re-read the stored backup copy. VaultSync's normal backup path currently permits deferred empty hashes and later hashes the live project, so the first adapter must reject empty/untrustworthy expectations rather than repair them from current source data. For contract `1.0`, an inaccessible or incomplete destination scan should fail closed instead of inventing an observed hash or describing an unknown state as missing. - -Storage locations should be logical and redacted, for example: - -```text -vaultsync://destination//backup// -``` - -VaultSync currently has folder/ZIP exploration and an authenticated decrypt-to-temporary-ZIP primitive, but no reusable encrypted read-only reader. A future exporter needs separate folder, ZIP, and encrypted ZIP readers. Secrets and plaintext bytes must never enter the manifest, and temporary plaintext must always be removed in `finally`. - -The exporter must be a new backup-specific scanner accepting an explicit `Backup` and `SnapshotId`. It must not wrap the current `VerifyService`, which always selects the latest project snapshot, reads only ordinary files, does not persist results, and currently has its returned mismatches ignored by UI orchestration. - -## First integration: explicit file handoff - -The first release should be intentionally simple and auditable: - -```bash -vaultsync proofrestore export \ - --project \ - --backup latest \ - --verify full \ - --contract 1 \ - --output proofrestore-manifest.json -``` - -Rules: - -- The command is strictly read-only. -- A full destination scan is mandatory for contract `1.0`. -- Manifest JSON goes to the output file or stdout; diagnostics go to stderr. -- The exporter validates against the pinned schema before returning success. -- Exit codes distinguish invalid input, inaccessible storage, unstable scans, contract failure, and output failure. -- Default output redacts absolute paths, hostnames, user names, and credentials. -- Phase one accepts only the single destination represented by the persisted backup row. VaultSync currently records no independent row for secondary successful destination copies. -- Phase one accepts only reachable unencrypted folder backups whose selected snapshot contains trustworthy non-empty expected hashes. -- Paths are converted to safe POSIX-relative form, parent directories are synthesized, case-colliding entries are rejected, and `.vaultsync_*` artifacts are excluded. - -Native VaultSync UI can call the same exporter service: - -```text -Backup completed -→ optional Verify recoverability -→ read-only evidence scan -→ Open or export to ProofRestore -``` - -The same action can appear beside a historical backup as **Verify this recovery point**. An optional post-backup or scheduled step should be shown as durable history only after VaultSync persists verification runs and item outcomes. - -## Later local automation - -After the file contract is stable, VaultSync can expose a short-lived loopback service started only by explicit user action: - -```bash -vaultsync proofrestore serve --bind 127.0.0.1 --port 0 --token -``` - -Potential read-only endpoints: - -```text -GET /v1/capabilities -POST /v1/manifests -GET /v1/jobs/{id} -GET /v1/jobs/{id}/manifest -``` - -The service must bind only to loopback, use a short-lived bearer token and strict Origin allowlist, accept no caller-supplied filesystem paths, return no raw file content, enforce bounded responses, and shut down automatically. A persistent daemon or public cloud upload API is not required for the initial integration. - -## Contract versioning - -The contract is versioned independently from both applications: - -- Patch: documentation or fixture corrections without changing accepted data -- Minor: optional backward-compatible fields or capabilities -- Major: required fields or changed semantics - -A future contract `2.0` should represent `unverified` and `inaccessible` objects honestly, allow absent observed hashes when no read occurred, declare hash algorithms and producer capabilities, record observation start/end times and unstable scans, and optionally carry a detached producer signature. A signature proves provenance, not recoverability. - -## Delivery phases - -1. **Harden contract `1.0`:** publish JSON Schema, fixtures, checksums, semantic rules, and compatibility policy. -2. **VaultSync persistence prerequisites:** capture trustworthy expected hashes transactionally and persist backup-copy plus verification-run outcomes. -3. **VaultSync exporter beta:** support one explicit persisted backup, snapshot, and unencrypted folder destination with mandatory full verification. -4. **Native handoff:** add **Verify with ProofRestore** beside history entries; add explicit VaultSync import guidance in ProofRestore. -5. **Reader expansion:** add tested plain-ZIP and encrypted-ZIP readers with safe temporary-data cleanup. -6. **Cross-repository CI:** VaultSync produces healthy, corrupted, missing, encrypted, case-collision, and inaccessible fixtures; ProofRestore verifies expected evidence and verdicts. -7. **Contract `2.0`:** add honest partial-observation states, scan stability, producer metadata, and large-manifest transport. -8. **Optional automation:** introduce scheduled verification and the short-lived local bridge only after runs are durable. - -## Main risks - -- Reusing source hashes instead of independently reading stored bytes -- Misclassifying inaccessible or encrypted destinations as missing -- Backup files changing while they are hashed -- Deferred source hashes not describing the bytes actually copied -- Current verification mismatches being transient or ignored -- Secondary destination copies having no independent persisted record -- Folder, ZIP, and encrypted ZIP requiring different safe readers -- Case-insensitive VaultSync paths colliding in ProofRestore's case-sensitive contract -- Large real projects exceeding ProofRestore's current 5 MiB browser import limit -- Case-sensitivity differences across platforms -- Manifests exceeding the current browser import limit -- Leaking local paths, hostnames, identities, or credentials -- Retention metadata diverging from provider behavior -- Coupling releases through copied DTOs without conformance tests - -The safe first milestone is therefore: one persisted VaultSync backup row, its explicit snapshot, one reachable unencrypted folder destination, trustworthy non-empty expected hashes, a full read-only destination scan, a validated JSON export, and manual ProofRestore import. diff --git a/docs/vaultsync-repository-study.md b/docs/vaultsync-repository-study.md deleted file mode 100644 index 8dedc2b..0000000 --- a/docs/vaultsync-repository-study.md +++ /dev/null @@ -1,165 +0,0 @@ -# VaultSync repository study - -This is a read-only architecture study of the clean VaultSync working tree at `/Users/flavio/Developer/VaultSync.nosync`, branch `release/v1.8.4`, commit `d5bd54f`. No VaultSync files were changed. - -## Actual structure - -VaultSync is a .NET 10 solution with three production projects: - -- `src/VaultSync.Core` — models, SQLite persistence, scanning, hashing, backup, retention, encryption, restore exploration, and verification services. -- `src/VaultSync.CLI` — Spectre.Console command registration and thin command handlers over Core. -- `src/VaultSync.UI` — Avalonia UI; `AppViewModel` partial classes orchestrate Core services and `BackupsViewModel` exposes UI actions. - -Tests reference both Core and UI. A future ProofRestore producer belongs in Core, with thin CLI and UI entry points using the same service. - -## Evidence already available - -`Project`, `Snapshot`, `FileEntry`, and `Backup` provide most join keys required by an exporter: - -- projects, snapshots, and backups have external IDs; -- backups identify a project, snapshot, destination root, relative backup path, backup mode, encryption state, and creation time; -- snapshot files contain relative path, size, modification time, and an optional SHA-256 value; -- snapshot-history metadata contains user-marked protection and known-good flags; -- repository methods already retrieve backups, explicit snapshots, snapshot files, and history metadata; -- `BackupIndexConsistencyService` detects broken relationships and missing/duplicate external IDs. - -Relevant files: - -- `src/VaultSync.Core/Models/Project.cs` -- `src/VaultSync.Core/Models/Snapshot.cs` -- `src/VaultSync.Core/Models/FileEntry.cs` -- `src/VaultSync.Core/Models/Backup.cs` -- `src/VaultSync.Core/Repositories/SqliteRepository.cs` -- `src/VaultSync.Core/Services/BackupIndexConsistencyService.cs` - -## Critical gaps in current verification - -### Verification is not backup-specific - -`VerifyService.VerifyAsync` always loads the latest project snapshot. It cannot receive the selected backup's `SnapshotId`, reads ordinary destination files only, and returns transient mismatches without persisting a verification run. - -`AppViewModel.StartVerificationAsync` currently ignores the returned `VerifyResult.Failures`; only thrown exceptions enter failure handling. A mismatching or missing file therefore does not become durable backup history. `BackupsViewModel` reconstructs every persisted backup with the UI status `Completed`, while its failure marker is in-memory only. - -Consequences: - -- the existing verifier must not be wrapped as the ProofRestore exporter; -- VaultSync needs a new scanner that accepts one explicit `Backup` and its exact `SnapshotId`; -- verification outcomes need a persisted run/item model before scheduled ProofRestore verification can be presented as durable history. - -Relevant files: - -- `src/VaultSync.Core/Services/VerifyService.cs` -- `src/VaultSync.UI/ViewModels/AppViewModel.BackupSupport.cs` -- `src/VaultSync.UI/ViewModels/BackupsViewModel.cs` - -### Expected hashes have a timing gap - -The normal backup path calls `SnapshotService.CreateSnapshotAsync` with `hashNow: false`. New or modified `FileEntry.HashSha256` values can therefore be empty when the copy begins. Post-backup hashing later reads the live project rather than immutable source bytes captured by the backup operation. - -If the source changes between copy and deferred hashing, the resulting expected hash may not describe the stored backup. Historical empty hashes cannot be repaired honestly by hashing the current source. - -A trustworthy exporter must either capture expected hashes before/during the backup transaction or initially support only snapshots whose non-empty expected hashes were captured reliably. - -Relevant files: - -- `src/VaultSync.Core/Services/BackupService.cs` -- `src/VaultSync.Core/Services/SnapshotService.cs` -- `src/VaultSync.UI/ViewModels/AppViewModel.BackupSupport.cs` - -### Backup job history is incomplete - -The SQLite backup row represents a successful persisted backup. It has no started/completed pair, job status, partial/failure record, or persisted verification result. Failed and cancelled work normally leaves no backup row. - -For an initial adapter, a persisted row may map to a successful snapshot only, with `Snapshot.CreatedUtc` as creation and `Backup.CreatedUtc` as the available completion-like timestamp. VaultSync cannot yet export honest failed/partial job history. - -### Multiple destinations need per-copy persistence - -Multi-destination orchestration creates one shared snapshot, but only the first successful destination writes backup metadata (`writeMetadata: !metadataWritten`). Secondary copies do not receive independent `Backup` rows. - -The first exporter can verify only the destination represented by the persisted row. Complete multi-destination coverage requires a future `backup_copies`-style record containing destination, relative path, outcome, timestamps, and verification state per copy. - -Relevant file: `src/VaultSync.UI/ViewModels/AppViewModel.BackupHandlers.cs`. - -## Backup content readers required - -VaultSync supports three physical content forms: - -1. ordinary backup folders; -2. plain `data.zip` archives; -3. encrypted `data.vse` archives. - -`SnapshotExplorerService` already detects all three and safely enumerates folders/plain ZIPs, but deliberately exposes no encrypted inventory. `BackupArchiveCryptoService` can authenticate and decrypt an encrypted archive to a temporary ZIP, and the UI restore flow demonstrates staging and cleanup. There is no reusable encrypted read-only content-reader abstraction yet. - -A future scanner should use explicit readers: - -```text -IBackupContentReader -├── FolderBackupContentReader -├── ZipBackupContentReader -└── EncryptedZipBackupContentReader -``` - -The encrypted reader must hash decompressed plaintext streams locally, clean temporary plaintext in `finally`, and never export credentials, keys, or raw content. - -Relevant files: - -- `src/VaultSync.Core/Services/SnapshotExplorerService.cs` -- `src/VaultSync.Core/Services/BackupArchiveCryptoService.cs` -- `src/VaultSync.UI/ViewModels/AppViewModel.BackupHistoryHandlers.cs` - -## Retention and readiness semantics - -Retention is count-based (`MaxSnapshotsPerProject`, default 20) with protection supplied by `Backup.IsProtected` and snapshot-history metadata. VaultSync does not persist exact future expiry timestamps per backup. Contract `1.0` can represent a keep-last policy and protection context, but cannot invent `snapshotExpiries`. - -`RestoreReadinessService` is a useful heuristic over recency, destination reachability, verification policy, index warnings, and user-marked protected/known-good points. It does not hash stored objects. Readiness scores and known-good flags may be exported as source metadata only; neither is recoverability proof. - -Relevant files: - -- `src/VaultSync.Core/Config/AppConfig.cs` -- `src/VaultSync.Core/Services/BackupRetentionSimulationService.cs` -- `src/VaultSync.Core/Services/RestoreReadinessService.cs` - -## Path and incremental behavior - -VaultSync generally compares snapshot paths case-insensitively, while ProofRestore intentionally matches paths case-sensitively. The exporter must normalize separators to POSIX, reject traversal and absolute paths, synthesize parent directories, reject case-colliding paths, exclude `.vaultsync_*` artifacts, and canonicalize hashes as `sha256:`. - -Incremental folder backups use `rsync --link-dest`; each selected backup directory is intended to appear as a complete logical tree. The scanner should verify that tree directly. The risk is missing/broken hard-linked content, not a generic reconstruction chain. - -## Concrete future seams - -Recommended Core types: - -```text -ProofRestoreEvidenceExportService -BackupEvidenceScanner -BackupLocationResolver -IBackupContentReader -ProofRestoreContractDtos -``` - -Recommended UI path: - -```text -BackupsViewModel.VerifyWithProofRestoreRequested -→ AppViewModel handler -→ Core exporter with progress/cancellation -→ Save manifest -→ Open ProofRestore or show file -``` - -Recommended CLI path: register a `proofrestore export` branch in `VaultSync.CLI.Program` and implement it in a thin `Commands/ProofRestoreCommands.cs` wrapper over the same Core service. - -## Safe first milestone - -The honest first milestone is deliberately narrow: - -- one persisted backup row; -- one explicit snapshot; -- one reachable, unencrypted folder destination represented by that row; -- complete and trustworthy non-empty expected hashes; -- full read-only re-read of every stored file; -- case-collision/path validation and directory synthesis; -- schema validation; -- manual manifest import into ProofRestore. - -ZIP, encrypted ZIP, multi-destination copies, persisted verification history, scheduled execution, partial observations, and large-manifest transport should be added only after their prerequisites are implemented and tested in VaultSync. diff --git a/package.json b/package.json index 1080eb2..eda3a08 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,7 @@ "test:e2e": "playwright test", "validate": "npm run format:check && npm run lint && npm run typecheck && npm test && npm run build", "capture:submission": "node scripts/capture-submission-assets.mjs", - "record:demo": "node scripts/record-demo.mjs", - "assemble:demo": "node scripts/assemble-demo.mjs" + "record:demo": "node scripts/record-demo.mjs" }, "dependencies": { "next": "15.5.20", diff --git a/scripts/assemble-demo.mjs b/scripts/assemble-demo.mjs deleted file mode 100644 index b0975a9..0000000 --- a/scripts/assemble-demo.mjs +++ /dev/null @@ -1,73 +0,0 @@ -import { rename, rm } from "node:fs/promises"; -import { spawn } from "node:child_process"; - -const outputDir = "docs/assets/submission"; -const videoPath = `${outputDir}/proofrestore-demo-silent.webm`; -const narrationPath = `${outputDir}/proofrestore-narration-neural.mp3`; -const captionsPath = `${outputDir}/proofrestore-demo-captions.srt`; -const outputPath = `${outputDir}/proofrestore-demo-final.mp4`; -const temporaryPath = `${outputDir}/.proofrestore-demo-final.tmp.mp4`; -const ffmpeg = process.env.FFMPEG_PATH || "ffmpeg"; - -const args = [ - "-y", - "-i", - videoPath, - "-i", - narrationPath, - "-i", - captionsPath, - "-map", - "0:v:0", - "-map", - "1:a:0", - "-map", - "2:s:0", - "-c:v", - "libx264", - "-preset", - "medium", - "-crf", - "20", - "-pix_fmt", - "yuv420p", - "-af", - "loudnorm=I=-16:TP=-1.5:LRA=11", - "-c:a", - "aac", - "-b:a", - "192k", - "-ar", - "48000", - "-ac", - "2", - "-c:s", - "mov_text", - "-metadata:s:s:0", - "language=eng", - "-disposition:s:0", - "default", - "-movflags", - "+faststart", - temporaryPath, -]; - -await rm(temporaryPath, { force: true }); - -await new Promise((resolve, reject) => { - const child = spawn(ffmpeg, args, { stdio: "inherit" }); - child.once("error", (error) => { - reject( - new Error( - `Could not start ffmpeg at ${JSON.stringify(ffmpeg)}. Install ffmpeg or set FFMPEG_PATH. ${error.message}`, - ), - ); - }); - child.once("exit", (code) => { - if (code === 0) resolve(); - else reject(new Error(`ffmpeg exited with status ${code ?? "unknown"}`)); - }); -}); - -await rename(temporaryPath, outputPath); -console.log(`Final narrated demo saved to ${outputPath}`);