The import probe skipped PM activation. Foreign Python paths could also conceal missing dependencies. Run bootstrap before dependency imports and sanitize the final child environment, including caller settings. Probe from the same checkout used by the backend. Derive the bundled flag when serving each bootstrap snapshot instead of storing it in setup events. Failed or unavailable repair calls keep their error and leave the recovery controls usable without reloading. Verified with real bootstrap modules, a disposable dependency selection, and native Python through the Node probe. Renderer tests cover refused, thrown and unavailable repair results, plus successful reload. No installed desktop, signed package or live user state was operated.
9 lines
297 B
TypeScript
9 lines
297 B
TypeScript
import { INSTALL_STAMP, installShape, type InstallStamp } from './install-stamp'
|
|
|
|
export function bootstrapSnapshot<State>(
|
|
state: State,
|
|
stamp: Readonly<InstallStamp> | null = INSTALL_STAMP
|
|
): State & { bundled: boolean } {
|
|
return { ...state, bundled: installShape(stamp) === 'bundled' }
|
|
}
|