## [0.6.0] - 2026-11-21
### Added
- Immich albums: with `--albums` (or `--album-month` / `--album-year`),
each uploaded asset, newly created or answered `duplicate`, is added to
a month album and a year album named from its post date in the run's
zone (`EDC November 2026` and `EDC 2026` by default). Albums are found
by exact name among those the API key's owner owns and created only
when absent, shared as editor with the `--album-share` user IDs, so
reruns never make a second album. Adds are batched per album and
idempotent. bairn only ever adds: it never removes an asset from an
album, deletes an album, or trashes anything. The key needs
`album.read`, `album.create` and `albumAsset.create`. The state file
records `postedAt` and `albumsFiledAt` per asset, so an asset whose
filing failed or was interrupted is filed on the next run; entries
written before these fields existed are not back-filed.
- `bairn smoke immich` (login path) runs an album leg with a key holding
only `asset.upload`, `album.read`, `album.create` and `albumAsset.create`,
sharing to `SMOKE_SHARE_USER_EMAIL`, and cleans up with the login session.
The login-path round trip no longer mints `asset.delete`.
- `--allow-missing-state`: `bairn fetch` now refuses to upload to Immich
when the state file is absent but the save dir already holds media
(every file would look new); the flag overrides the refusal. The check
runs for every fetch, dry runs included, and a dry run no longer
records assets in the state file.
- `--tz` / `BAIRN_TZ` set the fallback zone for video dates. `--max-pages
0` (unlimited) is documented and tested as the way to walk a full
history.
- Both the Famly and Immich clients retry transport errors, 429
(honouring `Retry-After`) and 5xx with capped exponential backoff and
jitter; other 4xx fail at once. A retried Immich upload is safe: the
server dedupes on the file checksum per owner and answers
`duplicate`.
- A Famly 401 mid-run refreshes the token once through the token
source (ADR 0003) and retries; a second 401 fails.
- The feed walk pauses one second between pages.
- CI: a weekly scheduled `drift-gate` run against the operator's own
Famly account (two GETs). Drift diffing now treats `<empty>` and
`null` shapes as wildcards and merges nested shapes across
feed items, so a week with photos is not reported as drift.
- `IMMICH_VERSION` in the Makefile names the Immich release bairn is
verified against via `make pre-tag-check`; Renovate tracks it with
automerge off.
- XMP `digiKam:TagsList` (flat child names, same source as
`dc:subject`) in the photo packet; Immich reads it and ignores
`dc:subject`.
- Videos now carry metadata: a standalone `<file>.xmp` (description,
date with its offset, tags) is written beside each video and sent to
Immich as `sidecarData`. Photos still embed their XMP and get no
sidecar.
### Changed
- The default save root and state directory (under the XDG data and state
dirs) are set to mode 0700 even when they already existed at a looser
mode. A directory you choose with `--save-dir`, `BAIRN_SAVE_DIR` or
`BAIRN_STATE_PATH` is created at 0700 if missing but never chmodded;
bairn logs a warning when it is accessible to group or other.
- `main.Version` defaults to `dev`; `make build` targets stamp it from
`git describe`. The EXIF Software tag reads `bairn 0.6.0` for a `v0.6.0`
tag and `bairn dev` for an unstamped build, including a build from a
source tarball with no `.git`. `make build VERSION=v0.6.0` overrides it.
- Every client that carries a credential (Famly login, Famly API, drift
probe, Immich, the contract and smoke gates) refuses a redirect to another host or from https to
http, and stops after 10 redirects. Immich previously refused all
redirects; same-host ones now follow.
- A 401 or 403 from Immich, or five failed uploads in a row, stops
uploads for the rest of the run instead of retrying every asset; the
rest are saved to disk, counted in `uploadFailed`, and a rerun
uploads them. A 403 now reports as unauthorized.
- `bairn fetch` logs the zone it will use for zoneless posts.
- Scheduled pipelines run only `drift-gate`; every other job sits behind
an include that skips schedules.
- `bairn drift --diff` exits 2 when a manifest endpoint has no readable
baseline file, instead of printing `ok`.
- Drift shapes walk every feed item and every nesting level (no
5-item sample, no depth cap), so tag fields now appear. Reseed
`discovery/baselines/main/` from the next schedule artifact.
- A response field that arrives as a different container than bairn's
struct declares is recorded as `<object>` or `<array>`, so vendor
keys never reach a shape. The drift artifact is developer-only.
- Drift documentation lives in `discovery/baselines/main/README.md`.
### Removed
- `discovery/probe/shape.py`, superseded by `bairn drift`.
- CI: the `drift-gate-immich` and `smoke-immich` jobs (web/api only,
never reachable from the runner), the Immich drift manifest and
its empty baseline, and the `claude-drift-triage` include. `make
pre-tag-check` remains the Immich gate.
- The vendored Immich `openapi.json`, the unused generated `imapi`
client, the oapi-codegen config, `make gen-immich` and
`make refresh-immich-spec`, and the oapi-codegen `go.mod` tool.
The hand-written `api/immich` client and its contract test stay.
### Fixed
- Videos upload to Immich: bairn sent a `filename` form field, and
Immich validates every file part against it, so a video's `.mp4`
name rejected its `sidecar.xmp` part ("Unsupported file type"). The
name now rides only on the asset part. The README's
`IMMICH_BASE_URL` example now ends in `/api`, which the client needs.
- Videos download again: Famly sends a video's link as `videoUrl`, and
bairn read `url`, so every video was discovered with no link and
never saved. Videos Famly is still transcoding are left for a later
run.
- Images Famly labels "UTC" are dated in `--tz` / `BAIRN_TZ` (default:
the local zone) like zoneless ones: Famly stores the instant, not
where the photo was taken, so a Detroit nursery's photos no longer
land 4-5 hours late, or on the next day, in Immich's timeline.
- Neither client follows a redirect that would replay its credential
header to another host (Immich follows none, Famly stays on its host).
- An image with no zone of its own is dated in the local zone (as videos
are), not as a UTC wall clock.
- A download error no longer carries the signed CDN query string.
- Retry-from-disk refuses a recorded path outside the save directory.
- The state lock lives on `<state-path>.lock`; on the state file itself it
was lost at the first flush, so a second `bairn fetch` could run.
- A video's `.xmp` sidecar is written before the media file, and added
beside media already on disk, so a retry-from-disk never lacks it.
- The save path is refused when a vendor id would resolve outside the
save directory.
- State, config and archive directories are created 0700.
- A `Retry-After` longer than the 30s backoff cap is honoured up to five
minutes; a longer one ends the retries instead of hammering a 429.
- A feed walk whose cursor stops moving ends with `feed cursor did not
advance` instead of looping on the same page.
- A video in a post with no zoned image was dated as UTC, so it showed
hours late in the timeline. It now uses the zone of the running
machine (override with `--tz` or `BAIRN_TZ`), with the offset
computed at the post's date.
- The Immich upload no longer sends `deviceId` / `deviceAssetId`;
Immich 3.x dropped them. The Immich floor is now v3.0.2, and
`IMMICH_VERSION` is pinned to 3.0.2, the version the home server
runs.
- A failed Immich upload is retried on the next run. Assets saved to
disk but not confirmed in Immich (a failed upload, an Immich outage,
or an earlier `--no-immich` run) are uploaded from the disk sink,
with the video `.xmp` sidecar, instead of being skipped. `duplicate`
counts as confirmed. The fetch summary gains `uploadDuplicates` and
`uploadFailed`, and `bairn fetch` exits 1 while any upload failed.
Entries in existing state files without `uploadedAt` count as not
uploaded.
- The state file is flushed every 50 changes and on exit instead of
being rewritten and fsynced on every change, which was quadratic
over a full history.
- `bairn drift` exits 2 when an endpoint errors, answers non-2xx, or
serves a non-JSON page, instead of passing on the endpoints that
did answer. With `--anonymize` it no longer prints response sizes.
- A merged array shape keeps its `<n=*>` marker when the first sampled
item had an empty array.
- The video sidecar also carries `exif:DateTimeOriginal`, the date tag
Immich reads, and its offset comes from the zone of a sibling image
in the post instead of a fixed `+00:00`. An image's offset is now
evaluated at the instant that is stamped.
- EXIF `DateTimeOriginal` and XMP `photoshop:DateCreated` now carry the
wall-clock time in the labelled offset. Previously the UTC clock
reading was written next to a non-UTC offset, so the label disagreed
with the time. Files already archived keep the old values.