Commit Graph
77 Commits
Author SHA1 Message Date
Claude f1720e7779 merge: third-pass archive, image and analysis fixes (W-1, W-5, W-7, W-13, W-14)
Merge branch fix3/data-images into the verification branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 20:18:40 +00:00
Claude 94ef3c88db fix(archive): partial writers keep the folder changed for the scan; image flags follow queued passes and hashed photos
Writers that change part of a sequence (decode tiers, image-pass flags,
analyses, verify flushes and stamps, duplicate flags, title/tags/rating/
notes edits, mass rename) now ask ArchiveIndexer.InStepAsync before their
own sidecar write and record the folder's scan stamps afterwards only when
the index held the folder as it was: the stored stamps are still the
folder's and the row holds the sidecar's frames. What another process
changed in the sidecar alone (frames, a new title) stays visible to the
next incremental scan, which writes the whole row from the sidecar.

EditSequenceInfoAsync reads sidecar and row under the lease and writes the
row through SequenceRepository.EditAsync at the settings version it read,
applying the edit again on a conflict, then the sidecar from the stored
row; settings and frames committed meanwhile stay. MassRenamer writes only
folder and title (RelocateAsync, whose null title now keeps the current
one). Verify flushes and duplicate flags run under one lease.

A scan that finds frames another writer listed in the sidecar itself
clears AnalyzedLight, ThumbsBuilt and ProxiesBuilt only in its own row and
only on a server (ImagesAfterScan); the shared sidecar keeps the writer's
flags, so a desktop's poll no longer makes the server redo its passes.

An image pass overtaken by an upload keeps its flag while a pass of the
same kind is queued for the sequence. ThumbPack.IsFrom accepts a thumbnail
drawn before a verify hashed its photo, in the pass, in SameFrames and in
the server's thumbnail lookup, which answered 404 for every such frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 20:16:58 +00:00
Claude 48ae3efd22 fix(archive): scans see frames another writer changed; partial writers keep the row and the lease
A desktop sharing the archive that imports into an existing sequence lists the
new frames in the sidecar itself and keeps its ThumbsBuilt and ProxiesBuilt.
The server scan cleared the flags only when SequenceAdopter.Reconcile found
unindexed photos, so it queued no image pass: the new frames, and every frame
they renumbered, answered 404 on /thumb and /proxy until a pass was forced.
A scan now also clears AnalyzedLight, ThumbsBuilt and ProxiesBuilt when the
sidecar's frames version differs from the index row's, decided under the
sequence lease, and its follow-ups queue the light analysis and both passes.

Writers that change only part of a sequence wrote the whole index row back
from a sidecar read under a lease they had already released (decode tiers) or
without any (verify stamp): an ingest or a PATCH committed in between was
undone, and a row written from a sidecar the index had not synced claimed its
frames version, hiding the change from the scan. FrameTiers.RecordAsync and
ArchiveVerifier now write the sidecar and only their own columns
(SequenceRepository.RecordTiersAsync, RecordVerifiedAsync) under one lease.
They and the image passes record the folder's scan stamps only
while the index holds the sidecar's frames version
(ArchiveIndexer.RecordStampsInStepAsync), so the next scan still sees frames
another process added.

An image pass decided ThumbsBuilt/ProxiesBuilt from the sidecar it read at
its start and set the flag again after a scan had cleared it for photos added
meanwhile, so no pass was queued for them. MarkAsync now holds the lease for
the sidecar and the index, and sets the flag only while the sidecar lists the
photos the pass read at the same indexes; otherwise it clears it.

A rebuild deleted every row whose folder was not among those listed when it
began, so a sequence that got its first frame or was created by an upload
session while it ran lost its row (404 for the Uploader, a second '(2)'
sequence for the session). A row is now checked again under its lease, as it
and its folder are then, before it goes.

Tests: a desktop's ArchiveIngest commit followed by a server scan (Data and
Server, /thumb and /proxy answer 200 for every frame); a thumbnail pass with
a scan's reconcile in between; tier records and a verify stamp interleaved
with a PATCH and with another writer's frames, on SQLite and PostgreSQL; a
rebuild during which uploads place and create sequences.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 19:21:44 +00:00
Claude 93054ba5de fix(server): proxy uploads carry their body limit before any early answer
PUT /api/v1/frames/{id}/proxy raised Kestrel's 1 MiB limit only inside the
handler, after its 404 and 422 answers and after authentication's 401 and
403. A proxy above 1 MiB left unread then closed the connection, and the
client retried a network error instead of reading the answer. The route now
carries IRequestSizeLimitMetadata (ArchiveImages.MaxProxyBytes) like the
chunk route, so routing applies it before anything answers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 19:00:39 +00:00
Claude 51acc7f91b merge: sync and project position fixes (V-9, V-10, V-21, V-29, CD-2)
Merge branch fix2/sync-positions into the verification branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 17:10:58 +00:00
Claude a56aaf8d65 fix(sync): translate positions only against the frames they name
Positions crossing copies could still land on other photos in three
windows:

- A push translated a row snapshot's settings against local frames
  listed later, after a manifest round trip: an import of earlier photos
  meanwhile moved the row's positions, and the server stored shifted
  exclusions, hero and keyframes. SyncPositions now reads this copy's
  row with its frames as one state (frames listed between two reads of
  the row at the same frames version) and translates that row's
  settings, at the settings version being pushed. The conflict
  comparison and ApplyLocallyAsync compare against that same row. When
  the copy was edited since, or its frames keep changing, nothing is
  sent or applied and the next comparison translates again (Keep mine
  reports a changed conflict; PushAll sends an edit saved meanwhile).
- The manifest read the sequence row, then paged its frames: an upload
  committed in between paired settings of one frames version with
  frames of the next. The server now lists them again while the frames
  version moved during the listing, then inside a transaction holding
  the row (on SQLite, on that transaction's connection, so no second
  pooled connection waits behind the write lock). The client also
  refuses to translate against a manifest whose frames are not each
  listed once at 0..n-1.
- Server capture times were fetched only when something was unhashed,
  so the same parked photo was written with or without capturedAt. They
  are now fetched whenever the two frame lists differ; an equal project
  then compares equal, and an entry can be placed on a photo that
  arrives unhashed.

CompareOriginals counted unhashed server frames one-to-one against this
PC's photos, so two copies of one photo in a folder the server adopted
left Download on offer forever while the download fetched nothing. A
photo on either side is now there when any photo of the other side
matches it, as downloads and uploads find them. Paged frame listings
keep each frame once (an insertion between pages lists one again).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 17:09:30 +00:00
Claude e9870f4e88 merge: proxy and decode-tier fixes (V-1, V-24, V-25, V-26, V-27, V-28)
Merge branch fix2/proxies-tiers into the verification branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 16:54:07 +00:00
Claude 78190476be merge: desktop settings fixes (V-4, V-6, V-7, V-30, V-31, V-32, V-34, ENG-08)
Merge branch fix2/desktop-settings into the verification branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 16:54:07 +00:00
Claude 61c7e9e7e3 merge: server archive fixes (V-5, V-8, V-11, V-16, V-35, V-36)
Merge branch fix2/server-archive into the verification branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 16:54:04 +00:00
Claude 4014b0e669 fix(proxies): judge proxies by one rule and record tiers and reports as they stand
- ArchiveImages.IsProxyOf compares capture times to the microsecond the index
  keeps (sidecars and Exif keep 100 ns ticks), and for frames read through
  proxies also applies the policy's size rule, so the proxy pass, uploads,
  thumbnails, renders, analyses, tiers, manifests and downloads agree.
- Proxy headers are cached per file while length and write time are unchanged
  (and the file has settled), so manifests cost a stat per proxy.
- FrameTiers.RecordAsync checks proxy presence when it writes the sidecar and
  returns the sequence's frames as they are, so a deep analysis or render that
  ran while proxies arrived no longer flags the frames preview-only again, and
  the analysis advises from the current flags.
- Server manifests ignore ProxiesBuilt for frames the server cannot decode, so
  frames added since the last proxy pass are asked for their proxies.
- GET /sequences/{id}/analysis/report answers 404 for a report that found
  frames unreadable before their proxies arrived (DeepReports.ReadCurrentAsync).
- The deep checkpoint key marks only frames read from proxies, so checkpoints
  written by earlier versions still resume.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 16:52:30 +00:00
Claude c68590920f fix(archive): the admin form reads archive.json; a poll never undoes an admin's edit
GET /api/v1/archive/settings refreshes the served archive from
archive.json first, so the admin form (which saves every field) starts
from a desktop's change made since the last poll instead of writing the
old templates back. ServerArchive.RefreshAsync replaces the served
archive only when the refresh registered a change, and only through a
compare-and-swap against the archive it read, so a poll racing an
admin's PUT no longer puts the pre-edit row back for ten minutes.

RefreshSettingsAsync now ignores an archive.json a newer Titano wrote,
as documented, instead of registering what this version reads of it.

AppServicesTests now points the folder at an archive the index does not
list first, and checks that the archive no longer chosen gets no scan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 16:33:56 +00:00
Claude 3a74527f46 fix(server): the chunk route raises its body limit before authentication
Authentication answers 401 and 403 before the endpoint runs, with the chunk
unread; over Kestrel's 1 MiB limit the connection was closed and the
Uploader saw a network error instead of being asked to sign in. The chunk
route now carries IRequestSizeLimitMetadata for the largest chunk size a
server allows, which routing applies when it selects the endpoint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 16:29:33 +00:00
Claude ea6e1a69e0 fix(sync): keep project positions on their photos when settings cross copies
Settings synced between a PC and its server sequence were stored as they
came, in the other copy's frame order. When the inserted photos arrived
later (a download, an upload), the index moved those already-correct
positions a second time, so exclusions, the hero and camera keyframes
landed on other photos (V-21, CD-2).

- Settings are translated by photo (SHA-256, else size and capture time)
  to the frames of the copy they go to: the server's before they are
  compared or applied here, this PC's to the server's frames as its
  manifest lists them before a push (SyncPositions).
- A position on a photo the receiving copy lacks waits in project.json as
  a pending frame and takes its place when the photo arrives, on an
  insertion or an append in step with the index; the Library's hero
  frame follows. A hero chosen meanwhile wins, and advice does not fill
  a hero while one waits. Old projects without the member are unchanged.
- Pushes send expectedFramesVersion; PATCH /api/v1/sequences/{id} answers
  409 frames_conflict when the frames changed since, and the next
  comparison translates again.
- A pulled payload equal to the local copy is settled without the
  archive: an offline or read-only archive no longer fails the
  comparison (V-10).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 16:20:11 +00:00
Claude b4f1fa32d5 fix(proxies): use only a frame's own proxy and let tiers, reports and built flags follow it
- Renders, analyses, the server's manifests and proxy downloads take a proxy only
  when its Exif capture time is the frame's (ArchiveImages.IsProxyOf); one left at
  the index by a frame renumbered since counts as missing and is asked for again
  (V-24).
- A frame whose original the host reads through its proxy (HEIF on the server) is
  preview-only only while it has none: the light analysis and the proxy pass keep
  the flag, the preview-only count, the light finding and the advisor's output cap
  in step with the proxies, and an arriving proxy queues a light analysis on the
  server (V-1, V-25).
- The deep checkpoint's content key includes whether each frame is read from its
  original or its proxy, and analysis.json lists the frames measured from proxies;
  an unreadable verdict on a frame now read from its proxy makes the report stale
  (V-26).
- Thumbnails drawn from proxies are compared with the archive's thumbnail size
  instead of 320 px (V-27).
- A resumed thumbnail or proxy pass sets ThumbsBuilt/ProxiesBuilt only when the
  frames an earlier run did still have theirs, and the proxy pass logs frames
  waiting for a client's proxy apart from unreadable ones (V-28).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 16:07:31 +00:00
Claude b344d2a527 fix(archive): polling follows the archive folder; the index follows an archive.json changed elsewhere
- The desktop's rescans run for the whole session and each one targets the archive at Settings › Archive's folder
  (as the Import and Archive screens do), so an archive created on the first run, chosen in Settings, relinked or
  imported with settings is rescanned from the next tick on, and Rescan every always reaches a live timer. The
  folder of the start is reopened (relink, interrupted renames) as soon as its archive.json is there, so an
  unplugged drive or a folder without an archive no longer stops polling for the session.
- ArchiveService.RefreshSettingsAsync reads archive.json and registers the archive again when its name, templates
  or proxy size changed elsewhere (a server's admin panel, another PC); null when the file cannot be read, is newer
  or belongs to another archive. Desktop rescans and the server's polling call it first, so imports, uploads and
  the admin panel follow the shared settings without a restart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 16:02:15 +00:00
Claude 98f301f5fd fix(server): answer every chunk request and out-of-range archive.json policies
The chunk endpoint raised the request body limit only before reading a chunk. A
chunk sent again after a lost answer, or to an unknown or finished upload, was left
unread above Kestrel's 1 MiB default, so Kestrel closed the connection instead of
delivering the answer. The limit is now raised before any answer, to the larger of
the upload's and the server's chunk size, and never lowered.

PUT /api/v1/archive/settings answered 500 when archive.json held a thumbnail size or
proxy quality out of range, which the admin API cannot set. It now answers 409
archive_policy with the policy to correct in details (Server.Error.ArchivePolicy).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 15:58:48 +00:00
Claude fba05c2840 fix(archive): scans leave sequences waiting for a folder alone and build server images
A sequence created through POST /api/v1/sequences keeps an empty folder until its
first frame. Scans no longer adopt loose photos at the archive root under its id,
and a rebuild, the orphans report and fix, verify and the scan follow-ups no longer
treat it as the root sequence, as missing or as a sequence to analyse. All of them
use ArchiveIngest.AwaitsFolder.

On the server (ArchiveServiceOptions.ImagesAfterScan), a scan that indexes sequences
without thumbnails or proxies queues background Thumbs and Proxies passes for them,
as an upload does. A scan that finds photos added or removed clears ThumbsBuilt and
ProxiesBuilt together with AnalyzedLight.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 15:58:37 +00:00
Claude 1dc93932cc fix(server): report Windows service start and stop failures to the event log
A service has no console, and a refused data folder or server.json throws
before the server's log file exists, so the SCM recorded only error 1064
and the entry to check was lost. ServiceMain and the stop path now also
write the reason to the Application event log (source TitanoServer,
advapi32 ReportEventW, no message file registered). The Windows README
says where to look and that a data folder created by an unelevated
console run must be deleted or given to Administrators first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 15:51:22 +00:00
Claude 348d580d4d Merge branch 'fix/imaging-metadata': decode tiers, preview-only and undecodable frames, GPR companions, MakerNote fields
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 11:46:58 +00:00
Claude 1b974b1281 style(tests): sort the usings of the archive module tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 11:44:18 +00:00
Claude 3b1b743fcd Merge branch 'fix/ingest-upload': uploads into API-made sequences, damaged frames repaired, positions follow inserts, cardEvent
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 11:44:09 +00:00
Claude bbc7f244fa fix(data): never let the compile_options probe block opening an index
Any failure of the informational PRAGMA compile_options probe is logged
and gives an empty list; before, anything but a SqliteException was cached
by the lazy value and rethrown by every later open.

Tests now cover the decode-tier fields end to end: the Library's
preview-only chip and its plural tooltip, server cards and frames carrying
previewOnlyCount and the preview size over the API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 11:17:55 +00:00
Claude ccbd5132ee Merge branch 'fix/proxies-render-sync': proxies from clients and nodes, node manifests, sync and mass-rename fixes, server polling
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 11:12:25 +00:00
Claude 24ad790c37 Merge branch 'fix/server-hardening': Windows secrets, trusted proxies, Docker and Unraid fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 11:10:50 +00:00
Claude df2d4b4316 fix(server): refuse planted Windows data, guard new archives, trust only loopback proxies
- Windows data folder: the folder and everything in it must belong to SYSTEM,
  Administrators or the server's account and hold no link, checked before the
  ACL is rewritten; otherwise the server stops and names the entry. server.json
  is read only after its owner is checked on the open handle. Secrets are
  deleted and created anew with the private ACL, so a planted file's owner
  loses its rights.
- Windows archive: a folder the server creates is changeable only by those
  accounts (users may read it) and a .titano folder it creates is private; an
  existing archive others can change is logged as a warning at start.
- Proxy mode: only loopback is trusted by default, since LAN clients reach the
  HTTP port from private addresses; a cookie sign-in that did not come through
  a trusted proxy over HTTPS answers proxy_untrusted, naming
  TITANO_TRUSTED_PROXIES.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 11:08:12 +00:00
Claude f215b99ca5 fix(proxies): ask again for preview-sized proxies and refuse unwanted ones
Earlier versions made the server's proxies of HEIF frames from their embedded
previews. Those carry the frame's capture time, so the proxy pass kept them
and the sequence stayed marked as having all its proxies; renders and
analysis then read thumbnail-sized files and no client or render node was
asked for a real one. The proxy pass now treats a proxy whose long edge falls
short of the policy's for the frame (its own size when smaller, a tenth of
slack, frames of unknown size not judged) as stale, and the server refuses
such a proxy when one is sent (422 proxy_too_small).

PUT /api/v1/frames/{id}/proxy also took a proxy of a frame the server
decodes itself, replacing its own proxy with any JPEG of the right capture
time; it now answers 422 proxy_not_wanted for those and for frames missing or
damaged. Its follow-up jobs are queued even when the sender disconnects once
the proxy is filed.

A render node cleared the server's Undecodable flag on every frame, so a
damaged frame the server's own render skips was downloaded and failed the
node's job. Only a format the server cannot decode and the node can loses the
flag now; other undecodable originals are neither fetched nor rendered unless
read from their proxy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 11:06:42 +00:00
Claude 56aa4da674 fix(settings): restore before the index opens; archive rows edit only their archive; parallelism follows the brief
Index restore (ENG-06, UI-09):
- A staged restore now runs on the files before the index is opened, so it also
  recovers an index that no longer opens; Settings > Advanced > Restore works
  without an open index (the current one is shown as unreadable).
- The staged copy passes PRAGMA quick_check (before migration, in a scratch copy)
  ahead of any backup: a damaged copy is set aside as .failed and never renews the
  daily copies. The index it replaces is kept as a VACUUM INTO copy, or, when it
  cannot be read, copied whole with its WAL as titano-replaced-<stamp>.db outside the
  rotation. The staged file is renamed over the index, so it is never applied twice.
- Archive > Maintenance gains Restore database..., which opens Settings > Advanced.

Archive settings (UI-03, ENG-03):
- An archive.json with an empty or overlong name (drive roots) can be edited again:
  the name read is made usable as at creation.
- Proxy and thumbnail sizes outside the presets (an admin's 3840) are listed and
  shown with their number.
- Changing the archive folder retargets the rows: an archive there is registered
  and rescanned; with none, the rows edit only the defaults of new archives. The
  rows never fall back to another archive of the index.
- Reset all and Import settings no longer rewrite the shared archive.json; Archive >
  Reset section asks first, naming the archive.
- PUT /api/v1/archive/settings: 409 archive_busy on a lease conflict, 409
  archive_manifest for a damaged, newer or foreign archive.json (was 500).

Parallelism (UI-02):
- Auto is the job engine's default, half the logical cores (BRIEF 14.6), with each
  job's own decode and analysis threads; a value the user sets is the number of
  workers and caps those threads. The memory budget is shared: each job's frame
  window gets budget / workers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 11:06:27 +00:00
Claude 1de6717dda fix(events): card reports cannot crowd the event queues or hold an import
The server publishes one account's card progress at most once a second
(sooner reports are taken and dropped) and at most 120 card events of an
account a minute (429 rate_limited beyond), so an upload-only account
can no longer push job and sequence events out of every client's queue.

On the client, the end of a card import waits at most two seconds for
its reports to reach the server, then cancels whatever is still on its
way, so a cancelled import or one that lost its server ends at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 10:56:18 +00:00
Claude 886132b5bb fix(upload): repairs charge no quota and another sequence's copy no longer blocks them
A re-upload that repairs a missing or damaged frame is now reported as
IngestResult.Repaired and adds nothing to the uploader's used bytes; the
quota checks at start and completion skip uploads whose target sequence
already holds the content. The start shortcut and crash recovery share
one rule (UploadRules.StandIn): an intact copy stands for the upload, the
target sequence's own copy first, except when the target holds the
content only in damaged copies, which the upload's bytes then repair.
A sequence adopted at the archive root that holds frames is never given
a new folder when its root sidecar is missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 10:53:49 +00:00
Claude 3e146c9f9f feat(settings): make every Settings row real; archive settings, index backups and restore
Settings (UI-01, UI-02, UI-03, UI-09, RF-4):
- New Import, Analysis and Formats pages, in the order of Settings.html. Import holds
  the defaults of new cards (session rules, subfolders, verification, duplicates,
  after-import actions); Analysis the deep-analysis width cap, night and star-field
  thresholds and deep analysis after import or scan; Formats the decode tier of every
  format on this PC with a notice and Store install link per missing codec extension.
- Archive gains thumbnail size and rescan interval; its templates, proxy size and
  thumbnail size are the open archive's own (archive.json) and new archives' defaults.
- Rendering quality, parallelism and background priority now drive the jobs: quality
  maps to preparation size, read-ahead and default flow quality; parallelism sets the
  engine's workers live and caps per-job threads; background priority raises the UI
  thread while Titano is in front.
- Advanced gains Restore (daily backups, dry-run summary, destructive confirmation,
  staged for the next start) and Reset all.
- The naming preview's sample title is a catalog string.

Engine (ENG-03, ENG-04, ENG-06):
- ArchiveService.GetSettingsAsync/UpdateSettingsAsync rewrite archive.json atomically
  under a lease, then the index row; the server endpoint and the desktop use them, and
  the desktop creates archives with Settings › Archive. ThumbnailPolicy in archive.json
  sizes the thumbnails.
- DatabaseBackups: daily VACUUM INTO copies kept x3 on the desktop and on a server on
  SQLite (DatabaseBackupService), staged restore checked and preceded by a fresh copy.
- Maintenance vacuums the SQLite index when 10 % or more is free (dry run reports it).
- JobEngine.SetWorkers; ProcessingOptions.Tune applies host tuning per job.

Archive setup toasts say why in a localized sentence (RF-1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 10:06:34 +00:00
Claude 9588ed7f4b fix(proxies): get proxies of undecodable originals from clients and nodes
The server decodes with managed decoders only, so HEIF originals had no
proxies, thumbnails from their small previews and no pixels for analysis or
managed renders, and nothing could send it proxies (ENG-05). Manifests now
carry the archive's proxy spec and, per frame, its flags and whether the
server wants its proxy. PUT /api/v1/frames/{id}/proxy (Edit or RenderNode)
stores a JPEG of at most 64 MiB that decodes and whose Exif capture time is
the frame's, then queues thumbnails and the proxy pass. An upload from the
desktop makes and sends the wanted proxies after the originals and counts
them as local changes; a render node sends those it can make from the
originals it fetched once the job is done. The server never makes such a
proxy from a preview, drops one left by a renumbered frame, takes thumbnails
from a proxy, and analyses and renders those frames from their proxies.

Render nodes fetched every frame of the manifest: frames missing, corrupt or
excluded on the server failed the download, and originals not hashed yet
failed the SHA-256 check (ENG-07). Nodes now skip those frames, fetch unhashed
originals into the job folder with a size check, judge decodability with their
own decoders, and use the proxy of a frame they cannot decode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 09:58:58 +00:00
Claude 078cac75e4 fix(server): scan the archive at start and every ten minutes
The server indexed only what arrived through its own uploads, so photos
already in an adopted folder and sequences another writer added stayed
unknown until an administrator asked for a rescan. ArchivePolling, registered
by the archive module, queues an incremental scan of the online archive at
start and every ten minutes at background priority, unless a scan or rebuild
of it is waiting, running or paused (ENG-13).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 09:58:45 +00:00
Claude c87357b02c fix(sync): finish stuck downloads and keep edits saved during a comparison
A download whose .part already held the whole original (the job stopped while
hashing it) or more asked the server to resume past the end, got 416 and
failed on every retry; such a part is now hashed again, and one the server
cannot resume starts over (CD-1).

Auto-sync pulled the server's settings with the copy of the sequence read when
the comparison began, so an edit saved on this PC meanwhile was overwritten
unseen. The payload is now applied in one step under the sequence lease and
only while the local settings version is the one read; otherwise nothing is
written and the change is settled as a conflict (CD-3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 09:58:36 +00:00
Claude bb55e47b47 feat(server): publish card imports as cardEvent
BRIEF §14.3 lists cardEvent among the WebSocket events, but the server had
none. A client importing a card into the server now reports its start,
progress (at most once a second, a report still waiting replaced by the
next) and end to the new POST /api/v1/uploads/cards (Upload permission;
import id, card name, state, done, total, failed), and the server publishes
a CardEvent naming the account and client to every connected client; the
protocol client parses it and offers ReportCardAsync. A report that fails is
logged and never stops the import; a server without the endpoint gets no
more reports (SRS-10).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 09:40:53 +00:00
Claude 94b13cc064 fix(ingest): file uploads into API-made sequences and repair damaged frames
A sequence created with POST /api/v1/sequences had no folder, and the ingest
looked for its sidecar at the archive root: every upload into it failed with
503 commit_failed, so the Uploader's "New sequence" target never worked. Its
first frame now claims a folder by the rules of a sequence created by an
upload (folder template with its title, unique variant, sidecar with the
row's id, title, tags, rating, notes and project), and the row takes the
folder in one transaction (DOCKER-1).

A frame flagged missing or corrupt, or whose file is gone or has another
size, no longer stands for an upload: the start short-circuit and crash
recovery match only intact frames still on disk, and the ingest repairs such
a frame with the verified copy (same id and position, flags cleared, a damaged
file kept beside it as name.damaged-<time>) instead of calling it a
duplicate. The Uploader deletes a source only after the server received and
verified its bytes in that upload, never on "already on the server" (SRV-1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 09:40:27 +00:00
Claude 23308c77dd fix(server): render uploads need Edit; chunks keep their upload's size
POST /sequences/{id}/renders and its complete call accepted the Upload
permission, so an upload-only account could file render outputs, which count
against no quota, into any sequence. Client renders are sent by the sync of
an editor's copy: both calls now require Edit (SRV-4).

The chunk endpoint capped the body at the current chunk size, while an
upload keeps the size it started with; after an administrator lowered the
setting, every chunk of an upload in flight got 413 until the upload expired.
The service now raises the limit to that upload's own chunk size before it
reads the body (SRV-5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 09:40:03 +00:00
Claude 5ec59a2e96 fix(server): trust forwarded headers only from known proxies
In TLS mode proxy the server accepted X-Forwarded-For/Proto/Host from any
peer, so a client reaching the HTTP port directly could pick a new address
per sign-in (defeating the 5/min/IP limit), forge audit addresses and claim
HTTPS; the admin never warned (SRS-03, SRV-3). Forwarded headers now count
only from TITANO_TRUSTED_PROXIES (addresses or CIDR networks; default
loopback, 10/8, 172.16/12, 192.168/16, fc00::/7), and the Dashboard and
Settings show a "Not via proxy" chip with a tooltip when a page did not
come through a trusted proxy over HTTPS (ProxyWarning in DashboardDto and
ServerSettingsDto).

TITANO_PUBLIC_HTTP_PORT and TITANO_PUBLIC_HTTPS_PORT name the ports clients
reach when a container's ports are published as other host ports: the
admin's HTTP-to-HTTPS redirect and the LAN beacon use them instead of the
bound container ports (DOCKER-4, DOCKER-5). --help lists TITANO_LOG_LEVEL,
the new variables and the container's PUID, PGID and TZ (DOCKER-7); a test
keeps it in step with the variables the server reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 09:27:31 +00:00
Claude 047cddfe7b fix(server): keep Windows secrets private and the service out of user folders
On Windows the data folder sits in %ProgramData%, whose ACL let every local
user read the database, the password-less TLS key and the temporary admin
password, and create a server.json the LocalSystem service would load
(SRS-02, SRV-2). The folder now gets a protected DACL (SYSTEM,
Administrators, the server's account) at every start when it names anyone
else, which also replaces what the files inside inherited; server.pfx and
initial-admin-password.txt are written with their own protected DACL, and
with mode 0600 elsewhere. A folder whose ACL cannot be changed stops the
start with a clear message.

--install-service registered a LocalSystem service from any folder, so a
per-user install or an unpacked zip handed SYSTEM to that user (SRS-06). It
now refuses, with a localized one-line reason, unless the program folder is
inside Program Files and no account besides SYSTEM, Administrators,
TrustedInstaller or the registering administrator can change it or any file
below it (under dotnet, the host's folder too).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-12 09:27:06 +00:00
Claude 01f301f970 merge: deterministic sync tests and a current-log download that survives new lines 2026-10-06 22:22:47 +00:00
Claude bdcd4e42ae test(server): the busy-log test writes a line a millisecond, never in a tight loop
Engine code of every test server in the process logs through the last server
started (Log.SetSink is process-wide), so the busy-log test's file lock is
shared with the classes running alongside: a loop that re-took it at once kept
a job engine of JobApiTests waiting to log a failure, and its job "running"
past the 15 s deadline (once in 40 loaded runs). The test now fills the log
with a few megabytes up front, so sending it takes a while, and adds a line
about every millisecond during the downloads; it still fails every run against
the old endpoint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-06 22:03:31 +00:00
Claude 5aa7ed1e6f test(server): the busy-log test writes only to the server's log file
Its logging loop also went to the console, whose lock the loggers of the test
classes running alongside share: a job engine waiting to log a failure kept
JobApiTests' job "running" past its 15 s deadline. The loop now writes through
the server's file logger on a thread of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-06 21:36:24 +00:00
Claude 9f03c07fdf fix(server): the current log downloads while the server keeps writing it
GET /api/v1/logs/files/{name} served the file with Results.File, which sets
Content-Length from the file's size and then copies it to its end. The current
log grows whenever the server logs, so a line written meanwhile made Kestrel
abort the response ("too many bytes written"); AdminTests failed on it once in
three full runs. The endpoint now sends the bytes the file held when it was
listed through FileResponses.Serve, a fixed-length, range-capable slice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-06 21:19:30 +00:00
Claude 66374d762c merge: web admin after the visual, accessibility and RTL review (dark theme, plurals, audit filters) 2026-10-06 21:18:24 +00:00
Claude 9c00977dab test(render-node): read the node's last beat after its empty claim was answered
The heartbeat check slept 300 ms to get past the claim that finds the queue
empty and then gave heartbeats 400 ms to move the node's last sign of life: a
slow runner could fail it, or pass it on the claim's own touch. It now counts
the claims the server answered, reads the last beat after the third one, waits
for a later beat with a deadline and checks that no claim came since.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-06 21:11:27 +00:00
Claude 9566818fd6 test(sync): the server event test waits for the comparison the edit starts
ServerEventsUpdateThisPcWithoutWaitingForTheNextComparison polled until the
server's settings reached the local copy, then expected the row in sync; the
link that records the agreement is stored after the local copy, so the row
could still read LocalAhead (1 failure in 15 loaded runs). It now waits for
SyncService.Changed, raised once the comparison stored every link and state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-06 21:11:27 +00:00
Claude 13a5fe401f test(server): admin panel policy headers, module graph, RTL strings, self reset and sign-in log
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-06 21:08:30 +00:00
Claude a4ceb89247 merge: integration branch claude/keen-knuth-uhxv8w (remote editor after review) into the Library workstream
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-06 20:38:30 +00:00
Claude 25697c3231 style: format the job list test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-06 08:08:18 +00:00
Claude 1e857e082a test(server): an editor hears frames added and settings changed over its event socket
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-06 08:07:11 +00:00
Claude 31c1a2d9c6 refactor(editor): the open sequence's jobs in their own type; restore undo as an object
WIP of the interrupted fix stage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-06 07:49:27 +00:00