Skip to content

Record how every screenshot scene was made - #194

Merged
darioalessandro merged 1 commit into
masterfrom
record-scene-provenance
Aug 2, 2026
Merged

Record how every screenshot scene was made#194
darioalessandro merged 1 commit into
masterfrom
record-scene-provenance

Conversation

@darioalessandro

Copy link
Copy Markdown
Member

Follow-up to #192. Changing a scene wasn't possible without reverse-engineering it.

generate.mjs stored the 12 base scene prompts, but everything made with generate.mjs edit — every "what the camera sees" preview, plus the edits that fixed a scene's staging — was passed as an argv string and never recorded. 9 of the 16 images manifest.js renders had no recipe. (docs/marketing/prompt-pack.md, which the file header points at, turns out to hold scene concepts, not these.)

What's added

  • CHOSEN — which candidate each base scene kept, since generate.mjs <id> N writes <id>_c1..cN and the manifest references one of them.
  • DERIVED — the edits and previews: source images, aspect, prompt. node generate.mjs derive <file> re-runs one; --as <name> writes elsewhere so a regeneration can be compared before it replaces the committed asset.
  • A coverage checknode generate.mjs derive with no argument lists everything and verifies every manifest reference has a recipe, exiting non-zero if one doesn't. This is the part that keeps it from rotting; the gap was invisible until someone tried to change a scene.
  • The slot3_ipad prompt, missing entirely — the iPad cardinal scene couldn't be regenerated at all.
$ node generate.mjs derive
...
coverage: 16/16 manifest scenes have a recipe

What these prompts are

Reconstructed from the committed images, not the original text — labelled as such in the file. I validated the mechanism by running slot3_preview end to end against the API: same subject, same aspect, framed wider than the committed shot. So I tightened that prompt and mac3_preview's with an explicit framing instruction. They produce an equivalent asset, not the same pixels. The recipe, not the receipt.

Crop boxes are the exception — those are exact, recovered by matching each committed crop against its parent (mac2_cook_c1_crop = 0,440,1536,2210, mean abs diff 0.34, i.e. JPEG noise).

Scope

Two files, generate.mjs and README.md. No scene asset, no screenshot, no metadata is modified — nothing to re-ship. The README gains a worked example for swapping the cardinal for another animal, which is what prompted this.

🤖 Generated with Claude Code

Changing a scene was not possible without reverse-engineering it. generate.mjs
stored the 12 base scene prompts, but everything made with `generate.mjs edit`
-- which is every "what the camera sees" preview, plus the edits that fixed a
scene's staging -- was passed as an argv string and never recorded. 9 of the 16
images manifest.js renders had no recipe. docs/marketing/prompt-pack.md, which
the header points at, holds scene concepts, not these.

Three additions:

CHOSEN records which candidate each base scene kept, since `generate.mjs <id> N`
writes <id>_c1..cN and the manifest references one of them.

DERIVED records the edits and previews: source images, aspect, prompt. A new
`generate.mjs derive <file>` re-runs one. `--as <name>` writes elsewhere so a
regeneration can be compared before it replaces the committed asset -- the model
is not deterministic, so you always want to look first.

`generate.mjs derive` with no argument lists everything and checks that every
manifest reference has a recipe, exiting non-zero if one does not. That is the
part that keeps this from rotting: the gap was invisible until someone tried to
change a scene, and now it fails loudly instead.

Also adds the slot3_ipad prompt, which was missing entirely -- the iPad cardinal
scene could not be regenerated at all.

Honesty about what these are: the DERIVED prompts are RECONSTRUCTED from the
committed images, not the original text. They are labelled as such in the file.
I validated the mechanism by running slot3_preview end to end: it returned the
same subject at the same aspect, framed wider than the committed shot, so I
tightened that prompt and mac3_preview's with an explicit framing instruction.
An equivalent asset, not the same pixels -- the recipe, not the receipt.

Crop boxes are exact, not reconstructed: recovered by matching each committed
crop against its parent (mac2_cook_c1_crop is 0,440,1536,2210, mean abs diff
0.34 -- JPEG noise).

No scene asset is modified by this commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

📊 Test Coverage Report

626/638 tests passed · ⏭️ 12 skipped

Metric Coverage
App code (excl. generated + vendored Theater) █████████░░░░░░░░░░░ 44.6% 🔴
Whole target █████████░░░░░░░░░░░ 45.8% 🔴

🎥 Capture & session core

File Coverage Lines
CaptureEngine.swift ██░░░░░░░░░░░░░░░░░░ 10.7% 164/1529 🔴
RecordingPipeline.swift ████████████░░░░░░░░ 59.7% 284/476 🟡
FrameStreamingCoordinator.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/124 🔴
FrameStreamer.swift ██████████████░░░░░░ 69.2% 72/104 🟡
RemoteCmdFlatBuffers.swift ███████████████████░ 96.2% 1200/1247 🟢
📁 Full report — 87 files
File Coverage Lines
CountdownTimer.swift ████████████████████ 100.0% 48/48 🟢
JPEGFrameEncoder.swift ████████████████████ 100.0% 12/12 🟢
CameraPreviewMode.swift ████████████████████ 100.0% 13/13 🟢
AppActivityMonitor.swift ████████████████████ 100.0% 31/31 🟢
AppTheme.swift ████████████████████ 100.0% 33/33 🟢
Messages.swift ████████████████████ 100.0% 7/7 🟢
DebugLog.swift ████████████████████ 100.0% 2/2 🟢
ZoomScale.swift ████████████████████ 100.0% 76/76 🟢
MonitorChrome.swift ████████████████████ 100.0% 56/56 🟢
StreamingConfig.swift ████████████████████ 100.0% 34/34 🟢
MultipeerMessages.swift ████████████████████ 100.0% 12/12 🟢
Locked.swift ████████████████████ 100.0% 19/19 🟢
ScannerLobby.swift ████████████████████ 100.0% 5/5 🟢
FrameCreditWindow.swift ████████████████████ 100.0% 9/9 🟢
AppDelegate.swift ████████████████████ 100.0% 17/17 🟢
HEICFrameEncoder.swift ████████████████████ 100.0% 17/17 🟢
PeerCompatibility.swift ████████████████████ 100.0% 42/42 🟢
DeviceScannerViewModel.swift ████████████████████ 99.1% 112/113 🟢
FrameSender.swift ████████████████████ 98.4% 187/190 🟢
FocusPointMapping.swift ████████████████████ 97.6% 40/41 🟢
RemoteCmdFlatBuffers.swift ███████████████████░ 96.2% 1200/1247 🟢
RemoteCmds.swift ███████████████████░ 95.9% 301/314 🟢
WatchSharedTypes.swift ███████████████████░ 94.0% 236/251 🟢
WatchPreviewStreamer.swift ███████████████████░ 93.6% 44/47 🟢
VP9FrameEncoder.swift ███████████████████░ 92.7% 153/165 🟢
WelcomeView.swift ██████████████████░░ 89.3% 492/551 🟢
VideoTransferProgressView.swift █████████████████░░░ 84.0% 295/351 🟢
UIImage+gif.swift █████████████████░░░ 83.2% 129/155 🟢
UIAlertController.swift █████████████████░░░ 83.0% 44/53 🟢
CameraDeviceDescriptor.swift ████████████████░░░░ 81.0% 34/42 🟢
CameraProgressOverlayView.swift ████████████████░░░░ 78.5% 186/237 🟡
MonitorView.swift ███████████████░░░░░ 76.8% 1178/1534 🟡
FlatBufferSchemas_generated.swift (excluded from app-code metric) ███████████████░░░░░ 75.6% 742/982 🟡
RolePickerView.swift ███████████████░░░░░ 75.4% 306/406 🟡
RecordingTimer.swift ███████████████░░░░░ 73.5% 61/83 🟡
CameraRecordingTimerView.swift ███████████████░░░░░ 73.4% 127/173 🟡
WelcomeViewModel.swift ███████████████░░░░░ 73.3% 96/131 🟡
SettingsViewModel.swift ██████████████░░░░░░ 70.9% 90/127 🟡
DeviceScannerView.swift ██████████████░░░░░░ 70.3% 1132/1611 🟡
SessionCoordinator.swift ██████████████░░░░░░ 69.8% 1732/2480 🟡
FrameStreamer.swift ██████████████░░░░░░ 69.2% 72/104 🟡
MonitorPresenter.swift █████████████░░░░░░░ 65.3% 154/236 🟡
WelcomeViewController.swift █████████████░░░░░░░ 64.1% 41/64 🟡
UIAlertPresenter.swift ████████████░░░░░░░░ 60.5% 26/43 🟡
RecordingPipeline.swift ████████████░░░░░░░░ 59.7% 284/476 🟡
MediaProcessors.swift ████████████░░░░░░░░ 58.3% 7/12 🟡
StoreManager.swift ███████████░░░░░░░░░ 53.2% 75/141 🟡
UICmds.swift ██████████░░░░░░░░░░ 50.0% 96/192 🟡
CameraViewModel.swift ██████████░░░░░░░░░░ 49.6% 126/254 🔴
ZoomPill.swift ██████████░░░░░░░░░░ 49.4% 168/340 🔴
UIViewController+SwiftUIHosting.swift ██████████░░░░░░░░░░ 48.4% 15/31 🔴
FrameCodecs.swift ██████████░░░░░░░░░░ 48.1% 25/52 🔴
FrameStreamReceiver.swift █████████░░░░░░░░░░░ 46.3% 238/514 🔴
SceneDelegate.swift █████████░░░░░░░░░░░ 45.8% 11/24 🔴
MonitorViewModel.swift █████████░░░░░░░░░░░ 44.1% 186/422 🔴
PurchaseManaging.swift ████████░░░░░░░░░░░░ 42.0% 21/50 🔴
HEVCFrameEncoder.swift ████████░░░░░░░░░░░░ 40.1% 93/232 🔴
MonitorViewController.swift ███████░░░░░░░░░░░░░ 37.3% 84/225 🔴
EnumExtensions.swift ███████░░░░░░░░░░░░░ 33.9% 40/118 🔴
CameraScreenView.swift ██████░░░░░░░░░░░░░░ 28.5% 148/520 🔴
DeviceScannerViewController.swift ██████░░░░░░░░░░░░░░ 28.1% 107/381 🔴
WatchSessionManager.swift ████░░░░░░░░░░░░░░░░ 20.8% 37/178 🔴
SoundManager.swift ████░░░░░░░░░░░░░░░░ 20.0% 4/20 🔴
MonitorViewController+SwiftUI.swift ███░░░░░░░░░░░░░░░░░ 14.4% 67/465 🔴
CaptureEngine.swift ██░░░░░░░░░░░░░░░░░░ 10.7% 164/1529 🔴
SwiftConstants.swift ██░░░░░░░░░░░░░░░░░░ 10.3% 6/58 🔴
RolePickerController.swift ██░░░░░░░░░░░░░░░░░░ 10.2% 23/226 🔴
PeerLinkStatus.swift █░░░░░░░░░░░░░░░░░░░ 7.1% 10/141 🔴
WatchRemoteCameraController.swift █░░░░░░░░░░░░░░░░░░░ 3.2% 9/279 🔴
CameraPermissionsView.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/640 🔴
CameraHostController.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/197 🔴
RemoteShutterHelpView.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/1373 🔴
CameraPermissionErrorView.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/416 🔴
PhotosAccessDeniedView.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/606 🔴
FrameStreamingCoordinator.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/124 🔴
MicrophonePermissionPromptView.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/347 🔴
SettingsView.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/760 🔴
Photos.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/12 🔴
LocalNetworkPermissionView.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/747 🔴
PermissionManager.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/159 🔴
OrientationUtils.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/18 🔴
PhotosAccessHelper.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/324 🔴
CameraRig.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/574 🔴
StreamLog.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/1 🔴
MultipeerService.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/116 🔴
CameraCountdownTorch.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/61 🔴
Data+MD5.swift ░░░░░░░░░░░░░░░░░░░░ 0.0% 0/4 🔴

Generated from 5fecf09 · workflow run

@darioalessandro
darioalessandro merged commit d9b7c0e into master Aug 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant