feat(app): R4.3b/c import worker, client, controller; HomeRoute on the disposable worker
Protocol v1 (task → ready → result | failed with phase and kind), the worker entry with the glue bundled statically and the page's compiled Module posted, the file streamed into the module's memory; client with start and task timers (paused while hidden), settle-once, terminate always, error events never masked; module-level controller (one import at a time, cancel on leaving Home, worker chunk prefetched once the engine is loaded); the settlement mapped to the B.1.8 messages (OD-5: a trap, a timeout or an unreadable file is « Erreur de lecture du PDF. », never a corrupt PDF). HomeRoute keeps its routing and size pre-checks, loads its own index after acceptance, drops a result when the session changed. Tests: handler and client in-process, the corpus message test (O8 51, O7 stored inputs, O2/O3/Step 5), the six existing suites migrated to the real worker logic.
This commit is contained in:
1 parent
52471dbbc0
commit
6d1cce6e06
26 files changed
+2164
-247
No files matched your search
@@ -144,6 +144,15 @@ export class CoreRuntime {
|
||||
if (this.restartable) void this.retry()
|
||||
}
|
||||
|
||||
/**
|
||||
* The compiled module of this runtime, when a load has started: posted to the import
|
||||
* worker (R4.3, structured clone) so an import needs no second fetch, offline included;
|
||||
* `null` before the first load, the worker then fetches the asset itself.
|
||||
*/
|
||||
compiledModule(): Promise<WebAssembly.Module> | null {
|
||||
return this.compiled
|
||||
}
|
||||
|
||||
/** Runs a free operation. */
|
||||
call<T>(op: string, input: string): CoreOutcome<T> {
|
||||
return this.invoke((glue) => parseOutcome<T>(glue.call(op, input)))
|
||||
@@ -246,7 +255,7 @@ export class CoreRuntime {
|
||||
* `JsError` worded `<kind>: <detail>`), without its `invalid_sheet: ` kind; `null` when the
|
||||
* error is anything else.
|
||||
*/
|
||||
function closedRefusal(error: unknown): string | null {
|
||||
export function closedRefusal(error: unknown): string | null {
|
||||
if (!(error instanceof Error) || error.name !== 'Error') return null
|
||||
const match = /^([a-z_]+): /.exec(error.message)
|
||||
if (!match) return null
|
||||
|
||||
Reference in new issue
Block a user