feat(sessions): keep every session, record review details, name and stamp the PDF

Sessions are now the unit of the product instead of an implicit capture run.

- Nothing is deleted by default: the fixed 10-session cap is gone. An age limit
  (Never / 7 / 14 / 30 / 90 / 180 / 365 days) is chosen in Settings > Sessions and
  applied on launch, after archiving, and by "Clean up now". Sent PDFs are never
  touched.
- Each session carries review details: lane, deployed version, commit, reviewer
  (pre-filled with the Mac user) and a free note. They persist in session.json and
  are inherited by the next session, so a review run is typed once.
- PDF file names are Redline-<yyyyMMdd-HHmm>-<LANE>-<SHORTID>.pdf, and every page
  carries a two-line reference footer (tool, build time, session / lane, deployed
  build, commit, reviewer, note). The PDF document info carries the same values in
  Author and Keywords.
- Verification: 159 tests, a headless panel self-test, and a LaunchServices-driven
  end-to-end run that types and clicks the real panel.
This commit is contained in:
Claude Fable 5
2026-10-31 11:32:54 +04:00
parent 542aad296b
commit 02fa791b78
26 changed files with 2780 additions and 279 deletions
+10 -2
View File
@@ -150,7 +150,14 @@ extension AppModel: SendCapable {
let finalURL = outboxDir.appendingPathComponent(fileName)
// Same directory as the final target so the rename below is same-volume (atomic).
let tempURL = outboxDir.appendingPathComponent(".shotdeck-\(UUID().uuidString).pdf")
let title = "Redline – \(DubaiTime.stamp(workingSession.createdAt))"
// The document title follows the same three parts as the file name: tool,
// lane (when recorded) and Dubai time.
let lane = workingSession.context.lane
let titleParts = ["Redline"]
+ (lane.isEmpty ? [] : [lane])
+ [DubaiTime.stamp(Date())]
let title = titleParts.joined(separator: " – ")
let toolVersion = appVersion
// D-13: build off the main actor. Only Sendable values cross into the
// detached task — never `anchor` (NSView is not Sendable).
@@ -159,7 +166,8 @@ extension AppModel: SendCapable {
session: workingSession,
imageURL: { capture in sourceDir.appendingPathComponent(capture.fileName) },
title: title,
to: tempURL
to: tempURL,
toolVersion: toolVersion
)
// POSIX rename onto `finalURL` replaces any same-name file in one
// directory operation; there is never a window where the PDF is gone.