refactor: route application lifecycle through runtime facts - #1759
refactor: route application lifecycle through runtime facts#1759thymikee wants to merge 28 commits into
Conversation
ADR 0019 §6 (amended): every command descriptor declares its platform-execution
mode explicitly. Adds the `none` mode to `CommandPlatformExecution`, removes the
silent `{ kind: 'legacy' }` default at registry entry, and annotates all 76
descriptors so the migration denominator is machine-readable.
Part of #1739 (wave 0)
`react-devtools start` on a Limrun Android instance dispatches internal `runtime port-reverse`, which reaches a provider device runtime, so ADR 0019 §6 `none` is false for it. Reclassify as `legacy` and add the derived coherence gate that catches delegated platform execution: if a CLI route for command R dispatches command D, R may declare `none` only when D is `none`. Part of #1739 (wave 0)
Subtracting attributed command NAMES let a stray dispatch hide behind a routed one that names the same command, so the gate's totality claim did not hold. Dispatch sites now carry their source offset and attribution subtracts occurrences. Part of #1739 (wave 0)
An unknown literal or computed command target resolved to undefined and never entered the scan, so a dispatch could evade attribution by naming a target the gate could not read. Daemon-send envelopes are now located by their send call and an unresolvable target is reported instead of skipped. Part of #1739 (wave 0)
… seam The syntactic scan recognized only a direct sendToDaemon call whose first argument was an inline object literal, so a variable envelope or a computed callee was omitted from every result. Rather than teach the scanner more shapes, the CLI's injected dispatches now flow through one typed construction point whose route/command pairs are declared, and the gate reads that declaration instead of recovering it from syntax. Part of #1739 (wave 0)
…zed gate ADR 0019 §8: the per-command cutover gates consolidate into one parametrized runtime-command-cutover gate driven by a table of migrated commands. Adding a migrated command adds a row; the mechanism carries one planted-red proof instead of one per command. Part of #1739 (wave 0)
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
|
Reviewed exact head 4ee2025. Changes requested. [P1] This does not establish the ADR 0019 ownership seam. Platform/provider packages mostly classify facts and call [P1] ADR 0019 defines one canonical descriptor as the abandonment-safe migration unit. This PR batches [P1] The direct base #1747 and prerequisites #1740/#1745 remain draft. Live evidence covers one Android-emulator open/close/test-IME recovery scenario, but not Apple-only [P2] The immediate delta is +104,691 source bytes and +40,614 raw shipped JS (+13,881 gzip), with no pre-start per-descriptor budgets. New and expanded files exceed project tripwires, including the 545-line root open implementation and 1,961-line close-shutdown test. This exceptional growth is a symptom of the combined root-owned design; splitting ownership should materially reduce it. The facts-first admission, plan-specific single binds, exact provider resolver capture, durable IME ordering/recovery, and fail-closed handler tests otherwise look coherent. No ready label until ownership, unit scope/gates, budget, live evidence, dependencies, and CI are resolved. |
|
Adversarial review of new lifecycle draft exact head
Live evidence covers only Android emulator open/IME recovery; macOS, physical Apple, and live-provider lifecycle evidence remain absent. Keep draft, address independently, run |
|
|
Exact-head adversarial rereview of
The four cutover rows, declared plans, single inspect/bind, fail-closed selection, Limrun liveness, IME lock, ref expiry, capture-kit cleanup, Linux/Vega modules, and R7/R9/R10 are fixed. Keep draft; independently classify/rerun both smoke failures and retain missing Apple/provider live-evidence blockers. |
|
Reviewed exact head
The branch is CLEAN/MERGEABLE but authoritative Integration, Coverage, Android Smoke, and iOS Smoke are red. Live evidence covers only an Android-local happy path, not provider or Apple/macOS/physical parity. The exceptional bundle/source growth and several near-tripwire modules also still need tightening. No readiness label. |
…e admission Android open regained a hard failure when the bundled test-IME helper artifact cannot be read, which fails every default-on emulator open. Only the durable recovery-record fence rejects now; helper acquisition warns and falls back. open/prepare/close/runtime/boot each carried their own requireXFacts, requireXBinding and xUnavailableResponse trio. One admission module owns the single side-effect-free inspection and the bind, and the cutover gate proves that promise at the shared module instead of re-detecting it per handler.
… alias module The neutral RuntimeHintValues payload had its transport keys re-listed by platform-apple, platform-android and the daemon recovery path. The contract owns the key set now and every gate reads it. src/platforms/android/ime-recovery-fence.ts was three aliases of contract exports; callers use the contract directly and the cutover gate keys on the real symbol.
…e direct lifecycle binding The migrated Android scenarios assert the durable test-IME path, but the IME helper had no provider-supplied artifact override, so activation could only ever work from a built npm bundle. It now follows the same precedence the snapshot and touch helpers already use, and the scenarios supply a fixture artifact — which is what makes android-lifecycle and android-find prove the broadcast channel instead of falling back to shell input text. harmonyos/linux/vega/web/webdriver/limrun each hand-rolled the same open, close, target-resolution and unavailable-operation bodies. One contracts factory owns that shape; each package declares its target identity and relaunch semantics.
…zation branches createComposedPlatformRuntimeGateway named Android test-IME recovery and Apple runner shutdown directly. The host composes which durable resources exist; the gateway keeps only the startup fence, the lazy host load and the once-per-process shape of each phase. Its cutover gate now rejects a gateway that names any platform durable owner, and proves the marker-evidence gate at the new owner. The two session finalization entry points duplicated the finalize/clear-hints pair; they now share one body and differ only in how they bind and dispose. The daemon path binds lazily, so an unsupported cell still fails on facts alone.
|
Took this over at Attributable CI (blocker 4) — root cause found, fixed, and the scenarios now prove the real pathThe migrated Android open dropped the
Two of them ( Regression coverage: Package ownership (blocker 2)
Duplication the review hadn't itemised
No file crosses 1000 lines. Still open (unchanged by this pass)The live-evidence gaps stand: macOS, physical Apple, Apple |
3ed4734 to
a200645
Compare
|
Reviewed exact head [P1] [P1 integration] This sibling still assigns R20/R21/R22 to prepare/close/runtime while #1758 assigns those same IDs to install/reinstall/install_source on the same boot base. The row model does not reject duplicate rule IDs, so rebase/consolidate against one accepted catalog before either sibling merges. The PR is also Exact-head Android Smoke is red at |
fcb2f35 to
9d2337f
Compare
Summary
Draft ADR 0019 Wave 3 lifecycle sibling for #1739, based on
refactor/adr19-boot-unitat3ed473400. It moves the canonicalopen,prepare,close, and internalruntimedescriptors behind package-owned lifecycle uses while keeping daemon request/session policy and public response construction.R19–R22, foropenTarget,prepareAppleRunner,closeTarget, andruntimeHints; no fifth policy file was added. The descriptor declares the complete close-with-hint-clear use, so close never reaches through an unavailable runtime-hints sibling.inspectFactscall and exactly one plan-specific bind. The capability bucket,requireCommandSupportedwiring, legacy adapter/maps/tags, and out-of-binding foreground/shutdown/port-reverse dispatch are removed.appleOs: 'ios'device leaf during preparation; a collapsed Apple record remains unsupported even if an owner label saysios.This remains a provisional sibling-stack draft. Final replay/readiness is blocked on the shared #1740/#1745/#1747 prerequisite resolution, remaining CI/review audit, and the live-device evidence gaps listed below.
Descriptor parity and fact coverage
Each column is independently matched to the legacy descriptor/dispatch cell; it does not inherit support from a sibling lifecycle operation.
openTargetisresolveOpenTarget + prepareApplicationOpen + openApplication;closeTargetiscloseApplication + finalizeApplicationClose;runtimeHintsisapplyRuntimeHints + clearRuntimeHints.The table-driven regression covers all 105 cells (35 local, 35 WebDriver, 35 Limrun) for each of the four operations. It compares every fact with its operation-specific legacy cell, asserts that false facts omit the concrete operation, and proves provider-owned unsupported/shutdown/recovery paths make zero local ADB/simctl/runner calls.
Durable-tier and route evidence
clearRuntimeHintsto unavailable makes its focused parity test fail the two expected supported cells; restored code is green.emulator-5554, opened Settings with--test-ime, observed the valid recovery marker and persisted Gboard prior state, then closed with the marker removed. Killing only the isolated verification daemon and reopening with--no-test-imerestored Gboard and removed both recovery records.Size accounting
Same-host/toolchain measurement at
b382e3f2a6475daabe84f99efedc68b19f505006(seven startup samples):44c298d7f3ed473400Text-diff source accounting excluding tests/fixtures: root
src/adds 114,947 B and removes 69,908 B (net +45,039 B);packages/adds 101,093 B and removes 9,910 B (net +91,183 B). The production net growth is itemized rather than attributed to stack headroom:Validation
pnpm check:affected --run && git pushpassed from a clean committed tree atb382e3f2a6475daabe84f99efedc68b19f505006. The affected gate passed format, lint, typecheck, build/package, layering, coverage, provider integration, replay compatibility, and daemon-wire compatibility; native/device lanes remain GitHub-authoritative.