Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI

on:
push:
branches: [main, staging]
pull_request:

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
build-test:
name: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-22.04, ubuntu-24.04, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Install Linux system dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential libssl-dev \
libayatana-appindicator3-dev librsvg2-dev patchelf

- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
targets: ${{ matrix.os == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- uses: Swatinem/rust-cache@v2

- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile

- name: Fetch PDFium
shell: bash
run: scripts/fetch-pdfium.sh

- name: Rust format
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Rust tests (unit + 57-pair fixture matrix)
shell: bash
run: |
export LARGSFORM_PDFIUM_DIR="$PWD/src-tauri/resources/pdfium/$(scripts/pdfium-platform.sh)"
cargo test --workspace

- name: Frontend lint, type-check, tests
run: |
pnpm lint
pnpm check
pnpm test

- name: Build installers
if: matrix.os != 'ubuntu-24.04'
run: pnpm tauri build ${{ matrix.os == 'macos-latest' && '--target universal-apple-darwin' || '' }}

- name: Upload installers
if: matrix.os != 'ubuntu-24.04'
uses: actions/upload-artifact@v4
with:
name: installers-${{ matrix.os }}
path: |
target/release/bundle/**/*.dmg
target/release/bundle/**/*.deb
target/release/bundle/**/*.AppImage
target/release/bundle/**/*.msi
target/release/bundle/**/*.exe
target/universal-apple-darwin/release/bundle/**/*.dmg
if-no-files-found: ignore
30 changes: 30 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Fuzz

on:
schedule:
- cron: "17 3 * * *" # nightly
workflow_dispatch:

jobs:
fuzz:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
target: [detect, decode]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: cargo install cargo-fuzz --locked
- name: Seed corpus from fixtures
run: |
mkdir -p crates/core/fuzz/corpus/${{ matrix.target }}
cp crates/core/tests/fixtures/samples/* crates/core/fuzz/corpus/${{ matrix.target }}/ || true
- name: Fuzz for 10 minutes
working-directory: crates/core/fuzz
run: cargo fuzz run ${{ matrix.target }} -- -max_total_time=600 -rss_limit_mb=4096
- uses: actions/upload-artifact@v4
if: failure()
with:
name: fuzz-artifacts-${{ matrix.target }}
path: crates/core/fuzz/artifacts/
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Rust
target/
**/*.rs.bk
*.rlib
*.prof*

# Node / frontend
node_modules/
dist/
build/
coverage/
*.log
.env*
!.env.example

# Tauri
src-tauri/gen/
src-tauri/resources/pdfium/

# Fuzzing
crates/core/fuzz/target/
crates/core/fuzz/corpus/
crates/core/fuzz/artifacts/

# Editors / OS
.DS_Store
Thumbs.db
*.tmp
*.swp
.vscode/
.idea/
14 changes: 14 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules/
dist/
build/
coverage/
target/
src-tauri/
crates/
specs/
.specify/
.claude/
pnpm-lock.yaml
package-lock.json
yarn.lock
.github/
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"plugins": ["prettier-plugin-svelte"],
"printWidth": 100,
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
52 changes: 32 additions & 20 deletions .specify/memory/constitution.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
<!--
Sync Impact Report
==================
Version change: (unversioned template) → 1.0.0
Bump rationale: Initial ratification; all placeholders replaced with concrete governance.

Modified principles (template slot → adopted title):
- [PRINCIPLE_1_NAME] → I. Local-First Privacy & Security
- [PRINCIPLE_2_NAME] → II. Cross-Platform Parity
- [PRINCIPLE_3_NAME] → III. Pluggable Converter Architecture
- [PRINCIPLE_4_NAME] → IV. Never Destroy User Data
- [PRINCIPLE_5_NAME] → V. Pragmatic Testing
Added principles:
- VI. Performance & Responsiveness
- VII. Accessibility (WCAG 2.1 AA)
- VIII. Simplicity / YAGNI
Added sections:
- Technology & Platform Constraints (was [SECTION_2_NAME])
- Development Workflow & Quality Gates (was [SECTION_3_NAME])
Version change: 1.0.0 → 1.0.1
Bump rationale: PATCH. Resolves an internal conflict between Principle I (temp files in
the OS temp directory) and Principle IV (atomic rename into place), which cannot both hold
when the destination is on a different volume. Clarifies where the single final-stage
staging file may live and how it is cleaned up. No principle was added, removed, or
redefined. Everything that complied with 1.0.0 still complies.

Modified principles:
- I. Local-First Privacy & Security: the temporary-file rule now permits a hidden,
owner-only staging file in the destination folder for the atomic final write, and
requires leftover staging files to be cleaned up on exit and at the next launch.
- IV. Never Destroy User Data: cross-reference to the Principle I staging-file rule.
Added sections: none
Removed sections: none

Dependent templates: not modified by this command. They read the constitution
at runtime (plan-template "Constitution Check" gate picks up principles I–VIII).
Prior report (1.0.0): initial ratification of principles I–VIII, Technology & Platform
Constraints, and Development Workflow & Quality Gates.

Dependent artifacts:
- specs/001-image-conversion-mvp/plan.md: the Complexity Tracking row for "temp file in the
destination folder" is now compliant and can be removed (analysis finding C1).
- specs/001-image-conversion-mvp/tasks.md: still needs exit-time cleanup and a way for the
startup sweep to find leftover files (analysis finding I1).
- Templates: not modified. They read the constitution at runtime.

Deferred TODOs: none
-->
Expand All @@ -46,6 +50,13 @@ built with Rust and Tauri, installable on macOS, Ubuntu, and Windows.
no remote content loaded into the webview.
- Temporary files MUST be created in the OS temp directory with restrictive permissions
and MUST be removed when a conversion finishes, fails, or is cancelled.
- **Exception: final-stage staging file.** To allow the atomic write required by
Principle IV, the single file holding a conversion's finished output MAY be created in
the destination folder instead. It MUST be hidden (a dot-prefixed name unique to the app),
readable and writable only by the current user, and deleted if the conversion fails or is
cancelled. Staging files left behind by a crash or forced quit MUST be deleted when the
app exits normally and at the next launch. All other intermediate data MUST stay in the
OS temp directory.

Rationale: People convert private photos, contracts, and recordings. Keeping everything
local is the core product promise and removes a whole class of security risks.
Expand Down Expand Up @@ -83,7 +94,8 @@ growing. A uniform interface keeps each new format cheap to add and isolated fro

- Source files MUST NEVER be modified, moved, or deleted by a conversion.
- Output MUST be written to a temporary file and atomically renamed into place only on
success; a failed or cancelled conversion MUST NOT leave partial output behind.
success; a failed or cancelled conversion MUST NOT leave partial output behind. The
staging file follows the Principle I exception.
- Existing files MUST NOT be overwritten silently. The default is a non-colliding name
(e.g., `photo (1).png`); overwriting requires an explicit user choice.
- Every failure MUST produce an actionable, human-readable error (what failed, which
Expand Down Expand Up @@ -196,4 +208,4 @@ cross-platform risk.
- **Review cadence**: Revisit the constitution when a principle is repeatedly waived or
when platform targets change.

**Version**: 1.0.0 | **Ratified**: 2026-12-03 | **Last Amended**: 2026-12-03
**Version**: 1.0.1 | **Ratified**: 2026-12-03 | **Last Amended**: 2026-12-03
Loading
Loading