Repository navigation
Commit 0e7df74
authored
refactor(capture-kit): lift the iOS snapshot route into the capture-kit router (#4308)
* refactor(capture-kit): lift the iOS snapshot route core into a platform-neutral router
Move the route core and its refusal policy from platform-apple into
capture-kit/src/snapshot-router, and bind the local guest bridge and the
runner-served bridge to it. Delete the Apple route core.
A channel now declares servesDevice, awaitsDiscovery and one refresh path:
only the runner channel, whose ordinary resolution returns an unverified
cache, declares refreshTarget; the stale-target fallback calls
refreshTarget ?? resolveTarget.
* docs: point the route references at the capture-kit snapshot router
* chore(gates): forbid platform and provider imports in the snapshot router
Declare the snapshot-router executable policy with every platform,
provider, apple-runner and tv-cdp package as a forbidden target. Pin it
with a real-tree check, a coverage check over the platform-* and
provider-* packages, and a positive control for static and dynamic
imports. Pin the two new capture-kit exports in the R11 manifest check.
* fix(capture-kit): always force rediscovery after stale-target evidence
Every snapshot source channel now declares a required refreshTarget and
a required resolutionVerifiesIdentity. The stale-target fallback always
calls refreshTarget, so the local channel no longer republishes its
cached generation after the bridge reported a newer one. Only a channel
whose resolution returns an unverified cache (the runner) refreshes
before it trusts a disabled circuit, so the local channel keeps main's
cost on that path.
The local resolver drops its 'refresh' flag for a separate
refreshTarget, as the runner bridge has. The runner bridge now returns
its own channel declaration, which removes the three hand copies in the
runner tests.
* refactor(apple): import moved snapshot source declarations from capture-kit
The snapshot-source types and errors modules re-exported the failure
types and SnapshotSourceError after they moved to the capture-kit
snapshot source channel. Their importers now name the owner, the
re-exports are gone, and the snapshot-source facade no longer carries
the moved types (its fallow exemption drops SnapshotSourceFailureKind).
The route tests share one simctl read stub, which keeps the file under
its line limit after the new stale-target case.
* refactor(capture-kit): hand the snapshot router its presenter, not a host
The router reads one host behavior, the iOS acquisition presenter. It
now takes that function, so the SnapshotRouterHost shape and the
{ snapshot: { presentIosAcquisition } } wrapper at the runner binding
and in its tests are gone.
* test(layering): read router boundary packages from tracked manifests
The positive control enumerated package directories from the working
tree, so an untracked scratch package could fail it. It now reads the
tracked manifests, as the other layering scans do, and also covers the
apple-runner and tv-cdp targets the policy forbids.
* test(apple): keep the snapshot-target compile proof in the lifecycle fixtures
The rebase onto main put lifecycle.test.ts one line over the 1000-line lint
limit. The compile-time SnapshotSourceTarget proof is not a lifecycle test,
so it moves to the fixtures, which are type-checked the same way.1 parent 3ad2164 commit 0e7df74
40 files changed
Lines changed: 1284 additions & 1126 deletions
File tree
- contracts/fixtures
- docs/adr
- packages
- capture-kit
- src/snapshot-router
- contracts/src
- platform-apple/src
- snapshot-source
- scripts/layering
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
| 328 | + | |
329 | 329 | | |
330 | | - | |
| 330 | + | |
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
341 | 349 | | |
342 | 350 | | |
343 | 351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments