Repository navigation
Conversation
… process startDaemonRuntime no longer calls process.exit or installs process handlers; src/daemon.ts owns signals, fatal errors and the exit code. close() is idempotent and resolves to a ShutdownReport. A runtime that fails during startup rolls back what it acquired. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… uploads and requests Provider admission, interactor resolution, artifact and upload tracking, resumable uploads, materialized paths, session-open locks and request cancellation are owned by the runtime instance instead of module scope. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Apple runner's sessions, locks, recycle ledger and owner state belong to the daemon runtime that composed them. The PNG worker is held by every runtime that uses it and stops with the last one. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 52 files
You’re at about 94% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…moves temp files Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 9 files (changes from recent commits).
You’re at about 95% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…one removal helper Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Closing one runtime can still kill another runtime's Apple runner build, so this needs one more change before merge (reviewed at c047776). CI is green (12 checks, none failing), and I know of no other merge issue. The Apple runner state in runner-artifact.ts is still process-wide. I found this by reading the code. I did not run two runtimes with an Apple runner. The PR body shows no artifacts for the live simulator run, and that run covers one runtime only, so per-runtime Apple isolation rests on Not blocking, and fine to take or leave: Could On the open review threads, all are addressed at this head except none still apply as live issues. These can be resolved: PNG/plugins/lock release in closeOnHost, isolation test cleanup, close test assertions, materialized-path dispose, resumable-upload dispose, shutdown error in daemon.ts, artifact-tracking dispose, releasePngWorker, composition test resolver, infoPath and lockPath assertions, removeBestEffort, all fixed at this head. The dispose ordering thread is benign: dispose runs after the servers close and in-flight work settles, and only a force-cut handler could still touch the temp dir, with its connection already gone. Before merge, Apple start admissions and the prep-process ledger must be per runtime, with a regression test showing B's prep child survives A's stop-all. |
…s to the runtime Closing one daemon runtime no longer retires another runtime's start admissions or signals its prep builds. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The runtime context, the per-runtime state list and the session teardown helpers move beside the other shutdown mechanics. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ranch * refactor/host-environment: fix(host): resolve every client read from the client's host
|
Pushed
Not done here: consolidating the per-module runtime-state owners into one is a follow-up. |
…-no-process-globals * refactor/host-environment: style: format the daemon policy reuse test fix(host): resolve the daemon policy path against the host working directory # Conflicts: # packages/daemon/src/server/http/daemon-runtime.ts
|
The PR is ready at 817930f. Not blocking, and you can take or leave these: the four test files daemon-runtime-device-claims, -recording-teardown, -snapshot-shutdown and -web-close-teardown still carry the empty This follows the earlier review at c047776 (#3772 (comment)). That review's findings are fixed. All 12 checks pass at 817930f. One thing I did not run: two daemon runtimes with a real xcodebuild prep in one process. Isolation rests on runner-session-runtime-isolation.test.ts, whose fake child never emits 'close'. The live simulator run in the PR body predates this delta, so the ALS lookups for prep and admission in a single live runtime are not live-validated. They do match the runnerSessions slot pattern that run covered. I also have not confirmed whether daemon composition reads Apple runner state before The PR has merge conflicts with main. Before merge, the base branch refactor/host-environment has to land, and the PR has to be rebased to clear the conflicts. On the open inline threads, no P1 or P2 thread still applies, and no lower-priority threads still apply. These threads no longer apply, so please resolve them: #3772 (comment), #3772 (comment), #3772 (comment), #3772 (comment), #3772 (comment), #3772 (comment), #3772 (comment), #3772 (comment), #3772 (comment), #3772 (comment) and #3772 (comment) are fixed, since the patches they cover are unchanged in this update. #3772 (comment) is harmless, because dispose runs after the servers close and in-flight work settles, so only a force-cut handler whose connection is already gone could touch the temp dir. The branch has a merge conflict with refactor/host-environment, so it needs a rebase before it can merge. |
|
This PR is ready at 012b50d, and the earlier findings from c047776 are now fixed. Not blocking: Smoke Tests is still running at 012b50d and no job has failed. The diff touches the smoke route, in daemon startup (the policy-load merge resolution) and in close (the moved Some limits on what the review covered. I read the code and did not run tests or gates. I did not run two daemon runtimes with a real xcodebuild prep in one process. The fake child in the isolation test never emits 'close'. The 'close' listener at runner-artifact.ts:392 looks up the ledger when the event fires, so it relies on the child-process handle carrying the spawn's async context. That holds in Node, but nobody has exercised it here. The simulator run in the PR body predates 22cea00, so no live cold start (prep build) has run at this head. The same On the open review threads, I could not read who wrote them. Ten fixed ones can be resolved because the code at this head already does what they asked: #3772 (comment) (closeOnHost finally still releases the PNG worker, plugins, registration and lock config), #3772 (comment) (isolation test unchanged since c047776), #3772 (comment) (close test unchanged), #3772 (comment) (materialized-path-registry dispose still in createRuntimeContext), #3772 (comment) (resumable-upload unchanged), #3772 (comment) (src/daemon.ts:33-35 still reports the shutdown error and sets exit code 1), #3772 (comment) (artifact-tracking unchanged), #3772 (comment) (releasePngWorker still idempotent and called in the finally), #3772 (comment) (composition test unchanged), #3772 (comment) (infoPath/lockPath assertions unchanged). Two more can be resolved too: #3772 (comment) (benign, since |
… migration Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…refactor/daemon-runtime-no-process-globals * origin/refactor/host-environment: test: keep the registration-owner test under its size ratchet fix(host): start a launched daemon in the launching host's working directory test: merge the duplicate test-kit import in the handler chain routing test test: move the daemon-composition tests off the daemon's testing exports (#3742) fix(android): ignore emulator log lines in -list-avds output (#3743)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Pushed
Nothing else changed since the review at |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…refactor/daemon-runtime-no-process-globals * origin/refactor/host-environment: refactor(daemon): read configuration from the request host instead of the ambient scope test: merge the duplicate test-kit import in the stale provider admission scenarios feat(cli): ensure the daemon explicitly before attaching in the CLI and MCP (#3766) feat(client): daemonLifecycle attach mode and ensureDaemon() (#3765) feat(daemon): quiesce request that retires an idle daemon atomically (#3764) fix(daemon): answer a named missing session on the session, not the device (#3701) test: route test/ and scripts/ off the daemon's testing exports (#3733) refactor(plugins): make the plugin framework provider-independent (#3722) fix(apple): name an Xcode too old for its host macOS as a runner startup failure (#3739) # Conflicts: # packages/daemon/src/server/http/daemon-runtime.ts
|
The code at 7eedaf6 looks right, and the earlier review of 012b50d still holds. CI is green on all 6 checks at that commit, and the new changes touch only tests and an upstream base merge. The PR has merge conflicts with main. The stack base refactor/host-environment has also moved to 7eb7379, and merging it conflicts in packages/daemon/src/server/http/daemon-runtime.ts, so please merge it, resolve that file, and re-run check:affected before merge. Not blocking, and you can take or leave it: the base now carries daemon-runtime-quiesce.test.ts from #3764, and it still passes Is the per-runtime state handle ( The evidence is not complete yet. I did not run the Limrun test locally, so that it passes at 7eedaf6 rests on the green CI and on your check:affected run. I also did not inspect the conflicting hunks of daemon-runtime.ts against 7eb7379, and I assumed no review threads were resolved since the last review, so any open inline thread that still applies still stands. |
…refactor/daemon-runtime-no-process-globals * origin/refactor/host-environment: fix(daemon): drop the unused host from install-from-source and tighten test envs
|
Pushed
|
|
The delta from 7eedaf6 to b29df19 is mostly fixed, but one problem remains in the shutdown path. Smoke Tests is still running, so CI is pending. drainInFlightRequests reports abandoned requests with a bare Not blocking, and you can take or leave it: with abandoned requests, registration.finish(outcome) is skipped, so the shutdown report is not written and daemon.json and the lock stay behind with a dead pid. I did not check how daemon resolution handles that, so this is likely rather than confirmed. Writing the report in every case and deferring only the registration and lock removal until The two earlier threads on closeOnHost cleanup (r4300418749) and the daemon.ts shutdown error (r4300418775) are fixed at this commit, so please resolve them. Since the review at 7eedaf6, the request drain, the server force-close budget and the conditional registration release are in place. I read the code at b29df19 and ran no tests or gates, and the passing |
…finished shutdown work Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…refactor/daemon-runtime-no-process-globals * origin/refactor/host-environment: refactor(cli): resolve one transport per run and one host per MCP tool call; default the lease provider cwd to the bound host refactor(daemon): publish a single package entrypoint (#3781) fix(daemon-client): wait for an acknowledged quiesce instead of killing the daemon (#3780) fix(daemon): refuse leases for providers without a registered runtime (#3773)
|
Pushed
|
|
This PR is ready at 5a20a1c. The earlier findings from b29df19 are fixed: the bounded-close log assertion now matches the emit path, and the shutdown report carries the provider-release outcome to stderr. Not blocking: the loop in src/daemon.ts that writes the unfinished-work lines to stderr is only covered through the pure function test, so you could extend The two cubic threads are fixed at this head and you can resolve them: the close path now releases the PNG worker, plugins, registration and lock even when a step fails (#3772 (comment)), and the shutdown error now reaches stderr before the exit code is set (#3772 (comment)). I read the diff and ran no tests or gates myself, and I took the |
…e and its test share Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…refactor/daemon-runtime-no-process-globals * origin/refactor/host-environment: test: pin the one-transport CLI run and one-host MCP call; document the bound host
|
Pushed
|
…refactor/daemon-runtime-no-process-globals * origin/refactor/host-environment: test: keep the failure that explains a missed materialization in the transport test
…-no-process-globals * refactor/host-environment: feat(provider-testmu): publish @agent-device/testmu on plugin contract v2 (#3770) docs(plugins): document plugin contract v2, the inventory and ADR 0034 (#3769) feat(daemon): daemon status lists the registered provider plugins (#3768) feat(plugins): plugin contract v2 and one provider registry (#3767) # Conflicts: # packages/daemon/src/server/http/daemon-runtime-composition.test.ts # packages/daemon/src/server/http/daemon-runtime-metadata-ownership.test.ts # packages/daemon/src/server/http/daemon-runtime.ts # src/daemon-composition.ts
…etirements and shell probes per runtime Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…eside Apple's runner-owner Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…me-no-process-globals * origin/main: fix(ios-runner): stop wide sliders from wedging tree snapshots (#3776)
… report Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
The PR is ready from the code side. At 794c048 the shutdown-failure thread is fixed: src/daemon.ts sets the exit code to 1 when the close report says it failed, and server-shutdown.ts writes "Daemon shutdown error". Not blocking: the Checks are green: 17 pass and none fail at 794c048. I read the one-line wiring in src/daemon.ts (close report, then exit code, then process exit) but no test drives the The PR has merge conflicts with its base. Before merge, please rebase onto refactor/host-environment at c9aa2f2, which brought in plugin contract v2. Then resolve the four conflicting files: packages/daemon/src/server/http/daemon-runtime.ts, src/daemon-composition.ts, daemon-runtime-composition.test.ts and daemon-runtime-metadata-ownership.test.ts. I did not review that resolution, since it does not exist yet. The cubic-dev-ai thread about swallowed shutdown failures no longer applies, so please resolve it: #3772 (comment) |
…bals * commit 'db55a5dfbd': test: give the iOS recording scenario's daemon host the PATH and Swift cache its process already had refactor(daemon): read the host cwd where the deploy handlers use it, leaving their shared prologue untouched
… the real entrypoint through a signal and an idle reap Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…bals * commit 'd8a9bd40c0': fix(daemon): abandon a transient device claim under the same env that cleared it fix(daemon): scope a transient device claim to the session that holds it (#3714) test: keep the scenario harness's state dir and transport out of reach of its env override test: fail the transport test on an unexpected exit or throw and always remove its workspace
…e the helper already loads Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Pushed
|
…ost module, not a seventh subpath Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Pushed
|
…refactor/daemon-runtime-no-process-globals * origin/refactor/host-environment: test: build the scenario gateway on the daemon host's env and pin the host claims directory on a failed release
|
Pushed |
Summary
Part of #3747, stacked on #3763. Closes #3752.
A daemon runtime no longer assumes it owns the process.
startDaemonRuntimenever callsprocess.exitand installs noprocess.on/oncehandler.src/daemon.tsowns signals, fatal errors and the exit code. A startup refusal rejects withdetails.exitCode(daemonStartupExitCode).close()is idempotent: concurrent calls share one promise that resolves to aShutdownReport(provider releases, runners, sessions, plugins).closedsettles whoever closes (idle reap). Provider runtimes dispose exactly once; a startup that fails rolls back what it acquired.daemon stop --jsonstill reportsproviderReleases.pending.AsyncResource.bind). The PNG worker is held by every runtime that uses it and stops with the last.Validation
pnpm check:affected --run --head 0b83711eb1passed (exact commit). New tests: two runtimes in one process serve, close and keep state independently; idempotentclose()and rollback; runner state per runtime; PNG worker refcount.Live on iPhone 17e simulator (clean daemon,
/private/tmpstate dir): open, snapshot, close; gracefuldaemon stophanded the runner off (ios_runner_session_detached, runner kept alive) and a new daemon adopted it with no second xcodebuild;daemon stop --cleananddevice statusleft no claims or runners.🤖 Generated with Claude Code