# Rescue: unversioned source copy on archdev

Found 2026-08-11 while auditing archdev for uncommitted work.

## What it is

`/home/casey/souveraine` on archdev (10.10.20.123) is a **full copy of this
repo with no `.git` directory at all**. 236 Rust files, a live `souveraine.toml`
and `souveraine.log`, newest source files timestamped **2026-08-09 21:07**.

It is not a worktree and not a clone. Nothing tracks it. Anything written there
was one `rm -rf` away from being gone, with no reflog and no remote.

Not to be confused with `/home/casey/Projects/souveraine` on the same box,
which *is* a git repo (branch `primary`, HEAD `d2f51e9`, 107 commits behind).
That tree's 499-line uncommitted sessiond diff was checked line by line and is
**already upstream** — 356 of 359 substantive added lines present at HEAD, the
3 misses being later refinements. No loss there.

## How it was audited

Every file under `src/ surfaces/ packaging/ tools/ docs/ scripts/` in the copy
was hashed with `git hash-object` and tested against this repo's object
database with `git cat-file -e`. Content that has ever been committed —
on any branch, at any point — is known to the object db. What isn't known has
never been committed anywhere.

1545 files checked. 175 unknown, of which 165 belong to the vendored
`packaging/upower-souveraine` submodule (separate object db — expected).

**Ten files remained.** Two are identical to HEAD (untracked paths). The rest
are below.

This method generalises: to prove a stray tree holds nothing new, hash its
files and ask the object db. Timestamps and `diff` cannot tell "never
committed" from "committed then superseded". Blob identity can.

## What is actually unique

The copy sits just after `b2774c8` (*sessiond: a power seam that cannot report
an outcome it does not have*, Aug 9 19:31) and carries follow-up work done at
21:07 that was never committed. That commit's own message says "Session.qml
keeps the legacy executor until this is exercised on hardware" — this is the
next step, orphaned.

Roughly 50 substantive lines with no upstream equivalent:

- `device_state.rs` — `power_request_failed()`. Releases the in-flight power
  latch **only on the failure path**, because success is the machine going
  down. Without it a refused suspend (lid policy, a blocking inhibitor) leaves
  the latch set and deafens the verb for the rest of the uptime.
- `protocol.rs` — `logind_capability()` plumbing for the capability query.
- `server.rs` — `logind_can()`: ask logind live (`CanPowerOff` etc.) before
  firing a power verb, and refuse honestly instead of firing one the machine
  cannot honour. Deliberately not cached: hibernate depends on swap that can
  change after boot, and a cached answer would be exactly the shadow copy
  doctrine §4 forbids. Carries a parse fix — an earlier version lived in `sh`
  behind two escaping layers, matched a literal `\"` busctl never emits, and
  left every capability reading "unknown" on the phone.
- `HidController.qml` — 8 lines, `_notReadyReason()` threading.

Superseded, do not resurrect: `Action::Dim => brightnessctl set 10`. That is
the absolute-value form `eb0292c` replaced with a percentage twelve minutes
after this copy was made. `Face.qml`'s `joinHands` landed upstream already.

## Contents here

- `files/` — the ten files verbatim as found on archdev.
- `vs-HEAD-517d8c1.diff` — their delta against this repo at rescue time.

**Not merged.** The tree has moved 100+ commits since; applying this needs a
human who knows the sessiond power seam. Preserved so the decision can be made
later instead of never.

## Follow-ups

- Decide whether the logind capability gate lands. If yes it wants rebasing by
  hand, not `git apply`.
- Delete or convert `/home/casey/souveraine` once the decision is made — an
  unversioned copy of the repo on a build box is a standing hazard.
- `/home/casey/Projects/souveraine` on archdev is 107 commits behind and holds
  `.git.broken-2026-07-29/`. Worth reconciling.
- Paths differ per machine: the souveraine remote is `gitea` on the laptop and
  `origin` on archdev. Check `git remote -v` before blaming the network.
