Implement export execution for both export modes #30

Open
opened 2026-07-28 04:57:29 +00:00 by claude-bot · 0 comments

Context

Spec section 12.1 defines two export modes with different safety properties. This issue
covers the export execution pipeline itself — selecting the set, copying files, and
driving the run as a background job.

Scope

Export execution for approved_only and include_unapproved modes.

Implementation notes

  • approved_only: only photos with approved human date decisions. Unresolved, disputed,
    and blocked-duplicate photos are excluded.
  • include_unapproved: additionally exports unresolved photos into undated/, without
    EXIF dating metadata. Unapproved photos must never receive a synthesized date — that is
    precisely the failure mode this mode is designed to avoid.
  • Export is always a copy operation (spec section 6.6). Originals are immutable and
    must never be touched. Any code path that opens an original for writing is a bug.
  • Run as a JobType.export background job — a large collection export is long-running and
    must not occupy a request.
  • Progress reporting: files completed, current file, estimated remaining.
  • Resumability, or at minimum a clean abort that leaves a clearly incomplete output plus a
    manifest recording what was actually written. A partial export that is indistinguishable
    from a complete one is the worst outcome here.
  • Re-running into a populated directory warns first and honours the explicit replace
    strategy chosen at pre-flight.
  • Admin-only, per the spec's role definitions — reviewers cannot export.
  • Emit audit events for export start, completion, and failure.

Done when

  • Both modes select the correct photo set per spec
  • Originals are provably never modified
  • Export runs as a background job with progress
  • Abort leaves an unambiguous, recorded partial state
  • Only admins can trigger export
  • Export runs are audited

References

  • docs/circa-spec.md sections 12.1, 6.6, 9.4
  • backend/app/models/models.py (JobType.export)

Depends on: export pre-flight checks, #2 (worker runtime).

## Context Spec section 12.1 defines two export modes with different safety properties. This issue covers the export execution pipeline itself — selecting the set, copying files, and driving the run as a background job. ## Scope Export execution for `approved_only` and `include_unapproved` modes. ## Implementation notes - `approved_only`: only photos with approved human date decisions. Unresolved, disputed, and blocked-duplicate photos are excluded. - `include_unapproved`: additionally exports unresolved photos into `undated/`, without EXIF dating metadata. Unapproved photos must never receive a synthesized date — that is precisely the failure mode this mode is designed to avoid. - **Export is always a copy operation** (spec section 6.6). Originals are immutable and must never be touched. Any code path that opens an original for writing is a bug. - Run as a `JobType.export` background job — a large collection export is long-running and must not occupy a request. - Progress reporting: files completed, current file, estimated remaining. - Resumability, or at minimum a clean abort that leaves a clearly incomplete output plus a manifest recording what was actually written. A partial export that is indistinguishable from a complete one is the worst outcome here. - Re-running into a populated directory warns first and honours the explicit replace strategy chosen at pre-flight. - Admin-only, per the spec's role definitions — reviewers cannot export. - Emit audit events for export start, completion, and failure. ## Done when - [ ] Both modes select the correct photo set per spec - [ ] Originals are provably never modified - [ ] Export runs as a background job with progress - [ ] Abort leaves an unambiguous, recorded partial state - [ ] Only admins can trigger export - [ ] Export runs are audited ## References - `docs/circa-spec.md` sections 12.1, 6.6, 9.4 - `backend/app/models/models.py` (`JobType.export`) Depends on: export pre-flight checks, #2 (worker runtime).
claude-bot added this to the v0.5.0 milestone 2026-07-28 04:57:29 +00:00
Sign in to join this conversation.
No description provided.