IF Commons GitHub

physical/world

Written to: 1 requirement: 0 proved, 0 partly, 0 failing, 1 with no test recorded. 0005-planning-surfaces FR-005

What the program works on (0037-planning FR-037, FR-045, plan.md Trust): the configuration file read, the store opened and the sources made from the configuration. planning.config.ts is TypeScript the program imports, so it runs with the permissions of the person who runs planctl: it is read only from the root of the repository the run started in and never from a path an argument or an item names; JSON or YAML beside it is not read; it holds no secret; and a configuration the person has not trusted is not run: a trust is a record in the repository's own .git of the SHA-256 of the file the person trusted, given by --trust of the command line and never by a call to the tool server.

import { loadConfig } from "./world.ts";
// const c = await loadConfig("/work/repo", { trust: false });

Source: commons/planning/src/physical/world.ts

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

physical.CONFIG_FILEconstno test imports it
const CONFIG_FILE: "planning.config.ts"

The name of the configuration file.

physical.LoadProblemtypeno test imports it
type LoadProblem = { readonly code: "E-CONFIG-LOAD" | "E-CONFIG-INVALID" | "E-TRUST"; readonly message: string };

Why the configuration could not be used.

physical.loadConfigfunctionno test imports it
function loadConfig(root: string, options: { readonly trust: boolean; }): Promise<Result<PlanningConfig, LoadProblem>>

The configuration of the repository at root, or why it is not used: absent, not trusted, not importable or not valid. trust records the file as trusted (the command line's --trust).

physical.Hosttypeno test imports it
type Host = { readonly cwd: string; readonly env: (name: string) => string | undefined; /** The wall time in milli… (478 characters)
type Host = {
  readonly cwd: string;
  readonly env: (name: string) => string | undefined;
  /** The wall time in milliseconds. */
  readonly now: () => number;
  /** The channel the run comes through: a person's command line or the tool server. */
  readonly channel: "cli" | "mcp";
  /** The client of a Git host for a repository: the live one reads its token from the environment; a test gives its own. */
  readonly githost?: (ref: RepoRef) => GitHostClient | undefined;
};

What a run is given from outside.

physical.policyOffunctionno test imports it
function policyOf(config: PlanningConfig): Policy

The policy a configuration says.

physical.openPlanningStorefunctionno test imports it
function openPlanningStore(root: string, config: PlanningConfig): Promise<Result<PlanningStoreBackend, string>>

The store of events of the repository, a folder, made where it is not.

physical.openSourcesfunctionno test imports it
function openSources(root: string, config: PlanningConfig, host: Host): Promise<Result<readonly Source[], string>>

The sources a configuration names, made over the repository at root.

physical.agentIdOffunctionno test imports it
function agentIdOf(env: (name: string) => string | undefined): string

The agent of an event of the tool server: its id from the environment, agent where there is none.

physical.personOfTextfunctionno test imports it
function personOfText(text: string | undefined): PersonActor | undefined

The person a text names, as id or id:Name.

CONFIG_FILEconstno test imports it
const CONFIG_FILE: "planning.config.ts"

The name of the configuration file.

LoadProblemtypeno test imports it
type LoadProblem = { readonly code: "E-CONFIG-LOAD" | "E-CONFIG-INVALID" | "E-TRUST"; readonly message: string };

Why the configuration could not be used.

loadConfigfunctionno test imports it
function loadConfig(root: string, options: { readonly trust: boolean; }): Promise<Result<PlanningConfig, LoadProblem>>

The configuration of the repository at root, or why it is not used: absent, not trusted, not importable or not valid. trust records the file as trusted (the command line's --trust).

Hosttypeno test imports it
type Host = { readonly cwd: string; readonly env: (name: string) => string | undefined; /** The wall time in milli… (478 characters)
type Host = {
  readonly cwd: string;
  readonly env: (name: string) => string | undefined;
  /** The wall time in milliseconds. */
  readonly now: () => number;
  /** The channel the run comes through: a person's command line or the tool server. */
  readonly channel: "cli" | "mcp";
  /** The client of a Git host for a repository: the live one reads its token from the environment; a test gives its own. */
  readonly githost?: (ref: RepoRef) => GitHostClient | undefined;
};

What a run is given from outside.

policyOffunctionno test imports it
function policyOf(config: PlanningConfig): Policy

The policy a configuration says.

openPlanningStorefunctionno test imports it
function openPlanningStore(root: string, config: PlanningConfig): Promise<Result<PlanningStoreBackend, string>>

The store of events of the repository, a folder, made where it is not.

openSourcesfunctionno test imports it
function openSources(root: string, config: PlanningConfig, host: Host): Promise<Result<readonly Source[], string>>

The sources a configuration names, made over the repository at root.

agentIdOffunctionno test imports it
function agentIdOf(env: (name: string) => string | undefined): string

The agent of an event of the tool server: its id from the environment, agent where there is none.

personOfTextfunctionno test imports it
function personOfText(text: string | undefined): PersonActor | undefined

The person a text names, as id or id:Name.

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