refactor: migrate snapshot to device runtime - #1779
Conversation
eda79e8 to
328f71f
Compare
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
|
Exact head
CI is also owner-blocked: exact-head iOS Smoke fails at |
|
Addressed both P1 findings in e44dfb6.
Clean committed-tree pnpm check:affected --run passed every runnable gate: 587 files / 4,816 tests, 95.37% changed-line coverage, plus format, lint, typecheck, layering, fallow, build, package, wire, and integration checks. Native/device lanes were left to GitHub; no local simulator/device command was run because benchmarks are active. The previous iOS Smoke is not proven to be a snapshot production regression: its unchanged existence-oriented wait found an edge/offscreen node, skipped scrolling, then the visibility assertion correctly returned false; base passed by timing out the first wait and scrolling. The mechanically equivalent legacy capture seam does not explain that decision difference. Fresh iOS Smoke is running on this head and remains blocking; if it repeats, the owning smoke helper should require visibility before skipping scroll rather than weakening production visibility. |
|
Exact head
No |
|
Addressed in b893163.
The budget point remains intentionally unresolved: +10,414 B raw / +3,069 B gzip / +2,674 B tarball / +10,431 B unpacked versus 856ff38 is not approved. The explicit request remains at #1739 (comment), and the PR stays draft. Exact-head CI is now running; the preceding production head e44dfb6 was fully green. |
|
Final review remediation is complete at
All deterministic exact-head checks and Android Smoke are green. The isolated iOS Smoke rerun remains in progress after an unrelated hardware-keyboard XCTest flake; per maintainer direction, readiness is not blocked on waiting for that run. No local simulator/device command was run while benchmarks are active. |
|
Closed the R32 alias/destructuring bypass in
No local simulator/device lane was invoked while benchmarks are active. |
|
Production migration is now architecturally sound, and the revised snapshot-unit size budget is explicitly authorized on #1739. However, R32 remains bypassable and is not yet an honest regression gate. It traces known helper identifiers/aliases, but equivalent daemon policy still passes when expressed through a renamed helper call such as Also, the exact-head iOS Release check failed during action setup because GitHub codeload returned HTTP 429 while downloading |
|
Addressed the remaining R32 bypasses in
I also reran the failed iOS Release job. GitHub codeload returned the same HTTP 429 while downloading |
|
The prior renamed-helper and object-rest bypasses are fixed. However, R32 remains bypassable through object identity wrapping: |
ca9e91d to
1b71fe4
Compare
|
Re-reviewed exact head |
57962bf to
ce3a701
Compare
|
Addressed the R32 bypass at the owning interface rather than adding more alias cases to the custom tracker.
Rebased onto |
|
Re-reviewed exact head ce3a701 after the force-push: this is a pure rebase; the eight PR commits range-diff unchanged. The owner-facts admission seam and removal of the bespoke identity/data-flow tracker remain sound, with no new code finding. The PR is code-clean and retains ready-for-human, but final merge readiness waits for the newly restarted exact-head CI lanes. |
ce3a701 to
bea6ce3
Compare
|
Re-reviewed exact head bea6ce3: clean. The R32 owner-facts admission implementation and structural enforcement are unchanged from the previously reviewed head; the rebase mainly incorporates merged #1810. The only post-rebase delta is a narrow replay-source test mock for the snapshot-interactor capture seam, correctly isolating that test without hiding production-route coverage. Code review remains ready-for-human. Coverage/core gates and Android/Linux are green; iOS/macOS Smoke and Swift compile are still pending before merge. |
|
#1838) #1779 added src/daemon/handlers/snapshot-interactor-capture.ts as a vi.mock seam between snapshot-capture and core/interactors. Both of its edges are value imports, and it sits on the path request-generic-dispatch -> snapshot-capture -> (seam) -> core/interactors -> register-builtins -> command-catalog -> ... -> daemon-command-registry, so it joined the largest type-level SCC (46 -> 47 files, daemon-server 16 -> 17) and R9/R10 have failed on main since d76e0f9. Load the interactor registry lazily, the same way platform-runtime-local-application-interactors.ts reaches core/interactors from above: the seam module is readable without the interactor graph behind it, and the SCC is back at 46/16. pnpm check:layering, typecheck, lint, and vitest src/daemon are green.
…e and rebase guidance Retro follow-up (item 2). Adds docs/agents/adr-0019-unit.md — the order of operations for one command unit with the declaration site for each step, the evidence a unit review must carry, and what 'done' is not — so the pattern rediscovered during the snapshot unit (#1779) is written down once. testing.md: mock the seam the code under test consumes (fake inspectFacts / bindDevice), not the generic dispatchCommand mock; a migrating command moves its tests off the dispatch mock in the same PR. AGENTS.md: fresh-worktree preflight (pnpm install + build in the worktree; layering scan reads tracked files only) and concurrent-agent hygiene (one full gate per host, verify subagent edits with git -C, one PR per worktree). pull-requests.md: two readiness claims (published-and-reported vs merge-ready) and the rebase rule — main has no up-to-date protection; rebase on conflict or when `check:affected --base <merge-base> --head origin/main` names your surface.
…e and rebase guidance Retro follow-up (item 2). Adds docs/agents/adr-0019-unit.md — the order of operations for one command unit with the declaration site for each step, the evidence a unit review must carry, and what 'done' is not — so the pattern rediscovered during the snapshot unit (#1779) is written down once. testing.md: mock the seam the code under test consumes (fake inspectFacts / bindDevice), not the generic dispatchCommand mock; a migrating command moves its tests off the dispatch mock in the same PR. AGENTS.md: fresh-worktree preflight (pnpm install + build in the worktree; layering scan reads tracked files only) and concurrent-agent hygiene (one full gate per host, verify subagent edits with git -C, one PR per worktree). pull-requests.md: two readiness claims (published-and-reported vs merge-ready) and the rebase rule — main has no up-to-date protection; rebase on conflict or when `check:affected --base <merge-base> --head origin/main` names your surface.
…e and rebase guidance (#1836) * docs(agents): ADR 0019 unit checklist, owning-seam mock rule, worktree and rebase guidance Retro follow-up (item 2). Adds docs/agents/adr-0019-unit.md — the order of operations for one command unit with the declaration site for each step, the evidence a unit review must carry, and what 'done' is not — so the pattern rediscovered during the snapshot unit (#1779) is written down once. testing.md: mock the seam the code under test consumes (fake inspectFacts / bindDevice), not the generic dispatchCommand mock; a migrating command moves its tests off the dispatch mock in the same PR. AGENTS.md: fresh-worktree preflight (pnpm install + build in the worktree; layering scan reads tracked files only) and concurrent-agent hygiene (one full gate per host, verify subagent edits with git -C, one PR per worktree). pull-requests.md: two readiness claims (published-and-reported vs merge-ready) and the rebase rule — main has no up-to-date protection; rebase on conflict or when `check:affected --base <merge-base> --head origin/main` names your surface. * docs(agents): name the admitted-plan token in the ADR 0019 unit checklist (#1841) * docs(agents): merge-ready owes live evidence only for changed device-facing paths * docs(agents): the unit checklist documents the admission API on main; #1841 updates the row when it lands
Summary
Migrate the public
snapshotcommand from legacy capability dispatch to the ADR 0019 request-scoped device runtime.plan.useand passes that exact use to the sharedinspectRequiredRuntimeUse; local snapshot admission policy is rejectedThe measured snapshot-unit budget approved on #1739 was +10,209 B JS raw, +3,058 B JS gzip, +2,590 B npm tarball, and +10,226 B unpacked against its authorized base: #1739 (comment). Returning to a non-positive delta requires separately migrating the remaining legacy capture consumers and is intentionally outside this command-atomic unit.
Validation
mainat60f6356b0bea6ce36dpnpm check:affected --runpassed all locally runnable selected gates before the chained force-with-lease push{ device }object-wrapper bypass; the positive route-to-owner-facts seam rejects the local admission reimplementation without reconstructing JavaScript data flowpnpm typecheck,pnpm check:fallow --base origin/main,pnpm format, package verification, wire compatibility, replay compatibility, andgit diff --checkpassed through the aggregate gateDocs/skills are unchanged because this is an internal runtime cutover, consolidation, and enforcement correction with no public CLI or workflow behavior change.