IF Commons GitHub

config

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-tool-command FR-001

What a fleet gives the plugin: the catalog of tools it needs, the dialects it chose with the way each is run and observed, the pins, the policy tools are resolved under, which computer this is and the folder the rendered files go in. The plugin holds none of it, so that two fleets with different tools and different dialects use the same plugin.

import type { ToolPluginConfig } from "./config.ts";
// a fleet builds a ToolPluginConfig in its composition root and passes it to toolPlugin

Source: commons/archon-tool/src/config.ts

1 of 2 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

ToolRuntimetypeno test imports it
type ToolRuntime = { /** How Toolchain reads it: its id, its manager, what it guarantees. */ readonly tool: ToolDial… (643 characters)
type ToolRuntime = {
  /** How Toolchain reads it: its id, its manager, what it guarantees. */
  readonly tool: ToolDialect;
  /** How Archon renders and steps it. */
  readonly dialect: Dialect;
  /** What is installed, as the desired state itself for a tool that is as asked and a state that differs for one that is not. */
  readonly observe: (requirements: readonly Requirement[]) => Promise<ReadonlyMap<RequirementId, JsonValue>>;
  /** Removes what can be got again; the lines say what was removed. A dialect with nothing to clean leaves it out. */
  readonly clean?: (o: { readonly programs: boolean }) => Promise<readonly string[]>;
};

A dialect the fleet chose, with what the plugin needs to resolve, carry out, observe and clean with it.

ToolPluginConfigtype
type ToolPluginConfig = { /** The version of the plugin as published. */ readonly version: string; /** The program… (1010 characters)
type ToolPluginConfig = {
  /** The version of the plugin as published. */
  readonly version: string;
  /** The program the plugin extends: `archon` by default; another command (a fleet's own) may use the same plugin. */
  readonly program?: string;
  readonly catalog: Catalog;
  readonly runtimes: readonly ToolRuntime[];
  /** The dialects, most preferred first. */
  readonly preference: readonly DialectId[];
  readonly pins: PinSource;
  /** The policy tools are resolved under (the platform, the control `toolIntegrity`, whether a copy on the path counts, whether source builds are approved). */
  readonly policy: Omit<Context, "preference" | "platform"> & { readonly platform: Platform };
  /** The name of this computer, as the fleet names it. */
  readonly subject: string;
  /** The assurance profile of the fleet. */
  readonly assurance: ProfileName;
  /** The folder the rendered files go in, under `.archon/<digest>/`, and the working folder of every step. */
  readonly workFolder: string;
};

What a fleet gives the plugin.

Imported by 5 tests of the run (5 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.