Skip to content

fix(daemon): commit recording exports with producer proof - #5059

Closed
thymikee wants to merge 12 commits into
0.22from
t3/recording-output-producer
Closed

thymikee wants to merge 12 commits into
0.22from
t3/recording-output-producer

Conversation

@thymikee

@thymikee thymikee commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Superseded by #5099 (direct recording exports) and #5100 (suite recording delivery, stacked on #5099). This PR retains the earlier review and validation record.

Summary

Refs #4970. Bind remote recording exports to the producing reservation, lifetime, tenant, and lease. Keep client placement and the standalone recording ID when a suite recording finishes during cleanup.

Before / after

  • Remote record stop authorizes the exact manifest. A proof retry requires the producer's file identities. Missing evidence leaves the export unpublished.
  • Android checkpoints file identities before it records native completion. Recovery verifies that checkpoint before serving the export. If proof is absent, recovery records native completion and leaves the file on the host.
  • Failed checkpoint reads and writes return a path-free retriable error. The daemon logs the OS error. Confirmed disposal retains the finished completion and any verified identities.
  • Older recordings without producer evidence return LEASE_OUTPUT_MISMATCH on remote stop. Stop and download active recordings before an upgrade. Finished files remain on the daemon host for local recovery.
  • test --record-video holds standalone IDs while the archive copy is pending. Archive and standalone downloads consume their own outputs.

Validation

  • 39d7b51ad1 passed 41 focused tests. All 13 runnable affected checks passed at the exact commit. All 16 hosted checks passed after the iOS smoke rerun. Both proof-less recovery cases failed on a37fcbd6a2.

  • Artifact IDs derive from the reservation and stay stable on retry.

  • Tested the a555931c3 daemon on Pixel 7 with Android 16 and the T3 0.21.41 client. The suite used UIAutomator. A separate snapshot verified android-helper 0.22.0-dev.

<T3 bound CLI> test settings.ad --record-video --no-test-ime --artifacts-dir <client root> --json
Suite passed 1/1. Archived H.264 video decoded all 388 frames.
Standalone without lease: 401 LEASE_OUTPUT_MISMATCH.
Standalone with lease after archive download: 200, matches all 4,672,599 archive bytes.
Both consumed IDs: 404 RESOURCE_EXPIRED.
  • At f801a3d546, both HTTP binary directions with the 0.22 nightly delivered matching video, chunk, and telemetry bytes.

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.06 MB 5.08 MB +15.2 kB
Package (unpacked) 5.06 MB 5.08 MB +15.2 kB
Package (download) 1.54 MB 1.55 MB +4.7 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 18.7 ms 24.3 ms +5.7 ms
CLI --help 36.2 ms 47.8 ms +11.6 ms

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 4 new findings on adc9ada. The verdict and the full list are in the summary comment.

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

@apex-sentinel-staging review

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 finding moved to a new line on dd5f1ad. The verdict and the full list are in the summary comment.

@thymikee

Copy link
Copy Markdown
Member Author

Review of dd5f1ad: the suite recording route has no live run yet, and several recording paths can publish, lose or expose output they should not. CI is green, with 19 checks and none failing at this commit.

The suite recording route is device-facing and changed. session-replay-video-owner.ts:77 now passes suiteCapture: 'remote', adopts the suite's admitted lease, overrides artifactsDir for every client artifacts root, and stages independent copies. The live evidence covers only explicit record stop and close during capture. Before merge, run a remote test --record-video suite on a device (Android is fine) through a client with an artifacts root, using node bin/agent-device.mjs at dd5f1ad. Show that (1) the downloaded test-artifacts archive contains the recording video, (2) the suite result's recordingArtifacts[].artifactId downloads the same bytes with the producing lease and returns 401 without it, and (3) after the archive download, the recording ID can still be downloaded once and then returns RESOURCE_EXPIRED.

A second independent pass found the following problems.

Replaying a completed 0.22 daemon-owned recording that has remoteCaptureLease: 'unleased' and no recorded tenant, global marker or export identities (recording-outputs.ts:76) now succeeds. The base accepted that manifest as valid. The new replay treats it as host-global, invents a new 15-minute window, and takes the file's current on-disk identity as proof (artifact-file-storage.ts:46-64). If the recorded path was replaced, the replacement is downloaded and later deleted. A legacy record with an explicit tenant and lease has the same gap, because there is no manifest identity to compare. Republishing a completed legacy recording should require an explicit tenant or global scope, the original retention deadline, and verified file identities. Files that cannot be verified should stay available for trusted local recovery only.

Teardown still assigns a legacy recording to the closing session's tenant (leased-recording-retention.ts:29). Close a leased session that holds a proof-less remote recording whose manifest names an unleased producer from a different tenant. The legacy branch at recording-outputs.ts:76 prefers the session lease's tenant and commits with no lease verifier, so the closing tenant can download it without that lease. The test at leased-recording-retention.test.ts:387-405 expects that reassignment. A later stop of the same completion omits legacyTenant and can register the same bytes again under another scope. Remove legacyTenant from publication. Keep a legacy live export remote only when its recording has the original producer scope plus a provable reservation and file identity, and keep other exports local.

Close now publishes tenantless recordings to the shared inventory (leased-recording-retention.ts:23). On a daemon with shared-secret auth and no auth hook, start a tenantless, unleased remote recording in an open session, then close the session during capture without record stop. The matching lifetime lets teardown publish a host-global entry. Another holder of the secret, including a caller declaring a different tenant, can discover and download it without a lease (artifact-tracking.ts:716-724, 862-868). Base teardown required a session lease before registering any recording. The compatibility argument for explicit stop does not cover this new publication on close. Keep the explicit-stop policy for host-global recordings, do not publish ordinary unleased host-global recordings to shared inventory on teardown, and hand verified suite delivery to its suite owner.

Stop recovery can authorize and deliver from different manifest reads (record-runtime.ts:522). After a leased session closes, a request with no lease in the shared namespace can reach stop recovery. If the first manifest read hits a one-off I/O error, the store returns unreattachable (store.ts:44-57), and the authorization check treats that like an absent record. A later read can succeed, replay the completed export and return its IDs, or run expiry cleanup, without checking the request against that manifest's lease. In the opposite order, an authorized stop finishes, then a transient failure on the post-finish read (lines 485-511) returns raw paths with no committed IDs as a success. Authorize the exact recording envelope used for stop, and carry its fence and completed proof through the finish and commit calls. Return a retriable error when that proof cannot be read, and never substitute a caller-owned result for a remote stop.

Remote recording responses expose daemon filesystem paths (record-runtime-response.ts:84). A public HTTP record start without a client out path returns the reserved host path, and with one it still returns the host sessionStateDir (lines 40-42). Live stop and completed replay put the daemon's video and telemetry paths into outPath and telemetryPath. The HTTP reply only projects screenshot paths (http-server.ts:828-851), including in batch, so descriptors without a path do not prevent this. The test at http-server-remote-output.test.ts:275-298 confirms the start disclosure. Project remote start and stop responses from client-local hints or safe filenames and IDs, and keep daemon paths in internal state and the trusted local response.

Suite responses also send recording paths from the daemon filesystem (test-command.ts:389). A public test --record-video request without client artifact path metadata returns recordingArtifacts entries with absolute daemon paths. With normal client metadata, a timed-out attempt that finishes its recording during cleanup adds absolute video and sidecar paths (session-replay-command.ts:250-255). They are copied to error.details.artifactPaths (session-test-runtime.ts:214-222) and survive in both tests and failures, because lines 413-421 of test-command.ts remap only artifactsDir. Project recording references to client-local paths or safe relative names in both the suite result and the nested failure details. For callers with no destination, keep the ID and filename and omit the host path.

The suite archive can serve recording bytes that failed producer verification (test-command.ts:436). The recorder writes directly into the attempt archive directory (session-replay-video-recording.ts:48-64). If a claimed sidecar is missing or verification has a transient error, no recording IDs are committed, but a valid primary video stays in that directory. The fixture at session-replay-command-recording-cleanup.test.ts:112-141 shows the surviving file and an archive response with no recording entries. Finalization registers the directory with the outer request's scope (request-finalization.ts:157-180), and download archives the whole directory (artifact-tracking.ts:816-830). The archive can also serve replacement bytes at the original path after the verified copy was staged. Reserve remote recording storage outside the archive tree, and materialize only verified recording files into the archive from the producer's committed outputs. The other suite artifacts should stay downloadable when a recording cannot be verified.

Transient proof I/O during close can make a completed export unrecoverable (transitions.ts:135). Close during a remote recording after the backend produced valid output, with lstat returning a transient EIO while verifying the video or sidecar (screen-recording-session-resource.ts:108-120). For disposal, the proof error goes through forceCleanup, and a real recording handle with a memoized successful finish answers cleaned (screen-recording-live-handle.ts:41-60). The manifest becomes terminal without a stored completion (transitions.ts:176-204, 325-341), and teardown treats the completed error as successful cleanup (session-teardown.ts:166-174). Once I/O recovers, the files remain but the producing lease has nothing to download or replay. This contradicts ADR 0024. Keep a retryable completion with its original reservation when the recorder stopped successfully and proof I/O is uncertain. Settle native disposal on its own, and let an exact-owner retry complete the proof.

Process recovery mints new IDs for the same committed recording (artifact-file-storage.ts:178). If the daemon commits a standalone recording and loses power before the client certainly received the stop reply, the video and completed proof survive. The manifest holds only identities and completedAt (screen-recording-session-resource.ts:104-105), and the publication map is empty in the new process (artifact-tracking.ts:218-228). An authorized retry within the original deadline verifies the file, then returns new UUIDs, and the previously committed IDs stop working. This also skips the original reservation ID that ADR 0040 requires. Persist the reserved output IDs with the recording proof and deadline. Restore verified retained entries with those IDs, and persist consumption where needed so they cannot be recreated.

Simplicity question: net production is 576 lines, under the 700-line threshold, so this is a question and not a size rejection. Could the independent IDs for archive suite recordings be dropped? The client archive already delivers them, and no client reads recordingArtifacts. That would remove the staged copies, the archive and archive-replay source kinds, waitForRecordingPublication and settleWithin, ReplaySuiteRecordingArtifact(s) with their schema and two ledger entries, the recordingOutputs plumbing through replay-port, and the artifactPaths cleanup parameter. For standalone exports, could retry idempotence be a registry lookup keyed by producer lifetime, path and proof identity, like the findTrackedArtifactId pattern? Expiry stays on addArtifactEntry(createdAt = completedAt), and consumption already shows up as a missing source that returns RESOURCE_EXPIRED. That deletes the publication map with its timer and abort logic, leaving one unref'd timer to expire proven sources after a failed registration. Could recording entries also use one identity function from capture-kit, and could the proof-less legacy branch go? ADR 0024's last two added sentences would change first: 'Each remote suite gets a fresh daemon directory' can stay, and 'A suite recording keeps its own retained copy so downloading the archive cannot consume its recording ID' would go. #4970 only requires preserving suite artifact delivery.

Not blocking, and these can be taken or left: artifact-tracking.ts:495 rebuilds capture-kit's recordingExportFileIdentity string by hand while five readers derive the flag separately from entry.reservation?.recording, so one identity function would let the boolean parameter go; request-finalization.ts:187 and request-router.ts:797 replace the old withCaptureOutputOwnership marker with two command-name carve-outs that could key on the committed shape instead; screen-recording-session-resource.ts:41 lets capture-kit give meaning to untyped keys the daemon writes (remoteCapturePath, remoteCaptureOutput, remoteCaptureExport), where a typed field owned by capture-kit would be clearer; the compatibility branch at recording-outputs.ts:76 (legacyTenant, the remoteCaptureLifetime === undefined ? !lease gate, the unverified branch) could be deleted, with commitRecordingOutputs refusing a remote manifest without remoteCaptureExport; a remote suite with archive delivery packs an unverified recording.mp4 because the archive covers the whole tree (record-runtime.ts:346), so either write recordings outside the tree or reword the ADR line; and recordingArtifacts in contracts/src/replay.ts:155 has no client reader and no user doc, so document it next to the remote-proxy suite sentence or drop it with the standalone suite IDs.

None of the four earlier inline threads needs more work: the suite collection failure thread is fixed, because collectSuiteRecordingOutputs now catches, warns and returns []; the consumed or expired replay thread is fixed, because replay now fails with typed RESOURCE_EXPIRED and live IDs are re-served; the proof-less file thread is benign, because proof-less files are preserved on failure and teardown commits only a manifest whose fence matches the live recording; and the host-global scope thread is benign, because host-global applies only when the start had no tenant and no lease, and the author's reply holds. These four can be resolved.

No tests, check:affected or live runs were executed for this review, and green CI at dd5f1ad and the author's receipts were relied on. Not verified here: the mixed-version HTTP runs and the Android 16 live run, which are author-reported without transcripts. Not verified here: iOS and macOS remote recording paths, although verification is a host-side file stat and platform-neutral by code read. Not verified here: whether a session's lifetime journalId can change while a recording is live, in which case teardown skips the commit silently at leased-recording-retention.ts:23-25 and leaves verified files with no expiry. Not verified here: whether forced disposal cleanup after a proof failure deletes the unverified export files (transitions.ts:135-153). Not verified here: whether staged suite copies in os.tmpdir() (agent-device-suite-recording-*) are swept after a process exit.

The next step is the live remote test --record-video run above at dd5f1ad, then an answer to the simplification question.

@thymikee

Copy link
Copy Markdown
Member Author

I’m keeping recording IDs in the suite result. The accepted #4970 case specifically requires the committed recording ID when cleanup finishes a late export. I’ll simplify the implementation around the original reservation, verified file identity, and deadline. A registry lookup can reuse a live ID within a daemon. Restart recovery also needs the reserved ID and a durable consumed state wherever source bytes can outlive delivery. The live Android suite run for dd5f1ad and the follow-up fixes are in progress.

@thymikee

Copy link
Copy Markdown
Member Author

Live Android suite evidence at dd5f1adb1b2ae88e56fcb781e48e0f93fd045b99: a task-owned remote test --record-video case with a client artifacts root passed on Pixel 7 / Android 16. The archive contained a 7.03-second H.264 video (211 frames, clean decode). After consuming the archive, the producing lease downloaded the recording ID with HTTP 200 and byte-for-byte identical output. Both IDs returned HTTP 404 / RESOURCE_EXPIRED after their respective downloads. The daemon and replay plugin were built from this head. T3 pinned the 0.21.41 client, and the suite used UIAutomator fallback. This run exercised the producing lease only. The lease, daemon, and emulator were cleaned up.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed f801a3d against the findings from the earlier review at dd5f1ad (#5059 (comment)). The suite collection warning and the replay of a consumed ID are now fixed, but the new recording route has no live run and four defects remain. No conflicts are known.

The live Android suite run (comment 7127154267) was taken at dd5f1ad, and it covered only the producing lease, not the 401 without it. The f801a3d delta then replaced the suite recording route: the recording is reserved in the attempt session dir, the archive gets a re-verified hard-linked copy (https://github.com/callstack/agent-device/blob/f801a3d/packages/daemon/src/sessions/recording-outputs.ts#L168), and downloads write .consumed receipts. That earlier run exercises none of it, and the unit tests use a fake runtime that writes the file itself. Please run a remote test --record-video suite on a device at f801a3d through a client with an artifacts root, using node bin/agent-device.mjs. It must show that (1) the downloaded test-artifacts archive contains a decodable recording video, (2) recordingArtifacts[].artifactId downloads byte-identical output with the producing lease and returns 401 LEASE_OUTPUT_MISMATCH without it, and (3) after the archive download the ID still downloads once and then returns RESOURCE_EXPIRED.

A second independent pass found that a standalone download can remove a suite recording before archive delivery (https://github.com/callstack/agent-device/blob/f801a3d/packages/daemon/src/sessions/recording-outputs.ts#L146). A remote test with --record-video and a client artifacts directory publishes the standalone ID when the stop finishes (record-runtime.ts:479-486, artifact-tracking.ts:364-385). While suite cleanup still runs, the producing tenant and lease can consume that ID, which deletes the only reserved source (artifact-tracking.ts:889-920). Publication then sees the receipt or a missing source and exits before the first archive copy, so the suite archive omits the video. The base wrote the video straight into the archive tree, so this could not happen. For suite recordings with archive delivery, please make the verified archive copy before the standalone entry becomes downloadable, or keep a verified source until the copy settles.

A second independent pass found that a proof retry can accept a replacement for a file that was already inspected (https://github.com/callstack/agent-device/blob/f801a3d/packages/capture-kit/src/capture-admission/screen-recording-session-resource.ts#L176). Close verifies the video identity, then telemetry inspection returns EIO. The pending completion keeps the paths and timestamp but drops the video identity (lines 56-59, 124-138). If the video is replaced before the exact owner retries or suite collection runs, the verifier stats both paths afresh and commits the replacement under the original reservation and lease. Please persist the identities already established when verification is interrupted and require them to match on retry. For files still awaiting inspection, bind verification to the original finished output, or keep them unpublished when the original identity cannot be established.

A second independent pass found that startup claim reconciliation can finish a proof-pending recording without its proof (https://github.com/callstack/agent-device/blob/f801a3d/packages/capture-kit/src/durable-capture/transitions.ts#L196). Close saves an iOS simulator recording as open/export-proof-pending after native cleanup, and the daemon exits before releasing the device claim. At restart, claim reconciliation treats the open manifest as native work (device-claim-reconciliation.ts:161-170, 219), and the Apple runtime reattaches the stopped recorder as a restore-export handle (recording/recovery.ts:306-336). Generic recovery then force-cleans it and writes completed with no proof (durable-capture/recovery.ts:175-190, transitions.ts:340-355). An exact-owner stop then misses the pending-proof branch (record-runtime.ts:615-620) and refuses the intact export. Please teach recording reconciliation and claim inspection that export-proof-pending already settled native cleanup, leave that manifest for the proof retry, and let the device claim settle.

A second independent pass found that a fenced read on the new proof-retry route can disclose a daemon path and mark transient I/O as non-retriable (https://github.com/callstack/agent-device/blob/f801a3d/packages/capture-kit/src/capture-admission/screen-recording-session-resource.ts#L154). After an exact-owner stop authorizes an export-proof-pending manifest, the verifier's fenced reread can fail with a transient filesystem error. The store embeds the OS error text in an unreattachable record (durable-capture/store.ts:44-57), and the fence returns it with retriable:false (durable-capture/fence.ts:110-118, 150-155). That text can hold the manifest's absolute path, and the handler and HTTP layer forward it (record-runtime.ts:109-116, 617-620, http-server.ts:828-840). The other two reads on this path use a safe retriable error. Please separate an unreadable record from a missing or mismatched fence at fenced admission, and map transient manifest I/O to the path-free retriable proof error, keeping the native text in diagnostics.

Not blocking, and these can be taken or left: export-proof-pending is stored with lifecycle 'open', so startup recovery (recovery.ts:130) tries to reattach a recording that disposal already cleaned and can mark it completed as already-missing, after which a later exact-owner stop fails non-retriably (transitions.ts:200); runtime-slot dispose no longer requests cleanup for undelivered recordings, and the expiry timers are in-process only, so after a restart nothing removes a recording or receipt unless the owner retries (artifact-tracking.ts:233); and a remote record start now omits sessionStateDir while a released mcp --structured client still advertises it as required, with no wire ledger entry for the change (output-schemas.ts:49).

No open thread from other reviewers still applies. These can be resolved: discussion_r4678110991 and discussion_r4677434788 (only an explicit host-global start reaches the commit, which matches base 0.22, and teardown retains it without advertising it), discussion_r4676819718 (the collection warning is fixed at this head), discussion_r4676819725 (consumed or expired replay now fails with typed RESOURCE_EXPIRED), and discussion_r4676819730 (proof-less files are preserved for trusted local recovery by design, ADR 0024 section 2.5). Their links are #5059 (comment), #5059 (comment), #5059 (comment), #5059 (comment) and #5059 (comment).

The 'Body rules' check was cancelled, not failed, and it only lints the PR body. One other check needs action because of its open thread on recording-outputs.ts:104, which repeats the host-global case above. All other checks pass, so CI is unlikely to be related to the code.

Not verified here: tests, check:affected and live runs were not executed for this review; the run-EefCO6 receipt and the mixed-version HTTP runs are author-reported without transcripts; the third finding was not traced into the reattach outcome for a disposed recorder, which may be 'unreattachable' instead of 'missing' but writes no proof either way; released structured MCP hosts were not run to see whether they validate the output; and iOS and macOS remote recording were not exercised, although proof and archive copy are host-side and platform-neutral by code read.

Before merge, the live remote test --record-video run at f801a3d must show the archive video, the lease-gated ID download (200 with the lease, 401 without it), and RESOURCE_EXPIRED after a single download.

@thymikee

Copy link
Copy Markdown
Member Author

This branch now conflicts with 0.22 at f801a3d. Please rebase onto current 0.22; the findings from the review at f801a3d still apply after the rebase.

@thymikee
thymikee force-pushed the t3/recording-output-producer branch from f801a3d to 1e74b95 Compare November 24, 2026 16:17
@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

The four blockers from the earlier review (#5059 (comment)) are closed at 1e74b95, but a second independent pass found three new problems in the proof checkpoints. No conflicts. The only check that did not pass is Body rules, which was cancelled and not failed. It lints only the PR body, and the other 17 checks pass. The live test --record-video run in the PR body is author-reported with no transcript, and it used the released 0.21.41 client. Not verified here: tests, the affected gate, and live runs, and iOS or macOS remote recording.

A second independent pass found that the earlier substitution finding is still open for files whose first inspection failed. Close finishes a video with telemetry, saves the video identity, and gets EIO on the first telemetry stat. It then saves export-proof-pending with only the video identity (transitions.ts:194-203). If the sidecar is replaced before the retry, verifyRecordingExport accepts the new stat at the unproved index and commits it under the original reservation and lease (screen-recording-session-resource.ts:142). A first-stat EIO on the video gives an empty identity list and allows the same swap for the video. Reservation-derived IDs prove the file slots, not the original files in them. The rule: every file a proof retry can publish needs a producer-bound identity. Keep a file unpublished when producer evidence for it is unavailable, and keep matching the identities already journaled.

A second independent pass found that new proof checkpoints can expose an unreadable manifest path on remote stop. An EIO opening the manifest during the proof-progress save returns an unreattachable record with the OS message (transitions.ts:406). Only the export-proof-pending entry point supplies unreadableRecordError. A live stop and a recovered stop that finish the native recording still use the default fence error, which embeds the absolute path and sets retriable:false. That message reaches direct RPC callers and can become a suite finalization warning. The rule: every unreadable-manifest failure during a proof checkpoint, on all recording finish routes, returns the path-free retriable recording proof error. The OS error stays in daemon diagnostics. The separate missing and fence-mismatch refusals stay as they are.

A second independent pass found that an EIO on the temporary-file rename for a proof checkpoint can leak paths and lose the finished export (screen-recording-session-resource.ts:136). The error escapes store.write after native finish, so a direct stop or pending-proof retry returns the raw filesystem message with host paths. On the close route, pendingCompletionMetadata accepts only RecordingProofIoError, so one failed write falls through to confirmed native cleanup. The next successful write then marks the record completed without the stored completion, and neither the producing lease nor suite collection can publish the intact video. The rule: every filesystem failure from a proof checkpoint write maps to a path-free retriable proof failure with the raw error in diagnostics. After confirmed disposal, the finished completion and verified identities stay available for proof retry.

Of the earlier inline threads, these are fixed at this head and can be resolved: the suite collection failure handling (#5059 (comment)) and the replayed stop on a consumed or expired export (#5059 (comment)). These do not apply: proof-less legacy files stay for trusted local handling by design and are never published remotely (#5059 (comment)), and the host-global unscoped registration matches base behavior (#5059 (comment) and #5059 (comment)).

Before merge, the three findings above need fixes with tests, and the cancelled Body rules check needs a re-run. The maintainer also decides on size (845 net production lines).

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on a555931. The verdict and the full list are in the summary comment.

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on 75899e4. The verdict and the full list are in the summary comment.

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 finding moved to a new line on a37fcbd. The verdict and the full list are in the summary comment.

Comment on lines 199 to 202
case 'completed':
await transitionTerminal(params, resourcePath, envelope, {
...params.definition.completionMetadata(authority.reattached.result),
});
return true;
case 'missing':
await transitionTerminal(params, resourcePath, envelope, {
recoveryStatus: 'already-missing',
});
await transitionTerminal(params, resourcePath, envelope, authority.reattached);
return true;

@apex-sentinel-staging apex-sentinel-staging Bot Nov 24, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer raised on 39d7b51, with the code it pointed at unchanged: withdrawn, not fixed.

🟡 Minor · Startup recovery of a reattached-completed recording cannot finish it without producer proof

A recording with an open record reserved for a remote export reattaches as completed after daemon exit; transitionFinishOutcome forces alreadyCompleted, so completionMetadata is called with progress undefined and verifyRecordingExport throws missingProducerProof whenever no remoteCaptureExport fact is journaled. Both finishRecoveredDurableCapture's completed case and transitionFinishOutcome hit this refusal; the predecessor terminalized unconditionally, so recovery used to commit such records.

Suggested change

Give the recovery completion path a way to capture evidence rather than requiring it: pass a progress (or an explicit capture-evidence flag) into transitionFinishOutcome when the record is still open, or make verifyRecordingExport capture and journal identities when stored proof is absent instead of throwing missingProducerProof.

Details

Also raised here

Also raised at this location by persona senior-developer: Startup recovery of a natively-completed remote recording can never produce proof — A remote recording whose recorder finished natively while the daemon manifest is still open is recovered through transitionTerminal → transitionFinishOutcome, which passes alreadyCompleted: true so commitFinishedCapture calls completionMetadata with progress === undefined. verifyRecordingExport then hits if (!progress || ...) throw missingProducerProof() because no prior attempt stored remoteCaptureExport (only the live stop sequence, via progress.record, ever writes it), so recovery throws "Recording export is missing producer proof." every time and the record is never completed — the device claim keeps seeing a recoverable screen-recording resource and the finished export is never servable. finishRecoveredDurableCapture's 'completed' branch has the same shape. …

persona: javascript, senior-developer

Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.

Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.

@blacksmith-sh

This comment has been minimized.

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 39d7b51

Since the review of a37fcbd: 0 new · 0 still open · 1 no longer raised

No open findings.

1 finding below minor hidden (user_settings.min_severity).

1 new finding away from what changed since a37fcbd not shown. Comment @apex-sentinel-staging review for a full review.

Reviewed with this repository's own Sentinel configuration (22bb75b293f4).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

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