Repository navigation
Conversation
Size Report
Startup median (7 runs, lower is better):
Affected plugins
|
This comment has been minimized.
This comment has been minimized.
114df0f to
7214c93
Compare
This comment has been minimized.
This comment has been minimized.
278fdec to
65f4412
Compare
0633a50 to
92fab3a
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 3 new findings on 92fab3a. The verdict and the full list are in the summary comment.
ac0eadf to
b6e9bb3
Compare
92fab3a to
887e399
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
b6e9bb3 to
ee8075e
Compare
887e399 to
460a8df
Compare
|
At 460a8df, the capture-identity change still has defects in how saved destinations are retired and how downloaded files are written, and the live evidence is missing. An interrupted start can disable path reuse for the rest of the session. Live evidence is required before merge, because this change affects the capture start and stop route and remote delivery of trace and native perf artifacts. Against a remote daemon over an HTTP A second independent pass found that a remote test archive may replace an existing file. If the requested artifacts root already holds a regular file, the daemon can return a test-artifacts directory archive with an entry of the same name. The tar reader accepts it, and the downloader renames the staged entry over the file on POSIX. The caller chose only the root; the daemon chose the file. Can every archive be extracted inside a new, exclusively created, client-owned suite directory under that root, with entry names confined to it and the new local path reported in the response? A second independent pass found that generated download names are opened with replacement semantics. A screenshot without an output path registers a millisecond-based name as if the caller had chosen it, so two requests can hit the same file, and an existing symlink is followed. The UUID fallback truncates and, on a failed fetch, removes the destination, and the recording fallback publishes with a replacing rename. Symlinked parent directories are not refused. Can every generated destination, found by tracing each fallback name from preparation to publication, be kept distinct from caller paths, created exclusively without following links under the admitted output directory, retried on collision, and cleaned up only when the download owns it? A second independent pass found that capture records follow symlinks. A symlinked record file is read through its target, a dangling one counts as absent and is replaced on start, and a symlinked record directory redirects locking, reads, writes and close cleanup. Can every record operation first admit and pin a private directory ancestry, open only regular files without following links, create new records exclusively, and replace or remove only a verified record under the lock? A second independent pass found that two overlapping pathless stops can both use one saved path. Neither stop reserves the generation at dispatch. If the daemon confirms both, both can read the path before either retires it, and the second download can replace the first artifact. Can the ID check, destination read, and retirement happen in one locked step, so only one caller gets the path? A second independent pass found that a successful stop can leave its pending start reusable. If a stop is sent while capture A's start reply is delayed, the stop goes unbound and only clears a foreign marker, then the late reply promotes A to a settled record. An active record also survives a successful stop after an uncertain duplicate start made the record unknown. Can reuse stay off while a start is pending, while any successful stop that confirms a tracked ID retires it and a late reply cannot restore it? A second independent pass found that a killed start process disables reuse for later captures. A process that dies after saving its entry but before dispatch leaves it with no owner or expiry; a later successful start removes only its own entry, so pathless stops ignore the saved path until close or manual cleanup. This is a second route into the interrupted-start problem above. Can dead owners' entries be reclaimed, or capture changes be serialized so a confirmed replacement supersedes abandoned ones? A second independent pass found that a successful close can leave a capture record behind. If a pending start settles after close takes its snapshot and before the close reply, the changed record survives even though the session is gone. A start registered after the directory scan can also be missed. Can close retire every generation it actually closed, including unconfirmed ones, or serialize the session's capture changes through close, while keeping starts accepted after the old session closed? A second independent pass found that equivalent session names get different record keys. Under tenant isolation, A second independent pass found that a failed close can leave a retired session's destination live. For a session without a device claim, a cleanup error during close still retires the session, but the client settles only on success, and a later no-active-capture answer does not clear the record either. Can terminal errors carry typed evidence that the session or capture is retired, so the client settles it, and keeps the destination when both are confirmed live for retry? Would a smaller client design meet the same goal? Keep the daemon half. Keep one record per endpoint, tenant, run, lease, session and family holding Not blocking, so take or leave: share the lock, write and key helpers with These earlier threads do not apply and can be resolved: legacy captures, because the client sends an ID only from its own settled record and the daemon compares only a present ID; perf report path, because the base branch never passed it the start destination and CI is still pending: 19 checks passed at this head, and the one queued check is not a test job. An earlier failure in the Before merge, the interrupted-start problem needs a fix, ideally through the single-record design, the other defects above need to be resolved, and the live remote trace and native perf results need to be attached. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 460a8df. The verdict and the full list are in the summary comment.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
All reported issues were addressed across 22 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
At ed7b418, one problem from the earlier review still needs a code fix, and the live evidence is still incomplete. The delta since 460a8df changes only security.md and restores the sentence about remote script delivery limits. The code problems remain. capture-destination-record.ts:283: An interrupted start still disables saved destinations. capture-destination-record.ts:242: Live evidence is required before merge. The PR body summarizes an iOS simulator run through an isolated HTTP proxy, with returned capture IDs, a trace downloaded into client state and perf at the caller path. It has no commands, device name, state dir or JSON output, and it does not show the pathless trace stop landing at the start path or the second-state-dir mismatch. Please run the built binary at the final head against a remote daemon over an HTTP capture-destination-record.ts:330: Please confirm this likely second route into the same problem. A start process killed after it saves the pending entry and before dispatch leaves an entry with no owner or expiry, so reuse stays disabled until close. The single-record design removes this case. capture-destination-record.ts:55: Please confirm this likely defect. The record key hashes the raw A second independent pass found the same interrupted-start regression at capture-destination-record.ts:283. After the abandoned start, a later confirmed start with an explicit destination still leaves the old entry. The next pathless stop sends no saved ID and downloads to a generated filename (daemon-artifacts.ts:765-786). A confirmed start should supersede older pending entries. Keep the generation check on late settlement so a superseded start cannot restore its record. For a follow-up issue, not for this PR:
These open threads still apply and can be handled without holding the merge: help omits confirmation, proxy docs omit condition, test downloads nothing, mismatch test naming and lock wait abort. One lower-priority thread also still applies. These can be resolved:
CI is green: all 29 checks pass. Not verified here: the code problems above were not reproduced; they come from reading code that is unchanged since 460a8df, as checked with a diff. The 94-test claim and other local tests were not run. The commands, device, state dir and outputs of the live run could not be checked without a transcript. It also remains unchecked whether a native perf capture re-adopted after a daemon restart keeps Before merge, fix the interrupted-start regression with its test and add the live evidence. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
thymikee
left a comment
There was a problem hiding this comment.
Follow-up on the maintainer review at ed7b418. At 27edb93b1c, a start confirmed by the daemon drops lower-order pending entries and retains higher-order attempts. Settlement still requires the pending generation to exist, so a late reply cannot restore a retired path. Tenant-isolated start, stop, and close use the same session naming rule as daemon admission. A tenant label alone does not establish isolation, and the client cannot infer isolation imposed only by the server's auth hook.
The focused capture-record file failed three cases on the previous implementation and passes all 38 tests on this head. It covers explicit paths, state-directory and credential separation, lease scope, cancellation, and tenant alias isolation. The historical archive and generated-file publication and concurrent or failed close handling remain follow-ups from the maintainer review.
Final-head live receipts remain open. On the built CLI through an isolated HTTP daemon, record:
trace start ./t/a.trace, an interaction, thentrace stop --json. Assert absoluteoutPathand nonempty output. Repeat without a start path and assert a unique file in the client working directory.perf cpu profile start --kind xctrace --template "Time Profiler" --out ./a/app.trace, thenperf cpu profile stop --kind xctrace --json. Assert the absolute caller path and a materialized artifact.- Start trace from state directory A. Stop A's capture from B with B's own explicit destination, then start a replacement from B on the same daemon and session. A's pathless stop must return
capture-identity-mismatch. Stop from B to confirm its replacement remained active.
The assigned simulator worker should attach commands, device, state directories, exact SHA, JSON and artifact checks. The older live run and hosted smoke results do not cover these final-head cases.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 27edb93. The verdict and the full list are in the summary comment.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 finding moved to a new line on da91932. The verdict and the full list are in the summary comment.
| fs.appendFileSync(outPath, ''); | ||
| session.trace = { | ||
| outPath, | ||
| clientCaptureId: req.meta?.captureId, | ||
| startedAt: Date.now(), | ||
| clientOutPath: req.meta?.clientArtifactPaths?.outPath, | ||
| clientOutPath: req.meta?.captureId ? req.meta.clientArtifactPaths?.outPath : undefined, | ||
| ...(req.internal?.publicNetworkOnly ? { remoteCaptureOutputPath: outPath } : {}), | ||
| remoteCaptureTenantId: session.lease?.tenantId ?? req.meta?.tenantId, | ||
| }; |
There was a problem hiding this comment.
No longer raised on 1adba76.
🟡 Minor · Old client's pathless trace stop now receives the daemon's own path as its destination
A released client (no meta.captureId) sends trace start ./saved.adtrace then a pathless trace stop; the stop response returns the daemon's own outPath as artifacts[].localPath instead of the client's destination. clientOutPath is stored only when meta.captureId is present, so for old clients it is never recorded and the fallback falls through to the daemon's path.
| fs.appendFileSync(outPath, ''); | |
| session.trace = { | |
| outPath, | |
| clientCaptureId: req.meta?.captureId, | |
| startedAt: Date.now(), | |
| clientOutPath: req.meta?.clientArtifactPaths?.outPath, | |
| clientOutPath: req.meta?.captureId ? req.meta.clientArtifactPaths?.outPath : undefined, | |
| ...(req.internal?.publicNetworkOnly ? { remoteCaptureOutputPath: outPath } : {}), | |
| remoteCaptureTenantId: session.lease?.tenantId ?? req.meta?.tenantId, | |
| }; | |
| session.trace = { | |
| outPath, | |
| clientCaptureId: req.meta?.captureId, | |
| startedAt: Date.now(), | |
| clientOutPath: req.meta?.clientArtifactPaths?.outPath, | |
| ...(req.internal?.publicNetworkOnly ? { remoteCaptureOutputPath: outPath } : {}), | |
| remoteCaptureTenantId: session.lease?.tenantId ?? req.meta?.tenantId, | |
| }; |
Suggested change
Record clientOutPath unconditionally on start and gate only its reuse on capture identity, or add a released-client fallback so a pathless stop still receives its start destination rather than a daemon-host path.
Details
persona: senior-developer, maintainability, javascript
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.
There was a problem hiding this comment.
Checked at 1adba76871 against released v0.21.46. Both advertise RPC protocol 3. The released trace and native perf stop handlers reused the named start destination on a pathless stop. At this head a legacy start lacks the capture ID, so a pathless stop still completes but drops the saved destination. On the public HTTP trace route localPath is omitted, with a filename available for fallback. The destination change remains observable even though the path field is optional. Saving the old path alone would not restore the behavior under the new identity check. Leaving this thread open for a maintainer decision on a typed protocol-3 refusal before finalizing a named capture or a protocol version bump.
There was a problem hiding this comment.
55c76abacb fixes start settlement when daemon execution order differs from client reservation order. The protocol-3 case still drops the saved destination for released clients. I left this thread open for the maintainer’s choice between a typed pre-finalization refusal and a protocol bump.
|
Fixed the delayed start reply finding at |
This comment has been minimized.
This comment has been minimized.
|
The review of 1adba76 found remaining issues. The earlier review's identity checks, client scoping, documentation and loopback coverage have been addressed. An auth hook can force tenant isolation even when the client requests none. Starting on Reservation order can differ from daemon execution order. If A reserves first but arrives after B has started and stopped, B can prune A's reservation before A starts successfully, so A loses its destination and a pathless stop uses a generated filename. Can settlement distinguish a later admitted start from a generation retired by stop or close, using daemon ordering or an equivalent lifecycle rule? Reservation pruning The four live receipts support the examples at 27edb93, but the later change affects successful stop settlement before download. Before merge, run the built final SHA through the isolated HTTP proxy and record commands, device, state directories and stop JSON for named trace reuse with bytes, two distinct unnamed trace files, named xctrace reuse with a readable archive, and a two-client mismatch. Also delay a dispatched trace start reply until a second client sharing its state directory successfully stops it, then show that releasing the reply leaves no saved record for the stopped ID. Stop settlement A second independent pass found that released clients without capture IDs lose their named start destination on pathless trace and perf stops against this daemon. Trace can write to the daemon path or fall back to the current directory, and perf also loses the saved path. Can start retain the client path regardless of ID and stop reuse it only when the requested and stored IDs match, including when both are absent, or can the alternative typed refusal or protocol change be settled before merge? Trace path The released-client path thread still stands; no lower-priority threads still apply. The following threads can be resolved: trace identity now checks the ID; CLI help requires confirmation; remote docs require confirmation; security guidance scopes pathless reuse; artifact coverage checks downloads and retirement; perf identity couples the path to an ID; stale trace coverage checks refusal; interruption reaches the pre-dispatch wait; client scope includes state and credentials; malformed names are documented and recorded. Body rules was cancelled and checks the PR title and body rather than capture routes; the reason for cancellation was not supplied. There are no known conflicts. Before merge, resolve the tenant alias and reordered start regressions, settle the released-client protocol concern, and attach final-SHA HTTP evidence. Not verified here: the tenant and request-order scenarios were traced statically and were not reproduced on a running daemon. Not verified here: raw command transcripts, exact ID pairs and final-head test output were not supplied. |
1adba76 to
55c76ab
Compare
This comment has been minimized.
This comment has been minimized.
|
Follow-up to the auth-hook alias review, traced at The alias split still applies when HTTP admission forces tenant isolation. For transparent aliasing, the client needs an authenticated scope before record lookup, with the capture or close request revalidating that scope against its own admission. A smaller deployment contract is to configure the client with the matching tenant and explicit tenant isolation, which the current key already supports. That option requires client configuration for hook-managed endpoints. Either choice is separate from the open released-client protocol-3 decision. This was a source trace. No patch or live run accompanies it. |
|
The review of 908766a still finds destination regressions. The updated base accounts for the Android helper and fill changes raised earlier; the current patch has neither change. The client record key uses the submitted scope before HTTP admission, although admission can force tenant isolation and map an unqualified session and its qualified alias to the same daemon session. A pathless stop under the alias can write to a generated filename instead of the named start destination, and close can leave the original record behind. Use the authenticated effective session address for start, stop and close, and revalidate it at admission before dispatch. Record scope The native perf route discards a named start destination from a released protocol-3 client that sends no capture ID, then permits a pathless stop without returning that destination. Settle the released-client compatibility decision and preserve the destination for the agreed legacy pairing or provide the agreed typed refusal or protocol transition before the destination can be lost. Native perf route The record compares receipt order across daemon instances, even though the order comes from a process-local counter and wall-clock origin. A replacement daemon with a lower value can have a successful start discarded, so the first pathless stop sends the predecessor's ID and leaves the new capture running. Scope order to the admitted daemon instance, accept its first valid receipt and prevent late retired-instance responses from replacing current state. Receipt ordering A close reply can delete a retained reservation after an older start reaches a reopened session but before that start reply settles. The successful capture then loses its named destination, and its pathless stop uses a generated name. Retire only capture generations belonging to the session lifetime that closed, and cover the close reply settling before the reopened start reply. Close retirement The live HTTP receipts cover 27edb93, before changes to start receipts, settlement and stop eligibility. Before merge, attach a built final-SHA HTTP proxy run with the device, state directories, commands, IDs and stop JSON for a named trace, two distinct unnamed traces, a named readable xctrace archive and a typed two-client mismatch. Include an admitted trace start whose reply arrives after a confirmed stop from a second process sharing client state, and show that the stopped ID stays retired. Exercise alternate session spellings with hook-forced tenant isolation for stop and close. Start settlement A second independent pass found that hook-forced tenant isolation still splits records by session spelling. Could the maintainer choose either a documented contract requiring matching client tenant configuration and explicit tenant isolation, or transparent aliasing using an authenticated effective session address revalidated at admission? Add a test that sends both spellings through the HTTP auth-hook route. Session key The open released-client trace thread still applies; no lower-priority open threads were reported. CI is pending: Body rules was cancelled for an unknown reason and checks the title and body rather than capture behavior; another check is queued and covers the changed trace and remote record route, while its earlier approval was for a different commit. No conflicts are known. Not verified here: the reported local test passes, prior guard logs, raw live transcripts and exact live capture ID pairs were unavailable. Not verified here: daemon replacement, close overlap and auth-hook aliases were traced in source but were not run live; the ordering test uses a send double. Before merge, fix the tenant alias, daemon instance ordering and close retirement regressions, settle and implement the released-client protocol decision, and attach the final-SHA HTTP receipts. |
This comment has been minimized.
This comment has been minimized.
|
I traced the daemon replacement and close/reopen findings at
Both fixes need evidence beyond the current contracts, so this pass produced no code or test changes. The live HTTP receipts remain attributed to |
908766a to
f3f5575
Compare
88af7a6 to
7e9c0c4
Compare
Apex Sentinel · ✅ Approve · review of
|
| 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.
Summary
Bind remote trace and native perf destinations to the caller's capture ID. Daemon confirmation orders overlapping starts. A confirmed stop retires its capture under the record lock, even if the start reply is still pending. Tenant isolation uses the daemon's session naming rule. This client artifact layer was split from #5246 and is stacked on #5245.
Before / after
captureandtenant-a:captureused separate records. Start, stop, and close now share a record.Validation
f3f5575200passed merge-tree and the changed declaration digests matched. Hosted checks pending.At
55c76abacb, the build and all 54 focused tests passed. The reordered-start regression failed at1082b8b351. Auth-hook aliases, the protocol-3 decision, and final-head live receipts remain open.The previous guard job failed Fallow after passing wire compatibility. At
908766ae0b, all 11 perf runtime tests passed. All 20 hosted checks passed at that SHA.Live HTTP at
27edb93b1c670ca2dec5f1d79595567244e52ea7passed all four cases on iPhone Duo, iOS 27.1. Built CLI and XCTest runner, loopback proxy with isolateddaemonstate, and separateclient-aandclient-bstate directories and working directories. Snapshots supplied fixture activity. The first xctrace stop failed. A fresh daemon and a recording interval produced the verified archive.