@openmixer/plugin-qualify 0.18.0 → 0.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +93 -3
  2. package/bin/plugin-qualify-sync.mjs +3 -1
  3. package/dist/clap-qualify.d.ts +3 -1
  4. package/dist/clap-qualify.js +3 -1
  5. package/dist/clap-qualify.js.map +1 -1
  6. package/dist/distributed-records.d.ts +4 -2
  7. package/dist/distributed-records.js +1 -1
  8. package/dist/distributed-records.js.map +1 -1
  9. package/dist/host-admission.d.ts +21 -0
  10. package/dist/host-admission.js +33 -3
  11. package/dist/host-admission.js.map +1 -1
  12. package/dist/hostd-pin-files.js +3 -1
  13. package/dist/hostd-pin-files.js.map +1 -1
  14. package/dist/index.d.ts +2 -0
  15. package/dist/index.js +2 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/measurement/format.d.ts +10 -0
  18. package/dist/measurement/format.js +8 -0
  19. package/dist/measurement/format.js.map +1 -1
  20. package/dist/measurement/probe-json.js +2 -1
  21. package/dist/measurement/probe-json.js.map +1 -1
  22. package/dist/probe-judge.d.ts +11 -0
  23. package/dist/probe-judge.js +6 -3
  24. package/dist/probe-judge.js.map +1 -1
  25. package/dist/probe-runner.js +3 -2
  26. package/dist/probe-runner.js.map +1 -1
  27. package/dist/qualification-record.d.ts +113 -8
  28. package/dist/qualification-record.js +18 -13
  29. package/dist/qualification-record.js.map +1 -1
  30. package/dist/qualify-adapter-pass.d.ts +67 -0
  31. package/dist/qualify-adapter-pass.js +255 -0
  32. package/dist/qualify-adapter-pass.js.map +1 -0
  33. package/dist/qualify-declarations.d.ts +30 -0
  34. package/dist/qualify-declarations.js +24 -1
  35. package/dist/qualify-declarations.js.map +1 -1
  36. package/dist/qualify-isolated.d.ts +70 -0
  37. package/dist/qualify-isolated.js +184 -0
  38. package/dist/qualify-isolated.js.map +1 -0
  39. package/dist/qualify-rejudge.d.ts +82 -0
  40. package/dist/qualify-rejudge.js +434 -0
  41. package/dist/qualify-rejudge.js.map +1 -0
  42. package/dist/qualify-sync.d.ts +97 -1
  43. package/dist/qualify-sync.js +276 -24
  44. package/dist/qualify-sync.js.map +1 -1
  45. package/fixtures/records-0.16.1/http___example.org_raffo@unversioned-2060c09ff626.default.probe.json +46 -0
  46. package/fixtures/records-0.16.1/http___example.org_raffo@unversioned-2060c09ff626.default.qualification.json +185 -0
  47. package/fixtures/records-0.16.1/http___lv2plug.in_plugins_eg-amp@unversioned-f046a60efd45.default.probe.json +51 -0
  48. package/fixtures/records-0.16.1/http___lv2plug.in_plugins_eg-amp@unversioned-f046a60efd45.default.qualification.json +232 -0
  49. package/fixtures/records-0.16.1/https___github.com_lucianodato_noise-repellent@unversioned-c3b5e21dd9a7.default.probe.json +51 -0
  50. package/fixtures/records-0.16.1/https___github.com_lucianodato_noise-repellent@unversioned-c3b5e21dd9a7.default.qualification.json +245 -0
  51. package/fixtures/records-0.16.1/in.lsp-plug.impulse_responses_mono@unversioned-d5235d2f5f53.custom.probe.json +52 -0
  52. package/fixtures/records-0.16.1/in.lsp-plug.impulse_responses_mono@unversioned-d5235d2f5f53.custom.qualification.json +145 -0
  53. package/fixtures/records-0.16.1/in.lsp-plug.trigger_midi_mono@unversioned-d5235d2f5f53.custom.probe.json +52 -0
  54. package/fixtures/records-0.16.1/in.lsp-plug.trigger_midi_mono@unversioned-d5235d2f5f53.custom.qualification.json +155 -0
  55. package/package.json +1 -1
  56. package/src/clap-qualify.ts +5 -1
  57. package/src/distributed-records.ts +1 -1
  58. package/src/host-admission.ts +40 -3
  59. package/src/hostd-pin-files.ts +3 -1
  60. package/src/index.ts +2 -0
  61. package/src/measurement/format.ts +17 -0
  62. package/src/measurement/probe-json.ts +2 -1
  63. package/src/probe-judge.ts +10 -3
  64. package/src/probe-runner.ts +2 -2
  65. package/src/qualification-record.ts +126 -15
  66. package/src/qualify-adapter-pass.ts +278 -0
  67. package/src/qualify-declarations.ts +26 -1
  68. package/src/qualify-isolated.ts +201 -0
  69. package/src/qualify-rejudge.ts +466 -0
  70. package/src/qualify-sync.ts +295 -24
  71. package/tools/isolated-step.mjs +122 -0
  72. package/tools/lv2_resolve.py +49 -0
  73. package/tools/mod-host-admit.mjs +99 -7
@@ -1,7 +1,10 @@
1
1
  import { type HostProfile } from "./host-profiles.js";
2
2
  import { type PinEntry } from "./pins-file.js";
3
3
  import { type PinFilesRun } from "./hostd-pin-files.js";
4
+ import { type ProbeRun } from "./probe-runner.js";
4
5
  import { type GridSpec } from "./measurement-grid.js";
6
+ import { type AdapterPassOptions } from "./qualify-adapter-pass.js";
7
+ import { type IsolatedRunner } from "./qualify-isolated.js";
5
8
  import { type MemoryBound } from "./memory-bound.js";
6
9
  import { type NotMeasured } from "./qualification-record.js";
7
10
  /** The settings file a system service reads, `key value` per line. */
@@ -32,6 +35,8 @@ export interface SyncSettings {
32
35
  readonly cellsPerPluginBudget: number;
33
36
  /** The memory bound of every run; `undefined` is `off`. */
34
37
  readonly memory?: MemoryBound;
38
+ /** The notes an instrument with no declared capacity holds in a memory-only run. */
39
+ readonly memoryNotes: number;
35
40
  readonly hostdPort: number;
36
41
  readonly hostdFeedbackPort: number;
37
42
  readonly settleS: number;
@@ -57,6 +62,14 @@ export interface SyncArgs {
57
62
  readonly noWait: boolean;
58
63
  /** `--refresh-pins`: refresh the pins' files from plugin-hostd and measure nothing (the package's upgrade runs it). */
59
64
  readonly refreshPins: boolean;
65
+ /** `--rejudge`: the verdicts, tiers and pins derived again from the records' figures, measuring nothing. */
66
+ readonly rejudge: boolean;
67
+ /** `--memory-only`: the footprint of each recorded plugin at the Pi's cells, merged into its record. */
68
+ readonly memoryOnly: boolean;
69
+ /** `--adapter-only`: the run of each LV2 plugin under the adapter at the Pi's cells, merged into its record. */
70
+ readonly adapterOnly: boolean;
71
+ /** `--isolated-only`: the missing isolated step of each record already judged, extending its run. */
72
+ readonly isolatedOnly: boolean;
60
73
  readonly help: boolean;
61
74
  /** The settings given as flags, by key. */
62
75
  readonly values: ReadonlyMap<string, string>;
@@ -89,15 +102,30 @@ export interface SyncItem {
89
102
  readonly files: readonly string[];
90
103
  /** The LV2 plugin's uri. */
91
104
  readonly uri?: string;
105
+ /** The LV2 plugin's binary as lilv loads it, an absolute path that may lie outside `root` (a complement's). */
106
+ readonly binary?: string;
92
107
  }
108
+ /** One LV2 plugin as lilv resolves it over the whole search path: the bundle its version rule takes, and its binary. */
109
+ export interface Lv2Resolved {
110
+ readonly uri: string;
111
+ readonly bundle: string;
112
+ readonly binary?: string | null;
113
+ }
114
+ /** The bundles lilv takes over `dirs`, or why it could not say. A stand-in in tests. */
115
+ export type Lv2Resolve = (dirs: readonly string[]) => readonly Lv2Resolved[] | {
116
+ readonly problem: string;
117
+ };
118
+ /** lilv itself, one world over the whole search path (tools/lv2_resolve.py), as every host built on it resolves (#199). */
119
+ export declare const LILV_RESOLVE: Lv2Resolve;
93
120
  /**
94
121
  * Every item on the search paths. A `.clap` is one item; an LV2 plugin is one item, found in the first bundle on the
95
122
  * LV2 directories that declares it, as plugin-hostd finds it. A directory that cannot be read is a problem named, and
96
123
  * the others are still walked.
97
124
  */
98
- export declare function discoverSyncItems(settings: Pick<SyncSettings, "lv2Dirs" | "clapDirs">): {
125
+ export declare function discoverSyncItems(settings: Pick<SyncSettings, "lv2Dirs" | "clapDirs">, lv2Resolve?: Lv2Resolve): {
99
126
  items: SyncItem[];
100
127
  problems: string[];
128
+ notes: string[];
101
129
  };
102
130
  /** One file of a set: its SHA-256, as plugin-hostd's `pin.h` digests it, and the stat it was taken at. */
103
131
  export interface FileDigest {
@@ -130,6 +158,13 @@ export declare const SYNC_CODE: {
130
158
  /** The probe runner wrote no document to judge. */
131
159
  readonly notMeasured: "qualify.sync.not-measured";
132
160
  };
161
+ /**
162
+ * Why a plugin is unmeasured because of the machine it ran on rather than what it is (#192): an EACCES, EPERM or
163
+ * ENOSPC the run hit, or a measurement that could not run or wrote no document. Such a plugin is measured again by
164
+ * the next run although its files are unchanged; a reason of the plugin's own (probe.limit.not-implemented, no such
165
+ * plugin, a crash) is not. `undefined` for every other outcome.
166
+ */
167
+ export declare function machineReason(p: Pick<SyncPlugin, "outcome" | "code" | "detail">): string | undefined;
133
168
  /** What the quick qualification never measures, stated in every record it writes. */
134
169
  export declare const QUICK_NOT_MEASURED: readonly NotMeasured[];
135
170
  export interface SyncPlugin {
@@ -168,12 +203,21 @@ export declare function recordedAsIs(item: SyncItem, entry: SyncEntry | undefine
168
203
  same: boolean;
169
204
  files?: FileDigest[];
170
205
  };
206
+ /**
207
+ * The entry of an LV2 plugin a host now loads from another bundle than it was qualified in, when its binary is the
208
+ * same bytes (#199): the entry with the new bundle and the new bundle's file digests, its verdicts and records kept.
209
+ * `undefined` when the item is not that case: not LV2, no entry, the same bundle, a binary that cannot be read, or one
210
+ * whose bytes differ from the recorded binary's (then it is measured again).
211
+ */
212
+ export declare function sameBinaryElsewhere(item: SyncItem, entry: SyncEntry | undefined): SyncEntry | undefined;
171
213
  export interface SyncContext {
172
214
  readonly settings: SyncSettings;
173
215
  readonly env: Readonly<Record<string, string | undefined>>;
174
216
  readonly log: (line: string) => void;
175
217
  /** The run of `plugin-hostd --pin-files`, a stand-in in tests. */
176
218
  readonly pinFilesRun?: PinFilesRun;
219
+ /** The isolated step, a stand-in in tests. */
220
+ readonly isolatedRunner?: IsolatedRunner;
177
221
  }
178
222
  /**
179
223
  * Every pin of the state with the files plugin-hostd collects for its plugin now, measured again by nothing
@@ -189,6 +233,16 @@ export declare function refreshPins(ctx: SyncContext, state: SyncState): {
189
233
  };
190
234
  /** One item qualified, whatever happens to it: an error of the sync's own while measuring it is its outcome, not the run's end. */
191
235
  export declare function qualifyItem(ctx: SyncContext, item: SyncItem, files: readonly FileDigest[]): SyncEntry;
236
+ /**
237
+ * The isolated steps the records of a state still owe, each extending its record's run. A plugin's pin follows its step, and
238
+ * a step that could not run stays owed: the next pass tries it again.
239
+ */
240
+ export declare function isolatedPass(ctx: SyncContext, state: SyncState): {
241
+ readonly state: SyncState;
242
+ readonly isolated: number;
243
+ readonly refused: number;
244
+ readonly notRun: number;
245
+ };
192
246
  /** The pin file's text: every whole pin of the state, the worse verdict kept for a uri pinned twice. */
193
247
  export declare function syncPinsText(state: SyncState): string;
194
248
  /** The pin lines of `after` that `before` does not hold as they are. */
@@ -241,6 +295,32 @@ export interface SyncSummary {
241
295
  readonly sent?: number;
242
296
  /** The pins whose files were refreshed from plugin-hostd without a measurement (plugin-qualify#239). */
243
297
  readonly refreshed?: number;
298
+ /** `--rejudge`: the records whose verdicts changed, the ones that stood, and the ones that owe a measurement. */
299
+ readonly rejudge?: {
300
+ readonly changed: number;
301
+ readonly unchanged: number;
302
+ readonly owing: number;
303
+ };
304
+ /** `--memory-only`: the plugins measured, those whose footprints were already merged, and those no run could read. */
305
+ readonly memoryOnly?: {
306
+ readonly measured: number;
307
+ readonly already: number;
308
+ readonly failed: number;
309
+ };
310
+ /** Every plugin the run measured was unmeasured for this one reason of the machine ({@link machineReason}): the run failed. */
311
+ readonly machineFailure?: string;
312
+ /** `--isolated-only`: how the steps ended. */
313
+ readonly isolatedOnly?: {
314
+ readonly isolated: number;
315
+ readonly refused: number;
316
+ readonly notRun: number;
317
+ };
318
+ /** `--adapter-only`: the plugins run, those done already at these host versions, and those whose host could not be run. */
319
+ readonly adapterOnly?: {
320
+ readonly measured: number;
321
+ readonly already: number;
322
+ readonly failed: number;
323
+ };
244
324
  }
245
325
  /**
246
326
  * Why a reader that is not the sync's user (the console, #221) cannot read the descriptors: the directory or one of its
@@ -263,8 +343,24 @@ export interface SyncRunOptions {
263
343
  readonly force?: boolean;
264
344
  /** `--refresh-pins`: only refresh the pins' files from plugin-hostd and send the changed ones; measure nothing. */
265
345
  readonly refreshOnly?: boolean;
346
+ /** `--rejudge`: derive the verdicts again from the records' figures; measure nothing. */
347
+ readonly rejudge?: boolean;
348
+ /** `--memory-only`: take only the footprints; `force` takes those already merged again. */
349
+ readonly memoryOnly?: boolean;
350
+ /** The isolated step, a stand-in in tests. */
351
+ readonly isolatedRunner?: IsolatedRunner;
352
+ /** `--isolated-only`: take only the isolated steps records still owe. */
353
+ readonly isolatedOnly?: boolean;
354
+ /** `--adapter-only`: take only the adapter runs; `force` takes those already done again. */
355
+ readonly adapterOnly?: boolean;
356
+ /** Stand-ins for the pass's hosts, in tests. */
357
+ readonly adapterPass?: AdapterPassOptions;
266
358
  /** The run of `plugin-hostd --pin-files`, a stand-in in tests. */
267
359
  readonly pinFilesRun?: PinFilesRun;
360
+ /** The run of the probe runner in a memory-only pass, a stand-in in tests. */
361
+ readonly probeRun?: ProbeRun;
362
+ /** How LV2 plugins are resolved to the bundle a host loads: lilv itself unless a test stands in (#199). */
363
+ readonly lv2Resolve?: Lv2Resolve;
268
364
  /** False under `--no-wait`: a run in progress is not waited for; the holder runs once more at its end instead. */
269
365
  readonly wait?: boolean;
270
366
  readonly env?: Readonly<Record<string, string | undefined>>;