@amalgm/shell 0.1.164-main.41371688349 → 0.1.164-main.41373475406

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.
@@ -5,7 +5,7 @@
5
5
  * evidence emitted by different processes and machines.
6
6
  */
7
7
  export type FilesPrimitive = "register" | "upload" | "download" | "watch" | "detect" | "record" | "send" | "receive" | "apply";
8
- export type FilesStageStatus = "started" | "completed" | "failed" | "observed";
8
+ export type FilesStageStatus = "started" | "completed" | "deferred" | "failed" | "observed";
9
9
  export interface FilesStageEvidence {
10
10
  readonly primitive: FilesPrimitive;
11
11
  readonly stage: string;
@@ -35,7 +35,7 @@ export declare function serializeStages(stages: readonly FilesStageEvidence[]):
35
35
  * order it finished, its duration, and the counters that explain the
36
36
  * duration. A stage that fires repeatedly — a Watch ring during a long walk
37
37
  * — folds into one line carrying the run's count and totals, so the shape of
38
- * the journey stays visible instead of scrolling past. Failures keep their
39
- * place and say so.
38
+ * the journey stays visible instead of scrolling past. Failures and
39
+ * deferrals keep their place and say so.
40
40
  */
41
41
  export declare function renderStageLedger(stages: readonly Record<string, unknown>[], totalMs: number): string;
@@ -56,8 +56,8 @@ export function serializeStages(stages) {
56
56
  * order it finished, its duration, and the counters that explain the
57
57
  * duration. A stage that fires repeatedly — a Watch ring during a long walk
58
58
  * — folds into one line carrying the run's count and totals, so the shape of
59
- * the journey stays visible instead of scrolling past. Failures keep their
60
- * place and say so.
59
+ * the journey stays visible instead of scrolling past. Failures and
60
+ * deferrals keep their place and say so.
61
61
  */
62
62
  export function renderStageLedger(stages, totalMs) {
63
63
  const rows = [];
@@ -71,9 +71,9 @@ export function renderStageLedger(stages, totalMs) {
71
71
  : `${primitive}/${String(stage.stage ?? "")}`;
72
72
  const durationMs = typeof stage.durationMs === "number" ? stage.durationMs : null;
73
73
  const measurements = (stage.measurements ?? {});
74
- const failed = status === "failed";
74
+ const said = status === "failed" ? " FAILED" : status === "deferred" ? " DEFERRED" : "";
75
75
  const previous = rows[rows.length - 1];
76
- if (previous && previous.label === label && previous.failed === failed) {
76
+ if (previous && previous.label === label && previous.said === said) {
77
77
  previous.occurrences += 1;
78
78
  previous.durationMs = previous.durationMs === null && durationMs === null
79
79
  ? null
@@ -81,7 +81,7 @@ export function renderStageLedger(stages, totalMs) {
81
81
  previous.measurements = foldMeasurements(previous.measurements, measurements);
82
82
  continue;
83
83
  }
84
- rows.push({ label, occurrences: 1, durationMs, failed, measurements: { ...measurements } });
84
+ rows.push({ label, occurrences: 1, durationMs, said, measurements: { ...measurements } });
85
85
  }
86
86
  const labels = rows.map((row) => row.occurrences > 1 ? `${row.label} ×${row.occurrences}` : row.label);
87
87
  const width = labels.reduce((widest, label) => Math.max(widest, label.length), 0);
@@ -91,7 +91,7 @@ export function renderStageLedger(stages, totalMs) {
91
91
  .map(([key, value]) => `${key}=${formatMeasurement(key, value)}`)
92
92
  .join(" ");
93
93
  return ` ${labels[index].padEnd(width)} ${duration.padStart(10)}`
94
- + `${row.failed ? " FAILED" : ""}${counters ? ` ${counters}` : ""}`;
94
+ + `${row.said}${counters ? ` ${counters}` : ""}`;
95
95
  });
96
96
  return [
97
97
  ...lines,
@@ -1 +1 @@
1
- {"version":3,"file":"files-trace.js","sourceRoot":"","sources":["../src/files-trace.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,OAAO,kBAAkB;IAGA;IAFZ,SAAS,GAAG,IAAI,GAAG,EAAwB,CAAC;IAE7D,YAA6B,IAAyB;QAAzB,SAAI,GAAJ,IAAI,CAAqB;IAAG,CAAC;IAE1D;;;;;OAKG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,CAAC;IAC5D,CAAC;IAED,6EAA6E;IACpE,OAAO,GAAuB,CAAC,QAAQ,EAAE,EAAE;QAClD,IAAI,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,CAAC;QAC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AAC;AACvB,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,IAAI,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,IAAI;QAAE,OAAO,GAAG,CAAC,KAAK,GAAG,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;IACzF,IAAI,KAAK,IAAI,IAAI,GAAG,IAAI;QAAE,OAAO,GAAG,CAAC,KAAK,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3E,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3D,OAAO,GAAG,KAAK,GAAG,CAAC;AACrB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ export { FileWorkspaceStore } from "./workspace-store.js";
11
11
  export { WireClient, WireRequestError } from "./wire-client.js";
12
12
  export type { WireClientOptions } from "./wire-client.js";
13
13
  export { GroundNotConverged, UserGroundHost } from "./user-ground-host.js";
14
- export type { DetectScanEvidence, InstallStage, UserGroundCatchUp, UserGroundClosed, UserGroundHostOptions, } from "./user-ground-host.js";
14
+ export type { DetectScanDeferral, DetectScanEvidence, InstallStage, UserGroundCatchUp, UserGroundClosed, UserGroundHostOptions, } from "./user-ground-host.js";
15
15
  export { NodeWatchHost } from "./watching/index.js";
16
16
  export type { NativeWatchHandle, NodeWatchHostOptions, OpenNativeWatch, WatchGround, WatchCoverageEvidence, WatchHealth, WatchObservation, WatchCloseOptions, } from "./watching/index.js";
17
17
  export { MachineHost, defaultMachineName } from "./machine-host.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc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E,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAS3E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAWpD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAYpE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -28,8 +28,28 @@ export interface DetectDiscoveryEvidence {
28
28
  readonly found: number;
29
29
  readonly stats?: DiscoveryStats;
30
30
  }
31
+ /** Why a scan gave way with nothing of it standing, in its branch's own word.
32
+ * Never error text: what a scan decided is read from this, not parsed. */
33
+ export type DetectScanDeferral =
34
+ /** What it read moved; a later read answers again. */
35
+ "moved"
36
+ /** An unfinished Apply owns this ground; it is read when that Apply ends. */
37
+ | "apply-attribution"
38
+ /** The root stands off the device it was bound on; its ground ringing asks again. */
39
+ | "root-off-device"
40
+ /** A directory above hides the root; access returning is heard. */
41
+ | "root-unreachable"
42
+ /** Not a retry: a named read cannot cover a re-created root, so a complete
43
+ * examination of it must still arrive. */
44
+ | "root-recreated-owes-complete"
45
+ /** An identity crossed this scan's scope, so its result stands nowhere and
46
+ * the root's examination goes wider. */
47
+ | "identity-crossed";
31
48
  export interface DetectScanEvidence {
32
- readonly outcome: "observed" | "failed";
49
+ /** `deferred` says `reason`, and a later scan answers for this one. Only a
50
+ * scan that threw is `failed`. */
51
+ readonly outcome: "observed" | "deferred" | "failed";
52
+ readonly reason?: DetectScanDeferral;
33
53
  readonly error?: string;
34
54
  readonly rootId: string;
35
55
  readonly directory: string;
@@ -511,12 +511,13 @@ export class UserGroundHost {
511
511
  this.stage({
512
512
  primitive: "detect",
513
513
  stage: "scan",
514
- status: evidence.outcome === "failed" ? "failed" : "completed",
514
+ status: evidence.outcome === "observed" ? "completed" : evidence.outcome,
515
515
  rootId: evidence.rootId,
516
516
  path: evidence.directory,
517
517
  durationMs: evidence.durationMs,
518
518
  measurements: {
519
519
  scope: evidence.scope,
520
+ ...(evidence.reason ? { reason: evidence.reason } : {}),
520
521
  ...(evidence.error ? { error: evidence.error } : {}),
521
522
  entries: evidence.entries,
522
523
  metadataReused: evidence.metadataReused,
@@ -6344,19 +6345,18 @@ async function reconcileGround(input) {
6344
6345
  };
6345
6346
  const started = performance.now();
6346
6347
  let settledHere = 0;
6347
- const report = async (proposals, failed = false, error) => {
6348
+ const report = async (proposals, decided = { outcome: "observed" }) => {
6348
6349
  if (!onScan)
6349
6350
  return;
6350
6351
  const durationMs = performance.now() - started;
6351
6352
  onScan({
6352
- ...(error ? { error: error instanceof Error ? error.message : String(error) } : {}),
6353
6353
  rootId,
6354
6354
  directory,
6355
6355
  scope: parameters.suspects === null || parameters.suspects === undefined
6356
6356
  ? "complete"
6357
6357
  : parameters.suspects.length === 0 ? "none" : "paths",
6358
6358
  ...counters,
6359
- outcome: failed ? "failed" : "observed",
6359
+ ...decided,
6360
6360
  durationMs,
6361
6361
  plannedRows: proposals.length,
6362
6362
  records: proposals.length,
@@ -6374,9 +6374,10 @@ async function reconcileGround(input) {
6374
6374
  });
6375
6375
  }
6376
6376
  catch (error) {
6377
- await report([], true, error);
6377
+ const deferred = (reason) => report([], { outcome: "deferred", reason });
6378
6378
  const movement = movementOf(error);
6379
6379
  if (error instanceof ApplyAttributionDeferred) {
6380
+ await deferred("apply-attribution");
6380
6381
  deferredCaptures.push({ directory, owners: error.owners });
6381
6382
  return { kind: "deferred", ...movement };
6382
6383
  }
@@ -6384,6 +6385,7 @@ async function reconcileGround(input) {
6384
6385
  // the domain's absence decisions do not wait on it; a root bound
6385
6386
  // beneath it is examined by its own walk, and other roots admit.
6386
6387
  if (input.units && error instanceof RootOffDevice) {
6388
+ await deferred("root-off-device");
6387
6389
  offDeviceRoots.set(parameters.rootPath, error.message);
6388
6390
  for (const [rootId, directory] of domainBindings) {
6389
6391
  if (directory === parameters.rootPath)
@@ -6394,24 +6396,28 @@ async function reconcileGround(input) {
6394
6396
  // Units: a root the walk could not look at is unread like one whose
6395
6397
  // binding the pass could not follow; the domain waits for it.
6396
6398
  if (error instanceof RootUnreachable) {
6399
+ await deferred("root-unreachable");
6397
6400
  unreachable.push(error.root);
6398
6401
  return undefined;
6399
6402
  }
6400
6403
  // Units: a re-created root owes its complete examination, and the
6401
6404
  // domain's absence decisions wait for it.
6402
6405
  if (input.units && error instanceof RootRecreated) {
6406
+ await deferred("root-recreated-owes-complete");
6403
6407
  promotions.set(parameters.rootPath, "root-recreated");
6404
6408
  return undefined;
6405
6409
  }
6406
6410
  // Units: this root's own evidence moved; other roots still admit.
6407
6411
  if (input.units && !isDetectCancelled(error) && moved(error)) {
6412
+ await deferred("moved");
6408
6413
  invalidatedRoots.push({ directory: parameters.rootPath, ...movement });
6409
6414
  return { kind: "deferred", ...movement };
6410
6415
  }
6416
+ await report([], { outcome: "failed", error: error instanceof Error ? error.message : String(error) });
6411
6417
  throw error;
6412
6418
  }
6413
6419
  if (result.kind !== "observed") {
6414
- await report([]);
6420
+ await report([], result.kind === "crossed" ? { outcome: "deferred", reason: "identity-crossed" } : undefined);
6415
6421
  return result.kind === "crossed" ? result : undefined;
6416
6422
  }
6417
6423
  roots.push({ rootUUID: rootId, directory, units: result.units });