Repository navigation
fix(android): stop accepting screen-record rotations once a stop is claimed - #4132
Conversation
…laimed A rotation that was awaiting native work could publish its chunk and arm another 170s timer after finish or forceCleanup had already settled the recording, starting a recorder on the device for a recording that ended. The rotation lifecycle is now a phase the stop claims synchronously before it awaits the in-flight rotation, so scheduling and chunk publication both refuse after that point.
Extracts the requested-option fields the native marker and the durable descriptor both carry, and splits the rotation steps so the stop claim and each commit step read on their own.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Size Report
Startup median (7 runs, lower is better):
|
thymikee
left a comment
There was a problem hiding this comment.
P1 — packages/platform-android/src/recording/runtime.ts:204
If finish() reaches finalizeAndroidRecording() and pauses at any host/device await (for example chunk pull or export completion), a concurrent forceCleanup() claims stop and cleans the same manifest/chunks. The finalizer then resumes and can publish completion from files/evidence cleanup already removed; finish() unconditionally calls confirmNativeCleanup() and reports success. The inverse ordering also races: forceCleanup() can read active evidence, then finish() finalizes/removes it while cleanup is still stopping/removing the same resources. createScreenRecordingLiveHandle does not serialize these operations when cleanup starts before finish; its memoization only makes cleanup wait for an already memoized finish. Serialize terminal work with one shared lifecycle promise/operation (or have cleanup await the active finish and only clean after its failure), and do not mark finished until the chosen terminal operation settles.
thymikee
left a comment
There was a problem hiding this comment.
Verdict: needs-changes against the coordinator's requirement that no new chunk start or publication occur after either stop operation begins.
Reviewed exactly f7879cf2d266ee1dd476d0342b2819bdeceb647b..91c753b658b622650c230e43d4e90bcb5ed02c29.
-
[P2] Fence every launch attempt before starting another device recorder —
packages/platform-android/src/recording/runtime.ts:132. A concurrent launch fails,launchRotationChunkawaitsstopChunk(previous)at line 130, andfinish()orforceCleanup()claims stop during that await. When stopping the old recorder resolves, line 132 unconditionally callslaunchChunk(previous), which launches a new recorder despite the stop claim. The same issue exists when stop is claimed during the pending-marker write instartPendingChunk(launch.ts:106): after that write resolves, line 112 still starts a recorder, and candidate retries also ignore the claim. The check at runtime.ts:181 only runs after these launches have finished. Rolling the child back afterwards limits its lifetime but does not satisfy the no-new-start requirement. Suggested fix: carry the recording's stop admission/cancellation into the launch owner; refuse sequential fallback and candidate retries after stop, and recheck after each pending-marker await before dispatching a device start. Keep rollback for a launch already dispatched before stop. Add regressions pausing the old-chunk stop and the pending-marker write, asserting no subsequent transport start. -
[P2] Fence publication at the actual manifest commit boundary —
packages/platform-android/src/recording/runtime.ts:187. The next child is ready and the phase check passes; the two-chunk manifest write then waits before publishing on the device. A stop claims the recording during that wait. The write subsequently succeeds, and lines 194–195 adopt the newly published chunk without another admission decision. In production,writeManifestpublishes through an asynchronous shellprintf ... && mv(src/platform-runtime-screen-recording-android-host.ts:136–146), so publication can occur after the stop claim. This violates the explicit requirement for an in-flight rotation that succeeds after stop began. The new commit tests miss this boundary: runtime.test.ts:245 and :279 assignmanifest = contentsbefore pausing, so their second chunk is already committed when stop starts and must correctly be collected. Suggested fix: make pending-to-committed publication stop-aware at its actual write/commit boundary, with cancellation/fencing and rollback of a refused uncommitted child. Preserve and collect commits that already succeeded before stop. Add the complementary test that pauses before storing/publishing the two-chunk manifest, claims stop, then releases the write and asserts no new chunk is published.
Other probes, by inspection:
- Either stop clears the timer synchronously; the schedule guard prevents rearming after successful rotation, and failed rotations do not schedule another timer. There is no pull inside this version of rotate; collection runs after joining rotation.
- A chunk committed before stop is retained in
chunksand included in finalization. A launched child returned after stop is rolled back before rotation settles; a rollback failure rejects finish and retains pending evidence for explicit cleanup. Rotation failures after stop likewise prevent finish from claiming completion. - Finish-first cleanup is serialized by the unchanged shared live handle, including cleanup after a failed finish. Cleanup-first finish is still asymmetrically allowed by that shared handle; this predates the reviewed range. The durable coordinator also serializes operations under its resource fence, so I am not reporting that as a new PR defect.
recordingRequestFieldspreserves every original field, optional-field omission, and insertion order in both manifest and descriptor. The named rotation steps preserve the original concurrent-start, sequential fallback, rollback, and commit order outside the intended stop changes.- Design: one monotonic stop admission owner is sufficient. The local phase is small, but its authority must extend through launch and publication rather than only checking after launch and before an asynchronous write.
- By inspection, all three added tests would distinguish the base: its successful rotation unconditionally rearms the timer, and it has no stopped-launch abandonment. I did not execute tests or wait for CI. Reviewed code remains unchanged.
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Cancelling the host command cannot undo the on-device rename or prove it never ran, so an abort signal cannot fence the commit boundary: it discarded a chunk the device had already committed, and it turned an unconfirmed rollback into a clean stop. Drop the signal from the commit write, run it to its real outcome, and keep the child in the recovery evidence whenever its rollback cannot be confirmed. Launch admission stays: no recorder starts after a stop.
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
Apex Sentinel: 9 new findings on a49c253. The verdict and the full list are in the summary comment.
There was a problem hiding this comment.
All reported issues were addressed across 5 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
254e619 to
ff52254
Compare
Apex SentinelVerdict: Since the last review: 5 new · 1 still open · 21 no longer raised 6 finding(s): 2 minor, 4 nit. Verdict: approve. reached max rounds (1). 🟡 Minor (2)
🔵 Nit (4)
Reply under an inline comment with |
There was a problem hiding this comment.
Apex Sentinel: 5 new findings on ff52254. The verdict and the full list are in the summary comment.
|
The fix reads correctly at a49c253, but the live validation for the changed route is missing, so this is not ready to merge yet. The only check that is not passing is a review-bot check, not an execution job. Its required fix is the sequential-fallback item below, which is in this diff and still holds at head. The changed device route is a record stop that lands while a rotation is in flight (runtime.ts:202). The only live run in the PR is a happy-path 12.6 min recording at an unnamed SHA that predates fa0effc and a49c253. No stop landed inside a rotation window, and nothing is recorded at head. The PR guidance (docs/agents/pull-requests.md:20-25, docs/agents/device-verification.md:19) asks for the changed route to run live with the source SHA. Please run this at a49c253 ( The sequential fallback still retires the active recorder after the stop is claimed (runtime.ts:147). Launch then refuses at launch.ts:118, the rotation withdraws silently, and finish reports the 180 s platform-limit warning (finalize.ts:69-73) for a recording that did not hit the limit. The rule: once a stop is claimed, no rotation step touches the device, and that includes stopping the previous chunk. Please check the admission before the fallback stop, and assert in the test at runtime.test.ts:405-443 that the warning is absent. Not blocking, and fine to take or leave: the PR body still says commit publication is refused once a stop is claimed and records validation at fa0effc, while a49c253 only gates launch and lets the commit settle on its own outcome, so the summary and the test, Could the stop state have one owner? Of the open inline threads, the ones on the fallback stop after the claim and the dead signal branch still stand, and 4 lower-priority threads still stand. These threads do not apply at a49c253 and can be resolved: r4434791073 (a stale pending path is cleaned idempotently: host remove is Before merge, please post the live run at a49c253 and add the admission check before the fallback stop with the warning assertion. I read base and head code only and ran no tests or gates, and I did not reproduce the fallow claim behind |
|
Both round-2 P1 findings accepted. I do not push back on the coordinator's direction — it is right, and my round-2 fix was wrong for the reason the review gives: cancelling the host P1-1 ( P1-2 ( Regression tests in
Recording suite 103 passed (15 in runtime.test.ts); Live run (required, done): emulator-5554 (Pixel_9_Pro_XL_API_37, Android 17.0), this worktree's build at Reply on the round-2 cubic items: the P3 on the |
ff52254 to
fa0effc
Compare
thymikee
left a comment
There was a problem hiding this comment.
Verdict: needs-changes. Reviewed head a49c253de2b993c846097f110f1c25323086ec6a.
- [P1] Preserve the current recorder when stop claims during sequential fallback —
packages/platform-android/src/recording/runtime.ts:147-151. If the concurrent start fails,launchRotationChunkstopspreviousbefore its fallback launch checksstopAdmission. A stop claimed in that interval makesstartPendingChunkthrowAndroidScreenRecordingStopClaimed;rotate()treats it as a withdrawal, whilechunksstill names the now-stopped previous chunk.finish()then completes that truncated chunk andstopOwnedChunksreportsalreadyExited, whichfinalizeAndroidRecordinglabels as the 180s platform limit (finalize.ts:69-73) even though this tool stopped it. Preserve/reconcile the old chunk before withdrawing, or report an explicit non-limit interruption; add a deterministic test for stop during fallback after the previous recorder was stopped.
The two round-2 P1s are resolved: an in-flight commit now runs to its real outcome and a successful write is adopted/collected; failed commit rollback surfaces via rotationFailure, retaining the child path as pendingRemotePath. Recovery and cleanup consume that path (start-reconciliation.ts:107-128, cleanup.ts:14-24).
Apex Sentinel: the sequential-fallback finding is real (above). Its finding that abandoned-chunk rollback can leave the marker without a pending path is not: the pre-launch marker already records the pending path, and rollbackChunks failure propagates out of rotate() into rotationFailure; the best-effort rewrite only follows confirmed rollback. Its remaining findings are nits or unrelated to this diff. The reported live run is adequate to show the changed route completing and leaving no recorder, but it explicitly missed a stop inside the commit window; the deterministic boundary tests cover that timing, and the report candidly states this limit.
There was a problem hiding this comment.
Verdict: needs-changes. Reviewed fa0effc59c5117d468e1733816f241ca0fab22e7..a49c253de2b993c846097f110f1c25323086ec6a in detached HEAD at the latter SHA.
Both round-2 P1 findings are resolved by inspection.
- The rotation commit at
packages/platform-android/src/recording/runtime.ts:224receives no stop signal. An acknowledged commit is adopted at line 231 even if stop was claimed during the write. Both stop operations join the rotation; finish then passes the updated chunk set tofinalizeAndroidRecording, whose stop step callsstopOwnedChunksbefore collection. The adopted child is stopped and pulled.schedule()checks the stopping phase and cannot re-arm rotation. Commit does not dispatch a recorder, and candidate launch admission remains checked immediately before dispatch inlaunch.ts:127. - A genuinely failed commit always rethrows at
runtime.ts:227. The promise assigned torotationincludes the catch that storesrotationFailure, soawait rotationcannot finish before that assignment. Finish fails instead of reporting clean completion. An uncertain child rollback retainspendingRemotePathat lines 175–186. This is actionable:cleanup.ts:17–24,42–50scans that path, reconstructs process identities, stops those writers and removes the pending artifact; inconclusive scans or failed cleanup retain the marker and returncleanup-pending. Reattachment refuses a pending launch (recovery.ts:161–165), and start reconciliation also checks pending-path writers before retiring eligible evidence (start-reconciliation.ts:107–120). A failed pending rewrite leaves the prior pending marker or the attempted committed marker naming the child, rather than deliberately publishing evidence that omits it.
Remaining concrete finding:
- [P2] Preserve an intentional retirement when sequential fallback withdraws —
packages/platform-android/src/recording/runtime.ts:147–151,209–212. When concurrent launch fails, rotation starts retiring the current recorder. If stop is claimed while retirement is in flight, the retried launch correctly refuses and rotation returns, but the current chunk is still the last committed chunk. Finalization calls stop on that already-retired recorder;chunks.ts:229returnstrueforalready-missing, andfinalize.ts:69–73converts this into the 180-second platform-limit/truncation warning. The existing test atruntime.test.ts:405–439sets up this exact sequence but checks only completion and launch/chunk counts. This is Sentinel's real finding, with P2 severity: it misreports normal stop as platform-limit truncation; it does not establish a recorder leak. Check admission before initiating fallback retirement, and retain the fact that rotation intentionally stopped the active recorder so finish does not infer a platform-limit exit when stop arrives during an already-dispatched retirement. A pre-retirement admission check alone cannot fix that latter window. Assert absence of the platform-limit warning in this test.
Live validation remains incomplete for the changed overlap. The new body and latest author comment now identify head a49c253de2, emulator-5554, two exported chunks, confirmed termination and no recorder 200 seconds later. That proves the normal rotation/stop route at head. They explicitly say the automated overlapping stop failed with a stale session and the successful stop landed five seconds later, after commit settled. Thus neither a stop during launch nor during commit ran successfully live. docs/agents/device-verification.md:19 and docs/agents/pull-requests.md:20–21 require the changed route, and explicitly exclude adjacent routes/fixtures as substitutes. Before merge, record a successful same-head stop demonstrably overlapping an in-flight rotation, with the resulting chunk/recorder/artifact observations. Keep the current deterministic tests for the publication boundary; the new report honestly states this live limitation but does not close it.
Disposition of all nine current Sentinel findings:
| Finding | Assessment |
|---|---|
| Sequential-fallback platform-limit warning | Real P2, described above. Its suggested admission check is insufficient for retirement already in flight. |
| Stale pending path after successful abandonment rollback | Not a demonstrated bug. Rollback failure propagates before the rewrite; after successful rollback, stale evidence is safe to retry. Production removal is rm -f (src/platform-runtime-screen-recording-android-host.ts:115–116), which succeeds for an absent file. A persistent transport failure correctly stays pending. |
| Cleanup during finish/export | Incorrect. The shared live handle waits for the finish promise before calling backend cleanup (packages/capture-kit/src/screen-recording-live-handle.ts:52–61). Retrying cleanup after a failed finish is intentional and identity-checked. |
| Fixture forwarding optional signal | No concrete regression. Overrides may ignore an optional argument; the signal-aware regression override explicitly accepts it. |
| Phase documentation names writers rather than readers | No concrete regression. Naming the two state writers does not claim there are no readers. |
| Timer depends on clearTimeout | Incorrect as a current failure. Stop clears the pending timer and schedule() independently refuses re-arming; candidate admission also prevents dispatch. The finding assumes a future removal of existing protections. |
previousStopped redundant |
Incorrect. It prevents stopping the previous chunk again after successful sequential adoption (runtime.ts:232) and affects rollback evidence independently of rollbackUncertain. |
next unused / only its path used |
Incorrect. rollbackChunks(transport, [next]) at runtime.ts:175 consumes its full process identity. |
| Abandonment rejection races assignment of rotationFailure | Incorrect. rotation is the promise returned by .catch(...); finish awaits that promise, including the failure assignment (runtime.ts:109–111,239–240). An uncertain rollback rejects finish and leaves the pre-existing pending marker. |
Read-only source review; no source edits, commits or pushes. No tests executed and no CI wait. git diff --check passes; checkout remains clean at the reviewed head. Author-reported unit/gate results were read, not independently rerun.
There was a problem hiding this comment.
Apex Sentinel: 4 new findings on fa0effc. The verdict and the full list are in the summary comment.
|
Both P2 findings accepted and fixed. Head P2 — P2 — Regression tests (runtime.test.ts, each recorded failing on
Recording suite: 101 passed (13 in runtime.test.ts). Full Reply on the cubic items:
|
thymikee
left a comment
There was a problem hiding this comment.
Verdict: needs-changes. Reviewed 91c753b658b622650c230e43d4e90bcb5ed02c29..fa0effc59c5117d468e1733816f241ca0fab22e7; verified local HEAD is exactly the latter SHA.
-
[P1] Treat cancellation as an unknown publication outcome, not a refused commit —
packages/platform-android/src/recording/runtime.ts:210–217. The device can finishmv -f tmp manifestbefore stop is claimed, while the ADB acknowledgement/host process settlement is still pending.claimStop()then aborts the write. The productionrunCmdrecordsdidAbortand rejects with cancellation even if the command subsequently reports exit code 0 (packages/host-kit/src/internal/exec.ts:247–271, 778, 905–913). This catch unconditionally runsundoRotationCommit, stops/removesnext, and rewrites the marker with the old chunk set.finish()subsequently collects only that old set: a chunk committed on-device before stop is discarded. Conversely, killing the host ADB process supplies no device-side check ofstopAdmissionbeforemv, so forwarding this signal also does not establish the required no-publication-after-stop fence. The new test atruntime.test.ts:519–522assumes an aborted write publishes nothing; atomic rename guarantees whole-file visibility, not that cancellation undoes a rename or confirms it never ran. Fix: distinguish a proven refusal from an uncertain outcome, settle/reconcile the device publication before rolling back, and preserve/adopt a chunk whose commit already happened. Exercise publication-before-abort with delayed acknowledgement/cancellation, plus the genuine pre-publication refusal case. -
[P1] Do not complete stop after an unconfirmed commit rollback —
packages/platform-android/src/recording/runtime.ts:217–220. If the commit write rejects after stop was claimed and stoppingnextfails (for example an inconclusive ownership probe or failed forced stop),undoRotationCommitsuppresses that failure at line 167. With concurrent rotation, its successful rewrite at line 177 removesnextand its pending path from the marker anyway. The new aborted-signal return then leavesrotationFailureunset, sofinish()exports only the old chunks and reports completion while the abandoned recorder can remain alive without recovery evidence. A failed artifact removal is likewise hidden and drops the remaining file from evidence. Cleanup-first has the same loss: it reads the rewritten marker and cannot discover the omitted child. Previously the commit exception still prevented successful finish; this return now converts an unconfirmed rollback into success. Fix: require confirmed child termination and artifact removal before withdrawing, and propagate rollback uncertainty while retaining the child's identity/path as pending evidence. Add stop-failure and remove-failure variants of the refused-commit test.
Round-1 dispositions and other requested probes:
- Launch finding resolved by inspection.
startPendingChunkchecks admission before each candidate and again after the pending-marker await; sequential fallback enters that owner too.AndroidScreenRecordingStopClaimedis an actual error class, is rethrown before concurrent-failure fallback retires the previous recorder, and is consumed byrotate()as a withdrawal. A successful refusal does not surface as a user stop failure. An actual marker/rollback failure should still surface. - Publication finding is not resolved: the signal cancels the host command, without establishing a device publication outcome or fence, as finding 1 explains.
- On the successful rollback path,
rollbackChunksstops the child and removes its file; the new test asserts both. Failure paths do not earn those guarantees (finding 2). - A successfully acknowledged commit still updates
chunks, and finish joins rotation before finalizing every chunk in that array. The cancelled-acknowledgement case loses an already committed chunk (finding 1). - I disagree with skipping renewed live evidence solely because the route is unchanged. Supplying a new abort signal changes live ADB execution/cancellation behavior on that route.
docs/agents/pull-requests.mdrequires live evidence for device-facing changes, anddevice-verification.mdrequires the changed route. The fixture's all-or-nothing cancellation behavior does not prove the production remote-write boundary. Verify the stop-during-publication path against the real transport and record device/SHA/results, alongside a deterministic transport-boundary regression.
Read-only source review; no source edits, commits, or pushes. No tests executed and no CI wait. gh pr checkout 4132 found the branch already in use by another worktree, so this review used detached HEAD at the requested SHA in this worktree.
A sequential fallback that retired the active recorder and then withdrew left that recorder's absence to be read by finalization as a 180s platform-limit exit, so a normal stop disclosed truncation that never happened. Refuse to begin a retirement once a stop is claimed, record a retirement already dispatched as the recording's own doing, and have finalize suppress the limit disclosure for it.
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
Apex Sentinel: 4 new findings and 2 moved to a new line on 5bfb20e. The verdict and the full list are in the summary comment.
|
P2 accepted and fixed. Head P2 (sequential fallback misreported as the platform limit): accepted. Both halves are in. Regression: the assertion is added to the existing Live evidence (overlap run at head Gate for this head was run in the foreground before the live run: |
|
Coordinator check of round 4 (
No blocking findings. All findings from rounds 1–3 are resolved. |
|
The earlier findings from a49c253 are fixed at 5bfb20e: a claimed stop now refuses new rotations, and the fallback retirement keeps the platform-limit warning off the hidden-cap path. One thread still needs a change before merge, described below. The checks are green (19 checks, none failing or pending), and there are no conflicts. The one failure in your local gate ( The change to make: runtime.ts:159-160 sets the flag before Not blocking: these can be taken or left. The admission check at runtime.ts:155 has no test that reaches it. The test at runtime.test.ts:405-447 claims the stop during the paused retirement, which is after that line, so deleting the guard keeps the suite green. One more test would cover it: the second concurrent start rejects after On the open inline threads: #4132 (comment) (already-missing result) still applies and is the change above. #4132 (comment) (unused signal branch) still applies as test cleanup:
On evidence: the live run is the one you reported, and I did not re-run it. It exercises the concurrent-start branch with two live recorders at stop time. The sequential fallback changed by this delta is covered by unit tests only, because the Android 17 emulator accepts a second concurrent |
A sequential fallback marked the active recorder retired before its stop answered, so a recorder the platform's 180s cap had already ended was read by finalization as this recording's own retirement and its truncation disclosure went silent. Record the retirement only when the stop confirmed the recorder was live, and drop the dead aborted-commit branch from the publication test.
There was a problem hiding this comment.
Apex Sentinel: 5 new findings on c4760a5. The verdict and the full list are in the summary comment.
|
Round-5 triage of the 9 unresolved inline threads: 2 accepted (fixed test-first), 1 accepted as a test-only cleanup, 6 replied-and-resolved as nit/intentional/out-of-scope. Head Accepted — Accepted — Replied and resolved — Replied and resolved — Replied and resolved — Replied and resolved — Replied and resolved — Replied and resolved — Gate: first |
|
Coordinator check of round 5 (
No blocking findings. All 14 threads were dispositioned and resolved, and no threads are open. |
|
The code looks good at c4760a5. The rotation fix from the earlier review (#4132 (comment)) is in, and the new test fails on the old code, so it guards the regression. CI is green: 19 checks, none failing or pending. The local gate failure you saw is in Apple provider-scenario tests that this Android recording diff does not touch, and your rerun was green. No conflicts. Not blocking, and fine to take or leave: at packages/platform-android/src/recording/runtime.ts:161, All review threads are settled. These are fixed at this commit and already resolved: #4132 (comment), #4132 (comment) and #4132 (comment). These are benign and also already resolved: the forwarded optional signal in fixtures.ts (#4132 (comment)), the RecordingPhase doc wording (#4132 (comment)), the phase versus abort-signal overlap (#4132 (comment)), the in-memory-only flag, which can only over-disclose the limit after a restart (#4132 (comment)), a failed commit surfacing through rotationFailure, which is existing policy (#4132 (comment)), I did not run the test suite. I judged the regression test by reading the old flag write and finalize.ts:76-77 against the new test's stop stub, and you report the test failing on 5bfb20e with |
Summary
record stopforadb screenrecordcould start a new recorder on the device after the recording had ended. A rotation awaiting native work still published its chunk and armed another 170 s timer afterfinishorforceCleanuphad awaited it and finalized, because both awaited the in-flight rotation before refusing further work.The fix splits the boundary by what each side can actually prove. A stop claims the phase synchronously and arms an abort-based launch admission:
startPendingChunkchecks it before every candidate dispatch (concurrent start and sequential fallback alike), so no recorder starts after a stop was claimed. The rotation's commit write runs to its real outcome and nothing else decides it: aborting the host command cannot undo the on-devicemv -f tmp manifestor prove it never ran, so a commit that succeeds is adopted and the stop collects that chunk like any other committed chunk, and a commit that genuinely fails rolls back with its real result — an unconfirmed rollback keeps the child's path in the marker as pending, and the failure surfaces throughrotationFailureinstead of a clean stop. A sequential fallback that confirmed it stopped the current recorder records that retirement, so finalization reads the recorder's absence as this recording's own doing rather than as the 180 s platform limit truncating a live recording; a retirement that found the recorder already gone records nothing and the limit disclosure stands. No shim, no new package.Scope expansion:
manifest.tsgainedrecordingRequestFields, owning the requested-option fields the native marker and descriptor both carry.fallowflagged that duplication plus arotatecomplexity breach, so those got owners rather than an allowlist. No CLI, SDK or MCP surface change. No linked issue.Validation
Branch base
f7879cf2d2, headc4760a56722479c6759305fcfac2956da59b2630.pnpm exec vitest run --project unit-core packages/platform-android/src/recording/runtime.test.ts:expected 3 to be 2(extra launch afterfinish, and afterforceCleanup), and 2 committed chunks where a claimed stop must publish none.91c753b658: 10 passed.91c753b658+ the round-2 tests: 3 failed | 10 passed (expected 2 to be 1, rejectionconcurrent start unavailable, adoption of a refused commit) → round-2 headfa0effc59c: 13 passed.fa0effc59c+ the round-3 tests: 3 failed | 12 passed —collects a chunk whose commit published while the stop was in flight:expected [ Array(1) ] to deeply equal [ …(2) ](a chunk the device committed before the stop was discarded);retains the child when the rotation commit fails after the stop was claimedand its remove-failure variant:promise resolved "{ status: 'completed' }" instead of rejecting(an unconfirmed rollback reported a clean stop).a49c253de2: 15 passed.a49c253de2+ the round-4 assertion (no platform-limit warning after an intentional fallback retirement): 1 failed | 14 skipped for that test —AssertionError: expected 'Android adb screenrecord stopped befo…' not to match /platform limit/— → head5bfb20e738: 15 passed.5bfb20e738+ the round-5 test (still discloses the platform limit when the recorder a fallback retired had already exited): 1 failed —AssertionError: expected '' to match /platform limit/(a genuinely limit-expired recorder lost its disclosure) — → headc4760a5672: 16 passed; recording suite 104 passed (14 files);packages/platform-android134 files / 1337 tests passed.Gate
pnpm check:affected --run --head c4760a56722479c6759305fcfac2956da59b2630: all runnable checks passed,exactCommit: true(format, lint, typecheck, layering, fallow, build, vitest-related, unit; coverage skipped, provider-integration deduplicated, replay-android skipped). Receipt:.tmp/validation/run-FGdXbb/receipt.json. The first gate run for this head failed only ontest/integration/provider-scenarios/apple-platform-output-guard.test.tsexceeding its 15 s time budget (32.47 s) under full-lane load — an unrelated Apple-simulator timing flake, recorded here rather than touching it; an earlier round's run likewise failed only insrc/__tests__/daemon-registration-owner.test.ts(manual graceful stopobserved modeforcedon a 30 ms grace window), which passes in isolation. CI owns full coverage, native builds and device lanes.Live (overlap run closed at head
5bfb20e7382d36f05fa0cb256264cfc494886c7f): worktree build verified in the daemon command line (.../t3-ade45b54/dist/src/internal/daemon.js, pid 21604), emulator-5554 (Pixel_9_Pro_XL_API_37, Android 17.0) viewed viadevice_open, private daemon--state-dir /private/tmp/sm6-r4-state,record start --scope device11:10:27 (chunk 1 pid 5230). A stopper script sharing the exact--session sm6-r4 --state-dir /private/tmp/sm6-r4-state --serial emulator-5554constants the start used caught the rotation in flight at 11:13:21.441 — marker holdingpendingRemotePath: /sdcard/agent-device-recording-1793528000098.mp4with two livescreenrecordprocesses (5230 launching child 9229) — and issuedrecord stopin the same millisecond; the stop was accepted (the round-3 miss was a stale session name in the stopper, fixed by one shared constants block). It returnedcompleted,recorder: confirmed,nativePathDisposition: retired,durationMs: 183302,capturedDurationMs: 163659after 11.3 s: the launch admission refused the rotation's retried launch, the pending child was rolled back, and the output holds the one committed chunk (sm6-run.mp4, 7,176,187 B, ffprobe 163.659 s; final marker: chunk 1 pid 5230,pendingRemotePathnull). The only warning is the idle-tail disclosure; no platform-limit/truncation warning.ps -A | grep screenrecord(adb, evidence only): no match immediately after the stop and none at 11:19:06, 334 s after it — past the 200 s requirement and the 170 s rotation window; no*.mp4left on device beyond the completion journal the next start retires. Sessions[],daemon stopfor every state dir used,device_close.Earlier runs on the same route (previous round, head
a49c253de2): a stop 5 s behind an observed in-flight rotation completed with both committed chunks collected (sm6-run.mp4169.007 s +sm6-run.part-002.mp44.178 s, marker pids 19932/27942), no recorder immediately or 200 s after stop. That round's automated overlapping stop itself had failed with a stale session name (no active recording) — the run above closes exactly that gap.Independent review is arranged by the coordinator; round-1 through round-5 dispositions are in the comment threads. Risk: the unconfirmed-rollback marker path (uncertain stop or failed removal of a rotation child) has unit coverage only — the live overlap exercised its confirmed counterpart (pending child rolled back, marker rewritten without the pending path).