Repository navigation
Conversation
Size Report
Startup median (7 runs, lower is better):
|
|
The code in 5fa7ed7 looks good, but I could not see live evidence for the stale-claim route, so this is waiting on that. The PR has no run of stale-claim reconciliation against a dead owner's claim. The #3403 device runs and a clean Not blocking, and you can take or leave these: the doc at src/daemon/request-router.ts:115 says routes without recovery run un-composed and the recovery refuses, but the field is required and no such refusal exists, and device-claim-owner-recovery.ts:37 has the same problem with its "unless a composer overrides it" clause. I looked for a smaller design. Would passing the createPlatformRuntimeGateway that daemon-runtime already imports drop platform-runtime-claim-recovery.ts? It would split the factory between the CLI and the daemon, since src/cli reaches the root only through dedicated platform-runtime-*.ts modules, so I accept the seam as the smallest way to remove the daemon-to-platform value edge. Only the unused stateDir field and the redundant dynamic import are left to trim. CI is green, with 18 checks and none failing, and there are no conflicts. Besides the stale-claim run above, the PR needs #3403 to merge first and must leave draft. |
029223a to
e53be1d
Compare
Stale-claim reconciliation rebuilds the dead owner’s runtime gateway — the act that names platform modules. The daemon keeps the transaction (the dead owner’s recorded state dir, artifact paths, owned-process store, disposal) and asks root composition for the gateway through a required ClaimRecoveryGatewayFactory (src/daemon/device/claim-recovery-gateway.ts), threaded root -> RequestRouterDeps -> request scope. Deletes the default root-gateway construction in device-claim-owner-recovery.ts: recovery never touches the current daemon’s gateway.
R76 inventory gains the daemon-runtime -> platform-runtime-claim-recovery edge and retires the superseded device-claim-owner-recovery -> platform-runtime entry; the root-module zone list and planted-violation fixtures follow.
- Keep the claim-recovery docs honest: the router's factory and the recovery's composeGateway are required, and no un-composed refusal route exists (#3404 review). - Drop ClaimRecoveryGatewayInput.stateDir: the gateway input only consumes the owner's sessions dir and stores; nothing production read the raw dir. - Make the #2168 test write an owned-process record through the composed store and require it on disk under the dead owner's dir, so a store built from the current daemon's paths fails. - Import the claim-recovery gateway composition statically in daemon-runtime; it rides the eager edge platform-runtime.ts already carries there.
5fa7ed7 to
eb7b8db
Compare
|
Rebased onto the new #3403 head ( Nits (all taken,
Live evidence — stale claim owned by a dead daemon, released through the composed gateway (iPhone 17e sim, isolated state dirs under Second leg, the daemon-startup composition through the new static import: a second dead-owner claim (pid 50071) was reconciled by a fresh daemon on a different state dir — Gates (on |
|
Addressed everything; rebased onto the updated #3403. Live stale-claim run (the blocking ask). On the Android emulator (ReactNative_API_35): opened a session through a daemon on an isolated The claim was released through the composed gateway: Notes taken:
Gates rerun at the rebased tip |
eb7b8db to
cda2166
Compare
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/daemon/device/claim-recovery-gateway.ts">
<violation number="1" location="src/daemon/device/claim-recovery-gateway.ts:14">
P2: Make `ownedProcesses` required: omitting it selects no-op writers, so stale-claim recovery cannot clear the dead owner’s durable process records.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| */ | ||
| export type ClaimRecoveryGatewayInput = Readonly<{ | ||
| sessionsDir: string; | ||
| ownedProcesses?: OwnedProcessRecordWriter; |
There was a problem hiding this comment.
P2: Make ownedProcesses required: omitting it selects no-op writers, so stale-claim recovery cannot clear the dead owner’s durable process records.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/daemon/device/claim-recovery-gateway.ts, line 15:
<comment>Make `ownedProcesses` required: omitting it selects no-op writers, so stale-claim recovery cannot clear the dead owner’s durable process records.</comment>
<file context>
@@ -0,0 +1,26 @@
+export type ClaimRecoveryGatewayInput = Readonly<{
+ /** The dead owner's sessions dir, resolved from its own claim record's state dir. */
+ sessionsDir: string;
+ ownedProcesses?: OwnedProcessRecordWriter;
+ resolveSessionArtifacts(sessionId: string): AppLogSessionArtifacts;
+}>;
</file context>
|
This is ready. The claim-recovery gateway wiring at the process root now looks right at cda2166, and the points from the earlier review are fixed. Not blocking: the earlier author comment says claim-recovery became a plain static import, but I did not rerun the live stale-claim runs or the local gates. I am relying on the output you quoted. Those runs used CI is still running at this head. 11 checks are queued or in progress, and none has failed so far. The unit, integration and layering checks cover the changed files, so please wait for them to finish. The previous head was green on 18 checks. There are no conflicts. Before merge, #3403 must land first and CI at cda2166 must pass. No review findings stand in the way. On the other reviewer's thread: the cubic-dev-ai P2 about the optional record store field does not apply, so you can resolve it. The only production caller, |
Summary
Stacked on #3403. Stale-claim reconciliation rebuilds the dead owner's runtime gateway — the one act that names platform modules. The daemon keeps the transaction: the owner's recorded state dir, session artifact paths, owned-process store, and disposal (
src/daemon/device/device-claim-owner-recovery.ts), and asks root composition for the gateway through a requiredClaimRecoveryGatewayFactory(src/daemon/device/claim-recovery-gateway.ts), threaded root →RequestRouterDeps→ request scope →createRequestHandler. Deletes the default root-gateway construction the recovery module used to perform itself (createPlatformRuntimeGatewayimport gone; the current daemon's gateway is never a recovery input). CLIdevice releaseand daemon startup pass the composed factory explicitly.Validation
Commit
54f553740(+ gate commit5fa7ed73a, which moves the R76 inventory entry from the retired recovery edge to the new composition edge). Local at tip: build, check:quick, check:layering, check:di-seams, check:affected --run, eager-closure and test-size-ratchet gates,test:integration:provider213/213,test:concurrency-torture4/4 — same evidence as #3403 (identical final tree, run on the stack tip).device-claim-owner-recovery.test.tsproves recovery composes from the claim's own state dir per transaction and disposes it. Live claim paths exercised in the #3403 device runs;device status --staleclean afterwards.