Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
50ee185
fix: clippy 1.100 lint that fails CI on every platform
SenseiIssei Nov 25, 2026
fe2c2f3
chore(deps): refresh both lockfiles, replace chrono with jiff
SenseiIssei Nov 25, 2026
9b42510
fix(core): order versions the way their package managers do
SenseiIssei Nov 25, 2026
f25806e
fix(core): a finished program is not held up by what it left running
SenseiIssei Nov 25, 2026
be4da65
fix(core): never start an installer twice, one run at a time, cancel
SenseiIssei Nov 25, 2026
c000763
fix(windows-update): result codes were off by two
SenseiIssei Nov 25, 2026
2c8549d
fix(core): run Windows' own tools by their full path
SenseiIssei Nov 25, 2026
7bf3c5d
fix(direct): close gaps around elevated installs, honest offline result
SenseiIssei Nov 25, 2026
fad8d92
fix(catalog): KeePassXC and PowerShell updates had gone missing
SenseiIssei Nov 25, 2026
1895094
feat(cli): bounded scans with progress, safe schedules, honest results
SenseiIssei Nov 25, 2026
df7e40c
feat(app): honest results, cancel, safe quit, accessible
SenseiIssei Nov 25, 2026
890a8bf
ci: make the weekly jobs do what they say
SenseiIssei Nov 25, 2026
b49e7c5
fix(sources): install exactly what was approved, or say no
SenseiIssei Nov 25, 2026
d3381ff
feat(core): do not start an install the disk has no room for
SenseiIssei Nov 25, 2026
79df730
fix(app): every hold can be released, however it was written
SenseiIssei Nov 25, 2026
2fd8d52
docs: the plan from here, what is verified, and claims that match the…
SenseiIssei Nov 25, 2026
c285bd2
fix(direct): the protected directory does not follow an environment v…
SenseiIssei Nov 25, 2026
0ff538d
fix: what an independent review of this branch found
SenseiIssei Nov 25, 2026
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
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ updates:
update-types:
- minor
- patch
ignore:
# Tauri's Rust crates and its npm packages must be on the same minor
# version, and a pull request of one ecosystem can only raise one half:
# both halves failed the packaging job every week and neither could be
# merged. The weekly lockfile refresh raises them together. Security
# updates are not affected by this.
- dependency-name: "tauri*"
update-types:
- version-update:semver-minor
- version-update:semver-patch
commit-message:
prefix: "chore(deps)"

Expand All @@ -36,6 +46,11 @@ updates:
- minor
- patch
ignore:
# See the Rust half above.
- dependency-name: "@tauri-apps/*"
update-types:
- version-update:semver-minor
- version-update:semver-patch
# The Node typings must describe the Node the build runs on (24, set in
# the workflows); a newer major would type-check APIs that do not exist
# there. Raise both together.
Expand Down
90 changes: 71 additions & 19 deletions .github/workflows/lockfile.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
name: Lockfile maintenance

# Dependabot raises the dependencies named in Cargo.toml and package.json, but
# not what they pull in. A security fix in a transitive crate — rustls-webpki
# under reqwest, October 2026 — therefore sat unapplied while every pull
# request failed the audit. Once a week this refreshes both lockfiles within
# the ranges the manifests allow, runs the full CI on the result and merges it
# only when everything is green.
# not what they pull in. A security fix in a transitive crate (rustls-webpki
# under reqwest, October 2026) therefore sat unapplied while every pull request
# failed the audit. Once a week this refreshes both lockfiles within the ranges
# the manifests allow, runs the full CI on the result and merges it only when
# everything is green. It is also what raises Tauri, whose Rust and npm halves
# must move together.
#
# Opening a pull request from a workflow needs one repository setting:
# Settings > Actions > General > "Allow GitHub Actions to create and approve
# pull requests". Without it the branch is still refreshed and checked, and an
# issue with a link to open the pull request says so. It used to fail silently,
# four weeks in a row.

on:
schedule:
Expand All @@ -17,6 +24,7 @@ permissions:
contents: write
pull-requests: write
actions: write
issues: write

jobs:
refresh:
Expand All @@ -35,35 +43,79 @@ jobs:
cargo update
cd apps/gui && npm update --package-lock-only

- name: Open a pull request and merge it once CI passes
- name: Check the refreshed lockfiles and merge them
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
run: |
set -euo pipefail
if git diff --quiet; then
echo "Both lockfiles are current."
exit 0
fi

branch="chore/lockfiles-$(date -u +%Y-%m-%d)"
# One branch, replaced every week: dated ones piled up.
branch="chore/lockfiles"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git switch -c "$branch"
git commit -am "chore(deps): refresh lockfiles"
git push -u origin "$branch"
gh pr create --base main --head "$branch" \
--title "chore(deps): refresh lockfiles" \
--body "Weekly refresh of Cargo.lock and package-lock.json within the ranges the manifests allow. Merged automatically when the full CI passes."
git push --force -u origin "$branch"
sha=$(git rev-parse HEAD)

title="chore(deps): refresh lockfiles"
pr=$(gh pr list -R "$REPO" --head "$branch" --base main --state open --json number --jq '.[0].number // empty')
if [ -z "$pr" ]; then
if gh pr create -R "$REPO" --base main --head "$branch" --title "$title" \
--body "Weekly refresh of Cargo.lock and package-lock.json within the ranges the manifests allow. Merged automatically when the full CI passes." 2> pr.err; then
pr=$(gh pr list -R "$REPO" --head "$branch" --base main --state open --json number --jq '.[0].number')
else
cat pr.err
fi
fi

# A pull request opened with GITHUB_TOKEN starts no workflows, so the
# CI is dispatched on the branch explicitly and awaited here.
gh workflow run rust.yml --ref "$branch"
sleep 30
run_id=$(gh run list --workflow rust.yml --branch "$branch" --event workflow_dispatch -L 1 \
--json databaseId --jq '.[0].databaseId')
if gh run watch "$run_id" --exit-status --interval 60 > /dev/null; then
gh pr merge "$branch" --squash --delete-branch
echo "Merged."
gh workflow run rust.yml -R "$REPO" --ref "$branch"
run_id=""
for _ in 1 2 3 4 5 6; do
sleep 20
run_id=$(gh run list -R "$REPO" --workflow rust.yml --branch "$branch" --event workflow_dispatch -L 5 \
--json databaseId,headSha --jq ".[] | select(.headSha == \"$sha\") | .databaseId" | head -n1)
[ -n "$run_id" ] && break
done
if [ -z "$run_id" ]; then
echo "The CI run on $branch did not start."
exit 1
fi

if gh run watch "$run_id" -R "$REPO" --exit-status --interval 60 > /dev/null; then
ci=passed
else
ci=failed
fi

if [ -n "$pr" ] && [ "$ci" = passed ]; then
if gh pr merge "$pr" -R "$REPO" --squash --match-head-commit "$sha" --delete-branch; then
echo "Merged #$pr."
exit 0
fi
ci="passed, but the merge was refused"
fi

# Someone has to look: say so where it is seen.
issue_title="The weekly lockfile refresh needs a look"
body="CI on \`$branch\` $ci: ${{ github.server_url }}/$REPO/actions/runs/$run_id"
if [ -z "$pr" ]; then
body="$body

This workflow may not open pull requests. Either open it here: ${{ github.server_url }}/$REPO/compare/main...$branch?expand=1
or allow it in Settings > Actions > General > Allow GitHub Actions to create and approve pull requests."
fi
existing=$(gh issue list -R "$REPO" --state open --search "\"$issue_title\" in:title" --json number --jq '.[0].number // empty')
if [ -n "$existing" ]; then
gh issue comment "$existing" -R "$REPO" --body "$body"
else
echo "CI failed on the refreshed lockfiles; the pull request stays open for a look."
gh issue create -R "$REPO" --title "$issue_title" --body "$body"
fi
exit 1
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
attestations: write
steps:
- uses: actions/checkout@v7
with:
Expand All @@ -238,6 +240,20 @@ jobs:
path: artifacts
merge-multiple: true

# Signed proof of which commit and workflow built each file, free of
# charge and independent of the code-signing certificate that does not
# exist yet: `gh attestation verify <file> -R SenseiIssei/Odysync`.
- uses: actions/attest-build-provenance@v4
with:
subject-path: |
artifacts/*.exe
artifacts/*.zip
artifacts/*.tar.gz
artifacts/*.dmg
artifacts/*.deb
artifacts/*.rpm
artifacts/*.AppImage

# A tool whose entire purpose is keeping other software current should be
# installable with `winget install Odysync`. The manifests are generated
# here because the installer's SHA-256 is only known now; submitting them
Expand Down
76 changes: 73 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,17 @@ jobs:
- name: Clippy
run: cargo clippy --workspace --all-targets

# `--bins` as well: the command line is a binary without a library, and
# with `--lib` alone none of its tests ever ran here.
- name: Test
run: cargo test --workspace --lib
run: cargo test --workspace --lib --bins

# Registers, finds and removes a real scheduled task. Only here, on a
# machine that is thrown away afterwards; the test refuses to run
# anywhere else.
- name: Scheduled task test (Windows)
if: runner.os == 'Windows'
run: cargo test -p odysync-backends --lib -- --ignored a_real_task_can_be_created_found_and_removed

- name: Build release (CLI only)
run: cargo build --release -p odysync-cli
Expand Down Expand Up @@ -161,11 +170,34 @@ jobs:
working-directory: apps/gui
run: npm test

# NSIS, the AppImage tools and the like, which Tauri downloads from
# GitHub while packaging. A 504 from there failed the weekly run on two
# platforms; kept between runs, most builds need no download at all.
- uses: actions/cache@v6
with:
path: |
~/.cache/tauri
~/AppData/Local/tauri
~/Library/Caches/tauri
key: tauri-tools-${{ matrix.os }}-${{ hashFiles('apps/gui/package-lock.json') }}
restore-keys: tauri-tools-${{ matrix.os }}-

# The same packaging the release uses: installer on Windows, .dmg on
# macOS, .deb/.rpm/AppImage on Linux, each with the CLI bundled in.
# Started again only when a download of a packaging tool failed; a
# compile error fails at once.
- name: Build and package the app
working-directory: apps/gui
run: npx tauri build --config ${{ matrix.config }}
shell: bash
run: |
set -uo pipefail
for attempt in 1 2 3; do
npx tauri build --config ${{ matrix.config }} 2>&1 | tee build.log && exit 0
grep -qE 'failed to bundle project: .*(http status: 5[0-9][0-9]|timed out|connection)' build.log || exit 1
echo "::warning::a packaging tool could not be downloaded (attempt $attempt)"
sleep $((attempt * 30))
done
exit 1

# Building is not running. Start the real app and require it to still be
# alive after 20 seconds — long enough for the webview to load and the
Expand Down Expand Up @@ -280,13 +312,51 @@ jobs:
path: "**/*.cdx.json"
if-no-files-found: error

# Publishers rename and drop files. An entry that no longer matches makes its
# app look up to date from then on: KeePassXC did for months. Once a week
# every entry is resolved against its publisher.
catalog:
name: catalog
# Not on a manual run: the lockfile refresh starts one, and a publisher
# renaming a file is no reason to hold back dependency updates.
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Resolve every catalog entry
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: cargo test -p odysync-backends --lib -- --ignored --nocapture catalog_entries_resolve

# The oldest Rust the project says it builds with.
msrv:
name: minimum Rust version
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Read rust-version
id: msrv
run: echo "version=$(sed -n 's/^rust-version = "\(.*\)"/\1/p' Cargo.toml)" >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.msrv.outputs.version }}
- uses: Swatinem/rust-cache@v2
- run: cargo check -p odysync-cli --locked
env:
# Lints come and go between versions; here only building counts.
RUSTFLAGS: ""

# A red scheduled run on main means something changed underneath the
# project — a new advisory, a new toolchain, a new runner image — and nobody
# pushed anything that would make them look. Say so where it is seen: one
# open issue, commented on for every further failure.
alert:
name: report a failing weekly run
needs: [test, gui, audit, deny, sbom]
needs: [test, gui, audit, deny, sbom, catalog, msrv]
if: failure() && github.event_name == 'schedule'
runs-on: ubuntu-latest
permissions:
Expand Down
49 changes: 35 additions & 14 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ The workspace is deliberately layered so that safety rules cannot be bypassed
by a backend, and so the CLI and the (Phase 2) Tauri GUI share one brain.

```
odysync-core domain model, version algebra, safety policy, planner, runner
└─ no knowledge of any specific package manager; pure and fully unit-tested
odysync-core domain model, version rules, safety policy, planner, runner
└─ no knowledge of any specific package manager; unit-tested everywhere

odysync-verify SHA-256 integrity + platform code-signature verification
└─ Authenticode (Windows), codesign (macOS), repo-signed (Linux)

odysync-backends every update source and every maintenance tool
├─ direct/ installers straight from the publisher (catalog, Sparkle)
├─ windows_update/, gpu/, oem/, firmware: drivers and the OS itself
├─ windows_update/, gpu/, fwupd: drivers, firmware and the OS itself
├─ guard, scan: what every source's apply and every scan go through
├─ inactive: sources known by name that cannot keep the contract, and why
├─ homebrew, apt, dnf, pacman, zypper, flatpak, snap, nix, …
├─ cleanup, components, devices, startup_items, system_info
└─ winget, chocolatey, scoop: optional
Expand All @@ -53,11 +55,18 @@ backend cannot reach into a front-end, and `core` cannot reach into a backend.
| Always install the approved version | `backends::*::apply` | `--version <exact>` / `pkg=version`; refuses to run without one |
| Confirm the update landed | `core::runner` | Reads the version back; exit code 0 alone is not accepted as success |
| No console windows | `core::proc` | `CREATE_NO_WINDOW`, no shell, `--disable-interactivity` |
| Nothing hangs forever | `core::proc` | Every spawn is time-boxed and `kill_on_drop` |
| Nothing hangs forever | `core::proc`, `backends::scan` | Every spawn is time-boxed and ends with everything it started (a job object on Windows, a session of its own on Unix); every source has its own scan limit; Windows Update runs on a thread that can be left behind |
| An installer never runs twice | `core::runner`, `core::error`, `core::proc` | A timeout is never retried; the installed version is read back instead. `run_installer` waits for what the installer started |
| Never over something newer | `backends::guard`, every `apply` | What is installed is read again and must still be older |
| One run at a time | `core::apply_lock` | An operating-system lock held by app, terminal or schedule |
| Room on the disk | `core::health`, `core::runner` | Checked before every install |
| Windows' own tools are Windows' own | `core::proc` | Full path from `GetSystemDirectoryW`, not from `PATH` |
| Nothing planted next to an elevated installer | `backends::direct::private_dir` | A fresh directory with an administrators-only access list |
| Unattended runs leave drivers alone | `core::model::in_unattended_care` | Used by `care`, `apply --unattended`, the daemon and schedules |
| Stable channel only | `core::policy` | `stable_only` rejects alpha/beta/rc/nightly |
| Store apps never run elevated | `core::model`, `core::policy` | `forbids_elevation()` is a hard block |

Because `core` performs no I/O, every rule above is covered by unit tests that
The policy itself performs no I/O, so every rule is covered by unit tests that
run on all three platforms without needing the package manager installed.

## The version algebra
Expand All @@ -69,7 +78,15 @@ package versions (`1.2.3.4`, `2024.05.01`, `1.0.0-rc.2`, `17.14.29 (March 2026)`
The critical design decision: **an unparseable version is `Unknown`, and
comparing anything against `Unknown` returns `None` — never `Equal`.** Callers
must treat `None` as "refuse to act". This makes "do nothing" the default answer
whenever the tool is uncertain, which is the opposite of v1's behaviour.
whenever the tool is uncertain, which is the opposite of v1's behaviour. The
same goes for two versions whose difference has no agreed meaning, such as
`1.0.0` against `1.0.0-4`.

Distribution packages follow rules of their own. `1.1.1w-0+deb11u1` to
`+deb11u2` is a security update, and the general rules read it as the same
version. `core::version_native` implements dpkg's, rpm's and pacman's ordering
and PEP 440, tested with the reference cases of each; `Version::parse_as`
selects one, and versions under different rules are never compared.

## winget table parsing

Expand Down Expand Up @@ -103,11 +120,14 @@ three:
2. the URL must belong to the publisher — a GitHub asset must be a release of
the repository the catalog names, a vendor URL must start with the pinned
prefix — and every redirect must stay on HTTPS;
3. the file is opened with `FILE_SHARE_READ` only, so nothing can write,
3. the download directory is new, and when Odysync is elevated only
administrators can write to it (a library next to an installer is loaded
with its rights);
4. the file is opened with `FILE_SHARE_READ` only, so nothing can write,
rename or delete it until the installer exits, and it is hashed from disk
under that lock;
4. the published digest must match;
5. the Authenticode signature must be valid and its subject's CN or O must
5. the published digest must match;
6. the Authenticode signature must be valid and its subject's CN or O must
equal the signer the catalog pins. The subject is parsed, not searched, so
a quoted comma or a longer name cannot satisfy the check.

Expand All @@ -118,16 +138,17 @@ Apple Team ID.

## Adding a backend

Implement `core::backend::Backend` (five methods) and add one line to
Implement `core::backend::Backend` (six methods) and add one line to
`backends::all_backends()`. Nothing else changes: policy, planning,
verification, reporting and both front-ends pick it up automatically.

The trait's contract is documented in `core/src/backend.rs` and is binding —
in particular, `apply` must pin an exact version and must never fall back to
installing a package that is already present.
installing a package that is already present. `backends::guard` has the checks
every `apply` starts with. A tool that cannot install one exact item belongs in
`backends::inactive`, with the reason.

## Status

Version 3.0: about 620 Rust tests and the frontend tests run in CI on Windows,
macOS and Linux, which also packages the app for all three. What remains open
is in [NEXT.md](NEXT.md).
What is verified, how, and what is not is kept in [NEXT.md](NEXT.md); what comes
next in [ROADMAP.md](ROADMAP.md).
Loading
Loading