refactor(capture-kit): state each snapshot source's circuit scope
Merged
TH
5d ago+85+85+01234567890123456789-48-48-01234567890123456789
Summary
Applies the optional items from the #4308 review. Part of #4205. No behavior change.
- Circuit scope union.
SnapshotSourceChannel.circuitis{ scope: 'route' }or{ scope: 'runner-session'; sessionChanged() }. A runner-session channel must supplysessionChanged, and a route channel cannot declare one. The runner bridge isrunner-session; the local guest channel isroute. A new test proves the local route keeps a retired generation's circuit across a runner session change. - Shared layering helper.
scripts/layering/executable-policies.tsevaluates everyexecutablePoliciesentry. It replacesplatformImportsFromRouteranddaemonImportsFromSnapshotFacet. - JSDoc.
RunnerSessionCircuitstates that only a runner-session circuit can setsessionDisabled. A duplicate comment inlifecycle.fixtures.tsis removed.
Validation
At 69621eb183 (base 0e7df74a1a):
pnpm check:affected --run --head 69621eb183: all runnable checks passed, exactCommit=true (41 passed).- Vitest capture-kit + platform-apple,
node --test scripts/layering/*.test.ts,pnpm typecheck,pnpm check:layering: pass. - Mutation controls (reverted): local channel as
runner-session→ the local-route test fails. Runner channel asroute→ 4 session-circuit tests fail. Helper filter or policy roots broken → the helper tests fail.
No device run: route behavior is unchanged.
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.