Hyperlinkv0.8.0-beta.28

Process

Process.processControlSpecconstsrc/Process.ts:1604
{
  status: Hyperlink.Marked<
    Hyperlink.Method<
      undefined,
      Schema.Struct<{
        readonly supervising: Schema.Boolean
        readonly armed: Schema.Boolean
        readonly activeInstances: Schema.Number
        readonly nextTriggerRun: Schema.optionalKey<Schema.DateTimeUtc>
        readonly nextScheduleTransition: Schema.optionalKey<Schema.DateTimeUtc>
        readonly nextPollCadence: Schema.optionalKey<Schema.Duration>
        readonly runsStarted: Schema.Number
        readonly runsSucceeded: Schema.Number
        readonly runsFailed: Schema.Number
        readonly lastRunStartedAt: Schema.optionalKey<Schema.DateTimeUtc>
        readonly lastRunDurationMillis: Schema.optionalKey<Schema.Number>
      }>,
      Schema.Never,
      true,
      Hyperlink.MethodAnnotations & { description: string },
      Hyperlink.Derive
    >,
    { readonly _tag: "ref" }
  >
  start: Hyperlink.Method<
    undefined,
    Schema.Void,
    Schema.Never,
    false,
    Hyperlink.MethodAnnotations & { description: string },
    Hyperlink.Derive
  >
  stop: Hyperlink.Method<
    undefined,
    Schema.Void,
    Schema.Never,
    false,
    Hyperlink.MethodAnnotations & {
      description: string
      destructive: true
    },
    Hyperlink.Derive
  >
  wake: Hyperlink.Method<
    undefined,
    Schema.Void,
    Schema.Never,
    false,
    Hyperlink.MethodAnnotations & { description: string },
    Hyperlink.Derive
  >
  resetCadence: Hyperlink.Method<
    undefined,
    Schema.Void,
    Schema.Never,
    false,
    Hyperlink.MethodAnnotations & { description: string },
    Hyperlink.Derive
  >
}

The base process control + observation contract — shared by every process. Mirrors the observable/controllable seams the engine supervisor exposes (ProcessSnapshot + lifecycle). A base process has no schedule mutation verbs: arm/disarm is done by mutating a schedule, so those verbs appear only when a process owns an inline schedule.

Source src/Process.ts:160429 lines
export const processControlSpec = {
  // ── live current state — one SubscriptionRef-backed source of truth ──
  // `status` is the whole snapshot; `status.get` reads it once, `status.changes` streams every
  // change (uniform local + remote), mirroring the queue's `status` ref.
  status: Hyperlink.ref(processStatus).annotate({
    description:
      "Live current-state snapshot: supervising, armed, active instances, next trigger/transition, " +
      "poll cadence, and cumulative run metrics.",
  }),

  // ── lifecycle commands ──
  start: Hyperlink.effect(Schema.Void).annotate({
    description: "Begin supervising — fork the trigger driver (idempotent).",
  }),
  stop: Hyperlink.effect(Schema.Void).annotate({
    description: "Stop supervising — interrupt the driver and any active run instances.",
    destructive: true,
  }),

  // ── cadence commands (no-ops while not supervising / no polling layer) ──
  wake: Hyperlink.effect(Schema.Void).annotate({
    description:
      "End the current polling wait immediately — the next tick runs now; cadence unchanged.",
  }),
  resetCadence: Hyperlink.effect(Schema.Void).annotate({
    description:
      "Reset the cadence preset to its initial state (backoff → initial, accelerating → slow) and wake.",
  }),
};
Referenced by 2 symbols