Skip to content

fix(replay): publish recordings after suite archive copy - #5100

Merged
thymikee merged 5 commits into
fix/recording-producer-prooffrom
fix/suite-recording-delivery
Nov 26, 2026
Merged

thymikee merged 5 commits into
fix/recording-producer-prooffrom
fix/suite-recording-delivery

Conversation

@thymikee

@thymikee thymikee commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Stacked on #5099. Refs #4970 and #5104. Remote test --record-video copies verified recordings into the suite archive before publishing standalone IDs.

Before / after

  • The suite reports IDs for recordings collected before it responds. The producing lease can download them after archive consumption. Detached cleanup leaves its files on the daemon host.
  • Copying starts after close succeeds and releases the device lock. A collection failure rolls back partial copies and adds a warning while preserving the test outcome.
  • Public callers without a destination receive relative or basename-only paths. Remote failure paths use the same projection. Trusted requests with a client destination use a unique archive under the session directory.
  • Attempt results add only recording paths produced during cleanup.

Validation

  • Stacked on fix(daemon): publish direct recordings with producer proof #5099 at 9f44fe308b. At 58d16d8c5f, 32 focused tests and typecheck passed. The failed-close regression reproduced copying before the fix and now verifies the export stays on the host. All 13 runnable affected checks passed with exactCommit: true.
  • Live at bfd9e77132 on Android 16. The HTTP suite passed 1/1 and all 229 video frames decoded. The standalone GET returned 401 without the lease and 200 with it after archive consumption. The bytes matched, and both consumed IDs returned RESOURCE_EXPIRED. Direct stop delivered a decodable MP4 and telemetry. The test session and daemon closed, and the emulator shut down.

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.03 MB 5.03 MB +3.3 kB
Package (unpacked) 5.03 MB 5.03 MB +3.3 kB
Package (download) 1.54 MB 1.54 MB +986 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 15.5 ms 14.7 ms -0.8 ms
CLI --help 26.2 ms 23.9 ms -2.3 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 18 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

@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: 2 new findings on 1994657. The verdict and the full list are in the summary comment.

@thymikee
thymikee force-pushed the fix/suite-recording-delivery branch from 1994657 to 0cde418 Compare November 25, 2026 10:36
@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at 0cde418, once the checks and the base PR noted below are done.

Not blocking: these can be taken or left: could one archiveDelivered fact, computed once in handleReplayTestCommand, replace each separate remote-suite check that decides this; could a suite that does not complete either return the already published recording IDs in the error details or not publish them; could the attempt finish step add only the recording paths created during cleanup, so that result.txt of passing and local runs does not gain a copiedArtifacts line; and are the other caller-visible output changes intended (relative or basename-only paths for public callers without a destination, projected error.details.artifactPaths, and trusted client-destination suites writing under the session directory)?

No open review thread still applies, so these can be resolved: ordering check is fixed; late cleanup paths are omitted on purpose and documented; collect after lock is fixed; relative public paths are intended and tested; test cleanup scope is fixed; doc comment is fixed; late detached collection is skipped on purpose and documented; copy failure now returns a warning and keeps the source on the host.

Not verified here: tests were not run locally, and the regression test was checked only by reading 1994657. The live Android evidence comes from 42b91eb (same patch as ba6c9ad) and is still treated as valid, because the later changes are host-side file handling only. It was not confirmed whether session close can leave a suite recording incomplete without an error.

Nothing has failed in CI, and 16 checks passed. "Body rules" was cancelled, probably by a newer run. It validates the PR description and covers no code changed here. One other check is still queued.

Before merge, "Body rules" needs a re-run and the queued check needs to finish. Then #5099 must merge first, because this PR is stacked on it.

@apex-sentinel-staging

This comment has been minimized.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 25, 2026

@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: 2 new findings on 0cde418. The verdict and the full list are in the summary comment.

@apex-sentinel-staging

This comment has been minimized.

@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 25, 2026
@thymikee

Copy link
Copy Markdown
Member Author

No code problems were found at bfd9e77, and the earlier clean review still holds. All 20 checks pass. No further change is needed before merge.

Both open threads can be resolved. This one is fixed: ADR 0024 now states that the suite owns stop and that startup recovery settles without publishing, and the code matches. This one does not apply: the second argument of objectSchema is the required list, so ['session'] already leaves path, fileName and artifactId optional, as the contract expects.

Not verified here: tests were not run locally. The upstream #5099 changes brought in by the rebase were checked only enough to confirm that they are base content and not logic from this PR.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 25, 2026
@thymikee
thymikee added this pull request to stack #5106 November 25, 2026 12:07
@thymikee
thymikee force-pushed the fix/suite-recording-delivery branch from bfd9e77 to 76ed197 Compare November 25, 2026 15:03
@apex-sentinel-staging

This comment has been minimized.

@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 25, 2026
@thymikee

Copy link
Copy Markdown
Member Author

No code problems were found at 76ed197, and the result of the earlier review at bfd9e77 still holds.

All 19 checks pass at this commit, and the required evidence is in place.

Two open threads no longer apply and can be resolved. This one is fixed: ADR 0024 now says the suite owns the stop and startup recovery leaves files on the host, and a direct stop is refused. This one needs no change: the second objectSchema argument lists required fields, so ["session"] leaves path, fileName and artifactId optional.

Not verified here: tests, typecheck and a live device run were not performed. The upstream commit 118d16f from #5099 was read only for its interaction with this PR and was not reviewed on its own.

Nothing else needs to change before merge.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 25, 2026
@thymikee
thymikee force-pushed the fix/suite-recording-delivery branch from 76ed197 to f1f8089 Compare November 26, 2026 10:12
@apex-sentinel-staging

This comment has been minimized.

@thymikee
thymikee force-pushed the fix/suite-recording-delivery branch from f1f8089 to 5e5bf08 Compare November 26, 2026 10:26
@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 5e5bf08. The verdict and the full list are in the summary comment.

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 58d16d8

Since the review of 5e5bf08: 0 new · 0 still open · 1 no longer raised (1 marked fixed)

No open findings.

🔧 1 finding marked fixed in their threads
Finding Fixed by Where
Suite recording collection failure and warning are dropped when close throws thymikee 58d16d8 · reply

Reviewed with this repository's own Sentinel configuration (2d29b6d6e348).

💬 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.

@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 26, 2026
@thymikee

Copy link
Copy Markdown
Member Author

No code problems found at 58d16d8. Recordings are now collected only after the close with retry settles. If the close throws, collection is skipped, so a publication warning can no longer be computed and then silently lost. The earlier thread no longer applies for that reason and can be resolved.

One limit remains. When the close fails, the recording now stays only on the daemon host, with no ID and no warning, and the infrastructure failure is the only signal. At 76ed197 it was copied and published. This is treated as the deferred publication choice that the PR description documents and #5104 tracks, not as a regression. Not verified here: whether base 9f44fe3 put a recording stopped during cleanup into the archive on this route. The recording was written straight to the requested archive path there, and its artifact path membership was not traced.

The PR description reports 32 focused tests and typecheck passing at this commit. Not verified here: the focused tests were not run for this review. The live run at bfd9e77 predates this commit. The new behavior is limited to the close failure route, which a live run cannot easily reach, and the success route is unchanged.

The only check that did not pass is Body rules, which was cancelled. It validates the PR description, not code, and this change does not touch its route, so it is likely unrelated to the code. All other checks are green. Before merge, update the PR description as needed so that Body rules passes.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 26, 2026
@thymikee
thymikee merged commit 55267de into 0.22 Nov 26, 2026
18 of 19 checks passed
@thymikee
thymikee deleted the fix/suite-recording-delivery branch November 26, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant